ltcai 9.8.0 → 9.9.1

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 (97) hide show
  1. package/README.md +45 -28
  2. package/bin/ltcai.js +1 -1
  3. package/desktop/electron/main.cjs +1 -1
  4. package/docs/BENCHMARKS.md +107 -0
  5. package/docs/CHANGELOG.md +82 -0
  6. package/docs/CI_AND_RELEASE_GATES.md +106 -0
  7. package/docs/COMMUNITY_AND_PLUGINS.md +1 -1
  8. package/docs/DEVELOPMENT.md +11 -8
  9. package/docs/LEGACY_COMPATIBILITY.md +48 -49
  10. package/docs/ONBOARDING.md +1 -1
  11. package/docs/OPERATIONS.md +15 -6
  12. package/docs/PERFORMANCE.md +9 -1
  13. package/docs/SECURITY_AUDIT.md +91 -0
  14. package/docs/TRUST_MODEL.md +1 -1
  15. package/docs/USABILITY_AUDIT.md +164 -0
  16. package/docs/WHY_LATTICE.md +1 -1
  17. package/docs/architecture.md +4 -2
  18. package/docs/kg-schema.md +6 -6
  19. package/docs/spec-vs-impl.md +8 -1
  20. package/lattice_brain/__init__.py +1 -1
  21. package/lattice_brain/graph/schema.py +1 -1
  22. package/lattice_brain/runtime/multi_agent.py +1 -1
  23. package/latticeai/__init__.py +1 -1
  24. package/latticeai/api/review_queue.py +7 -0
  25. package/latticeai/core/agent.py +105 -8
  26. package/latticeai/core/agent_eval.py +99 -1
  27. package/latticeai/core/legacy_compatibility.py +71 -47
  28. package/latticeai/core/marketplace.py +1 -1
  29. package/latticeai/core/tool_governor.py +92 -1
  30. package/latticeai/core/workspace_os.py +1 -1
  31. package/latticeai/services/architecture_readiness.py +1 -1
  32. package/latticeai/services/change_proposals.py +165 -23
  33. package/latticeai/services/product_readiness.py +2 -2
  34. package/latticeai/services/tool_dispatch.py +33 -0
  35. package/latticeai/tools/__init__.py +1 -1
  36. package/latticeai/tools/knowledge.py +1 -1
  37. package/package.json +9 -17
  38. package/scripts/bench_models.py +312 -0
  39. package/scripts/check_bundle_budget.mjs +103 -0
  40. package/scripts/check_current_release_docs.mjs +20 -1
  41. package/scripts/check_doc_status.mjs +149 -0
  42. package/scripts/check_legacy_debt.mjs +91 -0
  43. package/scripts/generate_sbom.py +70 -0
  44. package/scripts/prune_release_evidence.mjs +38 -0
  45. package/scripts/wheel_smoke.py +22 -6
  46. package/src-tauri/Cargo.lock +1 -1
  47. package/src-tauri/Cargo.toml +1 -1
  48. package/src-tauri/src/main.rs +12 -12
  49. package/src-tauri/tauri.conf.json +1 -13
  50. package/static/app/asset-manifest.json +27 -11
  51. package/static/app/assets/Act-CcSWTQsx.js +1 -0
  52. package/static/app/assets/{Brain-BMkgdWnI.js → Brain-CSCDZEHd.js} +2 -2
  53. package/static/app/assets/BrainHome-B5QpJ1Fx.js +2 -0
  54. package/static/app/assets/BrainSignals-CmFD8PWk.js +1 -0
  55. package/static/app/assets/Capture-BiuerOio.js +1 -0
  56. package/static/app/assets/CommandPalette-BrqpT7K2.js +1 -0
  57. package/static/app/assets/Library-BcaiPbum.js +1 -0
  58. package/static/app/assets/LivingBrain-6FvA0H5T.js +1 -0
  59. package/static/app/assets/ProductFlow-Cr8bkQPw.js +1 -0
  60. package/static/app/assets/ReviewCard-D56TMypk.js +1 -0
  61. package/static/app/assets/System-D6uJacqu.js +1 -0
  62. package/static/app/assets/bot-DgC7xgUl.js +1 -0
  63. package/static/app/assets/cpu-DDGb4XHl.js +1 -0
  64. package/static/app/assets/download-C-Ei3GFa.js +1 -0
  65. package/static/app/assets/folder-open-BbVuSO9M.js +1 -0
  66. package/static/app/assets/hard-drive-yDZR6XYz.js +1 -0
  67. package/static/app/assets/index-CFRhNBuH.css +2 -0
  68. package/static/app/assets/index-DrZSkwrE.js +10 -0
  69. package/static/app/assets/input-DPIkTs9n.js +1 -0
  70. package/static/app/assets/navigation-B1mkmyUe.js +1 -0
  71. package/static/app/assets/network-0XDI1Uf_.js +1 -0
  72. package/static/app/assets/primitives-sIQYKyf5.js +1 -0
  73. package/static/app/assets/sunrise-DXMjueec.js +1 -0
  74. package/static/app/assets/textarea-DvnwpnqS.js +1 -0
  75. package/static/app/assets/utils-BrfFHAJl.js +7 -0
  76. package/static/app/index.html +4 -2
  77. package/static/sw.js +1 -1
  78. package/auto_setup.py +0 -21
  79. package/kg_schema.py +0 -13
  80. package/knowledge_graph.py +0 -51
  81. package/knowledge_graph_api.py +0 -24
  82. package/llm_router.py +0 -20
  83. package/local_knowledge_api.py +0 -16
  84. package/ltcai_cli.py +0 -21
  85. package/mcp_registry.py +0 -20
  86. package/p_reinforce.py +0 -16
  87. package/setup_wizard.py +0 -16
  88. package/static/app/assets/Act-Dd3z8AzF.js +0 -2
  89. package/static/app/assets/Capture-D2Aw9gkv.js +0 -1
  90. package/static/app/assets/Library-Yreq-KW5.js +0 -1
  91. package/static/app/assets/System-CXNmmtEo.js +0 -1
  92. package/static/app/assets/index-7gY9t9Sd.css +0 -2
  93. package/static/app/assets/index-CndfILiF.js +0 -18
  94. package/static/app/assets/primitives-DxsIXb6G.js +0 -1
  95. package/static/app/assets/textarea-DH7ne8VI.js +0 -1
  96. package/telegram_bot.py +0 -16
  97. 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.8.0 Living Brain walkthrough](output/release/v9.8.0/gifs/v9.8.0-living-brain-walkthrough.gif)
