@quolu/lattice 0.1.0 → 0.12.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +87 -4
- package/bin/lattice-bridge.mjs +87 -0
- package/bin/lattice-dashboard.mjs +70 -0
- package/bin/lattice-mcp.mjs +9 -9
- package/bin/lattice.mjs +61 -8
- package/docs/bridge-setup.md +87 -0
- package/docs/schemas/lattice.plan_create_input.v1.schema.json +56 -0
- package/docs/schemas/lattice.plan_create_input.v2.schema.json +72 -0
- package/docs/schemas/lattice.plan_create_input.v3.schema.json +81 -0
- package/package.json +19 -7
- package/sensor/dist/bin/command-supervision.d.ts +1 -1
- package/sensor/dist/bin/command-supervision.js +4 -4
- package/sensor/dist/bin/command-supervision.js.map +1 -1
- package/sensor/dist/bin/fatal-handler.js +2 -2
- package/sensor/dist/bin/fatal-handler.js.map +1 -1
- package/sensor/dist/bin/{codegraph.js → lattice-sensor.js} +207 -328
- package/sensor/dist/bin/node-version-check.d.ts +7 -5
- package/sensor/dist/bin/node-version-check.d.ts.map +1 -1
- package/sensor/dist/bin/node-version-check.js +19 -14
- package/sensor/dist/bin/node-version-check.js.map +1 -1
- package/sensor/dist/context/index.d.ts +1 -1
- package/sensor/dist/context/index.js +6 -6
- package/sensor/dist/context/index.js.map +1 -1
- package/sensor/dist/db/index.d.ts +5 -5
- package/sensor/dist/db/index.d.ts.map +1 -1
- package/sensor/dist/db/index.js +7 -7
- package/sensor/dist/db/index.js.map +1 -1
- package/sensor/dist/db/migrations.js +1 -1
- package/sensor/dist/db/migrations.js.map +1 -1
- package/sensor/dist/db/queries.d.ts +1 -1
- package/sensor/dist/db/queries.js +5 -5
- package/sensor/dist/db/queries.js.map +1 -1
- package/sensor/dist/db/schema.sql +2 -2
- package/sensor/dist/db/sqlite-adapter.d.ts +2 -2
- package/sensor/dist/db/sqlite-adapter.js +3 -3
- package/sensor/dist/db/sqlite-adapter.js.map +1 -1
- package/sensor/dist/db/wal-valve.d.ts +1 -1
- package/sensor/dist/db/wal-valve.d.ts.map +1 -1
- package/sensor/dist/db/wal-valve.js +2 -2
- package/sensor/dist/db/wal-valve.js.map +1 -1
- package/sensor/dist/directory.d.ts +27 -63
- package/sensor/dist/directory.d.ts.map +1 -1
- package/sensor/dist/directory.js +78 -134
- package/sensor/dist/directory.js.map +1 -1
- package/sensor/dist/errors.d.ts +15 -15
- package/sensor/dist/errors.d.ts.map +1 -1
- package/sensor/dist/errors.js +21 -21
- package/sensor/dist/errors.js.map +1 -1
- package/sensor/dist/extraction/dynamic-import.d.ts +1 -1
- package/sensor/dist/extraction/dynamic-import.js +1 -1
- package/sensor/dist/extraction/extraction-version.d.ts +1 -1
- package/sensor/dist/extraction/extraction-version.js +1 -1
- package/sensor/dist/extraction/generated-detection.d.ts +1 -1
- package/sensor/dist/extraction/generated-detection.js +1 -1
- package/sensor/dist/extraction/grammars.d.ts +3 -3
- package/sensor/dist/extraction/grammars.js +5 -5
- package/sensor/dist/extraction/grammars.js.map +1 -1
- package/sensor/dist/extraction/index.d.ts +6 -6
- package/sensor/dist/extraction/index.js +50 -50
- package/sensor/dist/extraction/index.js.map +1 -1
- package/sensor/dist/extraction/kernel/decode.d.ts +1 -1
- package/sensor/dist/extraction/kernel/decode.js +1 -1
- package/sensor/dist/extraction/kernel/index.d.ts +3 -3
- package/sensor/dist/extraction/kernel/index.js +6 -6
- package/sensor/dist/extraction/kernel/index.js.map +1 -1
- package/sensor/dist/extraction/kernel/layout.d.ts +1 -1
- package/sensor/dist/extraction/kernel/layout.js +1 -1
- package/sensor/dist/extraction/kernel/loader.d.ts +6 -6
- package/sensor/dist/extraction/kernel/loader.js +13 -13
- package/sensor/dist/extraction/kernel/loader.js.map +1 -1
- package/sensor/dist/extraction/languages/cfquery.d.ts +1 -1
- package/sensor/dist/extraction/languages/cfquery.js +1 -1
- package/sensor/dist/extraction/languages/lua.d.ts +11 -0
- package/sensor/dist/extraction/languages/lua.d.ts.map +1 -1
- package/sensor/dist/extraction/languages/lua.js +1 -0
- package/sensor/dist/extraction/languages/lua.js.map +1 -1
- package/sensor/dist/extraction/parse-pool.d.ts +5 -5
- package/sensor/dist/extraction/parse-pool.d.ts.map +1 -1
- package/sensor/dist/extraction/parse-pool.js +4 -4
- package/sensor/dist/extraction/parse-worker.js +1 -1
- package/sensor/dist/extraction/parse-worker.js.map +1 -1
- package/sensor/dist/extraction/store-writer.d.ts +1 -1
- package/sensor/dist/extraction/store-writer.js +1 -1
- package/sensor/dist/extraction/svelte-extractor.d.ts +1 -1
- package/sensor/dist/extraction/svelte-extractor.js +1 -1
- package/sensor/dist/extraction/tree-sitter-helpers.js +1 -1
- package/sensor/dist/extraction/tree-sitter.d.ts +2 -2
- package/sensor/dist/extraction/tree-sitter.d.ts.map +1 -1
- package/sensor/dist/extraction/tree-sitter.js +71 -4
- package/sensor/dist/extraction/tree-sitter.js.map +1 -1
- package/sensor/dist/extraction/wasm-runtime-flags.d.ts +2 -2
- package/sensor/dist/extraction/wasm-runtime-flags.d.ts.map +1 -1
- package/sensor/dist/extraction/wasm-runtime-flags.js +5 -5
- package/sensor/dist/extraction/wasm-runtime-flags.js.map +1 -1
- package/sensor/dist/index.d.ts +36 -36
- package/sensor/dist/index.d.ts.map +1 -1
- package/sensor/dist/index.js +71 -71
- package/sensor/dist/index.js.map +1 -1
- package/sensor/dist/mcp/daemon-manager.js +1 -1
- package/sensor/dist/mcp/daemon-paths.d.ts +3 -3
- package/sensor/dist/mcp/daemon-paths.js +7 -7
- package/sensor/dist/mcp/daemon-paths.js.map +1 -1
- package/sensor/dist/mcp/daemon-registry.d.ts +2 -2
- package/sensor/dist/mcp/daemon-registry.js +5 -5
- package/sensor/dist/mcp/daemon.d.ts +7 -7
- package/sensor/dist/mcp/daemon.d.ts.map +1 -1
- package/sensor/dist/mcp/daemon.js +21 -21
- package/sensor/dist/mcp/daemon.js.map +1 -1
- package/sensor/dist/mcp/dynamic-boundaries.js +1 -1
- package/sensor/dist/mcp/engine.d.ts +9 -9
- package/sensor/dist/mcp/engine.d.ts.map +1 -1
- package/sensor/dist/mcp/engine.js +44 -44
- package/sensor/dist/mcp/engine.js.map +1 -1
- package/sensor/dist/mcp/index.d.ts +14 -14
- package/sensor/dist/mcp/index.d.ts.map +1 -1
- package/sensor/dist/mcp/index.js +41 -41
- package/sensor/dist/mcp/index.js.map +1 -1
- package/sensor/dist/mcp/liveness-watchdog.js +7 -7
- package/sensor/dist/mcp/liveness-watchdog.js.map +1 -1
- package/sensor/dist/mcp/ppid-watchdog.d.ts +3 -3
- package/sensor/dist/mcp/ppid-watchdog.js +2 -2
- package/sensor/dist/mcp/proxy.d.ts.map +1 -1
- package/sensor/dist/mcp/proxy.js +37 -37
- package/sensor/dist/mcp/proxy.js.map +1 -1
- package/sensor/dist/mcp/query-pool.d.ts +3 -3
- package/sensor/dist/mcp/query-pool.js +7 -7
- package/sensor/dist/mcp/query-pool.js.map +1 -1
- package/sensor/dist/mcp/query-worker.d.ts +2 -2
- package/sensor/dist/mcp/query-worker.js +7 -7
- package/sensor/dist/mcp/query-worker.js.map +1 -1
- package/sensor/dist/mcp/server-instructions.d.ts +10 -12
- package/sensor/dist/mcp/server-instructions.d.ts.map +1 -1
- package/sensor/dist/mcp/server-instructions.js +39 -37
- package/sensor/dist/mcp/server-instructions.js.map +1 -1
- package/sensor/dist/mcp/session.d.ts +2 -2
- package/sensor/dist/mcp/session.js +18 -18
- package/sensor/dist/mcp/session.js.map +1 -1
- package/sensor/dist/mcp/startup-handshake.d.ts +3 -3
- package/sensor/dist/mcp/startup-handshake.d.ts.map +1 -1
- package/sensor/dist/mcp/startup-handshake.js +3 -3
- package/sensor/dist/mcp/startup-handshake.js.map +1 -1
- package/sensor/dist/mcp/tools.d.ts +53 -53
- package/sensor/dist/mcp/tools.d.ts.map +1 -1
- package/sensor/dist/mcp/tools.js +180 -216
- package/sensor/dist/mcp/tools.js.map +1 -1
- package/sensor/dist/mcp/transport.d.ts +1 -1
- package/sensor/dist/mcp/transport.js +6 -6
- package/sensor/dist/mcp/transport.js.map +1 -1
- package/sensor/dist/mcp/version.d.ts +2 -2
- package/sensor/dist/mcp/version.d.ts.map +1 -1
- package/sensor/dist/mcp/version.js +3 -3
- package/sensor/dist/mcp/version.js.map +1 -1
- package/sensor/dist/project-config.d.ts +6 -6
- package/sensor/dist/project-config.d.ts.map +1 -1
- package/sensor/dist/project-config.js +10 -10
- package/sensor/dist/project-config.js.map +1 -1
- package/sensor/dist/resolution/callback-synthesizer.js +4 -4
- package/sensor/dist/resolution/callback-synthesizer.js.map +1 -1
- package/sensor/dist/resolution/frameworks/drupal.d.ts +3 -3
- package/sensor/dist/resolution/frameworks/drupal.js +3 -3
- package/sensor/dist/resolution/frameworks/fabric.js +1 -1
- package/sensor/dist/resolution/frameworks/fabric.js.map +1 -1
- package/sensor/dist/resolution/frameworks/java.js +1 -1
- package/sensor/dist/resolution/frameworks/java.js.map +1 -1
- package/sensor/dist/resolution/frameworks/svelte.js +1 -1
- package/sensor/dist/resolution/frameworks/svelte.js.map +1 -1
- package/sensor/dist/resolution/goframe-synthesizer.d.ts +1 -1
- package/sensor/dist/resolution/goframe-synthesizer.js +1 -1
- package/sensor/dist/resolution/index.d.ts +1 -1
- package/sensor/dist/resolution/index.js +9 -9
- package/sensor/dist/resolution/index.js.map +1 -1
- package/sensor/dist/resolution/name-matcher.js +2 -2
- package/sensor/dist/resolution/name-matcher.js.map +1 -1
- package/sensor/dist/resolution/resolver-pool.d.ts +2 -2
- package/sensor/dist/resolution/resolver-pool.js +4 -4
- package/sensor/dist/resolution/resolver-pool.js.map +1 -1
- package/sensor/dist/resolution/resolver-worker.js +2 -2
- package/sensor/dist/resolution/resolver-worker.js.map +1 -1
- package/sensor/dist/resolution/workspace-packages.js +1 -1
- package/sensor/dist/resolution/workspace-packages.js.map +1 -1
- package/sensor/dist/search/identifier-segments.d.ts +1 -1
- package/sensor/dist/search/identifier-segments.js +1 -1
- package/sensor/dist/search/query-utils.d.ts +1 -0
- package/sensor/dist/search/query-utils.d.ts.map +1 -1
- package/sensor/dist/search/query-utils.js +10 -3
- package/sensor/dist/search/query-utils.js.map +1 -1
- package/sensor/dist/sync/git-hooks.d.ts +9 -9
- package/sensor/dist/sync/git-hooks.d.ts.map +1 -1
- package/sensor/dist/sync/git-hooks.js +15 -15
- package/sensor/dist/sync/git-hooks.js.map +1 -1
- package/sensor/dist/sync/watch-policy.d.ts +2 -2
- package/sensor/dist/sync/watch-policy.js +5 -5
- package/sensor/dist/sync/watch-policy.js.map +1 -1
- package/sensor/dist/sync/watcher.d.ts +2 -2
- package/sensor/dist/sync/watcher.d.ts.map +1 -1
- package/sensor/dist/sync/watcher.js +16 -16
- package/sensor/dist/sync/watcher.js.map +1 -1
- package/sensor/dist/sync/worktree.d.ts +5 -5
- package/sensor/dist/sync/worktree.d.ts.map +1 -1
- package/sensor/dist/sync/worktree.js +9 -9
- package/sensor/dist/sync/worktree.js.map +1 -1
- package/sensor/dist/telemetry/index.d.ts +8 -8
- package/sensor/dist/telemetry/index.d.ts.map +1 -1
- package/sensor/dist/telemetry/index.js +16 -16
- package/sensor/dist/telemetry/index.js.map +1 -1
- package/sensor/dist/types.d.ts +2 -2
- package/sensor/dist/types.js +1 -1
- package/sensor/dist/ui/color.d.ts +2 -2
- package/sensor/dist/ui/color.js +2 -2
- package/sensor/dist/ui/glyphs.d.ts +3 -3
- package/sensor/dist/ui/glyphs.js +7 -7
- package/sensor/dist/ui/glyphs.js.map +1 -1
- package/sensor/dist/utils.d.ts +4 -4
- package/sensor/dist/utils.js +8 -8
- package/sensor/dist/utils.js.map +1 -1
- package/sensor/package.json +8 -13
- package/src/artifact-contracts.mjs +2 -2
- package/src/boundary-compiler.mjs +28 -28
- package/src/boundary-observation-compiler-v2.mjs +10 -10
- package/src/bounded-seam.mjs +144 -0
- package/src/bridge-cli.mjs +227 -0
- package/src/bridge-config.mjs +346 -0
- package/src/bridge-daemon.mjs +328 -0
- package/src/bridge-launch-agent.mjs +311 -0
- package/src/bridge-server.mjs +312 -0
- package/src/cli-help.mjs +163 -0
- package/src/control-compiler.mjs +30 -30
- package/src/dag-chain.mjs +261 -0
- package/src/factory-diagnostics.mjs +8 -7
- package/src/hash-chain.mjs +76 -0
- package/src/node-version-guard.mjs +5 -4
- package/src/project-cli.mjs +392 -0
- package/src/project-identity.mjs +71 -0
- package/src/rc1-evidence-bundle.mjs +16 -16
- package/src/rc1-v4-campaign.mjs +15 -14
- package/src/rc1-v5-artifact-set.mjs +2 -2
- package/src/rc1-v5-campaign.mjs +15 -14
- package/src/rc1-v6-artifact-set.mjs +18 -18
- package/src/rc1-v6-campaign.mjs +16 -16
- package/src/rc1-v6-causal-binding.mjs +16 -14
- package/src/rc1-v6-measurement.mjs +20 -38
- package/src/rc2-artifact-set.mjs +45 -40
- package/src/rc2-campaign.mjs +48 -66
- package/src/rc2-delivery-policy-front-end.mjs +30 -30
- package/src/rc2-rc1-transfer-front-end.mjs +5 -5
- package/src/rc3-actual-dogfood.mjs +6 -6
- package/src/rc3-dogfood-scaffold.mjs +12 -7
- package/src/rc3-scripted-campaign.mjs +75 -21
- package/src/rc4-stage1-dogfood.mjs +24 -7
- package/src/runtime-cli.mjs +2424 -45
- package/src/runtime-contracts.mjs +7 -7
- package/src/runtime-control-store.mjs +547 -0
- package/src/runtime-controller-protocol.mjs +517 -0
- package/src/runtime-direct-os-observer.mjs +284 -0
- package/src/runtime-engine.mjs +2 -2
- package/src/runtime-errors.mjs +1 -1
- package/src/runtime-event-store.mjs +15 -43
- package/src/runtime-front-end.mjs +26 -26
- package/src/runtime-gate-store.mjs +477 -0
- package/src/runtime-hold-recompile.mjs +214 -23
- package/src/runtime-lifecycle-lock.mjs +290 -0
- package/src/runtime-managed-supervisor.mjs +1276 -0
- package/src/runtime-multi-epoch-store.mjs +761 -0
- package/src/runtime-projection.mjs +62 -0
- package/src/seam-transform.mjs +38 -38
- package/src/{codegraph-adapter.mjs → sensor-adapter.mjs} +7 -7
- package/src/sensor-cli.mjs +107 -0
- package/src/sensor-runtime.mjs +48 -0
- package/src/timestamp-contract.mjs +8 -0
- package/src/todo-chain.mjs +178 -0
- package/src/todo-cli.mjs +1032 -0
- package/src/todo-contracts.mjs +501 -0
- package/src/todo-dashboard-registry.mjs +318 -0
- package/src/todo-gantt-html.mjs +416 -0
- package/src/todo-gantt-layout.mjs +603 -0
- package/src/todo-gantt-live.mjs +269 -0
- package/src/todo-gantt-presentation.mjs +217 -0
- package/src/todo-gantt-svg.mjs +249 -0
- package/src/todo-markdown-renderer.mjs +260 -0
- package/src/todo-migration.mjs +260 -0
- package/src/todo-narrative-anchor.mjs +130 -0
- package/src/todo-revision.mjs +425 -0
- package/src/todo-status.mjs +340 -0
- package/src/todo-store.mjs +3468 -0
- package/src/treatment-compiler.mjs +28 -28
- package/src/treatment-runner.mjs +42 -44
- package/sensor/dist/bin/codegraph.d.ts +0 -26
- package/sensor/dist/bin/codegraph.d.ts.map +0 -1
- package/sensor/dist/bin/codegraph.js.map +0 -1
- package/sensor/dist/bin/uninstall.d.ts +0 -14
- package/sensor/dist/bin/uninstall.d.ts.map +0 -1
- package/sensor/dist/bin/uninstall.js +0 -36
- package/sensor/dist/bin/uninstall.js.map +0 -1
- package/sensor/dist/installer/beta-signup.d.ts +0 -54
- package/sensor/dist/installer/beta-signup.d.ts.map +0 -1
- package/sensor/dist/installer/beta-signup.js +0 -178
- package/sensor/dist/installer/beta-signup.js.map +0 -1
- package/sensor/dist/installer/config-writer.d.ts +0 -28
- package/sensor/dist/installer/config-writer.d.ts.map +0 -1
- package/sensor/dist/installer/config-writer.js +0 -91
- package/sensor/dist/installer/config-writer.js.map +0 -1
- package/sensor/dist/installer/index.d.ts +0 -142
- package/sensor/dist/installer/index.d.ts.map +0 -1
- package/sensor/dist/installer/index.js +0 -622
- package/sensor/dist/installer/index.js.map +0 -1
- package/sensor/dist/installer/instructions-template.d.ts +0 -41
- package/sensor/dist/installer/instructions-template.d.ts.map +0 -1
- package/sensor/dist/installer/instructions-template.js +0 -53
- package/sensor/dist/installer/instructions-template.js.map +0 -1
- package/sensor/dist/installer/targets/antigravity.d.ts +0 -57
- package/sensor/dist/installer/targets/antigravity.d.ts.map +0 -1
- package/sensor/dist/installer/targets/antigravity.js +0 -308
- package/sensor/dist/installer/targets/antigravity.js.map +0 -1
- package/sensor/dist/installer/targets/claude.d.ts +0 -62
- package/sensor/dist/installer/targets/claude.d.ts.map +0 -1
- package/sensor/dist/installer/targets/claude.js +0 -454
- package/sensor/dist/installer/targets/claude.js.map +0 -1
- package/sensor/dist/installer/targets/codex.d.ts +0 -18
- package/sensor/dist/installer/targets/codex.d.ts.map +0 -1
- package/sensor/dist/installer/targets/codex.js +0 -185
- package/sensor/dist/installer/targets/codex.js.map +0 -1
- package/sensor/dist/installer/targets/cursor.d.ts +0 -35
- package/sensor/dist/installer/targets/cursor.d.ts.map +0 -1
- package/sensor/dist/installer/targets/cursor.js +0 -254
- package/sensor/dist/installer/targets/cursor.js.map +0 -1
- package/sensor/dist/installer/targets/gemini.d.ts +0 -26
- package/sensor/dist/installer/targets/gemini.d.ts.map +0 -1
- package/sensor/dist/installer/targets/gemini.js +0 -165
- package/sensor/dist/installer/targets/gemini.js.map +0 -1
- package/sensor/dist/installer/targets/hermes.d.ts +0 -18
- package/sensor/dist/installer/targets/hermes.d.ts.map +0 -1
- package/sensor/dist/installer/targets/hermes.js +0 -359
- package/sensor/dist/installer/targets/hermes.js.map +0 -1
- package/sensor/dist/installer/targets/kiro.d.ts +0 -27
- package/sensor/dist/installer/targets/kiro.d.ts.map +0 -1
- package/sensor/dist/installer/targets/kiro.js +0 -178
- package/sensor/dist/installer/targets/kiro.js.map +0 -1
- package/sensor/dist/installer/targets/opencode.d.ts +0 -38
- package/sensor/dist/installer/targets/opencode.d.ts.map +0 -1
- package/sensor/dist/installer/targets/opencode.js +0 -288
- package/sensor/dist/installer/targets/opencode.js.map +0 -1
- package/sensor/dist/installer/targets/registry.d.ts +0 -35
- package/sensor/dist/installer/targets/registry.d.ts.map +0 -1
- package/sensor/dist/installer/targets/registry.js +0 -91
- package/sensor/dist/installer/targets/registry.js.map +0 -1
- package/sensor/dist/installer/targets/shared.d.ts +0 -101
- package/sensor/dist/installer/targets/shared.d.ts.map +0 -1
- package/sensor/dist/installer/targets/shared.js +0 -264
- package/sensor/dist/installer/targets/shared.js.map +0 -1
- package/sensor/dist/installer/targets/toml.d.ts +0 -52
- package/sensor/dist/installer/targets/toml.d.ts.map +0 -1
- package/sensor/dist/installer/targets/toml.js +0 -147
- package/sensor/dist/installer/targets/toml.js.map +0 -1
- package/sensor/dist/installer/targets/types.d.ts +0 -108
- package/sensor/dist/installer/targets/types.d.ts.map +0 -1
- package/sensor/dist/installer/targets/types.js +0 -16
- package/sensor/dist/installer/targets/types.js.map +0 -1
- package/sensor/dist/upgrade/index.d.ts +0 -171
- package/sensor/dist/upgrade/index.d.ts.map +0 -1
- package/sensor/dist/upgrade/index.js +0 -659
- package/sensor/dist/upgrade/index.js.map +0 -1
- package/sensor/dist/upgrade/remove-binary.d.ts +0 -87
- package/sensor/dist/upgrade/remove-binary.d.ts.map +0 -1
- package/sensor/dist/upgrade/remove-binary.js +0 -289
- package/sensor/dist/upgrade/remove-binary.js.map +0 -1
- package/sensor/dist/upgrade/update-check.d.ts +0 -92
- package/sensor/dist/upgrade/update-check.d.ts.map +0 -1
- package/sensor/dist/upgrade/update-check.js +0 -258
- package/sensor/dist/upgrade/update-check.js.map +0 -1
- package/src/bootstrap.mjs +0 -88
package/README.md
CHANGED
|
@@ -3,8 +3,14 @@
|
|
|
3
3
|
Latticeは、codebaseの境界を観測・変換し、multi-agent開発の並列TODO graphを生成する
|
|
4
4
|
schedulability compilerです。
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
[
|
|
6
|
+
現在の工程状態と完了証拠の正本は、このrepoのLattice storeです。文書の役割と現行導線は
|
|
7
|
+
[docs/README.md](docs/README.md)、製品思想は[PLAN.md](PLAN.md)、公開contractは
|
|
8
|
+
[docs/00_product-contract.md](docs/00_product-contract.md)を参照してください。
|
|
9
|
+
|
|
10
|
+
CLIの全体像は`lattice --help`、各公開namespaceの正規構文は
|
|
11
|
+
`lattice <plan|run|event|todo|sensor|factory-diagnostics|runtime-errors|bridge> --help`で確認できます。
|
|
12
|
+
個別操作は`lattice <namespace> <subcommand> --help`または`lattice help <namespace> <subcommand>`で
|
|
13
|
+
正規optionをstore非依存に確認できます。
|
|
8
14
|
|
|
9
15
|
## 開発
|
|
10
16
|
|
|
@@ -12,9 +18,86 @@ schedulability compilerです。
|
|
|
12
18
|
npm test
|
|
13
19
|
npm run check
|
|
14
20
|
npm run ci
|
|
15
|
-
|
|
21
|
+
lattice sensor sync . --json
|
|
16
22
|
spotter doctor
|
|
17
23
|
codex-sidecar diagnostics --project . --preset auditor --json
|
|
18
24
|
```
|
|
19
25
|
|
|
20
|
-
|
|
26
|
+
未初期化projectで`sensor sync`した場合は`LATTICE_SENSOR_NOT_INITIALIZED`と正規`next_action`を返します。
|
|
27
|
+
その他のsensor失敗もexit code、signal、bounded stderrをtyped detailへ残し、原因を隠しません。
|
|
28
|
+
|
|
29
|
+
Node.js 22.13以上を使用します。境界観測は配布物に同梱したLattice sensorだけを使い、PATH上の
|
|
30
|
+
廃止済みruntimeや旧cache/dataへfallbackしません。Spotterはproject単位で生成stateの所有境界を守ります。
|
|
31
|
+
|
|
32
|
+
どのrepoでも、Latticeの導入状態はdirectoryの有無を推測せず、最初に次のtyped discoveryで判定します。
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
lattice status --json
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
`state`は`uninitialized | ready | active_run | invalid`のいずれかです。`uninitialized`は
|
|
39
|
+
正常な未初期化状態で、`next_action`が正規の初期authoring入口を返します。初回planは
|
|
40
|
+
新規planはPhase監査とToDo schedulingを分離する`lattice.plan_create_input.v3`のcanonical
|
|
41
|
+
JSON+LFを用意し、次で作成します。既存v2/v4は互換契約として維持されます。
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
lattice plan create --schema-version 3 --json
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
lattice plan create --input .lattice/plan-create.json
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
`invalid`をMarkdown fallbackへ丸めず、`next_action`に従ってstoreを診断してください。
|
|
52
|
+
discoveryと初期transactionの不変条件は
|
|
53
|
+
[ADR 0058](docs/adr/0058-project-discovery-and-initial-authoring.md)が正です。
|
|
54
|
+
|
|
55
|
+
TODO工程storeの読取は`lattice todo status`、検証は`lattice todo verify`、表示生成は
|
|
56
|
+
`lattice todo gantt`を使います。topology/source reconciliationは
|
|
57
|
+
`lattice todo revise --plan <key> --input <canonical-revision.json>`、Phase付きplanは
|
|
58
|
+
`lattice todo revise-phase --plan <key> --input <canonical-phase-revision.json>`でsuccessor発行します。
|
|
59
|
+
cross-plan topologyを同時に切り替える場合は
|
|
60
|
+
`lattice todo revise-set --input <canonical-revision-set.json>`を使い、Phase revisionを含む集合は
|
|
61
|
+
`lattice.todo_revision_set.v3`で通常revisionと混在できます。
|
|
62
|
+
Phase付きv5 planでは、通常ToDoの開始順はToDo DAGだけで決まり、Phase前後関係は重監査の順序だけを
|
|
63
|
+
制御します。特定ToDoがPhase受理を本当に必要とする場合だけ`phase_accept_dependencies`で明示します。
|
|
64
|
+
`lattice todo status --json`の`dispatch_frontier`はready全件を同時dispatchする既定を示します。
|
|
65
|
+
readyが複数なら最初のstartに`--parallel-frontier`を付け、subsetだけを直列着手する場合は
|
|
66
|
+
`--override-reason <reason>`で理由を残します。
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
lattice todo start --plan <key> --task <id> --parallel-frontier
|
|
70
|
+
lattice todo start --plan <key> --task <id> --override-reason <reason>
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
`--parallel-frontier`はhostへ並列dispatch方針を宣言する開始gateです。Lattice自身がAI hostのagentを
|
|
74
|
+
起動するものではなく、実際のdispatchはhostが行います。宣言後もready全件が着手されたかは
|
|
75
|
+
`active_set`と`next_ready`で観測できます。
|
|
76
|
+
ToDo完了は軽量確認までで、所属ToDoが全てdoneになったPhaseは`gate_ready`となり、`todo phase review`後に
|
|
77
|
+
required evidenceを束縛した`todo phase accept`で重監査の判断を記録します。監査回数やPhase数を自動追加する
|
|
78
|
+
機能ではありません。Phase状態は
|
|
79
|
+
`lattice todo phase status --plan <key>`、閲覧中に進捗が更新される工程表は
|
|
80
|
+
`lattice todo gantt serve --port 0`で確認できます。live viewerはloopback-only、read-onlyで、
|
|
81
|
+
`/projects/<project_id>/`というproject固有URLを返します。別projectからそれぞれ起動すれば、独立port・独立SSE経路で同時表示できます。
|
|
82
|
+
session開始時のtyped discoveryで使う`lattice status --json`と、actor環境変数を持つ通常のTODO操作は
|
|
83
|
+
active projectを自動登録し、一つのloopback dashboard daemonを再利用します。
|
|
84
|
+
`/projects/`の一覧からproject固有の工程図を開け、各projectのSSE更新は互いに分離されます。
|
|
85
|
+
LANや外部reverse proxyから閲覧するoptional bridgeは既定で無効です。明示したIPにだけbindする初回設定、
|
|
86
|
+
再設定、停止方法は[bridge setup](docs/bridge-setup.md)を参照してください。
|
|
87
|
+
静的工程表は`lattice todo gantt status`で`current / stale / missing`を確認でき、HTMLまたは
|
|
88
|
+
digest付きsidecarの欠落・改ざんはtyped failureになります。
|
|
89
|
+
状態を書き込む`start / block / unblock / done / evidence promote / reopen / revise / revise-phase / revise-set`
|
|
90
|
+
では、監査actorとして次の3環境変数をすべて設定してください。
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
export LATTICE_TODO_ACTOR_HOST=<host-id>
|
|
94
|
+
export LATTICE_TODO_ACTOR_SESSION=<session-id>
|
|
95
|
+
export LATTICE_TODO_ACTOR_AGENT=<agent-id>
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
不足またはidentifierとして不正な値がある場合、mutationはstoreを変更せず`ACTOR_UNRESOLVED`を返します。
|
|
99
|
+
error detailの`missing_environment`/`invalid_environment`と
|
|
100
|
+
`next_action: set_required_actor_environment_and_retry`を確認し、正規値を設定して同じ操作を再試行してください。
|
|
101
|
+
|
|
102
|
+
正確なargv、evidence descriptor、result wireは
|
|
103
|
+
[ADR 0056](docs/adr/0056-todo-authoring-transitions.md)を参照してください。
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { readBridgeConfig } from '../src/bridge-config.mjs';
|
|
4
|
+
import {
|
|
5
|
+
readBridgeStopRequest, removeBridgeDaemonActiveMarker, removeBridgeDaemonDescriptor,
|
|
6
|
+
writeBridgeDaemonDescriptor, writeBridgeStopReceipt,
|
|
7
|
+
} from '../src/bridge-daemon.mjs';
|
|
8
|
+
import { bridgeRuntimeController } from '../src/bridge-server.mjs';
|
|
9
|
+
|
|
10
|
+
const env = process.env;
|
|
11
|
+
const instanceToken = env.LATTICE_BRIDGE_INSTANCE_TOKEN;
|
|
12
|
+
if (typeof instanceToken !== 'string' || !/^[0-9a-f]{64}$/u.test(instanceToken)) {
|
|
13
|
+
process.stderr.write(`${JSON.stringify({ schema: 'lattice.bridge_daemon_error.v1',
|
|
14
|
+
code: 'BRIDGE_INSTANCE_TOKEN_INVALID', message: 'bridge instance token is invalid' })}\n`);
|
|
15
|
+
process.exit(1);
|
|
16
|
+
}
|
|
17
|
+
const controller = bridgeRuntimeController({ env, instanceToken });
|
|
18
|
+
let timer;
|
|
19
|
+
let closing = false;
|
|
20
|
+
let descriptorFingerprint = null;
|
|
21
|
+
let checking = false;
|
|
22
|
+
let failClosedError = null;
|
|
23
|
+
const close = async () => {
|
|
24
|
+
if (closing) return;
|
|
25
|
+
closing = true;
|
|
26
|
+
clearInterval(timer);
|
|
27
|
+
await controller.close();
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
try {
|
|
31
|
+
const stopRequest = await readBridgeStopRequest({ env });
|
|
32
|
+
if (stopRequest !== null) {
|
|
33
|
+
await writeBridgeStopReceipt({ nonce: stopRequest.nonce, env });
|
|
34
|
+
await removeBridgeDaemonDescriptor({ env });
|
|
35
|
+
await removeBridgeDaemonActiveMarker({ env });
|
|
36
|
+
process.exit(0);
|
|
37
|
+
}
|
|
38
|
+
const config = await readBridgeConfig({ env });
|
|
39
|
+
if (config === null || !config.enabled) throw Object.assign(new Error('bridge disabled'), { code: 'BRIDGE_DISABLED' });
|
|
40
|
+
await controller.reconcile();
|
|
41
|
+
await writeBridgeDaemonDescriptor({ config, env });
|
|
42
|
+
descriptorFingerprint = config.updated_at;
|
|
43
|
+
} catch (error) {
|
|
44
|
+
process.stderr.write(`${JSON.stringify({ schema: 'lattice.bridge_daemon_error.v1',
|
|
45
|
+
code: error?.code ?? 'BRIDGE_DAEMON_FAILED', message: error?.message ?? 'bridge daemon failed' })}\n`);
|
|
46
|
+
process.exit(1);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
timer = setInterval(async () => {
|
|
50
|
+
if (checking || closing) return;
|
|
51
|
+
checking = true;
|
|
52
|
+
try {
|
|
53
|
+
const stopRequest = await readBridgeStopRequest({ env });
|
|
54
|
+
if (stopRequest !== null) {
|
|
55
|
+
await close();
|
|
56
|
+
await writeBridgeStopReceipt({ nonce: stopRequest.nonce, env });
|
|
57
|
+
await removeBridgeDaemonDescriptor({ env });
|
|
58
|
+
await removeBridgeDaemonActiveMarker({ env });
|
|
59
|
+
process.exit(0);
|
|
60
|
+
}
|
|
61
|
+
const config = await readBridgeConfig({ env });
|
|
62
|
+
if (config === null || !config.enabled) {
|
|
63
|
+
await close();
|
|
64
|
+
await removeBridgeDaemonDescriptor({ env });
|
|
65
|
+
await removeBridgeDaemonActiveMarker({ env });
|
|
66
|
+
process.exit(0);
|
|
67
|
+
}
|
|
68
|
+
await controller.reconcile();
|
|
69
|
+
failClosedError = null;
|
|
70
|
+
if (descriptorFingerprint !== config.updated_at) {
|
|
71
|
+
await writeBridgeDaemonDescriptor({ config, env });
|
|
72
|
+
descriptorFingerprint = config.updated_at;
|
|
73
|
+
}
|
|
74
|
+
} catch (error) {
|
|
75
|
+
const failure = { schema: 'lattice.bridge_daemon_error.v1',
|
|
76
|
+
code: error?.code ?? 'BRIDGE_RECONCILE_FAILED',
|
|
77
|
+
message: error?.message ?? 'bridge reconcile failed' };
|
|
78
|
+
const fingerprint = JSON.stringify(failure);
|
|
79
|
+
if (fingerprint !== failClosedError) process.stderr.write(`${fingerprint}\n`);
|
|
80
|
+
failClosedError = fingerprint;
|
|
81
|
+
// Public traffic fails closed immediately. Keep only the local control loop alive so an
|
|
82
|
+
// authenticated nonce stop request can still receive a socket-closed receipt.
|
|
83
|
+
await controller.close();
|
|
84
|
+
} finally { checking = false; }
|
|
85
|
+
}, 250);
|
|
86
|
+
process.once('SIGINT', () => close().finally(() => process.exit(0)));
|
|
87
|
+
process.once('SIGTERM', () => close().finally(() => process.exit(0)));
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { readTodoStoreStable } from '../src/todo-store.mjs';
|
|
4
|
+
import { renderTodoGanttForProject } from '../src/todo-cli.mjs';
|
|
5
|
+
import {
|
|
6
|
+
readActiveTodoDashboardProjects,
|
|
7
|
+
writeTodoDashboardDaemonDescriptor,
|
|
8
|
+
} from '../src/todo-dashboard-registry.mjs';
|
|
9
|
+
import {
|
|
10
|
+
createTodoGanttProjectRegistry,
|
|
11
|
+
startTodoGanttDashboardServer,
|
|
12
|
+
} from '../src/todo-gantt-live.mjs';
|
|
13
|
+
|
|
14
|
+
const args = process.argv.slice(2);
|
|
15
|
+
if (args.length === 1 && (args[0] === '--help' || args[0] === '-h')) {
|
|
16
|
+
process.stdout.write('Usage: lattice-dashboard\n');
|
|
17
|
+
process.exit(0);
|
|
18
|
+
}
|
|
19
|
+
if (args.length > 0) {
|
|
20
|
+
process.stderr.write('Usage: lattice-dashboard\n');
|
|
21
|
+
process.exit(2);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const env = process.env;
|
|
25
|
+
const configured = env.LATTICE_DASHBOARD_PORT;
|
|
26
|
+
const port = typeof configured === 'string' && /^(?:0|[1-9][0-9]{0,4})$/u.test(configured)
|
|
27
|
+
&& Number(configured) <= 65_535 ? Number(configured) : 0;
|
|
28
|
+
const registry = createTodoGanttProjectRegistry();
|
|
29
|
+
const roots = new Map();
|
|
30
|
+
|
|
31
|
+
async function synchronize() {
|
|
32
|
+
const active = await readActiveTodoDashboardProjects({ env });
|
|
33
|
+
const activeIds = new Set(active.map(({ project_id: projectId }) => projectId));
|
|
34
|
+
for (const projectId of roots.keys()) {
|
|
35
|
+
if (!activeIds.has(projectId)) {
|
|
36
|
+
registry.unregister(projectId);
|
|
37
|
+
roots.delete(projectId);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
for (const entry of active) {
|
|
41
|
+
const binding = `${entry.repo_root}\0${entry.display_name}`;
|
|
42
|
+
if (roots.get(entry.project_id) === binding) continue;
|
|
43
|
+
registry.unregister(entry.project_id);
|
|
44
|
+
registry.register({
|
|
45
|
+
projectId: entry.project_id,
|
|
46
|
+
displayName: entry.display_name,
|
|
47
|
+
render: async ({ displayName }) => {
|
|
48
|
+
const result = await renderTodoGanttForProject({ repoRoot: entry.repo_root,
|
|
49
|
+
stable: true, displayName });
|
|
50
|
+
return { html: result.rendered.html, head_digest: result.metadata.manifest_digest };
|
|
51
|
+
},
|
|
52
|
+
readHead: async () => (await readTodoStoreStable({ repoRoot: entry.repo_root })).manifest.manifest_digest,
|
|
53
|
+
});
|
|
54
|
+
roots.set(entry.project_id, binding);
|
|
55
|
+
}
|
|
56
|
+
return active.length;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
await synchronize();
|
|
60
|
+
const dashboard = await startTodoGanttDashboardServer({ registry, port });
|
|
61
|
+
await writeTodoDashboardDaemonDescriptor({ port: dashboard.port, env });
|
|
62
|
+
const timer = setInterval(() => synchronize().then((count) => {
|
|
63
|
+
if (count === 0) process.exit(0);
|
|
64
|
+
}).catch(() => process.exit(1)), 1_000);
|
|
65
|
+
const close = async () => {
|
|
66
|
+
clearInterval(timer);
|
|
67
|
+
await dashboard.close();
|
|
68
|
+
};
|
|
69
|
+
process.once('SIGINT', () => close().finally(() => process.exit(0)));
|
|
70
|
+
process.once('SIGTERM', () => close().finally(() => process.exit(0)));
|
package/bin/lattice-mcp.mjs
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* Lattice MCP server entrypoint (ADR 0049 Decision 8).
|
|
4
4
|
*
|
|
5
5
|
* Thin bin that delegates to the sensor's MCP server — the same server
|
|
6
|
-
* `
|
|
6
|
+
* `sensor serve --mcp` starts (see sensor/src/bin/sensor.ts `serve`
|
|
7
7
|
* command and sensor/src/mcp/index.ts `MCPServer`). Deliberately a SEPARATE
|
|
8
8
|
* bin from `bin/lattice.mjs`: the CLI 6 面 axioms (stdout versioned JSON 1
|
|
9
|
-
* 行, exit 0/1/2, `lattice.cli_error.
|
|
9
|
+
* 行, exit 0/1/2, `lattice.cli_error.v2`) apply ONLY to lattice.mjs, never
|
|
10
10
|
* to this MCP surface (ADR 0049 Decision 1/8).
|
|
11
11
|
*
|
|
12
12
|
* Contract (ADR 0049 Decision 8):
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* (The sensor's own MCPServer already honors this; nothing here writes
|
|
15
15
|
* to stdout.)
|
|
16
16
|
* ② Accepts the INTERNAL daemon re-invoke form (`serve --mcp --path
|
|
17
|
-
* <root>` +
|
|
17
|
+
* <root>` + LATTICE_SENSOR_DAEMON_INTERNAL=1 env). The shared daemon
|
|
18
18
|
* re-execs `process.argv[1]` with exactly this argv shape
|
|
19
19
|
* (sensor/src/mcp/index.ts `spawnDetachedDaemon`) — when this process
|
|
20
20
|
* IS `process.argv[1]` (an MCP host launched it directly as
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* unable to ever start, silently pinning every session to direct mode
|
|
23
23
|
* (the exact silent-degradation trap the ADR calls out).
|
|
24
24
|
* ③ Exit semantics: usage violation before startup = exit 2; startup
|
|
25
|
-
* scrutiny failure = exit 1 + one `lattice.cli_error.
|
|
25
|
+
* scrutiny failure = exit 1 + one `lattice.cli_error.v2` line on
|
|
26
26
|
* stderr; normal session end = exit 0 (delegated entirely to
|
|
27
27
|
* MCPServer, which calls process.exit on every one of its lifecycle
|
|
28
28
|
* paths — direct/proxy/daemon alike); session-established failures are
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
* process alive for those).
|
|
31
31
|
* ④ Node version guard (wave2レビューでのスコープ外発見の修理): this bin
|
|
32
32
|
* imports `../sensor/dist/index.js` directly, bypassing the sensor
|
|
33
|
-
* CLI's own Node-version guard (sensor/src/bin/
|
|
33
|
+
* CLI's own Node-version guard (sensor/src/bin/sensor.ts, guarding
|
|
34
34
|
* against a Node 25.x V8 turboshaft WASM JIT Zone allocator OOM during
|
|
35
35
|
* tree-sitter grammar compilation, and a MIN_NODE_MAJOR floor). This
|
|
36
36
|
* file re-applies the SAME check — reusing thresholds/banners from
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
|
|
45
45
|
import { evaluateNodeVersionGuard } from '../src/node-version-guard.mjs';
|
|
46
46
|
|
|
47
|
-
const CLI_ERROR_SCHEMA = 'lattice.cli_error.
|
|
47
|
+
const CLI_ERROR_SCHEMA = 'lattice.cli_error.v2';
|
|
48
48
|
|
|
49
49
|
/** Usage violation BEFORE startup — exit 2, plain-text stderr (mirrors bin/lattice.mjs's own usageFailure shape). */
|
|
50
50
|
function usageFailure(message) {
|
|
@@ -52,7 +52,7 @@ function usageFailure(message) {
|
|
|
52
52
|
process.exitCode = 2;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
/** Startup-time scrutiny failure — exit 1, one lattice.cli_error.
|
|
55
|
+
/** Startup-time scrutiny failure — exit 1, one lattice.cli_error.v2 JSON line on stderr. */
|
|
56
56
|
function startupFailure(code, message) {
|
|
57
57
|
const payload = { schema: CLI_ERROR_SCHEMA, code, message };
|
|
58
58
|
process.stderr.write(`${JSON.stringify(payload)}\n`);
|
|
@@ -95,12 +95,12 @@ function parseArgs(argv) {
|
|
|
95
95
|
// Node version guard (④) — runs before anything else, including argv
|
|
96
96
|
// parsing, so it also covers the internal daemon re-invoke form (②) which
|
|
97
97
|
// re-execs this exact file. Same semantics as the sensor CLI: nodeMajor >=
|
|
98
|
-
// 25 or < MIN_NODE_MAJOR blocks unless
|
|
98
|
+
// 25 or < MIN_NODE_MAJOR blocks unless LATTICE_SENSOR_ALLOW_UNSAFE_NODE is set,
|
|
99
99
|
// in which case the banner is shown for visibility only and startup
|
|
100
100
|
// continues.
|
|
101
101
|
const nodeVersionGuard = evaluateNodeVersionGuard(
|
|
102
102
|
process.versions.node,
|
|
103
|
-
Boolean(process.env.
|
|
103
|
+
Boolean(process.env.LATTICE_SENSOR_ALLOW_UNSAFE_NODE),
|
|
104
104
|
);
|
|
105
105
|
if (nodeVersionGuard.banner) {
|
|
106
106
|
process.stderr.write(`${nodeVersionGuard.banner}\n`);
|
package/bin/lattice.mjs
CHANGED
|
@@ -1,22 +1,75 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { buildBootstrapDiagnostics } from '../src/bootstrap.mjs';
|
|
4
3
|
import { runRuntimeCli } from '../src/runtime-cli.mjs';
|
|
4
|
+
import { renderCliHelp } from '../src/cli-help.mjs';
|
|
5
5
|
import packageJson from '../package.json' with { type: 'json' };
|
|
6
6
|
|
|
7
7
|
const args = process.argv.slice(2);
|
|
8
|
+
const help = renderCliHelp(args);
|
|
8
9
|
|
|
9
|
-
if (
|
|
10
|
+
if (help !== null) {
|
|
11
|
+
process.stdout.write(help);
|
|
12
|
+
} else if (args.length === 1 && args[0] === '--version') {
|
|
10
13
|
process.stdout.write(`${packageJson.version}\n`);
|
|
11
|
-
} else if (args.length === 2 && args[0] === '
|
|
12
|
-
|
|
14
|
+
} else if (args.length === 2 && args[0] === 'status' && args[1] === '--json') {
|
|
15
|
+
const { projectStatusFailure, runProjectStatus } = await import('../src/project-cli.mjs');
|
|
16
|
+
try {
|
|
17
|
+
process.exitCode = await runProjectStatus({
|
|
18
|
+
cwd: process.cwd(), stdout: process.stdout, cliVersion: packageJson.version, env: process.env,
|
|
19
|
+
});
|
|
20
|
+
} catch (error) {
|
|
21
|
+
process.exitCode = projectStatusFailure({
|
|
22
|
+
cwd: process.cwd(), stdout: process.stdout, cliVersion: packageJson.version, error,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
} else if (args.length === 4 && args[0] === 'plan' && args[1] === 'create' && args[2] === '--input') {
|
|
26
|
+
const { projectCliFailure, runPlanCreate } = await import('../src/project-cli.mjs');
|
|
27
|
+
try {
|
|
28
|
+
process.exitCode = await runPlanCreate({ cwd: process.cwd(), inputRef: args[3], stdout: process.stdout });
|
|
29
|
+
} catch (error) {
|
|
30
|
+
process.exitCode = projectCliFailure(process.stderr, error);
|
|
31
|
+
}
|
|
32
|
+
} else if (args.length === 4 && args[0] === 'plan' && args[1] === 'create'
|
|
33
|
+
&& args[2] === '--schema' && args[3] === '--json') {
|
|
34
|
+
const { projectCliFailure, runPlanCreateSchema } = await import('../src/project-cli.mjs');
|
|
35
|
+
try {
|
|
36
|
+
process.exitCode = await runPlanCreateSchema({ stdout: process.stdout });
|
|
37
|
+
} catch (error) {
|
|
38
|
+
process.exitCode = projectCliFailure(process.stderr, error);
|
|
39
|
+
}
|
|
40
|
+
} else if (args.length === 5 && args[0] === 'plan' && args[1] === 'create'
|
|
41
|
+
&& args[2] === '--schema-version' && ['2', '3'].includes(args[3]) && args[4] === '--json') {
|
|
42
|
+
const { projectCliFailure, runPlanCreateSchema } = await import('../src/project-cli.mjs');
|
|
43
|
+
try {
|
|
44
|
+
process.exitCode = await runPlanCreateSchema({ stdout: process.stdout, version: Number(args[3]) });
|
|
45
|
+
} catch (error) {
|
|
46
|
+
process.exitCode = projectCliFailure(process.stderr, error);
|
|
47
|
+
}
|
|
13
48
|
} else if (args.length === 2 && args[0] === 'factory-diagnostics' && args[1] === '--json') {
|
|
14
49
|
const { buildFactoryDiagnostics } = await import('../src/factory-diagnostics.mjs');
|
|
15
50
|
const diagnostics = await buildFactoryDiagnostics();
|
|
16
51
|
process.stdout.write(`${JSON.stringify(diagnostics)}\n`);
|
|
17
52
|
process.exitCode = diagnostics.overall === 'ok' ? 0 : 1;
|
|
53
|
+
} else if (args[0] === 'sensor') {
|
|
54
|
+
const { runSensorCli } = await import('../src/sensor-cli.mjs');
|
|
55
|
+
process.exitCode = await runSensorCli({
|
|
56
|
+
argv: args.slice(1), stdout: process.stdout, stderr: process.stderr,
|
|
57
|
+
});
|
|
18
58
|
} else if (args[0] === 'runtime-errors') {
|
|
19
59
|
process.exitCode = await runRuntimeErrorsCli(args.slice(1));
|
|
60
|
+
} else if (args[0] === 'todo') {
|
|
61
|
+
const { runTodoCli } = await import('../src/todo-cli.mjs');
|
|
62
|
+
process.exitCode = await runTodoCli({
|
|
63
|
+
argv: args.slice(1),
|
|
64
|
+
cwd: process.cwd(),
|
|
65
|
+
stdout: process.stdout,
|
|
66
|
+
stderr: process.stderr,
|
|
67
|
+
});
|
|
68
|
+
} else if (args[0] === 'bridge') {
|
|
69
|
+
const { runBridgeCli } = await import('../src/bridge-cli.mjs');
|
|
70
|
+
process.exitCode = await runBridgeCli({
|
|
71
|
+
argv: args.slice(1), stdout: process.stdout, stderr: process.stderr, env: process.env,
|
|
72
|
+
});
|
|
20
73
|
} else {
|
|
21
74
|
try {
|
|
22
75
|
process.exitCode = await runRuntimeCli({
|
|
@@ -26,10 +79,10 @@ if (args.length === 1 && args[0] === '--version') {
|
|
|
26
79
|
stderr: process.stderr,
|
|
27
80
|
});
|
|
28
81
|
} catch (error) {
|
|
29
|
-
// typed契約(cli_error.
|
|
82
|
+
// typed契約(cli_error.v2+exit 1/2)の外へ漏れた例外=内部故障。opt-in時のみ観測を残す。
|
|
30
83
|
const { observeRuntimeError } = await import('../src/runtime-errors.mjs');
|
|
31
84
|
observeRuntimeError('LATTICE.CLI_INTERNAL_FAILED', { version: packageJson.version });
|
|
32
|
-
process.stderr.write(`${JSON.stringify({ schema: 'lattice.cli_error.
|
|
85
|
+
process.stderr.write(`${JSON.stringify({ schema: 'lattice.cli_error.v2', code: 'INTERNAL_FAILURE', message: error?.constructor?.name ?? 'Error' })}\n`);
|
|
33
86
|
process.exitCode = 1;
|
|
34
87
|
}
|
|
35
88
|
}
|
|
@@ -37,7 +90,7 @@ if (args.length === 1 && args[0] === '--version') {
|
|
|
37
90
|
async function runRuntimeErrorsCli(rest) {
|
|
38
91
|
const runtimeErrors = await import('../src/runtime-errors.mjs');
|
|
39
92
|
const usage = () => {
|
|
40
|
-
process.stderr.write(`${JSON.stringify({ schema: 'lattice.cli_error.
|
|
93
|
+
process.stderr.write(`${JSON.stringify({ schema: 'lattice.cli_error.v2', code: 'USAGE', message: 'usage: lattice runtime-errors <snapshot [--after-cursor N] [--limit N]|ack <cursor>|diagnostics|resolve <fingerprint>|reopen <fingerprint>|compact> --json' })}\n`);
|
|
41
94
|
return 2;
|
|
42
95
|
};
|
|
43
96
|
const options = { version: packageJson.version };
|
|
@@ -72,7 +125,7 @@ async function runRuntimeErrorsCli(rest) {
|
|
|
72
125
|
process.stdout.write(`${JSON.stringify(result)}\n`);
|
|
73
126
|
return 0;
|
|
74
127
|
} catch (error) {
|
|
75
|
-
process.stderr.write(`${JSON.stringify({ schema: 'lattice.cli_error.
|
|
128
|
+
process.stderr.write(`${JSON.stringify({ schema: 'lattice.cli_error.v2', code: 'RUNTIME_ERRORS_FAILED', message: error?.message ?? 'unknown' })}\n`);
|
|
76
129
|
return 1;
|
|
77
130
|
}
|
|
78
131
|
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Optional network bridge
|
|
2
|
+
|
|
3
|
+
Latticeのproject dashboardは既定でloopbackだけにbindし、bridge用socketや設定を作らない。
|
|
4
|
+
LAN上のreverse proxyなどから閲覧する時だけ、利用者がlisten IPを明示してbridgeを有効化する。
|
|
5
|
+
`postinstall`では質問やnetwork公開を行わない。
|
|
6
|
+
|
|
7
|
+
TTYでは`lattice bridge setup`で安全側既定の対話wizardを開始できる。最初の公開確認は既定で無効を選び、
|
|
8
|
+
cancelした場合は設定を変更しない。非TTYではhangせず、次の非対話commandを案内する。
|
|
9
|
+
portを省略するか`auto`にすると、49152–65535から候補を重複なく選び、
|
|
10
|
+
実際のexclusive bindとhealth確認に成功したportだけを保存する。
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
lattice bridge setup --listen 192.168.1.102 --port auto --dashboard --allow-host lattice.kitepon.dev --json
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
`--dashboard`は現在のlocal dashboard descriptorをrequestごとに解決するため、dashboard再起動でportが変わっても
|
|
17
|
+
bridge設定はstaleにならない。固定upstreamを使う場合だけ`--upstream http://127.0.0.1:4318`を指定する。
|
|
18
|
+
listen IPは常に許可Hostへ入り、reverse proxyで公開するhostnameは`--allow-host`を反復して追加する。
|
|
19
|
+
許可されていないHostは421となるため、DNS rebinding originへ工程情報を返さない。
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
lattice bridge status --json
|
|
23
|
+
lattice bridge reconfigure --listen 192.168.1.102 --port auto --dashboard --json
|
|
24
|
+
lattice bridge disable --json
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
設定は`~/.lattice/bridge.json`へmode 0600でatomic保存する。`setup`/`reconfigure`は実bridge daemonが
|
|
28
|
+
選択socketをexclusive bindしhealthを返すまで成功にしない。起動に失敗した場合は旧設定へ戻す。
|
|
29
|
+
`disable`もbridge socketの停止確認後に成功し、loopbackのlocal dashboardは停止しない。
|
|
30
|
+
configまたはdaemon descriptorが壊れている場合、`disable`は公開socketのfail-closed停止を優先して破損control
|
|
31
|
+
fileを除去し、JSON結果の`recovery`へ処置を明示する。その後は`setup`で再設定できる。
|
|
32
|
+
|
|
33
|
+
自動化・隔離testではabsoluteな`LATTICE_CONFIG_DIR`で設定rootを変更できる。無効な設定、低いport、
|
|
34
|
+
使用中の明示port、危険なrequest target、到達不能upstreamはsilent fallbackせずtyped errorを返す。
|
|
35
|
+
|
|
36
|
+
## Docker Caddy/Cloudflare Tunnelへ接続する
|
|
37
|
+
|
|
38
|
+
bridgeを有効化したMacとreverse proxy hostの間で、まず許可Hostを付けたLAN到達を確認する。
|
|
39
|
+
この段階が失敗している時はDNSやTunnelを追加しない。
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
curl --fail --header 'Host: lattice.example.com' \
|
|
43
|
+
http://MAC_LAN_IP:BRIDGE_PORT/projects/
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Caddyは既存のDocker networkと証明書運用を維持し、Lattice用siteだけを追加する。
|
|
47
|
+
|
|
48
|
+
```caddyfile
|
|
49
|
+
lattice.example.com {
|
|
50
|
+
reverse_proxy MAC_LAN_IP:BRIDGE_PORT {
|
|
51
|
+
flush_interval -1
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
本番反映はcontainer内で`caddy validate`を通してから`caddy reload`する。Caddyfileを単一ファイルで
|
|
57
|
+
bind mountしている構成では、atomic renameでhost側fileを置換するとcontainerが旧inodeを参照し続ける。
|
|
58
|
+
更新前backupを残し、inodeを維持するin-place更新を使うか、directory bind mountへ変更する。
|
|
59
|
+
|
|
60
|
+
remote-managed Cloudflare Tunnelでは、Tunnel実行tokenを設定APIの代用にしない。Cloudflareの正規管理面で
|
|
61
|
+
public hostname `lattice.kitepon.dev` を次のoriginへ対応付ける。
|
|
62
|
+
|
|
63
|
+
- Service: `https://caddy:443`
|
|
64
|
+
- TLS Origin Server Name: `lattice.kitepon.dev`(管理面に同等の設定がある場合は`Match SNI to Host`でもよい)
|
|
65
|
+
|
|
66
|
+
`http://caddy:80`は選ばない。CaddyのHTTPからHTTPSへのredirectをTunnelがorigin応答として返す構成は、
|
|
67
|
+
外部requestが同じ公開URLへ戻るredirect loopになり得るためである。外部gateではredirectを追って200にせず、
|
|
68
|
+
最初の応答がHTTPSの200であることを確認する。
|
|
69
|
+
|
|
70
|
+
受入は次の3 gateを独立して記録し、後段の成功で前段を代用しない。
|
|
71
|
+
|
|
72
|
+
1. **LAN bridge**: reverse proxy hostから許可Host付きで`http://MAC_LAN_IP:BRIDGE_PORT/projects/`が200。
|
|
73
|
+
2. **Docker Caddy**: Caddyへ`Host: lattice.kitepon.dev`を付けたHTTPS requestが200。証明書検証を省略する
|
|
74
|
+
内部probeを外部公開成功の証拠にはしない。
|
|
75
|
+
3. **Cloudflare public HTTPS**: `https://lattice.kitepon.dev/projects/`がredirectなしで200となり、一覧から開いた
|
|
76
|
+
`/projects/<project_id>/`のHTML titleが`Lattice — <project名> 依存工程図`である。
|
|
77
|
+
|
|
78
|
+
外部gateはHTMLだけで閉じず、各projectの
|
|
79
|
+
`https://lattice.kitepon.dev/projects/<project_id>/events`も確認する。応答は200かつ
|
|
80
|
+
`Content-Type: text/event-stream`で、接続直後に`event: state`と現在の`head_digest`を返さなければならない。
|
|
81
|
+
接続を開いたまま正規のTodo更新を行い、新しい`state`が同じstreamへ届くことを確認する。切断後に再接続しても
|
|
82
|
+
再び初回`state`が届き、そのdigestが最新headと一致することまでを継続・再接続gateとする。
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
curl --fail --show-error --include --no-buffer --max-time 15 \
|
|
86
|
+
https://lattice.kitepon.dev/projects/PROJECT_ID/events
|
|
87
|
+
```
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://github.com/kitepon-rgb/Lattice/blob/main/docs/schemas/lattice.plan_create_input.v1.schema.json",
|
|
4
|
+
"title": "lattice.plan_create_input.v1",
|
|
5
|
+
"description": "Canonical initial authoring input for lattice plan create.",
|
|
6
|
+
"$comment": "Runtime validation additionally enforces canonical JSON+LF bytes, strict ordering, unique task ids, graph validity, byte bounds, and input_digest as the canonical self-digest.",
|
|
7
|
+
"type": "object",
|
|
8
|
+
"additionalProperties": false,
|
|
9
|
+
"required": ["schema", "project_id", "plan_key", "plan_version", "actor", "recorded_at", "tasks", "hard_dependencies", "joins", "input_digest"],
|
|
10
|
+
"properties": {
|
|
11
|
+
"schema": { "const": "lattice.plan_create_input.v1" },
|
|
12
|
+
"project_id": { "$ref": "#/$defs/identifier" },
|
|
13
|
+
"plan_key": { "$ref": "#/$defs/identifier" },
|
|
14
|
+
"plan_version": { "$ref": "#/$defs/identifier" },
|
|
15
|
+
"actor": { "$ref": "#/$defs/actor" },
|
|
16
|
+
"recorded_at": { "$ref": "#/$defs/strictTimestamp" },
|
|
17
|
+
"tasks": { "type": "array", "minItems": 1, "maxItems": 512, "items": { "$ref": "#/$defs/task" } },
|
|
18
|
+
"hard_dependencies": { "type": "array", "maxItems": 2048, "items": { "$ref": "#/$defs/edge" } },
|
|
19
|
+
"joins": { "type": "array", "maxItems": 128, "items": { "$ref": "#/$defs/join" } },
|
|
20
|
+
"input_digest": { "$ref": "#/$defs/digest" }
|
|
21
|
+
},
|
|
22
|
+
"$defs": {
|
|
23
|
+
"identifier": { "type": "string", "pattern": "^[0-9A-Za-z](?:[0-9A-Za-z._-]{0,127})$" },
|
|
24
|
+
"digest": { "type": "string", "pattern": "^[0-9a-f]{64}$" },
|
|
25
|
+
"repoRef": { "type": "string", "minLength": 1, "maxLength": 1024, "pattern": "^(?!/)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*\\\\)(?!.*[\\u0000-\\u001f\\u007f])[^/]+(?:/[^/]+)*$" },
|
|
26
|
+
"strictTimestamp": { "type": "string", "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{3}Z$" },
|
|
27
|
+
"nullableRepoRef": { "oneOf": [{ "type": "null" }, { "$ref": "#/$defs/repoRef" }] },
|
|
28
|
+
"nullableIdentifier": { "oneOf": [{ "type": "null" }, { "$ref": "#/$defs/identifier" }] },
|
|
29
|
+
"actor": {
|
|
30
|
+
"type": "object", "additionalProperties": false, "required": ["host", "session", "agent"],
|
|
31
|
+
"properties": { "host": { "$ref": "#/$defs/identifier" }, "session": { "$ref": "#/$defs/identifier" }, "agent": { "$ref": "#/$defs/identifier" } }
|
|
32
|
+
},
|
|
33
|
+
"task": {
|
|
34
|
+
"type": "object", "additionalProperties": false,
|
|
35
|
+
"required": ["task_id", "title", "lane", "narrative_ref", "narrative_anchor", "compile_binding", "parent_task_id"],
|
|
36
|
+
"properties": {
|
|
37
|
+
"task_id": { "$ref": "#/$defs/identifier" }, "title": { "oneOf": [{ "type": "null" }, { "type": "string", "minLength": 1, "maxLength": 16384 }] },
|
|
38
|
+
"lane": { "$ref": "#/$defs/identifier" }, "narrative_ref": { "$ref": "#/$defs/nullableRepoRef" },
|
|
39
|
+
"narrative_anchor": { "type": "null" }, "compile_binding": { "type": "null" },
|
|
40
|
+
"parent_task_id": { "$ref": "#/$defs/nullableIdentifier" }
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"nodeRef": {
|
|
44
|
+
"type": "object", "additionalProperties": false, "required": ["project_id", "plan_key", "task_id"],
|
|
45
|
+
"properties": { "project_id": { "$ref": "#/$defs/identifier" }, "plan_key": { "$ref": "#/$defs/identifier" }, "task_id": { "$ref": "#/$defs/identifier" }, "expected_topology_digest": { "$ref": "#/$defs/digest" } }
|
|
46
|
+
},
|
|
47
|
+
"edge": {
|
|
48
|
+
"type": "object", "additionalProperties": false, "required": ["from", "to"],
|
|
49
|
+
"properties": { "from": { "$ref": "#/$defs/nodeRef" }, "to": { "$ref": "#/$defs/nodeRef" } }
|
|
50
|
+
},
|
|
51
|
+
"join": {
|
|
52
|
+
"type": "object", "additionalProperties": false, "required": ["id", "after", "before"],
|
|
53
|
+
"properties": { "id": { "$ref": "#/$defs/identifier" }, "after": { "type": "array", "minItems": 1, "maxItems": 512, "items": { "$ref": "#/$defs/nodeRef" } }, "before": { "$ref": "#/$defs/nodeRef" } }
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|