Skip to content

feat(migration/shared): complete PortNames.affine — first compilable Mode-A file (megaport STEP 8)#110

Merged
hyperpolymath merged 3 commits into
mainfrom
feat/megaport-step8-shared-scaffolds
Jun 1, 2026
Merged

feat(migration/shared): complete PortNames.affine — first compilable Mode-A file (megaport STEP 8)#110
hyperpolymath merged 3 commits into
mainfrom
feat/megaport-step8-shared-scaffolds

Conversation

@hyperpolymath
Copy link
Copy Markdown
Owner

Summary

  • Promotes migration/shared/PortNames.affine from Wave-3 pilot (was missing isCoprocessorPort) to first fully-compilable Mode-A file in this directory. affinescript check now passes against migration/shared/PortNames.affine.
  • Adds migration/shared/STATUS.md — parity table for all 10 Wave-3 .affine files (1/10 compile today; the other 9 are Mode-B aspirational design demos blocked on AS features).

How

  • isCoprocessorPort body uses collections::any + string::starts_with — preserves the .res original semantics (the _prefix in the .res was computed-but-unused; Array.some(d => startsWith(port, d)) is the meaningful body).
  • Updates the file header to record the depends-on relationship.

Depends on

affinescript#505string::starts_with + collections::any only became pub in that PR. Before #505 lands, this file fails resolution with `Symbol is not public`. After it lands, affinescript check passes locally and CI's equivalent will.

What this PR is NOT

This does not replace src/shared/PortNames.res in the build. The .res still owns the runtime contract (it compiles to src/shared/PortNames.res.mjs, which 12 test cases + 2 consumer modules import). Replacement requires AS-to-ESM codegen + consumer-port work — both tracked in STATUS.md's "Replacement" section. This PR ships the verified-correct future shape; the swap is a separate slice.

Campaign tracking

Refs:

  • standards#279 — STEP 8 MEGAPORT umbrella (idaptik + panll)
  • standards#252 — full ReScript→AffineScript campaign UMBRELLA
  • migration/main/PILOT.md + LESSONS.md (in-repo context)

