Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .claude/review/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,53 @@ engine:
# locally, so no CI workflow reviews its PRs.
reviews_run: local

# People-only approval: the bot never approves a PR that touches these paths.
# Keep this list in step with the owned paths in .github/CODEOWNERS.
human_approval:
paths:
# The review's own rules: what the bot and CI check
- '.github/**'
- '.husky/**'
- '.gitleaksignore'
- 'CLAUDE.md'
- 'AGENTS.md'
# All of .claude except the review's outcome logs, as in CODEOWNERS. A bare * also
# matches subfolders, so each level names what it skips with !( ).
- '.claude/!(review)'
- '.claude/!(review)/**'
- '.claude/review/!(learnings)'
- '.claude/review/!(learnings)/**'
- '.claude/review/learnings/!(feedback|feedback.jsonl)'
- '.claude/review/learnings/!(feedback)/**'
- '.claude/review/learnings/feedback/**/!(*.jsonl)'
- '.eslintrc*'
- '.eslintignore'
- 'jest.config.js'
- '__tests__/util/setup.ts'
- 'scripts/jest-shards/*.js'
- 'tsconfig.json'
# Sign-in, page access, and clearing one user's data before the next
- 'pages/api/auth/**'
- 'pages/api/stop-impersonating.page.ts'
- 'pages/api/utils/cookies.ts'
- 'pages/api/utils/pagePropsHelpers.ts'
- 'src/components/CacheRestoreGate/**'
- 'src/lib/apollo/persistence/**'
- 'src/lib/clearSessionData.ts'
- 'src/sw/**'
- 'src/lib/serviceWorker/**'
- 'serwist.config.mjs'
# Code that puts the user's API token on outgoing calls
- 'src/lib/apollo/link.ts'
- 'pages/api/graphql-rest.page.ts'
- 'pages/api/uploads/**'
- 'pages/api/csv-update.page.ts'
# Build and deploy config, where secrets are in reach
- 'next.config.ts'
- 'amplify.yml'
- '.yarnrc.yml'
- '.yarn/releases/**'

