Skip to content

feat(claude-permissions): retire the ~/.claude.json Read denies from the floor - #519

Merged
kyle-sexton merged 4 commits into
mainfrom
chore/allow-reading-claude-json
Sep 4, 2026
Merged

kyle-sexton merged 4 commits into
mainfrom
chore/allow-reading-claude-json

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

No linked issue: operator-directed change to the permission floor, raised while reconciling a machine's Claude settings before a chezmoi apply.

Summary

Retires the two ~/.claude.json Read() denies from the fleet permission floor. The operator needs that file readable and writable by first-class tools; this is the layer that owns the rule, so removing it downstream would have been undone by the next sync.

Fix

Removes Read(**/.claude.json) and Read(~/.claude.json) from claudePermissions.deny, and moves both patterns from required_read_denies to forbidden_read_denies in the component test so a later sync cannot silently reintroduce them. This mirrors exactly how the settings.local.json rows were retired, for the same mechanical reason.

The reasoning, recorded in the README:

  • A Read deny also blocks Edit and Write on the same path, per the permissions docs. So the rows blocked the documented way to manage the file, not just reads of it. That is the same defect that retired the settings.local.json rows.
  • Official docs record that a Read/Edit denial does not apply to a subprocess that opens the file itself. A one-line jq read was always available, so the rows constrained the first-class tools without being a boundary against a determined reader.
  • Read() rules are path/glob only. No rule could keep the sign-in session and MCP server configuration denied while leaving the rest reachable, so the choice was all or nothing.

The file does still hold sign-in session state and MCP server configuration. That material is now protected by operator judgement rather than by a floor rule that could not express the distinction, and any consumer wanting the old posture can re-add either spelling to its own deny list. The README states this plainly rather than leaving it implied.

Verification

  • bash components/claude-permissions/claude-permissions.test.sh: 17 assertions, all pass, including the four deny omits checks that now cover both retired .claude.json spellings alongside the two settings.local.json ones.
  • jq empty components/claude-permissions/claude-permissions.json: valid, and grep -c 'claude\.json' on the component returns 0.
  • npx markdownlint-cli2 components/claude-permissions/README.md: 0 issues. typos components/claude-permissions/: clean.

Related

  • melodic-software/dotfiles#631, which consumes this floor through the sync and carries the matching downstream artifact change.

🤖 Generated with Claude Code

…the floor

Both spellings blocked Edit and Write on the same path, not only reads, so the
floor prevented the documented way to manage the file rather than merely
protecting it. Official docs also record that a Read/Edit denial does not apply
to a subprocess that opens the file itself, so a one-line jq read was always
available and the rows only ever constrained the first-class tools.

Read() rules are path/glob only, so no rule could keep the sign-in session and
MCP server fields denied while leaving the rest reachable. The choice was all or
nothing. The file's sensitive material is now protected by operator judgement,
and a consumer that wants the old posture can re-add either spelling to its own
deny list.

Moves both patterns from required_read_denies to forbidden_read_denies so a
future sync cannot silently reintroduce them, matching how the settings.local.json
rows were retired for the same mechanical reason.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-03T18:54:43.646027Z 44fd03d PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@claude

claude Bot commented Sep 3, 2026 •

Copy link
Copy Markdown

Claude finished @kyle-sexton's task in 3m 8s —— View job


Review complete

Reviewed the diff (git diff origin/main...HEAD), the full claude-permissions.json, claude-permissions.test.sh, and README.md, and cross-checked for other .claude.json references in the repo (none outside these two files, so no drift left behind).

  • Gather context (PR body, changed files)
  • Fetch diff against origin/main
  • Read changed files in full
  • Analyze for correctness / maintainability issues
  • Post inline findings
  • Post final summary

Findings (2, both minor):

  1. Spelling-convention drift: "judgement" (British) at README.md:36 and claude-permissions.test.sh:93 vs. the repo-wide "judgment" (American) used in 36 other files — flagged inline on both lines.

  2. Possible doc self-inconsistency (not anchored to a changed line — the affected text is pre-existing): README.md:268 states removals need "exactly two arguments" (built-in read-only coverage, or a non-resolving command name), both of which are shaped for allow command-rule removals. This PR removes two deny Read() rows using a third, unlisted argument — collateral blocking of Edit/Write on the same path — the same argument already used for the settings.local.json precedent this PR explicitly mirrors. The two listed arguments don't apply to path-glob deny rules at all (there's no "resolves to no executable" concept for a Read() glob), so the scoping is inferable from context, but given how explicit this file otherwise is about disambiguating edge cases, a one-line scope note ("the two-argument test above applies to allow removals; deny removals are justified case-by-case, e.g. collateral blocking of Edit/Write") would close the gap for future reviewers applying "Change discipline" literally. Non-blocking — this is documentation clarity only, and the change itself is sound.

