Repository navigation
feat: implement issue #969 — [Phase 1] Drift-guard CI: fail when template stubs diverge from standards/ - #983
Conversation
…late stubs diverge from standards/
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Review limit reached
More reviews will be available in 5 minutes. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (4)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Code Review
This pull request introduces a template drift guard script (scripts/template_stub_drift.sh) and corresponding tests (tests/template_stub_drift.bats) to ensure files in repo-template do not diverge from their standards-derived baseline, alongside updating AGENTS.md with documentation. The review feedback suggests adding set -euo pipefail for robust error handling, guarding the template_drift_annotate call to guarantee temporary file cleanup under set -e, and removing an unused base64 dependency check.
Dev-Lead — review-changes (applied)Changes committed and pushed. |
Dev-Lead — review-changes (applied)Changes committed and pushed. |
Dev-Lead — fix-bot-comment (no-changes)Agent reasoning |
donpetry-bot
left a comment
There was a problem hiding this comment.
Automated review — APPROVED ✓
Risk: MEDIUM
Reviewed commit: 64a59aa268925230a31ec1594083cf65547df844
Review mode: triage-approved (single reviewer)
Summary
Adds a template-drift guard (script + bats + lint job + AGENTS.md docs) implementing #969. The new scripts/template_stub_drift.sh reuses fleet_stub_drift.sh's byte-identity ALIGNED/DRIFTED/MISSING model to fail CI when a file committed in petry-projects/repo-template diverges from its standards-derived baseline. Clean, well-tested, all CI green; triage's low-risk assessment confirmed.
Linked issue analysis
Closes #969 — all 4 acceptance criteria met: (1) reuses classify_stub_drift/stub_drift_row from fleet_stub_drift.sh for blob-SHA equality; (2) manifest covers the workflow stubs plus verbatim baselines (dependabot.yml, CODEOWNERS, CLAUDE.md) and excludes ci.yml via a documented TEMPLATE_DRIFT_ALLOWLIST with recorded rationale; (3) wired into the existing PR-triggered Lint workflow (no new cron) with ::error:: annotations naming the file and both short SHAs; (4) tests/template_stub_drift.bats exercises ALIGNED/DRIFTED/MISSING plus allowlist and 404→MISSING handling.
Findings
No blocking findings.
- Dependencies verified at head SHA: scripts/seed-repo-template.sh (supports --emit-workflow / --emit-baseline) and scripts/fleet_stub_drift.sh helpers both present.
- gemini-code-assist HIGH thread (set -e exiting before temp-file cleanup) is RESOLVED: main() guards the call with 'template_drift_annotate "$tsv" || rc=$?' so cleanup/return still run.
- Two gemini threads remain marked unresolved but are MOOT against current head: 'set -euo pipefail' is already present (line 2), and the 'base64' dependency check no longer exists (main() checks only gh and git). No action needed.
- Secret-scanning MCP tool unavailable in this environment; diff is shell/YAML/Markdown with no credentials. gitleaks CI check passed.
- Minor (non-blocking): a transient seed-emit failure degrades a file's check to a ::warning:: skip rather than failing — intentional anti-flake behavior, but means a persistent emit failure could silently pass. Acceptable for Phase 1.
CI status
All required checks green: Lint (shellcheck, bats, template-drift, gh-aw-compile, validate-agent-profiles), CI (ShellCheck, secret-scan/gitleaks, CodeQL actions+python), unit-tests, SonarCloud (quality gate passed, 0 new issues), AgentShield, holdout-guard, test-deletion guard. coderabbitai APPROVED at head. CANCELLED/SKIPPED entries are benign (dev-lead ci-relay self-cancel via [skip ci-relay]; dependency-audit ecosystem matrix + dependabot-automerge skipped as non-applicable). mergeStateStatus BLOCKED only pending the requested org-leads human review — expected, not a defect.
Reviewed automatically by the PR-review agent (single-reviewer mode: fable 5). Reply if you need a human review.
|
@donpetry-bot this PR has been idle ~hours with unresolved gemini-code-assist threads blocking merge (required thread resolution), after fix-review attempts stalled under rate-limit/concurrency churn. All required CI is green. Please complete the fix-review pass: address the remaining review threads, resolve them, and provide the approving review so squash auto-merge can land. |
|
@don-petry I'm on it — starting a fresh review now. Results will appear in a few minutes. |
donpetry-bot
left a comment
There was a problem hiding this comment.
Automated review — APPROVED ✓
Risk: MEDIUM
Reviewed commit: 64a59aa268925230a31ec1594083cf65547df844
Review mode: triage-approved (single reviewer)
Summary
Adds a template-drift guard (scripts/template_stub_drift.sh + tests/template_stub_drift.bats + a PR-triggered template-drift job in lint.yml + AGENTS.md docs) implementing #969. The script reuses fleet_stub_drift.sh's byte-identity ALIGNED/DRIFTED/MISSING model to fail CI when a file committed in petry-projects/repo-template diverges from its standards-derived baseline. Triage-approved confirmation: the low-risk assessment holds — clean diff, well tested, all CI green.
Linked issue analysis
Closes #969 — all 4 acceptance criteria met: (1) reuses classify_stub_drift/stub_drift_row from fleet_stub_drift.sh for blob-SHA equality; (2) manifest covers the workflow stubs plus verbatim baselines (dependabot.yml, CODEOWNERS, CLAUDE.md) and excludes ci.yml via a documented TEMPLATE_DRIFT_ALLOWLIST with recorded rationale; (3) wired into the existing PR-triggered Lint workflow (no new cron) with ::error:: annotations naming the file and both short SHAs; (4) tests exercise ALIGNED/DRIFTED/MISSING plus allowlist and 404->MISSING handling.
Findings
No blocking findings.
- All three gemini-code-assist suggestions are already implemented at head 64a59aa: (a) HIGH 'set -e exits before temp-file cleanup' is RESOLVED/OUTDATED — main() guards the call with 'template_drift_annotate "$tsv" || rc=$?' so cleanup/return still run; (b) the 'add set -euo pipefail' thread is MOOT — it is already present on line 2; (c) the 'remove unused base64 dependency check' thread is MOOT — main() now checks only gh and git. The latter two threads remain marked unresolved only because gemini filed them against an earlier commit (aeb29b4) and they were not auto-outdated; their content is in the code. No code action required.
- Workflow safety verified: lint.yml triggers on 'pull_request' (not pull_request_target), 'permissions: contents: read', checkout SHA-pinned (v6.0.3), GH_TOKEN is the default github.token. The drift job only reads cross-repo contents — no injection surface, no secrets.
- Secret-scanning MCP tool unavailable in this environment; diff is shell/YAML/Markdown with no credentials. gitleaks CI check passed.
- Minor (non-blocking, unchanged from prior review): a transient seed-emit failure degrades a file's check to a ::warning:: skip rather than failing — intentional anti-flake behavior; a persistent emit failure could silently pass. Acceptable for Phase 1.
CI status
All required checks green: Lint (shellcheck, bats, template-drift, gh-aw-compile, validate-agent-profiles), CI (ShellCheck, secret-scan/gitleaks, CodeQL actions+python), unit-tests, SonarCloud (quality gate passed, 0 new issues), AgentShield, holdout-guard, test-deletion guard. coderabbitai APPROVED at head. CANCELLED/SKIPPED entries are benign (dev-lead ci-relay self-cancel via [skip ci-relay]; dependency-audit ecosystem matrix + dependabot-automerge skipped as non-applicable). mergeStateStatus BLOCKED reflects required thread-resolution on the two stale-but-moot gemini threads and the pending human review — not a code defect.
Reviewed automatically by the PR-review agent (single-reviewer mode: fable 5). Reply if you need a human review.
Superseded by automated re-review at 64a59aa.
|
|
Advisory bots were rate-limited; auto-approval is withheld until they recover. pr-review-sweep will re-review this PR after 2026-06-28T13:02:24Z. |
Dev-Lead — fix-bot-comment (no-changes)Agent reasoning |
…late stubs diverge from standards/ (#983) * feat: implement issue #969 — [Phase 1] Drift-guard CI: fail when template stubs diverge from standards/ * chore: dev-lead update (review-changes) [skip ci-relay] * chore: dev-lead update (review-changes) [skip ci-relay] --------- Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
…late stubs diverge from standards/ (#983) * feat: implement issue #969 — [Phase 1] Drift-guard CI: fail when template stubs diverge from standards/ * chore: dev-lead update (review-changes) [skip ci-relay] * chore: dev-lead update (review-changes) [skip ci-relay] --------- Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
…late stubs diverge from standards/ (#983) * feat: implement issue #969 — [Phase 1] Drift-guard CI: fail when template stubs diverge from standards/ * chore: dev-lead update (review-changes) [skip ci-relay] * chore: dev-lead update (review-changes) [skip ci-relay] --------- Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
…late stubs diverge from standards/ (#983) * feat: implement issue #969 — [Phase 1] Drift-guard CI: fail when template stubs diverge from standards/ * chore: dev-lead update (review-changes) [skip ci-relay] * chore: dev-lead update (review-changes) [skip ci-relay] --------- Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
…late stubs diverge from standards/ (#983) * feat: implement issue #969 — [Phase 1] Drift-guard CI: fail when template stubs diverge from standards/ * chore: dev-lead update (review-changes) [skip ci-relay] * chore: dev-lead update (review-changes) [skip ci-relay] --------- Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
…late stubs diverge from standards/ (#983) * feat: implement issue #969 — [Phase 1] Drift-guard CI: fail when template stubs diverge from standards/ * chore: dev-lead update (review-changes) [skip ci-relay] * chore: dev-lead update (review-changes) [skip ci-relay] --------- Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
…late stubs diverge from standards/ (#983) * feat: implement issue #969 — [Phase 1] Drift-guard CI: fail when template stubs diverge from standards/ * chore: dev-lead update (review-changes) [skip ci-relay] * chore: dev-lead update (review-changes) [skip ci-relay] --------- Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
…late stubs diverge from standards/ (#983) * feat: implement issue #969 — [Phase 1] Drift-guard CI: fail when template stubs diverge from standards/ * chore: dev-lead update (review-changes) [skip ci-relay] * chore: dev-lead update (review-changes) [skip ci-relay] --------- Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
…late stubs diverge from standards/ (#983) * feat: implement issue #969 — [Phase 1] Drift-guard CI: fail when template stubs diverge from standards/ * chore: dev-lead update (review-changes) [skip ci-relay] * chore: dev-lead update (review-changes) [skip ci-relay] --------- Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
…late stubs diverge from standards/ (#983) * feat: implement issue #969 — [Phase 1] Drift-guard CI: fail when template stubs diverge from standards/ * chore: dev-lead update (review-changes) [skip ci-relay] * chore: dev-lead update (review-changes) [skip ci-relay] --------- Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
…late stubs diverge from standards/ (#983) * feat: implement issue #969 — [Phase 1] Drift-guard CI: fail when template stubs diverge from standards/ * chore: dev-lead update (review-changes) [skip ci-relay] * chore: dev-lead update (review-changes) [skip ci-relay] --------- Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>



Closes #969
Implemented by dev-lead agent. Please review.