Skip to content

NS04: product Session kernel and immutable runtime evidence - #35

Open
kmccleary3301 wants to merge 28 commits into
phase20/followup-1000from
north-star/ns04-session-kernel
Open

NS04: product Session kernel and immutable runtime evidence#35
kmccleary3301 wants to merge 28 commits into
phase20/followup-1000from
north-star/ns04-session-kernel

Conversation

@kmccleary3301

@kmccleary3301 kmccleary3301 commented Jul 16, 2026

Copy link
Copy Markdown
Owner

Scope

Implements North-Star packet bb-06u.5 on frozen base 7d69b792a048bbd42970542132defaa2cbf091e7.

  • adds a product-owned, event-sourced Session lifecycle bound to the runtime-effective EffectiveHarnessLock
  • adds immutable event replay and deterministic bb.session.v1 read models
  • adds fsynced JSONL session-event persistence and content-addressed artifact ownership
  • adapts CLI bridge input, approvals, runtime reconfiguration, pause/resume, cancellation, and terminal transitions behind the facade
  • publishes attachment manifests before returning handles and keeps manifest refs immutable
  • packages the runtime facade and public schemas in the built wheel

Compat reviewed: non-breaking. Existing bridge responses and legacy artifact paths remain compatible; the product read model and durable event stream are additive.

Bounds

Current exact head: 123dee66a.

  • 20 files
  • +2133/-1333, net +800
  • within the <=20 file / <=800 net-line packet cap

Review closure

All automated findings through the review of b7896bd12 were repaired and regression-locked. The exact head additionally:

  • keeps anchored-storage names confined across every public descriptor/handle operation
  • fails malformed or missing runtime configuration before any startup bundle is staged or published
  • keeps pause seeding atomic and deterministic across event-loop and worker-thread callers
  • consolidates event sink ownership into the event module without changing the public runtime facade
  • repairs the OpenCode phase-4 replay profile to extend the checked-in opencode_grok4fast_c_fs_v2.yaml base

The CLI bridge now records the exact runtime-effective harness, approval FIFO, sanitized input plus attachment refs, terminal transitions, and durable event/artifact evidence. Attachment CAS access is descriptor/handle confined and permission-authorized. Persistent permission rules commit before broker delivery. Startup and attachment publication remain transactional.

Verification

At exact head 123dee66a:

python -m pytest -q tests/product/runtime/test_session_kernel.py tests/test_cli_bridge_service_prewarm.py tests/test_session_runner_pending_permissions.py
258 passed

python -m pytest -q tests/contracts/public/test_public_contracts.py tests/compilation/test_config_view_and_tool_registry.py
216 passed, 21 skipped

python -m py_compile agentic_coder_prototype/agent_llm_openai.py agentic_coder_prototype/api/cli_bridge/session_runner.py
passed

git diff --check github/phase20/followup-1000
passed

Two independent exact-head reviews passed with no blocker. The packet retains legacy shell behavior as an explicit permission-controlled residual; model-native reads and writes cannot traverse the private attachment/CAS paths.

Warnings are existing Pydantic V1 deprecations and pytest temporary-directory cleanup warnings.

Distribution boundary

The existing explicit setuptools list omits agentic_coder_prototype.api and other bridge subpackages, so the wheel cannot import SessionService independently of the source tree. This packet packages and verifies the new product runtime package. Installed bridge/subpackage discovery belongs to dependent packet NS07 (bb-06u.9).

Frozen NS04 acceptance: 1000/1000. Latest-head push and pull-request CI passed. Absolute hardening remains 950/1000 because the frozen packet intentionally retains permission-controlled shell compatibility, restart registry rehydration belongs outside NS04, and the packet uses the full +800 line allowance.

@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: 8f16c2f9a8

ℹ️ 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 agentic_coder_prototype/api/cli_bridge/service.py Outdated
Comment thread agentic_coder_prototype/api/cli_bridge/service.py Outdated
Comment thread agentic_coder_prototype/api/cli_bridge/service.py Outdated
@kmccleary3301
kmccleary3301 force-pushed the north-star/ns04-session-kernel branch 2 times, most recently from 62a4434 to 266f712 Compare July 16, 2026 17:59

@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: 266f712de5

ℹ️ 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 agentic_coder_prototype/api/cli_bridge/service.py Outdated
Comment thread agentic_coder_prototype/api/cli_bridge/service.py Outdated
Comment thread agentic_coder_prototype/api/cli_bridge/service.py Outdated
@kmccleary3301
kmccleary3301 force-pushed the north-star/ns04-session-kernel branch from 266f712 to 9ba8e9e Compare July 16, 2026 18:24

@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: 9ba8e9e3fa

ℹ️ 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 agentic_coder_prototype/api/cli_bridge/service.py Outdated
Comment thread agentic_coder_prototype/api/cli_bridge/service.py Outdated
Comment thread agentic_coder_prototype/api/cli_bridge/service.py Outdated
Comment thread agentic_coder_prototype/api/cli_bridge/session_runner.py
@kmccleary3301
kmccleary3301 force-pushed the north-star/ns04-session-kernel branch from 9ba8e9e to f5bdcd4 Compare July 16, 2026 18:32
@kmccleary3301

