Skip to content

feat: implement issue #753 — [Phase 3] Default-off feature flag + regression guard + operator docs for the downstream-impact pass - #787

Merged
don-petry merged 8 commits into
mainfrom
dev-lead/issue-753-20260619-0734
Jun 19, 2026
Merged

don-petry merged 8 commits into
mainfrom
dev-lead/issue-753-20260619-0734

Conversation

@don-petry

Copy link
Copy Markdown
Collaborator

Closes #753

Implemented by dev-lead agent. Please review.

…ression guard + operator docs for the downstream-impact pass
@don-petry
don-petry requested a review from a team as a code owner June 19, 2026 07:43
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Jun 19, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

@don-petry, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 56 minutes and 26 seconds. 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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 refill rate.

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, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 8a02c3e1-7baa-45f0-84cf-e662458e0afb

📥 Commits

Reviewing files that changed from the base of the PR and between e69a2ac and fb1857c.

📒 Files selected for processing (20)
  • .github/workflows/lint.yml
  • AGENTS.md
  • docs/pr-review-agent/documentation-index.md
  • docs/pr-review-agent/downstream-impact.md
  • tests/fixtures/downstream-impact/golden/cases/01-direct-workflow/changed.txt
  • tests/fixtures/downstream-impact/golden/cases/01-direct-workflow/expected.json
  • tests/fixtures/downstream-impact/golden/cases/02-indirect-lib/changed.txt
  • tests/fixtures/downstream-impact/golden/cases/02-indirect-lib/expected.json
  • tests/fixtures/downstream-impact/golden/cases/03-indirect-prompt/changed.txt
  • tests/fixtures/downstream-impact/golden/cases/03-indirect-prompt/expected.json
  • tests/fixtures/downstream-impact/golden/cases/04-shared-source-union/changed.txt
  • tests/fixtures/downstream-impact/golden/cases/04-shared-source-union/expected.json
  • tests/fixtures/downstream-impact/golden/cases/05-mixed/changed.txt
  • tests/fixtures/downstream-impact/golden/cases/05-mixed/expected.json
  • tests/fixtures/downstream-impact/golden/cases/06-no-impact/changed.txt
  • tests/fixtures/downstream-impact/golden/cases/06-no-impact/expected.json
  • tests/fixtures/downstream-impact/golden/cases/07-empty/changed.txt
  • tests/fixtures/downstream-impact/golden/cases/07-empty/expected.json
  • tests/fixtures/downstream-impact/golden/manifest.json
  • tests/test_downstream_impact_regression.bats
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev-lead/issue-753-20260619-0734

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — review-changes (no-changes)

No changes were needed for this PR.

@don-petry
don-petry enabled auto-merge (squash) June 19, 2026 07:43
@donpetry-bot

Copy link
Copy Markdown
Contributor

Advisory bots were rate-limited; auto-approval is withheld until they recover. pr-review-sweep will re-review this PR after 2026-06-19T08:44:19Z.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces the downstream-impact pass feature, which maps changed files in a PR to impacted shared surfaces and downstream consumer repositories. It includes comprehensive documentation, a frozen golden manifest, several test cases, and a new BATS regression test suite (tests/test_downstream_impact_regression.bats) to pin the mapping logic. Feedback on the regression tests highlights a bug where the test suite fails on the empty changed-files case (07-empty) due to a missing changed.txt file, and suggests a more robust way to count directories in BATS without spawning subshells.

Comment thread tests/test_downstream_impact_regression.bats
Comment thread tests/test_downstream_impact_regression.bats
Comment thread tests/test_downstream_impact_regression.bats
@don-petry
don-petry disabled auto-merge June 19, 2026 07:44
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — fix-bot-comment (no-changes)

Agent reasoning
  - 0 Security Hotspots  
  - All measures passed
- **CI Status:** ✅ All checks completed with success
  - bats: ✅ success (regression tests passing)
  - ShellCheck, Lint, CodeQL, Secret scan: ✅ all pass
  - No failures, timeouts, or action-required statuses
- **Reviews:** ✅ No CHANGES_REQUESTED
  - gemini-code-assist[bot]: COMMENTED (feedback only, not blocking)
### Conclusion
The PR has no actionable issues. The SonarCloud bot comment indicates the quality gate has passed cleanly. The gemini-code-assist comment is providing implementation feedback (suggestions about BATS directory counting patterns), but it's not a blocking review state. All CI checks, including the regression test suite (bats), completed successfully.

donpetry-bot
donpetry-bot previously approved these changes Jun 19, 2026

@donpetry-bot donpetry-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review — APPROVED ✓

Risk: LOW
Reviewed commit: 8696017ba1661fbab3a819fae9054b008a8d9f16
Review mode: triage-approved (single reviewer)

Summary

Phase 3 wrap-up for the downstream-impact pass (epic #748, closes #753): adds a golden-fixture bats regression guard, frozen golden manifest + 7 expected-output cases, an operator doc (downstream-impact.md) linked from the documentation index, an AGENTS.md exception note, and registers the new bats file in lint.yml. Pure docs/tests/CI-registration — no runtime or scripts/review-one-pr.sh changes. The default-off flag behavior (AC#1) is exercised by the new off-path no-op tests; the gate itself already lives in scripts/lib/downstream-impact.sh from earlier epic stories.

Linked issue analysis

Closes #753. All four acceptance criteria are mapped to delivered files: (AC#2) regression guard pins the pure mapper against committed golden manifest + expected outputs and is registered in the always-run bats job; (AC#3) operator docs cover what the pass does, the DOWNSTREAM_IMPACT_ENABLED flag, GH_PAT cross-repo read scope, per-PR fetch/size caps, and manifest refresh; (AC#4) AGENTS.md updated with the new test exception and shellcheck is green; (AC#1) off-path no-op verified by two new flag-off tests asserting downstream_impact_triage_section emits nothing. Substantively addressed.

Findings

No blocking findings.

  • gemini-code-assist (COMMENTED, non-blocking) claimed the 07-empty case fails due to a missing changed.txt. This is contradicted by the diff: 07-empty/changed.txt is committed as an empty blob (e69de29bb) and the bats CI job passed green. Concern is moot.
  • gemini also suggested avoiding a subshell when counting case directories in the 'at least one golden case' test — a style nit, not a defect; test passes.
  • MCP secret scan (run_secret_scanning) was unavailable in this environment (permission not granted); not run. The gitleaks CI secret scan passed and the diff is docs + JSON fixtures with no credential-like content, so no secret risk.
  • Note: required CI is green; the only non-success checks (dev-lead dispatch/ci-relay) are CANCELLED self-superseded agent runs, not required gates.

CI status

All required checks green: bats, shellcheck, ShellCheck, Lint, validate-agent-profiles, gh-aw-compile, Compile agentic workflows, Agent Security Scan, Secret scan (gitleaks), CodeQL (actions + python), SonarCloud, unit-tests, AgentShield, holdout-guard, CodeRabbit status — all SUCCESS. CANCELLED entries (dev-lead / dispatch, dev-lead / ci-relay) are superseded Dev-Lead agent runs, not blocking gates. mergeStateStatus is BLOCKED only because org-leads review is still required (this verdict provides it).


Reviewed automatically by the PR-review agent (single-reviewer mode: fable 5). Reply if you need a human review.

@don-petry
don-petry disabled auto-merge June 19, 2026 16:08
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — review-changes (applied)

Changes committed and pushed.

@don-petry
don-petry enabled auto-merge (squash) June 19, 2026 16:13
@don-petry
don-petry disabled auto-merge June 19, 2026 16:17
@don-petry
don-petry enabled auto-merge (squash) June 19, 2026 16:19
@donpetry-bot

Copy link
Copy Markdown
Contributor

Advisory bots were rate-limited; auto-approval is withheld until they recover. pr-review-sweep will re-review this PR after 2026-06-19T17:19:53Z.

@don-petry
don-petry disabled auto-merge June 19, 2026 16:27
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — fix-bot-comment (no-changes)

Agent reasoning
**Tier 1 Blockers:** None exist
- No checks with `failure`, `timed_out`, `cancelled`, `action_required`, `stale`, or `startup_failure` status
- No reviews with `CHANGES_REQUESTED` state
**Review Comments:** The only substantive concern was from gemini-code-assist[bot] about a potential missing `changed.txt` file in the `07-empty` test case. However, the donpetry-bot PR review (now DISMISSED) explicitly addressed this: the file is present as an empty blob (e69de29bb) and the bats CI job passed green. The concern is moot.
## Result
**No changes needed.** This PR has zero actionable issues:
- SonarCloud quality gate is green
- All CI checks pass
- All prior concerns are addressed or resolved
The PR is ready for merge from a code quality and CI perspective.

@don-petry
don-petry enabled auto-merge (squash) June 19, 2026 16:28
donpetry-bot
donpetry-bot previously approved these changes Jun 19, 2026

@donpetry-bot donpetry-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review — APPROVED ✓

Risk: LOW
Reviewed commit: 3c832446c9de27d3cc2150e9efb37d9b99dfa33e
Review mode: triage-approved (single reviewer)

Summary

Phase 3 wrap-up for the downstream-impact pass (epic #748, closes #753): adds a golden-fixture bats regression guard (tests/test_downstream_impact_regression.bats), a frozen golden manifest + 7 expected-output cases, an operator doc (downstream-impact.md) linked from the documentation index, an AGENTS.md test-list exception note, and registers the new bats file in lint.yml. Pure docs/tests/CI-registration — no runtime or review-one-pr.sh changes. +430/-2 across 20 files. Triage tier cleared this as low-risk; this confirmation review agrees.

Linked issue analysis

Closes #753 (Phase 3). Acceptance criteria map to delivered files: (AC#1) default-off cost cap — two new flag-off no-op tests assert downstream_impact_triage_section emits nothing when DOWNSTREAM_IMPACT_ENABLED is unset or false; (AC#2) regression guard pins the pure mapper (compute_downstream_impact) against a frozen, manifest-independent golden manifest + 7 expected outputs, with a catch-all test so new case dirs are auto-pinned, registered in the always-run bats job; (AC#3) operator docs cover what the pass does, the DOWNSTREAM_IMPACT_ENABLED flag, GH_PAT cross-repo read scope, per-PR fetch/size caps, and manifest refresh; (AC#4) AGENTS.md updated with the new test exception and shellcheck/Lint green. Substantively addressed.

Findings

No blocking findings.

  • gemini-code-assist left 3 inline comments (2 medium, 1 low) on the bats file: (a) _assert_golden_case must guard a missing changed.txt for the 07-empty case, (b) drop the strict changed.txt requirement in the catch-all loop, (c) count case dirs with a pure-bash loop instead of ls|wc subshells. All three are resolved in the current HEAD (3c83244): _assert_golden_case now has an 'if [ -f changed.txt ]' guard defaulting to empty; the catch-all loop only requires expected.json; and the 'at least one golden case' test uses a pure-bash for-loop with count=$((count+1)). Author (dev-lead) replied to each thread documenting the fix.
  • Prior bot approval existed on the earlier SHA 8696017 (now DISMISSED); the only changes since are a main merge and the gemini fix commit, both covered above.
  • MCP secret scan (run_secret_scanning) was not run — the tool's permission was not granted in this environment. The gitleaks CI secret scan passed and the diff is docs + JSON fixtures + a bats test with no credential-like content (GH_PAT/GH_TOKEN appear only as variable names in docs), so no secret risk.
  • Org-standards check: adding the new test file to the lint.yml bats list and documenting it in AGENTS.md follows the documented repo-specific exception — compliant.

CI status

All required checks green: bats, shellcheck, ShellCheck, Lint, validate-agent-profiles, gh-aw-compile, Compile agentic workflows, Agent Security Scan, holdout-guard, Secret scan (gitleaks), CodeQL (actions + python), SonarCloud (quality gate passed, 0 new issues), unit-tests, AgentShield, review, CodeRabbit — all SUCCESS. The only non-success entries (dependabot-automerge, several dependency-audit ecosystem jobs, dev-lead ci-relay) are SKIPPED no-op jobs, not blocking gates. mergeStateStatus is BLOCKED only pending the required org-leads review, which this verdict provides.


Reviewed automatically by the PR-review agent (single-reviewer mode: fable 5). Reply if you need a human review.

@don-petry
don-petry disabled auto-merge June 19, 2026 16:49
@don-petry
don-petry enabled auto-merge (squash) June 19, 2026 17:13
@don-petry
don-petry disabled auto-merge June 19, 2026 17:14
@don-petry

Copy link
Copy Markdown
Collaborator Author

Note

I received your request but all AI engines are currently rate-limited. Please re-mention @dev-lead when the rate limit clears (estimated: unknown) — I cannot reconstruct the original instruction automatically.

@don-petry
don-petry enabled auto-merge (squash) June 19, 2026 17:18
@don-petry
don-petry disabled auto-merge June 19, 2026 17:18
@don-petry
don-petry enabled auto-merge (squash) June 19, 2026 17:22
@don-petry
don-petry disabled auto-merge June 19, 2026 17:23
@don-petry
don-petry enabled auto-merge (squash) June 19, 2026 17:27
@don-petry
don-petry disabled auto-merge June 19, 2026 17:28
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — rate-limited (intent: on-mention)

PR: #787
Please re-trigger manually (re-mention @dev-lead) when the rate limit clears — the original request cannot be reconstructed automatically.

@don-petry
don-petry enabled auto-merge (squash) June 19, 2026 17:32
@don-petry
don-petry disabled auto-merge June 19, 2026 17:32
@don-petry

don-petry commented Jun 19, 2026 •

Copy link
Copy Markdown
Collaborator Author
Superseded by automated re-review at fb1857c4641deee68a1f55af7d9fcd27bd3cd608 — click to expand prior review.

Automated review — APPROVED ✓

Risk: LOW
Reviewed commit: `a60d5e5d7a9201d229d3061ba6dad4cad4dc062e`
Review mode: on-mention re-trigger (rate-limit recovery)


Overview

Phase 3 of the downstream-impact pass (epic #748, closes #753). This PR delivers three things with no implementation changes:

  1. Golden-fixture regression guard (tests/test_downstream_impact_regression.bats) — pins the pure mapper's exact JSON output against 7 committed fixture cases
  2. Operator documentation (docs/pr-review-agent/downstream-impact.md) — enable/tune guide for the pass
  3. Scaffolding — adds the test to lint.yml's bats list and documents the exception in AGENTS.md

Code Quality

Regression guard design — well-engineered

  • _assert_golden_case canonicalises both sides with jq -S before comparing, so key-ordering differences from jq don't produce false failures
  • The "golden fixtures must exist and be well-formed" preamble tests prevent the guard from silently turning into a no-op if fixtures are accidentally deleted
  • The catch-all @test "every golden case directory matches its expected output" correctly handles new cases added without a corresponding named @test
  • Both named and catch-all tests run each case (minor duplication), but this gives clearer failure messages from named tests while catch-all future-proofs against additions — acceptable trade-off

Flag-off no-op tests — correct and sufficient for the AC

  • unset DOWNSTREAM_IMPACT_ENABLED and export DOWNSTREAM_IMPACT_ENABLED=false both correctly verify that downstream_impact_triage_section emits nothing when the flag is off — directly proving the Story 5 cost-cap AC
  • The flag-enabled path (DOWNSTREAM_IMPACT_ENABLED=true) is not tested here, but test_downstream_impact_triage_inline.bats (already in the bats list) is the appropriate home for those cases

Empty changed.txt in case 07

  • The file is 0 bytes; cat on it returns "", which compute_downstream_impact correctly handles (produces the empty-but-well-formed object). No issue.

Fixture correctness (spot-checked against the manifest)

  • Case 04 (review-cycle.sh shared by two reusables): review-cycle.sh appears in surface_sources for both pr-review.yml and dev-lead-reusable.yml. The expected union of alpha+bravo+charlie consumers is correct ✓
  • Case 01 (pr-review.yml direct): manifest refs .github-private/.github/workflows/pr-review.yml → strip .github-private prefix → .github/workflows/pr-review.yml → matches alpha and bravo ✓
  • Case 05 (mixed): docs/notes.md is neither a pinned surface nor in surface_sources — correctly lands in unmatched ✓

Potential Issues

None blocking. One observation:

  • changed.txt files are missing trailing newlines (all end with No newline at end of file in the diff). This is cosmetic and has no functional impact since compute_downstream_impact splits on \n and drops blank lines, so a missing trailing newline produces the same result as having one.

Documentation

downstream-impact.md is a well-structured operator guide covering all the key surface areas: enable flag, token scope (clearly states no new secret), fetch/size caps, manifest refresh procedure, and the regression guard. The cap table is particularly useful for operators tuning the pass.


Test Coverage

All 7 golden cases (direct workflow, indirect lib, indirect prompt, shared-source union, mixed, no-impact, empty) together with the flag-off no-op tests give solid coverage of the mapper's behavior matrix. CI confirms the bats job passes on this commit.


Summary: Documentation + tests only; no implementation changes. All CI checks pass. Approved.

@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — on-mention (no-changes)

Engine ran but made no changes.

@don-petry
don-petry enabled auto-merge (squash) June 19, 2026 17:36
@don-petry
don-petry disabled auto-merge June 19, 2026 19:14
@sonarqubecloud

Copy link
Copy Markdown

@don-petry
don-petry enabled auto-merge (squash) June 19, 2026 19:16
@donpetry-bot

Copy link
Copy Markdown
Contributor

Advisory bots were rate-limited; auto-approval is withheld until they recover. pr-review-sweep will re-review this PR after 2026-06-19T20:21:05Z.

@donpetry-bot donpetry-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review — APPROVED ✓

Risk: LOW
Reviewed commit: fb1857c4641deee68a1f55af7d9fcd27bd3cd608
Review mode: triage-approved (single reviewer)

Summary

Phase 3 of the downstream-impact pass (issue #753, epic #748): adds a default-off feature flag's regression coverage and operator docs. Changes are a new golden-fixture bats regression guard (tests/test_downstream_impact_regression.bats), seven golden fixture cases + manifest, an operator guide (docs/pr-review-agent/downstream-impact.md) and doc-index entry, a one-line addition wiring the new test into the always-run bats job in .github/workflows/lint.yml, and an AGENTS.md exception note documenting that wiring. 430 additions / 2 deletions across 20 files, no production logic changes.

Linked issue analysis

Closes #753. The PR delivers exactly the Phase 3 scope: a regression guard pinning the pure mapper output against frozen golden fixtures, plus default-off operator documentation. The flag (DOWNSTREAM_IMPACT_ENABLED) and mapper logic land in earlier phases; this PR adds the guard + docs and includes off-path no-op tests asserting byte-identical behavior when the flag is unset/false. Substantively addressed.

Findings

No blocking findings. The lint.yml change is a single documented test-list addition that matches the pre-existing AGENTS.md exception for repo-specific bats files; not a security smell. Gemini (advisory bot) flagged earlier that _assert_golden_case might fail when changed.txt is absent for the empty case; the merged code already guards this with an 'if [ -f ... ]' fallback and the catch-all loop only requires expected.json, so the concern is resolved (confirmed by green bats/unit-tests checks). MCP secret scan was unavailable this run (permission not granted); the gitleaks CI check is green and scanned content is docs/test/fixture data referencing only env-var names (GH_PAT/GH_TOKEN), no secret material.

CI status

All required checks green: Lint, shellcheck/ShellCheck, bats, unit-tests, CodeQL (actions + python), Secret scan (gitleaks), SonarCloud (Quality Gate passed, 0 new issues), agent-shield, holdout-guard, validate-agent-profiles, gh-aw-compile, dependency-audit. CANCELLED/SKIPPED entries are redundant dev-lead dispatch/ci-relay runs and path-filtered audits, not failures. mergeStateStatus is BLOCKED pending this review.


Reviewed automatically by the PR-review agent (single-reviewer mode: fable 5). Reply if you need a human review.

@donpetry-bot
donpetry-bot dismissed their stale review June 19, 2026 19:28

Superseded by automated re-review at fb1857c.

@don-petry
don-petry merged commit 9cb66bb into main Jun 19, 2026
40 of 50 checks passed
@don-petry
don-petry deleted the dev-lead/issue-753-20260619-0734 branch June 19, 2026 22:42
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.

[Phase 3] Default-off feature flag + regression guard + operator docs for the downstream-impact pass

2 participants