Skip to content

Port gHashTag/trinity:src/tri/tri_farm_deploy.zig (Zig, 4 functions) to specs/port/trinity/src/tri/tri_farm_deploy.t27 - #9202

Merged
gHashTag merged 2 commits into
masterfrom
queen-9156
Oct 12, 2026
Merged

gHashTag merged 2 commits into
masterfrom
queen-9156

Conversation

@gHashTag

Copy link
Copy Markdown
Collaborator

Closes #9156

Written by a bee on queen-9156 and published by tools/queen/publish.py. The branch itself is the bee's; the second commit is the coordination entry every pull request must add, which a bee has no way to know about.

1 file changed, 273 insertions(+)

🤖 Generated with Claude Code

Trinity Bee and others added 2 commits October 12, 2026 00:33
Port the Trinity Farm Deploy spec (147-line Zig module driving Railway
GraphQL deployments) so the toolchain generates it from .t27:

- ExperimentConfig with the original field defaults (optimizer LAMB,
  lr 1e-3, batch_size 66, context_length 81, ...), plus the four
  R4-R7 template entries.
- findExperiment: linear scan by name, ported in full (returns the
  optional ?ExperimentConfig).
- validateConfig: the three safeguards (flat LR schedule forbidden,
  context < 27 forbidden, lr <= 0 forbidden) in the original order.
  The original's error union (!void with error.FlatScheduleForbidden,
  error.ContextTooSmall, error.InvalidLearningRate) has no .t27
  equivalent, so the verdict is an i32 code; the error names become
  the ERR_* constants.
- formatEnvVarMutation and formatRedeployMutation keep their names and
  signatures (buf plus the ids they render) with undefined; bodies:
  they only move bytes out (print a GraphQL mutation into a caller
  buffer for the HTTP request) and .t27 has no string concatenation,
  so no test calls them. The decision inside each - operation name,
  input fields and order, usePreviousImageTag, projected response
  fields - is carried by the pure helpers the tests exercise.

10 test blocks, all green under t27c test-report (100%, zero vacuous);
t27c parse/typecheck clean; t27c spec-status: IMPLEMENTED; generated
Zig contains no not-yet-implemented markers.

Verified empirically against the compiler before writing: optional
structs (?Struct) with null checks and .? unwrapping, struct field
defaults in partial literals, scientific-notation float literals
(3e-4), str fields and comparison against literals, []u8 parameters,
and undefined; bodies generating plain `return undefined;`.

Closes #9156
A pull request must add exactly one docs/now entry and a bee has no way
to know that: its brief names a boundary file and acceptance criteria,
and docs/now/ is neither. The publisher adds it rather than failing the
gate.

Closes #9156

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-12 00:58:53 UTC

Summary

Status Count
Total Open PRs 50
PRs with Failing Checks 49
PRs with All Checks Green 1
READY 0
FAILING 49
PENDING 0
NO CHECKS YET 0

These columns do not partition: 0 + 49 + 0 + 0 = 49, and there are 50 open PRs. A PR is being counted twice or not at all.

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=e769ef021713 != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

This was referenced Oct 12, 2026

@tri-claw tri-claw Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer bee verdict for head 556b2fdbacc06d21a5ec9a8715c84205c594408a (tools/bees/reviewer.py, zai glm-4.7-flash, glm-4.5-flash, 4 turns, 76 s; then glm-4.7-flash, 3 turns, 47 s).

