Skip to content

Port scripts/gen_w384_lean.py (Python, 8 functions) to specs/port/scripts/gen_w384_lean.t27 - #6555

Merged
gHashTag merged 1 commit into
masterfrom
claude/bee-6080-v2
Oct 5, 2026
Merged

gHashTag merged 1 commit into
masterfrom
claude/bee-6080-v2

Conversation

@gHashTag

@gHashTag gHashTag commented Oct 5, 2026

Copy link
Copy Markdown
Owner

Closes #6080

Ports scripts/gen_w384_lean.py to specs/port/scripts/gen_w384_lean.t27. One file, .t27 only.

Design

The original builds Lean theorem text. t27 has no string concatenation or f-strings. Rather than reduce the text to integer stand-ins, this port builds the same text byte for byte into byte buffers that the caller supplies. A function that returned str writes into buf at pos and returns the end position. A function that returned (str, str) writes into two buffers and returns both lengths.

  • var_names(n, sep, buf, pos) writes the first n names joined by sep, skipping the Lean keywords in the original's skip set. Every caller of the Python list[str] either joins it or walks it, so activations are carried as name ordinals.
  • nest_mac, plus_chain, minus_chain, cancellation_chain, zero_weight_closure and theorem_block are ported in full.
  • main() keeps an undefined; body that no test calls, because it does file I/O and prints. Its two decisions are ported and tested:
    • already_present, the idempotence check;
    • w384_appendix, the exact text main appends ("\n\n" + "\n\n".join(blocks) + "\n").
  • The two docstrings contain U+2200. Sources must be ASCII (L3), so put_forall writes the UTF-8 bytes E2 88 80.

Every expected value in the tests was printed by running the Python original:

  • short outputs are compared as exact strings;
  • long ones (the 62/61-variable chains, depth 44, the 19+1+19 closure, and the full 11968-byte appended text) are pinned by length and FNV-1a 32.

Acceptance criteria

These were run on the Railway t27c lab, with t27c built from origin/master e7afb32.

--- 1
present
--- 2
8
--- 3
0
398
--- 4
IMPLEMENTED
--- 5
12
--- 6
0
--- parse
parse-ok
--- test-report
--- test report: specs/port/scripts/gen_w384_lean.t27 ---

  tests       12
  pass        12
  FAIL        0
  rate    100.0%

gen-rust and gen-c also succeed. coverage lists 22 functions with 17 tested directly. The other 5 are main, which is plumbing, and four byte writers that the string-equality tests exercise.

Negative control. I changed three expected values (the appendix hash, "a + b" to "a+b", and the 62-name length from 159 to 160). test-report then printed pass 9, FAIL 3, naming exactly those tests.

Note. duplicate-bodies flagged the local bytes_eq as a copy of gen_w367.t27's slices_equal. The tests now use std.mem.eql, and contains compares bytes inline. The criteria above and the negative control were re-run after that change.

Replaces #6531. That PR had the same file, but its second commit had no issue reference and failed L1 TRACEABILITY. This PR has the same final spec in one commit.

🤖 Generated with Claude Code

…ean.t27

One-commit replacement of the earlier PR for this issue: its follow-up commit
lacked an issue reference and failed L1 TRACEABILITY. The spec is the final
version from that PR (tests compare with std.mem.eql, no copied helper).

Closes #6080

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

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-05 16:45:31 UTC

Summary

Status Count
Total Open PRs 50
PRs with Failing Checks 41
PRs with All Checks Green 9
READY 8
FAILING 41
PENDING 0
NO CHECKS YET 0

These columns do not partition: 8 + 41 + 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)=9f2c8a4829f6 != 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).

@gHashTag
gHashTag merged commit b06be1f into master Oct 5, 2026
23 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/gen_w384_lean.py (Python, 8 functions) to specs/port/scripts/gen_w384_lean.t27

1 participant