Skip to content

import contract (#2875): state the rule contract, edit 15 rules on its corollaries, re-bless - #2876

Merged
squid-protocol merged 2 commits into
mainfrom
fix/2875-import-contract
Sep 8, 2026
Merged

squid-protocol merged 2 commits into
mainfrom
fix/2875-import-contract

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Roadmap Phase 3 (#2812), the import family (#2875). Sheet row draft → stated (11/68).

Contract: one hit is a statement or directive that binds an external unit — a module, package, header, library, file, stage or base image — into the current unit, in the language's own dependency form. Six corollaries in docs/import_rule_contract.md: C1 re-exports and loader calls count; C2 the unit is the statement, not the edge (the graph's edges are _dependency_capture's); C3 a binding, not a reference or the file's own header; C4 a named unit (FROM scratch, numeric BANK bind nothing); C5 statement/command position; C6 one owner with the stated duals kept (dockerfile FROM/class_start, html link/io, sqlite .read/.import per #2841).

The two cells: dockerfile 4 → 3 (FROM scratch excluded from count and capture; c.dockerfile re-blesses 1 → 0). embedded_python stays 7: the language's detector is an import of a hardware module, so every file carries one — inherency, ledgered corpus-side (its own intended-morphology entry replaces batch4's cross-product claim).

15 rules edited (crucible before → after): apex 22 → 0 (reference arm retired; Type.forName( only), scala 16 → 275 (one statement per line — the old class spanned eight import lines as one match), shell 103 → 41 (command position), livecode 83 → 33 (own module headers out, LCB use in), fortran 309 → 269, agc_assembly 104 → 50, abap 7 → 6, m4 2 → 0, dockerfile 113 → 103, csharp 95 → 96 (alias directive), go (aliased single-line form), makefile (tab-initial recipe, the #844 fix applied here at last), python 1541 → 1540 + embedded_python (statement position + loader calls, twin parity), javascript/typescript (bounded lazy scan — the detonation found the unbounded one quadratic; no crucible change).

Bless scope (bless_scope.py): 294 diffs, 0 topological, all import-family — per-file import counts, extracted-dependency lists, and the network keys that re-solve from them (shell's old capture turned comment prose into edges named path; livecode's 11 module *.tests headers resolved by stem to tokio's tests.rs). Newly parsed/excluded: none.

Verification: tests/extraction/languages green; test_import_contract_2875.py (33 languages); signal_contract_audit --ci (baseline 59 → 58); audit_check.py all clear; rosetta_audit.py 46/46 against the corpus branch.

Cross-repo: engine first; corpus PR squid-protocol/keyword-rosetta (rebless/gitgalaxy-2875-import) follows. Label rosetta:rebless-owed.

Closes #2875

🤖 Generated with Claude Code

…s corollaries, re-bless

One hit is a statement or directive that binds an external unit -- a
module, package, header, library, file, stage or base image -- into the
current unit, in the language's own dependency form
(docs/import_rule_contract.md; sheet row draft -> stated, 11/68).

The two open-defect cells were two different things. dockerfile 4 vs 3
was c.dockerfile's `FROM scratch` -- the reserved empty base binds
nothing (C4; class_start still opens the stage, #2856's dual); rule and
capture exclude it, c re-blesses 1 -> 0. embedded_python 7 vs 3 is the
classifier's own floor: the language's detection regex IS an import of a
hardware module, so every file carries one by construction -- inherency,
ledgered corpus-side, no rule can move it.

The crucible measured nine more rules disagreeing with the sentence, fixed
in the same layer: apex counted every `receiver.Member` reference (22 -> 0;
`Type.forName(` is its one load form -- the #2671 guard retired, not
scoped), scala's class swallowed newlines so eight import lines read as ONE
match (16 -> 275), shell's `.` fired on any path argument (`find . -name`,
103 -> 41), livecode counted its own `module`/`end module` headers and not
the LCB `use` import (83 -> 33), fortran counted `use` inside string prose
and host-association IMPORT (309 -> 269), abap/m4 anchored (template-string
`include`, `include/Makefile` as a path), agc_assembly counts a symbolic
BANK/SETLOC operand only (bare/numeric are location directives; EBANK= is
args' token: 104 -> 50), makefile's tab-initial `include` is a recipe (the
#844 fix, applied to this rule at last). Widened to the forms the contract
names: csharp's alias directive (95 -> 96), go's aliased single-line
import, python/embedded_python loader calls (statement-position twin
parity; 1 crucible hit -- Prism strips the docstring doctests upstream).
javascript/typescript's lazy `[^;]*?\bfrom` scan is bounded (quadratic on a
from-less payload, found by the contract module's detonation; no crucible
change).

Bless scope: 294 diffs, 0 topological, all import-family -- the per-file
import count, the extracted-dependency lists, and the dependency-network
keys that re-solve from them (shell's old capture turned comment prose
into edges named `path`; livecode's 11 `module *.tests` headers resolved
by stem to tokio's tests.rs, which loses 11 phantom dependents). Newly
parsed/excluded: none.

Tests: one cross-language module (test_import_contract_2875.py: 33
languages, COUNTS for one-statement-one-hit, the FROM/link duals, the
capture/count agreement on named units, ReDoS over 19 payloads); the
apex #2671 regression test, agc's numeric capture cases, livecode's
`module` capture, scala's comment-collision sweep and shell's two
"known limitation" pins rewritten to the contract. signal_contract_audit
baseline 59 -> 58; audit_check clear.

Corpus: keyword-rosetta rebless/gitgalaxy-2875-import (manifest, ledger,
report regenerated: open-defect share 19 -> 17 of 2639, import 0 of 45).

Closes #2875

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@squid-protocol squid-protocol added metrics Heuristics, risk exposures, and topological math updates core-engine Modifications to the central physics and parsing engine rosetta:rebless-owed Intentionally moves keyword-rosetta counts; audit warns, corpus re-blesses after merge labels Sep 8, 2026
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

…ass over the diff list had rewritten it as a Python literal)

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@squid-protocol
squid-protocol merged commit ad237ad into main Sep 8, 2026
32 checks passed
@squid-protocol
squid-protocol deleted the fix/2875-import-contract branch September 8, 2026 05:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core-engine Modifications to the central physics and parsing engine metrics Heuristics, risk exposures, and topological math updates rosetta:rebless-owed Intentionally moves keyword-rosetta counts; audit warns, corpus re-blesses after merge

Projects

None yet

1 participant