Skip to content

Declare the imports 77 files already use (transitive-closure bindings made explicit; zero binding change) - #12782

Merged
gunbai-bot[bot] merged 3 commits into
mainfrom
quiet-hawk-702/declared-imports
Sep 30, 2026
Merged

gunbai-bot[bot] merged 3 commits into
mainfrom
quiet-hawk-702/declared-imports

Conversation

@gunbai-bot

@gunbai-bot gunbai-bot Bot commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

The first of the two PRs quiet-gull-780 ruled for the transitive-pick defect (gunbc.recurring_failure_mode an_import_turns_an_ambiguous_bare_name_into_a_transitive_pick, bold-bat-516). It lands before the declared-scope resolver change, so that change shrinks to readers, leak removal and the old joins.

What it does

It adds, to 77 files, the explicit import for a name each file uses but never imported. Those names reached the file only because an imported module itself imports the declaring module. Each added import names the one declaration the transitive pick already bound: the declarer inside the file's own import closure. Where the file already imported the module, the names were merged into its brace list.

Receipt: zero binding change

Whole corpus: gunbc compile --source-root dag --source-root src/v2 --target dag --repository gunbc --measured-root-demands tools/whole_corpus_compile_measured_root_demands.json, with main's seed, on this tree against its own base (df9cda7). Diagnostics were compared by file and message, positions stripped, because added lines shift them.

  • New diagnostics: 0, blocking or advisory.
  • Removed: 39 unlisted import use and 2 unlisted variant value use advisories, exactly the warnings a declared import silences.

Where it came from

The census compared main's seed with a seed carrying only the declared-scope change. The declared-scope seed produced 722 new blocking diagnostics. This PR discharges the import-gap part. What remains goes to the transition or to separate lists:

  • List-1 readers, not import gaps (about 312): variant Cons/Empty not found in type List persists even with std.algebra { Cons, Empty } imported. The checker re-resolves the alias's variants in the consumer scope, the same class as operand_declaration_of_type on SourceSpan.start: Int. The transition moves those readers to Node.declaration.
  • Defects list, two distinct declarations both reachable, so the transitive pick chose one silently:
    • dag/gunbc/instruments/self_host_logic_behavioral_transport.dag BuildFailed: v2.compiler.self_host.promotion_admission versus v2.std.verdict. Not papered over here.
  • Not import gaps, left for individual reading (no corpus declaration of the name reachable):
    • split, fold, map, sort_by in dag/extdeps/tools/sha256sum, dag/gunbc/devboot/{build,produce}, dag/gunbc/host/host_hygiene_{liveness,reaper}_observe, dag/gunbc/product/fabric/contention, dag/gunbc/superseded_run_starvation_census, src/v2/compiler/04_infer, src/v2/std/compilers/body_lowering;
    • variants RulesetListed/RulesetUnreadable, MtJadeRev1_0, GoogleCloudInteractiveAuthenticationRequired, DeriveGrammarRelationTokensProgress.

🤖 Generated with Claude Code

gunbc-ci-auto-heal and others added 3 commits September 30, 2026 13:14
… transitive import closure)

Adds the explicit import each file needs for a name it uses but never imported, and which reached
it only because an imported module itself imports the declaring module. Each added import names the
ONE declaration the transitive pick already bound: the declarer inside the file's import closure.

Receipt, whole corpus (gunbc compile --source-root dag --source-root src/v2 --target dag, main's seed,
this tree versus its own base): 0 new diagnostics, blocking or advisory. The only removals are 39
'unlisted import use' and 2 'unlisted variant value use' advisories, the ones a declared import should
silence. So no binding changes.

This lands before the declared-scope resolver change (the bare-name candidate set becomes the
module's own names plus its explicit imports, never the transitive closure), shrinking that PR to
readers, leak removal and the old joins.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…iders (ends_with, LiveTreeDisposition)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…rtsFixed (the file now imports v2.std.live_tree)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@gunbai-bot
gunbai-bot Bot added this pull request to the merge queue Sep 30, 2026
Merged via the queue into main with commit c259719 Sep 30, 2026
4 checks passed
@gunbai-bot
gunbai-bot Bot deleted the quiet-hawk-702/declared-imports branch September 30, 2026 17:22
gunbai-bot Bot pushed a commit that referenced this pull request Sep 30, 2026
…12782's Cons/Empty and S3's slot-scan names)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.

0 participants