# Reports approve by default (`advisory`). Set `shadow` to post advice only. This repo is
# local-only, so there is no CI caller and this key is the only place the mode lives.
# auto_approve in .github/workflows/agent-review-approve.yml decides whether a passing
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{"ts":"2026-11-20T22:03:10.101Z","reviewId":"address-2317","id":"f8","signature":"61a0c5ebae05","agent":"code-review","category":"security","severity":4,"file":".claude/review/config.yml","message":"Non-jsonl files under .claude/review/learnings/feedback/ are neither reviewed nor gated, while CODEOWNERS still owns them.","outcome":"accepted"}
{"ts":"2026-11-20T22:03:10.102Z","reviewId":"address-2317","id":"f9","signature":"12eb0234a117","agent":"code-review","category":"security","severity":4,"file":".claude/review/config.yml","message":"The hand-picked .claude patterns do not cover everything CODEOWNERS owns under /.claude/, so new .claude files (for example .claude/statusline.sh or .claude/review/metrics/**) can be bot-approved. The comment saying every .claude path is covered is not true.","outcome":"accepted"}
{"ts":"2026-11-20T22:03:10.102Z","reviewId":"address-2317","id":"f10","signature":"fc68f432c293","agent":"standards","category":"docs-drift","severity":4,"file":".github/CODEOWNERS","message":"CODEOWNERS header still says \"This file is the one list\", and CLAUDE.md line 196 still says \"add or remove paths there, not here\". Both now conflict with the new mirrored list and the \"change both together\" rule.","outcome":"accepted"}
{"ts":"2026-11-20T22:03:10.102Z","reviewId":"address-2317","id":"f11","signature":"4fbedab45ab4","agent":"code-review","category":"conventions","severity":4,"file":"CLAUDE.md","message":"The edited paragraph still says CODEOWNERS is the one list and to change paths only there, then says to change both. It also says human_approval mirrors CODEOWNERS, which is not exactly true.","outcome":"accepted"}
{"ts":"2026-11-20T22:03:10.102Z","reviewId":"address-2317","id":"f12","signature":"43816f107c30","agent":"standards","category":"style","severity":3,"file":".claude/review/config.yml","message":"The new header comment is a single ~115 char line, while the surrounding comments wrap near 90 chars across lines.","outcome":"accepted"}
{"ts":"2026-11-20T22:03:10.102Z","reviewId":"address-2317","id":"f13","signature":"712b0c85e859","agent":"code-review","category":"conventions","severity":3,"file":".github/PULL_REQUEST_TEMPLATE.md","message":"The PR template still asks that the bot has approved, which can never happen on a one-way-door PR now. The next line does ask for a person on one-way doors, so the impact is small.","outcome":"accepted"}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{"ts":"2026-11-24T15:22:24.538Z","reviewId":"address-2317","id":"f1","signature":"bac9473d922a","agent":"security","category":"security","severity":5,"file":".claude/review/config.yml","message":"The list now owns the saved Apollo cache (persistence/**, CacheRestoreGate/**) to stop one person's data reaching the next user, but the code that wipes that data on sign-out (src/lib/clearSessionData.ts) and the service worker rules that keep token-bearing and donor responses out of the browser cache (src/sw/**, src/lib/serviceWorker/**) are outside both lists, so the bot can approve a change that leaves the last user's data behind.","outcome":"accepted"}
{"ts":"2026-11-24T15:22:24.543Z","reviewId":"address-2317","id":"f12","signature":"e3d77c88c77e","agent":"standards","category":"docs-drift","severity":3,"file":"CLAUDE.md","message":"\"Add or remove a path in both files together, not here. It covers:\" now ends on \"here\", so \"It\" reads as CLAUDE.md instead of the CODEOWNERS list.","outcome":"accepted"}
{"ts":"2026-11-24T15:22:24.543Z","reviewId":"address-2317","id":"f14","signature":"647a8aab3645","agent":"code-review","category":"conventions","severity":2,"file":".claude/review/config.yml","message":"The new header comment runs 4 lines and the .claude carve-out comment runs 3, longer than the one-to-two-line comment rule.","outcome":"accepted"}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{"ts":"2026-11-24T15:30:06.740Z","reviewId":"address-2317","id":"f1","signature":"160be2e542b2","agent":"code-review","category":"security","severity":6,"file":".claude/review/config.yml","message":"serwist.config.mjs, which controls what the service worker precaches (including the precachePrerendered: false guard on page HTML), is not in human_approval or CODEOWNERS. The service worker cache rules this pass sets out to gate can still change through a bot-approved PR.","outcome":"accepted"}
{"ts":"2026-11-24T15:30:06.774Z","reviewId":"address-2317","id":"f6","signature":"89d95c7ab9c4","agent":"code-review","category":"conventions","severity":3,"file":"CLAUDE.md","message":"The new CLAUDE.md bullet says the list covers the service worker's cache rules, but serwist.config.mjs is not listed, so the doc claims more than the gates enforce.","outcome":"accepted"}
81 changes: 36 additions & 45 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,52 +1,43 @@
# Only one-way-door paths need a code owner; there is no * line, so the rest can merge on the agent-review approval.
# pr-guard also labels PRs one-way-door from these paths. This file is the one list; CLAUDE.md only says what it covers.
# Only these paths need a code owner; there is no * line, so the rest can merge on the agent-review approval.
# pr-guard labels PRs one-way-door from these paths. human_approval in .claude/review/config.yml mirrors them; change both together.

