memorix 1.1.13 → 1.2.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/CHANGELOG.md +19 -0
- package/README.md +3 -2
- package/README.zh-CN.md +3 -2
- package/dist/cli/index.js +36313 -31189
- package/dist/cli/index.js.map +1 -1
- package/dist/dashboard/static/app.js +50 -30
- package/dist/index.js +5348 -674
- package/dist/index.js.map +1 -1
- package/dist/maintenance-runner.d.ts +1 -1
- package/dist/maintenance-runner.js +3661 -293
- package/dist/maintenance-runner.js.map +1 -1
- package/dist/memcode-runtime/CHANGELOG.md +19 -0
- package/dist/sdk.d.ts +1 -1
- package/dist/sdk.js +5346 -672
- package/dist/sdk.js.map +1 -1
- package/docs/1.2.0-CLAIM-LEDGER.md +72 -0
- package/docs/1.2.0-CODE-STATE.md +61 -0
- package/docs/1.2.0-DEVELOPMENT-CHARTER.md +255 -0
- package/docs/1.2.0-DYNAMIC-LIFECYCLE.md +71 -0
- package/docs/1.2.0-EVALUATION-HARNESS.md +51 -0
- package/docs/1.2.0-IMPLEMENTATION-PLAN.md +554 -0
- package/docs/1.2.0-KNOWLEDGE-WORKFLOW-RESEARCH.md +205 -0
- package/docs/1.2.0-KNOWLEDGE-WORKSPACE.md +68 -0
- package/docs/1.2.0-PRODUCT-STORY.md +234 -0
- package/docs/1.2.0-PROVIDER-QUALITY.md +189 -0
- package/docs/1.2.0-WORKFLOW-INHERITANCE.md +101 -0
- package/docs/1.2.0-WORKSET-RETRIEVAL.md +80 -0
- package/docs/AGENT_OPERATOR_PLAYBOOK.md +6 -3
- package/docs/API_REFERENCE.md +25 -6
- package/docs/CONFIGURATION.md +21 -3
- package/docs/README.md +17 -2
- package/docs/dev-log/progress.txt +120 -40
- package/llms-full.txt +16 -2
- package/llms.txt +9 -4
- package/package.json +3 -2
- package/plugins/codex/memorix/.codex-plugin/plugin.json +1 -1
- package/src/cli/capability-map.ts +1 -0
- package/src/cli/commands/codegraph.ts +112 -9
- package/src/cli/commands/context.ts +2 -0
- package/src/cli/commands/doctor.ts +73 -4
- package/src/cli/commands/knowledge.ts +282 -0
- package/src/cli/commands/serve-http.ts +12 -1
- package/src/cli/index.ts +3 -1
- package/src/cli/tui/App.tsx +1 -1
- package/src/cli/tui/Panels.tsx +8 -8
- package/src/cli/tui/theme.ts +1 -1
- package/src/cli/tui/views/GraphView.tsx +8 -7
- package/src/cli/tui/views/KnowledgeView.tsx +9 -9
- package/src/codegraph/auto-context.ts +171 -9
- package/src/codegraph/code-state.ts +95 -0
- package/src/codegraph/context-pack.ts +82 -1
- package/src/codegraph/external-provider.ts +581 -0
- package/src/codegraph/lite-provider.ts +64 -19
- package/src/codegraph/project-context.ts +9 -1
- package/src/codegraph/store.ts +154 -6
- package/src/codegraph/types.ts +117 -0
- package/src/config/resolved-config.ts +28 -0
- package/src/config/toml-loader.ts +3 -0
- package/src/config/yaml-loader.ts +6 -0
- package/src/dashboard/server.ts +15 -1
- package/src/evaluation/workset-evaluation.ts +120 -0
- package/src/hooks/handler.ts +48 -6
- package/src/knowledge/claim-store.ts +267 -0
- package/src/knowledge/claims.ts +537 -0
- package/src/knowledge/markdown.ts +129 -0
- package/src/knowledge/types.ts +157 -0
- package/src/knowledge/wiki.ts +524 -0
- package/src/knowledge/workflow-store.ts +168 -0
- package/src/knowledge/workflow-types.ts +95 -0
- package/src/knowledge/workflows.ts +743 -0
- package/src/knowledge/workset.ts +515 -0
- package/src/knowledge/workspace-store.ts +220 -0
- package/src/knowledge/workspace-types.ts +106 -0
- package/src/knowledge/workspace.ts +220 -0
- package/src/memory/observations.ts +19 -0
- package/src/runtime/control-plane-maintenance.ts +5 -0
- package/src/runtime/isolated-maintenance.ts +5 -0
- package/src/runtime/lifecycle-status.ts +102 -0
- package/src/runtime/lifecycle.ts +107 -0
- package/src/runtime/maintenance-jobs.ts +5 -0
- package/src/runtime/project-maintenance.ts +190 -0
- package/src/server/tool-profile.ts +3 -2
- package/src/server.ts +354 -14
- package/src/store/file-lock.ts +24 -4
- package/src/store/sqlite-db.ts +307 -0
- package/src/wiki/generator.ts +4 -2
- package/src/wiki/knowledge-graph.ts +7 -4
- package/src/wiki/types.ts +16 -4
|
@@ -0,0 +1,554 @@
|
|
|
1
|
+
# Memorix 1.2 Implementation Plan
|
|
2
|
+
|
|
3
|
+
Status: execution contract
|
|
4
|
+
Branch: codex/1.2.0-multidimensional-memory
|
|
5
|
+
Baseline: memorix 1.1.13
|
|
6
|
+
Start: 2026-07-17
|
|
7
|
+
Companion documents: [Product Story](1.2.0-PRODUCT-STORY.md), [Development Charter](1.2.0-DEVELOPMENT-CHARTER.md), and [Knowledge and Workflow Research](1.2.0-KNOWLEDGE-WORKFLOW-RESEARCH.md)
|
|
8
|
+
|
|
9
|
+
## Mission
|
|
10
|
+
|
|
11
|
+
Deliver Memorix 1.2 as a local-first, multi-agent project working-context
|
|
12
|
+
system. It must turn durable project evidence into a small task Workset without
|
|
13
|
+
forcing users to remember commands, trust stale summaries, or install a
|
|
14
|
+
third-party graph product.
|
|
15
|
+
|
|
16
|
+
The release is complete only when all phases in this document pass their
|
|
17
|
+
implementation and verification gates. This is one continuous development goal,
|
|
18
|
+
not a collection of disconnected feature experiments.
|
|
19
|
+
|
|
20
|
+
## Product Contract
|
|
21
|
+
|
|
22
|
+
For a normal request such as "continue the migration failure," a supported
|
|
23
|
+
agent can obtain a compact Workset that answers:
|
|
24
|
+
|
|
25
|
+
1. where to start in current code;
|
|
26
|
+
2. what source-backed knowledge and workflow apply;
|
|
27
|
+
3. what changed since that knowledge was formed;
|
|
28
|
+
4. what is stale, incomplete, conflicted, or unknown;
|
|
29
|
+
5. what verification proves the next change is safe.
|
|
30
|
+
|
|
31
|
+
Memorix does not replace code reading, Git, tests, or agent judgment. It
|
|
32
|
+
chooses and qualifies the evidence that makes those activities start faster.
|
|
33
|
+
|
|
34
|
+
## Delivery Rules
|
|
35
|
+
|
|
36
|
+
- Complete all phases in this single goal, but do not advance a phase until its
|
|
37
|
+
acceptance tests pass.
|
|
38
|
+
- Keep the default MCP profile small. Project Context remains the primary
|
|
39
|
+
agent-facing entry point.
|
|
40
|
+
- Keep raw evidence, claims, wiki pages, workflow templates, and task runs
|
|
41
|
+
separate. A summary is never allowed to overwrite its evidence.
|
|
42
|
+
- Preserve local-first operation. No remote provider, cloud graph database, or
|
|
43
|
+
external CodeGraph installation is required for a useful result.
|
|
44
|
+
- Make every automatic write reviewable. Project-versioned wiki and workflow
|
|
45
|
+
changes default to proposed patches, not silent edits.
|
|
46
|
+
- Do not represent the existing memory visualization as a semantic graph or
|
|
47
|
+
maintained wiki until the corresponding contracts exist.
|
|
48
|
+
- Maintain Windows-safe paths, bounded background work, source secrecy, and
|
|
49
|
+
existing agent integration behavior.
|
|
50
|
+
|
|
51
|
+
## Existing Foundations to Reuse
|
|
52
|
+
|
|
53
|
+
| Existing foundation | 1.2 use |
|
|
54
|
+
| --- | --- |
|
|
55
|
+
| Shared SQLite database and maintenance queue | New schema, non-blocking compilation, lint, and refresh jobs |
|
|
56
|
+
| CodeGraphStore and CodeGraph Lite | Current structural evidence, snapshots, and bounded fallback provider |
|
|
57
|
+
| Observation and Git Memory stores | Durable narrative and commit evidence |
|
|
58
|
+
| Observation code references and freshness | Claim-to-code validity and stale detection |
|
|
59
|
+
| Mini-skills and SkillsEngine | Legacy knowledge sources and native agent adapter format |
|
|
60
|
+
| WorkspaceSyncEngine and WorkflowSyncer | Adapter-writing path, but no longer the canonical workflow format |
|
|
61
|
+
| project_context and context_pack | Workset retrieval surface and compatibility path |
|
|
62
|
+
| Dashboard and TUI Knowledge views | Knowledge, workflow, provenance, and health inspection surfaces |
|
|
63
|
+
| Doctor, background service, hook lifecycle | Diagnostics, scheduling, and integration health reporting |
|
|
64
|
+
|
|
65
|
+
## Target Architecture
|
|
66
|
+
|
|
67
|
+
~~~mermaid
|
|
68
|
+
flowchart LR
|
|
69
|
+
A["Evidence: Git, code snapshots, tests, documents, observations"] --> B["Claim Ledger"]
|
|
70
|
+
B --> C["Knowledge Workspace: Markdown wiki, index, lint"]
|
|
71
|
+
B --> D["Workflow Library: versioned playbooks"]
|
|
72
|
+
A --> E["Code State and provider health"]
|
|
73
|
+
C --> F["Workset Builder"]
|
|
74
|
+
D --> F
|
|
75
|
+
E --> F
|
|
76
|
+
F --> G["memorix_project_context"]
|
|
77
|
+
G --> H["Agent action and verification"]
|
|
78
|
+
H --> A
|
|
79
|
+
~~~
|
|
80
|
+
|
|
81
|
+
## Canonical Storage and Data Ownership
|
|
82
|
+
|
|
83
|
+
### SQLite is the operational index
|
|
84
|
+
|
|
85
|
+
SQLite remains the local operational store. It records metadata, relationships,
|
|
86
|
+
validity, source references, job state, search metadata, and audit history. It
|
|
87
|
+
does not become the only human-readable copy of long-lived project knowledge.
|
|
88
|
+
|
|
89
|
+
Add a small migration runner backed by a schema_migrations table. New 1.2
|
|
90
|
+
migrations are ordered and transactional. Existing idempotent initialization
|
|
91
|
+
remains compatible; no existing user data is rewritten or discarded.
|
|
92
|
+
|
|
93
|
+
### Knowledge artifacts have two modes
|
|
94
|
+
|
|
95
|
+
1. **Local mode** stores generated Markdown artifacts under the Memorix data
|
|
96
|
+
directory, scoped by project identity. This is private by default.
|
|
97
|
+
2. **Versioned mode** stores the same artifacts in a user-selected,
|
|
98
|
+
non-ignored project directory. The CLI must require an explicit path or
|
|
99
|
+
explicit init choice before creating project files. It must not assume that
|
|
100
|
+
the repository's ignored .memorix directory is versioned.
|
|
101
|
+
|
|
102
|
+
Both modes use the same Markdown format. SQLite stores page metadata and index
|
|
103
|
+
state, not an opaque replacement for the page.
|
|
104
|
+
|
|
105
|
+
### Raw sources stay raw
|
|
106
|
+
|
|
107
|
+
Documents, Git facts, tests, observations, and captured execution evidence are
|
|
108
|
+
referenced by stable identifiers and hashes. The default policy does not copy
|
|
109
|
+
all project files or all conversations into the wiki. Large, binary, secret, or
|
|
110
|
+
generated paths remain excluded using existing CodeGraph and secret filters.
|
|
111
|
+
|
|
112
|
+
## Data Contracts
|
|
113
|
+
|
|
114
|
+
### CodeStateSnapshot
|
|
115
|
+
|
|
116
|
+
~~~text
|
|
117
|
+
CodeStateSnapshot
|
|
118
|
+
id
|
|
119
|
+
projectId
|
|
120
|
+
provider
|
|
121
|
+
baseRevision
|
|
122
|
+
worktreeFingerprint
|
|
123
|
+
worktreeState clean, dirty, unavailable
|
|
124
|
+
changedPathCount
|
|
125
|
+
indexedAt
|
|
126
|
+
sourceEpoch
|
|
127
|
+
completenessJson
|
|
128
|
+
previousSnapshotId
|
|
129
|
+
~~~
|
|
130
|
+
|
|
131
|
+
A snapshot is created by a bounded refresh or a fast project-state check. The
|
|
132
|
+
fingerprint derives from Git metadata and path status, not from storing a second
|
|
133
|
+
copy of source code. Completeness records file limits, skipped oversized files,
|
|
134
|
+
ignored paths, parser coverage, and scan errors.
|
|
135
|
+
|
|
136
|
+
Add snapshotId and sourceEpoch columns to code files, symbols, edges, and new
|
|
137
|
+
claim/code references where needed. Existing code reference hashes remain the
|
|
138
|
+
fine-grained freshness signal.
|
|
139
|
+
|
|
140
|
+
### Knowledge claims
|
|
141
|
+
|
|
142
|
+
~~~text
|
|
143
|
+
KnowledgeClaim
|
|
144
|
+
id
|
|
145
|
+
projectId
|
|
146
|
+
subject
|
|
147
|
+
predicate
|
|
148
|
+
objectValue
|
|
149
|
+
scope project, workspace, team, workflow, task
|
|
150
|
+
status active, superseded, disputed, unknown
|
|
151
|
+
confidence
|
|
152
|
+
observedAt
|
|
153
|
+
validFrom
|
|
154
|
+
validTo
|
|
155
|
+
supersededBy
|
|
156
|
+
reviewState
|
|
157
|
+
createdAt
|
|
158
|
+
updatedAt
|
|
159
|
+
~~~
|
|
160
|
+
|
|
161
|
+
A claim has evidence rows rather than a hidden free-form relationship:
|
|
162
|
+
|
|
163
|
+
~~~text
|
|
164
|
+
ClaimEvidenceRef
|
|
165
|
+
claimId
|
|
166
|
+
evidenceKind observation, git, code, test, document, workflow, run
|
|
167
|
+
evidenceId
|
|
168
|
+
relation supports, contradicts, derives, verifies
|
|
169
|
+
snapshotId
|
|
170
|
+
locator
|
|
171
|
+
capturedHash
|
|
172
|
+
createdAt
|
|
173
|
+
~~~
|
|
174
|
+
|
|
175
|
+
Multiple claims with the same subject, predicate, and scope may coexist. A
|
|
176
|
+
conflict is visible; it is not overwritten by the newest model output. A claim
|
|
177
|
+
becomes superseded only through explicit evidence-aware resolution.
|
|
178
|
+
|
|
179
|
+
### Wiki pages
|
|
180
|
+
|
|
181
|
+
Each generated page is Markdown with frontmatter that includes a stable id,
|
|
182
|
+
title, kind, status, claim ids, evidence references, code snapshot reference,
|
|
183
|
+
tags, review state, and updated time. Supporting tables track page metadata,
|
|
184
|
+
claim links, and page links for fast retrieval and linting.
|
|
185
|
+
|
|
186
|
+
Required artifacts:
|
|
187
|
+
|
|
188
|
+
- index.md: content-oriented page catalog;
|
|
189
|
+
- log.md: append-only knowledge evolution log;
|
|
190
|
+
- pages/: interlinked topic, subsystem, decision, and risk pages;
|
|
191
|
+
- workflows/: canonical project playbooks;
|
|
192
|
+
- schema.md: the local maintenance rules used by agents and linting.
|
|
193
|
+
|
|
194
|
+
### Workflow inheritance
|
|
195
|
+
|
|
196
|
+
A canonical workflow is Markdown with YAML frontmatter. It is not generated
|
|
197
|
+
from an agent-specific source format.
|
|
198
|
+
|
|
199
|
+
~~~text
|
|
200
|
+
WorkflowSpec
|
|
201
|
+
id, title, description, status, version
|
|
202
|
+
triggers and task lenses
|
|
203
|
+
assumptions and required context
|
|
204
|
+
ordered phases and branches
|
|
205
|
+
guardrails and allowed tools
|
|
206
|
+
expected outputs and verification gates
|
|
207
|
+
claim, evidence, and code references
|
|
208
|
+
adapter compatibility
|
|
209
|
+
updatedAt
|
|
210
|
+
|
|
211
|
+
WorkflowRun
|
|
212
|
+
id, workflowId, projectId
|
|
213
|
+
task summary and starting snapshot
|
|
214
|
+
phase state
|
|
215
|
+
selected evidence
|
|
216
|
+
outcome and verification verdict
|
|
217
|
+
failure reason
|
|
218
|
+
startedAt, completedAt
|
|
219
|
+
~~~
|
|
220
|
+
|
|
221
|
+
Workflow source files are canonical. WorkspaceSyncEngine renders native Skill,
|
|
222
|
+
rule, or instruction adapters only through its existing preview/apply safety
|
|
223
|
+
path. Existing Windsurf workflow conversion remains supported as an import path,
|
|
224
|
+
not the source of truth.
|
|
225
|
+
|
|
226
|
+
## Public Surface
|
|
227
|
+
|
|
228
|
+
### Primary agent path
|
|
229
|
+
|
|
230
|
+
Extend memorix_project_context. It remains a single compact tool and returns:
|
|
231
|
+
|
|
232
|
+
- start files and current code facts;
|
|
233
|
+
- selected current claims and relevant wiki pages;
|
|
234
|
+
- at most two matching workflow starts;
|
|
235
|
+
- stale, incomplete, conflict, and provider cautions;
|
|
236
|
+
- focused verification gates;
|
|
237
|
+
- provenance references in JSON and diagnostics output.
|
|
238
|
+
|
|
239
|
+
When no knowledge or workflow advantage exists, return less context rather than
|
|
240
|
+
a generic summary.
|
|
241
|
+
|
|
242
|
+
### Advanced operator path
|
|
243
|
+
|
|
244
|
+
Add a single advanced knowledge management surface in full/team profiles and a
|
|
245
|
+
matching CLI namespace:
|
|
246
|
+
|
|
247
|
+
~~~text
|
|
248
|
+
memorix knowledge init
|
|
249
|
+
memorix knowledge status
|
|
250
|
+
memorix knowledge ingest
|
|
251
|
+
memorix knowledge query
|
|
252
|
+
memorix knowledge lint
|
|
253
|
+
memorix knowledge workflow ...
|
|
254
|
+
memorix knowledge review ...
|
|
255
|
+
~~~
|
|
256
|
+
|
|
257
|
+
The advanced MCP equivalent uses one grouped knowledge tool with action-based
|
|
258
|
+
operations. It is absent from the lite profile by default. Existing memory,
|
|
259
|
+
graph, and context tools remain backward compatible.
|
|
260
|
+
|
|
261
|
+
### Dashboard, TUI, and Doctor
|
|
262
|
+
|
|
263
|
+
- Rename the existing generated view to an honest Memory Overview until the
|
|
264
|
+
maintained wiki is available.
|
|
265
|
+
- Add Knowledge Workspace, Claims, Workflows, and Evidence Drill-down views.
|
|
266
|
+
- Add health badges for snapshot freshness, incomplete scans, pending review,
|
|
267
|
+
conflicts, broken links, and failed maintenance jobs.
|
|
268
|
+
- Extend doctor with project knowledge workspace path, workflow adapter status,
|
|
269
|
+
page lint state, and provider/snapshot diagnostics.
|
|
270
|
+
- Keep all dashboard reads project-scoped.
|
|
271
|
+
|
|
272
|
+
## Phase 0: Evaluation Harness and Truthful Labels
|
|
273
|
+
|
|
274
|
+
### Implementation
|
|
275
|
+
|
|
276
|
+
- Add fixture repositories for TypeScript, Python, Go, docs-only, dirty
|
|
277
|
+
worktree, deleted-symbol, and incomplete-scan cases.
|
|
278
|
+
- Add seeded observations, Git evidence, test evidence, mini-skills, explicit
|
|
279
|
+
graph relations, and expected task Worksets.
|
|
280
|
+
- Rename or annotate current dashboard/TUI graph and wiki views so their scope
|
|
281
|
+
is accurate.
|
|
282
|
+
- Add an evaluation runner that compares memory-only context, current 1.1
|
|
283
|
+
context, and candidate 1.2 Worksets using deterministic expected evidence and
|
|
284
|
+
token budgets.
|
|
285
|
+
- The reusable fixture contract and run instructions live in
|
|
286
|
+
[the Evaluation Harness](1.2.0-EVALUATION-HARNESS.md).
|
|
287
|
+
|
|
288
|
+
### Exit gate
|
|
289
|
+
|
|
290
|
+
- Tests prove that the current memory map, structural code index, and
|
|
291
|
+
source-backed claim are distinguishable concepts.
|
|
292
|
+
- Evaluation fixtures run without network access or model credentials.
|
|
293
|
+
- No existing 1.1 context output regresses.
|
|
294
|
+
|
|
295
|
+
## Phase 1: Versioned Code State
|
|
296
|
+
|
|
297
|
+
### Implementation
|
|
298
|
+
|
|
299
|
+
- Introduce schema_migrations and CodeStateSnapshot tables.
|
|
300
|
+
- Implement Git revision and worktree fingerprint collection with bounded
|
|
301
|
+
Windows-safe commands.
|
|
302
|
+
- Extend CodeGraphStore refresh transactions to persist a snapshot and source
|
|
303
|
+
epoch with every changed fact.
|
|
304
|
+
- Extend status, Project Context JSON, and maintenance payloads with snapshot
|
|
305
|
+
completeness and freshness.
|
|
306
|
+
- Mark old observation code references suspect when their qualifying snapshot is
|
|
307
|
+
no longer current or complete enough.
|
|
308
|
+
|
|
309
|
+
### Exit gate
|
|
310
|
+
|
|
311
|
+
- A new commit creates a new snapshot.
|
|
312
|
+
- A dirty worktree differs from a clean one without reading all source files.
|
|
313
|
+
- Incomplete scans are explicit and cannot be formatted as complete truth.
|
|
314
|
+
- Existing incremental refresh, deletion handling, max file size, and no-block
|
|
315
|
+
MCP initialization tests still pass.
|
|
316
|
+
|
|
317
|
+
## Phase 2: Claim Ledger
|
|
318
|
+
|
|
319
|
+
### Implementation
|
|
320
|
+
|
|
321
|
+
- Add claim, evidence-ref, and conflict/supersession schema and stores.
|
|
322
|
+
- Implement claim validation, normalized identity, provenance checks, and
|
|
323
|
+
lifecycle transitions.
|
|
324
|
+
- Derive low-risk claims from explicit observations, Git facts, and code-state
|
|
325
|
+
evidence. Keep model-generated claims in draft or review state until policy
|
|
326
|
+
permits publication.
|
|
327
|
+
- Link claims to existing observation code references and snapshots.
|
|
328
|
+
- Implement claim lookup and a compact claim selector for task lenses.
|
|
329
|
+
|
|
330
|
+
### Exit gate
|
|
331
|
+
|
|
332
|
+
- Claims always expose at least one evidence reference.
|
|
333
|
+
- Contradictory active claims are shown as conflicted, not merged.
|
|
334
|
+
- Deleting a file, changing a bound symbol, or changing snapshot completeness
|
|
335
|
+
affects claim confidence or status deterministically.
|
|
336
|
+
- Secret filtering applies to claim content, source locators, and diagnostics.
|
|
337
|
+
|
|
338
|
+
## Phase 3: Wiki Compiler
|
|
339
|
+
|
|
340
|
+
### Implementation
|
|
341
|
+
|
|
342
|
+
- Add local and versioned workspace initialization with an explicit project
|
|
343
|
+
path choice and write policy.
|
|
344
|
+
- Implement Markdown page reader/writer, frontmatter validation, content hash,
|
|
345
|
+
index.md, log.md, link graph, and atomic write behavior.
|
|
346
|
+
- Compile approved claims into pages and produce proposed patches under review
|
|
347
|
+
policy. Preserve raw source references and do not silently overwrite manual
|
|
348
|
+
edits.
|
|
349
|
+
- Implement wiki lint for broken links, orphan pages, missing evidence,
|
|
350
|
+
superseded primary claims, unresolved conflicts, stale snapshot references,
|
|
351
|
+
and malformed frontmatter.
|
|
352
|
+
- Index page metadata and approved content into existing retrieval without
|
|
353
|
+
making raw pages mandatory prompt context.
|
|
354
|
+
|
|
355
|
+
### Exit gate
|
|
356
|
+
|
|
357
|
+
- A fresh workspace initializes predictably in local mode and only writes to a
|
|
358
|
+
project path after explicit opt-in.
|
|
359
|
+
- Ingesting evidence produces a reviewable page patch with source drill-down.
|
|
360
|
+
- Lint catches a deliberately broken link and a deliberately superseded claim.
|
|
361
|
+
- Manual edits survive a subsequent compiler run unless an explicit reviewed
|
|
362
|
+
patch replaces them.
|
|
363
|
+
|
|
364
|
+
## Phase 4: Workflow Inheritance
|
|
365
|
+
|
|
366
|
+
### Implementation
|
|
367
|
+
|
|
368
|
+
- Add WorkflowSpec and WorkflowRun stores, parser, validator, selector, and
|
|
369
|
+
source-backed workflow pages.
|
|
370
|
+
- Import current Windsurf workflows into canonical workflow files without
|
|
371
|
+
changing their original source.
|
|
372
|
+
- Extend WorkspaceSyncEngine to render canonical workflows to supported agents
|
|
373
|
+
through preview/apply, preserving non-Memorix user files.
|
|
374
|
+
- Add task-lens workflow selection and progressive delivery. The first phase is
|
|
375
|
+
compact; full instructions, scripts, and references are loaded only when
|
|
376
|
+
relevant.
|
|
377
|
+
- Record workflow runs and verification outcomes. Repeated outcomes may produce
|
|
378
|
+
a workflow improvement proposal, never a silent source edit.
|
|
379
|
+
|
|
380
|
+
### Exit gate
|
|
381
|
+
|
|
382
|
+
- A release, bugfix, migration, and review fixture each select the correct
|
|
383
|
+
canonical workflow or no workflow when none is applicable.
|
|
384
|
+
- Generated adapters pass existing workspace safety tests and do not rewrite
|
|
385
|
+
global agent settings.
|
|
386
|
+
- A failed verification gate remains visible in the next Workset.
|
|
387
|
+
- Existing mini-skills remain usable and are not mass-injected without budget
|
|
388
|
+
control.
|
|
389
|
+
|
|
390
|
+
## Phase 5: Workset Retrieval
|
|
391
|
+
|
|
392
|
+
### Implementation
|
|
393
|
+
|
|
394
|
+
- Replace the current context assembly policy with a bounded evidence ranker
|
|
395
|
+
that combines code state, claims, wiki pages, workflows, Git facts,
|
|
396
|
+
observations, and verification evidence.
|
|
397
|
+
- Define per-section caps, confidence thresholds, conflict policy, and token
|
|
398
|
+
budget accounting.
|
|
399
|
+
- Keep prompt, summary, and JSON outputs. JSON carries stable provenance ids and
|
|
400
|
+
reasons for selection.
|
|
401
|
+
- Keep context_pack compatible, but route it through the same ranking core.
|
|
402
|
+
|
|
403
|
+
### Exit gate
|
|
404
|
+
|
|
405
|
+
- A task returns source-backed start points, current claims, a workflow start
|
|
406
|
+
when applicable, cautions, and verification in a stable order.
|
|
407
|
+
- A task with no useful Memorix advantage receives a small response.
|
|
408
|
+
- No raw source dump, all-mini-skill dump, or unbounded page content enters the
|
|
409
|
+
default prompt.
|
|
410
|
+
- Existing lite MCP tool profile count does not grow.
|
|
411
|
+
|
|
412
|
+
## Phase 6: Dynamic Lifecycle and Maintenance
|
|
413
|
+
|
|
414
|
+
### Implementation
|
|
415
|
+
|
|
416
|
+
- Add maintenance job kinds for snapshot refresh, claim requalification, wiki
|
|
417
|
+
compilation, wiki lint, workflow analysis, and stale artifact review.
|
|
418
|
+
- Reuse SQLite leases, dedupe, retry, cancellation, and bounded worker behavior.
|
|
419
|
+
- Schedule from Git/hook/worktree signals, never from every prompt.
|
|
420
|
+
- Add recovery semantics for failed jobs, incomplete provider output, workspace
|
|
421
|
+
file conflicts, and interrupted writes.
|
|
422
|
+
|
|
423
|
+
### Exit gate
|
|
424
|
+
|
|
425
|
+
- Foreground Project Context returns without waiting for corpus scans or model
|
|
426
|
+
synthesis.
|
|
427
|
+
- Duplicate lifecycle events create one deduped job.
|
|
428
|
+
- Restarted workers recover eligible jobs without duplicate wiki/log writes.
|
|
429
|
+
- Failed background jobs surface through doctor and dashboard with sanitized
|
|
430
|
+
errors.
|
|
431
|
+
|
|
432
|
+
## Phase 7: Parser and Provider Quality
|
|
433
|
+
|
|
434
|
+
### Implementation
|
|
435
|
+
|
|
436
|
+
- Define a provider contract for symbols, relations, locations, coverage,
|
|
437
|
+
confidence, and snapshot metadata.
|
|
438
|
+
- Benchmark current Lite extraction against parser-backed candidates on Windows
|
|
439
|
+
install reliability, packaged size, supported fixtures, refresh time, and
|
|
440
|
+
relation accuracy.
|
|
441
|
+
- Adopt a parser-backed provider only when it wins the agreed gate. Tree-sitter
|
|
442
|
+
is a candidate, not a pre-decided dependency.
|
|
443
|
+
- Add optional external provider import only when normalized evidence can be
|
|
444
|
+
validated, versioned, diagnosed, and safely replaced by internal fallback.
|
|
445
|
+
- The checked-in provider contract, privacy boundary, and reproducible quality
|
|
446
|
+
gate live in [Provider Quality](1.2.0-PROVIDER-QUALITY.md). A pre-existing
|
|
447
|
+
local CodeGraph index may provide task-scoped semantic outlines; Memorix
|
|
448
|
+
never creates, syncs, or silently persists external facts.
|
|
449
|
+
|
|
450
|
+
### Exit gate
|
|
451
|
+
|
|
452
|
+
- Provider selection is explicit and reported in status/doctor.
|
|
453
|
+
- Lite remains a tested fallback for every supported installation.
|
|
454
|
+
- Parser or external provider failure degrades evidence confidence without
|
|
455
|
+
breaking Project Context.
|
|
456
|
+
- Benchmark results are checked into docs and reproducible locally.
|
|
457
|
+
|
|
458
|
+
## Phase 8: Product Validation and Release
|
|
459
|
+
|
|
460
|
+
### Implementation
|
|
461
|
+
|
|
462
|
+
- Run deterministic evaluation fixtures across coding, debugging, onboarding,
|
|
463
|
+
refactor, release, and non-code tasks.
|
|
464
|
+
- Run agent-facing smoke tests through packaged MCP and at least the installed
|
|
465
|
+
Codex integration without modifying the user's real project configuration.
|
|
466
|
+
- Verify local workspace, versioned workspace, workflow adapter, dashboard, and
|
|
467
|
+
doctor paths.
|
|
468
|
+
- Update README, Chinese README, setup, API reference, configuration, operator
|
|
469
|
+
playbook, changelog, and release notes.
|
|
470
|
+
- Perform package inspection, clean npm installation, full test suite, build,
|
|
471
|
+
lint, and GitHub Actions checks before publishing 1.2.0.
|
|
472
|
+
|
|
473
|
+
### Exit gate
|
|
474
|
+
|
|
475
|
+
- Evaluation evidence shows that 1.2 reduces broad exploration or catches
|
|
476
|
+
stale/conflicting context compared with the 1.1 baseline.
|
|
477
|
+
- All public product claims are backed by tests or documented measurement.
|
|
478
|
+
- No secret, raw private source, or user global config mutation appears in
|
|
479
|
+
default behavior.
|
|
480
|
+
- npm package, GitHub release, tag, changelog, docs, and supported integration
|
|
481
|
+
matrix are synchronized.
|
|
482
|
+
|
|
483
|
+
## Module Map
|
|
484
|
+
|
|
485
|
+
| Area | Primary new or changed modules |
|
|
486
|
+
| --- | --- |
|
|
487
|
+
| Schema and migrations | src/store/sqlite-db.ts, new migration helper, store tests |
|
|
488
|
+
| Code State | src/codegraph/types.ts, store.ts, lite-provider.ts, freshness.ts, auto-context.ts |
|
|
489
|
+
| Claims | new src/knowledge/claims.ts, claim-store.ts, evidence.ts, resolver.ts |
|
|
490
|
+
| Wiki | new src/knowledge/workspace.ts, pages.ts, compiler.ts, lint.ts, markdown.ts |
|
|
491
|
+
| Workflows | new src/knowledge/workflows.ts, workflow-store.ts, selector.ts, adapters.ts |
|
|
492
|
+
| Ranking | new src/knowledge/workset.ts and integration in codegraph auto-context/context-pack |
|
|
493
|
+
| Runtime | src/runtime/maintenance-jobs.ts, background handler registration |
|
|
494
|
+
| CLI and MCP | cli command registry, commands/context.ts, new commands/knowledge.ts, server.ts |
|
|
495
|
+
| Dashboard and TUI | dashboard server/static views, TUI data/views/theme |
|
|
496
|
+
| Config and docs | resolved config, TOML types/loaders, setup/API/playbook/README |
|
|
497
|
+
|
|
498
|
+
Private helper layout can change during implementation, but these boundaries and
|
|
499
|
+
acceptance tests are the contract.
|
|
500
|
+
|
|
501
|
+
## Test and Smoke Matrix
|
|
502
|
+
|
|
503
|
+
| Layer | Required verification |
|
|
504
|
+
| --- | --- |
|
|
505
|
+
| Unit | IDs, migrations, snapshot fingerprints, claim lifecycle, page parser, workflow parser, ranking, token caps |
|
|
506
|
+
| Store | SQLite reopen, migrations from 1.1 data, transactions, concurrent maintenance leases |
|
|
507
|
+
| Integration | code change to claim caution, wiki compile/lint, workflow selection/adapters, Project Context JSON |
|
|
508
|
+
| MCP | stdio initialize/list remains fast, default tool profile remains compact, Workset call succeeds in clean installation |
|
|
509
|
+
| CLI | knowledge init/status/ingest/lint/workflow, doctor diagnostics, no project write without opt-in |
|
|
510
|
+
| Dashboard/TUI | project isolation, provenance drill-down, visual empty/loading/error states |
|
|
511
|
+
| Agent smoke | isolated Codex setup and real MCP call; other adapters tested through generated config fixtures |
|
|
512
|
+
| Release | lint, build, serial full tests, pack inspection, isolated npm install, CI, tag, publish, release notes |
|
|
513
|
+
|
|
514
|
+
## Performance, Privacy, and Safety Budgets
|
|
515
|
+
|
|
516
|
+
- MCP initialize and tools/list cannot wait for indexing, wiki compilation, or
|
|
517
|
+
provider calls.
|
|
518
|
+
- Project Context schedules expensive work and returns the best qualified
|
|
519
|
+
current answer.
|
|
520
|
+
- Default prompt output has strict section caps and never includes full raw
|
|
521
|
+
documents or source files.
|
|
522
|
+
- Source locators and error strings pass existing credential sanitization.
|
|
523
|
+
- External providers are opt-in and receive only the data required by their
|
|
524
|
+
adapter. No automatic project export is allowed.
|
|
525
|
+
- Project file writes use atomic replacement, workspace path validation, and a
|
|
526
|
+
review policy. No broad user configuration writes are part of workflow setup.
|
|
527
|
+
- Every generated claim, page, workflow selection, and warning records its
|
|
528
|
+
provenance and reason.
|
|
529
|
+
|
|
530
|
+
## Compatibility and Migration Policy
|
|
531
|
+
|
|
532
|
+
- Existing observations, graph entities, graph relations, mini-skills,
|
|
533
|
+
CodeGraph tables, context_pack, and project_context continue to work.
|
|
534
|
+
- Existing Knowledge Base and Knowledge Graph endpoints remain available during
|
|
535
|
+
migration, but the UI describes them accurately as overview and memory map
|
|
536
|
+
until maintained artifacts are enabled.
|
|
537
|
+
- Existing Windsurf workflows remain readable and importable. No source agent
|
|
538
|
+
file is overwritten by canonical workflow creation.
|
|
539
|
+
- New schema is additive. Rollback means disabling knowledge features, not
|
|
540
|
+
deleting claims, pages, or existing 1.1 data.
|
|
541
|
+
- Versioned workspace files are never deleted by automatic cleanup.
|
|
542
|
+
|
|
543
|
+
## Definition of Done
|
|
544
|
+
|
|
545
|
+
1. Every Phase 0 through 8 exit gate passes in automated tests or reproducible
|
|
546
|
+
smoke evidence.
|
|
547
|
+
2. A clean project can use Memorix without a graph database, cloud service, or
|
|
548
|
+
manual command ritual.
|
|
549
|
+
3. A project can opt into a readable wiki and versioned workflows with reviewed,
|
|
550
|
+
source-backed changes.
|
|
551
|
+
4. A new agent receives a compact, qualified Workset through existing natural
|
|
552
|
+
language task flow.
|
|
553
|
+
5. The release is documented, packaged, published, tagged, and verified as
|
|
554
|
+
memorix 1.2.0.
|