Skip to content

Commit 14ec514

Browse files
feat(migration/modules): port 11 module-config files (megaport STEP 8 — first compilable batch) (#72)
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)
1 parent 1aeed07 commit 14ec514

12 files changed

Lines changed: 785 additions & 0 deletions
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
// SPDX-License-Identifier: AGPL-3.0-or-later
2+
// Copyright (c) 2026 Jonathan D.A. Jewell
3+
//
4+
// CloudGuardModule.affine — capability-driven registration for the
5+
// Cloudflare domain security management panel.
6+
//
7+
// Translation of src/modules/CloudGuardModule.res (93 LoC). Same shape
8+
// as the other module files plus an extra `capabilityDescription`
9+
// helper (CloudGuard tooltips include longer prose).
10+
//
11+
// Refs: standards#279, standards#252.
12+
13+
module CloudGuardModule;
14+
15+
use prelude::{Option, Some, None, contains};
16+
17+
type CloudguardCapability =
18+
| DomainInventory
19+
| SecurityHardening
20+
| DnsManagement
21+
| ComplianceAudit
22+
| OfflineConfig
23+
| BulkOperations
24+
| PagesIntegration
25+
| DnssecManagement
26+
27+
type CloudguardModuleConfig = {
28+
id: String,
29+
name: String,
30+
version: String,
31+
description: String,
32+
apiEndpoint: String,
33+
capabilities: [CloudguardCapability],
34+
icon: Option<String>,
35+
}
36+
37+
const config: CloudguardModuleConfig = #{
38+
id: "cloudguard",
39+
name: "CloudGuard",
40+
version: "0.1.0",
41+
description: "Cloudflare domain security management. Automates SSL/TLS hardening, DNS security records, WAF configuration, DNSSEC, and compliance auditing across all domains.",
42+
apiEndpoint: "https://api.cloudflare.com/client/v4",
43+
capabilities: [
44+
DomainInventory,
45+
SecurityHardening,
46+
DnsManagement,
47+
ComplianceAudit,
48+
OfflineConfig,
49+
BulkOperations,
50+
PagesIntegration,
51+
DnssecManagement,
52+
],
53+
icon: Some("shield"),
54+
};
55+
56+
fn hasCapability(cap: CloudguardCapability) -> Bool {
57+
contains(config.capabilities, cap)
58+
}
59+
60+
fn capabilityLabel(cap: CloudguardCapability) -> String {
61+
match cap {
62+
DomainInventory => "Domain Inventory",
63+
SecurityHardening => "Security Hardening",
64+
DnsManagement => "DNS Management",
65+
ComplianceAudit => "Compliance Audit",
66+
OfflineConfig => "Offline Config",
67+
BulkOperations => "Bulk Operations",
68+
PagesIntegration => "Pages Integration",
69+
DnssecManagement => "DNSSEC Management",
70+
}
71+
}
72+
73+
fn capabilityDescription(cap: CloudguardCapability) -> String {
74+
match cap {
75+
DomainInventory => "List and monitor all Cloudflare zones with plan tier, status, and nameserver info",
76+
SecurityHardening => "Apply SSL Full (Strict), HSTS, min TLS 1.2, security headers, and other hardening defaults",
77+
DnsManagement => "Create, update, and delete DNS records with templates for SPF, DMARC, DKIM, CAA, and TLSRPT",
78+
ComplianceAudit => "Evaluate live Cloudflare settings against Trustfile/Nickel security policy constraints",
79+
OfflineConfig => "Download zone configs as JSON, edit offline, upload with three-way diff and dry-run preview",
80+
BulkOperations => "Apply hardening settings across all selected domains with real-time progress tracking",
81+
PagesIntegration => "Set up Cloudflare Pages projects from GitHub repos with auto-detected SSG framework",
82+
DnssecManagement => "Enable DNSSEC, verify DS records at registrar, monitor key rotation status",
83+
}
84+
}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
// SPDX-License-Identifier: AGPL-3.0-or-later
2+
// Copyright (c) 2026 Jonathan D.A. Jewell
3+
//
4+
// FarmModule.affine — capability registration for the Git-Private-Farm panel.
5+
//
6+
// Translation of src/modules/FarmModule.res (66 LoC). Same capability-
7+
// declaration shape as the other panll module files: sum-type capability,
8+
// config record, hasCapability + capabilityLabel helpers. Pure data +
9+
// pure functions — no FFI / Tea_/ Pixi / Gossamer surface.
10+
//
11+
// Refs: standards#279 (megaport step), standards#252 (campaign umbrella).
12+
13+
module FarmModule;
14+
15+
use prelude::{Option, Some, None, contains};
16+
17+
/// Capabilities that the Farm panel exposes.
18+
type FarmCapability =
19+
| RepoInventory
20+
| EnrollmentDashboard
21+
| HealthDashboard
22+
| GroupAnalysis
23+
| ForgeCoverage
24+
25+
type FarmModuleConfig = {
26+
id: String,
27+
name: String,
28+
version: String,
29+
description: String,
30+
manifestPath: String,
31+
capabilities: [FarmCapability],
32+
icon: Option<String>,
33+
}
34+
35+
const config: FarmModuleConfig = #{
36+
id: "farm",
37+
name: "Git-Private-Farm",
38+
version: "0.1.0",
39+
description: "Repository admin registry and maintenance hub for ~265 repos across 6 forges",
40+
manifestPath: "~/.git-private-farm/farm-manifest.json",
41+
capabilities: [RepoInventory, EnrollmentDashboard, HealthDashboard, GroupAnalysis, ForgeCoverage],
42+
icon: Some("barn"),
43+
};
44+
45+
fn hasCapability(cap: FarmCapability) -> Bool {
46+
contains(config.capabilities, cap)
47+
}
48+
49+
fn capabilityLabel(cap: FarmCapability) -> String {
50+
match cap {
51+
RepoInventory => "Repo Inventory",
52+
EnrollmentDashboard => "Enrollment Dashboard",
53+
HealthDashboard => "Health Dashboard",
54+
GroupAnalysis => "Group Analysis",
55+
ForgeCoverage => "Forge Coverage",
56+
}
57+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
// SPDX-License-Identifier: AGPL-3.0-or-later
2+
// Copyright (c) 2026 Jonathan D.A. Jewell
3+
//
4+
// LanguageForgeModule.affine — capability registration for the
5+
// nextgen-languages panel.
6+
//
7+
// Translation of src/modules/LanguageForgeModule.res (60 LoC). Same shape
8+
// as the other module files.
9+
//
10+
// Refs: standards#279, standards#252.
11+
12+
module LanguageForgeModule;
13+
14+
use prelude::{Option, Some, None, contains};
15+
16+
type LanguageForgeCapability =
17+
| LanguageDashboard
18+
| CompilationStatus
19+
| MoscowView
20+
| WasmTargetTracker
21+
22+
type LanguageForgeModuleConfig = {
23+
id: String,
24+
name: String,
25+
version: String,
26+
description: String,
27+
capabilities: [LanguageForgeCapability],
28+
icon: Option<String>,
29+
}
30+
31+
const config: LanguageForgeModuleConfig = #{
32+
id: "language-forge",
33+
name: "Language Forge",
34+
version: "0.1.0",
35+
description: "Monitor and develop the 14 nextgen-languages portfolio — scores, phases, WASM readiness",
36+
capabilities: [LanguageDashboard, CompilationStatus, MoscowView, WasmTargetTracker],
37+
icon: Some("hammer"),
38+
};
39+
40+
fn hasCapability(cap: LanguageForgeCapability) -> Bool {
41+
contains(config.capabilities, cap)
42+
}
43+
44+
fn capabilityLabel(cap: LanguageForgeCapability) -> String {
45+
match cap {
46+
LanguageDashboard => "Language Dashboard",
47+
CompilationStatus => "Compilation Status",
48+
MoscowView => "MoSCoW View",
49+
WasmTargetTracker => "WASM Target Tracker",
50+
}
51+
}
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
// SPDX-License-Identifier: AGPL-3.0-or-later
2+
// Copyright (c) 2026 Jonathan D.A. Jewell
3+
//
4+
// MassPanicModule.affine — capability declarations for the
5+
// organisation-scale batch scanning panel.
6+
//
7+
// Translation of src/modules/MassPanicModule.res (66 LoC). Same shape.
8+
//
9+
// Refs: standards#279, standards#252.
10+
11+
module MassPanicModule;
12+
13+
use prelude::{Option, Some, None, contains};
14+
15+
type MassPanicCapability =
16+
| AssemblylineScanning
17+
| IncrementalBlake3
18+
| VerisimDBPersistence
19+
| DeltaReporting
20+
| NotificationPipeline
21+
| RepoDiscovery
22+
| CacheManagement
23+
| SystemImaging
24+
| TemporalNavigation
25+
26+
type MassPanicModuleConfig = {
27+
id: String,
28+
name: String,
29+
version: String,
30+
description: String,
31+
binaryName: String,
32+
capabilities: [MassPanicCapability],
33+
icon: Option<String>,
34+
}
35+
36+
const config: MassPanicModuleConfig = #{
37+
id: "mass-panic",
38+
name: "Mass Panic",
39+
version: "2.1.0",
40+
description: "Organisation-scale batch scanning — assemblyline + BLAKE3 + imaging + temporal + verisim",
41+
binaryName: "panic-attack",
42+
icon: Some("zap-off"),
43+
capabilities: [
44+
AssemblylineScanning,
45+
IncrementalBlake3,
46+
VerisimDBPersistence,
47+
DeltaReporting,
48+
NotificationPipeline,
49+
RepoDiscovery,
50+
CacheManagement,
51+
SystemImaging,
52+
TemporalNavigation,
53+
],
54+
};
55+
56+
fn hasCapability(cap: MassPanicCapability) -> Bool {
57+
contains(config.capabilities, cap)
58+
}
59+
60+
fn capabilityLabel(cap: MassPanicCapability) -> String {
61+
match cap {
62+
AssemblylineScanning => "Assemblyline Scanning (rayon parallelism)",
63+
IncrementalBlake3 => "Incremental BLAKE3 Fingerprinting",
64+
VerisimDBPersistence => "VerisimDB Octad Persistence",
65+
DeltaReporting => "Delta Reporting (diff between runs)",
66+
NotificationPipeline => "Notification Pipeline (markdown + GitHub)",
67+
RepoDiscovery => "Repository Discovery (.git detection)",
68+
CacheManagement => "Fingerprint Cache Management",
69+
SystemImaging => "System Health Imaging (fNIRS-style spatial risk map)",
70+
TemporalNavigation => "Temporal Navigation (time-series diff + trend detection)",
71+
}
72+
}
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
// SPDX-License-Identifier: AGPL-3.0-or-later
2+
// Copyright (c) 2026 Jonathan D.A. Jewell
3+
//
4+
// PanicAttackModule.affine — capability declarations for the stress
5+
// testing and weak point analysis panel.
6+
//
7+
// Translation of src/modules/PanicAttackModule.res (63 LoC). Same shape.
8+
//
9+
// Refs: standards#279, standards#252.
10+
11+
module PanicAttackModule;
12+
13+
use prelude::{Option, Some, None, contains};
14+
15+
type PanicAttackCapability =
16+
| StaticAnalysis
17+
| StressTesting
18+
| BugSignatureDetection
19+
| ReportGeneration
20+
| ReportComparison
21+
| BatchScanning
22+
| SarifExport
23+
| EventChainExport
24+
25+
type PanicAttackModuleConfig = {
26+
id: String,
27+
name: String,
28+
version: String,
29+
description: String,
30+
binaryName: String,
31+
capabilities: [PanicAttackCapability],
32+
icon: Option<String>,
33+
}
34+
35+
const config: PanicAttackModuleConfig = #{
36+
id: "panic-attack",
37+
name: "panic-attack",
38+
version: "2.0.0",
39+
description: "Universal stress testing and logic-based bug signature detection",
40+
binaryName: "panic-attack",
41+
icon: Some("zap"),
42+
capabilities: [
43+
StaticAnalysis,
44+
StressTesting,
45+
BugSignatureDetection,
46+
ReportGeneration,
47+
ReportComparison,
48+
BatchScanning,
49+
SarifExport,
50+
EventChainExport,
51+
],
52+
};
53+
54+
fn hasCapability(cap: PanicAttackCapability) -> Bool {
55+
contains(config.capabilities, cap)
56+
}
57+
58+
fn capabilityLabel(cap: PanicAttackCapability) -> String {
59+
match cap {
60+
StaticAnalysis => "Static Analysis (assail)",
61+
StressTesting => "Stress Testing (attack/assault)",
62+
BugSignatureDetection => "Bug Signature Detection (kanren)",
63+
ReportGeneration => "Report Generation (JSON/YAML/SARIF)",
64+
ReportComparison => "Report Comparison (diff)",
65+
BatchScanning => "Batch Scanning (assemblyline)",
66+
SarifExport => "SARIF Export (GitHub Security)",
67+
EventChainExport => "Event Chain Export (PanLL)",
68+
}
69+
}

0 commit comments

Comments
 (0)