Skip to content

test: inline-extern shape coverage (Refs #346) - #353

Merged
hyperpolymath merged 1 commit into
mainfrom
claude/inline-extern-fixtures
May 24, 2026
Merged

test: inline-extern shape coverage (Refs #346)#353
hyperpolymath merged 1 commit into
mainfrom
claude/inline-extern-fixtures

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Summary

Adds class-level coverage for the "inline extern fed to every downstream consumer" surface that produced the PR #346 FnExtern interp bug (Interp.eval_decl's TopFn arm missing the FnExtern match arm — silent pattern-match failure since the interpreter was written; fired the moment STDLIB-04a's tests became the first to hand an inline extern fn to Interp.eval_program).

Queued as a comment on PR #346 in the previous session; this is the follow-up.

What this PR adds

Four fixtures under test/e2e/fixtures/:

Fixture Shape
inline_extern_pure.affine extern fn host_pure_identity(x: Int) -> Int; (no effects)
inline_extern_effectful.affine extern fn host_log(msg: String) -> Unit / IO; (effect row)
inline_extern_polymorphic.affine extern fn host_identity[T](x: T) -> T; (type params)
inline_extern_type_consumed.affine extern type Handle; extern fn host_use(h: Handle) -> Int;

Each fed through parse → resolve → typecheck → interp via the new inline_extern_pipeline_ok helper in test/test_e2e.ml. Assertion: all four phases return Ok. A regression that re-introduces the silent pattern-match-failure path that broke main between #334 and #346 would fail loudly here instead.

Suite registered as "E2E Inline Extern Shapes (Refs #346)".

Why this matters

Per the .claude/CLAUDE.md §"Test-fixture hygiene for latent bug surfaces" rule landed this session: when adding a stdlib extern fn (or any other new declaration shape), test it against every downstream consumer (parse / resolve / typecheck / interp / codegen). PR #346 fixed one instance of this class; this PR pins the class against the gate so the next latent gap of the same shape (an extern type consumed by an extern fn in a module that other modules import, etc.) surfaces against CI rather than against the next agent.

Test plan

  • CI build job clean
  • CI dune runtest — four new alcotest cases pass; existing suite unchanged
  • No new lints

Refs #346, Refs .claude/CLAUDE.md §"Test-fixture hygiene for latent bug surfaces"


Generated by Claude Code

Adds class-level coverage for the "inline extern fed to every
downstream consumer" surface that produced the PR #346 FnExtern
interp bug (Interp.eval_decl's TopFn arm missing the FnExtern
match arm — silent pattern-match failure since the interpreter
was written; fired the moment STDLIB-04a's tests became the first
to hand an inline `extern fn` to Interp.eval_program).

Four fixtures under test/e2e/fixtures/:

  inline_extern_pure.affine          — no effects
  inline_extern_effectful.affine     — return type carries effect row
  inline_extern_polymorphic.affine   — `extern fn host_identity[T]`
  inline_extern_type_consumed.affine — `extern type` + consuming fn

Each fed through parse → resolve → typecheck → interp via the new
`inline_extern_pipeline_ok` helper in test/test_e2e.ml; assertion
is that all four phases return Ok. A regression that re-introduces
the silent pattern-match-failure path that broke main between #334
and #346 would fail loudly here.

Suite registered as "E2E Inline Extern Shapes (Refs #346)".

Queued as a comment on PR #346 in the previous session; this is
the follow-up. Per the CLAUDE.md "Test-fixture hygiene for latent
bug surfaces" rule landed this session, this treats "first user of
an existing-but-untested declaration shape" as a class-level
surface, not a single test case.

Not yet locally verified — no OCaml toolchain in remote execution
env. CI is the verification surface; the fixtures use only
already-parseable surface syntax (effects/extern/type-params), so
risk is low.

Refs #346, Refs CLAUDE.md §"Test-fixture hygiene"
@github-actions

Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 124 issues detected

Severity Count
🔴 Critical 15
🟠 High 60
🟡 Medium 49

⚠️ Action Required: Critical security issues found!

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@v6 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

@hyperpolymath
hyperpolymath merged commit a22a74c into main May 24, 2026
16 of 20 checks passed
@hyperpolymath
hyperpolymath deleted the claude/inline-extern-fixtures branch May 24, 2026 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants