Repository navigation
fix(generator): validate watched_workflows and branches as string lists - #1076
Conversation
tend-agent
left a comment
There was a problem hiding this comment.
One gap left in the same class of failure this PR closes: branches: [] is a list of non-empty strings (vacuously), so the new check accepts it, and it renders straight through as branches: [] in the workflow_run: trigger — which matches no branch, so ci-fix never fires. That is the same silent-never-fires symptom the PR calls out as the one that matters most, and the check three lines below already rejects the symmetric watched_workflows: [] for exactly this reason.
Reproduced on this branch — watched_workflows: ["ci"] plus branches: [] loads without error and renders:
on:
workflow_run:
workflows: ["ci"]
types: [completed]
branches: []Suggestion inline. Everything else checks out: the new validation matches the shape the other list fields use, the ordering leaves the existing watched_workflows: [] check reachable (an empty list clears the new all(...)), and hoisting branches out of the WorkflowConfig(...) call is behavior-preserving. Full suite is green here (731 passed), as is CI on this head.
An empty branches list passes the new list-of-non-empty-strings check vacuously and renders as `branches: []` in the workflow_run trigger, which matches no branch — the same silent-never-fires symptom as the scalar case, and what the neighbouring watched_workflows: [] guard already rejects.
Automated nightly regeneration of tend's workflow files. **tend version:** 0.1.20 → 0.1.22 ## Notable changes - **Notifications now run off a recovery queue** (max-sixty/tend#1074). The pre-check drops the old layered inbox sweep (shadowed-run and closed-bot-PR marking) in favour of a single paginated snapshot taken before a 10-minute cutoff, passes that cutoff through to the agent, and keeps repository watching enabled with an idempotent `PUT .../subscription` on every cycle. The job also gains a serial `tend-notifications` concurrency group. - **`tend-review` re-targets instead of skipping** (max-sixty/tend#1082). The "skip when the live HEAD is already examined" gate step and its `if:` guards are gone; a live session now re-targets when HEAD moves. The concurrency group adds `queue: max` so a push can't evict a pending `ready_for_review` run. - **Skills check the default branch for a landed fix before opening a PR** (max-sixty/tend#1070), and `review-runs` gains the run census as a second stranded-trigger drain input (max-sixty/tend#1073). - **Poll/rerun script fixes** (max-sixty/tend#1053, max-sixty/tend#1055): `tend-review` no longer gates the CI poll, and an unresolvable commit fails fast rather than passing silently. - **Generator fixes**: `watched_workflows` and `branches` are validated as string lists (max-sixty/tend#1076), and block prompts no longer get padded blank lines (max-sixty/tend#1090). Full upstream diff: max-sixty/tend@0.1.20...0.1.22 Co-authored-by: worktrunk-bot <[email protected]>
Automated nightly regeneration of tend's workflow files. **tend version:** 0.1.20 → 0.1.22 **Notable changes** - Notifications recover work missed while the unread queue was stale, and the job now runs under its own `tend-notifications` concurrency group so overlapping schedules serialize instead of racing (max-sixty/tend#1074). - Skills check the default branch for a landed fix before opening a PR, cutting duplicate PRs for work that already merged (max-sixty/tend#1070). - `review-runs` gains the run census as a second stranded-trigger drain input (max-sixty/tend#1073), and reviews re-target when HEAD moves rather than being discarded (max-sixty/tend#1082). - The CI poll no longer lets `tend-review` gate it, and the commit-resolution script fails fast instead of proceeding on an unresolved SHA (max-sixty/tend#1053, max-sixty/tend#1055). - The generator validates `watched_workflows` and `branches` as string lists, and stops padding blank lines inside block prompts (max-sixty/tend#1076, max-sixty/tend#1090). max-sixty/tend@0.1.20...0.1.22 **Beyond the regeneration:** 0.1.22's `tend-review.yaml` sets `concurrency.queue: max`, which GitHub accepts but the pinned `actionlint` hook rejects, so this PR also adds a scoped `-ignore` for that one schema message to `.pre-commit-config.yaml` — otherwise `lint` is red and the PR can't merge on its own CI. Tracked upstream as max-sixty/tend#1094. --------- Co-authored-by: leaf-agent <[email protected]>
workflows.<name>.watched_workflowsandworkflows.<name>.brancheswere the only list-typed config fields with no type validation — every other one (protected_branches,sandbox_path,sandbox_setup,secrets.allowed) checksisinstance(..., list)and rejects non-string elements. Both render straight into the generatedworkflow_run:trigger throughtojson, so an unchecked value reached the adopter's workflow file verbatim. This adds the same check both fields were missing, plus regression tests.Four concrete failures, all reproduced before the fix:
watched_workflows: ciworkflows: "ci"— matches no workflow, soci-fixsilently never firesClickExceptionatinitwatched_workflows: 5TypeError: object of type 'int' has no len()— a bare traceback out oftend initClickExceptionatinitwatched_workflows: {a: b}ClickExceptionatinitbranches: []branches: []— a trigger that matches no branchClickExceptionatinitThe scalar case is the one that matters most: it is the natural typo, it passes
actionlint, and the only symptom is thattend-ci-fixnever runs. Per CLAUDE.md, a config problem should "fail with a clear error, not silently parse".Verification
The scalar render, reproduced against
mainbefore the change:actionlint 1.7.12(the rev pinned in.pre-commit-config.yaml) accepts that file with exit 0, so nothing downstream catches it.The eight new parametrized cases: 7 fail on
main, all 8 pass with the fix.test_branches_explicit_valueis the positive control — it passes both ways, confirming a valid list still reaches the trigger. Full suite: 731 passed.ruff format --diffandruff checkclean.