Copy link
Copy Markdown
Owner Author

Addressed all six review findings at exact head f5bdcd44:

  • runtime-effective lock now includes request overrides, permission mode, and persisted rules
  • approval.requested is recorded from the emitted runtime permission request
  • input events bind both submitted artifact refs and sanitized queued content
  • fsynced JSONL sink persists the immutable session event stream after registry deletion
  • artifact-ref storage is initialized before concurrent upload requests can yield
  • sink append remains transactional with the in-memory projection

Evidence: 39 focused bridge/permission tests passed; 42 public-contract/kernel-boundary tests passed; live lifecycle retained session.started, approval.requested, approval.resolved, and session.canceled after DELETE. Packet remains within cap at 12 files, net +795.

@codex review

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

ℹ️ 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 agentic_coder_prototype/api/cli_bridge/session_runner.py Outdated
Comment thread agentic_coder_prototype/api/cli_bridge/service.py Outdated
Comment thread agentic_coder_prototype/api/cli_bridge/service.py Outdated
@kmccleary3301
kmccleary3301 force-pushed the north-star/ns04-session-kernel branch from f5bdcd4 to b9cd2a0 Compare July 16, 2026 19:00

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

ℹ️ 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 breadboard/product/runtime/session.py Outdated
Comment thread agentic_coder_prototype/api/cli_bridge/session_runner.py Outdated
Comment thread agentic_coder_prototype/api/cli_bridge/service.py Outdated

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

ℹ️ 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 agentic_coder_prototype/api/cli_bridge/service.py Outdated
Comment thread agentic_coder_prototype/api/cli_bridge/session_runner.py Outdated
@kmccleary3301
kmccleary3301 force-pushed the north-star/ns04-session-kernel branch from aebe95a to 002f892 Compare July 17, 2026 02:19
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.

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

ℹ️ 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 agentic_coder_prototype/api/cli_bridge/session_runner.py Outdated
@kmccleary3301

Copy link
Copy Markdown
Owner Author

Fixed the direct-runner compatibility finding in ec385b1.

  • _run now uses product-session durability only when a product session is attached.
  • Plain SessionRecord callers retain the prior completion/stop status rule and persist successful completion metadata.
  • Added a regression that reproduced the exact NoneType.read_model failure before the fix.

Evidence: the regression passed after reproducing red; 24 focused runner, replay, and lazy-initialization tests passed; py_compile passed.

@codex review

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

ℹ️ 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 agentic_coder_prototype/api/cli_bridge/session_runner.py Outdated
@kmccleary3301

Copy link
Copy Markdown
Owner Author

Fixed the plain-runner deferred permission replay finding in ebab1d4.

  • Runtime response ordering no longer depends on an attached product session.
  • Deferred FIFO responses are drained and republished for legacy SessionRecord runners.
  • Product-session approval transitions remain conditional on the product facade.
  • Added the exact out-of-order two-response regression; it failed before the fix with only first published and now passes with first, second and an empty pending set.

Evidence: all 22 pending-permission tests passed; py_compile passed.

@codex review

@kmccleary3301

Copy link
Copy Markdown
Owner Author

Current reviewed candidate is d21d5eb6.

The replay fix is unchanged; the two follow-up commits only compacted the regression and repaired lines to preserve the frozen packet bound after the review fix. Current PR delta: 19 files, +1669/-869, net +800. All 22 pending-permission tests and py_compile pass.

@codex review

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

ℹ️ 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 agentic_coder_prototype/api/cli_bridge/session_runner.py Outdated
@kmccleary3301

Copy link
Copy Markdown
Owner Author

Resolved the current-head P1 transaction-order finding in a29bdd5a.

  • Rule-file and registry metadata commits now complete before respond_permission can publish the decision to the runtime broker.
  • The existing rollback regression now also asserts the real broker queue remains empty when metadata commit fails; that assertion reproduced the bug before the fix.
  • Successful decisions still traverse the existing respond_permission path after commit.

Evidence: 23 permission transaction/persistence tests passed; py_compile passed. @codex review

@kmccleary3301 kmccleary3301 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Reviewed candidate a29bdd5: rule persistence now precedes runtime permission delivery, with a regression proving broker silence on metadata commit failure. Focused suite: 23 passed; py_compile passed. Fresh automated review requested in the PR thread.

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

ℹ️ 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 tests/test_cli_bridge_service_prewarm.py Outdated

@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: 23f837cff6

ℹ️ 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 agentic_coder_prototype/api/cli_bridge/session_runner.py Outdated
@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: ec1ad0370d

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

@kmccleary3301

Copy link
Copy Markdown
Owner Author

@codex review exact head a230288 only. Frozen closure packet is net +799 lines versus github/phase20/followup-1000. Focus cross-process CAS/session publication, attachment snapshot immutability, Windows handle/dir-fd confinement, and regressions.

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

