Skip to content

fix: confine managed layout destinations before writes - #10

Merged
Andyduck-ops merged 1 commit into
mainfrom
fix/code-layout-destinations
Oct 11, 2026
Merged

Andyduck-ops merged 1 commit into
mainfrom
fix/code-layout-destinations

Conversation

@Andyduck-ops

Copy link
Copy Markdown
Owner

Correction

Addresses the linked workflow/code ancestor finding from #9 before npm release.

  • Reuse the existing generic destination confinement primitive for planned init writes and config/hash metadata.
  • Check resolved update targets before backup and before direct execution, including actual .new destinations and protected-data handling.
  • Preserve dry-run, skip, customization and deliberate-deletion behavior.
  • Add real consumer regressions for linked layout directories and unchanged outside/earlier managed content.
  • Document preflight rejection. No Sleep, Runtime, Hook, dependency or CI workflow changes; unreleased version remains 0.5.2.

Linux evidence

  • New linked-layout consumer regression failed before production correction and passed afterward.
  • Build and full suite pass: 947 focused checks.
  • Pack preview and actual artifact installation pass.
  • Real CLI normal all-five-Harness init/update, linked-directory init/update rejection and linked .new rejection pass with outside/project content unchanged.
  • Two different-actor delta reviews PASS; smoke reviewer independently exercised 15 actual CLI commands including preview, customization, deletion, copy and force behavior.

Owner calibration

Linux is the requested release target. Existing Windows Sleep alias CI failure is outside this change and is not a release gate. No platform-specific branch or Sleep fix was added. Preflight is not a claim of transactional rollback or immunity to concurrent path replacement. npm publication is still pending actual maintainer authentication.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 11, 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-10-11T15:00:48.027617Z d44ca49 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.

@Andyduck-ops
Andyduck-ops merged commit 085ebe7 into main Oct 11, 2026
0 of 2 checks passed

@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: d44ca494b8

ℹ️ 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 src/cli/init.ts
Comment on lines +506 to +508
const confined = confineRepositoryDestinations(cwd, targets);
if (confined.state !== 'confined') {
throw new Error(`Cannot install managed resources: ${JSON.stringify(confined)}`);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reject directory leaf targets during init

When a managed destination such as .omp-flow/workflow/code/how.md already exists as an ordinary directory, confineRepositoryDestinations accepts it (its generic final-target check permits directories). init --force then passes this preflight, writes earlier plan entries, and only fails at fs.writeFileSync with EISDIR, leaving a partial installation despite the promised before-write rejection. Require file-resource targets to be missing or regular files before entering the deployment loop.

AGENTS.md reference: AGENTS.md:L101-L102

Useful? React with 👍 / 👎.

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