Repository navigation
Description
Claim it in this issue first. Size: M. Depends on: nothing. Claimed by: nobody. Language: C++ (the work is in shared ingest code; one language per commit).
The problem, in user terms
Every language that is added to ripwire pushes a few more Lang:: branches into one shared function, so each new language edit touches code that every other language's answers depend on, and review has to re-check them all. captureTagsFacts (src/ingest_sidecap.h, about 815 lines, from void captureTagsFacts( to its closing brace) holds about 35 lines naming a Lang:: at c20f4d9b, Elixir the most (16 mentions), then Ruby, C++ and Clojure (4 each). Check the count on your checkout:
sed -n '/void captureTagsFacts(/,/^}/p' src/ingest_sidecap.h | grep -c 'Lang::[A-Z]'
Files to touch
src/ingest_sidecap.h:captureTagsFacts. The decisions to move are per-capture: keep or drop the capture, whichSymKindit gets, parameter count,arityExact, and the Ruby arms (bare-call capture, receiver written path, Rake/Jbuilder top-level self).- a new
src/ingest_<lang>.hper language that has a body to hold (Elixir's lives besidesrc/ingest_elixir.h), each hook with a one-sentence reason above it (CONTRIBUTING, "Hooks"). An empty slot means the shared path. - the table itself: one
constexprhook table indexed byLang, beside the other per-Langtables (src/langfacts.hholds facts; this is hooks, so keep it out of that table). A value that is only data (a boolean, an enum) goes intolangfacts.has a column instead, per the "To decide where a change goes" rules in CONTRIBUTING. test/langidentity/ratchet.tsv: the ceiling falls with each removed predicate and may never rise; lower it in the same commit.
Red-first fixture and gate arm
This is a refactor, so the first artifact is the byte-identity harness, not a failing test: build main, then run bash test/langidentitycheck.sh BASE HEAD --langs=<the language you moved> --repo=<lang>:<your clone> after each commit. An empty diff is the pass. The red-first piece is a ratchet arm: the Lang:: line count in the function is asserted in a gate (a count that must fall), so a commit that adds a branch back goes red.
- Per-language gates that read the moved decisions:
test/elixircheck.sh,test/elixirnamearitycheck.sh,test/elixirsemanticcheck.sh,test/clojurecheck.sh,test/rubybarecallcheck.sh,test/rubyrakejbuildercheck.sh,test/rubyrecvcheck.sh,test/kotlincheck.sh,test/jslangcheck.sh,test/langcheck.sh.
Acceptance
- Every language's output byte-identical (the langidentity run for the moved language, plus a before/after map and
ripwire src --clonesdiff). - One language per commit; Elixir first (it has the most).
Lang::lines insidecaptureTagsFactsfall to zero by the end; no newLang::comparison in a shared file.ripwire . --quality-delta=origin/main..HEADgates 0; CONTRIBUTING "Definition of done for a common-code slice".
Not in scope
Moving captures into tags.scm (slices 4b and 5a are separate); the per-Lang fact tables (slice 6c); the base-clause readers.
Order with other work: src/ingest_sidecap.h is also touched by the open tags-predicate PR (#426, @conka8); rebase onto main before you start and again before review.
Activity