Skip to content

docs(distribution): expand the escape-hatch index; deny PowerShell lefthook bypass - #432

Merged
kyle-sexton merged 2 commits into
mainfrom
chore/sync-audit-phase3-escape-hatches
Aug 19, 2026
Merged

kyle-sexton merged 2 commits into
mainfrom
chore/sync-audit-phase3-escape-hatches

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

Closes #431

Phase 3.4 of the standards-sync-audit remediation (plan: docs/topics/standards-sync-audit/PLAN.md, Phase 3 approved 2026-08-19).

What

  • distribution/ESCAPE-HATCHES.md: adds the engine target-filter section (--targets for matrix/plan only — validate hard-rejects all filters; --target/--target-root for mappings/dest-paths/apply with the origin-identity check noted) and the Lefthook section (durable skip: true per lefthook-base vs the one-off human LEFTHOOK=0 bypass with the PowerShell $env:LEFTHOOK = '0' shape; agent deny floor stated for both shells).
  • distribution/README.md Commands: names the single-target flags and points at the index.
  • components/claude-permissions/claude-permissions.json: adds PowerShell(*env:LEFTHOOK*) — the three Bash LEFTHOOK denies anchor on the inline-env spelling (LEFTHOOK=0 cmd) that PowerShell lacks, so PowerShell agent sessions were not actually deny-floored from the bypass; one env-var-reference-anchored glob covers $env:LEFTHOOK = '0', Set-Item env:LEFTHOOK …, and ${env:LEFTHOOK} = … (whole-string globs, * only — precision costs coverage). Test asserts all four lefthook deny rows.

Verification

  • bash components/claude-permissions/claude-permissions.test.sh green incl. the four new assertions.
  • lychee + markdownlint green locally via pre-commit; deny list stays ASCII-sorted.
  • Post-merge: the sync PR to dotfiles (sole claude-permissions target) should carry a claude-permissions.json-only diff — currently DEFERRED: sync runs fail at attest (App installation 14 repos vs manifest 11, PR feat(distribution): Phase 4 fleet expansion — three new sync targets #428 aftermath) until the installation set is reconciled.

Related

  • Audit topic: docs/topics/standards-sync-audit/ (Phase 3.4)

🤖 Generated with Claude Code

https://claude.ai/code/session_013NhxMDn7vZdbs7Cq32m56M

…fthook bypass

ESCAPE-HATCHES.md grows the engine target-filter section (--targets for
matrix/plan; --target/--target-root for the single-target commands —
validate accepts no filters) and the Lefthook skip section (durable
skip: true vs the one-off LEFTHOOK=0 env bypass, PowerShell shape
included). The README Commands section now names the single-target
flags and points at the index.

claude-permissions gains PowerShell(*env:LEFTHOOK*): the Bash denies
anchor on the inline-env spelling PowerShell lacks, so a literal twin
could never match — the env-var-reference anchor covers assignment,
Set-Item, and brace forms in one whole-string glob. Test coverage
asserts all four lefthook deny rows.

Closes #431

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013NhxMDn7vZdbs7Cq32m56M
@claude

claude Bot commented Aug 19, 2026 •

Copy link
Copy Markdown

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


Claude's review of PR #432

  • Gather context (diff, CLAUDE.md, changed files)
  • Run /review:code-review procedure (skill didn't load instructions in this run — reviewed manually against the same correctness/maintainability bar)
  • Post findings

Summary

Scoped, well-documented change. Verified the new --targets/--target/--target-root documentation in ESCAPE-HATCHES.md against the actual flag parsing and command dispatch in distribution/sync-manifest.sh (lines ~1030-1080) — the descriptions of which flags each engine command accepts, the validate hard-reject, and the apply origin-identity check all match the implementation exactly. distribution/README.md's cross-link and the ## Commands anchor also check out.

Finding

One correctness concern, posted inline on components/claude-permissions/claude-permissions.json#L224:

The new PowerShell(*env:LEFTHOOK*) deny rule is a case-sensitive substring glob (per components/claude-permissions/README.md lines 149-151, these rules have no case-folding). PowerShell's env: drive is case-insensitive, so $env:LEFTHOOK, $Env:LEFTHOOK, and $ENV:LEFTHOOK are all equivalent in real PowerShell — but only the exact-case spelling matches this glob. $Env:LEFTHOOK = '0' (a casing Microsoft's own docs use) would not be caught by this deny rule as written.

If Claude Code's permission matcher doesn't separately case-fold PowerShell() rules, this PR's central claim — that PowerShell sessions are now fully deny-floored from the LEFTHOOK bypass — only holds for one casing, and both distribution/ESCAPE-HATCHES.md ("every env:LEFTHOOK reference in PowerShell") and the PR description overstate the coverage. Worth confirming the matcher's actual case behavior; if it is case-sensitive, the fix likely mirrors the Bash side's approach of listing multiple value-casing variants (=0/=FALSE/=false) — i.e. add casing-variant deny entries (or a case-insensitive mechanism) plus corresponding assertions in claude-permissions.test.sh.

Everything else — the JSON's ASCII sort order, the test assertions' logic against the actual deny array, and the new doc sections — held up under inspection.
· branch

@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: 1a0e3df0fc

ℹ️ 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 distribution/ESCAPE-HATCHES.md Resolved
@github-actions

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.

…oped doc example

Review findings: PowerShell's Env: drive is case-insensitive while
permission rules are literal whole-string globs, so the single
env:LEFTHOOK anchor left $Env:/$ENV:/lowercase spellings undenied.
Two anchors now cover the realistic shapes — *LEFTHOOK* for every
uppercase-name reference regardless of drive casing, *:lefthook* for
drive-qualified lowercase without denying bare lefthook invocations;
the exotic mixed-case residual is recorded in the test comment. The
ESCAPE-HATCHES PowerShell example now unsets the session-scoped
variable after the commit.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013NhxMDn7vZdbs7Cq32m56M
@kyle-sexton
kyle-sexton merged commit 5a93a99 into main Aug 19, 2026
1 check passed
@kyle-sexton
kyle-sexton deleted the chore/sync-audit-phase3-escape-hatches branch August 19, 2026 15:25
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.

Expand the escape-hatch index and close the PowerShell lefthook-bypass deny gap

1 participant