ltcai 7.2.0 → 7.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.
package/README.md CHANGED
@@ -200,29 +200,33 @@ See [docs/DEVELOPMENT.md](docs/DEVELOPMENT.md) for developer workflow details.
200
200
 
201
201
  ## Current Release
202
202
 
203
- The current release is **7.2.0 Runtime Trust Baseline**:
204
-
205
- - Agent runs can be previewed before execution, including selected roles,
206
- clamped retry budget, readiness state, and blocking reasons.
207
- - Product agent execution refuses simulation-mode success unless simulation is
208
- explicitly enabled for a non-product runtime.
209
- - ToolRegistry exposes a live manifest and diagnostics endpoint covering
210
- dispatch handlers, governance policy, catalog descriptions, and permissions.
211
- - Tool governance/catalog drift is covered by unit tests so tool additions
212
- cannot silently bypass policy or disappear from operator views.
213
- - 7.1.0 Brain usability work remains intact while the runtime gains clearer
214
- contracts for admin surfaces and future AgentRuntime extraction.
215
-
216
- Expected artifacts for 7.2.0 release must use exact filenames:
217
-
218
- - `dist/ltcai-7.2.0-py3-none-any.whl`
219
- - `dist/ltcai-7.2.0.tar.gz`
220
- - `ltcai-7.2.0.tgz`
221
- - `dist/ltcai-7.2.0.vsix`
222
- - `src-tauri/target/release/bundle/dmg/Lattice AI_7.2.0_aarch64.dmg`
203
+ The current release is **7.3.0 Runtime Contract & Retrieval Quality**:
204
+
205
+ - Single-agent and multi-agent execution now share a serializable
206
+ `agent-run-contract/v1` payload for run identity, mode, status, roles,
207
+ timeline, retries, artifacts, and terminal state.
208
+ - Agent runtime API responses include the shared contract, keeping real and
209
+ simulated run history distinguishable as runtime extraction continues.
210
+ - Brain quality evaluation now includes deterministic hybrid recall/ranking
211
+ regression thresholds, not only "some recall exists" checks.
212
+ - The 7.2.0 preview/diagnostics work remains the admin trust surface while
213
+ 7.3.0 tightens the underlying run and retrieval contracts.
214
+ - The roadmap focus is durability over model choice: knowledge, run evidence,
215
+ and retrieval quality become measurable product assets.
216
+
217
+ Expected artifacts for 7.3.0 release must use exact filenames:
218
+
219
+ - `dist/ltcai-7.3.0-py3-none-any.whl`
220
+ - `dist/ltcai-7.3.0.tar.gz`
221
+ - `ltcai-7.3.0.tgz`
222
+ - `dist/ltcai-7.3.0.vsix`
223
+ - `src-tauri/target/release/bundle/dmg/Lattice AI_7.3.0_aarch64.dmg`
223
224
 
224
225
  Do not upload `dist/*`. Package registry publishing remains owner-run.
225
226
 
227
+ See [docs/ROADMAP_RECOMMENDATIONS.md](docs/ROADMAP_RECOMMENDATIONS.md) for the
228
+ strategic roadmap slice applied in 7.3.0 and the follow-up tracks.
229
+
226
230
  ## Known Limitations
227
231
 
228
232
  - External package registries are owner-published and can lag behind GitHub.
@@ -238,6 +242,7 @@ Do not upload `dist/*`. Package registry publishing remains owner-run.
238
242
 
239
243
  | Version | Theme |
240
244
  | --- | --- |
245
+ | 7.3.0 | Runtime Contract & Retrieval Quality: shared agent-run contract across runtimes plus deterministic hybrid recall/ranking regression gates |
241
246
  | 7.2.0 | Runtime Trust Baseline: agent run preview/readiness, simulation-mode guardrails, live ToolRegistry manifest/diagnostics, and tests for dispatch/governance/catalog drift |
242
247
  | 7.1.0 | Brain Usability Completion: clearer first-run onboarding, ingestion progress/emergence, richer graph controls, inline answer proof, workspace/profile/admin discovery, empty/error/consent feedback, and VS Code sync status |
243
248
  | 7.0.0 | Brain Productization Loop: first-screen ingestion for files/folders/notes/web, answer-level memory proof and source citations, model-continuity demo flow, five-minute first-run loop, and recall/KG quality eval in CI |
