Skip to content

corpus: re-bless the api columns against engine main (gitgalaxy#2729) - #57

Merged
squid-protocol merged 1 commit into
mainfrom
corpus/2729-api-rebless
Sep 5, 2026
Merged

corpus: re-bless the api columns against engine main (gitgalaxy#2729)#57
squid-protocol merged 1 commit into
mainfrom
corpus/2729-api-rebless

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Closes #56.
Corpus half of squid-protocol/gitgalaxy#2729, and the paired re-bless owed by
squid-protocol/gitgalaxy#2743 (rosetta:rebless-owed).

100 manifest cells across 27 languages, re-blessed mechanically from one full-precision scan at
engine main 19262fb0 — no hand-edited numbers.

Two causes, both already merged upstream

1. api_orphan_credit 3 → 0 — gitgalaxy#2731, shipped as #2734

25 languages in a/b/c, plus makefile 4 → 3 in c.mk.

api_orphan_credit is arch_api − raw_arch_api: what galaxyscope's Contextual Baseline Fix adds
on top of the api rule's own count when an imported file has uncalled functions. It used to add
all of them, so a function that is both declared public and uncalled counted twice —
data/go/a.go recorded function_count 3, raw_arch_api 3, raw_state_slop_orphans 3 and
arch_api 6. The fix credits only orphans − api_declared_orphans. In this corpus every probe
is declared public by its own language's idiom (that is exactly what #2729's wave planted) and
uncalled in its own file, so the overlap is total and the credit is correctly 0.

New ledger entry api-declared-orphans-are-not-new-surface. The entry that predicted this —
api-double-count-inflates-scored-api, whose verdict said it "resolves when #2731 credits only the
orphans the rule did not already count" — flips still_reproduces to false, with the verifying
numbers: go/a.go arch_api 3 (was 6), risk_api_exposure 3.022 (was 5.939),
risk_documentation 40.613 (was 79.155).

The cost, recorded rather than worked around: the credit was the gate's only assertion that the
main→a→b→c chain resolved — it is how gitgalaxy#2543 and #2540 were caught. 26 of 46 languages now
assert 0 for it. The chain is still asserted by every language's import count and by the 20
languages whose api rule does not reach every probe.

2. api moves — gitgalaxy#2730, shipped as #2743

language api (main/a/b/c) why
abap 0 → 4/3/3/3 a FORM subroutine is public by default
ada 0 → 4/3/3/3 a column-0 subprogram is a library-level compilation unit
dart 0 → 4/3/3/3 a top-level function without a leading _
matlab 0 → 4/3/3/3 a function file has no visibility syntax at all — column-0 function is its file-level surface
perl 0 → 4/3/3/3 a sub is package-public, and the only perl form that does not also move a planted state_mutation or import
c 6/9/7/7 → 4/5/3/3 the rule was counting body-local declarations and two-word statements as public surface

c is the "too broad" direction: return NULL; alone was 513 of 8675 matches on the
language-crucible corpus. Its manifest note said "api counts every external-linkage (non-static)
file-scope declaration"; that is now true, where before it also counted every indented one.

api-no-plantable-idiom narrows from seven languages to two, with the reason each survivor
stays:

  • objective-c — the rule can now see an @interface method declaration, so the engine half is
    done, but planting an @interface would create a class and SPEC.md rule 2 pins class_start at
    0 as a false-positive tripwire in every language. A corpus constraint, not a rule gap.
  • sqlite — unchanged: every spelling its rule accepts (CREATE [TEMP] VIEW, CREATE VIRTUAL TABLE) is a func_start or class_start hit, so there is still no form that does not move a
    planted count.

One plant change: shell

export PROBE_GLOBALS=1export -f probe_globals, in all four files.

#2730 made the -f form matchable — the old rule demanded a bare identifier straight after
export, so shell could only ever measure exported variables, and the plant's variable name
merely resembled the probe. api is unchanged at 3 per file; the count was never the point. The
cost is that export -f probe_globals names the function, so under gitgalaxy#2727's
name-recurrence census the probe stops reading as an orphan and api_orphan_credit drops 3 → 0 —
shell joins api-export-names-suppress-orphan-credit, which now records why that trade is worth
making here when it was refused for makefile and m4: it is no longer a distinctive cost, since
25 other languages reach the same place in this same PR, and the alternative is measuring the wrong
construct.

Verification

  • verify_language.py46/46 PASS
  • na_check.py --ci — clean, 0 unreviewed absences
  • bias_report.py --gateexit 0, 0 unexplained out-of-band cells

Ledgered cells fall 194 → 184 and derived 116 → 115: fewer cells need excusing because fewer are
out of band. The headline is raw_arch_api, the column #2729 was filed about — abap and ada
rise 0 → 3.25, c falls 7.25 → 3.75, and risk_api_exposure/risk_documentation come into band
with them. The jcl/risk_api_exposure registry mismatch in the report header is byte-identical to
what is already on main: pre-existing, unchanged, already carried by api-contextual-baseline-fix.

Cross-repo

🤖 Generated with Claude Code

https://claude.ai/code/session_01WfeHRWra1d6Z5uSReFajSq

100 manifest cells across 27 languages, re-blessed mechanically from one
full-precision scan at engine main 19262fb0 -- no hand-edited numbers.

Two causes, both upstream fixes that have already merged:

* gitgalaxy#2731 (shipped as #2734) -- api_orphan_credit 3 -> 0 in a/b/c for
  25 languages (makefile 4 -> 3 in c.mk). The Contextual Baseline Fix now
  credits only the orphans the api rule did not already declare, so a probe
  that is both declared public and uncalled stops counting twice. New ledger
  entry api-declared-orphans-are-not-new-surface, and the entry that
  predicted this -- api-double-count-inflates-scored-api -- flips
  still_reproduces to false with the go/a.go numbers that verify it.
* gitgalaxy#2730 (shipped as #2743) -- api 0 -> 3 per file (4 in main) for
  abap, ada, dart, matlab and perl, whose own visibility idiom the api rule
  could not see before it was given a stated contract; and c 6/9/7/7 ->
  4/5/3/3, where the rule had been counting body-local declarations and
  two-word statements (`return NULL;`) as public surface.
  api-no-plantable-idiom narrows from seven languages to objective-c and
  sqlite, with the reason each of those two stays recorded.

shell's plant moves from `export PROBE_GLOBALS=1` to `export -f
probe_globals`. #2730 made the `-f` form matchable, and it is the only way a
shell script publishes a FUNCTION rather than a variable -- the old plant was
green for the wrong reason. api is unchanged at 3 per file; the cost is
api_orphan_credit 3 -> 0, so shell joins
api-export-names-suppress-orphan-credit, which now records why that trade is
worth making here when it was refused for makefile and m4.

Verification: verify_language.py 46/46 PASS, na_check.py --ci clean (0
unreviewed absences), bias_report.py --gate exit 0 with 0 unexplained
out-of-band cells. Ledgered cells fall 194 -> 184 and derived 116 -> 115:
fewer cells need excusing because fewer are out of band. raw_arch_api rises
0 -> 3.25 for abap and ada and falls 7.25 -> 3.75 for c, which is the
language bias gitgalaxy#2729 was filed for, measured gone.

Closes #56.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WfeHRWra1d6Z5uSReFajSq
@squid-protocol
squid-protocol merged commit f14449e into main Sep 5, 2026
1 check passed
squid-protocol added a commit that referenced this pull request Sep 5, 2026
Conflict was in the generated report only: bias-history auto-committed a
regenerated docs/ set on main (2d18562) after #57 merged, while this branch
carried its own regen. Resolved the same way as any generated file -- took
origin/main's docs/, then re-ran bias_report.py so they are recalculated from
the merged ledger rather than stitched together. deviation_ledger.json merged
clean and both narrowed entries survived verbatim.

The regenerated delta against origin/main is exactly the narrowing and nothing
else: ledgered 185 -> 180, derived 115 -> 120, and the two retired entries drop
out of ada / dockerfile / haskell / yaml's findings tables (their explained-by-
ledger counts fall 7->5, 14->12, 12->10, 14->12). Gate still exit 0, 0
unexplained.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WfeHRWra1d6Z5uSReFajSq
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.

corpus owes a re-bless against engine main

1 participant