Skip to content

feat: add witnessed suffix admission shell skeleton#322

Merged
flyingrobots merged 5 commits intomainfrom
feature/witnessed-suffix-admission-shell-red
May 1, 2026
Merged

feat: add witnessed suffix admission shell skeleton#322
flyingrobots merged 5 commits intomainfrom
feature/witnessed-suffix-admission-shell-red

Conversation

@flyingrobots
Copy link
Copy Markdown
Owner

@flyingrobots flyingrobots commented May 1, 2026

Summary

Adds the first shape-only witnessed suffix admission shell skeleton.

This PR follows the METHOD sequence already landed on main:

  • DESIGN: 7adf880 docs: design witnessed suffix admission shell
  • RED: a6802f2 test: add red tests for witnessed suffix admission shell
  • GREEN: 9e23ed4 feat: add witnessed suffix admission shell skeleton

What changed

  • Adds ABI DTOs for WitnessedSuffixShell, WitnessedSuffixAdmissionRequest, WitnessedSuffixAdmissionResponse, and WitnessedSuffixAdmissionOutcome.
  • Adds core DTOs with the same vocabulary and core-to-ABI conversions.
  • Covers admitted, staged, plural, conflict, and obstructed outcomes.
  • Reuses existing WorldlineId, WorldlineTick, ProvenanceRef, settlement basis evidence, overlap revalidation evidence, ConflictReason, and reading residual posture vocabulary.
  • Uses #[serde(deny_unknown_fields)] on the new ABI DTOs so transport/sync/status field smuggling is rejected at the boundary.

Non-goals preserved

  • No network transport.
  • No remote sync.
  • No import execution.
  • No endpoints.
  • No broad ABI redesign.

Verification

  • cargo fmt --all -- --check
  • cargo test -p echo-wasm-abi --lib witnessed_suffix
  • cargo test -p warp-core --lib witnessed_suffix
  • cargo clippy -p warp-core --all-targets -- -D warnings -D missing_docs

Push hook also passed the full local gate: fmt, guards, clippy-core, runtime tests, warp-core tests, and rustdoc.

Summary by CodeRabbit

Release Notes

  • New Features

    • Added witnessed suffix admission flow with support for multiple outcome states: admitted, staged, plurality-preserving, conflicting, and obstructed scenarios.
    • Introduced new public API types for witnessed suffix shells, admission requests, and responses with outcome tracking.
  • Tests

    • Added comprehensive test coverage for witnessed suffix serialization, deserialization, and ABI conversion across all admission outcome variants.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 1, 2026

Warning

Rate limit exceeded

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

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ 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.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 8beb1f46-29fd-44a9-91ea-8f392a3bcf24

📥 Commits

Reviewing files that changed from the base of the PR and between 9e23ed4 and 529da16.

📒 Files selected for processing (3)
  • crates/echo-wasm-abi/src/witnessed_suffix_tests.rs
  • crates/warp-core/src/witnessed_suffix.rs
  • docs/method/backlog/inbox/PLATFORM_abi-nested-evidence-strictness.md
📝 Walkthrough

Walkthrough

This PR adds serialization infrastructure for witnessed suffix admission judgment, introducing ABI request/response/outcome types with strict CBOR encoding, domain logic with deterministic Blake3 digest computation for overlap verification, and comprehensive round-trip and negative-case tests across both layers.

Changes

Cohort / File(s) Summary
ABI Serialization Layer
crates/echo-wasm-abi/src/kernel_port.rs
Adds WitnessedSuffixShell, WitnessedSuffixAdmissionRequest, WitnessedSuffixAdmissionResponse structs and WitnessedSuffixAdmissionOutcome enum (Admitted/Staged/Plural/Conflict/Obstructed variants) with #[serde(deny_unknown_fields)] for strict CBOR decoding.
Domain Logic Layer
crates/warp-core/src/witnessed_suffix.rs
Implements domain equivalents of ABI types with to_abi() conversion methods. Includes deterministic Blake3 digest computation for overlap slots via structured hashing and length prefixing. Outcome variants include residual posture tracking, conflict reasoning, and optional revalidation metadata.
ABI Test Coverage
crates/echo-wasm-abi/src/witnessed_suffix_tests.rs
Validates CBOR round-trip serialization for all request/response/shell variants; adds JSON-based negative tests ensuring deserialization fails on missing required fields or invalid transport/sync fields.
Domain Test Coverage
crates/warp-core/src/witnessed_suffix_tests.rs
Constructs deterministic domain objects and verifies to_abi() conversions for requests (worldline/entries/basis preservation) and responses across all five outcome variants with field-level assertions.
Module Wiring
crates/echo-wasm-abi/src/lib.rs, crates/warp-core/src/lib.rs
Declares witnessed_suffix_tests submodule in ABI crate; introduces witnessed_suffix module and re-exports all four public types (WitnessedSuffix*) in warp-core public API.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

