hygiene: validate bash retirement allowlist integrity#5358
Merged
AceHack merged 4 commits intoMay 26, 2026
Conversation
Co-Authored-By: Codex <noreply@openai.com>
…-retirement-allowlist-integrity-20260526
Co-Authored-By: Codex <noreply@openai.com>
…-retirement-allowlist-integrity-20260526
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Pull request overview
This PR hardens the bash-retirement inventory guard (tools/hygiene/check-bash-retirement-inventory.ts) by validating that the retained-shell allowlist itself is sorted and de-duplicated before using it to classify repo .sh drift, and it surfaces integrity counts in the report output.
Changes:
- Add allowlist integrity inspection (duplicate detection + out-of-order detection) and treat integrity drift as a first-class “drift” condition.
- Extend the rendered report with allowlist integrity counts and a dedicated integrity-errors section that suppresses normal drift classification until fixed.
- Add focused Bun tests covering duplicate/unsorted allowlist detection and integrity-error rendering (partial).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| tools/hygiene/check-bash-retirement-inventory.ts | Adds allowlist integrity validation and report rendering for integrity errors/counts. |
| tools/hygiene/check-bash-retirement-inventory.test.ts | Adds tests for allowlist integrity drift and one integrity rendering path. |
| docs/claims/codex-loop-bash-retirement-allowlist-integrity-20260526.md | Adds a live claim artifact (should be released/removed before merge per protocol). |
Comment on lines
+3
to
+24
| claimed-at: 2026-05-26T23:34:00Z | ||
| agent: Codex | ||
| session: codex/launchd-loop | ||
| surface: codex-background-service | ||
| origin: codex-launchd-loop | ||
| run-id: 20260526T232949Z | ||
| branch: claim/codex-loop-bash-retirement-allowlist-integrity-20260526 | ||
| worktree: /Users/acehack/.local/share/zeta-codex-loop/Zeta-worktrees/codex-loop-bash-retirement-allowlist-integrity-20260526 | ||
|
|
||
| ## Scope | ||
|
|
||
| Trajectory: TypeScript / Bun migration. | ||
|
|
||
| Bounded step: harden the bash-retirement inventory guard so the retained shell | ||
| allowlist is itself checked for duplicate or unsorted entries before it is used | ||
| to classify repo `.sh` drift. | ||
|
|
||
| ## Paths | ||
|
|
||
| - tools/hygiene/check-bash-retirement-inventory.ts | ||
| - tools/hygiene/check-bash-retirement-inventory.test.ts | ||
| - docs/claims/codex-loop-bash-retirement-allowlist-integrity-20260526.md |
Comment on lines
+114
to
+118
| test("renders allowlist integrity errors before drift sections", () => { | ||
| const [duplicate, rest] = splitExpectedRetained(); | ||
| const rendered = renderReport(buildInventoryReport(EXPECTED_RETAINED_SHELL, [duplicate, duplicate, ...rest])); | ||
|
|
||
| expect(rendered).toContain("## Retained shell allowlist integrity errors"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.shdriftChecks
bun test tools/hygiene/check-bash-retirement-inventory.test.tsbun run hygiene:check-bash-retirement-inventorynode_modules/.bin/tsc --noEmit -p tsconfig.json