Skip to content

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

Draft
mldangelo-oai wants to merge 17 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 17 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 repository target. Live working-tree paths that escape through parent
links are blocked without dropping safe deleted, nested, or alias-equivalent
paths.

Changes

  • Share one canonical directory-containment helper across diff inventories,
    ranking previews, and Git snapshots.
  • Reject unsafe live working-tree paths before reading them or handing them to
    full-file review, while preserving committed revision data and safe deleted
    entries and omitting vanished non-deleted paths.
  • Preserve selected nested roots, safe internal links and junctions,
    Unicode- and case-equivalent path spellings, and nonblocking progress
    estimates.
  • Add cross-platform synthetic coverage for external links, non-Git digest
    fallbacks, nested checkouts, missing parents, filesystem aliases, and looped
    resolution.
  • Merge current main and advance both bundled-plugin version declarations to
    0.1.38.

Testing

Exact head 9249639ad66448521317150ff2507f1868b516d1:

  • Focused confinement, Git-diff, recovery, runtime, and Windows-compatibility
    suites: 21 passed, 2 expected platform skips, zero failures.
  • Seed 12345 full suite: 1,580 passed, 30 skipped, zero failures.
  • TypeScript types, generated-model consistency, Prettier, build, and Git diff
    checks: passed.
  • Fresh npm artifact checks and installed-package smoke: passed, including the
    public import, strict NodeNext consumer, CLI, all 111 bundled plugin files,
    bundled Codex, and the nested worker.
  • Fresh exact-tree correctness and simplification reviews found no remaining
    actionable issues.

Risk and rollout

This intentionally makes local-patch inventory and ranking stop when a changed
entry's nearest existing path resolves outside the selected target. Revision
mode still reads committed blobs, and safe deleted, missing, nested, and
alias-equivalent paths keep their existing behavior. Snapshot digests reject
unsafe roots before Git or fallback traversal, while optional progress counts
remain nonblocking. The change adds no command, flag, environment variable,
dependency, or state migration.

Both bundled-plugin version declarations are 0.1.38. If another
plugin-changing pull request lands first, refresh from main and update both
declarations together. This pull request does not publish or release a package.
Exact-head cross-platform CI and human approval remain required. Processing
continues without waiting for CI, and any exact-head failures will be handled
in the return sweep.

Public disclosure review

The branch, title, description, commits, seven-file pull request delta, comments,
logs, screenshots, attachments, and links were reviewed. Existing automated
review comments contain requester-only Codex report links and an access-gated
settings link, so the nonpublic-links attestation remains unchecked.

  • 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.

@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-22T06:05:13.755778Z 9249639 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".

return False
candidate = parent
continue
return directory_is_within_target(candidate.resolve(strict=True), target)

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 Handle broken in-repository symlinks in local diffs

When a local patch contains a staged or untracked broken symlink such as broken.py -> missing.py, lstat() succeeds but resolve(strict=True) raises FileNotFoundError; both diff inventory and rank-input generation convert that into a fatal “Could not inspect” error, preventing the entire scan even though their later branches already handle symlinks without reading their targets. Validate a broken link's unresolved destination or containing directory so an in-target link can proceed while destinations outside the selected target remain rejected.

AGENTS.md reference: sdk/typescript/AGENTS.md:L22-L23

Useful? React with 👍 / 👎.

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.

1 participant