Part 8 — Developer Guide
8.1 Setting up a machine#
- Install Node 22, pnpm, Docker. Clone the repo.
- 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). cd kernel-poc && npm install, thennpm run vault:up(inits and unseals OpenBao).npm run restorerebuilds 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.- 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.
| 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-*.jsdoes 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.
Add a tool#
- Put the handler in the module for its artifact kind under
kernel-poc/src/tools/. - Declare an
inputSchemathat compiles (test-tool-schemas.jscompiles every one). - Keep the handler's own checks for anything it must never store; direct calls are not validated.
- If it only reads, add it to
READ_ONLY_TOOLSby name; otherwise authorization applies. - 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 runtest-store-pg.js. - Both backends (
store.js,store-pg.js) must agree; runtest-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;
lintVendorClassesexists 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; mindnew URL(p, import.meta.url).pathnameon Windows (usefileURLToPath/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:
- Never
git add -A,git add .orgit commit -a; stage explicit paths. - Read
git status --shortfirst; leave other sessions' dirty files alone. - Check
git diff --cached --statbefore each commit; unstage anything you did not edit. - Commit shared files (
http-server.js,kernel-authz.js,tools.js,package.json,CLAUDE.md) promptly and on their own. - End the message with a
Session:trailer, aboveCo-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.