Repository navigation
spec(port): port specs/port/trios-railway/crates/trios-railway-audit/src/event.t27 (Closes #9790) - #9817
Conversation
…src/event.t27 (Closes gHashTag#9790) Port gHashTag/trios-railway:crates/trios-railway-audit/src/event.rs (at 8b229e9489ee, 182 lines) as specs/port/trios-railway/crates/ trios-railway-audit/src/event.t27 - Roadmap Stage 6, goal gHashTag#4548, target t27c gen-rust. The AU-02 audit writer's decisions are ported as pure functions and tested (6 tests, 6 pass, 0 vacuous, 20 runtime asserts), including the original's own four artifact tests: the Gate-2 contribution rule (bpb strictly below target_bpb), the image_sha kept-length rule (at most eight characters, a shorter sha kept whole), the insert shape (four columns, returning the id), and the Neon env fallback order (RAILWAY_POSTGRES_URL preferred, legacy NEON_DATABASE_URL accepted). The clock is a caller parameter and the sha slicing is the caller's string plumbing guided by the kept-length decision. The audit_event transport keeps its name with an undefined; body no test calls. Verified: parse OK, spec-status IMPLEMENTED, typecheck 0 errors, coverage 8/9 (only the transport untested, by design), test-report 6/6 pass, 0 BLOCKED, gen 100 lines with 0 'not yet implemented', boundary exactly this one file, dupe_scan: all 9 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 #9790 port — What is verified:
CI (head 34f72ee): 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 #9790 auto-closed, and file the 14-step report. Dmitrii Fedorov (@dmitrii-f-t27) |
Summary
Port
gHashTag/trios-railway:crates/trios-railway-audit/src/event.rs(at8b229e9489ee, 182 lines) asspecs/port/trios-railway/crates/trios-railway-audit/src/event.t27— Roadmap Stage 6 (goal #4548), target t27c gen-rust. Closes #9790.The original is the AU-02 Neon audit writer:
audit_eventinserts one row intoigla_race_trialsand returns the id, never silently swallowing errors (R5), andAuditArtifact::newbuilds the stdout JSON artifact the hourly watchdog parses without re-querying Neon.Per the issue's rule ("Port the decision, not the plumbing"), the two listed functions are ported under their names —
audit_eventas anundefined;transport no test calls,AuditArtifact_newas a tested pure constructor — and the decisions are ported with 6 tests (20 runtime asserts, 0 vacuous), including the original's own four artifact tests:gate2_contributes— the Gate-2 contribution rule: this row contributes exactly whenbpb < target_bpb, strictly (original line 88; the original's own true-below and false-above tests);image_sha_kept_len— the sha kept-length rule: at most the first eight characters, a shorter sha kept whole (original line 85; the original's own truncate and short tests); the slicing itself is the caller's string plumbing;RAILWAY_POSTGRES_URLpreferred, the legacyNEON_DATABASE_URLaccepted per L-NEON-RENAME (original lines 101-103).The clock is a parameter the caller passes (the original stamps
Utc::nowinside).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: 8/9 tested — only theaudit_eventtransport untested, by design.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: 100 (> 12).grep -cE '^\s*(pub )?fn (AuditArtifact_new|audit_event)\(': 2.grep -cE '^\s*test\s+(["|[A-Za-z_])': 6 (≥ 2).git status --short— exactly this one file. The repo's lefthook pre-commit passed.dupe_scan: all 9 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)