fix(resolve): remove b895374 seed band-aid; recursive cross-module resolution (#138)#193
Merged
Merged
Conversation
…ecursively (#138) The b895374/#122 band-aid seeded Some/None/Ok/Err as flat builtins so files resolved without importing prelude — entrenching the interpreter- era flat namespace (#138, part of #128). Root cause it masked: resolve_and_typecheck_module (the path used when a module is pulled in via `use`) resolved a dependency's decls but never its OWN imports, so an imported module couldn't reach prelude constructors / sibling modules on its own. The global seed hid this. - resolve.ml: drop Some/None/Ok/Err from seed_builtins (keep RuntimeError — genuine interpreter exception variant, no module home). - resolve.ml: make resolve_and_typecheck_module / resolve_imports_with_loader mutually recursive so an imported module resolves its own `use prelude::{...}` / `use string::{...}` through the loader. The stdlib import graph is an acyclic DAG (max depth io->string->prelude). - typecheck.ml: drop the mirrored Some/None/Ok/Err builtin schemes (keep RuntimeError, keep opt/res type-ctor helpers for builtin sigs); remove the stray "If without else returns…" debug eprintf. - string/io/testing.affine: add the proper `use prelude::{...}` imports they were relying on the seed for (ADR-011). - test_e2e: de-couple the nested-generic return-position test from the seed (exercise the type syntax without constructing Ok/None), like its param-position siblings. stdlib 19/19 via the proper module path; 233/233 dune test; zero regression. Refs #128 Refs #138 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 18, 2026
🔍 Hypatia Security ScanFindings: 44 issues detected
View findings[
{
"reason": "Stray AI.a2ml in root -- use 0-AI-MANIFEST.a2ml only",
"type": "banned",
"file": "AI.a2ml",
"action": "delete",
"rule_module": "root_hygiene",
"severity": "high"
},
{
"reason": "Superseded by 0-AI-MANIFEST.a2ml",
"type": "banned",
"file": "AI.djot",
"action": "delete",
"rule_module": "root_hygiene",
"severity": "high"
},
{
"reason": "Issue in quality.yml",
"type": "missing_workflow",
"file": "quality.yml",
"action": "create",
"rule_module": "workflow_audit",
"severity": "high"
},
{
"reason": "Issue in security-policy.yml",
"type": "missing_workflow",
"file": "security-policy.yml",
"action": "create",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Action hyperpolymath/standards/.github/workflows/governance-reusable.yml@main needs attention",
"type": "unpinned_action",
"file": "governance.yml",
"action": "pin_sha",
"rule_module": "workflow_audit",
"severity": "high"
},
{
"reason": "TypeScript file detected -- banned language",
"type": "banned_language_file",
"file": "/home/runner/work/affinescript/affinescript/affinescript-deno-test/example/smoke_driver.ts",
"action": "flag",
"rule_module": "cicd_rules",
"severity": "critical"
},
{
"reason": "TypeScript file detected -- banned language",
"type": "banned_language_file",
"file": "/home/runner/work/affinescript/affinescript/affinescript-deno-test/cli.ts",
"action": "flag",
"rule_module": "cicd_rules",
"severity": "critical"
},
{
"reason": "TypeScript file detected -- banned language",
"type": "banned_language_file",
"file": "/home/runner/work/affinescript/affinescript/affinescript-deno-test/mod.ts",
"action": "flag",
"rule_module": "cicd_rules",
"severity": "critical"
},
{
"reason": "TypeScript file detected -- banned language",
"type": "banned_language_file",
"file": "/home/runner/work/affinescript/affinescript/affinescript-deno-test/lib/compile.ts",
"action": "flag",
"rule_module": "cicd_rules",
"severity": "critical"
},
{
"reason": "TypeScript file detected -- banned language",
"type": "banned_language_file",
"file": "/home/runner/work/affinescript/affinescript/affinescript-deno-test/lib/runner.ts",
"action": "flag",
"rule_module": "cicd_rules",
"severity": "critical"
}
]Powered by Hypatia Neurosymbolic CI/CD Intelligence |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes the #138 cleanup at root cause (part of #128).
The b895374/#122 band-aid seeded
Some/None/Ok/Erras flat builtins so files resolved without importing prelude — entrenching the interpreter-era flat namespace. It was masking the real gap:resolve_and_typecheck_module(used when a module is pulled in viause) resolved a dependency's decls but never its own imports.resolve.ml: drop
Some/None/Ok/Errfromseed_builtins(keepRuntimeError— genuine interpreter exception variant, no module home); makeresolve_and_typecheck_module/resolve_imports_with_loadermutually recursive so an imported module resolves its ownuse prelude::{...}/use string::{...}through the loader (stdlib import graph is an acyclic DAG, max depth io→string→prelude)typecheck.ml: drop the mirrored builtin schemes (keep
RuntimeError+opt/restype-ctor helpers); remove the strayIf without else returns…debugeprintfstring/io/testing.affine: add the proper
use prelude::{...}imports they relied on the seed for (ADR-011)test_e2e: de-couple the nested-generic return-position test from the seed (like its param-position siblings)
stdlib 19/19 via the proper module path
dune test233/233, zero regressionRefs #128
Refs #138