Skip to content

[codex] Harden reading artifact posture#319

Merged
flyingrobots merged 3 commits intomainfrom
feature/reading-artifact-hardening
May 1, 2026
Merged

[codex] Harden reading artifact posture#319
flyingrobots merged 3 commits intomainfrom
feature/reading-artifact-hardening

Conversation

@flyingrobots
Copy link
Copy Markdown
Owner

@flyingrobots flyingrobots commented Apr 29, 2026

Summary

  • Adds explicit ReadingResidualPosture values for residual, plurality, and obstructed alongside the existing complete posture.
  • Mirrors the posture vocabulary through warp-core conversion and adds ABI/core/WASM coverage so consumers can distinguish bounded reading posture from generic state payloads.
  • Updates the public observation/ABI docs to describe the reading-envelope posture surface and current ABI version.

Impact

Built-in observations still emit complete; this does not add suffix admission or new non-clean emission paths. It makes the ABI vocabulary explicit so external consumers can handle future bounded non-clean readings without guessing from payload shape.

Verification

  • cargo fmt --all -- --check
  • cargo test -p echo-wasm-abi --lib
  • cargo test -p warp-core --lib observation
  • cargo test -p warp-wasm --lib --features engine
  • cargo clippy -p warp-core --all-targets -- -D warnings -D missing_docs
  • pnpm docs:build
  • pre-commit staged crate verification
  • push-time full local verification lanes: fmt, guards, clippy-core, tests-runtime, tests-warp-core, rustdoc

pnpm docs:build succeeds with the existing local Node engine warning (v25.9.0 vs requested >=18 <25).

Summary by CodeRabbit

  • Tests
    • Enhanced validation of wire encoding for reading residual posture variants with exact hex representation checks.
    • Extended test assertions to validate observer basis, budget posture, and rights posture fields in observation artifacts.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 29, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: f6b92688-8116-4289-9e62-40be6d87ffba

📥 Commits

Reviewing files that changed from the base of the PR and between 5f5fa67 and 2089593.

📒 Files selected for processing (2)
  • crates/echo-wasm-abi/src/lib.rs
  • crates/warp-wasm/src/warp_kernel.rs

📝 Walkthrough

Walkthrough

Test suite enhancements to validate CBOR wire encoding for ReadingResidualPosture variants and extend field assertions in observation tests by adding enum type imports and assertion checks for reading envelope properties.

Changes

Cohort / File(s) Summary
CBOR Wire Encoding Test
crates/echo-wasm-abi/src/lib.rs
Strengthens test_reading_residual_posture_wire_names_are_distinct by expanding test data to include expected hex representations for each enum variant and adding assertions to validate exact canonical CBOR byte encoding matches.
Reading Field Assertions
crates/warp-wasm/src/warp_kernel.rs
Extends observe_frontier_head_matches_current_head test with validations for observer basis, budget posture, and rights posture fields; imports new enum types ReadingBudgetPosture, ReadingObserverBasis, ReadingRightsPosture.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

📦 Bytes aligned in hex perfection,
Enums checked with keen inspection,
CBOR's truth now crystallized,
Wire protocols standardized. ✓

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title '[codex] Harden reading artifact posture' directly matches the substantive changes: test hardening for ReadingResidualPosture CBOR encoding and expanded WASM ABI posture assertions.
Docstring Coverage ✅ Passed Docstring coverage is 85.71% which is sufficient. The required threshold is 80.00%.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/reading-artifact-hardening

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 60 minutes.

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

@flyingrobots flyingrobots marked this pull request as ready for review April 30, 2026 01:31
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 30, 2026

Note

Docstrings generation - SUCCESS
Generated docstrings for this pull request at #320

coderabbitai Bot added a commit that referenced this pull request Apr 30, 2026
Docstrings generation was requested by @flyingrobots.

* #319 (comment)

The following files were modified:

* `crates/warp-core/src/observation.rs`
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: 2

🤖 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/echo-wasm-abi/src/lib.rs`:
- Around line 611-632: The test
test_reading_residual_posture_wire_names_are_distinct currently only asserts
decoded text and round-trip decoding, which won't catch regressions in the
canonical CBOR encoding; update the test to pin the exact canonical CBOR byte
sequence for each ReadingResidualPosture variant by computing or hardcoding the
expected bytes and assert that encode_cbor(&posture).unwrap() == expected_bytes,
while keeping the existing decode_cbor checks for round-trip equality; reference
the functions ReadingResidualPosture, encode_cbor, decode_value, and decode_cbor
to locate where to replace the Value::Text check with a direct bytes equality
assertion.

In `@crates/warp-wasm/src/warp_kernel.rs`:
- Around line 1283-1296: The test currently asserts only observer_plan,
parent_basis_posture, and residual_posture on artifact.reading; add assertions
for the remaining reading-envelope defaults—observer_basis, budget_posture, and
rights_posture—to the same end-to-end ABI test so a WASM-side default drift
fails loudly (use the same expected enum variants as emitted in
crates/warp-wasm/src/lib.rs around the default block). Locate the assertions
around artifact.reading in the test (symbols: artifact.reading,
AbiReadingObserverPlan, AbiObservationBasisPosture, AbiReadingResidualPosture)
and add checks that artifact.reading.observer_basis equals the expected
AbiObservationBasis (default), artifact.reading.budget_posture equals the
expected AbiBudgetPosture (default), and artifact.reading.rights_posture equals
the expected AbiRightsPosture (default).
🪄 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: 46759ffe-9c86-46ca-b754-9f22898bec85

📥 Commits

Reviewing files that changed from the base of the PR and between a9dfb0b and 5f5fa67.

📒 Files selected for processing (7)
  • crates/echo-wasm-abi/src/kernel_port.rs
  • crates/echo-wasm-abi/src/lib.rs
  • crates/warp-core/src/observation.rs
  • crates/warp-wasm/src/warp_kernel.rs
  • docs/BEARING.md
  • docs/spec/SPEC-0004-worldlines-playback-truthbus.md
  • docs/spec/SPEC-0009-wasm-abi.md

Comment thread crates/echo-wasm-abi/src/lib.rs
Comment thread crates/warp-wasm/src/warp_kernel.rs
@flyingrobots
Copy link
Copy Markdown
Owner Author

Feedback resolution summary:

Issue Resolution Commit
Pin exact canonical CBOR bytes for ReadingResidualPosture wire names Added explicit expected CBOR hex assertions while preserving decoded-text and round-trip checks. 2089593
Cover remaining reading-envelope defaults in the WASM ABI observation test Added assertions for observer_basis, budget_posture, and rights_posture. 2089593

Local verification:

  • cargo fmt --all -- --check
  • cargo test -p echo-wasm-abi --lib
  • cargo test -p warp-wasm --lib --features engine
  • cargo clippy -p echo-wasm-abi --lib --tests -- -D warnings
  • cargo clippy -p warp-wasm --lib --features engine --tests -- -D warnings
  • Push hook full critical gate passed

@flyingrobots flyingrobots merged commit 172e534 into main May 1, 2026
30 checks passed
@flyingrobots flyingrobots deleted the feature/reading-artifact-hardening branch May 1, 2026 20:40
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