ltcai 9.9.0 → 9.9.2

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 (104) hide show
  1. package/README.md +41 -35
  2. package/bin/ltcai.js +1 -1
  3. package/desktop/electron/main.cjs +1 -1
  4. package/docs/CHANGELOG.md +83 -0
  5. package/docs/CI_AND_RELEASE_GATES.md +1 -1
  6. package/docs/COMMUNITY_AND_PLUGINS.md +1 -1
  7. package/docs/DEVELOPMENT.md +1 -1
  8. package/docs/LEGACY_COMPATIBILITY.md +48 -49
  9. package/docs/ONBOARDING.md +1 -1
  10. package/docs/OPERATIONS.md +1 -1
  11. package/docs/TRUST_MODEL.md +1 -1
  12. package/docs/WHY_LATTICE.md +1 -1
  13. package/docs/kg-schema.md +6 -6
  14. package/lattice_brain/__init__.py +1 -1
  15. package/lattice_brain/graph/schema.py +1 -1
  16. package/lattice_brain/runtime/multi_agent.py +1 -1
  17. package/latticeai/__init__.py +1 -1
  18. package/latticeai/api/chat.py +3 -0
  19. package/latticeai/api/chat_agent_http.py +2 -1
  20. package/latticeai/api/chat_intents.py +130 -7
  21. package/latticeai/app_factory.py +1 -0
  22. package/latticeai/core/agent.py +114 -2
  23. package/latticeai/core/file_generation.py +58 -0
  24. package/latticeai/core/legacy_compatibility.py +71 -47
  25. package/latticeai/core/marketplace.py +1 -1
  26. package/latticeai/core/workspace_os.py +1 -1
  27. package/latticeai/services/app_context.py +3 -0
  28. package/latticeai/services/architecture_readiness.py +1 -1
  29. package/latticeai/services/product_readiness.py +7 -2
  30. package/latticeai/services/tool_dispatch.py +36 -0
  31. package/latticeai/tools/__init__.py +1 -1
  32. package/latticeai/tools/knowledge.py +1 -1
  33. package/package.json +6 -16
  34. package/scripts/check_current_release_docs.mjs +20 -1
  35. package/scripts/check_legacy_debt.mjs +91 -0
  36. package/scripts/prune_release_evidence.mjs +38 -0
  37. package/scripts/wheel_smoke.py +22 -6
  38. package/src-tauri/Cargo.lock +1 -1
  39. package/src-tauri/Cargo.toml +1 -1
  40. package/src-tauri/src/main.rs +12 -12
  41. package/src-tauri/tauri.conf.json +1 -13
  42. package/static/app/asset-manifest.json +27 -27
  43. package/static/app/assets/Act-Cx_gZNbE.js +1 -0
  44. package/static/app/assets/{Brain-Cgkh0Hpn.js → Brain-BnGbytHa.js} +2 -2
  45. package/static/app/assets/BrainHome-CRUMJL93.js +2 -0
  46. package/static/app/assets/BrainSignals-BP8-Qh2g.js +1 -0
  47. package/static/app/assets/Capture-CAKnLcb0.js +1 -0
  48. package/static/app/assets/CommandPalette-BoUTXBfm.js +1 -0
  49. package/static/app/assets/Library-PcfVUco6.js +1 -0
  50. package/static/app/assets/LivingBrain-C3VbogVo.js +1 -0
  51. package/static/app/assets/ProductFlow-BLau7c7N.js +1 -0
  52. package/static/app/assets/ReviewCard-CX5RqRqx.js +1 -0
  53. package/static/app/assets/System-DRHc_6Su.js +1 -0
  54. package/static/app/assets/bot-DZkDdh-A.js +1 -0
  55. package/static/app/assets/cpu-DyvsDBbj.js +1 -0
  56. package/static/app/assets/download-C7yxYHvz.js +1 -0
  57. package/static/app/assets/folder-open-CffoIr9t.js +1 -0
  58. package/static/app/assets/hard-drive-C1oojrHb.js +1 -0
  59. package/static/app/assets/{index-BjaXCeOZ.js → index-BS_3aN1n.js} +3 -3
  60. package/static/app/assets/index-DU78Kogz.css +2 -0
  61. package/static/app/assets/input-B_U7zvbR.js +1 -0
  62. package/static/app/assets/navigation-xG-gyjbe.js +1 -0
  63. package/static/app/assets/network-BF13HJJF.js +1 -0
  64. package/static/app/assets/primitives-DsuKh3M8.js +1 -0
  65. package/static/app/assets/sunrise-CIP2ELJ1.js +1 -0
  66. package/static/app/assets/textarea-DsDL4ET8.js +1 -0
  67. package/static/app/assets/utils-Dh-Dwtkb.js +7 -0
  68. package/static/app/index.html +4 -4
  69. package/static/sw.js +1 -1
  70. package/auto_setup.py +0 -21
  71. package/kg_schema.py +0 -13
  72. package/knowledge_graph.py +0 -51
  73. package/knowledge_graph_api.py +0 -24
  74. package/llm_router.py +0 -20
  75. package/local_knowledge_api.py +0 -16
  76. package/ltcai_cli.py +0 -21
  77. package/mcp_registry.py +0 -20
  78. package/p_reinforce.py +0 -16
  79. package/setup_wizard.py +0 -16
  80. package/static/app/assets/Act-CfOPUKPs.js +0 -2
  81. package/static/app/assets/BrainHome-D8e3wQiW.js +0 -3
  82. package/static/app/assets/BrainSignals-BjRBA18L.js +0 -1
  83. package/static/app/assets/Capture-CQQYQ1Ga.js +0 -1
  84. package/static/app/assets/CommandPalette-pss56Mg4.js +0 -1
  85. package/static/app/assets/Library-CoI3xYJk.js +0 -1
  86. package/static/app/assets/LivingBrain-CaU_hCxQ.js +0 -1
  87. package/static/app/assets/ProductFlow-Db-1O71-.js +0 -1
  88. package/static/app/assets/System-Dfocn0zN.js +0 -1
  89. package/static/app/assets/bot-Bp2x1i6F.js +0 -1
  90. package/static/app/assets/circle-check-CyGal42W.js +0 -1
  91. package/static/app/assets/cpu-DQFk82hG.js +0 -1
  92. package/static/app/assets/download-C70gKQVi.js +0 -1
  93. package/static/app/assets/folder-open-DNGytsVw.js +0 -1
  94. package/static/app/assets/hard-drive-CYo_bEl4.js +0 -1
  95. package/static/app/assets/i18n-BBMJshCW.js +0 -7
  96. package/static/app/assets/index-BqRcLZR3.css +0 -2
  97. package/static/app/assets/input-ChWD-Fsh.js +0 -1
  98. package/static/app/assets/navigation-D9D9_FPC.js +0 -1
  99. package/static/app/assets/network-DzLDGmtV.js +0 -1
  100. package/static/app/assets/primitives-CmaSAyGG.js +0 -1
  101. package/static/app/assets/sparkles-DXiaM1NS.js +0 -1
  102. package/static/app/assets/textarea-CV43-o79.js +0 -1
  103. package/telegram_bot.py +0 -16
  104. package/tools/__init__.py +0 -29