14
+ ![v9.9.1 Living Brain walkthrough](output/release/v9.9.1/gifs/v9.9.1-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.8.0/screenshots/04-brain-chat-home.png) | **See how knowledge connects** — a real relationship graph, not a file list ![Memory Graph](output/release/v9.8.0/screenshots/05-memory-graph.png) |
28
- | **Capture anything** — files, whole folders, notes, screenshots, web pages ![Capture](output/release/v9.8.0/screenshots/06-capture.png) | **Automate with review** — agent changes become proposals you approve first ![Review Center](output/release/v9.8.0/screenshots/12-review-center.png) |
29
- | **Pick a model in one click** — recommended local models for your hardware ![Recommended Models](output/release/v9.8.0/screenshots/02-recommended-models.png) | **Stay in control** — audit, roles, retention in a separate admin surface ![Admin Console](output/release/v9.8.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.1/screenshots/04-brain-chat-home.png) | **See how knowledge connects** — a real relationship graph, not a file list ![Memory Graph](output/release/v9.9.1/screenshots/05-memory-graph.png) |
28
+ | **Capture anything** — files, whole folders, notes, screenshots, web pages ![Capture](output/release/v9.9.1/screenshots/06-capture.png) | **Automate with review** — agent changes become proposals you approve first ![Review Center](output/release/v9.9.1/screenshots/12-review-center.png) |
29
+ | **Pick a model in one click** — recommended local models for your hardware ![Recommended Models](output/release/v9.9.1/screenshots/02-recommended-models.png) | **Stay in control** — audit, roles, retention in a separate admin surface ![Admin Console](output/release/v9.9.1/screenshots/10-admin-console.png) |
30
30
 
31
31
  ## Why Lattice AI
