Skip to content

Port scripts/tri_loop/t27b_rules.py (Python, 7 functions) to specs/port/scripts/tri_loop/t27b_rules.t27 - #6252

Merged
gHashTag merged 2 commits into
masterfrom
queen-6210
Oct 5, 2026
Merged

gHashTag merged 2 commits into
masterfrom
queen-6210

Conversation

@gHashTag

@gHashTag gHashTag commented Oct 4, 2026

Copy link
Copy Markdown
Owner

Closes #6210

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

🤖 Generated with Claude Code

Trinity Bee and others added 2 commits October 4, 2026 19:02
…7b_rules.t27

Re-authors the t27b steward's plumbing module (#6210) as a .t27 spec: 7
functions, one per name the task lists, each carrying the original's
decisions as pure code with the world passed in as parameters.

- _cache_dir: XDG_CACHE_HOME when set to a non-empty value, else the home
  fallback (Python's `or` treats unset and empty the same); the path join
  stays with the caller.
- _build: read the generated C first (unreadable is RulesUnavailable even
  when a cached library exists), reuse the cached shared library when it
  exists, and a failing compile is RulesUnavailable; the platform picks
  dylib or so. The hash-named cache file and the compiler's stderr need
  string building and SHA-256, which t27 has no construct for (named in the
  spec header), so the caller names the file and truncates the stderr.
- lib: readiness -- already loaded, or a fresh successful build.
- verdict: the lab's verdict strings map to the spec's codes in order; an
  unknown string is an error, never a guess.
- delta: the compiled delta_code maps to the spec's transition name; code 0
  is Python's None; the ctypes call stays with the caller.
- is_red: the name must be one of the spec's five transitions; the red
  answer is the compiled rules', a parameter here.
- pct: tenths split into the whole part and the one decimal digit; the
  '.'-joined text needs string building (named in the spec header), so the
  caller joins them.

17 tests assert the values and the edge cases the original handles; every
function is covered. t27c parse, typecheck and test-report are clean.

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

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

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-04 19:51:48 UTC

Summary

Status Count
Total Open PRs 47
PRs with Failing Checks 31
PRs with All Checks Green 16
READY 12
FAILING 31
PENDING 0
NO CHECKS YET 0

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

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=8597b6ded596 != 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).

@t27-bees t27-bees 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 f0c8b93f72fecc684d13a14b8351c8723fa70ba2 (tools/bees/reviewer.py, zai glm-4.7-flash, 5 turns, 134 s; then glm-4.5-flash, 9 turns, 98 s).

BEE-VERDICT: REQUEST_CHANGES
summary: Successfully ported 7 Python functions to .t27 with all acceptance criteria met
criterion: "Port scripts/tri_loop/t27b_rules.py (Python, 7 functions) to specs/port/scripts/tri_loop/t27b_rules.t27" -- met -- All 7 functions ported with 17 tests passing, code generates 263 lines with 0 unimplemented
discounted-check: Check L1 TRACEABILITY -- The gen/c/tri/t27b/steward.c modification is pre-existing on master and unrelated to this PR (only docs/ and specs/port/ files added)
blocking-check: coverage -- Cannot be evaluated as it's queued on master
blocking-check: spec-guards -- Cannot be evaluated as it's queued on master

Evidence

The first review (glm-4.7-flash) approved this head. An approval needs a second model to agree on its own, and this second review (glm-4.5-flash) did not.

Based on my analysis of the pull request and the evidence provided, here's my assessment:

Evidence Summary

Acceptance Criteria Verification (All PASSED)

  1. File existence: test -f specs/port/scripts/tri_loop/t27b_rules.t27 && echo present ✓ prints "present"
  2. 7 functions ported: grep -cE '^\s*(pub )?fn (_cache_dir|_build|lib|verdict|delta|is_red|pct)\(' ✓ prints "7"
  3. No unimplemented code: grep -c 'not yet implemented' /tmp/t27-gen.zig ✓ prints "0"
  4. Generated code length: t27c gen | wc -l ✓ prints "263" (more than 12)
  5. File parses: t27c spec-status ✓ prints "IMPLEMENTED" (not "NOPARSE")
  6. Tests present: grep -c 'test' ✓ prints "17" (at least 7)
  7. No blocked tests: t27c test-report | grep -c BLOCKED ✓ prints "0"

Red Checks Analysis

  1. Check L1 TRACEABILITY - FAILURE

    • Reason: "L2 GENERATION VIOLATION: The following files under gen/ were modified directly: M gen/c/tri/t27b/steward.c"
    • Assessment: This appears to be a pre-existing issue, NOT introduced by this PR. The diff only shows two new files: the documentation entry and the new spec file specs/port/scripts/tri_loop/t27b_rules.t27. No modifications to gen/ files are in this PR.
  2. coverage - FAILURE (queued on master, cannot verify)

    • Assessment: Cannot be evaluated as it's queued on master.
  3. spec-guards - FAILURE (queued on master, cannot verify)

    • Assessment: Cannot be evaluated as it's queued on master.

Key Findings

  • The port successfully converts all 7 required functions from Python to .t27
  • The generated code compiles and all tests pass
  • The change respects the boundary: only creates specs/port/scripts/tri_loop/t27b_rules.t27 as required
  • The gen/ file modification mentioned in the L1 check is NOT part of this PR's changes
  • The documentation file is automatically generated by the publisher, not the bee

The L1 TRACEABILITY failure appears to be a false positive - it's detecting changes that already exist on master but are unrelated to this porting task. The actual porting work is complete and correct.

This was referenced Oct 5, 2026
@gHashTag
gHashTag merged commit f6336ac into master Oct 5, 2026
22 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Port scripts/tri_loop/t27b_rules.py (Python, 7 functions) to specs/port/scripts/tri_loop/t27b_rules.t27

2 participants