Skip to content

feat(stdlib): STDLIB-04e — wire string_to_int alias + lock pure-extern semantics (Closes #332) - #338

Merged
hyperpolymath merged 2 commits into
mainfrom
claude/stdlib-04e-pure-done
May 24, 2026
Merged

feat(stdlib): STDLIB-04e — wire string_to_int alias + lock pure-extern semantics (Closes #332)#338
hyperpolymath merged 2 commits into
mainfrom
claude/stdlib-04e-pure-done

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Summary

Originally scoped as bookkeeping ("real + tested, close-as-done"), but re-auditing caught the same trap STDLIB-04c removed: string_to_int declared in stdlib/effects.affine:33 was unwired dead surface — no entry in interp.ml, codegen_deno.ml, resolve.ml seed, or typecheck.ml binding. Any caller of use effects::{string_to_int} would compile and fail at run.

Fix

Wire string_to_int as the typed-alias of parse_int (canonical name) — same String -> Option<Int> signature, same OCaml impl, same __as_parseInt host shim. Touches all four registration points so the alias is first-class.

Tests

4 hermetic tests in E2E STDLIB-04e Pure #332 locking the round-trip semantics for all three pure externs:

Test Assertion
int_to_string(42) == "42"
string_to_int("123") == Some(123)
string_to_int("abc") == None
string_length("hello") == 5

Test plan

  • 4 new hermetic tests added
  • CI: dune runtest green (stdlib AOT gate untouched; e2e gate +4)
  • Hypatia DOC-FORMAT: no .md introduced

Updates docs/TECH-DEBT.adoc row 04e → DONE (notes the dead-surface discovery for posterity).

Closes #332. Refs #175.


Generated by Claude Code

…n semantics (Closes #332)

Originally scoped as bookkeeping ("real + tested; close-as-done"), but
re-auditing caught the same trap STDLIB-04c removed: `string_to_int`
declared in stdlib/effects.affine was unwired dead surface — no entry
in interp, codegen_deno, resolve, or typecheck. Any caller of
`use effects::{string_to_int}` would compile and fail at run.

Fix: wire `string_to_int` as the typed-alias of `parse_int` (canonical
name). Same semantics (`String -> Option<Int>`), same OCaml impl, same
`__as_parseInt` host shim. Adds 4 hermetic tests covering all three
externs' round-trip semantics ("E2E STDLIB-04e Pure #332"):

  * int_to_string(42)  == "42"
  * string_to_int("123") == Some(123)
  * string_to_int("abc") == None
  * string_length("hello") == 5

Updates `docs/TECH-DEBT.adoc` row 04e to DONE per the audit-split
contract (notes the dead-surface discovery for posterity).

Closes #332. 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
Signed-off-by: Jonathan D.A. Jewell <6759885+hyperpolymath@users.noreply.github.com>
@hyperpolymath
hyperpolymath merged commit 1938289 into main May 24, 2026
12 of 16 checks passed
@hyperpolymath
hyperpolymath deleted the claude/stdlib-04e-pure-done branch May 24, 2026 05:09
@github-actions

Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 137 issues detected

Severity Count
🔴 Critical 13
🟠 High 63
🟡 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants