Job
AI-assisted Universal Translator for the web (canon D6438): peel origin stacks into WebIR/CWL, emit modern targets, grow under Chimera — never one-shot dump trust. Four layers: engine · CWL hub · intelligence (propose only) · Hub ops / evidence. Adoption wedge historically: PHP → TypeScript (Hono / Fastify / Next). The 601/601 matrix is an oracle-product census, not “every stack rewritten.”
Hub architecture
| Piece | Fact |
|---|---|
| Server | scripts/chrysalis-operator-web.mjs — REST + SSE |
| Port | CHRYSALIS_OPERATOR_PORT ‖ 19090 |
| Start | pnpm run hub:serve |
| Data | ~/.chrysalis-hub/projects.json, workspaces under ~/.chrysalis-hub/workspaces/ |
| Parallelism | CHRYSALIS_HUB_MAX_PARALLEL (default 3) |
| Auth | CHRYSALIS_OPERATOR_TOKEN Bearer for writes |
| Public | nginx /hub/ → 127.0.0.1:19090 |
API examples: POST …/sites, POST …/run-batch,
GET …/batch-progress, GET /api/hub/translation-path-matrix,
GET /api/hub/language-readiness.
Laws
| ID | Law | Enforcement |
|---|---|---|
| D6442 | Translate only — no invent features/backends | Canon + holes on lower failure |
| D6447 | No demo-only / force-settle façades | Protocol refuses deep-lift-all-holes as completeness |
| D6448 | Close holes until zero data-cwl-hole or residual ledger | wisp-complete-conversion-protocol.mjs |
| Propose ≠ dispose | LLM proposes; oracle + verify dispose | No LiteRT.js convert path |
Protocol constants: COMPLETE_CONVERSION_KIND = chrysalis.complete-conversion-protocol,
COMPLETE_CONVERSION_GATE = D6448,
forceSettleResidualHoles: false on every evidence round.
Correctness loop
Capture (oracle) → Lift (WebIR) → CWL ↔ emit → Verify (replay)
↑ │
LLM / IS / chat propose │
└────── dispose ─────┘
Peel / emit modules
Dispatcher hub-lift-dispatch.mjs tries specialized peels before generic
lift-to-webir.mjs. AST peels cover PHP, JS/TS, Python, Java, Go, Ruby, Rust,
C#, Kotlin, Scala, Swift, Dart, Elixir, C++, Nest — plus SvelteKit / Next / Nitro.
COBOL: cobol-pattern-lift.mjs / cobol-pattern-emit.mjs.
Emit: emit-*-from-hub.mjs family, emit-cwl-from-hub.mjs,
emit-runtime-cwl-from-hub.mjs, wptp-emit-pipeline.mjs.
Packages: ingest, webir (junction), verify,
oracle + language oracles, emit-hono / emit-fastify,
runtime-chimera, cwl (junction).
Oracle and verify
@chrysalis/oracle: capture legacy behavior into a TraceCorpus
(NDJSON — header, body events, footer; schema version 1.0.0).
Event types include http.request, http.response, sql.query,
plus determinism hooks for time/RNG. Redaction is mandatory before persist.
Oracle does not translate or replay.
@chrysalis/verify: replayCorpus sorts traces, filters by route/traceId/shard,
diffs responses via replay-http. Also SQL replay and UI markup/CSS parity helpers.
| Hub verify lane | When |
|---|---|
legacy-oracle-php | PHP → TS/Hono/Fastify gold |
hub-structural-gold | Literal → Hono/Fastify gold |
hub-trace-replay | In-process @chrysalis/verify |
oracle-python / oracle-node | Live capture on origin hosts |
wptp-contract | OpenAPI / Swagger / HAR |
none | Silver/open — no trace parity claim |
Complete conversion (D6448)
Hole-close until zero data-cwl-hole (vendor islands excepted) or fail incomplete.
Three rounds with no improvement → incomplete.
CLI: pnpm run hub:complete-conversion
(--allow-incomplete · --max-rounds · --stop-after · --no-terminal-settle.
Bind traces with forceSettleResidualHoles: false.
Residual ledger when total !== 0 — reports/wisp/complete-conversion-residuals.json:
{
"kind": "chrysalis.complete-conversion-residuals",
"schemaVersion": 1,
"gate": "D6448",
"total": N,
"buckets": { /* classifyCwlHoleBuckets */ },
"reasons": { /* counts */ },
"topPages": …,
"engineDebt": [ "Close svelteInterp…", "…" ],
"nextActions": [ "Improve packages/ingest…", "Do not use deep-lift-all-holes" ]
}
D6448-ST prove profiles: hub:complete-conversion-prove:plain-php,
:tiny-blog (RFC-0021), plus express/typescript/python/go/csharp/elixir/dart/wisp-ui variants.
COBOL peels
pnpm run pilot:cobol-clbs — inventory + best-fit + residual; no Db2/CICS/VSAM invent.
Residual ledger kind chrysalis.cobol.residual.v1 with priorities P0–P3.
EXTFMAP is the sole open COBOL P0 until licensed drop or
CHRYSALIS_EXTFMAP_ABSENT=1 attestation — never invent.
Tokens: EXTFMAP_RESIDUAL_HONEST_OK; smokes
hub:cobol-best-fit-smoke, hub:cobol-clbs-prove-smoke,
hub:cobol-extfmap-residual-smoke.
See published.html#cobol.
How Convert consumes CWL
| Mechanism | Fact |
|---|---|
packages/cwl | Junction → chrysalis-cwl/packages/cwl |
packages/webir | Junction → chrysalis-cwl/packages/webir |
| Pin | file:../chrysalis-cwl/packages/cwl (tip 1.0.26) or @agenticop-io/cwl |
| Prove | hub:cwl-pin-smoke, hub:cwl-language-pillar-smoke |
| Cutover consume | hub:cwl-helix-cutover-smoke → CWL_HELIX_CUTOVER_OK or honest SKIP |
| Fat stay Convert | cwl-ingest.mjs, cwl-control-lower.mjs (not thin junction) |
Pilot Kit
MCP + Cursor rule + pilot:laravel-min + optional COBOL.
hub:cursor-pilot-kit-smoke → PILOT_KIT_OK.
Explicit: Pilot Kit is GTM — not DNA cutover.
Also: PUBLIC_CLAIM_OK, OSS_SCRUB_OK, CONVERT_GRAVITY_OK.
Owns / does not
| Owns | Does not own |
|---|---|
| Peelers, emitters, Hub SPA, oracle harnesses, Pilot Kit, Chimera shell | CWL RFCs/golds; Helix learn/enforce; smoke:ut-spine |
Anti-patterns: IR-v0 as second DNA; editing CWL grammar under Convert; WISP chrome as north star.
Gates
CONVERT_WHOLE_SYSTEM_OKhub:traffic-decides-bar-smoke→TRAFFIC_DECIDES_CONVERT_OKhub:ut-maintain-packaging-smokePILOT_KIT_OK·CWL_HELIX_CUTOVER_OK/SKIP
CWL · Traffic decides · Helix