Skip to content

ci(dupe): ts_emit.t27 and verilog_emit.t27 share 18 helper bodies; move them into one t27b module #10058

Closed as not planned

Description

@gHashTag

Problem

The Duplicate Body Ratchet (python3 tools/dupe_scan.py, CI check duplicate-bodies) has been red on master since d03afb0 (#10047). It was green at 60d332d.

#10047 added specs/tri/t27b/ts_emit.t27, and 18 of its function bodies repeat bodies in specs/tri/t27b/verilog_emit.t27:

child_holding, dec_len, holds, in_scope, line_near, param_index, param_name_hi, param_name_lo, parent_of, put_bytes, put_dec, put_ind, resolve, sym_at, sym_of, tmeta, tnode, to_front.

Every open PR inherits the red check (seen on #10053).

Repair

Not a bless. t27c splices used modules selectively (bootstrap/src/use_resolve.rs: only referenced names, each module once per import closure), and both emitters already reach cli/t27b only through t27c gen-rust. So the shared helpers can live in one module that both emitters use:

  • new specs/tri/t27b/emit_core.t27 (module T27bEmitCore, use tri::t27b::verilog_plan;): the refusal room and symbol constants, the 15 byte/name/scope helpers, and the three tree fixtures (tnode, tmeta, holds), with its own tests;
  • ts_emit.t27 and verilog_emit.t27 drop their copies and use tri::t27b::emit_core;;
  • regenerate gen/rust/tri/t27b/{ts_emit,verilog_emit}.rs, reseal the edited specs, seal the new one, and add the ledger row for the new spec.

Done when

  • python3 tools/dupe_scan.py exits 0 with no ledger change;
  • t27b verilog and t27b ts write the same bytes before and after on the same inputs;
  • the specs are sealed (no new seal debt).

Activity

  1. added
    shape-refusedClosed by the issue-shape gate (specs/policy/issue_shape.t27); a passing edit reopens it
    on Oct 17, 2026
  2. github-actions commented on Oct 17, 2026

    @github-actions
    Contributor

    Closed by the issue-shape gate (specs/policy/issue_shape.t27, #7498): an issue must have the template's sections. Edit the body; an edit that passes reopens it.

    • missing: ## Boundary -- list every file this task may touch, one per line (- specs/x.t27); without it the Queen reserves nothing and no bee can take the issue
    • missing: ## User Scenarios -- at least one Given/When/Then scenario
    • missing: ## Requirements -- numbered obligations, FR-001: ... MUST ...
  3. gHashTag commented on Oct 17, 2026

    @gHashTag
    OwnerAuthor

    Fixed on master by #10065 (a18d7ee): the shared helpers now live in specs/tri/t27b/emit_kit.t27, and python3 tools/dupe_scan.py exits 0 on a18d7ee (checked on the Railway lab). A parallel branch with the same repair (emit_core.t27) was dropped unopened so the helpers do not get a second home.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    shape-refusedClosed by the issue-shape gate (specs/policy/issue_shape.t27); a passing edit reopens it

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions