Sometimes, even for small edits, the folding runs test for each commit and this could lead to a very long wait #261

Closed
opened 2026-11-27 12:12:57 +01:00 by claudiomaradonna · 5 comments
No description provided.
Author
Owner

@motoko Can you check this?

@motoko Can you check this?

Route: answer 4009
@claudiomaradonna Confirmed against the code. fold-branch step 2 rebases with --exec '<fast checks>', so the every-commit checks of the Quality gates subsection run once per replayed commit, and docs/workflows/internal-skills.md gives the reason: every state a remote holds is ready to land. The Test suite itself runs once, on the final tree, at verify-execution step 4. Measured here, a passing per-commit run costs about 23s (tests/verify-agent-config.sh 17s, .agents/hooks/shellcheck.sh repo 5.5s, prettier --check '**/*.md' 0.6s), and each of those three checks the whole tree rather than the commit's diff, so the wait grows with the branch's commit count rather than the edit's size. Two levers exist already: --exec is dropped when the branch folds to one commit, and a Status evidence record names one tested commit, so the tip's pass covers no intermediate one. The change this points at would scope the per-commit run to that commit's diff, or run the tree-wide checks once at the tip; say the word and I'll brief it.

Route: answer 4009 @claudiomaradonna Confirmed against the code. `fold-branch` step 2 rebases with `--exec '<fast checks>'`, so the every-commit checks of the Quality gates subsection run once per replayed commit, and `docs/workflows/internal-skills.md` gives the reason: every state a remote holds is ready to land. The Test suite itself runs once, on the final tree, at `verify-execution` step 4. Measured here, a passing per-commit run costs about 23s (`tests/verify-agent-config.sh` 17s, `.agents/hooks/shellcheck.sh repo` 5.5s, `prettier --check '**/*.md'` 0.6s), and each of those three checks the whole tree rather than the commit's diff, so the wait grows with the branch's commit count rather than the edit's size. Two levers exist already: `--exec` is dropped when the branch folds to one commit, and a Status evidence record names one tested commit, so the tip's pass covers no intermediate one. The change this points at would scope the per-commit run to that commit's diff, or run the tree-wide checks once at the tip; say the word and I'll brief it.
Author
Owner

@motoko Can you work and implement it?

@motoko Can you work and implement it?

Route: implement 4123
@claudiomaradonna The reply to the open offer on this thread asks to work and implement the change the earlier answer identified — scoping fold-branch's per-commit checks so small edits no longer wait on every replayed commit — which is a change to the repository's files for the implementing bot to deliver through a pull request.

Route: implement 4123 @claudiomaradonna The reply to the open offer on this thread asks to work and implement the change the earlier answer identified — scoping `fold-branch`'s per-commit checks so small edits no longer wait on every replayed commit — which is a change to the repository's files for the implementing bot to deliver through a pull request.
Collaborator

Implemented in #263, #263.

fold-branch now runs its every-commit checks at two points. The
rebase's --exec carries only the checks that read the replayed commit's
own diff, here git diff --check HEAD^, so a commit that brings a
whitespace error into its own diff still stops the fold. A new step runs
the checks that read the whole tree once, on the folded tip, and the
skill's Done counts that run, so a fold that skipped it is not done.
docs/MAINTENANCE.md names which of this source's checks sit in each
group, which is also where the new test reads them from, so the document
and the skill cannot drift apart and silently lose a check.

A fold of several commits now pays one whole-tree run instead of one per
commit: about 34s once, where three commits cost about 34s each. The
branch's own fold showed it, 0.043s for the three per-commit runs and
39.8s for the one tip run.

What stays checked: verify-execution's final run of the Checks section
on the final tree, and every check of it on every pull request through
.forgejo/workflows/maintenance.yml, both untouched. What is not: a
commit between the replayed ones and the tip that breaks a whole-tree
check and is fixed before the tip now folds without a word, so git bisect across a branch's commits can stop at a state that fails them.

Two new tests, both red on d7893e2 and green on the branch; the pin of
the per-commit whitespace check, green on both, landed before the code.

Implemented in #263, https://git.unitoo.it/claudiomaradonna/agent-foundry/pulls/263. `fold-branch` now runs its every-commit checks at two points. The rebase's `--exec` carries only the checks that read the replayed commit's own diff, here `git diff --check HEAD^`, so a commit that brings a whitespace error into its own diff still stops the fold. A new step runs the checks that read the whole tree once, on the folded tip, and the skill's Done counts that run, so a fold that skipped it is not done. `docs/MAINTENANCE.md` names which of this source's checks sit in each group, which is also where the new test reads them from, so the document and the skill cannot drift apart and silently lose a check. A fold of several commits now pays one whole-tree run instead of one per commit: about 34s once, where three commits cost about 34s each. The branch's own fold showed it, 0.043s for the three per-commit runs and 39.8s for the one tip run. What stays checked: `verify-execution`'s final run of the Checks section on the final tree, and every check of it on every pull request through `.forgejo/workflows/maintenance.yml`, both untouched. What is not: a commit between the replayed ones and the tip that breaks a whole-tree check and is fixed before the tip now folds without a word, so `git bisect` across a branch's commits can stop at a state that fails them. Two new tests, both red on `d7893e2` and green on the branch; the pin of the per-commit whitespace check, green on both, landed before the code.
Sign in to join this conversation.
No description provided.