package/docs/CHANGELOG.md CHANGED
@@ -4,6 +4,27 @@ 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
+ ## [7.3.0] - 2026-06-20
8
+
9
+ > Runtime Contract & Retrieval Quality. Turns the next AgentRuntime extraction
10
+ > step and the uploaded roadmap's hybrid-search quality goals into a small,
11
+ > tested release: shared run contracts and deterministic recall regression.
12
+
13
+ ### Added
14
+ - `lattice_brain.runtime.contracts.AgentRunContract`, a serializable
15
+ `agent-run-contract/v1` payload shared by single-agent and multi-agent
16
+ execution paths.
17
+ - Multi-agent API result/run patches now include the shared contract with
18
+ runtime, mode, status, roles, retries, timeline, and terminal-state data.
19
+ - Single-agent runtime exposes the same contract helper for UI/API/storage
20
+ convergence in the next extraction pass.
21
+ - `scripts/brain_quality_eval.py` now runs deterministic hybrid recall/ranking
22
+ regression checks with recall and precision thresholds.
23
+
24
+ ### Changed
25
+ - Package/runtime/static metadata is synchronized to 7.3.0; package publish and
26
+ deployment remain owner-run only.
27
+
7
28
  ## [7.2.0] - 2026-06-20
8
29
 
9
30
  > Runtime Trust Baseline. Adds execution preview and registry diagnostics so
@@ -0,0 +1,55 @@
1
+ # Strategic Roadmap Recommendations
2
+
3
+ This roadmap captures the 2026-06-20 product direction input and maps it to
4
+ small release-sized work. The operating principle stays unchanged:
5
+
6
+ > Models are temporary. Knowledge is durable. The Brain is the product.
7
+
8
+ ## 7.3.0 Applied Slice
9
+
10
+ 7.3.0 implements the first narrow slice of the roadmap:
11
+
12
+ - Runtime evolution: single-agent and multi-agent execution share
13
+ `agent-run-contract/v1`, making mode/status/timeline evidence inspectable.
14
+ - Hybrid search optimization: the Brain quality gate now includes deterministic
15
+ recall and ranking regression thresholds.
16
+ - Security and trust: run contracts distinguish runtime type and execution mode
17
+ so simulated output is not presented as real execution.
18
+
19
+ ## Near-Term Tracks
20
+
21
+ 1. Retrieval quality and scale
22
+ - Expand fixture datasets for hybrid search.
23
+ - Add latency budgets for large corpora.
24
+ - Track recall, precision, and ranking regressions in CI.
25
+ - Tune semantic/graph/keyword fusion by query class.
26
+
27
+ 2. Incremental ingestion
28
+ - Add background indexing jobs.
29
+ - Detect duplicates and merge memory candidates.
30
+ - Surface conflict resolution for contradictory memories.
31
+
32
+ 3. Runtime convergence
33
+ - Use `agent-run-contract/v1` across single-agent, multi-agent, workflows,
34
+ audit logs, and UI event streams.
35
+ - Keep simulation mode explicit and never record it as product success.
36
+ - Route tools through explicit registry/governance contracts.
37
+
38
+ 4. Brain SDK boundary
39
+ - Continue extracting `lattice_brain` as a reusable Brain Core package.
40
+ - Keep compatibility shims until downstream imports are migrated.
41
+ - Preserve migration rollback paths for graph and memory storage.
42
+
43
+ 5. Trust and operations
44
+ - Extend audit logging around tool execution and retrieval injection.
45
+ - Add dependency vulnerability monitoring.
46
+ - Add Tauri update/rollback planning before enabling auto-update.
47
+
48
+ ## Longer-Term Tracks
49
+
50
+ - Multi-modal ingestion and retrieval for images, audio, and video.
51
+ - Proactive Brain synthesis, contradiction detection, and recommendations.
52
+ - Temporal reasoning over historical graph states.
53
+ - Interoperability with Obsidian, Notion, Email, Calendar, Git, Slack, and Teams.
54
+ - Encrypted Brain Network sharing.
55
+ - Plugin marketplace and public benchmarks.
@@ -26,7 +26,7 @@ from .storage import (
26
26
  storage_from_env,
27
27
  )
28
28
 
29
- __version__ = "7.2.0"
29
+ __version__ = "7.3.0"
30
30
 
31
31
  __all__ = [
32
32
  "AgentRuntime",
@@ -37,6 +37,7 @@ from .multi_agent import (
37
37
  MULTI_AGENT_VERSION,
38
38
  ROLE_AGENT_IDS,
39
39
  )
40
+ from .contracts import multi_agent_contract
40
41
 
41
42
  ROLE_DESCRIPTIONS = {
42
43
  "researcher": "Gathers workspace context and memory for the goal.",
@@ -344,6 +345,7 @@ class AgentRuntime:
344
345
  "retry_history": result.retry_history,
345
346
  "memory_snapshots": result.memory_snapshots,
346
347
  "mode": getattr(result, "mode", "simulation"),
348
+ "contract": multi_agent_contract(result=result, goal=goal),
347
349
  "current_role": None,
348
350
  }
349
351
 
@@ -509,6 +511,12 @@ class AgentRuntime:
509
511
  status=updated.get("status") or result.status,
510
512
  )
511
513
  result_payload = result.as_dict()
514
+ result_payload["contract"] = multi_agent_contract(
515
+ result=result,
516
+ goal=goal,
517
+ run_id=run_id,
518
+ current_role=updated.get("current_role") if isinstance(updated, dict) else None,
519
+ )
512
520
  if updated.get("status") == "cancelled":
513
521
  result_payload = {"status": "cancelled", "reason": updated.get("cancel_reason"), "completed_result": result_payload}
514
522
  payload = {"run": updated, "result": result_payload}
@@ -601,7 +609,9 @@ class AgentRuntime:
601
609
  user_email=user_email, workspace_id=scope,
602
610
  )
603
611
 
604
- payload = {"run": run, "result": result.as_dict()}
612
+ result_payload = result.as_dict()
613
+ result_payload["contract"] = multi_agent_contract(result=result, goal=goal, run_id=run.get("id") if isinstance(run, dict) else None)
614
+ payload = {"run": run, "result": result_payload}
605
615
  if pre_dispatch is not None:
606
616
  payload["pre_run_hooks"] = pre_dispatch
607
617
  if post_dispatch is not None:
@@ -0,0 +1,107 @@
1
+ """Shared runtime contracts for agent execution surfaces.
2
+
3
+ These contracts are deliberately small and serializable. The single-agent
4
+ state machine and the multi-agent facade can evolve independently, but callers
5
+ should see the same run identity, mode, status, role, timeline and artifact
6
+ shape across both paths.
7
+ """
8
+
9
+ from __future__ import annotations
10
+
11
+ from dataclasses import dataclass, field
12
+ from datetime import datetime
13
+ from typing import Any, Dict, List, Optional
14
+
15
+
16
+ def runtime_timestamp() -> str:
17
+ return datetime.now().isoformat(timespec="seconds")
18
+
19
+
20
+ @dataclass(frozen=True)
21
+ class AgentRunContract:
22
+ run_id: Optional[str]
23
+ agent_id: str
24
+ runtime: str
25
+ mode: str
26
+ status: str
27
+ goal: str
28
+ roles: List[str] = field(default_factory=list)
29
+ current_role: Optional[str] = None
30
+ retries: int = 0
31
+ timeline: List[Dict[str, Any]] = field(default_factory=list)
32
+ artifacts: List[Dict[str, Any]] = field(default_factory=list)
33
+ blocking_reasons: List[str] = field(default_factory=list)
34
+ schema_version: str = "agent-run-contract/v1"
35
+
36
+ @property
37
+ def is_terminal(self) -> bool:
38
+ return self.status in {"ok", "retried_ok", "failed", "rejected", "cancelled", "interrupted", "partial", "done"}
39
+
40
+ def as_dict(self) -> Dict[str, Any]:
41
+ return {
42
+ "schema_version": self.schema_version,
43
+ "run_id": self.run_id,
44
+ "agent_id": self.agent_id,
45
+ "runtime": self.runtime,
46
+ "mode": self.mode,
47
+ "status": self.status,
48
+ "goal": self.goal,
49
+ "roles": list(self.roles),
50
+ "current_role": self.current_role,
51
+ "retries": self.retries,
52
+ "timeline": list(self.timeline),
53
+ "artifacts": list(self.artifacts),
54
+ "blocking_reasons": list(self.blocking_reasons),
55
+ "is_terminal": self.is_terminal,
56
+ }
57
+
58
+
59
+ def multi_agent_contract(
60
+ *,
61
+ result: Any,
62
+ goal: str,
63
+ run_id: Optional[str] = None,
64
+ current_role: Optional[str] = None,
65
+ blocking_reasons: Optional[List[str]] = None,
66
+ ) -> Dict[str, Any]:
67
+ return AgentRunContract(
68
+ run_id=run_id,
69
+ agent_id=getattr(result, "agent_id", "agent:executor"),
70
+ runtime="multi_agent",
71
+ mode=getattr(result, "mode", "simulation"),
72
+ status=getattr(result, "status", "unknown"),
73
+ goal=goal,
74
+ roles=list(getattr(result, "roles_run", []) or []),
75
+ current_role=current_role,
76
+ retries=int(getattr(result, "retries", 0) or 0),
77
+ timeline=list(getattr(result, "timeline", []) or []),
78
+ artifacts=[],
79
+ blocking_reasons=list(blocking_reasons or []),
80
+ ).as_dict()
81
+
82
+
83
+ def single_agent_contract(
84
+ *,
85
+ ctx: Any,
86
+ goal: str,
87
+ run_id: Optional[str] = None,
88
+ agent_id: str = "agent:single",
89
+ mode: str = "llm",
90
+ blocking_reasons: Optional[List[str]] = None,
91
+ ) -> Dict[str, Any]:
92
+ state = getattr(getattr(ctx, "state", None), "value", getattr(ctx, "state", "unknown"))
93
+ status = "done" if state == "DONE" else "failed" if state == "FAILED" else str(state or "unknown").lower()
94
+ return AgentRunContract(
95
+ run_id=run_id,
96
+ agent_id=agent_id,
97
+ runtime="single_agent",
98
+ mode=mode,
99
+ status=status,
100
+ goal=goal,
101
+ roles=["planner", "executor", "critic"],
102
+ current_role=str(state or ""),
103
+ retries=int(getattr(ctx, "retry_count", 0) or 0),
104
+ timeline=list(getattr(ctx, "transcript", []) or []),
105
+ artifacts=[],
106
+ blocking_reasons=list(blocking_reasons or []),
107
+ ).as_dict()
@@ -18,8 +18,10 @@ from dataclasses import dataclass, field
18
18
  from datetime import datetime
19
19
  from typing import Any, Callable, Dict, List, Optional
20
20
 
21
+ from .contracts import multi_agent_contract
21
22
 
22
- MULTI_AGENT_VERSION = "7.2.0"
23
+
24
+ MULTI_AGENT_VERSION = "7.3.0"
23
25
 
24
26
  AGENT_ROLES = ("researcher", "planner", "executor", "reviewer", "release")
25
27
  CORE_PIPELINE = ("planner", "executor", "reviewer")
@@ -288,7 +290,7 @@ class AgentRunResult:
288
290
  mode: str = "simulation"
289
291
 
290
292
  def as_dict(self) -> Dict[str, Any]:
291
- return {
293
+ payload = {
292
294
  "agent_id": self.agent_id,
293
295
  "mode": self.mode,
294
296
  "status": self.status,
@@ -305,6 +307,8 @@ class AgentRunResult:
305
307
  "plan_review": self.plan_review,
306
308
  "memory_snapshots": self.memory_snapshots,
307
309
  }
310
+ payload["contract"] = multi_agent_contract(result=self, goal=self.output)
311
+ return payload
308
312
 
309
313
 
310
314
  def default_role_runner(
@@ -1,3 +1,3 @@
1
1
  """Lattice AI - modular server package."""
2
2
 
3
- __version__ = "7.2.0"
3
+ __version__ = "7.3.0"
@@ -30,6 +30,7 @@ from pathlib import Path
30
30
  from typing import Any, Awaitable, Callable, Dict, FrozenSet, List, Optional
31
31
 
32
32
  from lattice_brain.runtime.hooks import dispatch_tool
33
+ from lattice_brain.runtime.contracts import single_agent_contract
33
34
  from tools import ToolError
34
35
 
35
36
 
@@ -142,6 +143,10 @@ class AgentRuntime:
142
143
  def __init__(self, deps: AgentDeps) -> None:
143
144
  self.deps = deps
144
145
 
146
+ def contract(self, ctx: AgentRunContext, req: Any, *, run_id: Optional[str] = None) -> Dict[str, Any]:
147
+ """Expose the shared agent-run contract for the single-agent loop."""
148
+ return single_agent_contract(ctx=ctx, goal=getattr(req, "message", ""), run_id=run_id)
149
+
145
150
  # ── PLAN ─────────────────────────────────────────────────────────
146
151
  async def plan(
147
152
  self, ctx: AgentRunContext, req: Any, lang_hint: str, current_user: str,
@@ -11,7 +11,7 @@ from copy import deepcopy
11
11
  from typing import Any, Dict, List, Optional
12
12
 
13
13
 
14
- MARKETPLACE_VERSION = "7.2.0"
14
+ MARKETPLACE_VERSION = "7.3.0"
15
15
  TEMPLATE_KINDS = ("plugin", "workflow", "agent")
16
16
 
17
17
 
@@ -19,7 +19,7 @@ from pathlib import Path
19
19
  from typing import Any, Callable, Dict, Iterable, List, Optional
20
20
 
21
21
 
22
- WORKSPACE_OS_VERSION = "7.2.0"
22
+ WORKSPACE_OS_VERSION = "7.3.0"
23
23
 
24
24
  # Workspace types separate single-user Personal workspaces from shared
25
25
  # Organization workspaces. Both keep the same local-first JSON store; the type
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ltcai",
3
- "version": "7.2.0",
3
+ "version": "7.3.0",
4
4
  "description": "Lattice AI — local-first Digital Brain that keeps your knowledge durable across any AI model.",
5
5
  "homepage": "https://github.com/TaeSooPark-PTS/LatticeAI#readme",
6
6
  "repository": {
@@ -12,6 +12,7 @@ import sys
12
12
  import tempfile
13
13
  from pathlib import Path
14
14
 
15
+ from lattice_brain.quality import RetrievalBenchmarkRunner
15
16
  from latticeai.services.memory_service import MemoryService
16
17
 
17
18
 
@@ -110,7 +111,29 @@ def main() -> int:
110
111
  if proof.get("proofs", {}).get("vector_items", 0) < 1:
111
112
  return _fail("vector items must be counted in Brain proof")
112
113
 
113
- print("brain-quality-eval: OK")
114
+ benchmark = RetrievalBenchmarkRunner()
115
+ retrieval_metrics = benchmark.run_fixture(
116
+ "7.3.0-hybrid-recall-regression",
117
+ [
118
+ {
119
+ "query": "first five minute Brain proof",
120
+ "relevant": ["note:first-loop", "doc:first-loop"],
121
+ "retrieved": [item.get("id") for item in recall_items],
122
+ },
123
+ {
124
+ "query": "local-first memory product wedge",
125
+ "relevant": ["decision:pricing"],
126
+ "retrieved": ["decision:pricing", "note:first-loop"],
127
+ },
128
+ ],
129
+ top_k=4,
130
+ )
131
+ if retrieval_metrics.get("recall@5", 0.0) < 0.75:
132
+ return _fail(f"hybrid recall regression below threshold: {retrieval_metrics}")
133
+ if retrieval_metrics.get("precision@5", 0.0) < 0.4:
134
+ return _fail(f"hybrid precision regression below threshold: {retrieval_metrics}")
135
+
136
+ print(f"brain-quality-eval: OK {retrieval_metrics}")
114
137
  return 0
115
138
 
116
139
 
@@ -1654,7 +1654,7 @@ dependencies = [
1654
1654
 
1655
1655
  [[package]]
1656
1656
  name = "lattice-ai-desktop"
1657
- version = "7.2.0"
1657
+ version = "7.3.0"
1658
1658
  dependencies = [
1659
1659
  "plist",
1660
1660
  "serde",
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "lattice-ai-desktop"
3
- version = "7.2.0"
3
+ version = "7.3.0"
4
4
  description = "Lattice AI Digital Brain desktop shell"
5
5
  authors = ["TaeSoo Park"]
6
6
  edition = "2021"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://schema.tauri.app/config/2",
3
3
  "productName": "Lattice AI",
4
- "version": "7.2.0",
4
+ "version": "7.3.0",
5
5
  "identifier": "ai.lattice.desktop",
6
6
  "build": {
7
7
  "beforeDevCommand": "npm run frontend:dev",
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "7.2.0",
2
+ "version": "7.3.0",
3
3
  "generated_at": "vite",
4
4
  "entrypoints": {
5
5
  "app": "/static/app/index.html"