Skip to content

D-TGB-4: thought-git receipt and deterministic replay (lab, thought-git-probe) - #1674

Merged
AdaWorldAPI merged 6 commits into
mainfrom
ccr-f5674497-orfkox
Oct 21, 2026
Merged

AdaWorldAPI merged 6 commits into
mainfrom
ccr-f5674497-orfkox

Conversation

@AdaWorldAPI

Copy link
Copy Markdown
Owner

D-TGB-4 (EXO-58, under EXO-44). A thought's receipt holds what is needed to recompute its writes after its live slot is gone, and replay reproduces those writes from the receipt alone.

This is lab only, inside the workspace-excluded crates/thought-git-probe. It does not touch the contract, cycle_driver, LanceCycleWriter, the supervisor or the CE64 bits. Claim: EXO-50 session_019fbZ92dFKQ5BJHrA3YcH9A/003, acknowledged in session_01G22yT6htkcdyXsihxxXdrg/036.

What changes

src/receipt.rs:

  • Receipt holds:

    • base ref (dataset, branch, version);
    • ProgramId plus template version;
    • ProgramInputs as two lanes, sources and targets, read at the same position;
    • seed and ExecConfig;
    • the live slot and generation, kept as provenance only;
    • a fold over the values read, the provenance roots, a fold over the writes, and the outcome.
  • replay(receipt, store, config) takes no slot pool. It refuses on:

    • a missing seed;
    • a changed config;
    • an unknown base;
    • changed sources (checked by the source fold);
    • a different output (checked by the output fold).

    The writes themselves are not stored in the receipt.

  • replay_live, and capture / stage, check that the slot still holds the same thought under the same generation. A stale, reused or ABA slot fails closed.

  • MetadataTable is keyed by (dataset, data version, thought id), separate from the data version it describes.

    • stage refuses before the data version is sealed (data first, then metadata) and on a key naming another thought.
    • seal writes a fold over every field, last.
    • landed / replay_landed accept only a sealed row whose seal still matches and whose data version exists.
  • Replayed reports the receipt's roots as inherited, with zero independent roots, so a replay cannot earn new certification.

  • BaseRef and VersionStore are probe-local stand-ins for D-CPG's DurableRef (no contract type yet) and for Lance.

Also in this PR:

  • tests/receipt.rs: 10 falsifier tests.
  • .github/workflows/thought-git-probe.yml: until now no workflow ran this crate.
  • Board: entries/2026-10-21-d-tgb-4-receipt-replay.md, the STATUS_BOARD D-TGB-4 row (In PR), the PREREGISTRATION row, and the regenerated entries index.

Falsifiers and disables

Each disable was applied to the source and the suite rerun. Each one turned the named test red; the tests were green again after restore.

Test Disable
Released Commit/Plan/Prune thoughts replay cell for cell, even after their slot is reused replay takes no pool (by signature)
Missing seed refuses default the seed to 0
Changed seed is an output mismatch (the two seeds are first shown to give different writes) skip the output check
Changed config refuses skip the config check
Changed source refuses; a change to a non-source cell does not skip the source fold
Freed, reused and ABA-reused slots fail closed ignore the slot generation
Contradictions and roots keep their meaning (equal next_version, exactly one contradiction) report roots as independent
A replay earns no new certification, while a genuinely new root does (Gadamer) report roots as independent
Unsealed, torn, missing and data-less metadata rows are not landings accept unsealed rows / skip the seal comparison / stage before the data version
The same plan in two slots has one identity; a seed change alters it put the slot into the identity

One disable first came back green: test 8's prior horizon already held the receipt's roots, so mislabelling them as independent could not look new. The prior now predates them, and the disable turns both tests 7 and 8 red.

Local results:

  • cargo test: 36 passed (26 existing + 10 new).
  • cargo clippy --all-targets -- -D warnings: clean.
  • cargo fmt --check: clean.
  • Entries index and supersession index are current.

Measured and not measured

Measured: the 10 tests and 10 disables, on the fixture address space (12 rows × 4 lanes) with one program (DERIVE). No timing was taken.

Not measured or not built:

  • Lance-backed metadata.
  • Atomicity of the two Lance versions (still open in thought-git-basics item 8).
  • Programs other than DERIVE.
  • Rebase-as-replay.

The folds are 64-bit witnesses, not proofs.

Caveat: replay returns a Thought whose writes field is the fixture's existing Vec<(Cell, u64)>, carried over from D-TGB-0. The comparisons themselves run on folds. Whether a reference may hold tuples internally is still an open operator question (/036 item 1).

Open

  • The plan places the receipt, slot and DurableRef in lance-graph-contract at D-TGB-7. This PR does not.
  • D-RFT-5 can reference this receipt shape. I will post the shape on EXO-50.

Generated by Claude Code

Receipt carries base ref, program id + inputs, seed, exec config, the live
slot (provenance only), a fold over the values read, provenance roots and a
fold over the writes. Replay recomputes from the receipt alone and refuses on
missing seed, changed config, unknown base, changed sources or a different
output. Landed receipts live in a metadata table keyed by (dataset, version,
thought), staged then sealed; replay accepts only a sealed, untorn row whose
data version exists.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019fbZ92dFKQ5BJHrA3YcH9A
…elled roots are caught

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019fbZ92dFKQ5BJHrA3YcH9A
@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: bc5a9cb0-9244-4da7-87d4-52ba56bd395a
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copy link
Copy Markdown
Owner Author

@codex review


Generated by Claude Code

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 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 🔄 Running since 2026-10-21T19:51:51.870694Z ed54930 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 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: 3496242fc7

ℹ️ 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 crates/thought-git-probe/src/receipt.rs
@AdaWorldAPI
AdaWorldAPI marked this pull request as ready for review October 21, 2026 19:50
The metadata seal folded only ReceiptIdentity, which left out the outcome.
A sealed row changed from Commit to Prune would still pass landed() and
replay_landed(), and next_version would then drop the writes while every
fold still matched. The outcome is now part of ReceiptIdentity and of the
seal, and the partial-write test adds a torn case that mutates it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019fbZ92dFKQ5BJHrA3YcH9A

Copy link
Copy Markdown
Owner Author

@codex review


Generated by Claude Code

@AdaWorldAPI
AdaWorldAPI merged commit 414377f into main Oct 21, 2026
13 checks passed
AdaWorldAPI pushed a commit that referenced this pull request Oct 21, 2026
STATUS_BOARD D-TGB-4 row to Shipped, PR_ARC_INVENTORY and LATEST_STATE
entries for #1674. Also regenerates the entries index, whose count went
stale when #1674 and #1675 merged one after the other (421 -> 422).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019fbZ92dFKQ5BJHrA3YcH9A
AdaWorldAPI added a commit that referenced this pull request Oct 21, 2026
AdaWorldAPI added a commit that referenced this pull request Oct 21, 2026
board: reconciliation after #1674–#1682 — D-QSP-0 row, D-RFT-1 row, polyfill map G1, PR_ARC
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.

2 participants