Skip to content

feat(doctor): surface solution-acceptance deadlock checks (parity with validate)#308

Merged
LanNguyenSi merged 1 commit into
masterfrom
feat/doctor-solution-acceptance-checks
Jun 25, 2026
Merged

feat(doctor): surface solution-acceptance deadlock checks (parity with validate)#308
LanNguyenSi merged 1 commit into
masterfrom
feat/doctor-solution-acceptance-checks

Conversation

@LanNguyenSi

Copy link
Copy Markdown
Owner

What

harness doctor now surfaces the same two solution-acceptance deadlock misconfigurations that harness validate already flags, in its Policy Packs section:

Why

solution-acceptance is a pure consumer of the verdict marker the grounding-mcp producer writes. If grounding-mcp is not wired, no verdict can ever be written and every completion verb deadlocks on a permanent deny that looks protective. harness validate already caught this, but harness doctor was blind to it, so an operator who enabled the pack and forgot grounding-mcp got a silent deadlock with no doctor signal pointing at the root cause.

How

  • src/cli/validate/checks.ts: export checkSolutionAcceptanceProducer (was module-local). Export-only, no logic change.
  • src/cli/doctor/{types,index,format}.ts: add a solutionAcceptance: Diagnostic[] field to the Policy Packs section, populate it from the exported check in buildPolicyPacks, tally it truthfully in countDiagnostics (error to errorCount, warning to warningCount), and render it (✗ / ⚠) consistent with the section's existing style. The check is the single source of truth; no logic is duplicated and harness validate is unchanged.
  • docs/policy-packs/solution-acceptance.md: correct the stale text that still described condition docs: initial README + docs/VISION.md #1 as warning-tier and claimed harness does not project the tools.mcp env into the hook (that is now done at apply time by buildExpectedFiles). The docs now match the code: condition docs: initial README + docs/VISION.md #1 is an error in both validate and doctor, condition docs: ARCHITECTURE.md — YAML manifest schema + CLI surface #2 a warning, an absolute override is handled silently.

Tests / verification

  • New doctor tests cover error / warning / silent paths. The warning-path test asserts a +1 warningCount delta against an absolute-dir baseline (a bare >= 1 was inert because the minimal fixture independently emits a memory-router warning). Mutation-verified: no-op'ing the warning tally turns the test red. All five new doctor() calls pass homeOverride so the memory and rogue-ledger probes never read the operator's real ~/.harness.
  • Also tightened two pre-existing versionProbe test annotations to readonly string[] (the probe param is readonly; CI tsc excludes tests so the LSP-only mismatch was latent).
  • tsc clean; full vitest 2473 passed / 1 skipped; integration 1 passed; ug-schema-drift OK.

Review

Independent reviewer subagent (with a real mutation pass): APPROVE, no high or critical findings. The medium finding (warning-tally not mutation-killed) and the low finding (non-hermetic home) are both addressed in this branch.

Refs: discovery-2026-06-24/harness-doctor-solution-acceptance (08ccfe87)

…h validate)

`harness validate` already flags the two solution-acceptance
misconfigurations that turn the completion-gate into a permanent deny
(grounding-mcp absent from tools.mcp; a relative SOLUTION_VERDICT_DIR),
but `harness doctor` surfaced none of them, so an operator who enables
the pack and forgets grounding-mcp got a silent deadlock with no doctor
signal.

doctor now reports the same findings in its Policy Packs section,
reusing the (now exported) checkSolutionAcceptanceProducer as the single
source of truth: condition #1 as an error, condition #2 as a warning,
tallied truthfully into errorCount/warningCount. No check logic is
duplicated and `harness validate` is unchanged.

Also corrects docs/policy-packs/solution-acceptance.md, which still
described condition #1 as warning-tier and claimed harness does not
project the tools.mcp env into the hook (fixed by apply.ts
buildExpectedFiles). Adds doctor tests for the error/warning/silent
paths and a CHANGELOG [Unreleased] entry. Tightens two pre-existing
versionProbe test annotations to `readonly string[]` (the probe param is
readonly; CI tsc excludes tests so the LSP-only mismatch was latent).

Review-driven hardening: the warning-path test now asserts a +1
warningCount delta against an absolute-dir baseline (a bare `>= 1` was
inert because the fixture independently emits a memory-router warning;
mutation-verified red when the warning tally is dropped), and all five
new doctor() calls pass homeOverride so the memory / rogue-ledger probes
never read the operator's real ~/.harness.

Refs: discovery-2026-06-24/harness-doctor-solution-acceptance (08ccfe87)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@LanNguyenSi LanNguyenSi merged commit 6372be2 into master Jun 25, 2026
1 check passed
@LanNguyenSi LanNguyenSi deleted the feat/doctor-solution-acceptance-checks branch June 25, 2026 10:24
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.

2 participants