Skip to content

docs(arch): contract inventory, ADRs, metadata module, and golden tests#9

Merged
LessUp merged 1 commit into
masterfrom
architecture-deepening-20260531
Jun 1, 2026
Merged

docs(arch): contract inventory, ADRs, metadata module, and golden tests#9
LessUp merged 1 commit into
masterfrom
architecture-deepening-20260531

Conversation

@LessUp
Copy link
Copy Markdown
Owner

@LessUp LessUp commented Jun 1, 2026

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 — single tests/metadata.py as source of truth
  • docs/adr/0002: semantic (not structural) error alignment across C++/Go/Rust
  • docs/adr/0003: Range Coder 100 KiB corpus cap is deliberate policy; removal requires OpenSpec
  • docs/adr/0004: RLE uses buffered (not incremental) streaming semantics across all three languages
  • docs/adr/0005: Range C++ bench mode migration path — retained, removal requires OpenSpec

Phase 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 tables
  • algorithms/shared/rust/tests/frequency_golden.rs: same coverage in Rust

Phase 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 fields
  • CONTEXT.md: added ADR and contract inventory file references
  • docs/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 tests
  • make lint — no new warnings
  • No binary format bytes changed
  • No public API signatures changed
  • No CLI behavior changed
  • No conformance matrix semantics changed

Generated with Devin

… 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>
@LessUp LessUp merged commit 6678b31 into master Jun 1, 2026
@LessUp LessUp deleted the architecture-deepening-20260531 branch June 1, 2026 18:15
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