Four-Layer Code Mode Digital Thread Hub and Web Workbench
  • TypeScript 85.6%
  • HTML 12.3%
  • CSS 1.7%
  • JavaScript 0.4%
Find a file
Erwan Lee Pesle 6bd37b7de0
Some checks are pending
Quality / quality (push) Waiting to run
Merge pull request #104 from superWorldSavior/dependabot/github_actions/github-actions-0d991c6fca
chore(deps): bump the github-actions group with 2 updates
2026-12-05 18:57:35 +08:00
.agents/skills fix(hardening): phase 7 wave 2 — security/MRTR, load/concurrency resilience, and docs sync 2026-12-05 16:09:33 +08:00
.github chore(deps): bump the github-actions group with 2 updates 2026-12-05 10:22:39 +00:00
config feat(cloud-run): wire 5 newly harmonized Level-2 MCPs (25/25 Cloud Run fleet) 2026-12-05 18:00:45 +08:00
docs feat(cloud-run): add gcp-oidc fleet binding, Cloud Run manifest, Dockerfile, and Cloud Build OIDC CI 2026-12-05 16:57:29 +08:00
release/sbom chore(consolidation): phase 3b — retire legacy v1 server, compilers, microsandbox, and v1 scripts/tasks 2026-12-05 14:39:02 +08:00
scripts merge: integrate PR #99 (dynamic fleet hot-loading & events) into consolidated/hardened main 2026-12-05 16:47:59 +08:00
src feat(cloud-run): wire 5 newly harmonized Level-2 MCPs (25/25 Cloud Run fleet) 2026-12-05 18:00:45 +08:00
.dockerignore feat(cloud-run): add gcp-oidc fleet binding, Cloud Run manifest, Dockerfile, and Cloud Build OIDC CI 2026-12-05 16:57:29 +08:00
.env.erpnext.example feat: compose the CoffeeMachine digital thread 2026-07-31 18:46:07 +08:00
.gitattributes docs(annex): move dossiers and RFCs to docs/annex with link fixes 2026-09-13 00:40:19 +08:00
.gitignore chore: ignore local .opencode directory 2026-12-05 13:55:59 +08:00
AGENTS.md docs(consolidation): phase 5 — prune legacy v1 docs and skills 2026-12-05 14:50:03 +08:00
CLAUDE.md docs(consolidation): phase 5 — prune legacy v1 docs and skills 2026-12-05 14:50:03 +08:00
CONTRIBUTING.md docs(consolidation): phase 5 — prune legacy v1 docs and skills 2026-12-05 14:50:03 +08:00
deno.json feat(cloud-run): add gcp-oidc fleet binding, Cloud Run manifest, Dockerfile, and Cloud Build OIDC CI 2026-12-05 16:57:29 +08:00
deno.lock refactor(hardening): phase 7 wave 1 — pure hexagonal domain, fail-closed board UI, and workbench Option B 2026-12-05 15:54:07 +08:00
docker-compose.yml chore(consolidation): phase 3b — retire legacy v1 server, compilers, microsandbox, and v1 scripts/tasks 2026-12-05 14:39:02 +08:00
Dockerfile fix(docker): copy workbench-authority-graph.ts into ui-builder stage 2026-12-05 17:06:01 +08:00
LICENSE chore(license): adopt AGPL-3.0-only 2026-08-27 12:43:48 +08:00
README.md fix(hardening): phase 7 wave 2 — security/MRTR, load/concurrency resilience, and docs sync 2026-12-05 16:09:33 +08:00
SECURITY.md docs(consolidation): phase 5 — prune legacy v1 docs and skills 2026-12-05 14:50:03 +08:00

Casys Digital Thread

Casys Digital Thread is a local-first Engineering System of Record & Multi-Domain Hub built on the Four-Layer Code Mode Architecture: AI hosts (Claude, ChatGPT, Codex, Antigravity) explore and compose interactive engineering views through @mcpview/compose, sysml-toolkit compiles and Z3-verifies textual SysML v2, a shared SHA-256 CAS bridges any engineering MCP or FMI/FMU worker, and humans commit immutable revisions to the Thread ledger and read-only Web Workbench.

Architectural North Star & Anti-Perversion Charter: Read Four-layer Code Mode architecture first. It defines the four layers and explicitly bans the legacy anti-patterns (90-tool explosion, 5-step exploratory ceremony, mandatory SysON+Postgres runtime, per-language closed-subset compilers, and custom Desktop chat/ACP clones).