32
32
 
@@ -57,36 +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.8.0/screenshots/01-login.png) | ![Model install](output/release/v9.8.0/screenshots/03-install-load-progress.png) | ![Model library](output/release/v9.8.0/screenshots/07-model-library.png) |
60
+ | ![Login](output/release/v9.9.1/screenshots/01-login.png) | ![Model install](output/release/v9.9.1/screenshots/03-install-load-progress.png) | ![Model library](output/release/v9.9.1/screenshots/07-model-library.png) |
61
61
 
62
62
  Screenshot index and capture notes:
63
- [output/release/v9.8.0/SCREENSHOT_INDEX.md](output/release/v9.8.0/SCREENSHOT_INDEX.md)
63
+ [output/release/v9.9.1/SCREENSHOT_INDEX.md](output/release/v9.9.1/SCREENSHOT_INDEX.md)
64
64
 
65
65
  ## Current Release
66
66
 
67
- The current release is **9.8.0Honest Knowledge Pipeline**:
68
-
69
- - Every ingest (file, folder, web) now reports an extraction-quality score and
70
- warns on low-quality captures before they pollute the Brain.
71
- - Background folder ingestion is robust: per-item errors don't kill the job,
72
- progress (processed/total) is visible, and interrupted jobs resume with a
73
- jobs API (`/api/ingestion/jobs`) and UI progress.
74
- - The Brain signals honestly: chat answers carry a `context_quality` marker
75
- when graph context is limited, and `/api/brain/vector-freshness` plus a UI
76
- banner show when knowledge is still waiting for vector indexing.
77
- - The agent evaluation gate grew to 16 deterministic scenarios, adding
78
- ingestion, concept-extraction, RAG-grounded answering, and automation
79
- proposal paths; automation suggestions gain confidence scoring and dedup.
67
+ The current release is **9.9.1Clean Foundations**:
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.
80
93
 
81
94
  Release notes: [RELEASE.md](RELEASE.md) · Full history: [docs/CHANGELOG.md](docs/CHANGELOG.md)
82
95
 
83
- Expected artifacts for 9.8.0 release must use exact filenames:
96
+ Expected artifacts for 9.9.1 release must use exact filenames:
84
97
 
85
- - `dist/ltcai-9.8.0-py3-none-any.whl`
86
- - `dist/ltcai-9.8.0.tar.gz`
87
- - `ltcai-9.8.0.tgz`
88
- - `dist/ltcai-9.8.0.vsix`
89
- - `src-tauri/target/release/bundle/dmg/Lattice AI_9.8.0_aarch64.dmg`
98
+ - `dist/ltcai-9.9.1-py3-none-any.whl`
99
+ - `dist/ltcai-9.9.1.tar.gz`
100
+ - `ltcai-9.9.1.tgz`
101
+ - `dist/ltcai-9.9.1.vsix`
102
+ - `src-tauri/target/release/bundle/dmg/Lattice AI_9.9.1_aarch64.dmg`
90
103
 
91
104
  Do not use wildcard artifact uploads. Package registry publishing remains owner-run.
92
105
 
@@ -106,16 +119,20 @@ See [ARCHITECTURE.md](ARCHITECTURE.md) for details and
106
119
 
107
120
  - External package registries are owner-published and can lag behind GitHub.
108
121
  - PostgreSQL/pgvector is optional scale/migration tooling. SQLite remains the
109
- live local Brain store in 9.8.0.
122
+ live local Brain store in 9.9.1.
110
123
  - Docker, model downloads, cloud model calls, Telegram, Brain Network, and
111
124
  update checks require explicit user action.
112
- - Conversation does not fabricate answers when no model is loaded; LLM-free
113
- simulation is labeled as such.
125
+ - Conversation does not fabricate answers when no model is loaded. Agent and
126
+ workflow simulation without a loaded LLM is deterministic and LLM-free (it
127
+ does not call a model) — labeled as such, never presented as autonomous
128
+ model success.
114
129
 
115
130
  ## Release History
116
131
 
117
132
  | Version | Theme |
118
133
  | --- | --- |
