You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ruleset pr-quality parameter require_code_owner_review has drifted from the codified standard: expected true, actual false. The codified JSON (standards/rulesets/pr-quality.json) is the source of truth (#575/#580); run scripts/apply-rulesets.sh --repo petry-projects/broodly to converge.
Lock the codified pr-quality ruleset standard in scripts/apply-rulesets.sh (which already sets require_code_owner_review: true) with an offline regression test, so the drifted parameter cannot silently regress in-repo. Live GitHub-state convergence still requires an org admin token via scripts/apply-rulesets.sh and is out of scope for this repo-file change.
Findings
The committed scripts/apply-rulesets.sh already codifies "require_code_owner_review": true (pr-quality payload). There is no drift in the repo file — the drift is in the live GitHub ruleset state, which converges by running the script with an administration:write token.
The sibling script scripts/apply-repo-settings.sh has an offline --dry-run --force regression test (tests/scripts/apply-repo-settings.test.sh). apply-rulesets.sh has no equivalent guard, and its --dry-run path currently makes a live gh api call (fails offline), so the codified ruleset parameters are untested.
Implementation Checklist
scripts/apply-rulesets.sh — make --dry-run fully offline by skipping the live rulesets fetch in dry-run mode (behavior-preserving for real runs)
tests/scripts/apply-rulesets.test.sh — new offline test asserting the codified pr-quality ruleset sets require_code_owner_review: true (plus core pr-quality review params)
Tests to Write
apply-rulesets.sh --dry-run --force exits 0 without network/admin token
Confirmed scripts/apply-rulesets.sh already codifies "require_code_owner_review": true in the pr-quality payload — no drift in the repo file; the drift is in live GitHub state (which converges only with an administration:write token, out of scope for a repo-file change).
Made apply-rulesets.sh --dry-run offline (best-effort fetch, falls back to empty ruleset set when unauthenticated) so the codified payloads can be regression-tested without an admin token. Real (non-dry-run) behavior is unchanged.
Added tests/scripts/apply-rulesets.test.sh locking the required pr-quality review parameters, mirroring the existing apply-repo-settings.test.sh pattern.
Test Results
ok - codifies the pr-quality ruleset
ok - enforces require_code_owner_review=true
ok - enforces required_approving_review_count=1
ok - enforces require_last_push_approval=true
ok - enforces dismiss_stale_reviews_on_push=true
ok - enforces required_review_thread_resolution=true
---
PASS — 6 assertion(s) passed
tests/scripts/apply-repo-settings.test.sh (sibling) — still passes
Files Changed
scripts/apply-rulesets.sh: dry-run no longer hard-fails on a failed rulesets fetch — it falls back to an empty set so payloads can be previewed/tested offline. Non-dry-run runs still fetch and fail hard as before.
tests/scripts/apply-rulesets.test.sh: new offline regression test asserting the codified pr-quality ruleset enforces require_code_owner_review=true, required_approving_review_count=1, require_last_push_approval=true, dismiss_stale_reviews_on_push=true, and required_review_thread_resolution=true.
Notes
Live GitHub ruleset convergence is not performed by this change. Bringing the live pr-quality ruleset back to require_code_owner_review=true requires running scripts/apply-rulesets.sh with a token that has administration:write on the repo — a privileged, live-infrastructure operation outside the dev-lead's repo-file scope. This change codifies + regression-guards the correct value so it cannot silently drift in-repo, and provides the tested script to converge live state.
The JS/Go package test suites were not run: no node_modules are installed in this environment and the change is shell-only (does not touch any TS/Go package). The relevant shell test suite passes.
Guard the codified pr-quality ruleset standard (require_code_owner_review: true) with a regression test, since the drift is in live GitHub state while the checked-in convergence script scripts/apply-rulesets.sh is already correct.
Findings
Live pr-quality ruleset (id 14592511) reports require_code_owner_review: false — confirmed via gh api.
Checked-in scripts/apply-rulesets.sh already codifies require_code_owner_review: true (plus dismiss_stale_reviews_on_push / require_last_push_approval: true), so the repo source is already compliant with the standard.
Converging live state requires running apply-rulesets.sh with an administration:write token. The dev-lead token only has repo/workflow scope and live-ruleset changes mutate shared infrastructure — that is handled by the privileged apply workflow, not a code PR.
scripts/apply-rulesets.sh has no regression test (its sibling apply-repo-settings.sh does), which is how the standard could silently drift in-repo.
Assert the pr-quality dry-run payload contains "require_code_owner_review": true.
Assert the script exits 0 in --dry-run --force mode with a mocked gh.
Test Command
bash tests/scripts/apply-rulesets.test.sh
Note (red-first exception)
The codified script is already compliant, so the new guard passes on first run — this is a behavior-preserving compliance guard (Phase 2 exception). Live-state convergence is out of scope for a code PR and is noted for the privileged apply workflow.
The compliance finding is a live GitHub ruleset drift, not a source defect: the pr-quality ruleset (id 14592511) currently reports require_code_owner_review: false, but the checked-in convergence script scripts/apply-rulesets.shalready codifies require_code_owner_review: true (verified via gh api and a dry-run of the script). The repository source is therefore already aligned with the standard.
Live convergence is out of scope for a code PR. Applying the ruleset to live GitHub requires an administration:write token; the dev-lead token only carries repo/workflow scope, and mutating a live ruleset changes shared infrastructure. That step is handled by the privileged apply workflow — run: GH_TOKEN=<admin-token> ./scripts/apply-rulesets.sh (or the org-level apply-rulesets.sh) to converge.
To make the repo self-defending against future in-repo drift of this exact parameter, I added the regression guard that scripts/apply-rulesets.sh was missing (its sibling apply-repo-settings.sh already had one).
Plan Execution
Confirmed live drift (require_code_owner_review: false) and that the codified script already sets it true
Added tests/scripts/apply-rulesets.test.sh (self-contained gh mock, --dry-run --force, no network)
Proved the guard catches drift via a mutation test (flip payload to false → test fails; restore → passes)
bash .dev-lead/scripts/dev-lead-lint.sh passes; shellcheck --severity=warning -x on the new file passes
Sibling tests/scripts/apply-repo-settings.test.sh still passes (no regression)
Test Results
$ bash tests/scripts/apply-rulesets.test.sh
ok - pr-quality requires code owner review
ok - emits the pr-quality ruleset
ok - pr-quality requires one approving review
ok - pr-quality requires last push approval
ok - pr-quality requires review thread resolution
---
PASS — 5 assertion(s) passed
$ bash .dev-lead/scripts/dev-lead-lint.sh
[lint] shellcheck on 2 file(s)...
[lint] validating CODEOWNERS...
OK: CODEOWNERS
[lint] all checks passed
# Mutation check (payload forced to false, then restored):
not ok - pr-quality requires code owner review (output missing: "require_code_owner_review": true)
FAIL — see assertions above # <- guard correctly goes red on drift
Files Changed
tests/scripts/apply-rulesets.test.sh (new): regression guard asserting the codified pr-quality payload keeps require_code_owner_review: true alongside its companion review parameters. Runs offline via a stub gh on PATH; mirrors the existing apply-repo-settings.test.sh convention.
Notes
Red-first exception (Phase 2): the codified script already satisfies the standard, so the new guard passes on first run. Genuineness of the guard is demonstrated by the mutation test above rather than by shipping a broken script.
The JS (pnpm -r run test) and Go (go test ./...) suites were not run — dependencies are not installed in this environment and the change is a standalone shell test outside both build graphs, so it cannot affect them.
Action still required to close the finding: run the apply-rulesets convergence with an admin-scoped token to flip the live ruleset require_code_owner_review from false to true. This code change guards the standard but cannot mutate live GitHub state.
Detail: Ruleset pr-quality parameter require_code_owner_review has drifted from the codified standard: expected true, actual false. The codified JSON (standards/rulesets/pr-quality.json) is the source of truth (#575/#580); run scripts/apply-rulesets.sh --repo petry-projects/broodly to converge.
Detail: Ruleset pr-quality parameter require_code_owner_review has drifted from the codified standard: expected true, actual false. The codified JSON (standards/rulesets/pr-quality.json) is the source of truth (#575/#580); run scripts/apply-rulesets.sh --repo petry-projects/broodly to converge.
Activity
don-petry commentedon Jul 17, 2026
Dev-Lead Implementation Plan
Issue: #407 — Compliance: ruleset-drift-pr-quality-require_code_owner_review
Scope
Lock the codified
pr-qualityruleset standard inscripts/apply-rulesets.sh(which already setsrequire_code_owner_review: true) with an offline regression test, so the drifted parameter cannot silently regress in-repo. Live GitHub-state convergence still requires an org admin token viascripts/apply-rulesets.shand is out of scope for this repo-file change.Findings
scripts/apply-rulesets.shalready codifies"require_code_owner_review": true(pr-quality payload). There is no drift in the repo file — the drift is in the live GitHub ruleset state, which converges by running the script with anadministration:writetoken.scripts/apply-repo-settings.shhas an offline--dry-run --forceregression test (tests/scripts/apply-repo-settings.test.sh).apply-rulesets.shhas no equivalent guard, and its--dry-runpath currently makes a livegh apicall (fails offline), so the codified ruleset parameters are untested.Implementation Checklist
scripts/apply-rulesets.sh— make--dry-runfully offline by skipping the live rulesets fetch in dry-run mode (behavior-preserving for real runs)tests/scripts/apply-rulesets.test.sh— new offline test asserting the codifiedpr-qualityruleset setsrequire_code_owner_review: true(plus core pr-quality review params)Tests to Write
apply-rulesets.sh --dry-run --forceexits 0 without network/admin token"require_code_owner_review": trueTest Command
bash tests/scripts/apply-rulesets.test.shdon-petry commentedon Jul 17, 2026
Dev-Lead: Implementation Complete
Plan Execution
scripts/apply-rulesets.shalready codifies"require_code_owner_review": truein the pr-quality payload — no drift in the repo file; the drift is in live GitHub state (which converges only with anadministration:writetoken, out of scope for a repo-file change).apply-rulesets.sh --dry-runoffline (best-effort fetch, falls back to empty ruleset set when unauthenticated) so the codified payloads can be regression-tested without an admin token. Real (non-dry-run) behavior is unchanged.tests/scripts/apply-rulesets.test.shlocking the required pr-quality review parameters, mirroring the existingapply-repo-settings.test.shpattern.Test Results
Verification also run:
shellcheck scripts/apply-rulesets.sh tests/scripts/apply-rulesets.test.sh— clean.dev-lead/scripts/dev-lead-lint.sh— passedtests/scripts/apply-repo-settings.test.sh(sibling) — still passesFiles Changed
scripts/apply-rulesets.sh: dry-run no longer hard-fails on a failed rulesets fetch — it falls back to an empty set so payloads can be previewed/tested offline. Non-dry-run runs still fetch and fail hard as before.tests/scripts/apply-rulesets.test.sh: new offline regression test asserting the codified pr-quality ruleset enforcesrequire_code_owner_review=true,required_approving_review_count=1,require_last_push_approval=true,dismiss_stale_reviews_on_push=true, andrequired_review_thread_resolution=true.Notes
pr-qualityruleset back torequire_code_owner_review=truerequires runningscripts/apply-rulesets.shwith a token that hasadministration:writeon the repo — a privileged, live-infrastructure operation outside the dev-lead's repo-file scope. This change codifies + regression-guards the correct value so it cannot silently drift in-repo, and provides the tested script to converge live state.node_modulesare installed in this environment and the change is shell-only (does not touch any TS/Go package). The relevant shell test suite passes.don-petry commentedon Jul 21, 2026
Dev-Lead Implementation Plan
Issue: #407 — Compliance: ruleset-drift-pr-quality-require_code_owner_review
Scope
Guard the codified
pr-qualityruleset standard (require_code_owner_review: true) with a regression test, since the drift is in live GitHub state while the checked-in convergence scriptscripts/apply-rulesets.shis already correct.Findings
pr-qualityruleset (id14592511) reportsrequire_code_owner_review: false— confirmed viagh api.scripts/apply-rulesets.shalready codifiesrequire_code_owner_review: true(plusdismiss_stale_reviews_on_push/require_last_push_approval: true), so the repo source is already compliant with the standard.apply-rulesets.shwith anadministration:writetoken. The dev-lead token only hasrepo/workflowscope and live-ruleset changes mutate shared infrastructure — that is handled by the privileged apply workflow, not a code PR.scripts/apply-rulesets.shhas no regression test (its siblingapply-repo-settings.shdoes), which is how the standard could silently drift in-repo.Implementation Checklist
tests/scripts/apply-rulesets.test.shmirroring the existingtests/scripts/apply-repo-settings.test.shpattern (self-containedghmock,--dry-run --force).Tests to Write
pr-qualitydry-run payload contains"require_code_owner_review": true.--dry-run --forcemode with a mockedgh.Test Command
bash tests/scripts/apply-rulesets.test.shNote (red-first exception)
The codified script is already compliant, so the new guard passes on first run — this is a behavior-preserving compliance guard (Phase 2 exception). Live-state convergence is out of scope for a code PR and is noted for the privileged apply workflow.
don-petry commentedon Jul 21, 2026
Dev-Lead: Implementation Complete
Summary
The compliance finding is a live GitHub ruleset drift, not a source defect: the
pr-qualityruleset (id14592511) currently reportsrequire_code_owner_review: false, but the checked-in convergence scriptscripts/apply-rulesets.shalready codifiesrequire_code_owner_review: true(verified viagh apiand a dry-run of the script). The repository source is therefore already aligned with the standard.Live convergence is out of scope for a code PR. Applying the ruleset to live GitHub requires an
administration:writetoken; the dev-lead token only carriesrepo/workflowscope, and mutating a live ruleset changes shared infrastructure. That step is handled by the privileged apply workflow — run:GH_TOKEN=<admin-token> ./scripts/apply-rulesets.sh(or the org-levelapply-rulesets.sh) to converge.To make the repo self-defending against future in-repo drift of this exact parameter, I added the regression guard that
scripts/apply-rulesets.shwas missing (its siblingapply-repo-settings.shalready had one).Plan Execution
require_code_owner_review: false) and that the codified script already sets ittruetests/scripts/apply-rulesets.test.sh(self-containedghmock,--dry-run --force, no network)false→ test fails; restore → passes)bash .dev-lead/scripts/dev-lead-lint.shpasses;shellcheck --severity=warning -xon the new file passestests/scripts/apply-repo-settings.test.shstill passes (no regression)Test Results
Files Changed
tests/scripts/apply-rulesets.test.sh(new): regression guard asserting the codifiedpr-qualitypayload keepsrequire_code_owner_review: truealongside its companion review parameters. Runs offline via a stubghon PATH; mirrors the existingapply-repo-settings.test.shconvention.Notes
pnpm -r run test) and Go (go test ./...) suites were not run — dependencies are not installed in this environment and the change is a standalone shell test outside both build graphs, so it cannot affect them.require_code_owner_reviewfromfalsetotrue. This code change guards the standard but cannot mutate live GitHub state.don-petry commentedon Jul 24, 2026
Weekly Compliance Audit (2026-07-24)
This finding is still open.
Detail: Ruleset
pr-qualityparameterrequire_code_owner_reviewhas drifted from the codified standard: expectedtrue, actualfalse. The codified JSON (standards/rulesets/pr-quality.json) is the source of truth (#575/#580); runscripts/apply-rulesets.sh --repo petry-projects/broodlyto converge.Standard: standards/github-settings.md#pr-quality--standard-ruleset-all-repositories
don-petry commentedon Jul 31, 2026
Weekly Compliance Audit (2026-07-31)
This finding is still open.
Detail: Ruleset
pr-qualityparameterrequire_code_owner_reviewhas drifted from the codified standard: expectedtrue, actualfalse. The codified JSON (standards/rulesets/pr-quality.json) is the source of truth (#575/#580); runscripts/apply-rulesets.sh --repo petry-projects/broodlyto converge.Standard: standards/github-settings.md#pr-quality--standard-ruleset-all-repositories
feat: implement issue #407 — Compliance: ruleset-drift-pr-quality-req…