Skip to content

feat(stdlib): pub-mark sweep — io/math/option/result/testing (closes #508)#546

Merged
hyperpolymath merged 2 commits into
mainfrom
stdlib/pub-mark-sweep-508
Jun 11, 2026
Merged

feat(stdlib): pub-mark sweep — io/math/option/result/testing (closes #508)#546
hyperpolymath merged 2 commits into
mainfrom
stdlib/pub-mark-sweep-508

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Summary

Completes the pub-visibility sweep for the 5 stdlib modules listed in #508, applying the same rule PR #505 used for string.affine and collections.affine: any fn immediately preceded by a /// doc comment is pub-intent and gets the pub keyword.

Inventory (verified post-change)

Module pub before pub after non-pub remaining
io 0 15 0
math 0 36 0
option 1 36 0
result 0 24 0
testing 0 26 0

136 fns now reachable from consumers (was 1 of 137).

Verification

  • dune build bin/main.exe — clean
  • dune runtest368/368 PASS

Estate impact (idaptik migration corpus, run as oracle audit)

Pre-change: 68/86 PASS, 18 FAIL (4 parse, 14 type).

The 14 type failures all surface as Resolution error: undefined value: \min_float`/`max_float`. These are now correctly classified as **consumer-side import gaps** — the 11 affected idaptik files need use math::{min_float, max_float};. Companion PR on hyperpolymath/idaptik` adds those.

The 4 parse errors are in migration/main/{Boot,Main,StartupError,MultiplayerHandlers}.affine — explicitly tagged "Mode B (design-demo) — NOT v0.1.0-compileable" in their headers, using import X; + effect-row syntax that's RFC-tracked (RFC #45/#59 etc.) but not shipping. Out of scope for this PR.

Refs

…508)

PR #505 closed the pub-visibility gap in stdlib/string.affine and
stdlib/collections.affine. This PR completes the sweep for the
remaining 5 modules listed in #508.

Mechanical rule (per #508 scope):
  Any `fn` immediately preceded by a `///` doc comment (allowing
  intervening contiguous `//` lines / attributes) is pub-intent and
  gets the `pub` keyword.

| Module     | pub before | pub after | now-private |
|------------|-----------:|----------:|------------:|
| io         |  0         |  15       | 0           |
| math       |  0         |  36       | 0           |
| option     |  1         |  36       | 0           |
| result     |  0         |  24       | 0           |
| testing    |  0         |  26       | 0           |

Total: 136 fns now reachable from consumers (was 1 of 137).

Verification
  dune build bin/main.exe — clean
  dune runtest             — 368/368 PASS

Estate impact (verified by running main.exe check against the idaptik
migration/ corpus before and after this change):

  before: 68 / 86 PASS, 18 FAIL (4 parse, 14 type)
  after:  same numerically — the 14 `undefined value: \`min_float\`/\`max_float\``
          failures now flip from "stdlib symbol unreachable" to "caller
          missing \`use math::{min_float, max_float};\`", which is the
          correct consumer-side closure. Companion idaptik PR adds those.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: hyperpolymath <6759885+hyperpolymath@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 91 issues detected

Severity Count
🔴 Critical 2
🟠 High 19
🟡 Medium 70

⚠️ Action Required: Critical security issues found!

View findings
[
  {
    "reason": "Action perpolymath/standards/.github/workflows/governance-reusable.yml@main\n needs attention",
    "type": "unpinned_action",
    "file": "governance.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Action ons/checkout@v6\n    needs attention",
    "type": "unpinned_action",
    "file": "publish-jsr.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Action land/setup-deno@v2\n    needs attention",
    "type": "unpinned_action",
    "file": "publish-jsr.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in affine-vscode-publish.yml",
    "type": "missing_timeout_minutes",
    "file": "affine-vscode-publish.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in casket-pages.yml",
    "type": "missing_timeout_minutes",
    "file": "casket-pages.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in casket-pages.yml",
    "type": "missing_timeout_minutes",
    "file": "casket-pages.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in casket-pages.yml",
    "type": "missing_timeout_minutes",
    "file": "casket-pages.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in ci.yml",
    "type": "missing_timeout_minutes",
    "file": "ci.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in ci.yml",
    "type": "missing_timeout_minutes",
    "file": "ci.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in ci.yml",
    "type": "missing_timeout_minutes",
    "file": "ci.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  }
]

Powered by Hypatia Neurosymbolic CI/CD Intelligence

Last missing primitive surfaced while re-running the idaptik migration
oracle after the pub-mark sweep in this PR. `PlayerHP.affine` uses
`copysign(speed, dx)` as a branchless replacement for the Float-valued
if/else the wasm backend cannot lower.

This is a standard math primitive (mirrors C99 `copysign`, IEEE-754
`copySign`) with the conventional argument order: `copysign(x, y)`
returns `x` with the sign of `y`. Placed alongside the existing
sign/abs/min/max float helpers.

Re-audit against idaptik migration corpus:
  before:  68/86 PASS (this PR's pub-mark sweep alone got it here)
  +use math::{...} on 14 idaptik consumers: 81/86 PASS
  +copysign: 82/86 PASS — last 4 are deliberately-Mode-B parse failures

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: hyperpolymath <6759885+hyperpolymath@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 91 issues detected

Severity Count
🔴 Critical 2
🟠 High 19
🟡 Medium 70

⚠️ Action Required: Critical security issues found!

View findings
[
  {
    "reason": "Action perpolymath/standards/.github/workflows/governance-reusable.yml@main\n needs attention",
    "type": "unpinned_action",
    "file": "governance.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Action ons/checkout@v6\n    needs attention",
    "type": "unpinned_action",
    "file": "publish-jsr.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Action land/setup-deno@v2\n    needs attention",
    "type": "unpinned_action",
    "file": "publish-jsr.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in affine-vscode-publish.yml",
    "type": "missing_timeout_minutes",
    "file": "affine-vscode-publish.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in casket-pages.yml",
    "type": "missing_timeout_minutes",
    "file": "casket-pages.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in casket-pages.yml",
    "type": "missing_timeout_minutes",
    "file": "casket-pages.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in casket-pages.yml",
    "type": "missing_timeout_minutes",
    "file": "casket-pages.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in ci.yml",
    "type": "missing_timeout_minutes",
    "file": "ci.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in ci.yml",
    "type": "missing_timeout_minutes",
    "file": "ci.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in ci.yml",
    "type": "missing_timeout_minutes",
    "file": "ci.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  }
]

Powered by Hypatia Neurosymbolic CI/CD Intelligence

@hyperpolymath hyperpolymath merged commit 73ba5f9 into main Jun 11, 2026
27 checks passed
@hyperpolymath hyperpolymath deleted the stdlib/pub-mark-sweep-508 branch June 11, 2026 07:35
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: pub-mark sweep for io/math/option/result/testing (follow-up to #505)

1 participant