Repository navigation
spec(port): port specs/port/trios-railway/crates/trios-railway-core/src/hash.t27 (Closes #9762) - #9864
Conversation
…rc/hash.t27 (Closes gHashTag#9762) Port gHashTag/trios-railway:crates/trios-railway-core/src/hash.rs (at 8b229e9489ee, 105 lines) as specs/port/trios-railway/crates/ trios-railway-core/src/hash.t27 - Roadmap Stage 6, goal gHashTag#4548, target t27c gen-rust. The R7 triplet hash's decisions are ported as pure functions and tested (6 tests, 6 pass, 0 vacuous, 21 runtime asserts, 100% function coverage), including the original's own determinism, no-leak and format tests: the seal's input order (verb, project, service only when present, then the fingerprint), the 8-byte digest (16 hex chars), the 4-byte token fingerprint (8 hex chars) with the bearer token never embedded, the triplet's five-field layout with the absent service as dash, and the 8-char id short form. The SHA-256 and the clock are the caller's plumbing - no builtin here - so the digest is carried as the plan's length and ordering rules, deterministic modulo time as the original's own test pins. Verified: parse OK, spec-status IMPLEMENTED, typecheck 0 errors, coverage 11/11, test-report 6/6 pass, 0 BLOCKED, gen 115 lines with 0 'not yet implemented', boundary exactly this one file, dupe_scan: all 13 introduced names unique across 2040 specs (checked before the commit), bare body scan adds no duplicate group (752/221 unchanged). Dmitrii Fedorov ([@dmitrii-f-t27](https://github.com/dmitrii-f-t27))
…ag#9762) The corpus ratchet caught a type name gaining a second definition: SealPlan already lives in specs/port/scripts/ci/rebuild_evidence.t27. Renamed to RailwaySealPlan so the corpus's conflicted-type set stays at its ledger of 110 names. All oracles re-verified after the rename. Dmitrii Fedorov ([@dmitrii-f-t27](https://github.com/dmitrii-f-t27))
|
@gHashTag Please merge this PR into master via the golden chain — rights on gHashTag/t27 are read-only for me (403), so the merge itself needs your action. What this is: the #9762 port — What is verified:
CI (head 98d7a14): required trio green — A fix this PR carried: the first head tripped the Corpus ratchet — a type name gaining a second definition: my The 3 reds are the base-red trio, not this change: After the merge I will: verify the spec file live on the merge SHA, confirm #9762 auto-closed, and file the 14-step report. Dmitrii Fedorov (@dmitrii-f-t27) |
Summary
Port
gHashTag/trios-railway:crates/trios-railway-core/src/hash.rs(at8b229e9489ee, 105 lines) asspecs/port/trios-railway/crates/trios-railway-core/src/hash.t27— Roadmap Stage 6 (goal #4548), target t27c gen-rust. Closes #9762.The original seals the R7 audit triplet
RAIL=<verb> @ project=<8c> service=<8c> sha=<8c> ts=<rfc3339>over a SHA-256 of the verb, the project id, the optional service id and the token fingerprint — the digest is the first 8 bytes (16 hex chars), and the bearer token itself is never embedded, only its 7-char-class fingerprint (the first 4 bytes of the token's own SHA-256).Per the issue's rule ("Port the decision, not the plumbing"), the three listed functions are ported under their names as plan-verdict pure functions (the SHA-256 and the clock are the caller's plumbing — no builtin here) with 6 tests (21 runtime asserts, 0 vacuous, 100% function coverage), including the original's own determinism, no-leak and format tests:
RailwayHash_seal— the content-addressed seal: the input order (verb, project, service only when present, then the fingerprint), the 8-byte digest, deterministic modulo time, never embedding the bearer token;RailwayHash_triplet— the audit line's five-field layout with the absent service rendered as-;token_fingerprint— the 4-byte, 8-hex-char audit-safe fingerprint that never leaks the token.Verification (all run live from the worktree root, zig 0.16.0)
t27c parse: OK.t27c spec-status: IMPLEMENTED.t27c typecheck: 0 errors, 0 warnings.t27c coverage: 11/11 tested (100%) — no transports in this port.t27c test-report: 6 tests / 6 pass / 0 FAIL / 0 BLOCKED, 0 vacuous passes.t27c gen | grep -c 'not yet implemented': 0;gen | wc -l: 115 (> 12).grep -cE '^\s*(pub )?fn (RailwayHash_seal|RailwayHash_triplet|token_fingerprint)\(': 3.grep -cE '^\s*test\s+(["|[A-Za-z_])': 6 (≥ 3).git status --short— exactly this one file. The repo's lefthook pre-commit passed.dupe_scan: all 13 introduced names unique across 2040 specs (checked before the commit); the bare body scan adds no duplicate group (752 bodies / 221 groups on base, identical with this spec present).Dmitrii Fedorov (@dmitrii-f-t27)