134
+ | 9.9.1 | Clean Foundations |
135
+ | 9.9.0 | Fail-Closed Trust |
119
136
  | 9.8.0 | Honest Knowledge Pipeline |
120
137
  | 9.7.0 | Proactive Hybrid Brain |
121
138
  | 9.6.0 | Trusted Agent Loop |
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, {
@@ -0,0 +1,107 @@
1
+ # Model Robustness Benchmarks
2
+
3
+ > Status: reference 2026-07-21
4
+
5
+ Methodology and results for `scripts/bench_models.py`, a harness that measures
6
+ how well the agent loop turns model output into executable actions across model
7
+ quality tiers. Companion to [CI & Release Gates](CI_AND_RELEASE_GATES.md).
8
+
9
+ ## What is measured
10
+
11
+ The product claim is that the Brain stays durable "across any AI model": weaker
12
+ models emit sloppier output, but the loop repairs it and still completes the
13
+ task. The harness turns that into three numbers per tier:
14
+
15
+ - **success_rate** — fraction of model outputs that become a valid agent action
16
+ (the task can proceed).
17
+ - **repair_rate** — of the successful parses, the fraction that succeeded *only
18
+ because* the loop's tolerant parser had to repair the output. High = "this
19
+ tier leans hard on the loop's robustness".
20
+ - **latency_ms** — see the honesty note below.
21
+
22
+ Every output is fed through the **real** parser the production loop uses:
23
+ `latticeai.core.agent.extract_action_details` (called from `agent.py` in the
24
+ plan/execute/verify phases). The harness does not reimplement parsing — it
25
+ measures the shipping code. Its known repair tolerances are: `think_strip`
26
+ (strip `<think>` blocks), `fence` (unwrap ```` ```json ````), `slice` (extract
27
+ the `{...}` span from prose), `trailing_comma`, and `python_literal`
28
+ (`ast.literal_eval` of a single-quoted dict).
29
+
30
+ An `agent-loop` reference row additionally runs the real
31
+ `latticeai.core.agent_eval.run_agent_eval` state machine over its 20 scripted
32
+ scenarios and reports its success and recovery rates.
33
+
34
+ ## Honesty note on latency
35
+
36
+ In **scripted** mode, `latency_ms` is the **parse+repair cost only**
37
+ (microseconds). It is **not** model inference time and must not be read as such.
38
+ True generation latency is only meaningful in **live** mode against a real
39
+ endpoint.
40
+
41
+ ## Modes
42
+
43
+ 1. **scripted** (default; no model, no network): a curated corpus of
44
+ model-realistic outputs per tier. Deterministic; proves the harness works and
45
+ exposes the loop's repair boundary. Some weak-tier entries are *intentionally
46
+ broken* past the repair boundary so `success_rate < 1.0` is a real finding,
47
+ not a rigged demo. A self-check asserts every corpus entry's expected
48
+ parse/fail outcome matches reality (0 mismatches = healthy).
49
+ 2. **live** (opt-in): sends a fixed prompt set to an OpenAI-compatible local
50
+ endpoint (LM Studio / llama.cpp / vLLM), runs the real completions through
51
+ the same parser, and reports **true** generation latency. Falls back to a
52
+ clear "SKIPPED" line if the endpoint is unreachable.
53
+
54
+ ## Running
55
+
56
+ ```bash
57
+ # Scripted matrix (always works):
58
+ .venv/bin/python scripts/bench_models.py
59
+
60
+ # With machine-readable output:
61
+ .venv/bin/python scripts/bench_models.py --json bench.json
62
+
63
+ # Against a real local model (OpenAI-compatible endpoint):
64
+ .venv/bin/python scripts/bench_models.py \
65
+ --live-endpoint http://127.0.0.1:1234/v1 --model my-local-model
66
+ ```
67
+
68
+ Exit code is non-zero only if the harness self-check finds an inconsistency (a
69
+ real bug); a low score on a weak tier is a finding, not a failure.
70
+
71
+ ## Reference results (scripted, 2026-07-21)
72
+
73
+ Captured on the maintainer's machine; latency is parse-only.
74
+
75
+ | Tier | success_rate | repair_rate | n | repairs exercised |
76
+ |------|-------------:|------------:|--:|-------------------|
77
+ | frontier (clean JSON) | 1.00 | 0.00 | 6 | — |
78
+ | mid-local (fenced/prose/commas) | 1.00 | 1.00 | 6 | fence×3, slice×1, trailing_comma×2 |
79
+ | weak-local (think/py-literal/broken) | 0.625 | 1.00 | 8 | think_strip×2, python_literal×2, fence×1, trailing_comma×1 |
80
+
81
+ Agent-loop reference (real state machine): **success_rate 1.00**, **recovery_rate
82
+ 0.70** over 20 scenarios. Harness self-check: **0 mismatches**.
83
+
84
+ Reading the matrix: the mid tier is fully recoverable — every output needed a
85
+ repair, and all succeeded, which is exactly the "durable across models" claim in
86
+ action. The weak tier's 0.625 is the honest boundary: the 3 genuinely broken
87
+ outputs (pure prose, missing `action` field, truncated braces) cannot and should
88
+ not parse.
89
+
90
+ ## Measurable vs not-measurable (honest scope)
91
+
92
+ **This harness can measure:**
93
+ - Whether a given model's raw output survives the loop's parser (success_rate).
94
+ - How much the loop's repair layer is doing the work (repair_rate + which
95
+ tolerances fire).
96
+ - Real end-to-end generation latency in `live` mode.
97
+ - End-to-end loop completion over the scripted scenario suite.
98
+
99
+ **This harness does NOT measure:**
100
+ - Task *correctness* / answer quality — only that an action is well-formed and
101
+ executable, not that it is the *right* action.
102
+ - Multi-turn reasoning quality or tool-selection accuracy beyond the scripted
103
+ scenarios.
104
+ - Throughput/latency under concurrency or on other hardware.
105
+ - Any cloud model (no keys are used; live mode targets local endpoints only).
106
+ - A representative sample of "all models" — scripted tiers are archetypes, not a
107
+ statistical population. For real numbers on a specific model, use `live` mode.
package/docs/CHANGELOG.md CHANGED
@@ -4,6 +4,88 @@ 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.1] - 2026-07-21
8
+
9
+ ### Removed
10
+ - All repo-root compatibility shims except `server.py`: `ltcai_cli.py`,
11
+ `auto_setup.py`, `setup_wizard.py`, `mcp_registry.py`, `kg_schema.py`,
12
+ `knowledge_graph.py`, `knowledge_graph_api.py`, `local_knowledge_api.py`,
13
+ `llm_router.py`, `p_reinforce.py`, `telegram_bot.py`, and the root `tools/`
14
+ package (12 of 13 tracked shims, 92%). Canonical imports are the
15
+ `latticeai.*` / `lattice_brain.*` module paths; the console script and
16
+ `bin/ltcai.js` now target `latticeai.cli.entrypoint` directly.
17
+ - Stale release evidence: `output/release/` now keeps only the newest three
18
+ versioned evidence directories (automated retention policy).
19
+
20
+ ### Added
21
+ - Legacy debt gate: `scripts/check_legacy_debt.mjs` in `npm run lint` plus a
22
+ rewritten `tests/unit/test_legacy_root_shims.py` fail if a root module
23
+ reappears or any source tree imports a removed shim.
24
+ - `scripts/prune_release_evidence.mjs` retention policy (newest 3, override
25
+ with `LTCAI_RELEASE_EVIDENCE_KEEP`), wired into `npm run release:evidence`.
26
+ - First-run "First 5 minutes" guided card on the empty Brain home: ask a first
27
+ question, add a first file/note, see what the Brain learned — real feature
28
+ wiring, persistent progress, dismissible.
29
+ - Daily briefing on the Brain home (immediate fetch, friendly empty state) and
30
+ proactive quick actions on Cmd+K cold open (open briefing, review pending,
31
+ ask the Brain) with live counts.
32
+ - Localized API error pipeline: timeout/unreachable/status failures map to
33
+ friendly ko/en copy instead of raw `statusText` or English literals.
34
+ - `scripts/check_current_release_docs.mjs` now verifies the ARCHITECTURE.md
35
+ Release Artifact Map names current-version artifacts exactly.
36
+
37
+ ### Changed
38
+ - Review Center at product quality: translated status/source/risk/change-class
39
+ labels, framed diffs (file target, +/- coloring, honest truncation count),
40
+ raw IDs relegated to a collapsed "Technical details" disclosure, structured
41
+ success/failure feedback, and a distinct error state with retry for the
42
+ pending-proposals panel.
43
+ - Intelligence/care/admin/markdown panels show friendly i18n error copy first;
44
+ raw backend detail is demoted to secondary text.
45
+ - 37 version-named test files (`test_v3_*`, `test_v42_*` … `test_t9_*`,
46
+ `test_kg_v2/v4_*`) renamed to scenario-named suites; versioned test
47
+ function names cleaned up. Coverage is unchanged (1284 unit tests).
48
+ - Packaging: `pyproject.toml` ships a single root module (`server`);
49
+ `package.json` files list and `MANIFEST.in` no longer ship shim files.
50
+ - Docs: `docs/LEGACY_COMPATIBILITY.md` rewritten for the post-shim layout;
51
+ `docs/kg-schema.md` points at `lattice_brain/graph/schema.py`; ARCHITECTURE
52
+ artifact map and 9.8.0-era references brought current.
53
+
54
+ ## [9.9.0] - 2026-07-21
55
+
56
+ ### Fixed
57
+ - Change proposals record the target's original content hash and existence;
58
+ approval re-hashes the disk and rejects a modified/deleted/created target
59
+ with a 409 conflict instead of overwriting newer content. Applies are atomic
60
+ (`os.replace`) and serialized so duplicate/concurrent approvals apply once.
61
+ - The agent verifier no longer fabricates a PASS on unparseable critic output:
62
+ one strict repair retry, then the new terminal `NEEDS_REVIEW` state. `DONE`
63
+ now requires a valid PASS and deterministic execution evidence; the loose
64
+ `next_state == DONE` success path is removed.
65
+ - Device analysis no longer fabricates a `supported: true` model card on probe
66
+ failure; the recommendation screen models `loading | ready | unavailable`
67
+ and offers retry / continue-without-a-model.
68
+
69
+ ### Added
70
+ - `MUTATING_TOOL_INVENTORY` single-source governance classification for every
71
+ side-effecting tool, a fail-closed CI coverage gate, and dispatch-level
72
+ blocking (409) of existing-content overwrites that cannot be staged as a
73
+ reviewable proposal (`create_docx/xlsx/pptx/pdf`, `local_write`).
74
+ - Agent-eval result classification (`correct_completion` / `safe_termination`
75
+ / `needs_review` / `failed`) and fail-closed verifier scenarios (20 total).
76
+ - CI: `dependency-audit.yml` (pip-audit + npm audit + CycloneDX SBOM) and
77
+ scheduled `postgres-integration.yml`; all GitHub Actions SHA-pinned; a
78
+ frontend bundle-budget gate (150 KiB gzip).
79
+ - `docs/SECURITY_AUDIT.md`, `docs/BENCHMARKS.md` + `scripts/bench_models.py`,
80
+ `docs/USABILITY_AUDIT.md`, `docs/CI_AND_RELEASE_GATES.md`, and a
81
+ documentation status/link gate (`scripts/check_doc_status.mjs`).
82
+
83
+ ### Changed
84
+ - Initial JS bundle reduced ~22% (180.3 → 141.6 KiB gzip) via lazy-loaded
85
+ onboarding, Brain home, and command palette.
86
+ - `ARCHITECTURE.md` verified against the real module layout and corrected;
87
+ stale 9.6-era operational/feature/development docs updated and classified.
88
+
7
89
  ## [9.8.0] - 2026-07-20
8
90
 
9
91
  ### Added
@@ -0,0 +1,106 @@
1
+ # CI & Release Gates
2
+
3
+ > Status: reference 2026-07-21
4
+
5
+ Reference for the GitHub Actions workflows that guard `main` and releases, the
6
+ supply-chain hardening applied to them, and the recommended branch-protection
7
+ configuration. Companion to [SECURITY_AUDIT.md](SECURITY_AUDIT.md) and
8
+ [BENCHMARKS.md](BENCHMARKS.md).
9
+
10
+ ## Workflows
11
+
12
+ | Workflow | File | Triggers | Purpose |
13
+ |----------|------|----------|---------|
14
+ | CI | `.github/workflows/ci.yml` | push/PR to `main` | Lint, typecheck, unit + integration tests, brain/agent eval gates, build + wheel smoke |
15
+ | Release | `.github/workflows/release.yml` | tags `v*` / `[0-9]*` | Build & validate all artifacts (no publish) |
16
+ | Visual Smoke | `.github/workflows/visual.yml` | push/PR, nightly cron, dispatch | Playwright visual smoke |
17
+ | **Dependency Audit** | `.github/workflows/dependency-audit.yml` | push/PR, weekly cron, dispatch | pip-audit + npm audit + CycloneDX SBOMs |
18
+ | **Postgres Integration** | `.github/workflows/postgres-integration.yml` | weekly cron, dispatch | Live SQLite→Postgres/pgvector migration test |
19
+
20
+ The last two were added for the P2 deployment-trust / supply-chain workstream.
21
+
22
+ ## Supply-chain hardening: pinned actions
23
+
24
+ Every third-party `uses:` in every workflow is pinned to an **immutable commit
25
+ SHA**, with the human-readable version in a trailing comment. A moving tag
26
+ (`@v4`) can be repointed by the action owner; a SHA cannot. SHAs were resolved
27
+ from the authoritative upstream refs via `git ls-remote --tags` on 2026-07-21.
28
+
29
+ | Action | Tag | Pinned commit SHA |
30
+ |--------|-----|-------------------|
31
+ | actions/checkout | v4.4.0 | `11d5960a326750d5838078e36cf38b85af677262` |
32
+ | actions/checkout | v5.1.0 | `fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09` |
33
+ | actions/setup-python | v5.6.0 | `a26af69be951a213d495a4c3e4e4022e16d87065` |
34
+ | actions/setup-python | v6.3.0 | `ece7cb06caefa5fff74198d8649806c4678c61a1` |
35
+ | actions/setup-node | v5.0.0 | `a0853c24544627f65ddf259abe73b1d18a591444` |
36
+ | actions/upload-artifact | v4.6.2 | `ea165f8d65b6e75b540449e92b4886f43607fa02` |
37
+
38
+ Pinning coverage: **100% of current `uses:` entries** across `ci.yml`,
39
+ `release.yml`, `visual.yml`, `dependency-audit.yml`, and
40
+ `postgres-integration.yml`. All are first-party `actions/*`. If a third-party
41
+ action is added later, resolve and pin its SHA the same way before merge.
42
+
43
+ ## Dependency-audit gate posture (conservative)
44
+
45
+ The audit workflow is intentionally **non-blocking on day-to-day PRs** and
46
+ **strict on the scheduled/dispatch run**:
47
+
48
+ - `push` / `pull_request`: `pip-audit` and `npm audit` run with
49
+ `continue-on-error` keyed on the event name, so a newly-disclosed CVE in a
50
+ transitive dependency never reddens an unrelated PR. Findings still appear in
51
+ the job summary and uploaded report artifacts.
52
+ - `schedule` (weekly) / `workflow_dispatch`: the same steps run **strict** —
53
+ `pip-audit --strict` fails on any known vuln; `npm audit --audit-level=high`
54
+ fails on high/critical. This is the loud channel for triage.
55
+
56
+ CycloneDX SBOMs (`sbom-python.json`, `sbom-npm.json`) are produced every run and
57
+ uploaded as artifacts. Regenerate locally with `scripts/generate_sbom.py`.
58
+
59
+ **To promote to a required blocking PR check:** remove the `continue-on-error`
60
+ expressions in `dependency-audit.yml` and add `python-audit` / `npm-audit` to
61
+ the required-checks list below.
62
+
63
+ ## Postgres integration gate
64
+
65
+ `postgres-integration.yml` runs the migration-integrity suite
66
+ (`tests/integration/test_postgres_migration_live.py`) that is skipped
67
+ everywhere else. The suite is gated by `LTCAI_LIVE_POSTGRES_DOCKER_CONSENT=1`;
68
+ the workflow sets that variable, and the test itself starts and tears down a
69
+ `pgvector/pgvector:pg16` container via `docker compose` (preinstalled on
70
+ GitHub-hosted `ubuntu-latest`). It is deliberately kept off the PR path (slow,
71
+ image pull, needs Docker) and runs weekly + on demand.
72
+
73
+ ## Recommended branch protection for `main`
74
+
75
+ Required status checks (blocking):
76
+
77
+ - `CI / Test (Python 3.11)`
78
+ - `CI / Test (Python 3.12)`
79
+ - `CI / Integration smoke test`
80
+ - `CI / Build package`
81
+ - `Visual Smoke / Playwright visual smoke`
82
+
83
+ Advisory / non-blocking today (promote when the team is ready):
84
+
85
+ - `Dependency Audit / Python dependency audit (pip-audit)`
86
+ - `Dependency Audit / npm dependency audit`
87
+
88
+ Additional recommended settings: require PRs before merge, require branches to
89
+ be up to date, require linear history, and dismiss stale approvals on new
90
+ commits.
91
+
92
+ ## Release gate (publication safety)
93
+
94
+ `release.yml` builds and validates artifacts only — it never publishes. Package
95
+ publication (PyPI / npm / VS Code Marketplace / Open VSX) is a manual step
96
+ (`npm run publish:*`) using **exact version filenames**, never a `dist/*` glob,
97
+ so pushing a tag can never publish by accident. See
98
+ [../RELEASE.md](../RELEASE.md) for the full procedure.
99
+
100
+ ## Limitations (honest)
101
+
102
+ - Branch-protection rules are repository settings and cannot be committed from a
103
+ workflow; the list above is the recommended configuration to apply in GitHub
104
+ settings, not an enforced artifact.
105
+ - The audit gate depends on upstream advisory databases (OSV, npm registry);
106
+ absence of findings means "nothing known", not "provably safe".
@@ -1,6 +1,6 @@
1
1
  # Community And Plugins
2
2
 
3
- Current release: **9.8.0Honest Knowledge Pipeline**.
3
+ Current release: **9.9.1Clean Foundations**.
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
@@ -1,10 +1,13 @@
1
1
  # Lattice AI Development
2
2
 
3
- Current release: **9.8.0Honest Knowledge Pipeline**.
3
+ > **Status: canonical** — current contributor guidance, kept in sync with the
4
+ > current release.
5
+
6
+ Current release: **9.9.1 — Clean Foundations**.
4
7
 
5
8
  This document is for contributors working on the local-first Digital Brain
6
9
  codebase. Product positioning and quick start stay in `README.md`; release
7
- history is intentionally limited to 8.0.0-9.6.0 in `docs/CHANGELOG.md` and
10
+ history is intentionally limited to 8.0.0-9.9.0 in `docs/CHANGELOG.md` and
8
11
  `RELEASE.md`.
9
12
 
10
13
  ## Product Contract
@@ -153,10 +156,10 @@ For user-facing, API, runtime, release, or packaging changes, check:
153
156
  Release/publish examples must use exact target-version filenames. Do not
154
157
  document wildcard artifact upload commands.
155
158
 
156
- For 9.6.0 release work, exact artifacts are:
159
+ For 9.9.0 release work, exact artifacts are:
157
160
 
158
- - `dist/ltcai-9.6.0-py3-none-any.whl`
159
- - `dist/ltcai-9.6.0.tar.gz`
160
- - `ltcai-9.6.0.tgz`
161
- - `dist/ltcai-9.6.0.vsix`
162
- - `src-tauri/target/release/bundle/dmg/Lattice AI_9.6.0_aarch64.dmg`
161
+ - `dist/ltcai-9.9.0-py3-none-any.whl`
162
+ - `dist/ltcai-9.9.0.tar.gz`
163
+ - `ltcai-9.9.0.tgz`
164
+ - `dist/ltcai-9.9.0.vsix`
165
+ - `src-tauri/target/release/bundle/dmg/Lattice AI_9.9.0_aarch64.dmg`
@@ -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.8.0Honest Knowledge Pipeline**.
3
+ Current release: **9.9.1Clean Foundations**.
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