Skip to content

Add trusted snapshot package boundary - #212

Closed
Pigbibi wants to merge 4 commits into
mainfrom
codex/qsl-p2-m2c-trusted-snapshot-20260727
Closed

Add trusted snapshot package boundary#212
Pigbibi wants to merge 4 commits into
mainfrom
codex/qsl-p2-m2c-trusted-snapshot-20260727

Conversation

@Pigbibi

@Pigbibi Pigbibi commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Implements the accepted P2-M2C TrustedSnapshotPackage boundary from exact main.

  • canonical three-file offline package/readback boundary
  • external digest bindings and snapshot identity
  • duplicate-key, canonical JSON, root-contained regular-file safety
  • focused tests for trust-boundary failures

Validation: uvx --offline ruff check, focused pytest (4 passed), compileall, json.tool, diff --check.

Pigbibi and others added 2 commits July 27, 2026 13:44
Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Codex <noreply@openai.com>
@Pigbibi

Pigbibi commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

@codex review initial exact head: 20eb751

@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: 20eb751105

ℹ️ 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/us_equity_snapshot_pipelines/soxl_tqqq_clean_cutover_snapshot.py Outdated
Comment thread schemas/soxl_tqqq_clean_cutover_snapshot.v1.schema.json Outdated
Comment thread src/us_equity_snapshot_pipelines/soxl_tqqq_clean_cutover_snapshot.py Outdated
Co-Authored-By: Codex <noreply@openai.com>
@Pigbibi

Pigbibi commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

@codex review final exact head: e003adb

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

ℹ️ 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 schemas/soxl_tqqq_clean_cutover_snapshot.v1.schema.json Outdated
Comment thread src/us_equity_snapshot_pipelines/soxl_tqqq_clean_cutover_snapshot.py Outdated
Comment thread src/us_equity_snapshot_pipelines/soxl_tqqq_clean_cutover_snapshot.py Outdated
Co-Authored-By: Codex <noreply@openai.com>
@Pigbibi

Pigbibi commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

@codex review final exact head: f8c70b3

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

ℹ️ 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 +64 to +65
if value.startswith("0") and value != "0" and not value.startswith("0."):
raise SnapshotValidationError("adjusted_close must be canonical")

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 Require a leading zero for fractional decimals

Reject fractional strings that begin with . here. _canonical_decimal(".5") currently succeeds, so TrustedSnapshotPackage.read() can accept and expose a package that violates the checked-in schema, whose adjusted_close pattern requires 0.5; this breaks interoperability for any consumer that validates the supposedly canonical package against that schema.

Useful? React with 👍 / 👎.

Comment on lines +188 to +189
while chunk := os.read(fd, 1024 * 1024):
raw += chunk

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 Bound or linearly accumulate snapshot input

When the selected regular file is corrupted or attacker-controlled and very large, this loop repeatedly concatenates immutable bytes before the external digest or JSON validation can reject it. That makes readback quadratic in file size and leaves input size unbounded, allowing a bogus artifact to consume excessive CPU and memory; enforce a maximum from fstat() or accumulate chunks linearly.

Useful? React with 👍 / 👎.

fd = root_fd
try:
for part in relative.parts[:-1]:
next_fd = os.open(part, os.O_RDONLY | os.O_DIRECTORY | getattr(os, "O_NOFOLLOW", 0), dir_fd=fd)

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 Fail closed when O_NOFOLLOW is unavailable

On a Unix platform that supports directory-relative opens but does not expose os.O_NOFOLLOW, this fallback silently supplies zero and allows an intermediate symlink to be followed, defeating the method's root-contained, symlink-free trust boundary. Reject the operation when the capability is unavailable rather than weakening the open flags.

Useful? React with 👍 / 👎.

@Pigbibi

Pigbibi commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

Evidence-only final closure record: exact-head Codex review 4784297077 remains substantive with 3 unresolved P2 threads; required test 30243137462 is SUCCESS, but merge state is BLOCKED. Per existing authority, no further patch/review/rerun/reslice/merge is authorized; closing PR unmerged and parking.

@Pigbibi Pigbibi closed this Jul 27, 2026
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