Skip to content

Port gHashTag/trios:apps/trios-macos/rings/RUST-03/clade-rollback/src/main.rs (Rust, 5 functions) to specs/port/trios/ap - #9379

Merged
gHashTag merged 2 commits into
masterfrom
queen-9362
Oct 13, 2026
Merged

gHashTag merged 2 commits into
masterfrom
queen-9362

Conversation

@gHashTag

Copy link
Copy Markdown
Collaborator

Closes #9362

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

🤖 Generated with Claude Code

Trinity Bee and others added 2 commits October 13, 2026 09:35
Port of gHashTag/trios apps/trios-macos/rings/RUST-03/clade-rollback/
src/main.rs @ 8b229e9489ee (247 lines) to specs/port/trios/apps/
trios-macos/rings/RUST-03/clade-rollback/src/main.t27, per roadmap
stage 6 (goal #4548): port the decision, not the plumbing.

Decision logic extracted and tested (20 test blocks, 33 asserts):
- is_valid_snapshot: trios_app-* prefix, .sha256 sidecars excluded
- find_newest: newest-mtime selection, first entry wins ties
  (stable-sort semantics of the original); Option<String> became
  a typed NewestSnapshot
- sha256_verdict: missing sidecar skips verification (true),
  unreadable binary fails, sidecar text trimmed/lowercased/first
  token before hex comparison - the decision inside verify_sha256
- rollback_exit_code: no snapshots or failed verification -> exit 1
- staging_step: dir/copy failure exits 1 with no tmp cleanup,
  rename failure exits 1 and cleans the staged tmp file

Plumbing keeps its original name with a typed undefined body and is
called by no test: project_dir, verify_sha256, main.

t27c parse, typecheck, gen and test-report all pass; gen emits 255
lines with 0 'not yet implemented'.

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

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

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-13 10:37:06 UTC

Summary

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

These columns do not partition: 0 + 48 + 0 + 0 = 48, 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 edae22604709b43cbab1c961daf4539be0dd0bdf (tools/bees/reviewer.py, zai glm-4.7-flash, glm-4.5-flash, 4 turns, 180 s; then glm-4.7-flash, 5 turns, 793 s).

BEE-VERDICT: APPROVE
summary: Successfully ported all 5 required functions from Rust to .t27, extracting decision logic into pure functions with comprehensive tests
criterion: "test -f specs/port/trios/apps/trios-macos/rings/RUST-03/clade-rollback/src/main.t27 && echo present" -- met -- brief.md:737
criterion: "grep -cE '^\s*(pub )?fn (project_dir|is_valid_snapshot|find_newest|verify_sha256|main)'" -- met -- brief.md:738
criterion: "t27c gen specs/port/trios/apps/trios-macos/rings/RUST-03/clade-rollback/src/main.t27 > /tmp/t27-gen.zig && grep -c 'not yet implemented' /tmp/t27-gen.zig" -- met -- brief.md:739
criterion: "t27c gen specs/port/trios/apps/trios-macos/rings/RUST-03/clade-rollback/src/main.t27 | wc -l" -- met -- brief.md:740
criterion: "t27c spec-status specs/port/trios/apps/trios-macos/rings/RUST-03/clade-rollback/src/main.t27" does not print "NOPARSE" -- met -- brief.md:741
criterion: "grep -cE '^[[:space:]]*test[[:space:]]+(' |[A-Za-z_])'" -- met -- brief.md:742
criterion: "t27c test-report specs/port/trios/apps/trios-macos/rings/RUST-03/clade-rollback/src/main.t27 2>&1 | grep -c BLOCKED" -- met -- brief.md:743
discounted-check: cli-tri -- same red check on master for unrelated compilation errors
discounted-check: duplicate-bodies -- same red check on master for unrelated duplicate bodies
discounted-check: t27b-native-ratchet -- corpus count check, any new spec would move corpus

Evidence

Based on my review of the pull request, I'll analyze whether it meets the requirements for issue #9362.

Analysis

Issue Requirements

Issue #9362 asks to port 5 specific functions from gHashTag/trios/apps/trios-macos/rings/RUST-03/clade-rollback/src/main.rs to specs/port/trios/apps/trios-macos/rings/RUST-03/clade-rollback/src/main.t27:

  1. project_dir() -> String
  2. is_valid_snapshot(name: &str) -> bool
  3. find_newest(entries: &mut [(String, SystemTime)]) -> Option<String>
  4. verify_sha256(binary_path: &Path) -> bool
  5. main()

Verification of Criteria

From the brief.md, all acceptance criteria were verified as PASSED:

  1. ✅ File exists: test -f specs/port/trios/apps/trios-macos/rings/RUST-03/clade-rollback/src/main.t27 && echo present printed present
  2. ✅ All 5 functions are present: grep -c 'pub fn (project_dir|is_valid_snapshot|find_newest|verify_sha256|main)' printed 5
  3. ✅ Code generation produces no "not yet implemented" messages and generates 255 lines
  4. ✅ File parses: t27c spec-status printed IMPLEMENTED (not NOPARSE)
  5. ✅ Has at least 5 tests: grep -c 'test' printed 20
  6. ✅ No BLOCKED tests: t27c test-report printed 0 for BLOCKED count

Port Quality Analysis

The port correctly follows the "Port the decision, not the plumbing" principle:

  1. Plumbing functions have undefined; bodies:

    • project_dir() -> undefined;
    • verify_sha256() -> undefined;
    • main() -> undefined;
  2. Decision logic is properly extracted into testable functions:

    • starts_with() and ends_with() helpers for is_valid_snapshot()
    • find_newest() returns a struct NewestSnapshot instead of Option<String>
    • sha256_verdict() extracts the SHA-256 verification decision
    • rollback_exit_code() and staging_step() extract decision logic from main()
  3. Tests correctly cover the original behavior:

    • All 20 tests map to the original Rust test cases
    • Edge cases are tested (empty entries, ties, whitespace handling)
    • The verification matches the original's exact behavior

Red Checks Analysis

  1. duplicate-bodies - This check is red on master for unrelated duplicate bodies, and the new port doesn't introduce any duplicates. This check does not count against this head.

  2. cli-tri - This check is red on master due to compilation errors in unrelated CLI code. This check does not count against this head.

  3. t27b-native-ratchet - This check is red on master due to a ratchet verdict, which is a ledger/corpus count. Any new spec would move the corpus, so this doesn't count against this head.

Boundary Check

The PR only touches:

  • ✅ specs/port/trios/apps/trios-macos/rings/RUST-03/clade-rollback/src/main.t27 (as required)
  • ✅ docs/now/2026-10-13-published-port-ghashtag-trios-apps-trios-macos-rings-rust-03-clade-rol.md (publication artifact)

No edits outside the boundary, no scratch files, no deletions.

Second, independent review (glm-4.7-flash): APPROVE -- Ported all 5 required functions to main.t27 with comprehensive tests, generated code compiles without blockers

@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 13, 2026
@gHashTag
gHashTag enabled auto-merge (squash) October 13, 2026 11:30
@gHashTag
gHashTag merged commit e65c1b9 into master Oct 13, 2026
29 of 32 checks passed
@gHashTag
gHashTag deleted the queen-9362 branch October 26, 2026 07:10
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

2 participants