Witnessed suffixes judged with Blake3's grip,
Five outcomes flow—admit, stage, conflict, slip.
Shell digests hash the overlap's dance,
Deterministic, no room for chance. ⚙️✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 49.09% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Title accurately describes the main change: introduces witnessed suffix admission shell skeleton types and infrastructure across ABI and core modules.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/witnessed-suffix-admission-shell-red

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
Review rate limit: 0/1 reviews remaining, refill in 19 minutes and 30 seconds.

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

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@crates/warp-core/src/witnessed_suffix.rs`:
- Around line 397-401: The helper len_to_u64 currently masks conversion failures
by returning u64::MAX which creates ambiguous, non‑deterministic encodings;
change len_to_u64 to fail deterministically on overflow instead of saturating:
replace the Err branch with a hard failure (e.g. use u64::try_from(len).expect
or unwrap with a clear message) so any usize > u64::MAX panics immediately;
update callers if they expect a Result, but prefer keeping the function
signature u64 len_to_u64(usize) that panics on overflow and include a clear
error message referencing len_to_u64.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 2c9725c2-ad3f-4867-b1bb-5d601ffde311

📥 Commits

Reviewing files that changed from the base of the PR and between 7adf880 and 9e23ed4.

📒 Files selected for processing (6)
  • crates/echo-wasm-abi/src/kernel_port.rs
  • crates/echo-wasm-abi/src/lib.rs
  • crates/echo-wasm-abi/src/witnessed_suffix_tests.rs
  • crates/warp-core/src/lib.rs
  • crates/warp-core/src/witnessed_suffix.rs
  • crates/warp-core/src/witnessed_suffix_tests.rs

Comment thread crates/warp-core/src/witnessed_suffix.rs
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: 9e23ed4d4d

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

/// Target basis used while judging admission.
pub target_basis: ProvenanceRef,
/// Optional target-basis evidence for strand/parent realization cases.
pub basis_report: Option<SettlementBasisReport>,
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 unknown fields inside nested basis reports

WitnessedSuffixAdmissionRequest is marked with deny_unknown_fields, but its basis_report payload reuses SettlementBasisReport, which does not deny unknown keys. In JSON/self-describing formats, this means extra fields inside basis_report are still silently accepted, so the new admission boundary does not fully block field smuggling when callers nest unexpected transport/sync/status data under that object.

Useful? React with 👍 / 👎.

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.

Thanks. I am not applying this in this PR because it would tighten pre-existing settlement DTO decode behavior outside the witnessed-suffix shell skeleton. The shell DTOs added here use #[serde(deny_unknown_fields)] at their own boundary, and the nested SettlementBasisReport reuse is intentionally existing ABI vocabulary rather than a broad ABI strictness redesign. This should be handled separately if we decide all settlement evidence DTOs should reject unknown fields.

@flyingrobots
Copy link
Copy Markdown
Owner Author

Follow-up fixes pushed after initial PR checks:

Issue Resolution SHA
Determinism Guards failed because witnessed suffix rejection tests used serde_json:: under echo-wasm-abi. Reworked negative tests to mutate canonical CBOR Value maps and decode through the repo deterministic CBOR path. fd2247e
CodeRabbit flagged len_to_u64 saturating to u64::MAX on conversion failure. Removed saturation and added a compile-time usize::BITS <= u64::BITS guard, then cast only under that invariant. This avoids expect/panic while making unsupported pointer widths fail at compile time. 60d4b5f

Local verification after these fixes:

  • cargo fmt --all -- --check
  • cargo test -p echo-wasm-abi --lib witnessed_suffix
  • cargo test -p warp-core --lib witnessed_suffix
  • cargo clippy -p warp-core --all-targets -- -D warnings -D missing_docs
  • scripts/ban-nondeterminism.sh

Push hooks also passed the local critical gates on both follow-up pushes.

@flyingrobots flyingrobots merged commit 07702fc into main May 1, 2026
30 checks passed
@flyingrobots flyingrobots deleted the feature/witnessed-suffix-admission-shell-red branch May 1, 2026 20:12
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