Whitepaper · IR · from code

WebIR and the Rosetta path

Package @chrysalis/webir 2.0.2 lives in chrysalis-cwl (packages/webir. Convert junctions it — no second tree. Sourced from ROSETTA-UT-PATH.md, WEBIR-REVERSE-HOME.md, CORE-VS-PEEL.md, HUB-TRANSLATION-PATHS.md, and dna-seed code.

Docs · CWL · Convert · WPTP

Thesis

Frameworks are many writings of the same meaning. The Rosetta rule recovers that meaning without a lossy “regex lift” as the semantic spine. CWL → WebIR via ingest; WebIR → CWL via emit-from-hub tooling. WebIR is the only IR between languages — emit must not bypass it (HUB-TRANSLATION-PATHS.md).

Honesty law: unsupported behavior → hole reason;. Guessing is a forged gene. Silent stubs are cancer.

Package surface

ExportRole
Module / NodeBaseIR graph root and node base
Effect / ModuleBuilderEffects + construction helpers
visit / merge / snapshotTraversal and provenance helpers
./dialects/web-requestHTTP request/response dialect
./dialects/effectEffect dialect
./dialects/dataPage/data dialect

Convert: pnpm run link:webir-from-cwl; prove hub:webir-resolve-smoke, hub:cwl-language-pillar-smoke. Pillar: npm run build:webir / link:webir. Reverse authoring: cwl fmt --webir, cwl emit-check.

Surface stack

Authoring (CWL surfaces)
┌─────────────────────────────────────────┐
│  CWL API    @route  → JSON handlers      │
│  CWL Pages  @page   → HTML / layouts     │
│  CWL Data   load    → page data sidecar  │
│  CWL UI     @component / islands         │
│  CWL Effects use / effects metadata      │
│  Control    if / foreach (RFC-0021)      │
└──────────────────┬──────────────────────┘
                   │ 1:1  (cwl-ingest / emit)
                   ▼
            WebIR (semantic IR)
                   │
       ┌───────────┼───────────┐
       ▼           ▼           ▼
  emit-hono   runtime-cwl   chimera
  emit-fastify              (migration)
                   │
                   ▼
            oracle / verify replay

Ingest / emit / verify lanes

Convert Hub translation paths (WebIR always in the middle):

LaneModules (examples)
Ingestchrysalis-ingest, hub-ast-lift, hub-pattern-lift, hub-file-lift, *-ast-ingest.mjs, framework peels
Emitchrysalis-emit, hub-webir-typescript, hub-native-*, emit-*-from-hub.mjs, emit-cwl-from-hub.mjs
Verifylegacy-oracle-php, hub-structural-gold, hub-trace-replay (@chrysalis/verify), wptp-contract, none

Dispatcher: hub-lift-dispatch.mjs → specialized peels before generic lift-to-webir.mjs. Fat CWL control lowering stays Convert-side (cwl-control-lower.mjs; language grammar stays CWL pillar.

Core vs peel (D6551)

LayerWhat lives here
CoreWebIR types; CWL grammar/AST/parse/print/diagnose; hole contracts; verify dispose semantics; provenance
PeelOrigin dialect peels, Hub smokes/proves, COBOL adapters, emit backends, oracle sidecars, CLI orchestration

Peels map into the genome or leave holes. They do not expand the grammar. Promotion to core only when IR/CWL/hole/verify semantics change — not when a prove script grows.

DNA seed from CWL surface

Implemented in cwl-dna-seed.mjs. Draft document: schema: app-dna-v1, mode: draft, bridge.kind: cwl-surface-seed, identity `${host} ${METHOD} ${path_template}`.

FingerprintComputation
response keysSorted JSON key paths depth ≤ 2; null for non-JSON / SSE
request keysUnion of body + multipart field + file names
query keysSorted query binding names (values ignored)
content_classhtml | json | other from return/surface/stream
status_classesHundreds bucket if status present

Envelope annotations (cwl_effects, cwl_surface, stream/multipart) never become certified DNA route fields. CWL holes ≠ DNA holes[]. Golds: 24-dna-bridge, 34-dna-bridge-surfaces.

Deploy profiles (RFC-0023)

External artifact cwl-deploy-profile-v1: app_id, host, hosts{}, path_shape_equality, content_class_from_cwl. Not embedded in CWL grammar. Static asset globs (/**/*.js) are DNA-only collapse.

Hub grades

PathSignal
cwl → hono / fastify / typescriptGold when harness + corpus hold
cwl → cwlGold (round-trip)
any → cwlSilver (holes preserved)
verify lane noneSilver/open — no trace parity claim

Hub matrix / path knowledge APIs are the source of truth — not marketing greens.

WPTP boundary

WPTP is a public platform orbit: @wptp/ir, OpenAPI/HAR adapters, bronze emitters, compatibility matrix. Hub verify lane wptp-contract can use that orbit. WPTP does not redefine CWL grammar. Prefer platforms/wptp-* over inventing a second DNA in Convert.

Non-goals

  • Do not fork @chrysalis/webir under Convert.
  • Do not bypass WebIR in emit.
  • CWL is not the firewall; WebIR is not a WAF.
  • CWL does not replace databases, queues, or browser runtimes.

CWL · Convert · Helix