The four complementary layers

Layer 1 · Interface & Exploration    AI Hosts (Claude/ChatGPT/Codex) + @mcpview/compose
                                     (`execute`, `saveAs`/`replay`, synchronized Boards)
                                                       │
Layer 2 · System of Record           Git `.sysml` (`sysml-toolkit` + Z3, Salsa scaling)
                                     + SHA-256 CAS + 4-tool MRTR (`thread_commit`)
                                     + Immutable `ThreadSnapshot` + Read-only Web Workbench
                                                       │
Layer 3 · Worker Hub / Bridge        Level 0 standard MCP · Level 1 viewer MCP · Level 2 @mcpview
                                     Shared CAS artifact bus + `portSync` (`part.*`, `requirement.*`)
                                                       │
Layer 4 · Physics, CAD & Industrial  `mcp-build123d`, `mcp-fmi` (.fmu / FMI / SSP),
                                     `mcp-calculix`, `mcp-dfm`, `mcp-prusaslicer`, `mcp-erpnext`

Quick start (Four-Layer Code Mode Hub)

deno task build:codemode:board   # build ui://casys-digital-thread/board (@mcpview/compose)
deno task demo:codemode          # run 3-turn fail -> replay -> pass loop + generate board previews
deno task start:codemode:yolo    # start Code Mode Hub (7 model + 4 app tools) on http://127.0.0.1:3021/mcp
deno task preview:cockpit        # optional read-only Web Workbench on http://127.0.0.1:5175/

Walkthrough: Run the four-layer Code Mode demo.

Authority model

Actor Owns Must not
Human Intent, brief limits, consequential commits (thread_commit, project_decide) Author raw solver payloads or provider envelopes
Agent Exploratory Code Mode chains (execute), .sysml authoring, saveAs/replay Self-commit to Thread, fabricate verdicts, or drop literal status labels
Hub / Server SHA-256 CAS bus, sysml-toolkit compilation, attested receipts, immutable ThreadSnapshot Treat unsealed drafts or analytical-pre-sizing as verified solver proofs
Web Workbench Passive GET + SSE project dossier and read-only Compose Board replay Mutate project state or call providers

Status labels remain literal: unsealed, draft, unavailable, unresolved, stale, error, analytical-pre-sizing, demo-fixture, fail, pass.

Choose a path

Goal Start here
Understand the 4-layer architecture & rules Four-layer Code Mode architecture · Codebase architecture map
Run the Code Mode demo & connect a host Run the four-layer Code Mode demo
Understand product direction & verdicts Product direction · Proofs and verdicts
Preview the read-only Web Workbench Preview the native Workbench
Validate a source checkout Validate a source checkout
Browse full documentation Documentation guide

Validate a source checkout

npm --prefix src/ui ci
deno task verify

Repository map

Path Role
src/domain/codemode/, src/application/use-cases/codemode/, src/adapters/codemode/ Active Four-Layer Hub: execute, CAS Bridge, sysml-toolkit CLI engine, FMI parser, code-mode-receipt/1.0, thread_commit
src/ui/codemode-board/ Active Compose Board MCP App (ui://casys-digital-thread/board built on @mcpview/compose/code-mode/board)
src/domain/, src/adapters/shared/, src/presentation/, src/ui/src/ Immutable ThreadSnapshot / EngineeringProjectSnapshot ledgers, SHA-256 CAS stores, and read-only Web Workbench
config/codemode-fleet.json Loopback fleet configuration for the Four-Layer Code Mode Hub
docs/ Diátaxis documentation (entry: docs/README.md)

Engineering provider servers are maintained in separate repositories, published on JSR and npm (@casys/<name>), and bound by the hub as native @mcpview snippet providers. Related open-source building blocks: @mcpview/*, mcp-build123d, mcp-syson, mcp-calculix, mcp-dfm, mcp-prusaslicer, mcp-modelica, mcp-spice, mcp-chrono, mcp-fmi, mcp-openfoam, mcp-avl, mcp-cnc, mcp-openems, and mcp-erpnext.

Contributing, security & license

Read CONTRIBUTING.md and SECURITY.md. Copyright © 2026 Casys AI — licensed under AGPL-3.0-only.