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.
Files changed (88) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/README.md +3 -2
  3. package/README.zh-CN.md +3 -2
  4. package/dist/cli/index.js +36313 -31189
  5. package/dist/cli/index.js.map +1 -1
  6. package/dist/dashboard/static/app.js +50 -30
  7. package/dist/index.js +5348 -674
  8. package/dist/index.js.map +1 -1
  9. package/dist/maintenance-runner.d.ts +1 -1
  10. package/dist/maintenance-runner.js +3661 -293
  11. package/dist/maintenance-runner.js.map +1 -1
  12. package/dist/memcode-runtime/CHANGELOG.md +19 -0
  13. package/dist/sdk.d.ts +1 -1
  14. package/dist/sdk.js +5346 -672
  15. package/dist/sdk.js.map +1 -1
  16. package/docs/1.2.0-CLAIM-LEDGER.md +72 -0
  17. package/docs/1.2.0-CODE-STATE.md +61 -0
  18. package/docs/1.2.0-DEVELOPMENT-CHARTER.md +255 -0
  19. package/docs/1.2.0-DYNAMIC-LIFECYCLE.md +71 -0
  20. package/docs/1.2.0-EVALUATION-HARNESS.md +51 -0
  21. package/docs/1.2.0-IMPLEMENTATION-PLAN.md +554 -0
  22. package/docs/1.2.0-KNOWLEDGE-WORKFLOW-RESEARCH.md +205 -0
  23. package/docs/1.2.0-KNOWLEDGE-WORKSPACE.md +68 -0
  24. package/docs/1.2.0-PRODUCT-STORY.md +234 -0
  25. package/docs/1.2.0-PROVIDER-QUALITY.md +189 -0
  26. package/docs/1.2.0-WORKFLOW-INHERITANCE.md +101 -0
  27. package/docs/1.2.0-WORKSET-RETRIEVAL.md +80 -0
  28. package/docs/AGENT_OPERATOR_PLAYBOOK.md +6 -3
  29. package/docs/API_REFERENCE.md +25 -6
  30. package/docs/CONFIGURATION.md +21 -3
  31. package/docs/README.md +17 -2
  32. package/docs/dev-log/progress.txt +120 -40
  33. package/llms-full.txt +16 -2
  34. package/llms.txt +9 -4
  35. package/package.json +3 -2
  36. package/plugins/codex/memorix/.codex-plugin/plugin.json +1 -1
  37. package/src/cli/capability-map.ts +1 -0
  38. package/src/cli/commands/codegraph.ts +112 -9
  39. package/src/cli/commands/context.ts +2 -0
  40. package/src/cli/commands/doctor.ts +73 -4
  41. package/src/cli/commands/knowledge.ts +282 -0
  42. package/src/cli/commands/serve-http.ts +12 -1
  43. package/src/cli/index.ts +3 -1
  44. package/src/cli/tui/App.tsx +1 -1
  45. package/src/cli/tui/Panels.tsx +8 -8
  46. package/src/cli/tui/theme.ts +1 -1
  47. package/src/cli/tui/views/GraphView.tsx +8 -7
  48. package/src/cli/tui/views/KnowledgeView.tsx +9 -9
  49. package/src/codegraph/auto-context.ts +171 -9
  50. package/src/codegraph/code-state.ts +95 -0
  51. package/src/codegraph/context-pack.ts +82 -1
  52. package/src/codegraph/external-provider.ts +581 -0
  53. package/src/codegraph/lite-provider.ts +64 -19
  54. package/src/codegraph/project-context.ts +9 -1
  55. package/src/codegraph/store.ts +154 -6
  56. package/src/codegraph/types.ts +117 -0
  57. package/src/config/resolved-config.ts +28 -0
  58. package/src/config/toml-loader.ts +3 -0
  59. package/src/config/yaml-loader.ts +6 -0
  60. package/src/dashboard/server.ts +15 -1
  61. package/src/evaluation/workset-evaluation.ts +120 -0
  62. package/src/hooks/handler.ts +48 -6
  63. package/src/knowledge/claim-store.ts +267 -0
  64. package/src/knowledge/claims.ts +537 -0
  65. package/src/knowledge/markdown.ts +129 -0
  66. package/src/knowledge/types.ts +157 -0
  67. package/src/knowledge/wiki.ts +524 -0
  68. package/src/knowledge/workflow-store.ts +168 -0
  69. package/src/knowledge/workflow-types.ts +95 -0
  70. package/src/knowledge/workflows.ts +743 -0
  71. package/src/knowledge/workset.ts +515 -0
  72. package/src/knowledge/workspace-store.ts +220 -0
  73. package/src/knowledge/workspace-types.ts +106 -0
  74. package/src/knowledge/workspace.ts +220 -0
  75. package/src/memory/observations.ts +19 -0
  76. package/src/runtime/control-plane-maintenance.ts +5 -0
  77. package/src/runtime/isolated-maintenance.ts +5 -0
  78. package/src/runtime/lifecycle-status.ts +102 -0
  79. package/src/runtime/lifecycle.ts +107 -0
  80. package/src/runtime/maintenance-jobs.ts +5 -0
  81. package/src/runtime/project-maintenance.ts +190 -0
  82. package/src/server/tool-profile.ts +3 -2
  83. package/src/server.ts +354 -14
  84. package/src/store/file-lock.ts +24 -4
  85. package/src/store/sqlite-db.ts +307 -0
  86. package/src/wiki/generator.ts +4 -2
  87. package/src/wiki/knowledge-graph.ts +7 -4
  88. package/src/wiki/types.ts +16 -4
