Skip to content

Report a Stale pullRequestCheck: false and Correct AUDIT.md Section 6 - #4423

Merged
ptr727 merged 6 commits into
developfrom
burndown/audit-stale-pr-check
Nov 24, 2026
Merged

ptr727 merged 6 commits into
developfrom
burndown/audit-stale-pr-check

Conversation

@ptr727

@ptr727 ptr727 commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • spec/audit.py's rulesets.payload check now reports a registry pullRequestCheck: false as drift once it has outlived its reason (Detect a Stale pullRequestCheck: false in the Registry #3908). That is where every branch whose committed repo-config/ payload requires the pull request status check carries a .github/workflows/test-pull-request.yml posting that check on every pull request into the branch. Each workflow is read at its branch's head commit.
    • No finding where a gated branch lacks the workflow, posts the check under another name, or has no pull_request trigger.
    • No finding where the trigger can skip a pull request into the branch: a branches / branches-ignore filter excluding it, any negated branches pattern, a paths / paths-ignore filter, or a types list missing opened, synchronize, or reopened.
    • A reusable-workflow uses: job does not count, since GitHub posts its check as <caller> / <callee job>.
    • An operational repository reads main alone, since its develop ruleset requires no check.
    • The job-name reading is shared with the interface contract check through a new job_names helper, so both read a ruleset-bound name the same way, WORKFLOW.md D1.5's pull_request-only expression included.
    • job_names skips uses: call jobs, so the interface contract check no longer accepts a reusable-workflow call job carrying the check name as posting it. That is a pre-existing defect the local pass raised in this file, fixed here. Such a job now draws that check's existing "names the ruleset-bound check neither as a literal job name nor through the pull_request-only expression" finding.
  • spec/audit.py stays under its 3000-line ceiling (tests/test_audit_size.py), which is a design constraint rather than a number to raise. That is why lines in driftnote_findings, check_interface, check_branch_drift, check_settings_general, and check_rulesets_payload moved. Their six-line finding appends are folded into one-line forms, purely as a reshaping. Every finding's text and severity is unchanged. The full suite passes over the existing finding assertions. Running the base and head driftnote_findings and check_interface on the same constructed fixtures gives identical output.
  • spec/checks.json's rulesets.payload description now names the stale-field finding the check reports.
  • AUDIT.md section 4's branch-model bullet documents the new finding.
  • AUDIT.md section 6, the Two canonical units carry 21 defects a whole-unit read found, none of them new #1493 items still open on develop:
    • Item 6: the bullet still passes the model, since OPERATIONS.md and RESYNC.md both require passing it. It now says to pass the value the registry workflowModel names, and that the command does not cross-check it, so a wrong one checks the other model's develop ruleset and can still report a match.
    • Item 7: the bullet now says configure.sh finds the registry entry by repository name alone, so <owner> must be the registry owner.
    • Items 1, 2, 3, 4, 8, 9, 10, and 11 were checked against develop and are already fixed there, so nothing changes for them. Item 5, the heading rename, is its own change and is left out, as is the issue's GOVERNANCE.md "Hub-Hosted Tooling" half.

Tests

  • tests/test_audit_helpers.py StalePullRequestCheckCase, on constructed fixtures:
    • a stale false with both branches posting gives one finding;
    • a false with either branch lacking the workflow gives none;
    • a false with a check posted under another name gives none;
    • true or an absent field gives none and reads no branch;
    • an operational repository reads main only;
    • the pull_request-only expression counts as posting;
    • each skipping trigger above gives none, while a branches list naming both branches, or a types superset of the defaults, gives the finding;
    • a uses: job named for the check gives none, and draws the interface contract check's naming finding;
    • Run.branch_workflow reads each branch at its own head SHA and answers None for an absent branch or file;
    • check_rulesets_payload reports the stale field, reading each branch at its own head.
  • spec/validate.py passes, and so do the spec and audit test modules and the full suite.

Introduced findings left after the local pass edit budget, and their outcomes

  • AUDIT.md:103, introduced, an unfollowable instruction. "Pass the model the target's registry workflowModel names" named nothing for an entry without workflowModel, which takes defaults.workflowModel instead. Fixed in this pull request's review loop: the sentence now names the entry's workflowModel or else defaults.workflowModel.
  • spec/audit.py:1262, introduced, design. The new trigger and job-name readers fit under the size ceiling by compacting unrelated finding sites, rather than by moving pure workflow readers into a sibling module such as spec/audit_contract.py. Declined. The run's coordinator accepted the compaction as a pure reshaping, and the finding text is unchanged. Moving the readers needs a spec/ file outside this change's claim. The ceiling holds at 2999 of 3000, so nothing fails today.
  • AUDIT.md:87, introduced, a doc stating a looser rule than the code. Section 4 said the field stays where the trigger "can skip some pull request", where posts_check keeps it for any negated branches pattern and any paths filter. Fixed: section 4 now names each kept shape.
  • spec/audit.py:2301, introduced, a test gap. Nothing tested that check_rulesets_payload wires in the stale check with each branch's head read. Fixed: test_the_rulesets_check_reports_it_from_each_branch_head.

Closes on promotion: #3908

🤖 Generated with Claude Code

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants