Repository navigation
Closed
Labels
Milestone
Description
Friction
- Agents run
uv run devops ciby hand, then rebase, amend or edit, then push. The pre-push hook then finds no saved verdict for the new content and runs the whole gate again. - Each repeat costs a full gate: about 200 s alone on the release tip at load 14-23, and 370-930 s in agents' hook runs under shared load.
- A content-keyed verdict that matches costs the push about 9-14 s instead.
Evidence
Checked at release/v0.2.37 30b8fdd.
- The verdict is keyed on content, not commits: the blob hash of every tracked and non-ignored untracked file, the hashes of pyproject.toml, uv.lock and .pre-commit-config.yaml, and the options {fix, check} (
src/devops_cli/ci/cache.py:34-38,:140-146,:164-185,:246-279,:282-309). There is one verdict file per worktree root (:86-88). - So it survives
git add,git commitand pre-commit's stash of unstaged changes, and the hook reuses it: earlier logs show hook cache hits of 4.9 s inside the CLI and 8.7-13.8 s through pre-commit. - It is lost by a rebase, amend or edit after the manual run, by
--checkor--no-fix(different options), by a run in another worktree, and by any failure: a failed run clears it (src/devops_cli/commands/ci.py:1090-1092), including a failed--onlyor--skiprun. - A run whose docs pre-fix rewrites files saves no verdict (
src/devops_cli/commands/ci.py:998-1004), and pre-commit fails a hook that modifies files. - That happens to every push from a release tip whose generated docs went stale when two pull requests, each green on its own base, merged together. The tip at 25e2cda carried a stale
docs/MCP_TOOLS.mduntil bfb312a, and the same skew can come back. - One workflow's reflog shows a manual gate, then an amend and a rebase onto the release tip, then a push that ran the gate again.
- AGENTS.md:57-58 says a push needs a passing
uv run devops ciin the session and that the pre-push hook enforces it. It does not say that the hook's run counts, so agents run the gate by hand first.
Remedy
- AGENTS.md and docs/SDLC.md say: the pre-push hook's
uv run devops ciis the gate run. A manual run counts only when nothing changes before the push. Run it, if at all, after the last rebase, amend or edit, in the worktree you push from, with no--check,--no-fix,--onlyor--skip. - They also say: when the hook's docs pre-fix rewrites files, regenerate and commit the docs, then push again. Do not repeat the push unchanged.
- Workflow prompts that order a manual gate before a rebase or amend are changed the same way (outside this repository).
- No check, threshold or hook changes.
Acceptance criteria
- Tests first, offline: a test over
src/devops_cli/ci/cache.pyshows that a verdict saved for a tree is found again aftergit addandgit commitof that tree in atmp_pathrepository, and is not found after an amend that changes a file. - AGENTS.md and docs/SDLC.md carry the wording above;
devops docs checkpasses. - No change to
.pre-commit-config.yamlor to any check.
Proposed design
Problem statement
Agents run the full CI gate manually, then rebase or amend changes, and push. The pre-push hook runs the full gate again because it doesn't reuse the previous verdict, causing unnecessary delays of 200-930 seconds per push.
Acceptance criteria
- Criterion 1: A test verifies that a verdict saved for a tree is found again after git add and git commit of that tree in a tmp_path repository.
Verification: Run tests over src/devops_cli/ci/cache.py that simulate a git add and git commit on a tree, ensuring the verdict is reused. - Criterion 2: A test verifies that a verdict is not found after an amend that changes a file.
Verification: Run tests over src/devops_cli/ci/cache.py that simulate an amend changing a file, ensuring the old verdict is cleared and a new one is generated. - Criterion 3: AGENTS.md and docs/SDLC.md are updated with new wording about when to run the gate manually.
Verification: Check that AGENTS.md and docs/SDLC.md contain the specified wording: 'the pre-push hook's uv run devops ci is the gate run' and 'Run it, if at all, after the last rebase, amend or edit'. - Criterion 4: The devops docs check passes after the changes.
Verification: Rundevops docs checkcommand to ensure documentation is valid.
Key questions
- Does the verdict reuse logic depend on content keys or commit hashes?: The verdict is keyed on content, not commits: the blob hash of every tracked and non-ignored untracked file, the hashes of pyproject.toml, uv.lock and .pre-commit-config.yaml, and the options {fix, check} (src/devops_cli/ci/cache.py:34-38, :140-146, :164-185, :246-279, :282-309). [sources: src/devops_cli/ci/cache.py:34-38, src/devops_cli/ci/cache.py:140-146, src/devops_cli/ci/cache.py:164-185, src/devops_cli/ci/cache.py:246-279, src/devops_cli/ci/cache.py:282-309]
- What conditions cause a verdict to be cleared?: A verdict is lost by a rebase, amend or edit after the manual run, by --check or --no-fix (different options), by a run in another worktree, and by any failure: a failed run clears it (src/devops_cli/commands/ci.py:1090-1092), including a failed --only or --skip run. A run whose docs pre-fix rewrites files saves no verdict (src/devops_cli/commands/ci.py:998-1004), and pre-commit fails a hook that modifies files. [sources: src/devops_cli/commands/ci.py:1090-1092, src/devops_cli/commands/ci.py:998-1004]
- What is the expected behavior for the pre-push hook after manual runs?: The pre-push hook should reuse the verdict from a manual run if nothing changes before the push, and only re-run the full gate if there are changes. (proposed) [sources: src/devops_cli/ci/cache.py:86-88]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
dan-petty commentedon Oct 18, 2026
Intake placed this item to the backlog: at intake only a critical fix goes into a release; a release start pulls Ready items in, P0 features first.
The candidate focuses on documentation updates and clarifications for agents and the SDLC.This improves workflow efficiency but is not critical or urgent.Improves agent workflow, reducing friction and time spent during pushes.Involves updating documentation and tests without changing core logic or adding new features.dan-petty commentedon Oct 20, 2026
Status set to Ready at 2954109 (see proposed design in issue body).
docs(agents): the full gate runs once per push, after the last rebase…
dan-petty commentedon Oct 20, 2026
What changed
#1761, merged into
release/v0.2.38as 3f9a2f3.5 file(s) changed.
How it was verified
Check runs at fee61c9:
Acceptance Criteria of
docs/agent/tasks/task-1663-ci-verdict-reuse-pre-push.md:No Acceptance Criteria section.
feat(release): v0.2.38 (#1799)
feat(release): v0.2.38 (#1798)
docs(adr): decide required checks, a merge queue and what the local g…