ltcai 8.1.0 → 8.3.0

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.
Files changed (123) hide show
  1. package/README.md +29 -48
  2. package/docs/CHANGELOG.md +70 -874
  3. package/docs/COMMUNITY_AND_PLUGINS.md +43 -0
  4. package/docs/DEVELOPMENT.md +26 -3
  5. package/docs/LEGACY_COMPATIBILITY.md +23 -1
  6. package/docs/ONBOARDING.md +38 -0
  7. package/docs/TRUST_MODEL.md +26 -26
  8. package/docs/WHY_LATTICE.md +29 -25
  9. package/docs/kg-schema.md +7 -5
  10. package/lattice_brain/__init__.py +1 -1
  11. package/lattice_brain/graph/ingest.py +40 -8
  12. package/lattice_brain/graph/schema.py +6 -0
  13. package/lattice_brain/runtime/agent_runtime.py +22 -37
  14. package/lattice_brain/runtime/multi_agent.py +1 -1
  15. package/lattice_brain/workflow.py +26 -1
  16. package/latticeai/__init__.py +1 -1
  17. package/latticeai/api/computer_use.py +2 -0
  18. package/latticeai/api/knowledge_graph.py +33 -0
  19. package/latticeai/api/local_files.py +2 -0
  20. package/latticeai/api/memory.py +13 -0
  21. package/latticeai/api/tools.py +1 -0
  22. package/latticeai/api/workflow_designer.py +5 -4
  23. package/latticeai/app_factory.py +30 -28
  24. package/latticeai/brain/__init__.py +1 -1
  25. package/latticeai/core/config.py +10 -0
  26. package/latticeai/core/legacy_compatibility.py +174 -0
  27. package/latticeai/core/marketplace.py +1 -1
  28. package/latticeai/core/tool_registry.py +10 -0
  29. package/latticeai/core/workspace_graph_trace.py +132 -0
  30. package/latticeai/core/workspace_memory.py +75 -0
  31. package/latticeai/core/workspace_os.py +135 -1283
  32. package/latticeai/core/workspace_os_utils.py +132 -0
  33. package/latticeai/core/workspace_permissions.py +99 -0
  34. package/latticeai/core/workspace_plugins.py +97 -0
  35. package/latticeai/core/workspace_runs.py +612 -0
  36. package/latticeai/core/workspace_skills.py +114 -0
  37. package/latticeai/core/workspace_snapshots.py +195 -0
  38. package/latticeai/core/workspace_timeline.py +107 -0
  39. package/latticeai/runtime/audit_runtime.py +64 -0
  40. package/latticeai/runtime/config_runtime.py +4 -0
  41. package/latticeai/runtime/sso_runtime.py +52 -0
  42. package/latticeai/services/architecture_readiness.py +37 -3
  43. package/latticeai/services/memory_service.py +215 -7
  44. package/latticeai/services/model_capability_registry.py +68 -0
  45. package/latticeai/services/model_engines.py +594 -0
  46. package/latticeai/services/model_loading.py +482 -0
  47. package/latticeai/services/model_recommendation.py +5 -0
  48. package/latticeai/services/model_runtime.py +131 -875
  49. package/latticeai/services/product_readiness.py +41 -18
  50. package/llm_router.py +7 -28
  51. package/mcp_registry.py +7 -24
  52. package/package.json +1 -1
  53. package/scripts/pts-claudecode-discord-bridge.mjs +2 -1
  54. package/src-tauri/Cargo.lock +1 -1
  55. package/src-tauri/Cargo.toml +1 -1
  56. package/src-tauri/tauri.conf.json +1 -1
  57. package/static/app/asset-manifest.json +11 -11
  58. package/static/app/assets/{Act-BOO66G-c.js → Act-D5mo4tE4.js} +1 -1
  59. package/static/app/assets/{Brain-C6lEYiD7.js → Brain-BVWyQw8A.js} +1 -1
  60. package/static/app/assets/{Capture-TATXBRDw.js → Capture-C1R6GT0t.js} +1 -1
  61. package/static/app/assets/{Library-DK4FIp8a.js → Library-C2wIxpTs.js} +1 -1
  62. package/static/app/assets/{System-Bgs6Ql7x.js → System-DE5GRyQR.js} +1 -1
  63. package/static/app/assets/index-CoiuIFFP.js +16 -0
  64. package/static/app/assets/index-ty1iGgZu.css +2 -0
  65. package/static/app/assets/{primitives-B70WOra0.js → primitives-BdsUNXa6.js} +1 -1
  66. package/static/app/assets/{textarea-Czrd9gwM.js → textarea-e7qaj6Hm.js} +1 -1
  67. package/static/app/index.html +2 -2
  68. package/static/sw.js +1 -1
  69. package/tools/__init__.py +2 -1
  70. package/tools/computer.py +21 -0
  71. package/docs/CARRYOVER_AUDIT_v3.6.0.md +0 -61
  72. package/docs/HANDOVER_v3.6.0.md +0 -46
  73. package/docs/RUNTIME_HOOK_COVERAGE_v3.5.0.md +0 -56
  74. package/docs/RUNTIME_HOOK_COVERAGE_v3.6.0.md +0 -49
  75. package/docs/V2_ARCHITECTURE.md +0 -561
  76. package/docs/V3_2_AUDIT.md +0 -82
  77. package/docs/V3_BACKEND_ARCHITECTURE.md +0 -138
  78. package/docs/V3_FRONTEND.md +0 -146
  79. package/docs/V4_1_FRONTEND_ARCHITECTURE_REVIEW.md +0 -65
  80. package/docs/V4_1_FRONTEND_MIGRATION_REPORT.md +0 -70
  81. package/docs/V4_1_VALIDATION_REPORT.md +0 -47
  82. package/docs/V4_2_BRAIN_CORE_ARCHITECTURE.md +0 -97
  83. package/docs/V4_2_STORAGE_MIGRATION_REPORT.md +0 -91
  84. package/docs/V4_2_VALIDATION_REPORT.md +0 -89
  85. package/docs/V4_3_2_DEADCODE_AUDIT_REPORT.md +0 -174
  86. package/docs/V4_3_2_DOCUMENTATION_CLEANUP_REPORT.md +0 -81
  87. package/docs/V4_3_2_GITHUB_VERCEL_CHECK_REPORT.md +0 -75
  88. package/docs/V4_3_2_GRAPH_UX_REPORT.md +0 -48
  89. package/docs/V4_3_2_INDEPENDENT_AUDIT_PACKAGE.md +0 -209
  90. package/docs/V4_3_2_PRODUCT_POLISH_REPORT.md +0 -57
  91. package/docs/V4_3_2_SELF_AUDIT_REPORT.md +0 -63
  92. package/docs/V4_3_2_VALIDATION_REPORT.md +0 -97
  93. package/docs/V4_3_3_VALIDATION_REPORT.md +0 -46
  94. package/docs/V4_3_PORTABILITY_ARCHITECTURE.md +0 -69
  95. package/docs/V4_3_PRIVACY_AUDIT.md +0 -60
  96. package/docs/V4_3_PRODUCT_HARDENING_REPORT.md +0 -53
  97. package/docs/V4_3_VALIDATION_REPORT.md +0 -58
  98. package/docs/V4_4_0_EXTRACTION_REPORT.md +0 -239
  99. package/docs/V4_5_0_GEMMA_RUNTIME_COMPATIBILITY_REPORT.md +0 -49
  100. package/docs/V4_5_0_GRAPH_UX_REPORT.md +0 -34
  101. package/docs/V4_5_0_MODEL_RUNTIME_UX_REPORT.md +0 -40
  102. package/docs/V4_5_0_ONBOARDING_REPORT.md +0 -31
  103. package/docs/V4_5_0_PRODUCT_EXPERIENCE_RECOVERY_REPORT.md +0 -49
  104. package/docs/V4_5_0_VALIDATION_REPORT.md +0 -60
  105. package/docs/V4_5_1_GRAPH_EXPERIENCE_REPORT.md +0 -33
  106. package/docs/V4_5_1_MODEL_EXPERIENCE_REPORT.md +0 -37
  107. package/docs/V4_5_1_NAVIGATION_REPORT.md +0 -37
  108. package/docs/V4_5_1_ONBOARDING_REPORT.md +0 -29
  109. package/docs/V4_5_1_PRODUCT_REIMAGINING_REPORT.md +0 -61
  110. package/docs/V4_5_1_RC_ARTIFACTS.md +0 -44
  111. package/docs/V4_5_1_UX_REPORT.md +0 -45
  112. package/docs/V4_5_1_VALIDATION_REPORT.md +0 -55
  113. package/docs/V4_5_1_VISUAL_DESIGN_REPORT.md +0 -30
  114. package/docs/V4_6_0_LIVING_BRAIN_EXPERIENCE_REPORT.md +0 -72
  115. package/docs/V4_6_1_RELEASE_REFRESH_REPORT.md +0 -42
  116. package/docs/V4_7_0_ADMIN_SEPARATION_REPORT.md +0 -42
  117. package/docs/V4_7_1_ADMIN_OPERATIONS_REPORT.md +0 -49
  118. package/docs/V4_7_2_INTUITIVE_BRAIN_UX_REPORT.md +0 -62
  119. package/docs/V4_BRAIN_ARCHITECTURE.md +0 -322
  120. package/docs/V4_DIGITAL_BRAIN_RECOVERY.md +0 -555
  121. package/docs/V4_IMPLEMENTATION_PLAN.md +0 -470
  122. package/static/app/assets/index-Bvv79nre.js +0 -16
  123. package/static/app/assets/index-Dslqglia.css +0 -2
