test(codegen): #235 — engine-validate #199 closure ABI independent of CPS#279
Merged
Conversation
…t of CPS (Refs #235) Until #225 PR2 the #199 closure ABI ([fnId@0,envPtr@4] via the exported __indirect_function_table) had only ever been *statically* compiled estate-wide — the blind spot the two PR2 defects hid in. The async tests now exercise it but only THROUGH the CPS transform; the existing tests/codegen/test_closure_*.affine have NO `.mjs` host (compile-only). This adds the missing negative-control. tests/codegen/closure_indirect_dispatch.{affine,mjs}: a captured closure (`fn(u:Unit) => base + 35`, base = local 7) passed to a plain `extern fn invokeCallback(cb: fn(Unit)->Int)->Int`; the host dispatches it via __indirect_function_table (wrapHandler, identical to packages/affine-vscode/mod.js). Verified the unit imports ONLY `env.invokeCallback` (no thenableThen ⇒ async transform provably not involved) yet still exports `__indirect_function_table`; asserts table exported + closure fired once + captured local reached via envPtr (7+35=42). Protects the shared #199 path for ALL closure users independent of #205. Gate: full tools/run_codegen_wasm_tests.sh green incl. the new test; dune test --force 290/290. Zero regression. #235 estate-consumer audit (recorded on the issue): the ONLY estate consumer that genuinely warrants its own runtime smoke is rsr-certifier (standards#123 — full #199 closures + #205 path, ships its own wrapHandler clone, zero wasm tests). my-lang (#199-only), idaptik/reposystem (.ts generic vscode, not this ABI), boj-server/ gitbot-fleet (no consumer) are defensibly static-only now this upstream guarantee exists. Refs #235 — deliverable (1) done; the rsr-certifier per-repo smoke (standards repo) is the remaining tracked item, so not Closes.
🔍 Hypatia Security ScanFindings: 47 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": "Action actions/checkout@v4 needs attention",
"type": "unpinned_action",
"file": "publish-jsr.yml",
"action": "pin_sha",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Action denoland/setup-deno@v2 needs attention",
"type": "unpinned_action",
"file": "publish-jsr.yml",
"action": "pin_sha",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"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"
}
]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.
#235 — engine-validate the #199 closure ABI independent of the CPS transform
Until #225 PR2 the #199 closure ABI (
[fnId@0,envPtr@4]via the exported__indirect_function_table) had only ever been statically compiled estate-wide — the blind spot the two PR2 defects hid in. The async tests now exercise it but only through the CPS transform; the existingtests/codegen/test_closure_*.affinehave no.mjshost (compile-only). This adds the missing negative-control.tests/codegen/closure_indirect_dispatch.{affine,mjs}: a captured closure passed to a plainextern fn invokeCallback(cb: fn(Unit)->Int)->Int; host dispatches via__indirect_function_table(wrapHandler, identical topackages/affine-vscode/mod.js). Unit imports onlyenv.invokeCallback(nothenableThen⇒ async transform provably uninvolved) yet still exports__indirect_function_table; asserts table exported + closure fired once + captured local reached viaenvPtr(7+35=42). Protects the shared #199 path for all closure users independent of #205.tools/run_codegen_wasm_tests.shgreen incl. the new test;dune test --force290/290. Zero regression.Estate-consumer audit (deliverable 2 — posted on #235)
Only rsr-certifier (standards#123 — full #199 closures + #205 path, ships its own
wrapHandlerclone, zero wasm tests) genuinely warrants its own runtime smoke. my-lang (#199-only), idaptik/reposystem (.tsgeneric vscode — not this ABI), boj-server/gitbot-fleet (no consumer) are defensibly static-only now this upstream guarantee exists. The rsr-certifier per-repo smoke (standards repo) is the remaining tracked item.Refs #235 — deliverable (1) done; not Closes (rsr-certifier smoke remains).
🤖 Generated with Claude Code