Skip to content

spec(port): port specs/port/trios-railway/crates/trios-railway-core/src/mutations.t27 (Closes #9783) - #9862

Merged
gHashTag merged 1 commit into
gHashTag:masterfrom
dmitrii-f-t27:zcode-port-9783-railway-mutations
Oct 17, 2026
Merged

gHashTag merged 1 commit into
gHashTag:masterfrom
dmitrii-f-t27:zcode-port-9783-railway-mutations

Conversation

@dmitrii-f-t27

Copy link
Copy Markdown
Contributor

Summary

Port gHashTag/trios-railway:crates/trios-railway-core/src/mutations.rs (at 8b229e9489ee, 165 lines) as specs/port/trios-railway/crates/trios-railway-core/src/mutations.t27 — Roadmap Stage 6 (goal #4548), target t27c gen-rust. Closes #9783.

The original is RW-03: the five typed mutations against the Railway GraphQL API — serviceCreate (image-based, project-scoped), variableUpsert (one variable at a time, fully scoped), serviceInstanceRedeploy (redeploy on the most recent source, answering the new deployment id), serviceInstanceUpdate (pinning source.image), and serviceDelete (permanent, deployments included). The R7 triplet is logged at the call site — this module returns plain ids.

Per the issue's rule ("Port the decision, not the plumbing"), all five listed functions are ported under their names as plan-verdict pure functions (no transports: the GraphQL round-trips are the callers' plumbing, so no undefined; body is needed) with 8 tests (28 runtime asserts, 0 vacuous, 100% function coverage), including the original's own mutation_strings_present and created_service tests:

  • the five mutation names with the shared mutation M( prefix;
  • the variable-key counts each carries: serviceCreate 2 — and NOT the image, because Railway splits service from service-instance config (the image lands via the follow-up serviceInstanceUpdate); variableUpsert 5 (projectId, environmentId, serviceId, name, value — one variable, fully scoped); redeploy 2 (reusing the most recent source); delete 1;
  • the image pin landing on source.image inside the instance update input;
  • the redeploy answer rule — a JSON string taken as-is, anything else stringified;
  • the CreatedService shape under its serde names.

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: 19/19 tested (100%) — every helper directly asserted.
  • t27c test-report: 8 tests / 8 pass / 0 FAIL / 0 BLOCKED, 0 vacuous passes.
  • t27c gen | grep -c 'not yet implemented': 0; gen | wc -l: 165 (> 12).
  • grep -cE '^\s*(pub )?fn (service_create|service_instance_set_image|variable_upsert|service_redeploy|service_delete)\(': 5. grep -cE '^\s*test\s+(["|[A-Za-z_])': 8 (≥ 5).
  • Boundary: git status --short — exactly this one file. The repo's lefthook pre-commit passed.
  • dupe_scan: all 14 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)

…rc/mutations.t27 (Closes gHashTag#9783)

Port gHashTag/trios-railway:crates/trios-railway-core/src/mutations.rs
(at 8b229e9489ee, 165 lines) as specs/port/trios-railway/crates/
trios-railway-core/src/mutations.t27 - Roadmap Stage 6, goal gHashTag#4548,
target t27c gen-rust.

The RW-03 mutations' decisions are ported as pure functions and
tested (8 tests, 8 pass, 0 vacuous, 28 runtime asserts, 100%
function coverage), including the original's own
mutation_strings_present and created_service tests: the five
mutation names (serviceCreate, variableUpsert,
serviceInstanceRedeploy, serviceInstanceUpdate, serviceDelete) with
the shared mutation M( prefix, the variable-key counts each carries
(serviceCreate 2 and NOT the image - Railway splits service from
service-instance config; variableUpsert 5, fully scoped; redeploy
2, reusing the most recent source; delete 1), the image pin landing
on source.image, the redeploy answer's string-or-stringified rule,
and the CreatedService shape under its serde names. The five
required functions keep their names as plan verdicts; the GraphQL
round-trips are the callers' plumbing, and no undefined transport
is needed.

Verified: parse OK, spec-status IMPLEMENTED, typecheck 0 errors,
coverage 19/19, test-report 8/8 pass, 0 BLOCKED, gen 165 lines with
0 'not yet implemented', boundary exactly this one file, dupe_scan:
all 14 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))
@dmitrii-f-t27

Copy link
Copy Markdown
Contributor Author

@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 #9783 port — crates/trios-railway-core/src/mutations.rs (gHashTag/trios-railway, at 8b229e9489ee, 165 lines) re-authored as specs/port/trios-railway/crates/trios-railway-core/src/mutations.t27. One file, one commit, head 85550fd9d, Closes #9783.

What is verified:

  • t27c parse OK, spec-status IMPLEMENTED, typecheck 0 errors / 0 warnings, coverage 19/19 (100%) — no transports in this port, t27c test-report 8 tests / 8 pass / 0 FAIL / 0 BLOCKED, 0 vacuous — including the original's own mutation_strings_present and created_service tests: the five mutation names with the shared mutation M( prefix, the variable-key counts (serviceCreate 2 without the image — Railway splits service from service-instance config; variableUpsert 5, fully scoped; redeploy 2; delete 1), the image pin on source.image, the redeploy answer's string-or-stringified rule, and the CreatedService shape.
  • gen → 165 lines, 0 not yet implemented; the 5 required names count exactly 5; 8 test blocks; boundary exactly the one file.
  • dupe_scan: all 14 introduced names unique across 2040 specs (checked before the commit); the bare body scan adds no duplicate group (752/221 unchanged).
  • The t27b-native-run artifact of this head (commit 85550fd, run 39008620213): mutations.t27 row — reference pass, t27b pass, tests 8, invariants 0, asserts 30, blockers [], detail empty, reference_disagree: [].

CI (head 85550fd): required trio green — validate, check-linked-issue, parse-ratchet — and Check L1 TRACEABILITY green (the single commit carries its issue reference); 26 checks pass overall, incl. emit-bitexact, t27b-native-linux, t27b-native-macos.

The 3 reds are the base-red trio, not this change: cli-tri (the #3324 include_str!), duplicate-bodies (only the known base names), t27b-native-ratchet (the same verdict red the Queen's port PRs carry; this spec's own row is reference pass + t27b pass — the registration debt is the UNLISTED class).

After the merge I will: verify the spec file live on the merge SHA, confirm #9783 auto-closed, and file the 14-step report.

Dmitrii Fedorov (@dmitrii-f-t27)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants