Skip to content

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

Open
hyperpolymath wants to merge 1 commit into
mainfrom
feat/megaport-step8-shared-scaffolds
Open

feat(migration/shared): complete PortNames.affine — first compilable Mode-A file (megaport STEP 8)#110
hyperpolymath wants to merge 1 commit 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

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