Skip to content

fix(workbench): confine inventories and snapshots to the selected target - #472

Draft
mldangelo-oai wants to merge 21 commits into
mainfrom
mdangelo/codex/confine-repository-parent-symlinks-20260815
Draft

fix(workbench): confine inventories and snapshots to the selected target#472
mldangelo-oai wants to merge 21 commits into
mainfrom
mdangelo/codex/confine-repository-parent-symlinks-20260815

Conversation

@mldangelo-oai

@mldangelo-oai mldangelo-oai commented Aug 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

Keep changed-file inventories, ranking previews and Git snapshots inside the selected target without rejecting valid broken symlink leaves.

Changes

  • Share parent-only confinement between local inventory and ranking. Preserve staged and untracked broken links, deleted files and safe missing parents.
  • Keep the original selected target across nested checkouts, snapshot digests, fallback traversal and nonblocking progress estimates.
  • Merge main and advance both bundled plugin markers to 0.1.63, refreshing caches from main and the previous PR payload.
  • Replace the duplicate installer mock with real bundled-Codex upgrades. Simplify repeated path fixtures and one nested branch; remove six net lines without dropping boundary assertions.

Testing

  • Eight affected and adjacent suites: 195 passed, 14 platform-dependent skips.

  • Real Codex upgrades from 0.1.60 and 0.1.62 passed, followed by real Git inventory/ranking checks against the installed scripts.

  • Types, formatting, build, Ruff and Python 3.10 syntax passed.

  • Rebuilt npm package validation and full installed-package smoke passed.

  • Full suite and native Windows were not rerun. Current-head CI is left for a separate pass.

  • Final main refresh (fd98a90): package 0.1.21 includes the MCP launcher-permission fix; feature source and bundled payload are unchanged. Types/model generation, formatting, build, 28 focused package/report/launcher tests, static artifact verification and full installed-package smoke passed, including MCP initialization. CI was not awaited.

Risk and rollout

Revision mode continues to read committed blobs. Safe missing, deleted, nested and alias-equivalent paths retain their behavior; escaped working-tree parents remain blocked. Progress estimates skip unsafe paths without weakening snapshot validation. No new public options or dependencies. This PR remains a draft.

Public disclosure review

  • No customer, partner, prospect, or user identities, data, or identifying details are included.
  • No credentials, personal data, private source, scan findings, or nonpublic links or tickets are included.
  • I reviewed the branch name, title, description, commits, changes, comments, logs, screenshots, attachments, and links for public disclosure.

Existing commit contact metadata and account-specific automated review links prevent the second attestation. This update uses synthetic fixtures and a GitHub noreply commit identity; historical metadata and other authors' comments are unchanged.

@github-actions github-actions Bot added the bug Something isn't working label Aug 16, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: 995da43fbf

ℹ️ 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".

@chatgpt-codex-connector

Copy link
Copy Markdown

Security review completed. No security issues were found in this pull request.

Reviewed commit: 995da43fbf

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@mldangelo-oai
mldangelo-oai marked this pull request as ready for review August 16, 2026 02:41
@mldangelo-oai
mldangelo-oai marked this pull request as draft August 16, 2026 03:54

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review the current head, 648c15254b1bfc371fa75c17b0e02c5586307d6a.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 648c15254b

ℹ️ 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".

@chatgpt-codex-connector

Copy link
Copy Markdown

Security review completed. No security issues were found in this pull request.

Reviewed commit: 648c15254b

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review commit c9c121420b905d454736bbb13311b605037c33a7.

@chatgpt-codex-connector

Copy link
Copy Markdown

Security review completed. No security issues were found in this pull request.

Reviewed commit: c9c121420b

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: c9c121420b

ℹ️ 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".

@mldangelo-oai mldangelo-oai changed the title fix(workbench): keep repository inventory and snapshots within the target fix(workbench): confine inventories and snapshots to the selected target Aug 22, 2026
@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex security review

Please review exact head 9249639 against current main.

@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review exact head 9249639 against current main.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 22, 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-08-25T04:36:53.228121Z 0cebe50 Manual request
🔒 Security Review Completed 2026-08-25T04:37:28.935577Z 0cebe50 Manual request
ℹ️ 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.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

Unknown error
ℹ️ 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".

@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: 9249639ad6

ℹ️ 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 sdk/typescript/_bundled_plugin/scripts/workbench_target.py Outdated

@kmbroai kmbroai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Critical review

Reviewed 9249639ad66448521317150ff2507f1868b516d1. The confinement invariant is necessary, but the current leaf-resolution rule rejects a valid local diff. Consolidate the overlapping diff work with #630 rather than landing two competing implementations.

Correctness

[P2] Do not dereference a broken symlink leaf that will not be read. In existing_ancestor_is_within_target, lstat() succeeds for a broken symlink, then resolve(strict=True) raises. Both new callers turn that into a fatal inventory/ranking error before reaching their existing leaf-symlink handling. The earlier inline finding remains applicable.

I created a real temporary Git repository, committed a regular file, then staged broken.py -> missing.py within the repository. At this head, the actual inventory command exits 2 and ranking exits 1, both with a changed-path inspection error and neither producing output. The same fixture against #630 exits 0 for both: inventory omits the link and ranking records it with an empty preview. This is a compatibility regression, not a request to follow an out-of-target link.

Use the containing-directory/nearest-existing-parent check for local diff paths, while leaving the leaf's existing no-dereference behavior intact. Preserve rejection when the parent resolves outside the selected target.

Necessity and simplification

Snapshot recursion still needs to retain the original selected target rather than silently promote a nested checkout to a new authorized root. The _selected_target propagation addresses that distinct issue, and optional progress counting should remain nonblocking.

However, #630 changes the same inventory and ranking call sites with a narrower helper and already covers the broken-leaf case. Prefer one shared local-diff rule, then keep this PR's remaining snapshot-specific protection separately reviewable. Do not maintain both existing_ancestor_is_within_target and changed_path_parent_is_within_target with subtly different leaf semantics.

The large canonical-path test combines many independent scenarios and patches Git/Python helpers repeatedly. Split its meaningful cases into focused tests sharing the existing fixture; an early failure should not prevent later alias, nested-root, and progress checks from running. That is non-blocking cleanup after the correctness fix.

Verification

The supplied diff/canonical-path suites pass 8 tests, 1 skip, 0 failures on Bun 1.3.14/Linux. The additional real-Git broken-link control fails here and passes on #630 as described. No native Windows/macOS validation or full package run is claimed.

@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review the current head 0cebe50.

@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex security review the current head 0cebe50.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: 0cebe50bc4

ℹ️ 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".

@chatgpt-codex-connector

Copy link
Copy Markdown

Security review completed. No security issues were found in this pull request.

Reviewed commit: 0cebe50bc4

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants