merge_autonomy_routine_sources' schema default is hand-copied into four shell fallbacks, and nothing pins the copies to the schema
Id: TD-PPagop-26082321 · Status: resolved · Filed: 2026-08-23 · Resolved: 2026-08-24 · Ref: https://github.com/Poetic-Poems/agent-ops/pull/738
config.schema.json declares merge_autonomy_routine_sources’s default as
["register-hygiene", "tech-debt"]. That literal is then written out again,
by hand, in four places:
lib/landing.sh’s_landing_routine_sourcesfallback;scripts/detect-classifier-escapes.sh’s_escape_audit_routine_sourcesfallback;scripts/doctor.sh, twice (// ["register-hygiene","tech-debt"]).
Nothing checks that the five agree. test/detect-classifier-escapes.test.sh
pins the first two against each other, which is the wrong pair: the two
consumers are not fed the same config. agent-cycle.sh calls lib/landing.sh
with $DEFAULTED_CONFIG, into which config_defaults has already written the
schema’s own default, so that fallback is never reached in production; the
detector is invoked with --config "$CONFIG_FILE" — the raw file, where the
key is absent — so its fallback is the one that decides. The pair that has to
agree is therefore the schema’s default and the detector’s literal, and
that relationship is untested.
Edit the schema default alone and the gate starts arming against the new list
while the post-hoc audit recomputes against the old one. Every landing in the
difference is reported as a classifier-escape that never happened — the
manufactured-escape failure mode requirement 8e exists to rule out, arriving
through the one channel its own test does not watch. scripts/doctor.sh’s two
copies fail the same way in the other direction: its “names a source this
repository never gathers” warning (agent-ops#554) would be judging against a
list the pipeline no longer uses.
The sibling key merge_autonomy_protected_paths had exactly this gap and it
is now closed: test/detect-classifier-escapes.test.sh asserts both shipped
fallbacks equal jq -c '.properties.merge_autonomy_protected_paths.default' config.schema.json. The same two assertions for the routine-sources default,
plus two for scripts/doctor.sh’s copies, would close this one.
The deeper fix is to stop hand-copying schema defaults into shell literals at
all — have the fallback read config.schema.json — but that costs each of
these call sites a file read on a path where they deliberately avoid one, and
scripts/doctor.sh must keep working against a config it has not defaulted.
Pinning is the cheap version and buys the same protection.
Noticed while reviewing PR #727 (agent-ops#724), which mirrored the existing routine-sources shape when it made the protected-path list configurable.