Test plan

  • affinescript check migration/shared/PortNames.affine → "Type checking passed" (locally verified against feat/stdlib-pub-visibility-megaport-unblock of affinescript)
  • No source-file changes — only migration/shared/ additions
  • After affinescript#505 merges, re-verify against main AffineScript
  • Future: in-tree CI gate that runs affinescript check migration/shared/*.affine (separate PR — adds AS toolchain dep)

Closes the PortNames Wave 3 follow-up — the .affine now compiles to
"Type checking passed" against AffineScript stdlib (was previously
missing the `isCoprocessorPort` body the .res original carries).

- `isCoprocessorPort` body uses `collections::any` + `string::starts_with`
  for the any-prefix match; matches `.res` original semantics (the .res
  computed an unused `_prefix` via `String.split + Array.get`, then
  ran `Array.some(d => startsWith(port, d))` — the second line is the
  meaningful body, and that's what this port preserves).
- Depends on affinescript#505 (newly-pub stdlib fns) — pre-#505 both
  `any` and `starts_with` were module-private despite their public-API
  doc comments, so the port failed at resolution.

Also adds `migration/shared/STATUS.md` — parity table tracking which
.affine files compile (1/10) vs which remain Mode-B aspirational
design demos waiting on affinescript#228 / #262 (in-tree imports +
qualified paths) and other AS features.

Replacement of `src/shared/PortNames.res` itself is gated on .affine→
.mjs codegen + consumer migration (see STATUS.md "Replacement" section);
this PR ships the verified-correct future shape, not the swap.

Refs standards#279 (STEP 8 — MEGAPORT)
@github-actions
Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 94 issues detected

Severity Count
🔴 Critical 11
🟠 High 24
🟡 Medium 59

⚠️ 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": "Issue in boj-build.yml",
    "type": "missing_timeout_minutes",
    "file": "boj-build.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in cflite-pr.yml",
    "type": "missing_timeout_minutes",
    "file": "cflite-pr.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in codeql.yml",
    "type": "missing_timeout_minutes",
    "file": "codeql.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in containers.yml",
    "type": "missing_timeout_minutes",
    "file": "containers.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in containers.yml",
    "type": "missing_timeout_minutes",
    "file": "containers.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in dco.yml",
    "type": "missing_timeout_minutes",
    "file": "dco.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in dogfood-gate.yml",
    "type": "missing_timeout_minutes",
    "file": "dogfood-gate.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in dogfood-gate.yml",
    "type": "missing_timeout_minutes",
    "file": "dogfood-gate.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in dogfood-gate.yml",
    "type": "missing_timeout_minutes",
    "file": "dogfood-gate.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  }
]

Powered by Hypatia Neurosymbolic CI/CD Intelligence

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 1, 2026

🔍 Hypatia Security Scan

Findings: 131 issues detected

Severity Count
🔴 Critical 11
🟠 High 22
🟡 Medium 98

⚠️ Action Required: Critical security issues found!

View findings
[
  {
    "reason": "Action actions/checkout@v6 needs attention",
    "type": "unpinned_action",
    "file": "build-validation.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Action mlugg/setup-zig@v2 needs attention",
    "type": "unpinned_action",
    "file": "build-validation.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Action actions/checkout@v6 needs attention",
    "type": "unpinned_action",
    "file": "fuzz.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Action mlugg/setup-zig@v2 needs attention",
    "type": "unpinned_action",
    "file": "fuzz.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Action tions/checkout@v6\n  needs attention",
    "type": "unpinned_action",
    "file": "rust-ci.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Action olnay/rust-toolchain@stable\n  needs attention",
    "type": "unpinned_action",
    "file": "rust-ci.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Action tions/checkout@v6\n  needs attention",
    "type": "unpinned_action",
    "file": "rust-ci.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Action olnay/rust-toolchain@stable\n  needs attention",
    "type": "unpinned_action",
    "file": "rust-ci.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Action atinem/rust-cache@v2\n  needs attention",
    "type": "unpinned_action",
    "file": "rust-ci.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Action tions/checkout@v6\n  needs attention",
    "type": "unpinned_action",
    "file": "rust-ci.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "medium"
  }
]

Powered by Hypatia Neurosymbolic CI/CD Intelligence

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 1, 2026

🔍 Hypatia Security Scan

Findings: 117 issues detected

Severity Count
🔴 Critical 11
🟠 High 19
🟡 Medium 87

⚠️ Action Required: Critical security issues found!

View findings
[
  {
    "reason": "Action actions/checkout@v6 needs attention",
    "type": "unpinned_action",
    "file": "build-validation.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Action mlugg/setup-zig@v2 needs attention",
    "type": "unpinned_action",
    "file": "build-validation.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Action actions/checkout@v6 needs attention",
    "type": "unpinned_action",
    "file": "fuzz.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Action mlugg/setup-zig@v2 needs attention",
    "type": "unpinned_action",
    "file": "fuzz.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Action tions/checkout@v6\n  needs attention",
    "type": "unpinned_action",
    "file": "rust-ci.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Action olnay/rust-toolchain@stable\n  needs attention",
    "type": "unpinned_action",
    "file": "rust-ci.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Action tions/checkout@v6\n  needs attention",
    "type": "unpinned_action",
    "file": "rust-ci.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Action olnay/rust-toolchain@stable\n  needs attention",
    "type": "unpinned_action",
    "file": "rust-ci.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Action atinem/rust-cache@v2\n  needs attention",
    "type": "unpinned_action",
    "file": "rust-ci.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Action tions/checkout@v6\n  needs attention",
    "type": "unpinned_action",
    "file": "rust-ci.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "medium"
  }
]

Powered by Hypatia Neurosymbolic CI/CD Intelligence

@hyperpolymath hyperpolymath disabled auto-merge June 1, 2026 04:27
@hyperpolymath hyperpolymath merged commit 0e1f3b9 into main Jun 1, 2026
23 of 28 checks passed
@hyperpolymath hyperpolymath deleted the feat/megaport-step8-shared-scaffolds branch June 1, 2026 04:27
hyperpolymath added a commit that referenced this pull request Jun 1, 2026
…follow-up to #110) (#111)

## Summary

- Ports `src/app/proven/ProvenError.res` (32 LoC) to Mode-A AffineScript
at `migration/app/proven/ProvenError.affine`.
- Self-contained: pure record type + 5 constructor helpers + `toString`.
No FFI, no cross-module deps, no Tea_/Pixi/Gossamer surface.
- `affinescript check` passes.

## Adjacent to #110

This is a small single-file follow-up to PR #110
(migration/shared/PortNames.affine). Same megaport STEP 8 context,
different subdirectory (`migration/app/proven/` vs `migration/shared/`),
and self-contained so it can land independently.

## Translation choices

- record-field punning `{operation}` → explicit `#{operation:
operation}` (AS records require it)
- labelled args `(~name: T)` → positional `(name: T)` (AS has no labels)
- template literal `` `[${a}] ${b}` `` → `"[" ++ a ++ "] " ++ b` (no JS
templates)

## What this PR is NOT

Does **not** replace `src/app/proven/ProvenError.res`. Consumers
(SafeFloat, SafeJson, SafeAngle) still reference the .res. Those ports
need cross-module `use` resolution (affinescript#228 family) before they
can swap to the .affine.

## Refs

- standards#279 — STEP 8 megaport
- standards#252 — campaign UMBRELLA
- idaptik#110 — sibling PR (PortNames.affine +
migration/shared/STATUS.md)

## Test plan

- [x] `affinescript check migration/app/proven/ProvenError.affine` →
"Type checking passed"
- [x] No source-file changes — only `migration/app/proven/` addition
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.

1 participant