test(#3732): add kill switch and CEL is_fork exclusion to fork dispatch contract - #5665
Conversation
…ch contract Add the two remaining contract rows to the existing "Fork PR label dispatches harness" scenario in fork-dispatch.feature: - fork-pr-killed: a disabled harness with the same CEL trigger, asserting that the kill switch (enabled: false in config) prevents dispatch on fork events. - fork-pr-nofork: a harness whose CEL trigger includes !event.state.change_proposal.is_fork, asserting that harness-level fork exclusion produces an empty matrix. Both harnesses are added to the existing scenario (not as new scenarios) per maintainer guidance to conserve parallel execution slots. The positive harness wait provides the settle window for the negative assertions. Document the four-row fork PR behaviour contract in behaviour-testing.md as the canonical template for per-agent CEL port PRs. Note: pre-commit could not run (network restrictions in sandbox). The behaviour e2e suite requires live GitHub infrastructure and could not run in this sandbox. go vet passed. Closes #3732
|
🤖 Finished Review · ✅ Success · Started 10:06 AM UTC · Completed 10:27 AM UTC |
Site previewPreview: https://ea1926ea-site.fullsend-ai.workers.dev Commit: |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
ReviewFindingsLow
Previous runReviewFindingsLow
Previous run (2)ReviewFindingsLow
Previous run (3)ReviewFindingsLow
Previous run (4)ReviewFindingsHigh
Next steps:
Previous run (5)ReviewFindingsLow
Previous run (6)ReviewFindingsLow
Labels: PR adds behaviour contract tests for fork dispatch (component/e2e) and updates developer documentation (component/docs). |
|
/fs-fix |
|
🤖 Finished Fix · ✅ Success · Started 5:24 AM UTC · Completed 5:29 AM UTC |
Change unlinked `(ADR 54)` to linked `([ADR 0054](...))` in the fork PR behaviour contract section, matching the consistent ADR reference pattern used throughout docs/guides/dev/. Addresses review feedback on #5665
🔧 Fix agent — iteration 1 (human-triggered)Addressed 1 review finding: linked the ADR 54 reference using the established zero-padded format with relative path, matching all other ADR references in the docs/guides/dev/ directory. Fixed (1):
Tests: passedNext steps:
|
|
🤖 Finished Review · ✅ Success · Started 5:30 AM UTC · Completed 5:42 AM UTC |
|
/fs-fix Please address the following — keep the 1. Missing real kill-switch contract rowIssue #3732 asks for kill switch active in config on a fork event → empty matrix, exit 0. That means repo/org
2. Review finding: document
|
|
🤖 Finished Fix · ✅ Success · Started 5:48 AM UTC · Completed 5:58 AM UTC |
Add a separate fork-PR scenario that engages kill_switch: true (the global emergency stop in config.yaml) and asserts no harness runs. This is distinct from the existing fork-pr-killed row which tests per-agent enabled: false. The new "the kill switch is active" step reads the repo config, sets kill_switch: true, and commits the change. Update the fork PR behaviour contract table in behaviour-testing.md to show kill switch and disabled harness as separate rows. Add a "Dispatch step reference" section documenting both "a disabled custom harness" and "the kill switch is active" steps with when-to-use guidance. Addresses review feedback on #5665
🔧 Fix agent — iteration 2 (human-triggered)Addressed both human-instruction findings: (1) added a real kill-switch scenario using kill_switch: true with a new 'the kill switch is active' step and unit tests, (2) documented both 'a disabled custom harness' and 'the kill switch is active' steps in behaviour-testing.md with clear distinction between the two mechanisms. Preserved existing fork-pr-killed and fork-pr-nofork coverage. Fixed (2):
Tests: passed Decision points
Next steps:
|
|
🤖 Finished Review · ✅ Success · Started 5:59 AM UTC · Completed 6:14 AM UTC |
|
/fs-fix pull updates from main and fix conflicts, fix review comments |
|
🤖 Finished Fix · ✅ Success · Started 6:58 AM UTC · Completed 7:06 AM UTC |
Update the "Fork PR synchronize re-triggers" row to accurately reflect what the test actually verifies: the sync+label sequence dispatches the harness exactly 1 time with a successful workflow, rather than overspecifying "re-triggers" and "concurrency rules". Addresses review feedback on #5665
🔧 Fix agent — iteration 4 (human-triggered)Addressed 1 review finding: corrected the synchronize row in the fork PR behaviour contract table to accurately describe what the test verifies. Fixed (1):
Tests: passedNext steps:
|
|
🤖 Finished Review · ✅ Success · Started 10:15 AM UTC · Completed 10:30 AM UTC |
|
/fs-fix pull updates from main |
|
🤖 Finished Fix · ✅ Success · Started 6:09 AM UTC · Completed 6:15 AM UTC |
🔧 Fix agent — iteration 5 (human-triggered)Merged origin/main into PR branch as requested. Clean merge with no conflicts. go vet, tests, and build all pass. Fixed (1):
Tests: passedNext steps:
|
|
🤖 Finished Review · ✅ Success · Started 6:15 AM UTC · Completed 6:28 AM UTC |
|
/fs-fix The new kill-switch scenario is polluting other parallel behaviour scenarios. Bug
Latest evidence on
All fork-contract assertions themselves pass; the red is collateral damage from sticky kill-switch state. FixKeep the existing kill-switch / disabled-harness / CEL exclusion coverage. Do not remove those scenarios. Make kill-switch activation scenario-scoped cleanup:
Re-run behaviour and confirm triage (and other non-kill-switch scenarios) no longer fail with an active kill switch left behind. |
|
🤖 Finished Fix · ✅ Success · Started 6:38 AM UTC · Completed 6:49 AM UTC |
The kill-switch scenario sets kill_switch: true in the enrolled repo's config.yaml but never clears it. Since behaviour test slots are reused across scenarios within a suite run, subsequent scenarios on the same slot fail because the kill switch is still active. Add automatic cleanup tied to kill-switch activation: - Track activation via KillSwitchActivated field on World - Deactivate kill switch in CleanupScenario (same pattern as DummyOps) - Reset field in resetScenarioWorld for each new scenario Addresses review feedback on #5665
🔧 Fix agent — iteration 6 (human-triggered)Added automatic kill-switch cleanup to prevent cross-scenario pollution. When givenKillSwitchActive sets kill_switch: true, it marks KillSwitchActivated on the World. CleanupScenario (AfterScenario) deactivates the kill switch before the slot is reused. All 4 changes follow the established DummyOps cleanup pattern. Fixed (4):
Tests: passed
Decision points
Next steps:
|
|
🤖 Finished Review · ✅ Success · Started 6:50 AM UTC · Completed 7:02 AM UTC |
|
🤖 Finished Retro · ✅ Success · Started 7:39 AM UTC · Completed 7:58 AM UTC |
Retro: PR #5665 — fork dispatch behaviour contractPR #5665 added kill-switch and CEL Timeline highlights
What went well
Existing-issue evidence (not filed as new proposals)
Proposals filed
|
Summary
Add the two remaining fork-PR behaviour contract rows (kill switch, CEL
is_forkexclusion) tofork-dispatch.featureand document the four-row contract inbehaviour-testing.mdas the canonical template for per-agent CEL port PRs.Related Issue
Closes #3732
Changes
fork-pr-killedto the existing "Fork PR label dispatches harness" scenario, asserting the kill switch prevents dispatch on fork eventsfork-pr-noforkwith!event.state.change_proposal.is_forkin its trigger, asserting harness-level fork exclusion produces an empty matrixdocs/guides/dev/behaviour-testing.mdincluding the consolidation pattern and unauthorized-actor split referenceTesting
go vet -tags behaviour ./e2e/behaviour/...passesmake behaviour-test(requires live GitHub infrastructure — must pass in CI)make lint(pre-commit could not run due to sandbox network restrictions — must pass in CI)Checklist
!for breaking changes)Closes #3732
Post-script verification
agent/3732-fork-dispatch-contract)5e2b16052a01aab8ece6d4911d1f65b977dd9313..HEAD)