@@ -0,0 +1,72 @@
1
+ # Memorix 1.2 Claim Ledger
2
+
3
+ The Claim Ledger is the first layer of the 1.2 Knowledge Workspace. It turns a
4
+ small, source-qualified statement into something Memorix can safely retrieve,
5
+ review, supersede, or warn about.
6
+
7
+ It is not a generated knowledge graph and it is not a replacement for code,
8
+ Git, tests, or the original memory. A claim is useful only because its evidence
9
+ is still inspectable.
10
+
11
+ ## What a claim records
12
+
13
+ | Field | Meaning |
14
+ | --- | --- |
15
+ | subject, predicate, object | One compact project assertion |
16
+ | scope | Project, workspace, team, workflow, or task boundary |
17
+ | evidence | Observation, Git, code, test, document, workflow, or run references |
18
+ | snapshotId | The Code State Snapshot that qualified code evidence |
19
+ | confidence | Bounded source-quality signal, never a statement of certainty |
20
+ | status | active, superseded, disputed, or unknown |
21
+ | reviewState | approved, needs-review, draft, or rejected |
22
+
23
+ SQLite is the local operational index. Evidence is referenced by ids, paths,
24
+ and hashes; Memorix does not copy a second raw source tree or a full chat log
25
+ into the ledger.
26
+
27
+ ## Automatic policy
28
+
29
+ Memorix derives low-risk claims only from:
30
+
31
+ 1. an explicit user or agent memory; or
32
+ 2. Git-ingested evidence.
33
+
34
+ It does not promote ordinary hook output, model-generated summaries, or every
35
+ conversation fragment into a project fact. Model-origin claims stay draft or
36
+ need review until a user or agent explicitly reviews them.
37
+
38
+ When an explicit observation names current code, its claim receives both the
39
+ observation evidence and the matching code-reference evidence. New references
40
+ inherit the latest completed Code State Snapshot at bind time.
41
+
42
+ ## Conflict and supersession
43
+
44
+ Two approved active assertions with the same subject, predicate, and scope but
45
+ different values are marked disputed together. Memorix keeps both; the newest
46
+ write never erases the other side.
47
+
48
+ Supersession is explicit and evidence-aware. A replacement claim must address
49
+ the same project assertion and a source reference must explain the transition.
50
+ The old claim remains in the audit trail with its replacement id and validity
51
+ end time.
52
+
53
+ ## Dynamic qualification
54
+
55
+ After a Lite CodeGraph refresh:
56
+
57
+ - a deleted or changed bound symbol makes a claim unknown and needs-review;
58
+ - a changed bound file lowers confidence and asks for review;
59
+ - an incomplete scan lowers the confidence of code-bound claims instead of
60
+ presenting them as complete truth.
61
+
62
+ The refresh still succeeds if ledger qualification cannot run. Memorix reports
63
+ that the qualification was skipped and preserves the source memory rather than
64
+ discarding a user write.
65
+
66
+ ## Retrieval boundary
67
+
68
+ The ledger already exposes a deterministic, task-lensed selector internally.
69
+ It returns only matching source-qualified claims, carries conflicts as cautions,
70
+ and obeys a token budget. The user-facing Knowledge Workspace, canonical wiki
71
+ pages, and advanced operator commands arrive in the next phases; they will use
72
+ this ledger rather than treating generated prose as source truth.
@@ -0,0 +1,61 @@
1
+ # Memorix 1.2 Code State Snapshots
2
+
3
+ Code State Snapshots give Memorix a bounded answer to a basic question:
4
+ which version of the project did this memory or structural fact describe?
5
+
6
+ They do not copy project source into a second database. A snapshot stores Git
7
+ metadata, a worktree fingerprint, and scan completeness. Structural facts keep
8
+ their normal hashes and receive the snapshot id and source epoch that last
9
+ confirmed them.
10
+
11
+ ## Snapshot Contract
12
+
13
+ | Field | Meaning |
14
+ | --- | --- |
15
+ | baseRevision | Full Git revision when Git can provide one |
16
+ | worktreeState | clean, dirty, or unavailable |
17
+ | worktreeFingerprint | SHA-256 of bounded Git revision and status metadata |
18
+ | changedPathCount | Number of dirty Git paths, not their contents |
19
+ | sourceEpoch | Monotonic project-local scan generation |
20
+ | completeness | File cap, changed/removed counts, oversized skips, and deferred deletion checks |
21
+ | previousSnapshotId | Prior completed scan for the same project |
22
+
23
+ Git unavailable is an explicit unavailable state. It is never formatted as a
24
+ clean worktree.
25
+
26
+ ## Lifecycle
27
+
28
+ 1. Lite refresh reconciles changed, unchanged, removed, and oversized files.
29
+ 2. Memorix reads bounded Git revision and porcelain status metadata.
30
+ 3. A transactional snapshot record is appended with the next source epoch.
31
+ 4. Current files, symbols, edges, and current observation-code refs point to
32
+ that snapshot.
33
+ 5. Project Context and codegraph status expose the latest snapshot rather than
34
+ silently treating an old scan as current.
35
+
36
+ The snapshot is written after refresh reconciliation. An interrupted scan can
37
+ leave no new snapshot, but cannot claim a partially written snapshot is
38
+ complete.
39
+
40
+ ## Migration and Privacy
41
+
42
+ The 1.2 migration is additive. Existing CodeGraph tables and rows remain in
43
+ place; the migration adds snapshot columns and a code_state_snapshots table.
44
+ Migration ids are recorded in schema_migrations.
45
+
46
+ Snapshot records contain no source text, conversation content, credentials, or
47
+ dirty path names. They only retain the fingerprint and aggregate counts needed
48
+ to qualify later retrieval.
49
+
50
+ ## Operator View
51
+
52
+ Use the existing commands:
53
+
54
+ ~~~powershell
55
+ memorix codegraph refresh --json
56
+ memorix codegraph status
57
+ ~~~
58
+
59
+ The status output now includes revision availability, dirty state, changed path
60
+ count, source epoch, and whether scan limits made the latest snapshot
61
+ incomplete.
@@ -0,0 +1,255 @@
1
+ # Memorix 1.2 Development Charter
2
+
3
+ Status: active development baseline
4
+ Branch: `codex/1.2.0-multidimensional-memory`
5
+ Start: 2026-07-17
6
+
7
+ ## Read This First
8
+
9
+ [The 1.2 Product Story](1.2.0-PRODUCT-STORY.md) explains the user-facing
10
+ promise and delivery narrative in plain language. This charter is the technical
11
+ contract that keeps that promise honest.
12
+
13
+ [Knowledge and Workflow Research](1.2.0-KNOWLEDGE-WORKFLOW-RESEARCH.md)
14
+ records the external design study and the adopted boundary for project knowledge
15
+ and workflow inheritance.
16
+
17
+ [The 1.2 Implementation Plan](1.2.0-IMPLEMENTATION-PLAN.md) is the execution
18
+ contract for the complete goal: data contracts, phase gates, compatibility,
19
+ verification, and release criteria.
20
+
21
+ ## Product Direction
22
+
23
+ Memorix 1.2 is not a larger text-memory product. Strong coding agents can
24
+ often reread a repository faster and more accurately than they can sift
25
+ through a long history of prose. Text memory still matters for decisions,
26
+ constraints, and hard-won lessons, but it must earn a place in context.
27
+
28
+ The 1.2 product is a **task-ready working context layer**. It combines four
29
+ different kinds of evidence and returns only the compact workset that helps an
30
+ agent act:
31
+
32
+ 1. **Narrative memory**: decisions, problems, constraints, and handoffs.
33
+ 2. **Code state**: current files, symbols, relations, and their freshness.
34
+ 3. **Change evidence**: Git commits, dirty-worktree facts, and lifecycle
35
+ signals that explain what has moved since a memory was captured.
36
+ 4. **Verification evidence**: relevant tests, commands, failures, and known
37
+ risks.
38
+
39
+ The agent-facing experience stays simple: a natural-language task reaches
40
+ `memorix_project_context`, and Memorix decides whether there is useful context
41
+ to return. Users should not need to remember a graph command, a retrieval
42
+ mode, or a storage model.
43
+
44
+ ## Current Baseline
45
+
46
+ 1.1 already has useful foundations:
47
+
48
+ - SQLite-backed code files, symbols, edges, and observation-code references.
49
+ - Incremental CodeGraph Lite refresh with hashes, deletes, size limits, and
50
+ built-in support for TypeScript, JavaScript, Python, Go, Rust, Java, C#,
51
+ C/C++, PHP, Ruby, and Kotlin at best-effort structural fidelity.
52
+ - Code-reference freshness (`current`, `suspect`, `stale`, `unbound`).
53
+ - Task lenses, current project facts, Code Memory status, bounded context packs,
54
+ Git Memory, and durable background maintenance.
55
+
56
+ The current dashboard Knowledge Base and Knowledge Graph are useful projections
57
+ of memories, mini-skills, and explicit relations. They are not a temporal
58
+ semantic knowledge graph: their inferred relations are largely deterministic
59
+ entity/category links. The 1.2 Claim Ledger and Knowledge Workspace now add
60
+ claim-level validity, contradiction handling, review state, and a readable
61
+ artifact layer. Existing workspace sync remains a compatibility converter;
62
+ canonical workflow inheritance now lives in the Knowledge Workspace and uses
63
+ safe, project-scoped adapters.
64
+
65
+ That is a foundation, not the 1.2 finish line. Lite currently uses conservative
66
+ language profiles and regex extraction, its graph does not yet represent a
67
+ versioned code-state contract, and the product cannot yet prove that a returned
68
+ workset reduced exploration or risk for the task.
69
+
70
+ ## 1.2 Invariants
71
+
72
+ - **Memory earns context.** Do not inject a memory just because it exists.
73
+ It must be relevant, current enough, and actionable.
74
+ - **Structure is not prose.** Code state stays normalized and versioned; a
75
+ narrative observation may reference it but cannot become the canonical graph.
76
+ - **Dynamic means evidence changes with the project.** A workset is tied to a
77
+ repository revision and worktree fingerprint. Changed or deleted code
78
+ invalidates confidence rather than silently surviving as a fact.
79
+ - **External tools are accelerators, not prerequisites.** When a healthy local
80
+ CodeGraph-class provider exists, Memorix can consume normalized evidence from
81
+ it. A project remains useful without one.
82
+ - **No context dump.** The default return is an action map: where to start,
83
+ what is reliable, what changed, what is uncertain, and how to verify.
84
+ - **No fake black box.** The user experience is quiet, but every suggested
85
+ fact carries provenance and freshness for agents and diagnostics.
86
+ - **Knowledge is an artifact, not a label.** A wiki page has source-backed
87
+ claims, review state, and a drill-down path to evidence. A dashboard summary
88
+ alone is not an LLM Wiki.
89
+ - **Workflow is protocol, not prompt ballast.** A reusable project playbook has
90
+ a trigger, phases, guardrails, and verification gates. It is delivered by
91
+ progressive disclosure and never silently rewrites project process.
92
+
93
+ ## Core Data Contract
94
+
95
+ 1.2 introduces a versioned `CodeStateSnapshot` around the existing code tables:
96
+
97
+ ```text
98
+ CodeStateSnapshot
99
+ projectId
100
+ provider
101
+ baseRevision Git HEAD when known
102
+ worktreeFingerprint tracked dirty/untracked state summary
103
+ indexedAt
104
+ completeness files/paths skipped, parser coverage, limits reached
105
+ sourceEpoch invalidates older derived facts
106
+ ```
107
+
108
+ `CodeStateSnapshot` does not duplicate source files. It records the provenance
109
+ and completeness needed to decide whether symbols, edges, and memory bindings
110
+ are still safe to use.
111
+
112
+ The retrieval product is a `Workset`:
113
+
114
+ ```text
115
+ Workset
116
+ task and task lens
117
+ start points files/symbols with reasons
118
+ current evidence code and Git facts
119
+ durable knowledge only relevant narrative memory
120
+ cautions stale, incomplete, contradictory, or low-confidence items
121
+ verification plan focused tests/commands and why they matter
122
+ provenance snapshot/revision/source refs
123
+ ```
124
+
125
+ The Knowledge Workspace adds a claim and artifact layer above the existing
126
+ stores:
127
+
128
+ ```text
129
+ KnowledgeClaim
130
+ subject / predicate / object-or-value
131
+ sourceRefs / codeRefs
132
+ observedAt / validFrom / validTo
133
+ status active, superseded, disputed, unknown
134
+ confidence
135
+
136
+ WikiPage
137
+ stable id, title, kind, frontmatter
138
+ claim refs, source refs, code-state reference
139
+ review state, links, updatedAt
140
+
141
+ WorkflowSpec
142
+ trigger, assumptions, ordered phases
143
+ guardrails, expected output, verification gates
144
+ evidence refs and target-agent adapters
145
+
146
+ WorkflowRun
147
+ selected workflow and task snapshot
148
+ evidence used, outcome, verification result
149
+ ```
150
+
151
+ ## Delivery Phases
152
+
153
+ ### Phase 0: Evidence and Evaluation
154
+
155
+ - Define fixture repositories across supported languages and common project
156
+ shapes.
157
+ - Record baseline measurements for memory-only context, broad repo rereads, and
158
+ current 1.1 context packs.
159
+ - Establish release gates: freshness correctness, bounded first-turn latency,
160
+ no raw source dump, and no secret persistence.
161
+
162
+ ### Phase 1: Versioned Code State
163
+
164
+ - Add snapshot metadata, source epochs, Git revision, and dirty-worktree
165
+ fingerprints to the code-state store.
166
+ - Make refresh results explicit about completeness and skipped sources.
167
+ - Invalidate derived refs by state transition rather than scan age alone.
168
+
169
+ ### Phase 2: Claim Ledger
170
+
171
+ - Add source-backed claim records with temporal validity, supersession,
172
+ contradiction, and confidence semantics.
173
+ - Require every claim to drill down to evidence and, when relevant, the
174
+ CodeStateSnapshot that qualified its code references.
175
+ - Keep claims compact and typed; a generated graph edge alone is not a claim.
176
+
177
+ ### Phase 3: Wiki Compiler
178
+
179
+ - Compile approved project evidence into interlinked Markdown wiki pages with
180
+ an index, evolution log, and lint checks.
181
+ - Keep the human-readable wiki artifact separate from the local search index.
182
+
183
+ ### Phase 4: Workflow Inheritance
184
+
185
+ - Add canonical project playbooks with triggers, phases, guardrails, outputs,
186
+ verification gates, and evidence refs.
187
+ - Adapt one project-owned workflow to supported agent skill/rule formats rather
188
+ than treating a source-agent workflow format as canonical.
189
+ - Record workflow runs and let repeated verified outcomes propose, but not
190
+ silently apply, workflow improvements.
191
+
192
+ ### Phase 5: Workset Retrieval
193
+
194
+ - Turn `memorix_project_context` into the primary workset surface while keeping
195
+ its micro tool profile small.
196
+ - Rank code state, Git evidence, narrative memory, and verification hints by
197
+ task, freshness, confidence, and token budget.
198
+ - Return minimal context when Memorix has no meaningful advantage over a normal
199
+ file read.
200
+
201
+ ### Phase 6: Dynamic Lifecycle
202
+
203
+ - Connect Git/hook/worktree changes to bounded refresh scheduling.
204
+ - Preserve the 1.1 non-blocking handshake model: foreground context never waits
205
+ for a corpus-sized scan or remote provider request.
206
+ - Add health and recovery diagnostics for stale snapshots and provider drift.
207
+
208
+ ### Phase 7: Parser and Provider Quality
209
+
210
+ - Introduce a provider contract that normalizes symbols, relations, locations,
211
+ parser coverage, and confidence.
212
+ - Replace regex-only structural extraction with a parser-backed provider after a
213
+ Windows/package-size benchmark. Tree-sitter is a candidate, not an unchecked
214
+ dependency decision.
215
+ - Add an external-provider adapter only after its input can be validated,
216
+ versioned, and downgraded safely to the internal provider.
217
+
218
+ ### Phase 8: Product Validation
219
+
220
+ - Compare new-agent task completion with and without a Workset across coding,
221
+ debugging, onboarding, refactor, and non-code tasks.
222
+ - Measure broad scans avoided, stale-context catches, first useful action time,
223
+ and unnecessary-token cost.
224
+ - Make dashboard and doctor explain evidence quality without exposing users to
225
+ internal storage jargon.
226
+
227
+ ## Non-Goals
228
+
229
+ - Building a full IDE or language server inside Memorix.
230
+ - Copying another CodeGraph product's API surface or asking users to operate two
231
+ memory systems manually.
232
+ - Capturing every chat transcript or treating volume as memory quality.
233
+ - Increasing MCP tool count to expose every graph primitive.
234
+ - Claiming universal language precision before parser coverage and evaluations
235
+ prove it.
236
+ - Calling the current memory visualization a full semantic knowledge graph or
237
+ calling a generated overview a maintained wiki before the artifact and claim
238
+ contracts exist.
239
+
240
+ ## First Implementation Slice
241
+
242
+ The first 1.2 code slice is **Phase 0 plus the `CodeStateSnapshot` schema**.
243
+ It must add no visible tool explosion and must prove these behaviors with
244
+ fixtures:
245
+
246
+ 1. the same repository at a new commit produces a new snapshot;
247
+ 2. a dirty worktree is distinguishable from a clean commit state;
248
+ 3. an incomplete scan is visible and cannot be presented as complete truth;
249
+ 4. a task workset keeps only source-backed, current, or explicitly cautioned
250
+ items within its token budget.
251
+
252
+ Only after those guarantees are tested should parser dependencies or external
253
+ CodeGraph adapters enter the runtime. The claim ledger, wiki compiler, and
254
+ workflow inheritance begin only after code-state evidence can state its own
255
+ completeness and revision.
@@ -0,0 +1,71 @@
1
+ # Memorix 1.2 Dynamic Lifecycle
2
+
3
+ "Dynamic" in Memorix does not mean doing a full scan or an LLM call whenever
4
+ an agent asks a question. It means durable evidence is requalified after the
5
+ project changes, through bounded background work that can recover from a
6
+ stopped client.
7
+
8
+ ## Foreground boundary
9
+
10
+ Project Context and Context Pack read the latest completed local state. They
11
+ may enqueue work, but they never wait for:
12
+
13
+ - a repository-sized Code Memory scan;
14
+ - claim requalification;
15
+ - knowledge compilation or lint;
16
+ - workflow file indexing; or
17
+ - a provider or model request.
18
+
19
+ If a new scan is needed, the Workset says what is currently known and marks
20
+ the relevant state as dirty, incomplete, suspect, or stale.
21
+
22
+ ## Durable jobs
23
+
24
+ The existing SQLite maintenance ledger owns all lifecycle jobs. 1.2 adds:
25
+
26
+ | Job | Trigger | Result |
27
+ | --- | --- | --- |
28
+ | codegraph-refresh | stale/missing index, hook, startup | New CodeStateSnapshot |
29
+ | claim-derive | explicit or Git-backed memory write | Source-qualified claim evidence is produced after the memory write has completed |
30
+ | claim-requalification | after a completed code refresh | Claims are rebound to current code, then become current, needs-review, or unknown from that evidence |
31
+ | knowledge-compile | explicit knowledge-producing write or refresh | Local workspaces receive reviewable proposals |
32
+ | knowledge-lint | code/claim/workspace lifecycle event | Broken, stale, conflicting, or manually protected artifacts become visible |
33
+ | workflow-index | startup or workspace lifecycle event | Canonical Markdown workflow metadata is refreshed in SQLite |
34
+
35
+ Jobs have a project id, dedupe key, retry budget, lease, sanitized error
36
+ record, and bounded payload. A duplicate event updates the existing active job
37
+ instead of starting a second full pass.
38
+
39
+ The dedupe key is deliberately stable per project and job kind. A newer hook,
40
+ manual refresh, or startup check replaces an active job's payload; it does not
41
+ create one expensive pass per CodeStateSnapshot.
42
+
43
+ Code Memory refreshes are scheduled from project startup, Project Context,
44
+ session startup, and a supported agent's real file-mutation hook. A file edit
45
+ only records a small durable queue entry; it never parses the repository inside
46
+ the hook process.
47
+
48
+ ## Write policy
49
+
50
+ The lifecycle worker may update SQLite state and local/private Knowledge
51
+ Workspace proposals. It never automatically applies a proposal to a published
52
+ page.
53
+
54
+ When both kinds of workspace exist, lifecycle reads target the same versioned
55
+ workspace preferred by the Task Workset. A payload may explicitly target the
56
+ local or versioned workspace. For a versioned workspace, background compilation
57
+ is disabled unless an explicit operator payload permits it; indexing and linting
58
+ remain read-only against project Markdown. This prevents a background process
59
+ from creating unexpected Git changes merely because an agent opened a project.
60
+
61
+ ## Recovery and visibility
62
+
63
+ Workers use SQLite leases. A process that exits while holding a job leaves it
64
+ eligible for retry after lease expiry, subject to the job retry limit. Failed
65
+ jobs retain a sanitized error for diagnostics; completed history expires after
66
+ the existing retention window.
67
+
68
+ Doctor, the dashboard maintenance endpoint, and JSON status show lifecycle
69
+ summary and failed jobs, plus claim review counts, workspace proposal counts,
70
+ and failed workflow runs. The Workset itself remains small: it reports only the
71
+ resulting safety state, not the internal job log.
@@ -0,0 +1,51 @@
1
+ # Memorix 1.2 Evaluation Harness
2
+
3
+ The 1.2 evaluation harness prevents product claims from drifting away from
4
+ observable retrieval behavior. It evaluates a normalized task Workset using
5
+ deterministic requirements, not an LLM judge.
6
+
7
+ ## What It Checks
8
+
9
+ For each task fixture, every compared Workset is checked for:
10
+
11
+ 1. required start files;
12
+ 2. required evidence identifiers;
13
+ 3. required cautions for unsafe or incomplete state;
14
+ 4. a strict token ceiling.
15
+
16
+ The same fixture can compare a memory-only answer, the current Project Context
17
+ answer, and a future 1.2 candidate Workset. A result only passes when it
18
+ contains every required item and stays within budget.
19
+
20
+ The initial current-context baseline is 320 tokens. The candidate-workset
21
+ budget is 180 tokens for the same fixture, so a future implementation must
22
+ preserve evidence and safety signals while becoming more compact.
23
+
24
+ ## Fixture Coverage
25
+
26
+ | Fixture | Boundary being tested |
27
+ | --- | --- |
28
+ | typescript-auth | TypeScript source and code-bound auth decision |
29
+ | python-worker | Python source and retry behavior |
30
+ | go-service | Go source and health timeout |
31
+ | docs-only | Project knowledge that has no code file |
32
+ | dirty-worktree | Uncommitted changes must stay visible |
33
+ | deleted-symbol | Removed source evidence must become a caution |
34
+ | incomplete-scan | Scan limits must not be formatted as complete truth |
35
+
36
+ Fixtures live under tests/fixtures/workset-evaluation/. They are intentionally
37
+ small repositories rather than copies of the Memorix codebase, so success does
38
+ not depend on Memorix-specific naming or history.
39
+
40
+ ## Running It
41
+
42
+ Run the harness without network access or model credentials:
43
+
44
+ ~~~powershell
45
+ npm test -- tests/evaluation/workset-evaluation.test.ts tests/evaluation/current-context-baseline.test.ts tests/evaluation/fixture-corpus.test.ts
46
+ ~~~
47
+
48
+ The current-context baseline test runs the existing Auto Context path against
49
+ real local fixture repositories. Future phases must add their real Workset
50
+ adapter to this harness before claiming retrieval, wiki, workflow, or provider
51
+ quality improvements.