@@ -1,561 +0,0 @@
1
- # Lattice AI v2 Architecture — AI Workspace, Pipeline, and Workflow Platform
2
-
3
- Lattice AI v2.0.0 introduced the local-first AI workspace, AI pipeline,
4
- Knowledge Graph, and multi-agent workflow foundation. v2.2.1 keeps that
5
- architecture and matures the operational layer: explicit handoffs, context
6
- packets, review/retry loops, durable context snapshots, planning records,
7
- replay, marketplace templates, and realtime workflow observability all compose
8
- over the same local-first JSON store and Knowledge Graph.
9
-
10
- This document describes how the v2 platform pillars fit together, the small set of
11
- **additive integration seams** that wire them, the cross-integration matrix that
12
- results, and the compatibility surfaces that v1.x callers and data keep relying
13
- on. Every claim below is grounded in the shipping source:
14
-
15
- - App assembly: `latticeai/server_app.py`
16
- - Cross-system wiring: `latticeai/services/platform_runtime.py`
17
- - State + persistence: `latticeai/core/workspace_os.py`
18
- - Plugin SDK: `latticeai/core/plugins.py`, `latticeai/api/plugins.py`
19
- - Workflow engine: `latticeai/core/workflow_engine.py`, `latticeai/api/workflow_designer.py`
20
- - Multi-Agent runtime: `latticeai/core/multi_agent.py`, `latticeai/api/agents.py`
21
- - Realtime bus: `latticeai/core/realtime.py`, `latticeai/api/realtime.py`
22
- - Marketplace foundation: `latticeai/core/marketplace.py`, `latticeai/api/marketplace.py`
23
- - Project conventions: `AGENTS.md`
24
-
25
- All v2 subsystems share the same design rules from `AGENTS.md`: dependency
26
- injection, explicit interfaces, small focused modules, registry-based dispatch,
27
- and composition over global state. None of them import the FastAPI app; each is
28
- constructed by `server_app.py` and exposed through a router factory.
29
-
30
- ---
31
-
32
- ## 1. The v2 Platform Pillars
33
-
34
- The platform version is the single source of truth `WORKSPACE_OS_VERSION =
35
- "2.2.0"` (`latticeai/core/workspace_os.py`). Each pillar module re-declares the
36
- same version for its own surface (`PLUGIN_SDK_VERSION`, `WORKFLOW_ENGINE_VERSION`,
37
- `MULTI_AGENT_VERSION`, `REALTIME_VERSION`) and the marketplace foundation exposes
38
- `MARKETPLACE_VERSION`.
39
-
40
- ### 1.1 Plugin SDK (`latticeai.core.plugins`)
41
-
42
- A plugin is a directory under the configured plugins root that ships a
43
- `plugin.json` manifest and **extends** the existing Skill / Tool / Workflow
44
- surfaces rather than replacing them. Installed standalone skills keep working
45
- untouched; a plugin simply *bundles* skills and declares tools / workflow
46
- templates / actions under one versioned, permissioned unit.
47
-
48
- Design rules enforced by the module: no import-time I/O (the filesystem is only
49
- touched on `discover()`), no FastAPI and no globals (lifecycle state lives in the
50
- workspace store), and permissions are an allow-list — the execution boundary
51
- refuses any capability a plugin did not declare *and* was not granted.
52
-
53
- A validated `plugin.json` manifest:
54
-
55
- ```json
56
- {
57
- "id": "release-notes",
58
- "name": "Release Notes Assistant",
59
- "version": "1.0.0",
60
- "description": "Bundles a release-notes skill and a packaging workflow.",
61
- "author": "you@example.com",
62
- "lattice_version": ">=2.0.0",
63
- "permissions": ["read_workspace", "run_skills", "run_workflows"],
64
- "provides": {
65
- "skills": ["release-notes"],
66
- "workflows": ["package-and-tag"],
67
- "tools": [],
68
- "actions": []
69
- },
70
- "entrypoint": "",
71
- "homepage": ""
72
- }
73
- ```
74
-
75
- Constraints from `validate_manifest` and the module constants:
76
-
77
- - `id`: lowercase alphanumeric with `-`/`_`, 2–64 chars (`_ID_RE`).
78
- - `version`: semantic version (`_SEMVER_RE`).
79
- - `permissions` ⊆ `PLUGIN_PERMISSIONS` = `read_workspace`, `write_workspace`,
80
- `read_graph`, `write_graph`, `run_tools`, `run_skills`, `run_workflows`,
81
- `run_agents`, `network`, `manage_memory`.
82
- - `provides` keys ⊆ `PLUGIN_PROVIDES` = `skills`, `tools`, `workflows`,
83
- `actions`; each value is a list.
84
- - `lattice_version` is a minimum (major must match host, host must be `>=`),
85
- checked by `is_compatible(required, current=PLUGIN_SDK_VERSION)`.
86
-
87
- The permissioned execution boundary:
88
-
89
- ```python
90
- def execute_action(
91
- self,
92
- plugin_id: str,
93
- action: str,
94
- args: Optional[Dict[str, Any]] = None,
95
- *,
96
- runners: Optional[Dict[str, Callable[..., Any]]] = None,
97
- ) -> PluginExecutionResult: ...
98
- ```
99
-
100
- `execute_action` maps an action to the capability + permission it needs
101
- (`run_tool→tools/run_tools`, `run_skill→skills/run_skills`,
102
- `run_workflow→workflows/run_workflows`, `run_agent→agents/run_agents`). It
103
- returns a `PluginExecutionResult` with `status` in `ok | blocked | error |
104
- skipped`:
105
-
106
- - `blocked` if the plugin is not enabled, did not declare the required
107
- permission, or the permission was not granted at install time.
108
- - `skipped` if the host injected no runner for the capability (never crashes the
109
- caller — safe-by-default).
110
- - `error` if the runner raised; `ok` otherwise.
111
-
112
- ### 1.2 Workflow Designer (`latticeai.core.workflow_engine`)
113
-
114
- A workflow is a small directed graph of typed *nodes* starting from a `trigger`.
115
- `NODE_TYPES` = `trigger`, `tool`, `skill`, `plugin`, `agent`, `condition`,
116
- `output`. The engine walks the graph from the trigger, dispatching each
117
- executable node to an injected runner and recording a step-by-step timeline so a
118
- run can be inspected, replayed, and linked into the Workspace timeline and
119
- Knowledge Graph.
120
-
121
- Key safety properties baked into the engine:
122
-
123
- - **Bounded execution.** `_MAX_STEPS = 100` is a hard cap, so a mis-wired `next`
124
- cycle can never hang a run; exceeding it records a `guard` error.
125
- - **Graceful degradation.** A node whose runner family is not wired is recorded
126
- as `skipped` with a reason rather than failing the whole run; the run status
127
- becomes `partial`.
128
- - **No `eval`.** `condition` nodes use `_evaluate_condition`, which compares a
129
- context value to a literal via a fixed op set (`==`, `!=`, `>`, `<`, `>=`,
130
- `<=`, `contains`, `truthy`) and fails closed onto the `false` branch.
131
-
132
- ```python
133
- class WorkflowEngine:
134
- def __init__(self, runners: Optional[Dict[str, Callable[..., Any]]] = None): ...
135
- def run(self, workflow: Dict[str, Any], *, inputs: Optional[Dict[str, Any]] = None) -> WorkflowRun: ...
136
- ```
137
-
138
- A run yields a `WorkflowRun` with `status` in `ok | failed | partial`, a
139
- `timeline`, and `outputs`. `export_workflow` / `import_workflow` provide a
140
- portable JSON representation (definition only — no run history or scope).
141
-
142
- ### 1.3 Multi-Agent Runtime 2.0 (`latticeai.core.multi_agent`)
143
-
144
- v1.x shipped a single-agent state machine (`latticeai.core.agent.SingleAgentRuntime`;
145
- `latticeai.core.agent.AgentRuntime` remains a compatibility alias) that drives
146
- PLAN → EXECUTE → VERIFY → DONE. v2.0 adds the **orchestration** layer above it:
147
- a pipeline of named roles that hand off to one another, retry on a failing
148
- review, and emit a structured timeline that drops straight into the Workspace
149
- timeline / Knowledge Graph.
150
-
151
- `AGENT_ROLES` = `researcher`, `planner`, `executor`, `reviewer`, `release`. The
152
- `CORE_PIPELINE` is `planner → executor → reviewer`; `researcher` and `release`
153
- are optional stages. Role ids match `DEFAULT_AGENTS` in
154
- `latticeai/core/workspace_os.py` (`agent:planner`, `agent:executor`,
155
- `agent:reviewer`, `agent:researcher`, `agent:release`).
156
-
157
- ```python
158
- class MultiAgentOrchestrator:
159
- def __init__(self, role_runner: Optional[Callable[[str, OrchestrationContext], Dict[str, Any]]] = None): ...
160
- def run(
161
- self,
162
- goal: str,
163
- *,
164
- user_email: Optional[str] = None,
165
- workspace_id: Optional[str] = None,
166
- inputs: Optional[Dict[str, Any]] = None,
167
- roles: Optional[List[str]] = None,
168
- max_retries: int = 2,
169
- ) -> AgentRunResult: ...
170
- ```
171
-
172
- Like the v1 runtime, the orchestrator is pure logic over an injected
173
- `role_runner` port, so it runs with no LLM and no server. `default_role_runner`
174
- is deterministic and genuinely useful: the `researcher` pulls workspace context,
175
- the `planner` decomposes the goal, the `executor` carries out steps (and can
176
- drive an injected `workflow_runner` / `plugin_runner`), and the `reviewer`
177
- returns `pass` / `retry`. The reviewer can rewind the pipeline to the executor up
178
- to `max_retries` times; the final `status` is `ok`, `retried_ok`, or `failed`.
179
-
180
- v2.2.0 matures that orchestration with first-class `AgentHandoff` and
181
- `AgentContextPacket` records, structured plan review, retry history, memory
182
- snapshots, and replay frames. Handoffs are workspace-scoped and persisted with
183
- source/target agents, task summary, reason, status, timestamps, and redacted
184
- context so a run can be inspected after the fact instead of inferred from a flat
185
- log.
186
-
187
- ### 1.4 Realtime Collaboration (`latticeai.core.realtime`)
188
-
189
- An in-process pub/sub bus, presence registry, and activity feed delivered over
190
- Server-Sent Events (SSE). SSE is chosen deliberately: the codebase already
191
- streams model output over SSE, it needs no extra dependency, and it works through
192
- the existing single-port local-first deployment.
193
-
194
- Guarantees from the module:
195
-
196
- - **Single-user local mode keeps working.** Publishing with zero subscribers is
197
- a no-op; a `_FEED_LIMIT`-bounded ring buffer is still maintained so a late
198
- subscriber catches up via `recent()` / a replay tail on `stream()`.
199
- - **Workspace isolation preserved.** Every event carries `workspace_id`; a
200
- subscriber only receives events whose workspace is in its allowed scope set.
201
- A `None` scope (personal / local view) sees unscoped + personal events.
202
- - **Backpressure-safe.** Per-subscriber queues are bounded (`_QUEUE_MAX`); on
203
- overflow the oldest event is dropped rather than blocking the publisher.
204
-
205
- ```python
206
- class RealtimeBus:
207
- def publish(self, event: Dict[str, Any]) -> Dict[str, Any]: ...
208
- def __call__(self, event: Dict[str, Any]) -> Dict[str, Any]: # stable event_sink alias
209
- return self.publish(event)
210
- ```
211
-
212
- ### 1.5 Marketplace Foundation (`latticeai.core.marketplace`)
213
-
214
- v2.2.0 adds a local marketplace foundation rather than a cloud marketplace
215
- service. `TemplateCatalog` manages Plugin, Workflow, and Agent templates with
216
- metadata, export/import, install hooks, and a template registry stored through
217
- workspace. Marketplace templates are local extension points for the existing
218
- Plugin SDK, Workflow Engine, and Multi-Agent Runtime; they do not bypass plugin
219
- permissions, workflow execution guards, or workspace scoping.
220
-
221
- ---
222
-
223
- ## 2. How the Pillars Compose Into One Platform
224
-
225
- The v2 platform pillars are not parallel silos. They are stitched into one platform by
226
- exactly **three additive seams**, all introduced without changing any existing
227
- behavior.
228
-
229
- ### Seam 1 — Additive state keys with deep-merge backfill
230
-
231
- `WorkspaceOSStore._default_state()` adds new top-level keys to the local-first
232
- JSON state, including **`plugin_registry`** (an object, mirroring
233
- `skill_registry`), **`workflow_runs`** (a list, alongside the existing
234
- `workflows`), **`handoffs`**, **`memory_snapshots`**, and
235
- **`template_registry`**. The default state also adds v2 feature flags
236
- (`plugin_sdk`, `workflow_designer`, `multi_agent_runtime`,
237
- `realtime_collaboration`, `agent_handoff`, `agent_context_packets`,
238
- `review_retry_loop`, `timeline_replay`, `marketplace_foundation`, and related
239
- agent memory/planning flags) plus platform navigation areas.
240
-
241
- These are safe for existing data because `load_state()` runs `_deep_merge(default,
242
- loaded)` on every load. `_deep_merge` walks the default tree and fills in any key
243
- missing from the loaded file while preserving every value already present:
244
-
245
- ```python
246
- def _deep_merge(default: Any, loaded: Any) -> Any:
247
- if isinstance(default, dict) and isinstance(loaded, dict):
248
- merged = {key: _deep_merge(value, loaded.get(key)) for key, value in default.items()}
249
- for key, value in loaded.items():
250
- if key not in merged:
251
- merged[key] = value
252
- return merged
253
- if loaded is None:
254
- return default
255
- return loaded
256
- ```
257
-
258
- A v1.x `workspace_os.json` that has none of these newer keys is therefore
259
- upgraded *in memory* on first load — the new keys are backfilled with their
260
- defaults, every pre-existing snapshot, trace, memory, agent run, workflow, and
261
- skill entry is preserved, and the file is only rewritten on the next normal
262
- `save_state`. Plugin lifecycle helpers, workflow-run helpers, handoff helpers,
263
- memory snapshot helpers, and marketplace template helpers operate on these keys,
264
- deliberately mirroring the existing skill-registry and workflow-history
265
- contracts.
266
-
267
- ### Seam 2 — A single `event_sink` on `record_timeline_event`
268
-
269
- `WorkspaceOSStore.__init__` takes one optional `event_sink` hook. Every state
270
- mutation in the store already funnels through `record_timeline_event(area,
271
- event_type, payload, workspace_id)`. v2.0 adds a single best-effort call at the
272
- end of that method:
273
-
274
- ```python
275
- def record_timeline_event(self, area, event_type, payload, workspace_id=None):
276
- ...
277
- state.setdefault("timeline", []).append(event)
278
- state["timeline"] = state["timeline"][-500:]
279
- self.save_state(state)
280
- if self.event_sink is not None:
281
- try:
282
- self.event_sink(event)
283
- except Exception:
284
- # Realtime delivery is best-effort and must never break a write.
285
- pass
286
- return event
287
- ```
288
-
289
- In `server_app.py` the bus is constructed first and injected as that sink:
290
-
291
- ```python
292
- REALTIME_BUS = RealtimeBus()
293
- WORKSPACE_OS = WorkspaceOSStore(DATA_DIR, event_sink=REALTIME_BUS)
294
- ```
295
-
296
- Because `RealtimeBus.__call__` aliases `publish`, **every** timeline event —
297
- workspace, snapshot, memory, graph trace, agent run, workflow run, plugin
298
- install/enable, skill change, onboarding, presence — fans into the realtime feed
299
- automatically. There is no per-call instrumentation and no duplicated event
300
- system. The hook defaults to `None`, so existing callers and tests see zero
301
- behavior change.
302
-
303
- ### Seam 3 — `PlatformRuntime` as the one cross-wiring point
304
-
305
- `latticeai/services/platform_runtime.py` is the single place the v2 subsystems
306
- cross-wire to one another and to the workspace. Keeping it out of `server_app`
307
- honours the `AGENTS.md` preference for small, composable, independently testable
308
- modules; `server_app` only constructs it and mounts routers.
309
-
310
- ```python
311
- PLATFORM = PlatformRuntime(
312
- store=WORKSPACE_OS,
313
- workspace_service=WORKSPACE_SERVICE,
314
- plugin_registry=PLUGIN_REGISTRY,
315
- get_current_user=get_current_user,
316
- workspace_graph=_workspace_graph,
317
- workspace_scope_from_request=_workspace_scope_from_request,
318
- get_tool_permission=get_tool_permission,
319
- )
320
- ```
321
-
322
- `PlatformRuntime` provides:
323
-
324
- - **Request gating** — `gate_read` / `gate_write` resolve a caller's workspace
325
- scope via `WorkspaceService` (raising `403` on `PermissionError`), and
326
- `allowed_scopes` returns the set of workspaces a user may see (used by the
327
- realtime router).
328
- - **Plugin lifecycle hooks** — `register_plugin_skill` marks a bundled skill
329
- installed in the shared skill registry (`version="plugin:<id>"`), so plugins
330
- extend the existing skill surface instead of owning a parallel one.
331
- - **Shared node runners** — `_tool_node_runner`, `_skill_node_runner`,
332
- `_plugin_node_runner`, `_agent_node_runner`, plus `plugin_capability_runners`
333
- (the runner map the Plugin SDK boundary dispatches to) and `_context_provider`
334
- (feeds workspace memory to the agent researcher role).
335
- - **Cross-system runs** — `run_workflow_by_id` and `run_agent`, plus the
336
- factories `build_workflow_runners`, `build_orchestrator`, and
337
- `plugin_capability_runners` that are handed to the routers.
338
-
339
- The v2 routers are wired entirely through `PLATFORM`:
340
-
341
- ```python
342
- app.include_router(create_plugins_router(
343
- registry=PLUGIN_REGISTRY,
344
- register_skill=PLATFORM.register_plugin_skill,
345
- plugin_runners_factory=lambda: PLATFORM.plugin_capability_runners(None, None),
346
- ...
347
- ))
348
- app.include_router(create_workflow_designer_router(
349
- store=WORKSPACE_OS,
350
- gate_read=PLATFORM.gate_read, gate_write=PLATFORM.gate_write,
351
- build_runners=PLATFORM.build_workflow_runners,
352
- ...
353
- ))
354
- app.include_router(create_agents_router(
355
- store=WORKSPACE_OS,
356
- orchestrator_factory=PLATFORM.build_orchestrator,
357
- gate_read=PLATFORM.gate_read, gate_write=PLATFORM.gate_write,
358
- ...
359
- ))
360
- app.include_router(create_realtime_router(
361
- bus=REALTIME_BUS,
362
- allowed_scopes=PLATFORM.allowed_scopes,
363
- ...
364
- ))
365
- ```
366
-
367
- ---
368
-
369
- ## 3. Cross-Integration Matrix
370
-
371
- Because of the seams above, the subsystems can drive one another. The following
372
- capabilities are all backed by `PlatformRuntime` runners and the engines:
373
-
374
- | From | Can run | Wired by |
375
- | --- | --- | --- |
376
- | **Workflow** node | `tool`, `skill`, `plugin`, `agent` | `build_workflow_runners` → `_tool_node_runner`, `_skill_node_runner`, `_plugin_node_runner`, `_agent_node_runner` |
377
- | **Agent** run (executor role) | `plugin`, `workflow` | `build_orchestrator` / `run_agent` inject `workflow_runner` + `plugin_runner` into `default_role_runner` |
378
- | **Plugin** action | `skill`, `tool`, `workflow`, `agent` | `plugin_capability_runners` → `run_skill`, `run_tool`, `run_workflow`, `run_agent` |
379
- | **Any timeline event** | Realtime feed | `event_sink` → `RealtimeBus.publish` (Seam 2) |
380
- | **Graph entities** | Link to `workflow_runs`, `agent_runs` (and workflows, memories) | `record_workflow_run`, `record_agent_run`, `create_workflow` call `graph.ingest_event` and store the returned `graph_node_id` |
381
- | **Workspace timeline** | Reflects all activity | every store mutation calls `record_timeline_event`; `timeline()` also re-projects snapshots, traces, agent runs, and workflows |
382
-
383
- Concrete flows:
384
-
385
- - **Workflow → tool/skill/plugin/agent.** The Workflow Designer `run` endpoint
386
- builds the runner map from `PLATFORM.build_workflow_runners(user, scope)` and
387
- passes it to `WorkflowEngine`. A `tool` node records the invocation plus its
388
- governance decision (via `get_tool_permission`) but never silently executes
389
- exec/destructive tools. A `plugin` node calls `registry.execute_action(...)`
390
- through the permission boundary. An `agent` node calls `run_agent(...,
391
- with_workflow=False)`.
392
-
393
- - **Agent → plugin/workflow.** `run_agent` constructs `default_role_runner` with
394
- a `workflow_runner` (`run_workflow_by_id(..., with_agent=False)`) and a
395
- `plugin_runner` (`registry.execute_action(pid, "run_skill", ...)`), so the
396
- executor role can drive both. The result is persisted with
397
- `store.record_agent_run`.
398
-
399
- - **Plugin → workflow/agent.** `plugin_capability_runners` exposes `run_workflow`
400
- (delegates to `run_workflow_by_id(..., with_agent=False)`) and `run_agent`
401
- (delegates to `run_agent(..., with_workflow=False)`), each gated by the
402
- plugin's declared permission.
403
-
404
- - **Graph linkage.** When the Knowledge Graph is enabled, `record_workflow_run`
405
- ingests a `WorkflowRun` node, `record_agent_run` ingests an `AgentRun` node,
406
- and `create_workflow` ingests a `Workflow` node — each storing the returned
407
- `graph_node_id` on the record so runs are navigable from the graph and via the
408
- Relationship Explorer.
409
-
410
- - **Unified timeline.** `WorkspaceOSStore.timeline()` merges live timeline events
411
- with re-projected snapshots, answer traces, agent runs, and workflows (and
412
- optional audit events), all scope-filtered, giving one chronological view of
413
- every subsystem's activity.
414
-
415
- ---
416
-
417
- ## 4. Recursion Bounding
418
-
419
- Cross-system runs could in principle recurse forever (workflow runs an agent that
420
- runs a workflow that runs an agent…). v2.0 bounds recursion **by construction** in
421
- `PlatformRuntime`, not by a runtime depth counter:
422
-
423
- - A workflow's **`agent` node** runs an orchestrator built *without* a workflow
424
- runner. In `run_agent` the workflow node path calls
425
- `run_agent(..., with_workflow=False)`, so `default_role_runner` receives
426
- `workflow_runner=None`.
427
- - An orchestrator's **workflow runner** runs an engine built *without* an `agent`
428
- runner. `run_workflow_by_id(..., with_agent=False)` assembles the runner map
429
- with only `tool`, `skill`, and `plugin` — no `agent` key — so the
430
- `WorkflowEngine` skips any `agent` node it encounters.
431
-
432
- The deepest possible chains are therefore:
433
-
434
- ```text
435
- agent → workflow → (tool | skill | plugin)
436
- workflow → agent → plugin
437
- ```
438
-
439
- Independently, the `WorkflowEngine` enforces `_MAX_STEPS = 100` per run as a hard
440
- cap against `next`-pointer cycles, and `MultiAgentOrchestrator` caps reviewer
441
- retries via `max_retries` (clamped to 0–5 in the agents router). Together these
442
- guarantee every cross-system run terminates.
443
-
444
- ---
445
-
446
- ## 5. HTTP Surface (v2 additions)
447
-
448
- All v2 routes are namespaced so they never collide with existing paths
449
- (`/plugins/registry` vs. the marketplace `/plugins/directory`; `/workflows` vs.
450
- `/workspace/workflows`; `/agents` plural vs. the single-agent `/agent`).
451
-
452
- **Plugin SDK** (`latticeai/api/plugins.py`): `GET /plugins/sdk`,
453
- `GET /plugins/registry`, `GET /plugins/registry/{plugin_id}`,
454
- `POST /plugins/validate`, `POST /plugins/install` (admin),
455
- `POST /plugins/uninstall` (admin), `POST /plugins/enable`,
456
- `POST /plugins/disable`, `POST /plugins/execute`.
457
-
458
- **Workflow Designer** (`latticeai/api/workflow_designer.py`): `GET /workflows`,
459
- `GET|POST /workflows/api/definitions`, `GET|PATCH
460
- /workflows/api/definitions/{id}`, `POST /workflows/api/validate`,
461
- `POST /workflows/api/definitions/{id}/run`,
462
- `GET /workflows/api/definitions/{id}/runs`, `GET /workflows/api/runs`,
463
- `GET /workflows/api/runs/{run_id}/replay`,
464
- `GET /workflows/api/export/{id}`, `POST /workflows/api/import`.
465
-
466
- **Multi-Agent Runtime** (`latticeai/api/agents.py`): `GET /agents`,
467
- `GET /agents/api/roles`, `GET /agents/api/runs`,
468
- `GET /agents/api/runs/{run_id}/replay`, `GET /agents/api/handoffs`,
469
- `GET|POST /agents/api/memory/snapshots`, `POST /agents/api/run`.
470
-
471
- **Marketplace foundation** (`latticeai/api/marketplace.py`):
472
- `GET /marketplace/templates`, `GET /marketplace/templates/{kind}/{id}/export`,
473
- `POST /marketplace/templates/import`, `POST /marketplace/templates/install`,
474
- `GET /marketplace/templates/registry`.
475
-
476
- **Realtime Collaboration** (`latticeai/api/realtime.py`): `GET /activity`,
477
- `GET /realtime/stream` (SSE), `GET /realtime/feed`, `GET /realtime/presence`,
478
- `POST /realtime/presence/join`, `POST /realtime/presence/leave`.
479
-
480
- Representative run request/response (Workflow Designer):
481
-
482
- ```json
483
- // POST /workflows/api/definitions/{workflow_id}/run
484
- { "inputs": { "steps": ["analyze", "package"] } }
485
- ```
486
-
487
- ```json
488
- {
489
- "run": { "id": "workflow-run-…", "status": "ok", "workflow_id": "workflow-…" },
490
- "result": { "status": "ok", "step_count": 4, "timeline": [ /* per-node */ ], "outputs": {} }
491
- }
492
- ```
493
-
494
- ```json
495
- // POST /agents/api/run
496
- { "goal": "Draft v2.2 release notes", "roles": ["planner", "executor", "reviewer"], "max_retries": 2 }
497
- ```
498
-
499
- ```json
500
- {
501
- "run": { "id": "agent-run-…", "agent_id": "agent:executor", "status": "ok" },
502
- "result": { "status": "ok", "roles_run": ["planner", "executor", "reviewer"], "retries": 0, "output": "…" }
503
- }
504
- ```
505
-
506
- ---
507
-
508
- ## 6. Compatibility
509
-
510
- > **Compatibility note.** v2.2.0 is **additive**. All v1.x and v2.0 data and APIs are
511
- > preserved; the platform layers new capabilities on top of unchanged surfaces.
512
-
513
- Preserved surfaces, verified against source:
514
-
515
- - **ASGI entrypoints.** `server:app` and `latticeai.server_app.app` remain the
516
- application objects. `server_app.py` still exposes the module-level `app =
517
- FastAPI(...)` plus the `main()` / `uvicorn.run(app, ...)` entry point.
518
- - **Version wiring.** `WORKSPACE_OS_VERSION = "2.2.0"` drives both
519
- `APP_VERSION` (and thus the FastAPI `app.version`) and the `/health`
520
- response — the health router is constructed with `app_version=APP_VERSION`.
521
- - **Existing routes.** Every v1.x router (`auth`, `admin`, `security_dashboard`,
522
- `workspace`, `health`, `models`, `chat`, `tools`, `garden`, `setup`,
523
- `static_routes`) is still included unchanged in `server_app.py`. The v2.0
524
- routers are *added* alongside them under non-colliding namespaces.
525
- - **Data.** The local-first `workspace_os.json` is upgraded by deep-merge
526
- backfill (Seam 1) and `_migrate_workspaces` (non-destructive workspace
527
- upgrade); no migration deletes or rewrites existing snapshots, traces,
528
- memories, agent runs, workflows, or skills.
529
- - **Skills.** Standalone installed skills keep working; plugins reuse the same
530
- `skill_registry` via `register_plugin_skill` rather than a parallel store.
531
- - **Snapshots.** Snapshot files remain immutable JSON under
532
- `workspace_snapshots/`; `snapshot["version"]` is stamped with
533
- `WORKSPACE_OS_VERSION` but creation/compare/export behavior is unchanged.
534
- - **Knowledge Graph.** Graph operations stay additive (`ingest_event`,
535
- `ingest_message`); v2.0 only *adds* `WorkflowRun` / `AgentRun` linkage on top,
536
- honoring the `AGENTS.md` rule to preserve legacy read compatibility and avoid
537
- destructive migrations.
538
- - **Legacy workflows.** Pre-2.0 workflows persisted as a flat `steps` list still
539
- validate and run — `workflow_engine.normalize_definition` lifts them into a
540
- linear `trigger → tool… → output` node chain without rewriting stored history.
541
- - **Realtime hook is opt-in.** `WorkspaceOSStore(event_sink=...)` defaults to
542
- `None`; without a bus the store behaves exactly as in v1.x.
543
-
544
- ---
545
-
546
- ## 7. Per-Subsystem Reference
547
-
548
- Each pillar is intentionally a small, self-documenting module. For the
549
- authoritative, code-level definition of each subsystem, see:
550
-
551
- - **Plugin SDK** — `latticeai/core/plugins.py` (manifest schema, permissions,
552
- execution boundary) and `latticeai/api/plugins.py` (HTTP surface).
553
- - **Workflow Designer** — `latticeai/core/workflow_engine.py` (node types,
554
- validation, interpreter) and `latticeai/api/workflow_designer.py`.
555
- - **Multi-Agent Runtime 2.0** — `latticeai/core/multi_agent.py` (roles, pipeline,
556
- retry) and `latticeai/api/agents.py`.
557
- - **Realtime Collaboration** — `latticeai/core/realtime.py` (bus, presence, SSE)
558
- and `latticeai/api/realtime.py`.
559
- - **Cross-wiring** — `latticeai/services/platform_runtime.py`.
560
- - **State + persistence** — `latticeai/core/workspace_os.py`.
561
- - **App assembly** — `latticeai/server_app.py`.
@@ -1,82 +0,0 @@
1
- # Lattice AI v3.2.0 Release Claim Audit
2
-
3
- Audit date: 2026-06-08
4
- Target version: 3.2.0
5
- Scope: code, API routes, frontend views, adapters, tests, runtime/browser behavior, artifacts, tag/release metadata.
6
-
7
- ## Verdict
8
-
9
- Final source verdict: PASS after release-hardening fixes.
10
-
11
- The audit found two UI wiring gaps and one release-route hygiene issue:
12
-
13
- - `/app#/agents` showed AgentRuntime state but did not expose the Agent Registry controls and capability index from `/agents/api/registry*`.
14
- - `/app#/skills` called the live skill registry but only normalized a legacy `{ skills: [...] }` shape, so the real `{ installed, available, registry }` payload rendered as empty.
15
- - `server_app` registered the MCP router twice because `create_tools_router` already mounted the MCP/skills/plugin-directory routes.
16
-
17
- All three were fixed and covered by tests. No product scope was added.
18
-
19
- ## PASS / PARTIAL / FAIL Matrix
20
-
21
- | # | Claim | Status | Evidence |
22
- |---|---|---|---|
23
- | 1 | Multi-Agent Collaboration | PASS | `latticeai/core/multi_agent.py`, `latticeai/services/agent_runtime.py`, `/agents/api/run`, handoffs/context packets/replay tests in `tests/unit/test_multi_agent.py` and `tests/unit/test_agent_platform_maturity.py`. |
24
- | 2 | Agent Registry | PASS | `latticeai/core/agent_registry.py`, `latticeai/api/agent_registry.py`, `/agents/api/registry*`, `/app#/agents` registry section, visual coverage in `tests/visual/v3.spec.js`. |
25
- | 3 | Agent Marketplace | PASS | `latticeai/core/marketplace.py`, `latticeai/api/marketplace.py`, `/marketplace/templates`, `/app#/marketplace`. Offline local catalog; no cloud marketplace is claimed. |
26
- | 4 | Agent Templates | PASS | Five named agent templates: Research Assistant, Coding Assistant, Knowledge Curator, Documentation Writer, Workflow Builder; clone/export/import/install covered in `tests/unit/test_v32_platform.py`. |
27
- | 5 | Workflow Agents | PASS | `latticeai/core/workflow_engine.py`, `latticeai/api/workflow_designer.py`, `PlatformRuntime.build_workflow_runners`, `/app#/workflows`, workflow run/replay tests. |
28
- | 6 | Autonomous Planning | PASS | Planner/executor/reviewer flow via `/agents/api/run`, bounded retry/replan history in `MultiAgentOrchestrator`, `/app#/planning`, retry tests. |
29
- | 7 | Long-Term Memory Platform | PASS | `latticeai/services/memory_service.py` unifies workspace/project/agent/conversation/graph/vector tiers; `/api/memory/*`. |
30
- | 8 | Memory Manager | PASS | Usage/sources/health plus recall/inspect/prune/compact/rebuild/clear in `MemoryService` and `/app#/memory`. |
31
- | 9 | Skills Registry | PASS | `WorkspaceOSStore.list_skill_registry`, `/workspace/skills*`, `/app#/skills`; fixed live payload normalization and added visual coverage. |
32
- | 10 | Hooks Registry | PASS | `latticeai/core/hooks.py`, `latticeai/api/hooks.py`, `/api/hooks*`, `/app#/hooks`, unit tests for toggle/register/inspect/remove. |
33
- | 11 | Tool Registry | PASS | `latticeai/core/tool_registry.py`, `latticeai/services/tool_dispatch.py`, `/tools/permissions`, `/mcp/tools`, `/app#/tools`, route duplicate guard. |
34
- | 12 | MCP Foundation / MCP Manager | PASS | `latticeai/api/mcp.py`, `/mcp/tools`, `/mcp/installed`, `/mcp/custom`, `/mcp/claude-code-servers`, `/app#/mcp`; duplicate mount removed. |
35
- | 13 | Retrieval & Memory Integration | PASS | `latticeai/api/search.py`, `latticeai/services/search_service.py`, `MemoryService.recall`, `/api/search/hybrid`, `/api/index/status`, `/api/graph`, `/api/memory/recall`. |
36
- | 14 | UX Completion Pass | PASS | `/app` routes render without Classic dependency, console errors, app 404/500 responses, or horizontal overflow in real browser validation. Light/dark toggle validated. |
37
- | 15 | Documentation refresh | PASS | README, release notes/changelogs, release guide, and this audit document updated for the hardening pass. |
38
- | 16 | Architecture refresh | PASS | Architecture docs already describe the v3.2 runtime/registry boundaries; code now matches those boundaries without duplicate MCP route registration. |
39
- | 17 | Version 3.2.0 consistency | PASS | `package.json`, `pyproject.toml`, `vscode-extension/package.json`, runtime constants, and expected artifacts remain at 3.2.0. |
40
- | 18 | Tests | PASS | Lint/typecheck/python compile, 365 unit tests, live integration tests, 90 Playwright tests, and real-app browser route validation passed. |
41
- | 19 | Build artifacts | PASS | Rebuilt Python sdist/wheel, npm tarball, VSIX, and validated exact v3.2.0 artifact names. |
42
- | 20 | Git tag and GitHub Release metadata | PASS | Source policy keeps version 3.2.0; tag/release metadata should point at the final validated main commit. No package assets were attached or published. |
43
-
44
- ## Fixes Applied
45
-
46
- ### Agent Registry UI wiring
47
-
48
- - Finding: Agent Registry backend and adapter existed, but `/app#/agents` only rendered the runtime roster.
49
- - Affected files: `static/v3/js/views/agents.js`, hashed v3 assets, `tests/visual/v3.spec.js`, `tests/visual/mock_server.cjs`.
50
- - Expected behavior: `/app#/agents` exposes built-in/custom registry metadata, versions, capabilities, enabled state, and registration.
51
- - Actual behavior before fix: Registry data was reachable only through API/adapters, not the product view.
52
- - Fix: Added a live Agent Registry section, custom-agent registration controls, capability index display, enable/disable/remove actions, and Playwright coverage.
53
-
54
- ### Skills registry live payload normalization
55
-
56
- - Finding: `/workspace/skills` returned `{ installed, available, registry }`, but `/app#/skills` only accepted a legacy `{ skills }` array.
57
- - Affected files: `static/v3/js/views/skills.js`, hashed v3 assets, `tests/visual/v3.spec.js`, `tests/visual/mock_server.cjs`.
58
- - Expected behavior: installed and available skills render from the real registry payload.
59
- - Actual behavior before fix: live registry payload could render as an empty state.
60
- - Fix: Normalized installed, available, array registry, and object registry shapes with de-duplication by skill name.
61
-
62
- ### Duplicate MCP route registration
63
-
64
- - Finding: `create_tools_router` already included the MCP router, and `server_app` mounted it again.
65
- - Affected files: `latticeai/server_app.py`, `tests/unit/test_route_compatibility.py`.
66
- - Expected behavior: every public path/method has one handler.
67
- - Actual behavior before fix: duplicate MCP/skills/plugin-directory path registrations.
68
- - Fix: Removed the second MCP include and added a route duplicate guard.
69
-
70
- ## Validation Summary
71
-
72
- - `npm run lint`: PASS
73
- - `npm run typecheck`: PASS
74
- - `npm run check:python`: PASS
75
- - `./venv/bin/python -m pytest tests/unit -v`: PASS, 365 passed
76
- - `LTCAI_TEST_BASE_URL=http://127.0.0.1:8899 ./venv/bin/python -m pytest tests/integration -v`: PASS, 9 passed
77
- - `npx playwright test`: PASS, 90 passed
78
- - Real app browser validation: PASS for `/app`, `/app#/chat`, `/app#/planning`, `/app#/workflows`, `/app#/marketplace`, `/app#/memory`, `/app#/skills`, `/app#/hooks`, `/app#/tools`, `/app#/mcp`, `/app#/agents`, `/app#/models`, `/app#/knowledge-graph`, `/app#/hybrid-search`, `/app#/settings` across desktop/mobile, including no console/page errors, no app 404/500 responses, no horizontal overflow, no Classic dependency text, and light/dark toggle.
79
-
80
- ## Release Readiness
81
-
82
- READY FOR MANUAL PACKAGE PUBLICATION once the v3.2.0 tag and GitHub Release notes point at the final validated main commit. No package publication or deployment was performed by this audit.