Skip to content

test(stdlib): STDLIB-04d — hermetic e2e coverage for IO externs (Closes #331)#341

Merged
hyperpolymath merged 2 commits into
mainfrom
claude/stdlib-04d-io-tests
May 24, 2026
Merged

test(stdlib): STDLIB-04d — hermetic e2e coverage for IO externs (Closes #331)#341
hyperpolymath merged 2 commits into
mainfrom
claude/stdlib-04d-io-tests

Conversation

@hyperpolymath
Copy link
Copy Markdown
Owner

Summary

print/println/read_line/read_file/write_file were already wired in interp + Deno codegen, but had no dedicated hermetic tests asserting the round-trip semantics. Test-debt, not impl-debt: a silent regression to any of these would slip through the existing gate (the TEA-bridge tests exercise the redirect path but don't assert extern behaviour as a first-class surface).

Tests

5 new tests in E2E STDLIB-04d IO #331:

Test Asserts
write_fileread_file round-trip byte-for-byte content preserved on a real tmpfile (cleanup via Fun.protect)
read_file on missing path returns Err(_), doesn't raise
print exec no error
println exec no error
Deno codegen prelude defines both print and println

read_line is interactive and intentionally out of scope — the TEA-bridge tests already exercise that surface with full Unix.dup2 stdin redirection.

Test plan

  • 5 new hermetic tests added
  • tmpfile cleanup via Fun.protect — no leftover fixtures on test exit
  • CI: dune runtest green (e2e gate +5)
  • Hypatia DOC-FORMAT: no .md introduced

No implementation change. Updates docs/TECH-DEBT.adoc row 04d → DONE per the audit-split contract.

Closes #331. Refs #175.


Generated by Claude Code

#331)

`print`/`println`/`read_line`/`read_file`/`write_file` were already
wired in interp + Deno codegen, but had no dedicated hermetic tests
asserting the round-trip semantics. Test-debt, not impl-debt: a
silent regression to any of these would slip through the existing gate
(the TEA-bridge tests exercise the redirect path but don't assert
extern behaviour as a first-class surface).

5 new tests in "E2E STDLIB-04d IO #331":

  * write_file -> read_file round-trip on a real tmpfile, asserting the
    string round-trips byte-for-byte (with tmpfile cleanup via
    Fun.protect)
  * read_file on a missing path returns Err(_) (not raise)
  * print exec without error
  * println exec without error
  * Deno codegen wires both print + println into the emitted prelude

`read_line` is interactive and intentionally out of scope here — the
TEA-bridge tests already exercise that surface with full Unix.dup2
stdin redirection.

No implementation change. Updates `docs/TECH-DEBT.adoc` row 04d → DONE
per the audit-split contract.

Closes #331. Refs #175.
@github-actions
Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 143 issues detected

Severity Count
🔴 Critical 13
🟠 High 69
🟡 Medium 61

⚠️ 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 enabled auto-merge (squash) May 24, 2026 04:51
@hyperpolymath hyperpolymath merged commit b0b0a22 into main May 24, 2026
12 of 16 checks passed
@hyperpolymath hyperpolymath deleted the claude/stdlib-04d-io-tests branch May 24, 2026 05:58
@github-actions
Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 135 issues detected

Severity Count
🔴 Critical 13
🟠 High 63
🟡 Medium 59

⚠️ 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

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.

STDLIB-04d: IO externs — dedicated end-to-end test coverage

2 participants