Skip to content

Port gHashTag/trinity:src/tri/tri_spec_improve.zig (Zig, 5 functions) to specs/port/trinity/src/tri/tri_spec_improve.t27 - #9228

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

gHashTag merged 2 commits into
masterfrom
queen-9218

Conversation

@gHashTag

Copy link
Copy Markdown
Collaborator

Closes #9218

Written by a bee on queen-9218 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, 226 insertions(+)

🤖 Generated with Claude Code

Trinity Bee and others added 2 commits October 12, 2026 03:47
Port of gHashTag/trinity src/tri/tri_spec_improve.zig @5aabfbe8346f,
stage 5 of the t27 roadmap: TestReport_passRate (with its empty-report
0.0 rule), TestReport_grade (EXCELLENT/GOOD/SATISFACTORY/POOR bands at
100/90/70), calculateFillRate (line scanner counting "pub fn "/"fn "
lines, treating "{}"/"{ }" tails as stubs and a spec with no function
declarations as fully filled), and checkConvergence (no fill rate below
target). getCpuCount is world-touching OS plumbing, so it is ported as
an `undefined;` body with its catch-fallback decision (fall back to 4
when the core count is unavailable) extracted into the pure
cpu_count_from_query and tested directly; no test calls getCpuCount.

String helpers (trim bounds, fn/prefix and stub-tail checks) are
implemented by hand since t27 has no std string utilities. 11 tests
cover the empty spec, all-implemented, stub, mixed-indent, and
declaration-quirk inputs for fill rate, convergence at/above/below
target and on empty lists, and every grade band including the
empty-report edge.

t27c parse, typecheck, gen (194 lines of Zig, no `not yet
implemented`), and test-report (11/11 pass, 0 FAIL, 0 BLOCKED, 0
vacuous) all clean.

Closes #9218
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 #9218

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

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-12 04:37:34 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).

@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 da8fad58ffa76aaf48ce2e60ce1df8cedfb2b63b (tools/bees/reviewer.py, zai glm-4.7-flash, 3 turns, 200 s; then glm-4.5-flash, 4 turns, 117 s).

BEE-VERDICT: APPROVE
summary: All acceptance criteria met; 5 functions ported with correct names; 11 tests asserting original behavior; generated code compiles and passes (0 BLOCKED).
criterion: "test -f specs/port/trinity/src/tri/tri_spec_improve.t27 && echo present" -- met -- evidence: runner output prints "present"
criterion: "grep -cE '^\s*(pub )?fn (TestReport_passRate|TestReport_grade|calculateFillRate|checkConvergence|getCpuCount)(' specs/port/trinity/src/tri/tri_spec_improve.t27" prints 5 -- met -- evidence: runner output prints "5"
criterion: "t27c gen specs/port/trinity/src/tri/tri_spec_improve.t27 > /tmp/t27-gen.zig && grep -c 'not yet implemented' /tmp/t27-gen.zig" prints 0 -- met -- evidence: runner output prints "0"
criterion: "t27c gen specs/port/trinity/src/tri/tri_spec_improve.t27 | wc -l" prints at least 13 -- met -- evidence: runner output prints "194"
criterion: "t27c spec-status specs/port/trinity/src/tri/tri_spec_improve.t27" does not print NOPARSE -- met -- evidence: runner output prints "IMPLEMENTED"
criterion: "grep -cE '^[[:space:]]*test[[:space:]]+("|[A-Za-z_])' specs/port/trinity/src/tri/tri_spec_improve.t27" prints at least 5 -- met -- evidence: runner output prints "11"
criterion: "t27c test-report specs/port/trinity/src/tri/tri_spec_improve.t27 2>&1 | grep -c BLOCKED" prints 0 -- met -- evidence: runner output prints "0"
discounted-check: Documented t27c subcommands exist -- on master: master e351b02: failure (same reason as this head)
discounted-check: cli-tri -- on master: not run on the last 6 commits of master (same as this head)
discounted-check: duplicate-bodies -- on master: master e351b02: failure (same reason as this head)
discounted-check: t27b-native-linux -- on master: master e351b02: failure (same reason as this head)
discounted-check: t27b-native-macos -- on master: master e351b02: failure (same reason as this head)
discounted-check: t27b-native-ratchet -- on master: master e351b02: failure (same reason as this head)

Evidence

Evidence

1. Does the change do what issue #9218 asks?

The issue asks to port src/tri/tri_spec_improve.zig to specs/port/trinity/src/tri/tri_spec_improve.t27 with 5 specific functions and at least 5 test blocks.

Functions ported (names match the issue's list exactly):

  • TestReport_passRate — matches line 36 of original
  • TestReport_grade — matches line 42 of original
  • calculateFillRate — matches line 52 of original
  • checkConvergence — matches line 80 of original
  • getCpuCount — matches line 88 of original

Tests (11 total, all asserting original behavior):

  • "fill rate - empty spec" — asserts calculateFillRate("") == 1.0 (original: line 408)
  • "fill rate - all implemented" — asserts > 0.9 (original: line 420)
  • "fill rate - stub bodies" — asserts calculateFillRate("fn stub() {}") == 0.0 (original: line 408)
  • "fill rate - mixed with indented declarations" — asserts 0.5 (derived from original)
  • "fill rate - declaration quirks" — asserts calculateFillRate("fn ") == 1.0 and calculateFillRate("fn") == 1.0 (edge cases from original)
  • "convergence at target" — asserts checkConvergence returns true/false correctly (original: line 424-426)
  • "report grade" — asserts TestReport_grade returns "EXCELLENT" for perfect pass rate (original: line 437)
  • "report grade - satisfactory band" — asserts returns "SATISFACTORY" for 80% pass rate (original: line 449)
  • "report grade - good and poor bands" — asserts returns "GOOD" and "POOR" (original: line 437, 449)
  • "report grade - empty report" — asserts returns "POOR" for empty report (original: line 438)
  • "cpu count fallback" — asserts cpu_count_from_query returns 4 on failure, returns query result on success (original: line 88-90)

Generated code correctness: The runner confirmed:

  • t27c gen produces 0 "not yet implemented" and 194 lines (acceptance criteria 3)
  • Generated Zig compiles with 0 BLOCKED (acceptance criterion 6)

2. Does it damage anything else?

The bee wrote only the one specified file. The additional docs/now/ entry was added by the publisher, not the bee (brief.md line 13-15 confirms this). No tests were deleted, no assertions weakened, no edits outside the boundary, and no non-ASCII identifiers or secrets.

Summary: All 6 acceptance criteria passed, and the generated code's tests run successfully (0 BLOCKED).

Second, independent review (glm-4.5-flash): APPROVE -- Successfully ported 5 functions from Zig to t27 with all acceptance criteria met

@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 05:23
@gHashTag
gHashTag merged commit 4234cc3 into master Oct 12, 2026
26 of 32 checks passed
@gHashTag
gHashTag deleted the queen-9218 branch October 26, 2026 07:08
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_spec_improve.zig (Zig, 5 functions) to specs/port/trinity/src/tri/tri_spec_improve.t27

2 participants