Skip to content

feat(reviewer): surface merge-decision metrics (wire export_metrics_json)#327

Merged
ProtocolWarden merged 1 commit into
mainfrom
feat/surface-merge-decision-metrics
Jun 18, 2026
Merged

feat(reviewer): surface merge-decision metrics (wire export_metrics_json)#327
ProtocolWarden merged 1 commit into
mainfrom
feat/surface-merge-decision-metrics

Conversation

@ProtocolWarden

Copy link
Copy Markdown
Owner

Third (and final) observer-plane completion — and it corrects another false-positive.

Premise correction

The audit flagged MergeDecisionInstrumenter / DecisionMetricsCollector (#250) as "never instantiated." Not so — they're already wired: pr_review_watcher calls the module-level record_decision_outcome at 5 decision points → get_instrumenter()MergeDecisionInstrumenter records every real merge decision. (Like TeamExecutorRunner earlier, the per-repo audit missed the indirection.)

The actual gap

export_metrics_json / get_metrics_summary had no caller — the metrics were collected but never surfaced.

Completion

_export_decision_metrics(status_dir) writes get_instrumenter().export_metrics_json() to status_dir/merge_decision_metrics.json each poll cycle (alongside the heartbeat), best-effort so it can never break the review loop. The collected merge-decision metrics are now observable.

Ratchet

Pruned export_metrics_json from audit.d12_baselineD12 gate confirms 0.

Verified: 1 new test; reviewer suite 113 green (tests/ root + the dedicated #322 CI job); working-detector audit B2-env-only; doctor + D12 clean.

🤖 Generated with Claude Code

…son)

Investigation corrected the audit's premise: MergeDecisionInstrumenter /
DecisionMetricsCollector were flagged "never instantiated" but are ALREADY wired
— pr_review_watcher records every merge decision via the module-level
record_decision_outcome (→ get_instrumenter() → MergeDecisionInstrumenter). The
genuine gap was narrow: export_metrics_json / get_metrics_summary had no caller,
so the collected metrics were never observable.

_export_decision_metrics(status_dir) now writes
get_instrumenter().export_metrics_json() to status_dir/merge_decision_metrics.json
each poll cycle (alongside the heartbeat), best-effort so it can't break the
review loop. Prune export_metrics_json from audit.d12_baseline — the D12 gate
confirms 0.

1 new test; reviewer suite 113 green (tests/ root + #322 CI job); audit B2-env +
doctor + D12 clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@ProtocolWarden ProtocolWarden merged commit cdfbe7f into main Jun 18, 2026
18 of 20 checks passed
@ProtocolWarden ProtocolWarden deleted the feat/surface-merge-decision-metrics branch June 18, 2026 11:18
ProtocolWarden added a commit that referenced this pull request Jun 18, 2026
…omes (#328)

The incomplete-integration remediation campaign is complete (14 green-gated PRs).
Update the plan of record to reflect the operator correction (COMPLETE genuine
features, don't delete them) and record every outcome:

- the 3 adversarial corrections (cross-repo consumers, indirect dispatch,
  convention hooks) that caught the per-repo audit's blind spots;
- WIREs: DAGExecutor #10, SwitchBoard #21 (p95), PlatformManifest #83
  (visibility_scope fail-closed), and the OC observer plane — #325
  (FlakyTestReporter), #326 (coverage trend/alerts), #327 (merge-decision metrics);
- justified deletes of superseded duplicates (Custodian #47, DAGExecutor #11,
  SourceRegistry #14, TeamExecutor #12, CoreRunner #20); ContextLifecycle = KEEP;
- the d12_baseline ratchet pruning (D12 gate confirms 0 after each wire);
- the B2 root cause: content-less secret artifact (infra, not a code bug).

flip parse_visibility_scope to WIRE-done; remove the TeamExecutor RxP
false-positive. Backlog updated.

Co-authored-by: ProtocolWarden <ProtocolWarden@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant