Repository navigation
fix(ci): make agent gates deterministic per head #311
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
.agent-loop/initiatives/WS-CI-002-deterministic-agent-gates/STATUS.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| # STATUS: WS-CI-002 — Deterministic Agent Gates | ||
|
|
||
| - Phase: ready for human review | ||
| - Completed chunk: `WS-CI-002-01` | ||
| - Goal: make the required `agent-gates` result deterministic for each PR head | ||
| while leaving independent human approval to protected-branch review rules. | ||
| - Trigger: PR #309 remained blocked by several pre-approval failures after its | ||
| exact head had passed every test and received an independent approval. | ||
| - Evidence: 31 dependency-gate tests and 11 lightweight workflow tests pass; | ||
| CI-integrity and test-delta review pass with no required fixes. |
75 changes: 75 additions & 0 deletions
75
...ves/WS-CI-002-deterministic-agent-gates/chunks/WS-CI-002-01-single-head-gate.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| # Chunk Contract: WS-CI-002-01 — Single-Head Agent Gate | ||
|
|
||
| ## Goal | ||
|
|
||
| Produce one deterministic required `agent-gates` result per PR head and use | ||
| branch protection, not a CI review-API poll, for independent approval. | ||
|
|
||
| ## Why this chunk exists | ||
|
|
||
| The workflow currently runs on PR changes and review changes under the same | ||
| required context. Dependency-manifest PRs fail before approval and later pass | ||
| after approval, leaving contradictory same-head results that GitHub sometimes | ||
| retains as merge blockers. | ||
|
|
||
| ## Risk class | ||
|
|
||
| L1 CI and contribution authority. | ||
|
|
||
| ## Allowed files | ||
|
|
||
| ```text | ||
| .github/workflows/agent-gates.yml | ||
| backend/scripts/check_guide_extractor_dependencies.py | ||
| backend/tests/test_guide_extractor_dependencies.py | ||
| scripts/test_lightweight_agent_gates.py | ||
| docs/operations_backend_testing.md | ||
| .agent-loop/CURRENT_STATE.md | ||
| .agent-loop/initiatives/WS-CI-002-deterministic-agent-gates/** | ||
| ``` | ||
|
|
||
| ## Not allowed | ||
|
|
||
| - Removing static dependency-manifest validation. | ||
| - Weakening dependency hashes, platform constraints, import boundaries, tests, | ||
| lint, coverage, or any Backend lane. | ||
| - Reducing protected-branch approval requirements. | ||
| - Adding an approval bypass, fallback success, or `continue-on-error`. | ||
| - Changing product behavior or dependencies. | ||
|
|
||
| ## Acceptance criteria | ||
|
|
||
| 1. `agent-gates` runs on head-changing PR events, not review or body-edit events. | ||
| 2. Superseded in-progress runs for the same PR are cancelled. | ||
| 3. The dependency gate validates repository content without querying live PR reviews. | ||
| 4. Obsolete review-fetching code and its tests are removed rather than retained. | ||
| 5. Lightweight regression tests lock the deterministic trigger and static command. | ||
| 6. Existing branch protection remains responsible for the required independent approval. | ||
| 7. All affected tests and exact-head GitHub checks pass. | ||
|
|
||
| ## Verification commands | ||
|
|
||
| ```bash | ||
| python3 -m unittest -v scripts.test_lightweight_agent_gates | ||
| cd backend | ||
| .venv/bin/ruff check scripts/check_guide_extractor_dependencies.py tests/test_guide_extractor_dependencies.py | ||
| .venv/bin/pytest -q tests/test_guide_extractor_dependencies.py | ||
| cd .. | ||
| python3 scripts/check_markdown_links.py | ||
| python3 scripts/check_stale_workstream_wording.py | ||
| git diff --check origin/main...HEAD | ||
| ``` | ||
|
|
||
| ## Required reviewers | ||
|
|
||
| CI integrity and test delta. | ||
|
|
||
| ## Human review focus | ||
|
|
||
| Confirm that review authority still comes from protected-branch approval and | ||
| that `agent-gates` now represents only deterministic repository validation. | ||
|
|
||
| ## Stop conditions | ||
|
|
||
| Stop if the change weakens branch protection, dependency validation, tests, | ||
| coverage, or requires a successful check without validating repository content. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.