Skip to content

fix(generator): preserve pre-check setup guards - #1106

Merged
max-sixty merged 4 commits into
mainfrom
codex/compose-setup-conditions
Aug 31, 2026
Merged

max-sixty merged 4 commits into
mainfrom
codex/compose-setup-conditions

Conversation

@max-sixty

@max-sixty max-sixty commented Aug 30, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • keep Tend's workflow pre-check on every generated setup step
  • combine an adopter's if: expression with that guard instead of replacing it
  • normalize whole-expression ${{ ... }} syntax, reject ambiguous non-string
    values, and fail clearly on mixed interpolation fragments

This extracts the useful setup-condition correction from #1088 without adding a second review gate.

Verification

  • uv run pytest generator/tests (589 passed)
  • wt test after merging current main (834 Python tests, 32 worker tests,
    TypeScript typecheck)
  • pre-commit run --all-files
  • independent design review

This was written by Codex on behalf of @max-sixty

@tend-agent tend-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One finding, on the new ${{ }} normalization in Config.load: the unwrap tests only the first three and last two characters, so a condition that starts with an interpolation and ends with one — but isn't a single wrapper — gets sliced through the middle.

Reproduced on this branch. With setup: - run: ./x.sh and if: "${{ runner.os == 'Linux' }} && ${{ github.event_name == 'push' }}", tend-notifications.yaml renders:

    if: (steps.check.outputs.count != '0' || github.event_name == 'workflow_dispatch') && (runner.os == 'Linux' }} && ${{ github.event_name == 'push')

init exits 0 and says nothing; GitHub rejects the expression when the workflow runs. The unwrapped mixed form has the same shape from the other side — if: "a || ${{ b }}" skips the strip entirely and carries a live ${{ into the parenthesized conjunct. Both were passed through untouched before this PR, so the mangling is new here.

Since these forms can't be composed with the guard, rejecting them at load is the cut-over CLAUDE.md asks for ("old formats should fail with a clear error, not silently parse"), and it matches what checks.py already does with "${{" in environment for a dynamically-named environment. Inline suggestion below; with it applied uv run pytest generator/tests is 585 passed and the mixed form fails init with a message naming the fix.

Comment thread generator/src/tend/config.py Resolved

@tend-agent tend-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mixed-interpolation case from the last review is fixed, and I re-verified it on this head: if: "${{ a }} && ${{ b }}" and if: "a || ${{ b }}" both fail init now, if: "${{ runner.os == 'Linux' }}" normalizes to the bare expression, and tend-notifications renders if: (steps.check.outputs.count != '0' || github.event_name == 'workflow_dispatch') && (runner.os == 'Linux') with the check step still ahead of every guarded step. uv run pytest generator/tests is 588 passed.

Two suggestions inline, plus two notes:

  • The "${{ }}" empty-wrapper branch (if must contain an expression) is the only one of the three new rejection paths with no test; the other two are parametrized.
  • _setup_yaml's replacement here is byte-for-byte the change #1088 also carries, so whichever lands second conflicts in workflows.py and test_generate.py. Worth dropping it from #1088 once this merges.

Comment thread generator/src/tend/config.py Resolved
Comment thread docs/tend.example.yaml Resolved
@max-sixty
max-sixty merged commit 158a04b into main Aug 31, 2026
7 checks passed
@max-sixty
max-sixty deleted the codex/compose-setup-conditions branch August 31, 2026 00:53
max-sixty pushed a commit to max-sixty/leaf that referenced this pull request Aug 31, 2026
Automated nightly regeneration of tend's workflow files.

**tend version:** 0.1.22 → 0.1.24

## Notable changes

- **Conflicted bot PRs are now repaired on the frequent poll**
(max-sixty/tend#1108). `tend-notifications` gains a `conflict_count`
boot gate: it runs a GraphQL scan for open bot PRs whose `mergeable` is
not `MERGEABLE`, skips ones already carrying a `tend-conflict-deferred`
marker for the current head, and boots the agent when either
notifications or conflicts are outstanding. This is the bulk of the
workflow-body diff.
- **A multi-line adopter prompt now survives generation**
(max-sixty/tend#1103). Block scalars gain explicit indentation
indicators — `prompt: |` becomes `prompt: |2`, likewise `sandbox_setup:`
— so a prompt or setup script whose first line is itself indented no
longer changes meaning. This repo's `sandbox_setup:` (the Playwright
headless-shell install) is regenerated under the new form.
- **Review gating tightened** (max-sixty/tend#1087, max-sixty/tend#1107,
max-sixty/tend#1080). `APPROVE` is gated on the author stating merge
readiness rather than on the draft flag alone; the posting preflight is
bound to the outward action; and the code-review pass becomes its own
step, gated at submit.
- **`uv` is provisioned for agent sessions** (max-sixty/tend#1109), and
pre-check setup guards are preserved through regeneration
(max-sixty/tend#1106).
- Experimental Gist-backed Claude memory (max-sixty/tend#1110) — off
unless configured.

Full upstream range:
max-sixty/tend@0.1.22...0.1.24

## Also in this PR

`tend init` now writes `.github/actionlint.yaml` — a `concurrency.queue`
ignore scoped by glob to `**/.github/workflows/tend-*.yaml`. This repo
carried the same accommodation as a blanket `-ignore` arg on the
actionlint pre-commit hook, which suppressed that schema error
everywhere, including in workflows this repo owns. The generated file
replaces it, so the false positive stays ignored on the generated
workflows and a real one in `ci.yaml` or `publish-site.yaml` now fails.

Verified by running `pre-commit run actionlint --all-files` in the
regeneration worktree with the blanket arg removed and the generated
config in place: passed.

---------

Co-authored-by: leaf-agent <[email protected]>
max-sixty pushed a commit to max-sixty/worktrunk that referenced this pull request Aug 31, 2026
Nightly regeneration of tend's workflow files, picking up two upstream
releases.

**tend version:** 0.1.22 → 0.1.24

### Notable changes

- **The frequent poll now repairs conflicted bot PRs**, not just unread
notifications — the `tend-notifications` boot gate gained a GraphQL
query that test-merges open bot PRs and looks for deferral markers in
recent comments, so a conflicted PR wakes the queue instead of waiting
for the nightly sweep
([max-sixty/tend#1108](max-sixty/tend#1108)).
- **Review gating tightened**: `APPROVE` is now conditioned on the
author stating merge readiness rather than the draft flag alone, the
posting preflight is bound to the outward action, and the code-review
pass became its own step gated at submit
([max-sixty/tend#1087](max-sixty/tend#1087),
[max-sixty/tend#1107](max-sixty/tend#1107),
[max-sixty/tend#1080](max-sixty/tend#1080)).
- **Generator fixes that change this repo's YAML**: an adopter's
`prompt:` may now span more than one line (the `|2` block-indent markers
in the diff), pre-check setup guards are preserved, and the
`concurrency.queue` actionlint ignore is written out
([max-sixty/tend#1103](max-sixty/tend#1103),
[max-sixty/tend#1106](max-sixty/tend#1106),
[max-sixty/tend#1095](max-sixty/tend#1095)).
- **`uv` is provisioned for agent sessions**, and Gist-backed Claude
memory ships as experimental
([max-sixty/tend#1109](max-sixty/tend#1109),
[max-sixty/tend#1110](max-sixty/tend#1110)).
- Pinned harness versions moved with the releases: Claude 2.1.251, Codex
0.151.0, uv 0.12.7.

### A second commit, outside the usual regen

`tend init` now also writes `.github/actionlint.yaml` (the
`concurrency.queue` ignore from max-sixty/tend#1095). The nightly recipe
stages only `.github/workflows` and `.config`, so it landed untracked
and would be re-created on every future run — the second commit tracks
it. This repo runs no actionlint job or pre-commit hook, so the file is
inert here; it only suppresses a false positive for anyone linting these
workflows locally.

Full compare: max-sixty/tend@0.1.22...0.1.24

---------

Co-authored-by: worktrunk-bot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants