Skip to content

restack-regenerates-generated-files/3: Regenerate and commit generated files after a restack, the generated_files hold cause, and docs - #994

Merged
bwmatson merged 6 commits into
mainfrom
spec/restack-regenerates-generated-files/3
Nov 17, 2026
Merged

bwmatson merged 6 commits into
mainfrom
spec/restack-regenerates-generated-files/3

Conversation

@bwmatson

Copy link
Copy Markdown
Owner

Start here

Already verified by the pipeline

  • Tests were committed first and seen to fail first.
  • unit-test result: passed
  • Review took 2 review rounds

Review tier: full — the reviewer classified it full

Why

This pull request builds part of change restack-regenerates-generated-files; this is the change's reason.

A unit that edits agent-assessment/web also commits the build output (src/server/web/assets/*-<hash>.js, src/server/web/index.html, src/report/template.html). The asset names carry a content hash, so any two units that rebuild them conflict on every file: renamed on both sides, deleted by one and added by the other, or both deleted. The restack of report-views-usage-and-coverage/4 hit this and failed with No such file or directory on a path both sides had deleted, because the conflict han

… The full reason is in openspec/changes/restack-regenerates-generated-files/proposal.md.

What this pull request does

After a restack, the pipeline rebuilds and commits the generated files a unit touched. A failing rebuild puts the branch back where it was and holds the unit under a new generated_files cause.

  • Once a restack's rebase finishes (clean, settled or resolved), each generated entry whose paths the unit's commits touched runs its command in its cwd. The changes under that entry's paths are committed as one chore: commit.
  • Generated paths are matched with the existing is_generated rule, so a slash-free pattern matches the file name anywhere in the repository.
  • A command that cannot start, runs past the check timeout or exits non-zero raises GeneratedFilesFailed. The move resets the branch, or the detached head, to where it started and removes what the command wrote, so the next restack replays the move and runs the rebuild again.
  • The build worker's prepare and pre-push restacks, and the merge handler's restack of children (also used by the resolution lane), hold the unit HELD with cause generated_files. The command's trimmed output goes in the note, built by one shared helper.
  • docs/configuration.md, docs/architecture.md, the abk-config skill and the changelog describe the generated rebuild and the new hold cause.

Based on main, with nothing unmerged beneath it — ready to merge whenever the checks look right.

Unit restack-regenerates-generated-files/3 of change restack-regenerates-generated-files, task group(s) 3, 4.
Spec: openspec/changes/restack-regenerates-generated-files/ in the planning repo.

Assumptions

This unit assumes nothing unmerged: everything it builds on is already in main.

Verification

This is a unit-test unit: everything it needs is fakes, fixtures or throwaway containers, so GitHub Actions runs the whole of it. No e2e-test run was required.

Left for later

Approved, with these recorded rather than blocking:

  • src/agent_build_kit/pipeline/events.py:2761 — When build_restack holds a unit under generated_files, it returns RestackOutcome.DEFERRED, whose definition at events.py:162 says 'the move could not run now (a pause, a busy checkout): retry later'. A held unit is not retried. It waits for a person.
  • docs/configuration.md:693 — The generated comment block says 'its changes are committed' and gives no bound on how long the command may run. The code now commits only the changes under the entry's paths, and stops the command after COMMAND_TIMEOUT_SECONDS (900 s) with a generated_files hold.

How this was built

Tests were committed first and seen to fail before any implementation existed; the commit order is checked mechanically; lint, formatting and types pass at the tip.


Opened by the spec-driven pipeline. The build agent never merges. The pipeline merges only
a unit review classified auto and policy allowed; a person merges any other, after checking
the stack order above.

The tests come first and fail until the implementation.

A unit that edits `agent-assessment/web` also commits the build output (`src/server/web/assets/*-<hash>.js`, `src/server/web/index.html`, `src/report/template.html`).

Unit: restack-regenerates-generated-files/3
With this in, the tests of the previous commit pass.

A unit that edits `agent-assessment/web` also commits the build output (`src/server/web/assets/*-<hash>.js`, `src/server/web/index.html`, `src/report/template.html`).

Unit: restack-regenerates-generated-files/3
The tests come first and fail until the implementation.

Unit: restack-regenerates-generated-files/3
With this in, the tests of the previous commit pass.

A unit that edits `agent-assessment/web` also commits the build output (`src/server/web/assets/*-<hash>.js`, `src/server/web/index.html`, `src/report/template.html`).

Unit: restack-regenerates-generated-files/3
…ated_files hold cause, and docs (checks, round 1)

Unit: restack-regenerates-generated-files/3
…ated_files hold cause, and docs (review round 1)

Unit: restack-regenerates-generated-files/3
@bwmatson bwmatson added change-restack-regenerates-generated-files The change this pull request belongs to checking In review, but its checks are still running review-full Review asks for a full read from a person in-review Built and waiting for human review and removed checking In review, but its checks are still running labels Nov 17, 2026
@bwmatson
bwmatson merged commit 2f43eaf into main Nov 17, 2026
5 checks passed
@bwmatson bwmatson added settling Merged; waiting for its checks to complete and removed in-review Built and waiting for human review settling Merged; waiting for its checks to complete labels Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change-restack-regenerates-generated-files The change this pull request belongs to review-full Review asks for a full read from a person

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant