Skip to content

fix(work): a reviewer reads the submitted patch itself, verified by its hash, and a typed artifact with no bytes behind it is refused - #5003

Merged
joelteply merged 3 commits into
canaryfrom
e1babb61/a-work-submission-s-patch-is-retrievable
Oct 13, 2026
Merged

joelteply merged 3 commits into
canaryfrom
e1babb61/a-work-submission-s-patch-is-retrievable

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Card e1babb61. Kimi submitted db0aa5b2 (43734d03, 343 B, sha256 675d1d64...)
and her ledger correctly said the reviewer acts next, but work/submission
returned only the reference, so the reviewer had nothing to read and her
finished work stranded for hours. An audit of the write path, by reading the
code: the derived submit already retains the bytes with
airc_blobs::FsStore::put (submission.rs retain_patch); nothing read them back
for a reviewer; and a fully typed artifact was published with no bytes behind
it.

  • media::artifact::read_text_blob(hash, size) is the one reader of a retained
    text blob. It verifies the size and recomputes the SHA-256, so the reviewer
    gets the submitter's bytes or a named reason. benchmark_grade's private
    read_patch is deleted in favour of it.
  • work/submission returns patch (verified text) or patch_error. Protocol TS
    updated to match.
  • work/submit refuses a typed artifact whose bytes the store doesn't hold, and
    names the fix: omit artifact and it's derived and retained.
  • Test a_retained_patch_reads_back_by_its_hash_and_a_mismatch_is_named. Not run
    here; CI is its first run.

Not in this change: a reviewer on ANOTHER node. airc has no peer fetch-by-hash
yet, so that's a transport, tracked on this card. Kimi's 43734d03 bytes:
Codex is checking the 5090's media/blobs at the exact path.

Co-Authored-By: Claude Opus 5.5 (1M context) [email protected]
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

…ts hash, and a typed artifact with no bytes behind it is refused

Card e1babb61. Kimi submitted db0aa5b2 (43734d03, 343 B, sha256 675d1d64...)
and her ledger correctly said the reviewer acts next, but work/submission
returned only the reference, so the reviewer had nothing to read and her
finished work stranded for hours. An audit of the write path, by reading the
code: the derived submit already retains the bytes with
airc_blobs::FsStore::put (submission.rs retain_patch); nothing read them back
for a reviewer; and a fully typed artifact was published with no bytes behind
it.

- media::artifact::read_text_blob(hash, size) is the one reader of a retained
  text blob. It verifies the size and recomputes the SHA-256, so the reviewer
  gets the submitter's bytes or a named reason. benchmark_grade's private
  read_patch is deleted in favour of it.
- work/submission returns `patch` (verified text) or `patch_error`. Protocol TS
  updated to match.
- work/submit refuses a typed artifact whose bytes the store doesn't hold, and
  names the fix: omit `artifact` and it's derived and retained.
- Test a_retained_patch_reads_back_by_its_hash_and_a_mismatch_is_named. Not run
  here; CI is its first run.

Not in this change: a reviewer on ANOTHER node. airc has no peer fetch-by-hash
yet, so that's a transport, tracked on this card. Kimi's 43734d03 bytes:
Codex is checking the 5090's media/blobs at the exact path.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
joelteply and others added 2 commits October 12, 2026 20:32
…by the reference's size, and the grader carries the whole reference

Codex's review on #5003 (f60cd52). FsStore::get_verified already verifies
size and digest with a bounded read and growth detection, and
ImageArtifact::read already uses it. My helper re-implemented that and read
an arbitrary blob whole before checking the size.

- media::artifact::read_text_blob(&MediaRef) is get_verified with the
  reference's own size as the bound (a whole patch, unclipped, no constant),
  then UTF-8. My size/sha256 code is gone.
- work/submit checks the typed artifact on the parsed SubmissionArtifact
  (= MediaRef), and work/submission reads submitted.artifact directly.
- benchmark_grade::grade_submission takes the MediaRef, not a hash string, so
  its read is bounded and verified too.
- The test drives MediaRef references: exact size reads back; size+1 and an
  absent hash are named errors.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
…es its hash and size

CI on 647e0cf (run 38332598243, Codex): 8818 pass, 1 fail.
work_submission_commands_bind_before_publication_and_preserve_identity typed
"b"x64 / 20 bytes with no blob behind it, which #5003's guard now rightly
refuses. The fixture retains a real patch in the test's own store (HomeGuard
pins the store's home) and types that hash and length. The identity, causality
and duplicate assertions are unchanged, and the guard is not weakened.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
@joelteply
joelteply merged commit 323dc8f into canary Oct 13, 2026
7 checks passed
@joelteply
joelteply deleted the e1babb61/a-work-submission-s-patch-is-retrievable branch October 13, 2026 02:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant