Phase 2 architectural decisions + core ID types - #11
Merged
Conversation
This was referenced May 30, 2026
nnunley
force-pushed
the
phase2-decisions
branch
2 times, most recently
from
June 8, 2026 02:25
a472b9c to
7c1e19f
Compare
Contributor
|
This needs to be rebased on |
waywardmonkeys
left a comment
Contributor
There was a problem hiding this comment.
Rebase, fix CI, address these things and I think this is good to go.
|
|
||
| **Grounding:** `docs/leit_kernel_handover.md` §"Segment Architecture" (the format | ||
| sketch, versioning bias, and Open Questions) and the ITER-0001 serialization choice | ||
| (bytemuck zero-copy, little-endian — see `docs/superpowers/iterations/requirements/EPIC-009.md`). |
Contributor
There was a problem hiding this comment.
This file doesn't exist in-tree. (It doesn't need to, just don't link to it, I think.)
Collaborator
Author
There was a problem hiding this comment.
Removed the stale handover link and kept the grounding self-contained.
| /// | ||
| /// Fixed-width 4-byte little-endian value; viewable in place from mmap'd | ||
| /// segment bytes via `bytemuck` (`Pod`). | ||
| #[derive(Clone, Copy, Default, PartialEq, Eq, Hash, Pod, Zeroable)] |
Contributor
There was a problem hiding this comment.
Does it actually make sense for these to all impl Default? (I suspect not.)
Collaborator
Author
There was a problem hiding this comment.
Removed Default from all four segment ID types; zero is no longer implicitly presented as a valid identifier.
… (STORY-0096) ITER-0001 dependency hygiene per the usage-site rule: the leit_wind_tunnel harness uses only rapidhash in its library surface; leit_core/leit_index/ leit_text are used solely by its #[cfg(test)] integration tests, so they move to [dev-dependencies] and no longer appear in the harness's production dependency graph. The bench crates were already correct (empty lib; all deps dev). Library build, 17 unit tests, and both bench crates verified green.
… (STORY-0112) ITER-0001: BlockId, FilterExprId, SegmentOrd, SegmentLocalDocId in leit_core, each a #[repr(transparent)] newtype over a [u8; 4] little-endian inner deriving bytemuck Pod/Zeroable. The on-disk form is the in-memory form: a &[u8] slice from an mmap'd buffer casts in place to &[Id] with no allocation or deserialization (zero-copy), stable across host endianness; ordering is numeric. bytemuck chosen over zerocopy because zerocopy's derives emit internal #[allow(non_ascii_idents)]/#[allow(non_local_definitions)] that conflict with the workspace's forbid-level Linebender lints (E0453); bytemuck is no_std and lint-clean under the same forbid set. Proven by SCENARIO-0005 (6 unit tests: value + slice + unaligned round-trip, numeric ordering, LE byte layout).
Records the design-decidable decisions for the Phase 2 segment format (DEC-01..10) with rationale, a Phase 3 forward-compatibility audit, and decision->enforcement traceability. Human-confirmed key calls: - DEC-01 segment offsets: u64 (no size cap; removes the only Phase 3 format-migration risk) - DEC-10 integrity: single footer checksum, verified in Full validation mode - DEC-06 block-aware API: public dedicated BlockCursor trait (Phase 3 WAND consumes it without a format/API break) - DEC-05 header: fixed-layout little-endian POD, absolute u64 section offsets, magic + version + format_flags, reserved stored-fields/columnar slots Decision-documentation ACs of STORY-0078/0081-0084/0090/0043-0047 are satisfied here (decided:ITER-0001); their code-enforcement ACs are deferred to ITER-0003/0004. Forward constraint recorded for ITER-0005: block-metadata schema must carry per-block max_score + doc-range for Phase 3 WAND/MaxScore.
…ORY-0112 AC-2) ITER-0001 audit corrective: SCENARIO-0005 now also exercises try_from_bytes/ try_cast_slice (Ok on well-formed, Err on malformed) per AC-2's validated-read obligation.
nnunley
force-pushed
the
phase2-decisions
branch
from
July 15, 2026 12:22
338d664 to
1d204c5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds Phase 2 segment-format architectural decisions and the core segment-resident ID types they require.
BlockId,FilterExprId,SegmentOrd, andSegmentLocalDocIduse stable 4-byte little-endianbytemuckPOD representations.Defaultsentinel.Verification
cargo test -p leit_core -p leit_wind_tunnelcargo clippy -p leit_core -p leit_wind_tunnel --all-targets -- -D warningscargo fmt --all -- --check