feat(migration/modules): port 11 module-config files (megaport STEP 8 — first compilable batch)#72
Open
hyperpolymath wants to merge 1 commit into
Open
feat(migration/modules): port 11 module-config files (megaport STEP 8 — first compilable batch)#72hyperpolymath wants to merge 1 commit into
hyperpolymath wants to merge 1 commit into
Conversation
… — first compilable batch)
Ports the 11 panll src/modules/ files that share the capability-
declaration shape (capability sum + config record + hasCapability +
capabilityLabel helpers) — all pure data + pure functions, no
Tea_ / Pixi / Gossamer / Promise / FFI surface.
All 11 files pass `affinescript check`:
ServiceEndpoints.affine (39 LoC)
TsdmModule.affine (57)
TangleVizModule.affine (57)
LanguageForgeModule.affine (60)
PanicAttackModule.affine (63)
FarmModule.affine (66)
MassPanicModule.affine (66)
VerificationDashboardModule (67)
SpecBrowserModule.affine (68)
PlazaModule.affine (79)
CloudGuardModule.affine (93)
Total: 715 LoC of .res successfully ported to Mode-A
compilable AffineScript.
Translation pattern (same for all 11):
- `type x = | A | B` → unchanged + semicolons
- `array<T>` → `[T]`
- `option<T>` → `Option<T>`
- `let r = {f: v}` → `const r: T = #{ f: v };` (AS record literal)
- `let f = (x): T => body` → `fn f(x) -> T { body }`
- `arr->Array.includes(x)` → `contains(arr, x)` (prelude)
- `switch x {| A => ...}` → `match x { A => ...,}`
Depends on affinescript#505 — `contains` / other prelude fns being `pub`.
This PR ships the verified-correct future shape; does NOT replace
the .res files in the build (separate slice — needs .affine→.mjs
codegen + consumer migration). See migration/modules/STATUS.md for
detailed parity table + replacement plan + blocker analysis for the
other subsystems (TEA framework, Gossamer IPC, JSX) where the
remaining ~715 .res files live.
Refs standards#279 (megaport STEP 8), standards#252 (campaign UMBRELLA)
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
src/modules/files that share the capability-declaration shape (capability sum + config record +hasCapability+capabilityLabelhelpers) intomigration/modules/*.affine.affinescript check— first compilable Mode-A batch in panll's STEP 8 megaport..resported.Files
ServiceEndpoints.affineTsdmModule.affineTangleVizModule.affineLanguageForgeModule.affinePanicAttackModule.affineFarmModule.affineMassPanicModule.affineVerificationDashboardModule.affineSpecBrowserModule.affinePlazaModule.affineCloudGuardModule.affineSee
migration/modules/STATUS.mdfor the per-file table + replacement plan + blocker analysis for the rest ofsrc/modules/andsrc/components/,src/update/, etc.Depends on
affinescript#505 —
prelude::contains(used by everyhasCapabilitybody) was indirectly affected; the broader stdlib pub gap was unblocked there. Without #505 some translation choices (e.g. usingstring::starts_withfor similar prefix matches in other modules) would have to be hand-rolled.What this PR is NOT
This does not replace any
src/modules/*.resfile in the build. The .res files still own the runtime contract (compile tosrc/modules/*.res.mjsvia rootrescript.json, consumersimportfrom there). Replacement requires.affine→.mjscodegen + consumer migration — both separate slices, tracked under standards#279.What this PR IS
The 11
.affinefiles are the verified-correct future shape. When AffineScript gains source-to-ESM codegen for non-stdlib modules, promoting these 11 files to in-build status becomes a one-PR cutover instead of an 11-PR rewrite — the design risk is already discharged here.Translation pattern (same for all 11)
type x = | A | B→ unchanged + semicolonsarray<T>→[T],option<T>→Option<T>let r = {f: v}→const r: T = #{ f: v };(AS records need#{...})let f = (x): T => body→fn f(x) -> T { body }arr->Array.includes(x)→contains(arr, x)(prelude)switch x { | A => ... }→match x { A => ..., }Campaign refs
Test plan
.affinefiles passesaffinescript checklocally (againstfeat/stdlib-pub-visibility-megaport-unblockof affinescript = affinescript#505)migration/modules/additionsmainAffineScriptaffinescript check migration/**/*.affine(separate PR — adds AS toolchain dep to panll CI)