Skip to content

feat: TTD Protocol & Core Hardening (PR 1)#268

Merged
flyingrobots merged 3 commits into
mainfrom
feat/ttd-core-hardening-pr1
Feb 14, 2026
Merged

feat: TTD Protocol & Core Hardening (PR 1)#268
flyingrobots merged 3 commits into
mainfrom
feat/ttd-core-hardening-pr1

Conversation

@flyingrobots
Copy link
Copy Markdown
Owner

Establish the high-integrity foundation for Time Travel Debugging.

Goal

Implement bit-exact wire formats and core provenance records to enable deterministic worldline replay and 'Show Me Why' debugging features.

Changes

  • Wire Protocols: Added (Intent) and (Receipt) codecs with Little-Endian headers and BLAKE3 checksums.
  • Provenance: Added tracking to capture which rule modified which atom.
  • Merkle Hardening: Implemented binding schema, worldline, and emissions into the state commitment.
  • Safety: Added for leak-free session cleanup.

Verification

  • Header Integrity Drill: Verified rejection of corrupted/truncated headers.
  • Domain Separation Check: Proven structural collision prevention between frame types.
  • Decoder Fuzzer: 1,000-run randomized stress test for the TTDR decoder.
  • Cascading Cleanup Test: Verified full session data purging.

This commit establishes the foundation for Time Travel Debugging by:
- Porting EINT v2 and TTDR v2 codecs with high-integrity headers.
- Adding AtomWrite provenance tracking to warp-core.
- Implementing TTD-aware Merkle commitments (commit_hash v2).
- Adding TruthSink::clear_session for memory safety.
- Integrating protocol integrity drills and fuzzer tests.

Part of PR 1 in the TTD incremental integration plan.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 14, 2026

Warning

Rate limit exceeded

@flyingrobots has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 0 minutes and 57 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/ttd-core-hardening-pr1

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 and usage tips.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

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: f5bf2d757b

ℹ️ 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 +570 to +572
let mut header = frame.header;
header.parent_count = frame.parent_hashes.len() as u16;
header.channel_count = frame.channel_digests.len() as u16;
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 Reject reserved receipt mode before encoding TTDR frames

encode_ttdr_v2 accepts headers whose flags encode ReceiptMode::Reserved, but decode_ttdr_v2 rejects that mode in TtdrHeader::from_bytes, so a frame produced by this encoder can be undecodable by the paired decoder when callers accidentally set mode 3. This creates a self-incompatible wire path for a publicly exposed enum variant and should fail fast during encoding instead of emitting an invalid frame.

Useful? React with 👍 / 👎.

Comment on lines +406 to +407
let count = self.entry_hashes.len() as u32;
out.extend_from_slice(&count.to_le_bytes());
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 Enforce channel entry-hash cap during TTDR encoding

The encoder writes entry_hashes.len() directly as a u32 without enforcing the decoder's MAX_ENTRIES_PER_CHANNEL limit (65,536), so frames with more entries are emitted successfully but are guaranteed to be rejected by decode_ttdr_v2 with TooManyEntries. This breaks round-trip compatibility for large-but-possible inputs and should be validated on encode to prevent generating invalid wire data.

Useful? React with 👍 / 👎.

- Reject ReceiptMode::Reserved during encoding to prevent undecodable frames.
- Enforce MAX_ENTRIES_PER_CHANNEL cap during encoding.
- Added regression tests for both cases.
@flyingrobots
Copy link
Copy Markdown
Owner Author

@coderabbitai review please 🥕

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 14, 2026

@flyingrobots: Acknowledged. 🥕

Initiating FULL ANNIHILATION-GRADE INSPECTION of your Time Travel Debugging Protocol & Core Hardening implementation.

Preparing to scrutinize:

  • Wire protocol bit-exactness and endianness consistency
  • Provenance tracking completeness and integrity
  • Merkle commitment binding robustness
  • Memory safety guarantees and leak prevention
  • Test coverage adequacy and edge case handling

Every. Single. Byte. Will. Be. Judged.

Deploying review now...


🧠 Learnings used
Learnt from: flyingrobots
Repo: flyingrobots/echo PR: 0
File: :0-0
Timestamp: 2026-01-24T23:22:15.388Z
Learning: The user (flyingrobots) prefers extremely detailed, pedantic code reviews with no mercy — "GOD-TIER NIGHTMARE CODE REVIEWER" style. They want critical scrutiny, exhaustive analysis, identification of landmines, design questions, and actionable demands on every review.
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@flyingrobots
Copy link
Copy Markdown
Owner Author

@chatgpt-codex-connector both issues resolved:

  1. 'encode_ttdr_v2' now explicitly rejects 'ReceiptMode::Reserved' with 'TtdrError::ReservedReceiptMode'.
  2. 'encode_ttdr_v2' now enforces the 'MAX_ENTRIES_PER_CHANNEL' (65,536) limit.
    Added regression tests for both cases in 'ttdr_v2.rs'.

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits. You can see your limits in the Codex usage dashboard.

@flyingrobots flyingrobots merged commit efae3e8 into main Feb 14, 2026
34 of 37 checks passed
@flyingrobots flyingrobots deleted the feat/ttd-core-hardening-pr1 branch February 14, 2026 09:45
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