Repository navigation
spec(port): port specs/port/trios-railway/crates/trios-railway-experience/src/lib.t27 (Closes #9769) - #9821
Conversation
…ence/src/lib.t27 (Closes gHashTag#9769) Port gHashTag/trios-railway:crates/trios-railway-experience/src/ lib.rs (at 8b229e9489ee, 140+ lines) as specs/port/trios-railway/ crates/trios-railway-experience/src/lib.t27 - Roadmap Stage 6, goal gHashTag#4548, target t27c gen-rust. The append-only experience writer's decisions are ported as pure functions and tested (5 tests, 5 pass, 0 vacuous, 28 runtime asserts), including the original's own rejects_unknown_phi_step test: the eleven-step PHI LOOP catalogue and its membership gate (from_hash builds the line only for an allowed step, bailing otherwise), the line's carried fields with the absent evidence, and the file layout rules - the experience directory, the trios_railway_<YYYYMMDD>.trinity daily file, the compact date format, the trailing newline per record, and the append-only contract (create(true).append(true), never truncate - L21). The clock and the hash triplet arrive as parameters; the append_line transport keeps its name with an undefined; body no test calls. Verified: parse OK, spec-status IMPLEMENTED, typecheck 0 errors, coverage 11/12 (only the transport untested, by design), test-report 5/5 pass, 0 BLOCKED, gen 148 lines with 0 'not yet implemented', boundary exactly this one file, dupe_scan: all 11 names unique across 2040 specs, bare body scan adds no duplicate group (752/221 unchanged). 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 #9769 port — What is verified:
CI (head 01dfca1): required trio green — 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 #9769 auto-closed, and file the 14-step report. Dmitrii Fedorov (@dmitrii-f-t27) |
Summary
Port
gHashTag/trios-railway:crates/trios-railway-experience/src/lib.rs(at8b229e9489ee, 140+ lines) asspecs/port/trios-railway/crates/trios-railway-experience/src/lib.t27— Roadmap Stage 6 (goal #4548), target t27c gen-rust. Closes #9769.The original is the append-only writer for
.trinity/experience/<YYYYMMDD>.trinity, enforcing L7 (the experience log) and L21 (context immutability): it only ever opens files in append mode and never seeks or truncates — a caller that would truncate has no method to call.Per the issue's rule ("Port the decision, not the plumbing"), the two listed functions are ported under their names —
append_lineas anundefined;transport no test calls,ExperienceLine_from_hashas a tested pure constructor — and the decisions are ported with 5 tests (28 runtime asserts, 0 vacuous):phi_step_count/phi_step_in_order/is_valid_phi_step— the eleven-step PHI LOOP catalogue (CLAIM…PUSH, mirroring NOW.json) and the membership gate:from_hashbuilds the line only for an allowed step, bailing otherwise — the original's ownrejects_unknown_phi_steptest;ExperienceLine_from_hash— the built/invalid verdict with the carried fields and the absent evidence (skip_serializing_ifbecomes the absent flag); the clock (Utc::now) and the hash triplet arrive as parameters;experiencedirectory, thetrios_railway_<YYYYMMDD>.trinitydaily file (prefix, suffix, compact%Y%m%ddate format), one JSON record per line with its trailing newline, and the append-only contract (create(true).append(true), never truncate — L21).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/12 tested — only theappend_linetransport untested, by design.t27c test-report: 5 tests / 5 pass / 0 FAIL / 0 BLOCKED, 0 vacuous passes.t27c gen | grep -c 'not yet implemented': 0;gen | wc -l: 148 (> 12).grep -cE '^\s*(pub )?fn (ExperienceLine_from_hash|append_line)\(': 2.grep -cE '^\s*test\s+(["|[A-Za-z_])': 5 (≥ 2).git status --short— exactly this one file. The repo's lefthook pre-commit passed.dupe_scan: all 11 names unique across 2040 specs; the bare body scan adds no duplicate group (752 bodies / 221 groups on base, identical with this spec present).Dmitrii Fedorov (@dmitrii-f-t27)