docs(arch): contract inventory, ADRs, metadata module, and golden tests#9
Merged
Merged
Conversation
… tests Phase 1 (contract inventory): - docs/architecture/contract-inventory.md: full inventory of codec lifecycle, error, buffer, security, binary format, CLI, validation metadata, and benchmark contracts as of 2026-05-31. Phase 2 (decision records - ADRs): - docs/adr/0001: validation metadata module shape - docs/adr/0002: semantic error alignment across languages - docs/adr/0003: Range Coder corpus cap policy (100 KiB, deliberate) - docs/adr/0004: RLE buffered streaming stance - docs/adr/0005: Range C++ bench mode migration path Phase 3 (contract tests): - algorithms/shared/go/codec/frequency_golden_test.go: byte-exact golden tests for frequency table wire format (Go) - algorithms/shared/rust/tests/frequency_golden.rs: byte-exact golden tests for frequency table wire format (Rust) Phase 4/6 (validation metadata + docs alignment): - tests/metadata.py: single source of truth for algorithm registry, corpus registry, Range cap constant, benchmark job registry, and report schema - CONTEXT.md: add ADR and contract inventory references - docs/en/architecture/index.md: correct CLI example to match actual contract All existing tests pass (make test && make lint). Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
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
Architecture deepening cycle 2026-05-31. All changes are contract-preserving — no binary format, public API, CLI, or test-gate semantics were altered.
Phase 1 — Contract inventory
docs/architecture/contract-inventory.md: full observable-contract snapshot for codec lifecycle, error kinds, buffer semantics, security limits, binary format, CLI, validation metadata, and benchmark metadata. Serves as the authoritative baseline before any refactor.Phase 2 — Decision records (ADRs)
docs/adr/0001: validation metadata module shape — singletests/metadata.pyas source of truthdocs/adr/0002: semantic (not structural) error alignment across C++/Go/Rustdocs/adr/0003: Range Coder 100 KiB corpus cap is deliberate policy; removal requires OpenSpecdocs/adr/0004: RLE uses buffered (not incremental) streaming semantics across all three languagesdocs/adr/0005: Range C++benchmode migration path — retained, removal requires OpenSpecPhase 3 — Contract tests (byte-exact golden)
algorithms/shared/go/codec/frequency_golden_test.go: pins exact LE wire bytes for empty, single-entry, three-entry, max-u32, and count=256 frequency tablesalgorithms/shared/rust/tests/frequency_golden.rs: same coverage in RustPhase 4/6 — Validation metadata + docs alignment
tests/metadata.py: single source of truth for algorithm registry, corpus registry, Range cap constant (RANGE_CORPUS_CAP_BYTES = 100 * 1024), benchmark job registry, and report schema fieldsCONTEXT.md: added ADR and contract inventory file referencesdocs/en/architecture/index.md: corrected CLI example (compress-kit encode --algo ...→ actual<binary> <encode|decode> <input> <output>contract)Test plan
make test— all tests pass including new golden testsmake lint— no new warningsGenerated with Devin