Repository navigation
fix(config): reject non-mapping secrets and workflows with a config error - #1738
Conversation
…rror A list or scalar under secrets: or workflows: crashed Config.load with an AttributeError traceback instead of naming the key, unlike codex: and checks:. Also drop MergePolicy.bot_can_merge, which nothing reads, and a comment left behind by a removed regex.
|
@tend-agent The new type checks run after
|
…aulting
`or {}` ran before the type check, so `workflows: false`, `secrets: []`
and `checks: false` silently loaded the defaults. Only an absent or null
section now defaults to {}; anything else must be a mapping.
|
Fixed in f39b8db: |
There was a problem hiding this comment.
setup: has the same falsey hole the PR closes for the mapping sections: raw.get("setup", []) or [] turns setup: false or setup: {} into no steps without a word. It's a list, so _mapping_section can't cover it. I'm noting it here and leaving it out of this PR, since a list helper is a separate change.
codex: keeps its own stricter check, which rejects an empty codex:. test_invalid_codex_refresh_config_is_refused covers that case (null) on purpose, so this PR is right to leave it alone.
`.config/tend.yaml` now fails with `setup must be a list of steps` when
`setup:` holds anything other than a list. Before, `setup: false`,
`setup: {}` or `setup: ''` silently loaded as no setup steps, and a
non-empty mapping or string (`setup: {run: make}`, `setup: make`) was
iterated by key or character and failed with the misleading `setup[0]
must be a mapping with uses or run`. An absent, empty (`setup:`) or `[]`
setup still means no steps.
This is the list-shaped counterpart of #1738, which closed the same `or
{}` hole for `secrets`, `workflows` and `checks`; that PR's review noted
`setup:` and left it out. New cases in `test_config_edge_cases.py` cover
all five rejected shapes plus the two accepted empty ones. The rejected
cases fail on main, and the generator suite passes locally, apart from
the two network-bound `test_refresh_consumers.py` tests that can't
resolve DNS in the sandbox.
Co-authored-by: tend-agent <[email protected]>
Pins PR #1738 at the head whose review recorded 'no findings' while the new type checks ran after `or {}` defaulted falsey values.
… bare 'no findings' (#1741) The review skill's check before submitting accepted "no findings" as the second pass's result. Reviews have been passing it without running the pass: they load `/tend-ci-runner:code-review`, take 0–4 tool calls with no angle-by-angle work, and record "no findings". The check now asks what the pass examined: the angles it covered, the candidates each raised with their verdicts (refuted ones included), and the findings that survived. A bare "no findings" no longer counts as running the pass. `code-review` already covers the defects these reviews missed. Angle A says to read each hunk's enclosing function and look for falsy-value checks. Angle C traces how changed code is called and what inputs it can see. Its Output section already tells the caller to report how the pass ran. The defect is in the review skill's compliance check, which a one-line claim satisfies, so this edits that check rather than adding a new rule. Validation: unvalidated by model evals so far. `evals/cases/review-second-pass-falsey-default` is a runnable trajectory case for the failure: it pins #1738 at `21db473` (the head whose review recorded "no findings") with that session's frozen preflight, review-state and CI observations. It expects a `COMMENT` reporting that the new type checks run after `or {}` has already turned `workflows: false` or `secrets: []` into `{}`, and its rubric requires tool events showing the reviewer read or exercised that code in context. `prepare.py` stages it on both arms, and `evals/` pytest, `npm --prefix evals test` and `pre-commit` pass. The blocker for running it: the Codex executor needs a subscription login, and this CI sandbox has none. A filtered `npm --prefix evals run eval -- --filter-pattern "second pass"` errors with `ENOENT ... /home/tend-sandbox/.codex/auth.json`. The Claude harness excludes trajectory cases. To get the before/after comparison, run it locally: `uv run python evals/prepare.py && npm --prefix evals run eval -- --filter-pattern "second pass"`. <details><summary>Evidence from this window's session logs</summary> Tool calls each review session made between loading `code-review` and its next step, from the JSONL logs: | Run | PR | Calls | Outcome | |---|---|---|---| | 45562114460 | #1738 at 21db473 | 0 | "The second review pass found nothing new". `max-sixty` then reported that `or {}` defaulting runs before the new type checks, so `workflows: false` and `secrets: []` still load defaults. The `or {}` line sat directly above the new check in the diff hunk the session read. | | 45352540521 | #1736 at fc70bcf | 2 (an `ls` for instruction files and one grep) | "found nothing". `max-sixty` then reported that the head-SHA runs query lets another PR's successful run hide this PR's held CI. | | 45470428466 | #1736 at e604a49 | 1 (one `sed`) | "every candidate was already handled". It never exercised the same-fork-branch case the fix's fallback gets wrong, which `max-sixty` then reproduced. | | 45473678051 | #1736 at 53ca32c | 4 | "Second pass done with no findings" | The earlier corrections on #1724 (44995176016: 2 calls) and #1730 (45126081051: 1 call) have the same shape. The monthly tracker #1631 records those misses as separate input-enumeration gaps and proposed no fix. This window's logs show they share a cause: the pass didn't run. None of these was a wrong outward action. Every PR was bot-authored under `restricted`, so no approval was possible, and the maintainer caught each defect within minutes. The same nominal pass on a human-authored PR would back an approval. </details> --------- Co-authored-by: tend-agent <[email protected]>
Config.loadcrashed with anAttributeErrortraceback whensecrets:orworkflows:in.config/tend.yamlheld a list or a truthy scalar (for examplesecrets: [allowed]orworkflows: [review]). A falsey non-mapping was worse:or {}turnedworkflows: false,secrets: []orchecks: falseinto the defaults without a word. All three sections now go through one_mapping_sectionhelper: an absent or empty (key:) section defaults to{}, and anything else that isn't a mapping raises<key> must be a mapping, whichtend initandtend checkprint as an ordinary error, the waycodex:already did.A parametrized regression test in
test_config_edge_cases.pycovers lists, scalars and falsey values for each key; the falsey cases failed before the fix.Two dead bits in the same file go with it:
MergePolicy.bot_can_merge, which nothing outside its own two test assertions reads, and a "POSIX-ish env var name" comment whose regex was removed earlier. No behaviour change from either.Found by the nightly survey of
generator/src/tend/config.py. The local generator suite passes apart from the twotest_refresh_consumers.pytests that need DNS.