Reporter — Operational Protocol
Protocol
1. DISCOVER
- Read inputs from the orchestrator dispatch context:
metrics_path: path toscanner-metrics.jsonwritten by the scanner.output_path: path where the final markdown health document must be written (always{ROOT}/output/parity-test-d-health-report.md).state_path: path topipeline-state.jsonfor status updates.run_id: current run identifier.root: resolved scope root.
- Verify
metrics_pathexists and is valid JSON. If the file does not exist: emitBLOCKEDwith message: "Scanner metrics not found at{metrics_path}. The scanner step may have failed." - Parse the metrics JSON. If JSON is malformed: emit
BLOCKEDwith message: "Scanner metrics at{metrics_path}are not valid JSON. Re-run the scanner step."
2. PROCESS
Render the markdown health document using the following template (populated from the parsed metrics):
# Code Health Report — parity-test-d
> Generated by the parity-test-d pipeline (Tier 1c — Antigravity CLI)
## Source
**Directory scanned:** `{metrics.scanned_directory}`
**Files scanned:** {metrics.file_count}
## High-Complexity Files
{If metrics.high_complexity is non-empty, for each entry render:}
- **`{entry.file}`** — complexity score {entry.complexity_score}: {entry.reason}
{If metrics.high_complexity is empty, render:}
- No high-complexity files detected.
## Missing Docstrings
{If metrics.missing_docstrings is non-empty, for each entry render:}
- **`{entry.file}`** — missing docstrings at: {entry.locations joined by ", "}
{If metrics.missing_docstrings is empty, render:}
- No missing docstrings detected.
## Long Functions
{If metrics.long_functions is non-empty, for each entry render:}
- **`{entry.file}`** — `{entry.function}`: {entry.line_count} lines
{If metrics.long_functions is empty, render:}
- No long functions detected.
Ensure:
## High-Complexity Filessection is present (even if empty with "No ... detected." sentinel).## Missing Docstringssection is present (same rule).## Long Functionssection is present (same rule).- No section is left entirely blank or contains placeholder text.
3. DELIVER
- Create the
{ROOT}/output/directory if it does not exist. - Write the rendered markdown to
output_pathusing theWritetool. - Update
pipeline-state.json:- Set
phases[1].status="completed". - Set
phases[1].outputs=[output_path]. - Set top-level
status="completed". - Set
completed_at= current ISO-8601 timestamp.
- Set
- Emit terminal status:
DONE— health document written successfully; all three required sections present.DONE_WITH_CONCERNS— document written but one or more sections had no data from metrics (note which and why).BLOCKED— metrics file missing or malformed; output not written.