package/README.md CHANGED
@@ -11,7 +11,7 @@
11
11
  [![CI Status](https://github.com/TaeSooPark-PTS/LatticeAI/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/TaeSooPark-PTS/LatticeAI/actions/workflows/ci.yml)
12
12
  [![License](https://img.shields.io/badge/license-MIT-green)](LICENSE)
13
13
 
14
- ![v9.9.0 Living Brain walkthrough](output/release/v9.9.0/gifs/v9.9.0-living-brain-walkthrough.gif)
14
+ ![v9.9.2 Living Brain walkthrough](output/release/v9.9.2/gifs/v9.9.2-living-brain-walkthrough.gif)
15
15
 
16
16
  Chat, files, folders, notes, and web pages all flow into one durable knowledge
17
17
  graph on your computer. Any model — local MLX or cloud — can speak with that
@@ -24,9 +24,9 @@ memory. Nothing leaves your machine without explicit consent.
24
24
 
25
25
  | | |
26
26
  | --- | --- |
27
- | **Chat with a Brain that remembers** — every conversation grows durable, source-linked memory ![Brain Chat](output/release/v9.9.0/screenshots/04-brain-chat-home.png) | **See how knowledge connects** — a real relationship graph, not a file list ![Memory Graph](output/release/v9.9.0/screenshots/05-memory-graph.png) |
28
- | **Capture anything** — files, whole folders, notes, screenshots, web pages ![Capture](output/release/v9.9.0/screenshots/06-capture.png) | **Automate with review** — agent changes become proposals you approve first ![Review Center](output/release/v9.9.0/screenshots/12-review-center.png) |
29
- | **Pick a model in one click** — recommended local models for your hardware ![Recommended Models](output/release/v9.9.0/screenshots/02-recommended-models.png) | **Stay in control** — audit, roles, retention in a separate admin surface ![Admin Console](output/release/v9.9.0/screenshots/10-admin-console.png) |
27
+ | **Chat with a Brain that remembers** — every conversation grows durable, source-linked memory ![Brain Chat](output/release/v9.9.2/screenshots/04-brain-chat-home.png) | **See how knowledge connects** — a real relationship graph, not a file list ![Memory Graph](output/release/v9.9.2/screenshots/05-memory-graph.png) |
28
+ | **Capture anything** — files, whole folders, notes, screenshots, web pages ![Capture](output/release/v9.9.2/screenshots/06-capture.png) | **Automate with review** — agent changes become proposals you approve first ![Review Center](output/release/v9.9.2/screenshots/12-review-center.png) |
29
+ | **Pick a model in one click** — recommended local models for your hardware ![Recommended Models](output/release/v9.9.2/screenshots/02-recommended-models.png) | **Stay in control** — audit, roles, retention in a separate admin surface ![Admin Console](output/release/v9.9.2/screenshots/10-admin-console.png) |
30
30
 
31
31
  ## Why Lattice AI
32
32
 
@@ -57,45 +57,49 @@ First-run flow — wake the Brain, pick the owner, load a recommended model:
57
57
 
58
58
  | | | |
59
59
  | --- | --- | --- |
60
- | ![Login](output/release/v9.9.0/screenshots/01-login.png) | ![Model install](output/release/v9.9.0/screenshots/03-install-load-progress.png) | ![Model library](output/release/v9.9.0/screenshots/07-model-library.png) |
60
+ | ![Login](output/release/v9.9.2/screenshots/01-login.png) | ![Model install](output/release/v9.9.2/screenshots/03-install-load-progress.png) | ![Model library](output/release/v9.9.2/screenshots/07-model-library.png) |
61
61
 
62
62
  Screenshot index and capture notes:
63
- [output/release/v9.9.0/SCREENSHOT_INDEX.md](output/release/v9.9.0/SCREENSHOT_INDEX.md)
63
+ [output/release/v9.9.2/SCREENSHOT_INDEX.md](output/release/v9.9.2/SCREENSHOT_INDEX.md)
64
64
 
65
65
  ## Current Release
66
66
 
67
- The current release is **9.9.0Fail-Closed Trust**:
68
-
69
- - **Change proposals can't clobber your edits.** A proposal now records the
70
- original content hash; if the file changed before you approve, the apply is
71
- rejected with a conflict instead of silently overwriting your work, and the
72
- write is atomic. Duplicate/concurrent approvals apply exactly once.
73
- - **A confused verifier never reports success.** If the agent's critic output
74
- can't be parsed (after one strict retry), the run ends as `NEEDS_REVIEW`
75
- instead of a fabricated "done"; completion now requires a valid PASS *and*
76
- real execution evidence.
77
- - **Every mutating tool is governed.** A single-source inventory classifies
78
- each side-effecting tool; a CI gate fails closed if a new mutator ships
79
- ungoverned, and tools that would overwrite existing content without a
80
- reviewable proposal are blocked rather than applied.
81
- - **Honest onboarding.** Device analysis is modeled as
82
- `loading | ready | unavailable`; a failed probe no longer fabricates a
83
- "supported, ready on this computer" model card it shows the cause, a
84
- retry, and "continue without a model."
85
- - **Leaner & audited.** Initial JS bundle is ~22% smaller (lazy-loaded heavy
86
- views, with a CI budget), plus dependency/SBOM audit and scheduled
87
- PostgreSQL integration workflows, a security-scan report, a model benchmark
88
- harness, and current/architecture documentation classification.
67
+ The current release is **9.9.2Artifact Trust**:
68
+
69
+ - **A clean core.** The historical repo-root compatibility shims are gone
70
+ (only `server.py` remains for `uvicorn server:app`); packaging ships exactly
71
+ the `latticeai.*` / `lattice_brain.*` packages, and a legacy debt gate in
72
+ `npm run lint` plus a dedicated test suite keep the root clean for good.
73
+ - **Your first five minutes matter.** A guided "First 5 minutes" card on the
74
+ empty Brain home walks a new user through asking a first question, adding a
75
+ first file or note, and seeing what the Brain learned wired to real
76
+ features, with progress that persists and a briefing that loads immediately.
77
+ - **Proactive intelligence you can actually see.** Today's briefing now lives
78
+ on the Brain home instead of a double-collapsed drawer, and Cmd+K opens with
79
+ proactive quick actions (open briefing, review pending items, ask the Brain)
80
+ before you type a single letter.
81
+ - **Review Center at product quality.** Proposal cards translate risk and
82
+ change class into human language, frame diffs with file targets and honest
83
+ truncation counts, tuck raw IDs into a "Technical details" disclosure, and
84
+ every approve/reject failure shows a friendly message first.
85
+ - **Errors that speak your language.** The API error pipeline is localized
86
+ (ko/en): timeouts, unreachable-service, and backend failures produce plain,
87
+ helpful copy instead of raw `statusText` or English literals, across chat,
88
+ admin, care, and intelligence panels.
89
+ - **Scenario-first tests, smaller evidence footprint.** 37 version-named test
90
+ files were renamed to behavior-named suites, and `output/release/` now keeps
91
+ only the newest three evidence sets (~70MB reclaimed) via an automated
92
+ retention policy.
89
93
 
90
94
  Release notes: [RELEASE.md](RELEASE.md) · Full history: [docs/CHANGELOG.md](docs/CHANGELOG.md)
91
95
 
92
- Expected artifacts for 9.9.0 release must use exact filenames:
96
+ Expected artifacts for 9.9.2 release must use exact filenames:
93
97
 
94
- - `dist/ltcai-9.9.0-py3-none-any.whl`
95
- - `dist/ltcai-9.9.0.tar.gz`
96
- - `ltcai-9.9.0.tgz`
97
- - `dist/ltcai-9.9.0.vsix`
98
- - `src-tauri/target/release/bundle/dmg/Lattice AI_9.9.0_aarch64.dmg`
98
+ - `dist/ltcai-9.9.2-py3-none-any.whl`
99
+ - `dist/ltcai-9.9.2.tar.gz`
100
+ - `ltcai-9.9.2.tgz`
101
+ - `dist/ltcai-9.9.2.vsix`
102
+ - `src-tauri/target/release/bundle/dmg/Lattice AI_9.9.2_aarch64.dmg`
99
103
 
100
104
  Do not use wildcard artifact uploads. Package registry publishing remains owner-run.
101
105
 
@@ -115,7 +119,7 @@ See [ARCHITECTURE.md](ARCHITECTURE.md) for details and
115
119
 
116
120
  - External package registries are owner-published and can lag behind GitHub.
117
121
  - PostgreSQL/pgvector is optional scale/migration tooling. SQLite remains the
118
- live local Brain store in 9.9.0.
122
+ live local Brain store in 9.9.2.
119
123
  - Docker, model downloads, cloud model calls, Telegram, Brain Network, and
120
124
  update checks require explicit user action.
121
125
  - Conversation does not fabricate answers when no model is loaded. Agent and
@@ -127,6 +131,8 @@ See [ARCHITECTURE.md](ARCHITECTURE.md) for details and
127
131
 
128
132
  | Version | Theme |
129
133
  | --- | --- |
134
+ | 9.9.2 | Artifact Trust |
135
+ | 9.9.1 | Clean Foundations |
130
136
  | 9.9.0 | Fail-Closed Trust |
131
137
  | 9.8.0 | Honest Knowledge Pipeline |
132
138
  | 9.7.0 | Proactive Hybrid Brain |
package/bin/ltcai.js CHANGED
@@ -90,7 +90,7 @@ function run(index) {
90
90
  process.exit(1);
91
91
  }
92
92
 
93
- const child = spawn(python, [path.join(root, "ltcai_cli.py"), ...process.argv.slice(2)], {
93
+ const child = spawn(python, ["-m", "latticeai.cli.entrypoint", ...process.argv.slice(2)], {
94
94
  cwd: root,
95
95
  stdio: "inherit",
96
96
  });
@@ -20,7 +20,7 @@ ipcMain.handle("lattice:select-folder", async (event) => {
20
20
 
21
21
  function startBackend() {
22
22
  if (process.env.LATTICEAI_DESKTOP_NO_BACKEND) return;
23
- const command = process.env.LATTICEAI_DESKTOP_BACKEND_CMD || "python3 ltcai_cli.py --host 127.0.0.1 --port 4825";
23
+ const command = process.env.LATTICEAI_DESKTOP_BACKEND_CMD || "python3 -m latticeai.cli.entrypoint --host 127.0.0.1 --port 4825";
24
24
  const [bin, ...args] = command.split(/\s+/).filter(Boolean);
25
25
  if (!bin) return;
26
26
  backend = spawn(bin, args, {
package/docs/CHANGELOG.md CHANGED
@@ -4,6 +4,89 @@ The top entry is either the current unreleased main-branch work or the current
4
4
  release line. Older entries are historical and may describe behavior as it
5
5
  existed at that release.
6
6
 
7
+ ## [9.9.2] - 2026-07-21
8
+
9
+ ### Added
10
+ - ArtifactWritePipeline: `sanitize_write_content` in
11
+ `latticeai/core/file_generation.py` — a conservative validate-first →
12
+ extract → repair gate. The agent executor applies it to every `write_file`
13
+ `args.content` before dispatch, records a `content_sanitize` verdict on the
14
+ transcript, and tags `artifact_sanitize`/`artifact_repair` in the loop trace.
15
+ - Artifact-first chat contract: direct file-creation responses and agent runs
16
+ carry an `artifacts[]` array (`kind/path/filename/bytes/previewable/valid/
17
+ repaired`) via `collect_artifacts(transcript)`.
18
+ - Direct-path overwrite protection: an existing target is auto-suffixed
19
+ (`generated_page_2.html`) and announced, instead of silently overwritten.
20
+ - Generated files are optionally indexed into the Brain through the unified
21
+ `IngestionPipeline` (`workspace://` provenance, `origin: generated_file`);
22
+ disable with `LATTICEAI_INGEST_GENERATED=0`. The response reports an honest
23
+ `brain_ingest` status; ingest failures never fail the file creation.
24
+ - Plan schema enforcement (`normalize_plan`): non-empty goal, junk-step
25
+ filtering, `estimated_steps` clamping, and a deterministic single
26
+ `write_file` step for file-intent requests whose plan came back empty.
27
+ - Memory quality filter (`filter_learnings`): trivial and duplicate agent
28
+ learnings are dropped before entering the Brain.
29
+ - FG harness `tests/unit/test_artifact_write_scenarios.py` (FG-01..FG-08):
30
+ intent gating, filename inference, dirty-output extraction, truncated-HTML
31
+ repair, agent-path sanitization, how-to non-routing, scaffold validity.
32
+ - Frontend honesty surfaces: "Auto-repaired" badge on file cards
33
+ (`generation.repaired`), and a distinct warning strip for `NEEDS_REVIEW` /
34
+ `FAILED` terminal agent states (`role="alert"`, ko/en, dark/light).
35
+
36
+ ### Changed
37
+ - HTML file validation now rejects documents wrapped in prose or Markdown
38
+ fences, so extraction gets a chance to slice out the real document instead
39
+ of the wrapper being saved as "valid".
40
+ - `product_readiness` `action-aware-chat` gate additionally proves the
41
+ ArtifactWritePipeline evidence (module, agent seam, FG harness test).
42
+
43
+ ## [9.9.1] - 2026-07-21
44
+
45
+ ### Removed
46
+ - All repo-root compatibility shims except `server.py`: `ltcai_cli.py`,
47
+ `auto_setup.py`, `setup_wizard.py`, `mcp_registry.py`, `kg_schema.py`,
48
+ `knowledge_graph.py`, `knowledge_graph_api.py`, `local_knowledge_api.py`,
49
+ `llm_router.py`, `p_reinforce.py`, `telegram_bot.py`, and the root `tools/`
50
+ package (12 of 13 tracked shims, 92%). Canonical imports are the
51
+ `latticeai.*` / `lattice_brain.*` module paths; the console script and
52
+ `bin/ltcai.js` now target `latticeai.cli.entrypoint` directly.
53
+ - Stale release evidence: `output/release/` now keeps only the newest three
54
+ versioned evidence directories (automated retention policy).
55
+
56
+ ### Added
57
+ - Legacy debt gate: `scripts/check_legacy_debt.mjs` in `npm run lint` plus a
58
+ rewritten `tests/unit/test_legacy_root_shims.py` fail if a root module
59
+ reappears or any source tree imports a removed shim.
60
+ - `scripts/prune_release_evidence.mjs` retention policy (newest 3, override
61
+ with `LTCAI_RELEASE_EVIDENCE_KEEP`), wired into `npm run release:evidence`.
62
+ - First-run "First 5 minutes" guided card on the empty Brain home: ask a first
63
+ question, add a first file/note, see what the Brain learned — real feature
64
+ wiring, persistent progress, dismissible.
65
+ - Daily briefing on the Brain home (immediate fetch, friendly empty state) and
66
+ proactive quick actions on Cmd+K cold open (open briefing, review pending,
67
+ ask the Brain) with live counts.
68
+ - Localized API error pipeline: timeout/unreachable/status failures map to
69
+ friendly ko/en copy instead of raw `statusText` or English literals.
70
+ - `scripts/check_current_release_docs.mjs` now verifies the ARCHITECTURE.md
71
+ Release Artifact Map names current-version artifacts exactly.
72
+
73
+ ### Changed
74
+ - Review Center at product quality: translated status/source/risk/change-class
75
+ labels, framed diffs (file target, +/- coloring, honest truncation count),
76
+ raw IDs relegated to a collapsed "Technical details" disclosure, structured
77
+ success/failure feedback, and a distinct error state with retry for the
78
+ pending-proposals panel.
79
+ - Intelligence/care/admin/markdown panels show friendly i18n error copy first;
80
+ raw backend detail is demoted to secondary text.
81
+ - 37 version-named test files (`test_v3_*`, `test_v42_*` … `test_t9_*`,
82
+ `test_kg_v2/v4_*`) renamed to scenario-named suites; versioned test
83
+ function names cleaned up. Coverage is unchanged (1284 unit tests).
84
+ - Packaging: `pyproject.toml` ships a single root module (`server`);
85
+ `package.json` files list and `MANIFEST.in` no longer ship shim files.
86
+ - Docs: `docs/LEGACY_COMPATIBILITY.md` rewritten for the post-shim layout;
87
+ `docs/kg-schema.md` points at `lattice_brain/graph/schema.py`; ARCHITECTURE
88
+ artifact map and 9.8.0-era references brought current.
89
+
7
90
  ## [9.9.0] - 2026-07-21
8
91
 
9
92
  ### Fixed
@@ -63,7 +63,7 @@ the required-checks list below.
63
63
  ## Postgres integration gate
64
64
 
65
65
  `postgres-integration.yml` runs the migration-integrity suite
66
- (`tests/integration/test_v42_postgres_migration_live.py`) that is skipped
66
+ (`tests/integration/test_postgres_migration_live.py`) that is skipped
67
67
  everywhere else. The suite is gated by `LTCAI_LIVE_POSTGRES_DOCKER_CONSENT=1`;
68
68
  the workflow sets that variable, and the test itself starts and tears down a
69
69
  `pgvector/pgvector:pg16` container via `docker compose` (preinstalled on
@@ -1,6 +1,6 @@
1
1
  # Community And Plugins
2
2
 
3
- Current release: **9.9.0Fail-Closed Trust**.
3
+ Current release: **9.9.2Artifact Trust**.
4
4
 
5
5
  LatticeAI defines the path from a strong local-first framework (8.4.0
6
6
  action-aware baseline, 8.5.0 registry+DI hardening, 8.6.0 capture/navigation
@@ -3,7 +3,7 @@
3
3
  > **Status: canonical** — current contributor guidance, kept in sync with the
4
4
  > current release.
5
5
 
6
- Current release: **9.9.0Fail-Closed Trust**.
6
+ Current release: **9.9.2Artifact Trust**.
7
7
 
8
8
  This document is for contributors working on the local-first Digital Brain
9
9
  codebase. Product positioning and quick start stay in `README.md`; release
@@ -1,18 +1,18 @@
1
1
  # Legacy Compatibility Map
2
2
 
3
- Current target: **9.6.0Trusted Agent Loop**.
3
+ Current target: **9.9.1Legacy debt paydown**.
4
4
 
5
- Lattice AI is moving toward a smaller, modular architecture centered on
6
- `lattice_brain`, `latticeai.services`, `latticeai.api`, and `latticeai.runtime`.
7
- Some root-level modules remain packaged for compatibility with older imports,
8
- CLI entrypoints, or extension workflows. Their presence does not define the
9
- current architecture.
5
+ Lattice AI is centered on `lattice_brain`, `latticeai.services`, `latticeai.api`,
6
+ and `latticeai.runtime`. 9.9.1 completed the root-shim compatibility window:
7
+ every repo-root import shim except `server.py` was physically deleted, and a
8
+ legacy debt gate keeps the root clean.
10
9
 
11
10
  The managed inventory lives in `latticeai.core.legacy_compatibility` and
12
11
  groups shims by layer:
13
12
 
14
- - `root`: historical repo-root imports such as `knowledge_graph.py` — **kept**
15
- (external entrypoints: `uvicorn server:app`, installed CLI, old scripts).
13
+ - `root`: historical repo-root imports such as `knowledge_graph.py` —
14
+ **removed in 9.9.1** except `server.py` (external entrypoints:
15
+ `uvicorn server:app`, Docker CMD, launch scripts).
16
16
  - `brain-flat`: pre-graph-package imports such as `lattice_brain.store` —
17
17
  **removed in 8.8.0** (internal-only).
18
18
  - `deprecated-namespace`: older `latticeai.brain.*` package imports —
@@ -24,11 +24,44 @@ Removed layers stay listed in `legacy_compatibility.REMOVED_SHIMS` and in the
24
24
  `legacy_shim_report()` payload (`removed`, `lingering`), so tooling can tell
25
25
  "removed on purpose" apart from "missing by accident".
26
26
 
27
+ ## Legacy Debt Gate
28
+
29
+ Two gates keep the debt paid down:
30
+
31
+ - `scripts/check_legacy_debt.mjs` (part of `npm run lint`) — fails if a
32
+ disallowed root-level Python module reappears, or if any source tree imports
33
+ a removed root shim.
34
+ - `tests/unit/test_legacy_root_shims.py` — asserts removed shims stay
35
+ unimportable, canonical replacements import, and the registry in
36
+ `latticeai.core.legacy_compatibility` matches reality.
37
+
38
+ ## Root Module Map (removed in 9.9.1)
39
+
40
+ | Removed root module | Canonical import |
41
+ | --- | --- |
42
+ | `knowledge_graph.py` | `from lattice_brain.graph.store import KnowledgeGraphStore` |
43
+ | `knowledge_graph_api.py` | `from latticeai.api.knowledge_graph import create_knowledge_graph_router` |
44
+ | `kg_schema.py` | `from lattice_brain.graph.schema import ...` |
45
+ | `auto_setup.py` | `from latticeai.setup.auto_setup import probe, recommend` |
46
+ | `llm_router.py` | `import latticeai.models.router` |
47
+ | `ltcai_cli.py` | `from latticeai.cli.entrypoint import main` (console script `LTCAI`) |
48
+ | `mcp_registry.py` | `import latticeai.core.mcp_registry` |
49
+ | `local_knowledge_api.py` | `from latticeai.services.local_knowledge import create_local_knowledge_router` |
50
+ | `p_reinforce.py` | `from latticeai.services.p_reinforce import PReinforceGardener` |
51
+ | `telegram_bot.py` | `from latticeai.integrations.telegram_bot import run_bot` |
52
+ | `setup_wizard.py` | `from latticeai.setup.wizard import scan_environment` |
53
+ | `tools/` | `from latticeai.tools import execute_tool` |
54
+
55
+ The only remaining root module:
56
+
57
+ | Kept root module | Why it remains |
58
+ | --- | --- |
59
+ | `server.py` | Lazy proxy to `latticeai.server_app`; preserves `uvicorn server:app`, the Docker CMD, and launch scripts without import-time construction |
60
+
27
61
  ## Brain Core extraction readiness
28
62
 
29
- Removing the internal layers gives `lattice_brain` exactly one import surface
30
- (its physical module paths). Two structural guards keep it extractable as a
31
- standalone package:
63
+ `lattice_brain` has exactly one import surface (its physical module paths).
64
+ Two structural guards keep it extractable as a standalone package:
32
65
 
33
66
  - `tests/unit/test_brain_core_isolation.py` — AST guard that fails if any
34
67
  `lattice_brain` module imports `latticeai` (the product imports the Brain,
@@ -36,36 +69,6 @@ standalone package:
36
69
  - `tests/unit/test_legacy_root_shims.py::test_internal_shim_layers_are_gone`
37
70
  — fails if a removed shim path becomes importable again.
38
71
 
39
- ## Current Policy
40
-
41
- - Keep compatibility shims while public imports or package entrypoints still
42
- depend on them.
43
- - Prefer moving implementation into focused packages before removing a root
44
- module.
45
- - Add deprecation notes before removal.
46
- - Avoid breaking package users during a minor release.
47
- - Do not silently remove rollback, backup, restore, or migration paths.
48
- - Track every remaining shim through `latticeai.core.legacy_compatibility` so
49
- release readiness can report owner, replacement, reason, removal phase, and
50
- missing files.
51
-
52
- ## Root Module Map
53
-
54
- | Legacy root module | Current home / direction | Why it remains |
55
- | --- | --- | --- |
56
- | `knowledge_graph.py` | `lattice_brain.graph` / `lattice_brain.knowledge` | Compatibility for older graph imports and historical tooling |
57
- | `knowledge_graph_api.py` | `latticeai.api.memory`, `latticeai.api.search`, graph-related API routers | Compatibility for older API import paths |
58
- | `kg_schema.py` | `lattice_brain` storage/schema modules | Compatibility for graph schema references |
59
- | `auto_setup.py` | `latticeai.setup.auto_setup` | Thin compatibility shim for zero-config setup probes and historical commands |
60
- | `llm_router.py` | `latticeai.models.router` | Compatibility for older local model routing imports |
61
- | `ltcai_cli.py` | package console entrypoint (`ltcai`) | Compatibility for the installed CLI contract |
62
- | `mcp_registry.py` | `latticeai.core.mcp_registry` and service-backed registries | Compatibility for MCP/skills lookup entrypoints |
63
- | `local_knowledge_api.py` | `latticeai.services.local_knowledge` | Thin compatibility shim for local folder/file watcher flows |
64
- | `p_reinforce.py` | gardener/maintenance service direction | Compatibility for existing Brain gardening runtime hooks |
65
- | `telegram_bot.py` | opt-in integration package or disabled-by-default connector | Compatibility only; Telegram must remain opt-in |
66
- | `setup_wizard.py` | `latticeai.setup.wizard` | Thin compatibility shim for first-run recommendation calls |
67
- | `server.py` | lazy proxy to `latticeai.server_app` / `latticeai.app_factory` | Preserves historical `server.app` imports without import-time construction |
68
-
69
72
  ## Inner Shim Layers (removed in 8.8.0)
70
73
 
71
74
  | Legacy layer | Example module | Replacement import | Status |
@@ -76,14 +79,10 @@ standalone package:
76
79
 
77
80
  ## Packaging Notes
78
81
 
79
- `pyproject.toml` and `package.json` still include several root modules because
80
- older installed packages may import them directly. That is intentional for now.
81
- The long-term target is:
82
-
83
- - move implementation into `lattice_brain`, `latticeai.core`, `latticeai.models`,
84
- `latticeai.services`, or `latticeai.api`;
85
- - leave thin shims with docstrings/deprecation warnings;
86
- - remove a shim only after tests prove no supported entrypoint relies on it.
82
+ `pyproject.toml` ships a single root module (`server`) plus the
83
+ `latticeai.*`/`lattice_brain.*` packages; the npm package mirrors that. The
84
+ console script `LTCAI` targets `latticeai.cli.entrypoint:main` directly, and
85
+ `bin/ltcai.js` spawns `python -m latticeai.cli.entrypoint`.
87
86
 
88
87
  ## Removal Checklist
89
88
 
@@ -1,6 +1,6 @@
1
1
  # Lattice AI Onboarding
2
2
 
3
- Current release: **9.9.0Fail-Closed Trust**.
3
+ Current release: **9.9.2Artifact Trust**.
4
4
 
5
5
  The first-run goal is a five-minute path from "I opened the app" to "my Brain
6
6
  has a source, a question, and proof." This page is the product contract behind
@@ -1,4 +1,4 @@
1
- # Lattice AI — Operations Guide (v9.9.0)
1
+ # Lattice AI — Operations Guide (v9.9.2)
2
2
 
3
3
  > **Status: canonical** — kept in sync with the current release. Storage layout
4
4
  > below reflects the SQLite live Brain store and workspace scoping, not the
@@ -1,6 +1,6 @@
1
1
  # Lattice AI Trust Model
2
2
 
3
- Current release: **9.9.0Fail-Closed Trust**.
3
+ Current release: **9.9.2Artifact Trust**.
4
4
 
5
5
  Lattice AI is local-first, explicit about external communication, and honest
6
6
  when a capability is unavailable.
@@ -1,6 +1,6 @@
1
1
  # Why Lattice AI Exists
2
2
 
3
- Current release: **9.9.0Fail-Closed Trust**.
3
+ Current release: **9.9.2Artifact Trust**.
4
4
 
5
5
  **Lattice AI is a local-first Digital Brain that keeps your knowledge durable
6
6
  across any AI model.**
package/docs/kg-schema.md CHANGED
@@ -1,9 +1,9 @@
1
1
  # Knowledge Graph Schema
2
2
 
3
- Current release: **9.9.0Fail-Closed Trust**.
3
+ Current release: **9.9.2Artifact Trust**.
4
4
 
5
5
  명세 출처: `lattice_ai_full_spec.pptx` 슬라이드 20·21·22
6
- 구현: `kg_schema.py`
6
+ 구현: `lattice_brain/graph/schema.py`
7
7
 
8
8
  ---
9
9
 
@@ -179,8 +179,8 @@ provenance(source_type, source_uri, content_hash, captured_at, modified_at,
179
179
 
180
180
  ## 마이그레이션 (legacy → v2)
181
181
 
182
- 기존 `knowledge_graph.py` 가 만든 `nodes` / `edges` 테이블은 자유 문자열 타입을
183
- 사용해 왔다. `kg_schema.py` 는 매핑 표를 가지고 있어 정식 enum 으로 변환한다.
182
+ 기존 `lattice_brain/graph/store.py`(구 `knowledge_graph.py`) 가 만든 `nodes` / `edges` 테이블은 자유 문자열 타입을
183
+ 사용해 왔다. `lattice_brain/graph/schema.py` 는 매핑 표를 가지고 있어 정식 enum 으로 변환한다.
184
184
 
185
185
  | legacy 타입 (한글 동사) | → v2 `EdgeType` |
186
186
  |------------------------|------------------|
@@ -209,7 +209,7 @@ provenance(source_type, source_uri, content_hash, captured_at, modified_at,
209
209
 
210
210
  마이그레이션은 별도 CLI 없이 **서버 기동 시 자동으로** 일어난다:
211
211
  `knowledge_graph.KnowledgeGraphStore` 가 열릴 때 v2 스키마를 생성/치유하고
212
- (`kg_schema.KGStoreV2.init_schema` — 추가 컬럼은 `ALTER` 로 in-place 치유,
212
+ (`lattice_brain.graph.schema.KGStoreV2.init_schema` — 추가 컬럼은 `ALTER` 로 in-place 치유,
213
213
  edges_v2 식별자 변경은 create→copy→swap 으로 재구축), legacy 데이터를
214
214
  v2 로 백필한다. 기존 `nodes` / `edges` 테이블은 삭제하지 않는다. v4 에서는
215
215
  `nodes_v2` / `edges_v2` 가 쓰기 마스터이며, legacy 테이블은 이전 import/API
@@ -243,7 +243,7 @@ v2 로 백필한다. 기존 `nodes` / `edges` 테이블은 삭제하지 않는
243
243
  read/write 는 `knowledge_graph.KnowledgeGraphStore` 가 담당한다:
244
244
 
245
245
  ```python
246
- from kg_schema import KGStoreV2, NodeType, EdgeType
246
+ from lattice_brain.graph.schema import KGStoreV2, NodeType, EdgeType
247
247
  from knowledge_graph import KnowledgeGraphStore
248
248
 
249
249
  store = KnowledgeGraphStore(db_path, blob_dir)
@@ -26,7 +26,7 @@ from .storage import (
26
26
  storage_from_env,
27
27
  )
28
28
 
29
- __version__ = "9.9.0"
29
+ __version__ = "9.9.2"
30
30
 
31
31
  __all__ = [
32
32
  "AgentRuntime",
@@ -32,7 +32,7 @@ legacy 테이블에 대한 dual-write 프로젝션(raw SQL) + ``kgv2_*`` 재구
32
32
  사용 예
33
33
  -------
34
34
  ```python
35
- from kg_schema import KGStoreV2
35
+ from lattice_brain.graph.schema import KGStoreV2
36
36
 
37
37
  store = KGStoreV2("/Users/me/.ltcai/kg_v2.db")
38
38
  store.init_schema() # nodes_v2 / edges_v2 생성 + 컬럼 drift self-heal
@@ -48,7 +48,7 @@ from .contracts import multi_agent_contract
48
48
  from ..utils import now_iso as _now
49
49
 
50
50
 
51
- MULTI_AGENT_VERSION = "9.9.0"
51
+ MULTI_AGENT_VERSION = "9.9.2"
52
52
 
53
53
  AGENT_ROLES = ("researcher", "planner", "executor", "reviewer", "release")
54
54
  CORE_PIPELINE = ("planner", "executor", "reviewer")
@@ -1,3 +1,3 @@
1
1
  """Lattice AI - modular server package."""
2
2
 
3
- __version__ = "9.9.0"
3
+ __version__ = "9.9.2"
@@ -208,6 +208,7 @@ def create_chat_router(context: AppContext) -> APIRouter:
208
208
  execute_tool=execute_tool,
209
209
  agent_controller=agent_controller,
210
210
  agent_root=AGENT_ROOT,
211
+ ingestion_pipeline=context.ingestion_pipeline,
211
212
  )
212
213
  document_coordinator = DocumentGenerationCoordinator(
213
214
  model_router=model_router,
@@ -276,6 +277,8 @@ def create_chat_router(context: AppContext) -> APIRouter:
276
277
  direct_response = await intent_controller.direct_file_action(
277
278
  req,
278
279
  model_id=selected_model_id,
280
+ effective_email=effective_email,
281
+ workspace_id=workspace_id,
279
282
  )
280
283
  if direct_response is not None:
281
284
  return direct_response
@@ -18,7 +18,7 @@ from lattice_brain.runtime.hooks import dispatch_tool
18
18
  from latticeai.api.chat_contracts import AgentEvalRequest, AgentRequest, AgentResumeRequest
19
19
  from latticeai.api.chat_helpers import _LANG_HINT, detect_language, workspace_scope_from_request
20
20
  from latticeai.core.agent import AgentRunContext, AgentState
21
- from latticeai.services.tool_dispatch import collect_created_files
21
+ from latticeai.services.tool_dispatch import collect_artifacts, collect_created_files
22
22
 
23
23
 
24
24
  class AgentHTTPController:
@@ -307,6 +307,7 @@ class AgentHTTPController:
307
307
  "state_history": ctx.state_history,
308
308
  "final_state": ctx.state.value,
309
309
  "created_files": collect_created_files(ctx.transcript),
310
+ "artifacts": collect_artifacts(ctx.transcript),
310
311
  "loop": ctx.trace.summary(),
311
312
  }
312
313