Repository navigation
Audit That a Merge-Bot Caller Stub Subscribes to auto_merge_disabled - #4326
Conversation
Add a file-level requireTokens contract key, read against the whole caller file's code view, in a module of its own so spec/audit.py stays under its ceiling. The merge-bot entry now requires auto_merge_disabled, which the hub task's re-arm job needs the stub to subscribe to. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The fidelity model said a caller stub's contract is the hub task and the secrets it maps. The merge-bot stub's contract now also covers the event its hub task needs it to subscribe to. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Move artifactNameToken, requireTokensInJob, and forbidTokensInJob into audit_contract beside requireTokens, so one function reads every token against the file's or a job's code view. Share the carried-contract lookup between the shipped stub tests, test the validator's refusal of a single-string requireTokens, and call the stub's subscription an activity type. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
A recorded local strict-review pass covers head |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 48 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
There was a problem hiding this comment.
🟢 Approval recommended
No active issues were identified, and the change addresses the stated interface-contract gap requiring merge-bot caller stubs to subscribe to auto_merge_disabled.
No open issues 🎉
What changed in this PR
This pull request extends interface auditing so merge-bot caller stubs must subscribe to auto_merge_disabled, preventing silent re-arm failures across fleet repositories.
Changes:
- Adds file-level
requireTokensauditing and centralizes token validation. - Requires
auto_merge_disabledin the merge-bot workflow contract. - Adds schema, validator, documentation, tests, and a module size limit.
| File | Description |
|---|---|
| tests/test_audit_size.py | Adds a line-count ceiling for the new contract auditing module. |
| tests/test_audit_helpers.py | Adds coverage for token detection, comment exclusion, shipped stubs, and malformed contract definitions. |
| spec/validate.py | Validates requireTokens as an array of strings. |
| spec/files.schema.json | Declares the requireTokens contract property in the manifest schema. |
| spec/files.json | Requires auto_merge_disabled for merge-bot caller stubs. |
| spec/fidelity-model.md | Documents activity subscriptions as part of caller interface fidelity. |
| spec/audit.py | Delegates interface token validation to the new contract auditing module. |
| spec/audit_contract.py | Centralizes file-level and job-level interface token checks. |
Review effort: Lite
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #4326 +/- ##
===========================================
+ Coverage 79.25% 79.26% +0.01%
===========================================
Files 44 45 +1
Lines 15887 15890 +3
===========================================
+ Hits 12592 12596 +4
+ Misses 3295 3294 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@coderabbitai review |
|
/review |
Action not completed
|
…udit, Co-Author (#4330) ## Summary Promotes `develop` to `main`. It carries four changes: - [#4325](#4325) reads Jinja template comments in the prose gate. - [#4323](#4323) names the registration grace refusal and routes a missing shared hook to the maintainer. - [#4326](#4326) audits that a merge-bot caller stub subscribes to `auto_merge_disabled`. - [#4324](#4324) allows a co-author line by default and never a session link. Closes #4308 Closes #3869 Closes #1264 Closes #4307 Closes #4313 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **New Features** * The installer now sets `attribution.sessionUrl` to `false` when the setting is absent, while preserving existing host values. Reports identify missing settings and note host-owned values. * Prose checks now recognize Jinja templates and handle their comments more accurately. * Workflow specifications can require tokens across entire workflows, with validation for the new requirement. * **Documentation** * Updated guidance clarifies hook reporting, check-registration timing, and commit and pull request attribution rules. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Summary
#4310 moved the merge bot's re-arm onto the pull request
auto_merge_disabledevent, which each caller stub has to subscribe to. Nothing audited that subscription.requireTokensInJobreads one job, and a stub'son:types sit outside every job, so a repository keeping its old stub passed the audit while the re-arm job never ran there.spec/audit_contract.py(new): a file-levelrequireTokenscontract key, read against the whole caller file's code view, so a comment naming the token does not satisfy it. A missing token isDRIFT, matching the other interface contract keys. The module holds every contract token check, soartifactNameToken,requireTokensInJob, andforbidTokensInJobmove here too, with their findings, messages, and order unchanged.spec/audit.py:check_interfacecalls the new module. The file goes from 2996 to 2977 lines. Its 3000-line ceiling is unchanged.spec/files.json: the merge-bot entry requiresauto_merge_disabled.spec/files.schema.jsonandspec/validate.py: declare the key and validate it as an array of strings.tests/test_audit_helpers.py: a pass case, a fail case, a comment-only case, and a check that the hub's own stub and the catalog snippet meet the carried contract. A further case runs the validator over a manifest whoserequireTokensis a single string and asserts its refusal. The two shipped-stub cases share one contract lookup.tests/test_audit_size.py: a 200-line ceiling for the new module.spec/fidelity-model.md: a caller stub's contract now also covers an activity type its hub task needs it to subscribe to.Fleet effect: drift, not an advisory
A read of each registry repository's default-branch stub found that 20 cataloged repositories still lack
auto_merge_disabled, plus 1 archived one. Only the hub's own stub has it. Each of those now draws oneDRIFTfinding from theinterfacecheck onmerge-bot-pull-request.yml.That is drift rather than an advisory, for these reasons:
pins.age. No mechanism edits a stub'son:types.A repository that holds the old stub on purpose can say so with a registry
driftNote, as for any other drift.Verification
uv run --no-project --script spec/validate.py: OK.python -m unittest discover -s testswithtests/requirements.txt: 4618 tests, OK (12 skipped).spec/audit.py --selftestpasses.ruff check,ruff format --check,mypy, and the prose gate are clean.Closes on promotion: #4313
🤖 Generated with Claude Code