Repository navigation
spec(port): port specs/port/trios/crates/trios-rainbow-bridge/src/channel.t27 (Closes #9734) - #9815
Conversation
…nnel.t27 (Closes gHashTag#9734) Port gHashTag/trios:crates/trios-rainbow-bridge/src/channel.rs (at 8b229e9489ee, 137 lines) as specs/port/trios/crates/trios- rainbow-bridge/src/channel.t27 - Roadmap Stage 6, goal gHashTag#4548, target t27c gen-rust. The payload-to-channel total function is ported as pure functions and tested (4 tests, 4 pass, 0 vacuous, 61 runtime asserts, 100% function coverage): exactly seven channels in ROY G BIV order (the original's own exactly_seven test), the per-kind mapping claim->red, heartbeat->orange, done->yellow, honey->green, state->blue, violation->indigo, victory->violet, and the total-and-injective-on- colour property proven by the double loop over all 49 pairs - the original's own injectivity test. The language does not compile enum values as arguments or literals, so both enums are modelled by their serde snake_case tags; the empty answer marks the unreachable eighth variant, mirroring the original's wildcard-free match. No transport exists in this port. Verified: parse OK, spec-status IMPLEMENTED, typecheck 0 errors, coverage 5/5, test-report 4/4 pass, 0 BLOCKED, gen 131 lines with 0 'not yet implemented', boundary exactly this one file, dupe_scan: all 5 names unique across 2040 specs, bare body scan adds no duplicate group (752 bodies / 221 groups 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 #9734 port — What is verified:
CI (head be081dd): 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 #9734 auto-closed, and file the 14-step report. Dmitrii Fedorov (@dmitrii-f-t27) |
Summary
Port
gHashTag/trios:crates/trios-rainbow-bridge/src/channel.rs(at8b229e9489ee, 137 lines) asspecs/port/trios/crates/trios-rainbow-bridge/src/channel.t27— Roadmap Stage 6 (goal #4548), target t27c gen-rust. Closes #9734.The original declares exactly seven colour channels in ROY G BIV order (an eighth variant is forbidden — R7 + ONE SHOT §8, mirrored by the Coq
seven_channels_totallemma) and the total function mapping each of the seven payload variants to its one legal channel — a match with no wildcard arm, total and injective on colour.Per the issue's rule ("Port the decision, not the plumbing"), the one listed function is ported under its name as a tested pure decision, with 4 tests (61 runtime asserts, 0 vacuous, 100% function coverage):
channel_of_payload— the mapping: claim → red, heartbeat → orange, done → yellow, honey → green, state → blue, violation → indigo, victory → violet (original lines 100-110);channel_count/channel_in_order— the canonical ROY G BIV order (Channel::ALL, original lines 33-46), asserted to be exactly seven — the original's ownexactly_seven_channelstest;payload_kind_count/payload_kind_in_order— the seven payload kinds in the sample order of the original's own injectivity test;channel_of_payload_is_total_and_injective_on_colourtest;The language does not compile enum values as arguments or literals, so both enums are modelled by their serde snake_case tags — the shape this series uses for command strings.
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: 5/5 tested (100%) — no transports in this port.t27c test-report: 4 tests / 4 pass / 0 FAIL / 0 BLOCKED, 0 vacuous passes.t27c gen | grep -c 'not yet implemented': 0;gen | wc -l: 131 (> 12).grep -cE '^\s*(pub )?fn (channel_of_payload)\(': 1.grep -cE '^\s*test\s+(["|[A-Za-z_])': 4 (≥ 1).git status --short— exactly this one file. The repo's lefthook pre-commit passed.dupe_scan: all 5 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)