No correctness issues found. The JSON edit, test-assertion move (required_read_denies → forbidden_read_denies), and README rationale are internally consistent with each other and with the settings.local.json precedent this PR mirrors; the deny-removal not needing a withdraw tombstone is also correctly consistent with the README's existing explanation (lines 169–175) that the active consumer force-sets deny each apply.

Branch: chore/allow-reading-claude-json

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 44fd03daa6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread components/claude-permissions/README.md Resolved
Comment thread components/claude-permissions/README.md Resolved
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

Claude has reviewed this PR 1 time. The lane skips further automatic reviews after 5; deleting this comment resets the count.

…he repo's spelling

Review follow-up on two valid findings.

The settings.local.json entry still asserted that `.claude.json` "stay[s]
denied" and referred to "both remaining patterns", which contradicted the
retirement recorded one entry above. Rewritten so the skillUsage point reads as
moot rather than as a live residual, since nothing in the floor distinguishes
one key of that file from another now.

"judgement" is the British spelling and this repo uses "judgment" in 35 files
with no prior use of the other form. Aligned in the README and the test comment.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
kyle-sexton added a commit that referenced this pull request Sep 3, 2026
…ation flags (#520)

No linked issue: found while driving #519, whose CI was red for a reason
unrelated to its diff.

## Summary

`main` is red on `pr-convention-lockstep`, and has been since
2026-09-02, on a gate that has not actually drifted. The check stopped
being able to *read* the reusable and reported that as drift. This
restores it.

## Fix

`parseGatePatterns` matched the gate's regex declarations with a literal
`/i;` terminator. melodic-software/ci-workflows commit `3e32b0a` made
`CLOSING_KEYWORD` global, `/gi;`, so every occurrence on a line can be
classified. The match then failed and the check raised `gate reusable:
CLOSING_KEYWORD / NO_ISSUE_MARKER regex declarations not found`, which
reads as drift but is a parse failure.

Declaration flags were never part of the contract this check enforces.
Only the pattern *body* is extracted, and both probes are rebuilt with
`"i"` regardless, so pinning the flag set asserted an incidental detail
of how the reusable happened to be written on the day the parser was
authored. The matcher now accepts any valid flag set. Drift detection is
unchanged and still functional: the extracted body is probed against
every policy keyword and marker, so a keyword surviving only in a
comment still fails.

Why `main` went red without anyone touching it: this repo's last CI run
on `main` was 2026-09-02T06:04Z and the ci-workflows commit landed at
06:48Z, 44 minutes later. No run had observed it until #519 opened.

## Verification

- Reproduced on `main`'s own tree before changing anything: `node
components/pr-convention-policy/lockstep-drift.mjs` against live sources
fails with the exact CI message.
- With the fix, the same live run reports `pr-convention lockstep: all
copies and caller pins match policy.json` and exits 0. That is the
load-bearing check that no *real* drift was hiding behind the parse
failure, so this is not a detector being loosened to hide a problem.
- `npm run test:pr-convention-lockstep`: 14 tests, 14 pass.
- Red under mutation, which this suite's design calls for: reverting
only the parser change and re-running leaves 13 passing and fails
exactly the new `declaration flags are not part of the contract` test.
- The new test asserts the substantive properties rather than the
message: a `gi`-declared gate still yields probes that match `Closes
#12` and `No linked issue`, the rebuilt probe is not global, and the
extracted body is identical whichever flags were declared.

Two commits, deliberately. `e11eb1c` is mechanical Biome formatting plus
three per-call `noConsole` suppressions for the CLI entrypoint; it
landed on its own because these files had never been Biome-formatted.
The CI Biome job scopes itself to a path list that excludes this
component while the lefthook lane globs every staged JS/TS file, so any
edit here drags the accumulated formatting diff in. `4344d9a` is the
actual fix. Reviewing the second commit alone is sufficient, and the
first is verified behavior-neutral: after it, the live check still
failed with exactly the original error and the 13 pre-existing tests
still passed.

## Related

- #519, blocked by this failure; it touches
only `components/claude-permissions` and is otherwise green.
- melodic-software/ci-workflows `3e32b0a`, the upstream change that
exposed the brittleness. It is correct and needs no revert.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
@kyle-sexton
kyle-sexton merged commit f89a2f1 into main Sep 4, 2026
1 check passed
@kyle-sexton
kyle-sexton deleted the chore/allow-reading-claude-json branch September 4, 2026 00:55
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.

1 participant