# HR tools and their pages: goal, NS and PDS calculators, salary, ASR, MHA, savings fund, HCM data
/src/components/HrTools/ @CruGlobal/mpdx-developers
/pages/accountLists/*/hrTools/ @CruGlobal/mpdx-developers
# The review's own rules: what the bot and CI check
/.github/ @jbirdjavi @jeff-clay @EJTison
/.husky/ @jbirdjavi @jeff-clay @EJTison
/.gitleaksignore @jbirdjavi @jeff-clay @EJTison
/CLAUDE.md @jbirdjavi @jeff-clay @EJTison
/AGENTS.md @jbirdjavi @jeff-clay @EJTison
/.claude/ @jbirdjavi @jeff-clay @EJTison
/.eslintrc* @jbirdjavi @jeff-clay @EJTison
/.eslintignore @jbirdjavi @jeff-clay @EJTison
/jest.config.js @jbirdjavi @jeff-clay @EJTison
/__tests__/util/setup.ts @jbirdjavi @jeff-clay @EJTison
/scripts/jest-shards/*.js @jbirdjavi @jeff-clay @EJTison
/tsconfig.json @jbirdjavi @jeff-clay @EJTison

# Reports that read HCM data, and their pages
/src/components/Reports/MPGAIncomeExpensesReport/ @CruGlobal/mpdx-developers
/src/components/Reports/StaffExpenseReport/ @CruGlobal/mpdx-developers
/pages/accountLists/*/reports/mpgaIncomeExpenses/ @CruGlobal/mpdx-developers
/pages/accountLists/*/reports/staffExpense/ @CruGlobal/mpdx-developers
# Sign-in, page access, and clearing one user's data before the next
/pages/api/auth/ @jbirdjavi @jeff-clay @EJTison
/pages/api/stop-impersonating.page.ts @jbirdjavi @jeff-clay @EJTison
/pages/api/utils/cookies.ts @jbirdjavi @jeff-clay @EJTison
/pages/api/utils/pagePropsHelpers.ts @jbirdjavi @jeff-clay @EJTison
/src/components/CacheRestoreGate/ @jbirdjavi @jeff-clay @EJTison
/src/lib/apollo/persistence/ @jbirdjavi @jeff-clay @EJTison
/src/lib/clearSessionData.ts @jbirdjavi @jeff-clay @EJTison
/src/sw/ @jbirdjavi @jeff-clay @EJTison
/src/lib/serviceWorker/ @jbirdjavi @jeff-clay @EJTison
/serwist.config.mjs @jbirdjavi @jeff-clay @EJTison

# Sign-in, impersonation, page access gates, auth cookies, file uploads and the Apollo clients
/pages/api/auth/ @CruGlobal/mpdx-developers
/pages/api/stop-impersonating.page.ts @CruGlobal/mpdx-developers
/pages/api/utils/cookies.ts @CruGlobal/mpdx-developers
/pages/api/uploads/ @CruGlobal/mpdx-developers
/src/lib/apollo/link.ts @CruGlobal/mpdx-developers
/src/lib/apollo/client.ts @CruGlobal/mpdx-developers
/src/lib/apollo/ssrClient.ts @CruGlobal/mpdx-developers
/pages/api/utils/pagePropsHelpers.ts @CruGlobal/mpdx-developers
# Code that puts the user's API token on outgoing calls
/src/lib/apollo/link.ts @jbirdjavi @jeff-clay @EJTison
/pages/api/graphql-rest.page.ts @jbirdjavi @jeff-clay @EJTison
/pages/api/uploads/ @jbirdjavi @jeff-clay @EJTison
/pages/api/csv-update.page.ts @jbirdjavi @jeff-clay @EJTison

# REST proxy and CSV import
/pages/api/graphql-rest.page.ts @CruGlobal/mpdx-developers
/pages/api/Schema/ @CruGlobal/mpdx-developers
/pages/api/csv-update.page.ts @CruGlobal/mpdx-developers

# Monitoring and safety nets
/src/lib/dataDog.ts @CruGlobal/mpdx-developers
/scripts/safety-nets/ @CruGlobal/mpdx-developers

# Guardrail files and build config
/.github/ @CruGlobal/mpdx-developers
/.husky/ @CruGlobal/mpdx-developers
/.claude/ @CruGlobal/mpdx-developers
**/CLAUDE.md @CruGlobal/mpdx-developers
**/AGENTS.md @CruGlobal/mpdx-developers
/.gitleaksignore @CruGlobal/mpdx-developers
/.eslintrc* @CruGlobal/mpdx-developers
/amplify.yml @CruGlobal/mpdx-developers
/next.config.ts @CruGlobal/mpdx-developers
/.yarnrc.yml @CruGlobal/mpdx-developers
/jest.config.js @CruGlobal/mpdx-developers
/tsconfig.json @CruGlobal/mpdx-developers
/.eslintignore @CruGlobal/mpdx-developers
/__tests__/util/setup.ts @CruGlobal/mpdx-developers
/scripts/jest-shards/*.js @CruGlobal/mpdx-developers
/.yarn/releases/ @CruGlobal/mpdx-developers
# Build and deploy config, where secrets are in reach
/next.config.ts @jbirdjavi @jeff-clay @EJTison
/amplify.yml @jbirdjavi @jeff-clay @EJTison
/.yarnrc.yml @jbirdjavi @jeff-clay @EJTison
/.yarn/releases/ @jbirdjavi @jeff-clay @EJTison

# agent-review's address step commits these outcome logs on PR branches; no owner, so they never make a PR one-way-door
/.claude/review/learnings/feedback/*.jsonl
Expand Down
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Findings I did not fix, and why:
- [ ] My PR title is the work item key, then a summary of 80 characters or less (example: `MPDX-1234 Add sortable columns`)
- [ ] I have applied the appropriate labels (_Add the label "Preview Environment" to automatically create a preview environment_)
- [ ] I have run the Claude Code `/agent-review:review` command locally and fixed each finding or listed it above
- [ ] The `github-actions` bot has approved the PR (it approves once `/agent-review:review` leaves no open blockers)
- [ ] The `github-actions` bot has approved the PR (it approves once `/agent-review:review` leaves no open blockers; it never approves a one-way door)
- [ ] I have asked a person to review, if this is a one-way door (it touches a path `.github/CODEOWNERS` gives an owner)
- [ ] I have tested my changes in preview or in staging
- [ ] I have cleaned up my commit history
15 changes: 8 additions & 7 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,15 +193,16 @@ Critical environment setup:

## One-way-door paths

A mistake here gets money math or HR data wrong, breaks sign-in, leaks a secret, or switches off a guardrail. Work that touches these uses the stricter setup in `.claude/skills/implement/SKILL.md`, and a person from the code owners must approve the PR.
These are the places where a person's approval adds something the bot and CI can't. A mistake here could switch off a guardrail, show one person's data to someone else, or leak a token or secret, and none of that can be taken back. Work that touches these uses the stricter setup in `.claude/skills/implement/SKILL.md`, and a code owner must approve the PR.

`.github/CODEOWNERS` is the one list of exact paths. A path is a one-way door when CODEOWNERS gives it an owner; the few lines with no owner at the end are carve-outs. pr-guard reads it to set the one-way-door label, so add or remove paths there, not here. It covers:
`.github/CODEOWNERS` holds the exact paths. A path is a one-way door when CODEOWNERS gives it an owner; the two lines with no owner at the end are carve-outs. pr-guard reads it to set the one-way-door label. `human_approval` in `.claude/review/config.yml` lists the same paths so the agent-review bot never approves these PRs. Add or remove a path in both files together, not here. The list covers:

- HR tools, the reports that read HCM data, and their pages
- Sign-in, impersonation, page access gates, auth cookies, file uploads and the Apollo clients
- The REST proxy and CSV import
- Monitoring and safety nets
- Guardrail files and build config: CI, hooks, Claude config, CLAUDE.md, AGENTS.md, the gitleaks ignore list, lint, test, TypeScript, Yarn and Next.js config, and Amplify
- The review's own rules: CI, hooks, Claude config, the root CLAUDE.md and AGENTS.md, the gitleaks ignore list, and lint, test and TypeScript config
- Sign-in, page access, and clearing one user's data before the next: the saved Apollo cache, the sign-out wipe and the service worker's cache rules
- The code that puts the user's API token on outgoing calls
- Build and deploy config where secrets are in reach: Next.js, Amplify and Yarn

HR tools and the HCM reports are not on the list. Tests, the AI review and a check on staging cover their math, not a person's approval.

Tests follow their folder: a test inside an owned folder is a one-way door too. A test next to a single owned file is not, unless CODEOWNERS lists it.

Expand Down
Loading