ONEWEB6.0Docs

Part 8 — Developer Guide

8 min readDocumentation
Audiencedevelopers extending the platform.
Sources this page was written from

CLAUDE.md (invariants, gotchas, commit hygiene), kernel-poc/README.md, workbench/GENERATOR.md, workbench/e2e/, workbench/layout/.

8.1 Setting up a machine#

  1. Install Node 22, pnpm, Docker. Clone the repo.
  2. Bring up the 6.0 stack: docker compose -f platform-dev/docker-compose.6.0.yml up -d (Postgres :5437, Keycloak :8095, OpenBao, Jaeger, RabbitMQ, Kafka, Mailpit, MinIO, SFTP; every port and health check is in the services directory).
  3. cd kernel-poc && npm install, then npm run vault:up (inits and unseals OpenBao).
  4. npm run restore rebuilds all 6.0 state from seed scripts. Anything demonstrated against the generators lives in a seed script; a corpus that exists only in a database is a cache.
  5. Start the Kernel facade (dev launch config uses :4600) and the Workbench: build each designer (pnpm --filter <pkg> build) and serve it; shell on :3000.

When serving designers, one build rule applies:

Putting steps 3 to 5 together:

8.2 Testing strategy#

The platform is tested at three levels: the Kernel and generators, the Workbench, and the generated apps and runtimes.

flowchart TB subgraph kern["Kernel and generators"] direction LR K1["npm test<br/>(suite chain)"] K2["test:dialects<br/>(live SQL engines)"] K3["test:restore"] end subgraph wb["Workbench"] direction LR W1["pnpm -r test<br/>(jsdom)"] W2["test:layout<br/>(real browser)"] W3["test:e2e<br/>(real Kernel)"] W4["test:journey<br/>(empty tenant to Deploy)"] end subgraph rt["Generated apps and runtimes"] direction LR R1["verify-generated-*.js"] R2["verify-camel-parity.js"] end
Test layers and what each runs against
Layer Command What it proves
Kernel suite cd kernel-poc && npm test A hand-maintained && chain of src/test-*.js (about 465 checks)
Suite coverage test-suite-coverage.js (runs first) Every test-*.js is in the chain or in an EXCLUDED map with a reason; fails otherwise
Live dialects npm run test:dialects DDL and migrations executed on Postgres, MySQL, MariaDB, SQL Server, Oracle, DB2; a green npm test proves only engines that were running
Restore npm run test:restore, restore:time State rebuilds from empty
Workbench unit pnpm -r test jsdom component tests; typecheck separately with tsc --noEmit -p packages/<pkg>/tsconfig.json
Real-browser layout pnpm test:layout Widths, overflow, contrast, focus rings (jsdom has no layout)
Real Kernel e2e pnpm test:e2e The Flow designer against a real file-backed facade
UI-only journey pnpm test:journey (about 4 min) Empty tenant to Deploy through visible controls only
Generated apps verify-generated-*.js Auth, login, writes, concurrency against a running app
Runtime parity verify-camel-parity.js Same input to both flow runtimes, compare

Rules the suite enforces:

  • Only a connection error is a skip. A reachable database missing its fixture is a failure.
  • A test that exists must run. Writing src/test-*.js does not add it; add it to the chain.
  • Assert the failure, not only the happy path: the vendor-lint test reintroduces the exact bug.
  • Prefer live round-trips (database, browser) over string matching.
  • CI is unverified (no run has ever been read); a green local run is evidence about this machine only.

Wiring a new test in is a manual step:

8.3 Extending the Kernel#

There are four ways to extend the platform. Each starts in a different place, and the sections below cover them in turn.

flowchart TB KER["Kernel"] T["Add a tool<br/>(kernel-poc/src/tools/)"] AK["Add an artifact kind<br/>(schema, tool module, catalog entry)"] FS["Add a Flow step type or trigger<br/>(shared rule module)"] DS["Add a designer<br/>(workbench/packages)"] T --> KER AK --> KER FS --> KER DS -->|"calls tools of"| KER AK -. "then designer and<br/>generator together" .-> DS FS -. "then gen-flow.js and<br/>gen-camel.js" .-> KER
Kernel extension points

Add a tool#

  1. Put the handler in the module for its artifact kind under kernel-poc/src/tools/.
  2. Declare an inputSchema that compiles (test-tool-schemas.js compiles every one).
  3. Keep the handler's own checks for anything it must never store; direct calls are not validated.
  4. If it only reads, add it to READ_ONLY_TOOLS by name; otherwise authorization applies.
  5. If it writes a new event type, extend the database CHECK constraint in a new migration in kernel-poc/sql/ (each migration redefines the constraint wholesale; last one wins) and run test-store-pg.js.
  6. Both backends (store.js, store-pg.js) must agree; run test-upsert-parity.js.

For example, after adding a tool that writes:

Add an artifact kind#

Schema in kernel-schemas/, tool module with *_create, an entry in sdk/src/new-artifact.ts (the one catalog; a test fails on any *_create nobody offers), references declared where the graph should see them (refSites), then designer and generator together.

Add a Flow step type or trigger#

Rules first, in one shared module read by the tools and both compilers (the pattern of flow-rest.js, flow-file.js, flow-soap.js, flow-trigger.js). Then gen-flow.js (implement or refuse by name) and gen-camel.js. Prove parity by execution, not by diffing output. Add a case to e2e/create-every-kind.test.tsx.

8.4 Adding a designer#

Create workbench/packages/designer-<name> on the SDK kit (sdk/src/ui/): <Icon name> from the closed union and wbk-table* classes (a test fails on your own SVG or table). Implement reload() (required by designer-contract.test.ts), selection attributes (data-sel-id/-label/-kind), the save rule (one Save bar for typed text or 2+ related fields; instant for a single choice), and register it in the shell. Fetches outside KernelClient must send credentials: "include". Add scenes to layout/scenes.tsx for new kit components. Rebuild every designer after an SDK change. Never load CSS from a remote except its own file; apps/shell/src/styles.css is the only token loader.

Before committing a package:

8.5 Writing a generator safely#

  • Every SQL identifier through q() / quoteIdent; every value a bind parameter. Claims especially.
  • One parser per language; allowed expression roots come from PAGE_EXPR_ROOTS.
  • Never invent a vendor class; lintVendorClasses exists for that. The importer reads markup back through the same design-system contracts.
  • Fail closed, refuse rather than guess; do not emit a blocked migration even with --allow-destructive.
  • Emit "DO NOT EDIT — regenerate" and say what is not generated.
  • Write files temp + rename; refuse under a live next dev; mind new URL(p, import.meta.url).pathname on Windows (use fileURLToPath/path.resolve).
  • Move the generator and the designer together; the parity tests catch disagreement, nothing catches both being wrong.

8.6 Multi-session commit hygiene#

More than one session may work in the one tree on one branch. Git stages from the filesystem, so:

  1. Never git add -A, git add . or git commit -a; stage explicit paths.
  2. Read git status --short first; leave other sessions' dirty files alone.
  3. Check git diff --cached --stat before each commit; unstage anything you did not edit.
  4. Commit shared files (http-server.js, kernel-authz.js, tools.js, package.json, CLAUDE.md) promptly and on their own.
  5. End the message with a Session: trailer, above Co-Authored-By:.

A correct message ends like this:

8.7 CI#

.github/workflows/kernel-poc.yml runs on every push and pull request: a restore from empty and an npm test with a no-skip guard, with Keycloak and OpenBao started. It is unverified: it has not been read, a Linux simulation still showed failing restore steps, and devsecops.yml installs scanners unpinned. State that plainly; never call CI green or red.

8.8 Debugging gotchas (short list)#

Symptom Cause
Edited designer shows no change pnpm serve serves prebuilt dist/
reading 'push' in react-dom Loaded via rsbuild dev
Seed re-run changed nothing, or refused Upsert guard; adopt overlay
jsonb compare never matches Key order; compare with canonical()
gen_random_uuid() stops resolving SET search_path dropped public
Docker path rewritten under Git Bash MSYS_NO_PATHCONV=1; host side pwd -W
Multi-line edits via node -e corrupt files Backticks and ${} are eaten; use Edit/Write
Hub route fails at startup with ! Camel Simple has no unary not; invert the branches
A 5-step retry on one failure HttpClient retries a 503 once itself; count requests

Full list with measurements: CLAUDE.md.