Skip to content

feat(t27c): gen-json -- the IGLA board event a spec states, as one JSON object (Closes #10050) - #10064

Merged
gHashTag merged 4 commits into
masterfrom
feat/gen-json-10050
Oct 18, 2026
Merged

gHashTag merged 4 commits into
masterfrom
feat/gen-json-10050

Conversation

@gHashTag

@gHashTag gHashTag commented Oct 17, 2026 •

Copy link
Copy Markdown
Owner

Closes #10050

What

t27c gen-json <spec> prints the IGLA board event a spec states, as one compact JSON object:

{"job":JOB,"stage":STAGE,"msg":MSG,"progress":PROGRESS,
 "metrics":{KEY_LENS:LENS_PCT,KEY_CELLS:[{KEY_STATUS:CELL_STATUS[c],KEY_PCT:CELL_PCT[c]} ...]}}
  • Values (FR-001). Every value comes from the spec through the gen-js value layer, codegen_js::const_value(&JS, ...). That layer already spells strings, numbers and arrays as valid JSON, so no value is written in Rust.
  • Keys. The keys inside metrics come from the spec's KEY_* consts.
  • Cells. The 27 cells are made by zipping CELL_STATUS with CELL_PCT. If the two arrays differ in length, the command stops with an error.
  • Missing const. The command exits non-zero and names it, for example gen-json: the spec declares no const KEY_PCT.
  • Not committed (FR-003, changed 2026-10-18). The event is not committed under gen/; whatever posts it runs t27c gen-json at post time.
    • The copy committed earlier went stale every time the map moved: 621, then 622, then 626 bytes within a day.
    • The L2 GENERATION rule also refused gen/json/ as a backend directory it does not know.
    • The spec stays the event's only home. The issue was edited to match.

Foreign-code gate

This adds Rust under bootstrap/. The owner approved the label on 2026-10-18 and named the offset (translated from chat): "the label is approved; for the offset, delete docs/reports/data/W564-harness.sh and tools/jtag/read_user1.py, and keep the glue to 46 lines or fewer".

lines
hand-written Rust added (bootstrap/src/main.rs only: subcommand, 2 dispatch arms, run_gen_json) +30
docs/reports/data/W564-harness.sh deleted -26
tools/jtag/read_user1.py deleted (already ported as specs/port/tools/jtag/read_user1.t27) -20
net hand-written foreign code -16
  • tools/devhome_baseline.txt drops the deleted harness's line. It is modified, not deleted.
  • foreign-budget and own-language pass in lefthook, on both pre-commit and pre-push.

Lab output (Railway lab, /tmp/gj10050, PATH=/opt/zig, HEAD 9243cbf = this branch with origin/master 538df07 merged)

$ cargo build --release -p t27c
    Finished `release` profile [optimized] target(s) in 47.23s
BUILD_RC=0
$ grep -n -E "METRICS_BYTES : |pub const MSG : |pub const PROGRESS" specs/igla/own_model_board.t27
51:pub const MSG : str = "1 published, 16 verified, 5 drafts, 5 gaps; 54%";
55:pub const PROGRESS : f64 = 0.54;
67:pub const METRICS_BYTES : i32 = 626;
$ ./target/release/t27c gen-json specs/igla/own_model_board.t27 > /tmp/gj10050c.json
rc=0
326fd30e8cb26d27e7437eb1d41abd880b4cad90451ea192c1bf9f1588885b62  /tmp/gj10050c.json
749
$ python3 -c '... json.load ...; json.dumps(e["metrics"], separators=(",",":"))'
metrics_bytes 626 keys ['job', 'metrics', 'msg', 'progress', 'stage'] cells 27 progress 0.54
msg 1 published, 16 verified, 5 drafts, 5 gaps; 54%
$ cat /tmp/gj10050c.json
{"job":"own_model","stage":"own_model","msg":"1 published, 16 verified, 5 drafts, 5 gaps; 54%","progress":0.54,"metrics":{"lens_pct":[55,70,37],"cells":[{"status":4,"pct":60},{"status":4,"pct":70},{"status":4,"pct":80},{"status":4,"pct":80},{"status":4,"pct":60},{"status":4,"pct":100},{"status":3,"pct":50},{"status":0,"pct":0},{"status":0,"pct":0},{"status":4,"pct":100},{"status":4,"pct":100},{"status":4,"pct":20},{"status":4,"pct":80},{"status":4,"pct":65},{"status":4,"pct":95},{"status":3,"pct":75},{"status":3,"pct":55},{"status":3,"pct":40},{"status":4,"pct":70},{"status":4,"pct":15},{"status":5,"pct":60},{"status":4,"pct":40},{"status":4,"pct":100},{"status":0,"pct":0},{"status":0,"pct":0},{"status":0,"pct":0},{"status":3,"pct":50}]}}
--- test report: specs/igla/own_model_board.t27 ---
  tests       6
  pass        6
  FAIL        0
  invariants  1   proved -- comptime, so compiling IS the check
  rate    100.0%
  runtime asserts executed, per test (#6509; a pass with 0 is vacuous, T730):
       9  the_metrics_are_own_models_arrays
      34  a_gap_cell_is_never_above_zero_percent
       7  the_tally_sums_to_twenty_seven
       9  the_message_is_the_tally
       4  progress_is_the_overall_percent_over_a_hundred
       3  the_metrics_fit_the_board
  vacuous passes  0 of 6  (passed with 0 runtime asserts executed)

The metrics object is 626 bytes, equal to master's METRICS_BYTES.

An earlier run (before the drop commit) included a negative control: with KEY_PCT removed from a copy of the spec, the command printed Error: gen-json: the spec declares no const KEY_PCT and exited 1.

Not in this PR

The igla-judge Railway cron that POSTs this body to board.railway.internal:8081/event is the next step. It is config-only and is not part of this PR.

🤖 Generated with Claude Code

gHashTag and others added 2 commits October 18, 2026 00:49
…bject (Closes #10050)

t27c gen-json reuses the gen-js value layer (const_value through the JS
Target) and arranges the values into the board's event
{job, stage, msg, progress, metrics}, the metrics keys taken from the
spec's KEY_LENS/KEY_CELLS/KEY_STATUS/KEY_PCT and the 27 cells zipped from
CELL_STATUS and CELL_PCT.

Hand-written Rust: +30 lines, all in bootstrap/src/main.rs (already on the
owner's exception list; a new file would need a protected list change).
Offset named by the owner: docs/reports/data/W564-harness.sh (-26) and
tools/jtag/read_user1.py (-20, already ported as
specs/port/tools/jtag/read_user1.t27); the devhome baseline drops the
deleted harness's line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rints (Closes #10050)

Generated on the Railway lab by ./target/release/t27c gen-json specs/igla/own_model_board.t27
at 0209e05 (sha256 6d85c82c...c6e2, 745 bytes; metrics object 622 bytes = METRICS_BYTES).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gHashTag gHashTag added the owner-approved-foreign Owner-approved exception to the only-t27 rule: hand-written foreign code allowed in this PR label Oct 17, 2026
@gHashTag
gHashTag enabled auto-merge (squash) October 17, 2026 17:57
@github-actions

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-17 17:57:23 UTC

Summary

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

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).

gHashTag added a commit that referenced this pull request Oct 17, 2026
…irectory (Closes #10079)

BACKENDS and SUBCOMMANDS gain the pair json / gen-json at index 4,
pinned by the_backend_table_is_pinned. A gen/json/<stem>.json copy is
then checked like every other copy: t27c gen-json specs/<stem>.t27 must
reproduce it byte for byte. gen/jsonl/ stays an unknown backend.

The L2 check runs the base's copy of this rule, so #10064 (gen-json,
#10050) needs this entry on master before its committed
gen/json/igla/own_model_board.json can pass.

gen/c/policy/l2_generation.c is t27c gen-c output from the Railway lab
(sha256 5d625a4c...33d1, 42175 bytes); test report 22/22, 0 vacuous.

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

Copy link
Copy Markdown
Owner Author

Status of the PR-specific reds on d5af744:

  • L2 GENERATION (HAND-MADE COPY gen/json/igla/own_model_board.json: a backend directory t27c does not write): the check runs master's copy of l2_generation.c, whose backend table has no json. spec(policy): l2_generation -- gen/json/ is t27c gen-json's backend directory (Closes #10079) #10082 adds json -> gen-json; on the lab, gen-c output is byte-identical and the spec passes 22/22. Once spec(policy): l2_generation -- gen/json/ is t27c gen-json's backend directory (Closes #10079) #10082 is on master, re-run this check. It will then compare the JSON with t27c gen-json specs/igla/own_model_board.t27.
  • fpga-conformance: the elab ratchet reports NEW modules openxc7_dsp_fabric, wasm_board_ax7203 and wasm_interp. All three come from master, and master's own runs of that workflow fail the same way. This PR touches nothing under fpga/.
  • Deletions: docs/reports/data/W564-harness.sh (-26) and tools/jtag/read_user1.py (-20) are the foreign-code offset the owner named. tools/devhome_baseline.txt is modified, not deleted: it only drops the deleted harness's line.

🤖 Generated with Claude Code

This was referenced Oct 17, 2026
gHashTag added a commit that referenced this pull request Oct 17, 2026
…irectory (Closes #10079) (#10082)

* spec(policy): l2_generation -- gen/json/ is t27c gen-json's backend directory (Closes #10079)

BACKENDS and SUBCOMMANDS gain the pair json / gen-json at index 4,
pinned by the_backend_table_is_pinned. A gen/json/<stem>.json copy is
then checked like every other copy: t27c gen-json specs/<stem>.t27 must
reproduce it byte for byte. gen/jsonl/ stays an unknown backend.

The L2 check runs the base's copy of this rule, so #10064 (gen-json,
#10050) needs this entry on master before its committed
gen/json/igla/own_model_board.json can pass.

gen/c/policy/l2_generation.c is t27c gen-c output from the Railway lab
(sha256 5d625a4c...33d1, 42175 bytes); test report 22/22, 0 vacuous.

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

* seal(policy): reseal l2_generation after the json backend entry (Refs #10079)

spec-guards and coverage reported the seal stale: the spec changed in
the previous commit. Resealed on the Railway lab with
t27c seal specs/policy/l2_generation.t27 --save (zig 0.16.0): 22/22
pass, and the four gen hashes equal the "current" values CI printed
(c 9bde97a5, rust 1381dab7, verilog c8b31e83, zig 1b937eda).

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 18, 2026
gHashTag and others added 2 commits October 18, 2026 11:45
… post time (Refs #10050)

The committed gen/json/igla/own_model_board.json went stale the moment
master's map moved (622 bytes / 42% committed, master now states its own
METRICS_BYTES and percentage), and every REVIEWED flip would move it
again. It was a second home for what own_model_board.t27 already
states, and the L2 rule refused it as a copy in a backend directory it
does not know. The event is produced when it is posted, by
t27c gen-json specs/igla/own_model_board.t27, and is never committed.

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

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-18 04:50:24 UTC

Summary

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

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=0f8c66b9ed0e != 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 c6f745c into master Oct 18, 2026
33 of 39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

owner-approved-foreign Owner-approved exception to the only-t27 rule: hand-written foreign code allowed in this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

t27c: gen-json backend -- print own_model_board.t27 as the IGLA board's JSON event (needs owner-approved-foreign)

1 participant