BEE-VERDICT: APPROVE
summary: Successfully ported 4 functions from Zig to .t27 with comprehensive test coverage
criterion: 1. test -f specs/port/trinity/src/tri/tri_farm_deploy.t27 && echo present prints present -- met -- brief.md:636
criterion: 2. grep -cE '^\s*(pub )?fn (findExperiment|formatEnvVarMutation|formatRedeployMutation|validateConfig)\(' specs/port/trinity/src/tri/tri_farm_deploy.t27 prints 4 -- met -- brief.md:637
criterion: 3. t27c gen specs/port/trinity/src/tri/tri_farm_deploy.t27 > /tmp/t27-gen.zig && grep -c 'not yet implemented' /tmp/t27-gen.zig prints 0, and t27c gen specs/port/trinity/src/tri/tri_farm_deploy.t27 | wc -l prints more than 12 -- met -- brief.md:638-639
criterion: 4. t27c spec-status specs/port/trinity/src/tri/tri_farm_deploy.t27 does not print NOPARSE -- met -- brief.md:640
criterion: 5. grep -cE '^[[:space:]]*test[[:space:]]+("|[A-Za-z_])' specs/port/trinity/src/tri/tri_farm_deploy.t27 prints at least 4 -- met -- brief.md:641
criterion: 6. t27c test-report specs/port/trinity/src/tri/tri_farm_deploy.t27 2>&1 | grep -c BLOCKED prints 0 -- met -- brief.md:642
discounted-check: Documented t27c subcommands exist -- Failure on master (dead tri mentions fell 141 -> 140), unrelated to this port's functionality
discounted-check: cli-tri -- Build failure on master, not caused by this port's changes
discounted-check: t27b-native-ratchet -- Failure on master, same underlying issue as other red checks

Evidence

Evidence

The pull request successfully ports 4 functions from the original Zig code to .t27 format:

File Creation and Structure

  • Created specs/port/trinity/src/tri/tri_farm_deploy.t27 (273 lines)
  • Module declaration: module port::trinity::src::tri::tri_farm_deploy;

Functions Ported

  1. findExperiment(name: str) ?ExperimentConfig - Ported with 4 predefined experiments (EXP_R4 through EXP_R7), returning the correct configuration or null
  2. validateConfig(config: ExperimentConfig) i32 - Ported with 3 safeguards returning error codes (0 for success, 1-3 for various errors)
  3. formatEnvVarMutation(...) - Kept as undefined; body with helper functions for the decision logic
  4. formatRedeployMutation(...) - Kept as undefined; body with helper functions for the decision logic

Test Coverage

  • 10 tests total, exceeding the minimum requirement of 4
  • Tests cover:
    • Finding experiments (r4, r5, r6, r7)
    • Experiment defaults
    • All validation error cases
    • Helper functions for mutation decisions

Acceptance Criteria Met

All criteria from issue #9156 are satisfied:
✓ File exists and outputs "present"
✓ All 4 functions present
✓ Generated code has 0 "not yet implemented" and 178 lines (>12)
✓ File parses (status: IMPLEMENTED)
✓ At least 4 tests present (10 tests)
✓ No BLOCKED tests

Red Checks Discounted

  1. Documented t27c subcommands exist - Failure on master, unrelated to this change
  2. cli-tri - Build failure on master, not caused by this port
  3. t27b-native-ratchet - Failure on master, same root cause as others

Boundary Compliance

  • Only modified the single file specified in the boundary
  • No edits to original or other specs
  • No scratch files or debug output left in repository
  • All data moving functions correctly have undefined; bodies

Second, independent review (glm-4.7-flash): APPROVE -- Creates a valid .t27 spec with all four functions ported as pure decisions, all 6 acceptance criteria pass, and no defects introduced

@tri-claw tri-claw Bot added the bee-reviewed A reviewer bee reviewed and verified this PR at its current head; the only merge signal (#5525) label Oct 12, 2026
@gHashTag
gHashTag enabled auto-merge (squash) October 12, 2026 04:44
@gHashTag
gHashTag merged commit bd17769 into master Oct 12, 2026
29 of 32 checks passed
@gHashTag
gHashTag deleted the queen-9156 branch October 26, 2026 07:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bee-reviewed A reviewer bee reviewed and verified this PR at its current head; the only merge signal (#5525)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Port gHashTag/trinity:src/tri/tri_farm_deploy.zig (Zig, 4 functions) to specs/port/trinity/src/tri/tri_farm_deploy.t27

2 participants