PR #2080 — Doctor checks config.json and policy.json without a JSON Schema library
PR #2080 — Doctor checks config.json and policy.json without a JSON Schema library
The Broader Goal at the End of the Previous PR
v0.24.0 still needs dispatch, review, and local config to fail in the open
instead of drifting quietly. #2074 made a missing GOVERNS link visible on
stdout and in sentinel.md while #1990's hard-fail is still unbuilt. The
three-lens follow-ups plan then split the next config-trust work into four
independent tasks. This PR is Task C, issue #2065.
Strategic Shifts in This PR (if any)
No strategy change. pyproject.toml still declares dependencies=[], so
this does not add jsonschema. The checker covers the small known key set
(wrong type, missing required key, bad enum), not $ref or a full recursive
schema. That matches the design's P1-1 scope note.
What This PR Shipped
synlynk/config_schema.pyexportsvalidate(),CONFIG_SCHEMA, andPOLICY_SCHEMA.validate()returns a list of human-readable errors. Config requiresschema_version(int),budget(object withlimit_usdandlimit_requests),harness_billing(object), andworkspace_id(string).identity_slug,local_fallback, andlocal_auto_thresholdstay optional. Policy requiresschema_versionandrepo_id, and checkscapability_policy.modeagainstempiricalandheuristic.synlynk doctorregisters_hc_config_schemaand_hc_policy_schemaimmediately after_hc_identity_slug. A missing file warns. A parse error or schema error fails and names the field. A matching file is ok.- The live repo config (
schema_version,budget,harness_billing,workspace_id) and policy (mode: empirical) both pass. A config that drops a required top-level field, or setsbudgetto a non-object, fails validation, sosynlynk doctorno longer reports that file as OK. - Tests:
tests/test_config_schema.py(5) andtests/test_doctor_config_schema.py(2).
Plan: docs/superpowers/plans/2026-10-06-three-lens-followups-plan.md Task C.
Design: docs/superpowers/specs/2026-10-06-three-lens-followups-design.md.
Brainstorm Visuals Used
None. This follows the committed design and plan.
What This Achieved on the Path to Autonomy
A bad config.json or policy.json now shows up in synlynk doctor before
dispatch reads the wrong type or an illegal capability mode. The fleet still
has no third-party schema dependency.
Strategic Note: The Goal at the End of This PR
The other three-lens follow-ups remain independent: sample-size-gated empirical routing (#2063), durable routing-fallback logs (#2064), and the cross-adapter conformance suite (#2062). #1990's GOVERNS hard-fail is still the next enforcement step for the warning #2074 shipped.