Repository navigation
fix(codex-shim): name the path and chmod fix when a private shim artifact is group-writable - #6680
Conversation
…fact is group-writable
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (4)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review. 📝 WalkthroughWalkthroughUnix shim migration now reports which trust check failed for an artifact. Integration tests cover writable state-file refusal, safely quoted ChangesUnix shim migration
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to The migration hint safely quotes paths and does not weaken the existing refusal checks. No actionable merge risk remains. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files. (2 skipped: 2 unsupported.)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
✅ Deterministic PR hygiene checks passed. |
✅ READY
Review readiness checklist
✅ 4/4 boxes ticked. This pull request has been marked Ready for Review. |
|
Maintainer integration into
|
Summary
ocx codex-shim installrefuses to migrate a legacy in-place Unix shim when~/.opencodex/codex-shim.jsonis group- or world-writable. Older releases wrote that file with the process umask, so a umask of002(the Ubuntu desktop default) left it at0664. The refusal said only "Private Codex artifact is not an owned regular file". It named neither the file nor the reason, whileocx codex-shim statuskept advising the sameocx codex-shim install.The trust check in
snapshot()is unchanged. Its refusal now names the path and the failed condition: not a regular file, owned by another uid, or group/world-writable with its mode. For the writable case it also gives the exact fix, for example:OpenCodex deliberately does not loosen the check or chmod the file itself. The CLI reference documents the refusal next to the legacy-migration paragraph.
Refs #6668. This delivers the "at minimum" outcome listed in the issue. Automatic tightening of the legacy state file is left to maintainers' judgement, because it would relax a trust boundary.
Verification
bun run typecheck: passbun run structure:check: passbun run privacy:scan: passtests/codex-integration/codex-shim-migration.test.ts. A0664legacy state file refuses with the path, the mode and the chmod hint, and leaves the state and the legacy wrapper untouched. Afterchmod 600, migration commits schema 2. The case fails without the source change.bun test tests/codex-integration/codex-shim*plustests/ci-workflows/skill-ocx-generated.test.tsandtests/ci-workflows/file-size-ratchet.test.ts, with umask 022 and no proxy env vars: all pass. With the machine's umask 002, 7 shim tests fail identically on unchangeddev. Their fixtures create private homes that inherit the umask.chmod 600and a successful migration.bun run testlocally (memory limits on this machine). I'm leaving it to CI.Maintainer sweep refresh (head
159d4f7704)Refreshed by the maintainer compat sweep (lane D): merged
origin/dev38455fb245into the branch (no force-push) and added159d4f7704:chmod 600clears only the group/world-writable refusal; symlink and foreign-owner refusals remain.tests/codex-integration/codex-shim-migration.test.tsruns the printed hint through/bin/shfor a state path containing a space and an apostrophe, then checks mode0600and the schema-2 migration.structure/runtime.mdnames the refusal contract and its test.Commands on this head:
bun test tests/codex-integration/codex-shim-migration.test.ts23 pass / 0 fail;bun test tests/test-layout.test.ts tests/test-layout-tooling.test.ts tests/ci-workflows/file-size-ratchet.test.ts27 pass / 0 fail;bun run typecheckexit 0;bun run structure:checkpass; docs-sitebun run buildpass. An independent review re-ran 92 related tests (0 fail) and confirmed the new assertions fail against the old refusal. The full local suite was not run because parallel lanes share this machine; the rest is left to hosted CI on this head.Checklist
reference/cli/lifecycle.md)Review readiness checklist
This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:
Required local validation passed; commands, results, and any full-suite exception are documented.
I pushed my PR to a recent dev commit (at most 10 behind; a maintainer may still ask for the exact tip before merge).
I resolved all correct Codex and CodeRabbit findings.
My PR is ready for review.
Summary by CodeRabbit
chmod 600command. OpenCodex does not change the file’s permissions; migration can proceed after you correct them.