ℹ️ 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 agentic_coder_prototype/api/cli_bridge/service.py
Comment thread agentic_coder_prototype/api/cli_bridge/session_runner.py Outdated
@kmccleary3301

Copy link
Copy Markdown
Owner Author

@codex review exact head 4130799 only. Mutable attachment snapshot paths were removed; CAS-verified bytes are base64-inlined into immutable task text. Exhaustive replay invariant coverage restored. Frozen packet is net +748 lines.

@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".

@kmccleary3301

Copy link
Copy Markdown
Owner Author

@codex review exact head 29b7a3d only. Prior findings resolved: immutable CAS bytes are inlined with a 16 KiB upload/selection limit; packet net +765 lines vs frozen github/phase20/followup-1000; exhaustive exact suites 277 passed. Focus any remaining correctness, security, lifecycle, or portability issue.

@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: 29b7a3d994

ℹ️ 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 agentic_coder_prototype/api/cli_bridge/service.py Outdated
@kmccleary3301

Copy link
Copy Markdown
Owner Author

@codex review exact head 4123463 only. Attachment ingress now streams to a 16 KiB hard cap; rejected selections are mutation-free; prompt exposes only an attachment://sha256 digest capability; bytes are read by existing read_file after PermissionBroker authorization from descriptor/handle-confined CAS with digest+size verification. Exact suites: 278 passed. Packet: net +790 lines.

@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: 41234631a6

ℹ️ 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 agentic_coder_prototype/api/cli_bridge/service.py
@kmccleary3301

Copy link
Copy Markdown
Owner Author

@codex review exact head adfe9ef only. Frozen packet is exactly 20 files and net +784 lines. Session/events and effective-config test modules were consolidated only; exact 278-test closure suite passed. Review remaining correctness, security, concurrency, and portability defects.

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

ℹ️ 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 breadboard/product/runtime/ports.py Outdated
Comment thread agentic_coder_prototype/api/cli_bridge/session_runner.py Outdated
@kmccleary3301

Copy link
Copy Markdown
Owner Author

@codex review exact head eddae65 only. Frozen packet is exactly 20 files and net +799 lines. Review correctness, security, concurrency, portability, and boundary compliance; prior heads are obsolete.

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

ℹ️ 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 agentic_coder_prototype/api/cli_bridge/service.py
@kmccleary3301

Copy link
Copy Markdown
Owner Author

@codex review exact head 3b87878 only. Frozen closure packet: exactly 20 files, +2054/-1255 = net +799 against github/phase20/followup-1000; do not review superseded heads. Assess correctness, security, concurrency, portability, public schema/runtime parity, and test adequacy. Return numeric 0-1000 score and concrete findings.

@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: 3b8787839b

ℹ️ 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 agentic_coder_prototype/api/cli_bridge/runtime_emission.py Outdated
Comment thread breadboard/product/runtime/artifacts.py
@kmccleary3301

Copy link
Copy Markdown
Owner Author

@codex review exact head b7896bd only. Prior comments are repaired. Current packet is 20 files, +2103/-1308 = net +795 against the frozen base. Focus the consolidated event sink, strict config-load failure boundary, OpenCode phase-4 replay profile, pause/control concurrency, anchored-storage confinement, and current-head test adequacy. Local locks: 315 packet tests passed; full config corpus 176 passed/21 skipped; tmux action parity passed; py_compile 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: b7896bd120

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

except OSError as exc:
for handle in reversed(handles): AnchoredStorage.close_windows_handle(handle)
raise HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail="invalid workspace metadata path") from exc
root_fd, metadata_fd = os.open(workspace_root, os.O_RDONLY | getattr(os, "O_DIRECTORY", 0)), None

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 Open the workspace root without following symlinks

When the workspace path is in a parent another process can modify, this root open follows a symlink swapped in after workspace_dir.resolve(), so the subsequent dir-fd-confined .breadboard writes can be anchored in an attacker-chosen directory outside the intended workspace; the later metadata-path check also resolves the pathname again, so it won't catch that replacement. Use O_NOFOLLOW/descriptor identity for the root open as well (the same root-open pattern is also present in the permission rules store).

Useful? React with 👍 / 👎.

@kmccleary3301

Copy link
Copy Markdown
Owner Author

@codex review

@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: 123dee66a8

ℹ️ 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 on lines +581 to +582
if target_fd is not None: artifact_store.materialize_at(artifact_ref, target_fd, filename)
else: artifact_store.materialize(artifact_ref, attachment_root / attachment_id / filename)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Block shell access to materialized attachments

When shell tools are enabled, these materialized copies make uploaded attachment bytes reachable at predictable paths under the workspace (.breadboard/attachments/...), while the new read/glob/grep/list guards only filter the Python file tools. A model can run a shell command such as find .breadboard/attachments -type f -exec cat {} \; and bypass the attachment:// capability check added in read_file, so attachment authorization is not actually enforced for sessions that allow shell execution.

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