Skip to content

landing_eligible's unknown verdict always blames the changed-file list, even when the protected-paths list was the unevaluable part

Id: TD-PPagop-26082325 · Status: resolved · Filed: 2026-08-23 · Resolved: 2026-09-07 · Ref: https://github.com/Pullwright/agent-ops/pull/1229

landing_protected_paths_hit (lib/landing.sh) returns exit 2 for three distinct causes: bad arguments or a gh error, a changed-file listing that reached LANDING_PR_FILES_LIMIT, and — since TD-PPagop-26082320 — a merge_autonomy_protected_paths list _landing_is_protected cannot evaluate against a path at all. landing_eligible collapses all three into one string:

Terminal window
2)
printf 'unknown:could not establish %s#%s'\''s changed-file list' "$slug" "$number"

The verdict is right — unknown, never a pass — but the explanation is wrong for the third cause: the changed-file list was read perfectly well, and what could not be established was the operator’s own configured list. That string is the whole diagnostic an operator gets, and the one they get most of (agent-ops#718 held D18 arming shut for five days while the logs said only unknown:could not establish …'s changed-file list), so a malformed merge_autonomy_protected_paths override would send whoever debugs it to gh, pagination and the --method GET gotcha rather than to their own config.json.

The deliberate twin does better: scripts/detect-classifier-escapes.sh names its own reason exactly (the protected-path list could not be evaluated against the merge's changed files (a non-string entry in merge_autonomy_protected_paths)). The two implementations are pinned identical on the verdict by test/detect-classifier-escapes.test.sh, and nothing pins — or now matches — the explanation.

Not a correctness gap. Every call site treats exit 2 as a refusal whatever caused it, and the malformed-list case is unreachable through a schema-validated config.json (config.schema.json constrains every entry to a non-empty string); scripts/detect-classifier-escapes.sh’s own --config read is the one ungated path, and that script already explains itself properly. This is a diagnosability defect only.

Suggested fix. Give landing_protected_paths_hit a way to say which cause it hit — a fourth exit code, or a reason on stderr the caller can carry — and have landing_eligible print the matching unknown: reason, the way the detector already does. Requirement 8d (and acceptance check 8t, which pins the current wording) in docs/IMPLEMENTATION-PIPELINE-SPEC.md move with it, as does test/landing.test.sh’s pinned unknown:could not establish acme/widgets#12's changed-file list assertion.

Noticed while reviewing PR #733 (TD-PPagop-26082320), which introduced the third cause.

Migrated to https://github.com/Poetic-Poems/agent-ops/issues/961.