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,205 @@
1
+ # Memorix 1.2 Knowledge and Workflow Research
2
+
3
+ Status: adopted product direction
4
+ Companion: [1.2 Product Story](1.2.0-PRODUCT-STORY.md) and [1.2 Development Charter](1.2.0-DEVELOPMENT-CHARTER.md)
5
+ Date: 2026-07-17
6
+
7
+ ## Research Question
8
+
9
+ Can Memorix become more than a store of narrative memories? The useful answer is
10
+ not "add a graph." A coding project needs an evidence-backed knowledge base that
11
+ agents can maintain, inspect, and use, plus a way to inherit the project's
12
+ working methods without asking every new agent to rediscover them.
13
+
14
+ The resulting 1.2 direction is a **Knowledge Workspace** and **Workflow
15
+ Inheritance** layer on top of Memorix's existing local, multi-agent memory
16
+ system.
17
+
18
+ ## What the Reference Systems Actually Teach
19
+
20
+ | System | Verified design contribution | What Memorix should learn | What Memorix should not copy |
21
+ | --- | --- | --- | --- |
22
+ | [Cognee](https://docs.cognee.ai/) | Ingests varied data, derives chunks, entities, concepts, and ontologies, then combines graph and vector retrieval for agent memory. | Treat knowledge as an evolving substrate, not a flat pile of notes. | Rebuilding a generic ingestion platform, graph database matrix, and cloud product inside a coding-memory release. |
23
+ | [Karpathy's LLM Wiki](https://gist.githubusercontent.com/karpathy/442a6bf555914893e9891c11519de94f/raw/) | Keeps immutable raw sources, a generated interlinked Markdown wiki, and a schema that teaches the agent how to ingest, query, and lint it. | Make knowledge a durable, human-readable artifact that compounds, cites its sources, and can be linted. | Pretending every retrieved chunk is a wiki page or hiding synthesized claims in a database only. |
24
+ | [Graphiti / Zep](https://help.getzep.com/graphiti/getting-started/overview) | Builds temporal Context Graphs from episodes, tracks fact invalidation, and combines temporal, keyword, semantic, and graph retrieval. | A fact must have provenance and a lifecycle: current, superseded, disputed, or unknown. | Adding a graph database just to claim a temporal graph before we have trustworthy claims and invalidation rules. |
25
+ | [Mem0](https://github.com/mem0ai/mem0) | Uses compact memory APIs, entity linking, temporal retrieval, and multi-signal ranking. | Evaluate retrieval quality and fuse independent signals rather than trusting one similarity score. | Treating vendor benchmark scores as directly comparable to a local coding-agent workflow. |
26
+ | [Letta](https://docs.letta.com/guides/core-concepts/memory/context-hierarchy/) | Separates always-visible blocks, files, archival memory, and external retrieval by size and mutability. | Give every knowledge item an access mode: core protocol, on-demand page, archival evidence, or external source. | Injecting every permanent mini-skill or wiki page into every session. |
27
+ | [LangMem](https://langchain-ai.github.io/langmem/) | Separates agent-managed hot-path memory from background extraction and consolidation. | Keep foreground task work fast; larger synthesis and maintenance must be bounded background work. | Coupling Memorix to a particular agent runtime or framework store. |
28
+ | [TencentDB Agent Memory](https://github.com/TencentCloud/TencentDB-Agent-Memory) | Uses layered memory, readable Markdown upper layers, traceable drill-down, background extraction, and skill/SOP generation from execution history. | Store high-level guidance as readable artifacts that drill down to evidence; let repeated successful work propose a workflow. | Making Mermaid the canonical truth or accepting self-reported benchmark gains without independent evaluation. |
29
+ | [Supermemory](https://supermemory.ai/docs) | Treats memory, extraction, connectors, and retrieval as one context stack scoped to an entity. | Make scope explicit: project, workspace, team, workflow, and task are different containers. | Becoming an all-in-one hosted content connector platform in 1.2. |
30
+ | [Memobase](https://github.com/memodb-io/memobase) | Separates durable user profile from event timeline and processes buffers outside the hot path. | Separate stable project protocol from episodic task evidence; batch maintenance rather than blocking the user. | Optimizing Memorix around consumer user-profile personalization instead of project work. |
31
+
32
+ The social-media ranking that prompted this research is useful as a discovery
33
+ list, but it is not a common benchmark or a product-fit analysis. Each project
34
+ optimizes for a different unit of memory: user profile, agent runtime, generic
35
+ documents, enterprise data, or project work.
36
+
37
+ ## Honest Audit of the Current Memorix Baseline
38
+
39
+ Memorix already has real foundations. It is not empty branding. It has SQLite
40
+ storage, observations, Git evidence, mini-skills, a code index, code-bound
41
+ freshness, a dashboard Knowledge Base view, and a graph view.
42
+
43
+ It is nevertheless not yet an industry-grade semantic knowledge graph or a
44
+ Karpathy-style LLM Wiki:
45
+
46
+ 1. **CodeGraph Lite is a structural index, not a semantic knowledge graph.**
47
+ It records files, symbols, and primarily import-level edges. Its built-in
48
+ provider uses conservative language-specific regular expressions, which is a
49
+ valid fallback but not parser-grade code intelligence.
50
+ 2. **The current Knowledge Base is a generated view, not a maintained wiki.**
51
+ It groups active observations and mini-skills into sections at render time.
52
+ It does not persist interlinked Markdown pages that are updated when a new
53
+ source changes the project's synthesis.
54
+ 3. **The current Knowledge Graph is a deterministic memory map.** It creates
55
+ nodes from observations and mini-skills, then infers many edges from shared
56
+ entity name, category, source skill, or optional explicit relations. It has
57
+ useful provenance refs, but it has no claim identity, temporal validity,
58
+ confidence policy, contradiction state, or source-level truth-maintenance
59
+ loop.
60
+ 4. **Workflow support is format conversion, not workflow inheritance.** Existing
61
+ workspace sync can convert Windsurf workflow files to selected agent formats.
62
+ Mini-skills preserve small instructions, but they are not versioned playbooks
63
+ with inputs, steps, gates, outcomes, or learning from runs.
64
+
65
+ The right response is not to delete these foundations. They become the evidence
66
+ and compatibility layers for the next system.
67
+
68
+ ## Product Decision: Knowledge Workspace
69
+
70
+ Memorix 1.2 will build a local, project-scoped Knowledge Workspace with four
71
+ separate layers:
72
+
73
+ ~~~mermaid
74
+ flowchart LR
75
+ A["Evidence: Git, code, tests, documents, observations"] --> B["Claims: provenance and validity"]
76
+ B --> C["Wiki: interlinked, human-readable knowledge"]
77
+ B --> D["Workflows: reusable project playbooks"]
78
+ C --> E["Task Workset: minimal context for the active task"]
79
+ D --> E
80
+ E --> F["Agent action and verification"]
81
+ F --> A
82
+ ~~~
83
+
84
+ ### Evidence
85
+
86
+ Evidence includes Git commits, code-state snapshots, test or command results,
87
+ approved documents, and high-signal observations. It carries source references
88
+ and capture time. A synthesized page never replaces its evidence.
89
+
90
+ ### Claims
91
+
92
+ A claim is a small, inspectable assertion, not merely a graph edge. It records:
93
+
94
+ - subject, predicate, and object or value;
95
+ - project, workspace, team, workflow, or task scope;
96
+ - source and optional code references;
97
+ - observed time and validity window;
98
+ - active, superseded, disputed, or unknown status;
99
+ - confidence.
100
+
101
+ Claims give Memorix the temporal honesty borrowed from Graphiti without
102
+ pretending that a visual graph alone is a knowledge system.
103
+
104
+ ### Wiki
105
+
106
+ The wiki consists of maintained Markdown pages with structured frontmatter and
107
+ links. A page can cover an architecture concept, a subsystem, a decision, a
108
+ release procedure, or a known risk. Each page identifies its claims, evidence,
109
+ code-state snapshot, status, and last review.
110
+
111
+ The project can choose a versioned workspace for these pages so humans can read
112
+ them, agents can update them through reviewed patches, and Git can show how the
113
+ knowledge changed. SQLite and search indexes accelerate retrieval but are not
114
+ the only copy of the knowledge.
115
+
116
+ ### Workflows
117
+
118
+ A workflow is not an oversized AGENTS.md paragraph. It is a canonical,
119
+ versioned playbook containing:
120
+
121
+ - trigger, scope, assumptions, and required context;
122
+ - ordered phases with optional branches;
123
+ - allowed tools, guardrails, expected outputs, and verification gates;
124
+ - source, claim, and code references;
125
+ - target-agent adapters;
126
+ - run evidence, outcome, and failure reason.
127
+
128
+ For example, a project can own a bug-fix workflow, release workflow, migration
129
+ workflow, or incident workflow. A new agent receives only a small trigger and
130
+ the relevant first phase. It loads the full playbook only when the task matches.
131
+ Repeated successful runs can propose improvements, but never silently rewrite a
132
+ project protocol.
133
+
134
+ ## How Workflow Inheritance Feels to a User
135
+
136
+ The user says, "Prepare the next release." Memorix should recognize a relevant
137
+ project release playbook, return the current release facts and first gate, and
138
+ let the agent continue using the normal tools for that environment. The user
139
+ does not remember a slash command or manually paste a checklist.
140
+
141
+ This is progressive disclosure:
142
+
143
+ 1. agent integration sees a short workflow trigger and description;
144
+ 2. task selection chooses at most one or two relevant workflows;
145
+ 3. the active Workset contains only the immediate phase, linked knowledge, and
146
+ verification gate;
147
+ 4. detailed procedures, source pages, and raw evidence are loaded on demand.
148
+
149
+ Agents that support Skills receive a native skill adapter. Other MCP clients
150
+ receive the same canonical instructions as prompt-ready context. Memorix must
151
+ not rewrite a user's global agent configuration or claim a workflow is executed
152
+ when the host does not expose the required hooks or tools.
153
+
154
+ ## 1.2 Scope and Non-Goals
155
+
156
+ The 1.2 goal is **project knowledge that makes agents better at continuing
157
+ work**, not a general company data lake.
158
+
159
+ In scope:
160
+
161
+ - local evidence, claims, wiki pages, and workflows with source drill-down;
162
+ - code- and Git-aware freshness for project knowledge;
163
+ - versioned project workflows with progressive agent delivery;
164
+ - linting for missing sources, stale claims, broken links, conflicts, orphan
165
+ pages, and unverified workflow gates;
166
+ - a dashboard that explains why a page or workflow was selected.
167
+
168
+ Out of scope for 1.2:
169
+
170
+ - cloning Cognee's multi-format enterprise ingestion breadth;
171
+ - requiring Neo4j, a cloud API, or an external CodeGraph installation;
172
+ - capturing every conversation as knowledge;
173
+ - automatic writes to source-controlled knowledge without a clear project
174
+ policy and audit trail;
175
+ - running a workflow engine inside every supported agent.
176
+
177
+ ## Revised Delivery Order
178
+
179
+ 1. **Truth baseline:** make the existing graph and wiki labels honest; add
180
+ fixtures that distinguish a memory map, a structural code index, and a
181
+ source-backed claim.
182
+ 2. **Evidence and Code State:** ship CodeStateSnapshot and completeness
183
+ semantics before letting generated knowledge claim current truth.
184
+ 3. **Claim ledger:** add provenance, validity, conflict, and source drill-down
185
+ for knowledge assertions.
186
+ 4. **Wiki compiler:** ingest approved sources into reviewable, interlinked
187
+ Markdown pages; add index, log, and lint rather than only search.
188
+ 5. **Workflow inheritance:** introduce canonical playbooks, task selection,
189
+ agent adapters, and run evidence.
190
+ 6. **Workset integration:** rank code state, claims, wiki pages, workflows, Git
191
+ evidence, and verification hints into project context.
192
+ 7. **Lifecycle and proof:** keep maintenance non-blocking, expose diagnostics,
193
+ and measure whether new agents start useful work faster with less broad
194
+ repository exploration.
195
+
196
+ ## Acceptance Test
197
+
198
+ A newcomer can enter a project, say "continue the database migration issue,"
199
+ and receive a compact, evidence-backed answer that names the right starting
200
+ code, the current state of the migration, relevant decisions, a warning about
201
+ superseded advice, the matching migration workflow if one exists, and the
202
+ verification gate. Every recommendation can be drilled back to its source.
203
+
204
+ If Memorix cannot establish that chain of evidence, it must give a smaller
205
+ answer and say what it does not know.
@@ -0,0 +1,68 @@
1
+ # Memorix 1.2 Knowledge Workspace
2
+
3
+ The Knowledge Workspace is the human-readable layer above the Claim Ledger.
4
+ It turns approved, source-backed claims into reviewable Markdown rather than
5
+ silently treating a generated summary as project truth.
6
+
7
+ ## Storage modes
8
+
9
+ Local mode is the default. Its Markdown lives below the Memorix data directory,
10
+ scoped by a stable project hash. It stays private to the local user.
11
+
12
+ Versioned mode is explicit. The caller must supply an absolute workspace path
13
+ inside the Git project. Memorix rejects paths under Git internals, common build
14
+ directories, and paths Git reports as ignored. It never assumes that a hidden
15
+ project directory is versioned.
16
+
17
+ Both modes use the same layout:
18
+
19
+ schema.md
20
+ index.md
21
+ log.md
22
+ pages/
23
+ proposals/
24
+ workflows/
25
+
26
+ SQLite stores workspace and page metadata for fast retrieval and diagnostics.
27
+ Markdown remains the readable artifact. Memorix never copies all source files
28
+ or all conversations into either one.
29
+
30
+ ## Review model
31
+
32
+ Compilation is proposal-first:
33
+
34
+ 1. approved active claims are grouped into a topic page candidate;
35
+ 2. the candidate is written below proposals;
36
+ 3. a proposal records source claim ids, evidence ids, and code snapshot ids;
37
+ 4. an explicit apply operation writes the corresponding pages entry.
38
+
39
+ An existing page whose content differs from the last applied content hash is
40
+ treated as manually edited. Compilation leaves it untouched and writes a new
41
+ proposal instead. Applying a proposal rechecks that base hash before the atomic
42
+ replacement, so a concurrent human edit cannot be overwritten.
43
+
44
+ The schema, index, and append-only log are Memorix-owned workspace artifacts.
45
+ Topic pages are user-reviewable knowledge artifacts.
46
+
47
+ ## Page contract
48
+
49
+ Each page uses YAML frontmatter with a stable id, title, kind, status, review
50
+ state, claim ids, evidence references, code snapshot reference, tags, source
51
+ hash, and timestamps. The body is compact: current claims, evidence drill-down,
52
+ and internal links. It does not embed raw source or long conversation history.
53
+
54
+ ## Linting
55
+
56
+ Workspace lint reports:
57
+
58
+ - malformed frontmatter;
59
+ - broken internal Markdown links;
60
+ - pages that are not referenced by the index;
61
+ - claim ids with no evidence;
62
+ - superseded primary claims;
63
+ - unresolved claim conflicts;
64
+ - stale snapshot references;
65
+ - missing proposal targets or manual-edit protection failures.
66
+
67
+ Lint is advisory but visible. A broken or stale page cannot be silently treated
68
+ as current by the future Workset builder.
@@ -0,0 +1,234 @@
1
+ # Memorix 1.2 Product Story
2
+
3
+ Status: active product narrative
4
+ Companion: [1.2 Development Charter](1.2.0-DEVELOPMENT-CHARTER.md)
5
+ Start: 2026-07-17
6
+
7
+ ## The Promise
8
+
9
+ Memorix 1.2 makes a project easier to resume than to rediscover.
10
+
11
+ When an agent joins a task, it should not begin with a blank chat, a giant
12
+ transcript, or a demand that the user remember the right command. It should
13
+ receive a small, trustworthy starting map: what this task touches, what changed,
14
+ what the last people learned, what may no longer be true, and how to prove the
15
+ next change works.
16
+
17
+ Memorix does not replace reading code or making engineering judgments. It makes
18
+ the first useful read and the first useful action arrive sooner.
19
+
20
+ It also helps a project preserve the way it works: the release gates, migration
21
+ procedures, debugging habits, and hard-won project protocols that should not
22
+ disappear when a new agent joins.
23
+
24
+ ## The User Story
25
+
26
+ Someone opens an existing project and writes a normal request:
27
+
28
+ > Continue the timeout fix after the embedding-provider switch.
29
+
30
+ The useful experience is not a list of memory commands. Before the agent starts
31
+ wandering through the repository, it can ask Memorix for project context in the
32
+ same natural-language task. Memorix returns a compact **Workset**:
33
+
34
+ 1. **Start here**: the few files or symbols most likely to matter, with a reason.
35
+ 2. **What is true now**: the current revision, relevant local changes, and code
36
+ facts that were actually indexed.
37
+ 3. **What the project learned**: only durable decisions, previous failures, or
38
+ handoff facts relevant to this task.
39
+ 4. **What to distrust**: old memories whose files changed, incomplete scans, or
40
+ conflicting evidence.
41
+ 5. **How to finish safely**: focused tests, commands, or checks tied to the
42
+ affected area.
43
+
44
+ The agent still reads the source and decides how to fix the problem. The user
45
+ does not need to learn a graph query, a retrieval mode, or a storage model. If
46
+ Memorix has no useful advantage, it stays quiet instead of padding the context.
47
+
48
+ ## What Feels Automatic, and What Is Actually Happening
49
+
50
+ The user experience should be simple: state the task normally. Existing agent
51
+ guidance, plugins, or supported lifecycle hooks tell an agent that a
52
+ non-trivial task is a good time to request `memorix_project_context`, passing
53
+ that same task text. The agent receives a Workset and continues normally.
54
+
55
+ Memorix does not secretly read every prompt, force a tool call for trivial
56
+ work, or claim that all clients expose the same lifecycle events. An integration
57
+ without hooks still relies on MCP guidance and the agent's tool choice. 1.2
58
+ improves the relevance, freshness, and restraint of the returned Workset; it
59
+ does not pretend to provide universal invisible automation.
60
+
61
+ ## A Project Is Also a Knowledge Base
62
+
63
+ The product cannot stop at task handoff. Over time, a useful project develops
64
+ its own vocabulary, architecture rationale, operational procedures, test
65
+ conventions, release gates, and recurring failure patterns. Those things are
66
+ not just old chat text. They are knowledge that agents should be able to
67
+ inspect, update, and reuse.
68
+
69
+ 1.2 makes that knowledge a first-class **Knowledge Workspace**:
70
+
71
+ - immutable or traceable evidence from code, Git, tests, documents, and
72
+ high-signal observations;
73
+ - small claims that say what is believed, why, and whether it is still current;
74
+ - interlinked Markdown wiki pages that people can read and agents can maintain;
75
+ - reusable project workflows that describe how work should be performed and
76
+ verified.
77
+
78
+ The wiki is not a chat export and the workflow is not a giant global prompt.
79
+ Both are compact, source-backed project artifacts that load only when relevant.
80
+
81
+ ## Workflow Inheritance
82
+
83
+ Every serious project has a way of working: how to investigate a bug, migrate a
84
+ database, cut a release, recover from an incident, or review a risky change.
85
+ 1.2 treats those as versioned project playbooks rather than accidental habits
86
+ buried in sessions or agent-specific configuration files.
87
+
88
+ When a task matches a workflow, the agent receives its immediate first phase,
89
+ relevant knowledge pages, and verification gate. It can drill into the full
90
+ playbook only when needed. A successful run produces evidence; repeated,
91
+ reviewed evidence can propose a better workflow. It never silently rewrites the
92
+ project's process.
93
+
94
+ ## The Change From 1.1
95
+
96
+ 1.1 preserves project knowledge well: session notes, decisions, Git facts,
97
+ skills, hooks, search, and a lightweight code-memory layer. That remains useful,
98
+ but a stored note alone cannot prove that it still matches the code in front of
99
+ an agent.
100
+
101
+ 1.2 changes the center of gravity from **remembering old text** to **assembling
102
+ current evidence for one active task**.
103
+
104
+ | Question | 1.1 foundation | 1.2 destination |
105
+ | --- | --- | --- |
106
+ | What did we learn? | Searchable observations and Git facts | Keep only task-relevant durable knowledge |
107
+ | Where should work start? | Code Memory can suggest files | A ranked, source-backed start map |
108
+ | Is an old note still safe? | Freshness labels on code references | Revision- and worktree-aware evidence quality |
109
+ | How does a user use it? | Commands and MCP tools are available | A normal task produces a compact Workset |
110
+ | What happens after code changes? | Refresh and hooks exist | Evidence is invalidated or refreshed without blocking work |
111
+
112
+ ## The Four Evidence Planes
113
+
114
+ Memorix does not store a second copy of the repository. It keeps four different
115
+ kinds of evidence separate, then combines only what the task needs.
116
+
117
+ | Plane | Plain-language job | Example |
118
+ | --- | --- | --- |
119
+ | Narrative memory | Preserve the reasoning humans and agents would otherwise lose | "The timeout must cover both embedding retries and fallback." |
120
+ | Code state | Say where that reasoning connects to the code that exists now | `src/config/embedding.ts`, `resolveEmbeddingLane()` |
121
+ | Change evidence | Explain what moved since a fact was recorded | a new commit, a dirty config file, a deleted symbol |
122
+ | Verification evidence | Show how the next agent can know its work is correct | the focused timeout test and its last result |
123
+
124
+ The resulting Workset is not a transcript and not a code dump. It is closer to a
125
+ good handoff written by someone who can see the current repository.
126
+
127
+ The Knowledge Workspace sits above these evidence planes. It turns source-backed
128
+ claims into maintained wiki pages and reusable workflows. The Workset reads from
129
+ it; it does not blindly copy its contents into every task.
130
+
131
+ ## What "Dynamic" Means
132
+
133
+ Dynamic does not mean constantly re-indexing the whole repository or silently
134
+ inventing conclusions. It means a fact carries enough identity to be checked
135
+ against the project that exists now.
136
+
137
+ A **CodeStateSnapshot** is the receipt for that check. It records the Git
138
+ revision when available, a compact fingerprint of local uncommitted changes,
139
+ when indexing happened, which provider produced the facts, and whether paths or
140
+ languages were skipped. It does not store all source code again.
141
+
142
+ That lets Memorix make honest distinctions:
143
+
144
+ - "This decision still points at unchanged code."
145
+ - "The referenced file changed; use this note as a lead, not as truth."
146
+ - "The scan was incomplete, so this start map may have blind spots."
147
+ - "A local edit happened after the last snapshot; refresh only the affected
148
+ evidence when possible."
149
+
150
+ The important behavior is graceful: foreground work gets the best current
151
+ answer quickly, while larger refresh work stays bounded and non-blocking.
152
+
153
+ ## The Product Loop
154
+
155
+ ```mermaid
156
+ flowchart LR
157
+ A["Agent receives a normal task"] --> B["Memorix builds a compact Workset"]
158
+ B --> C["Agent reads the right code and acts"]
159
+ C --> D["Git, tests, hooks, and explicit notes create evidence"]
160
+ D --> E["Code state and memory freshness are updated"]
161
+ E --> A
162
+ ```
163
+
164
+ The loop is valuable only when it reduces repeated exploration. It must never
165
+ turn every prompt, file read, or chat line into permanent memory.
166
+
167
+ ## Delivery Story
168
+
169
+ ### Act 1: Establish Trust
170
+
171
+ Create an evaluation harness and versioned code-state snapshots. Before richer
172
+ parsers or external graph integrations, Memorix must prove whether a fact came
173
+ from the current project, a changed project, or an incomplete scan.
174
+
175
+ ### Act 2: Build the Smallest Useful Starting Map
176
+
177
+ Teach `memorix_project_context` to rank current code, Git evidence, durable
178
+ knowledge, and verification hints into a bounded Workset. The default should be
179
+ short enough to help an agent begin, not long enough to replace its context
180
+ window.
181
+
182
+ ### Act 3: Let Project Knowledge Compound
183
+
184
+ Build a source-backed claim ledger and a reviewable Markdown wiki. New evidence
185
+ updates the project's synthesis, flags contradictions, and preserves a path back
186
+ to source code, Git facts, tests, or approved documents.
187
+
188
+ ### Act 4: Let Agents Inherit Useful Workflows
189
+
190
+ Build canonical project playbooks for repeatable work. Adapt them to supported
191
+ agent skill and rule formats, but keep one project-owned source of truth and
192
+ load only the relevant phase for a task.
193
+
194
+ ### Act 5: Keep the Map Honest While Work Continues
195
+
196
+ Use lightweight lifecycle signals and Git/worktree changes to mark evidence
197
+ current, suspect, stale, or incomplete. A slow scan or an unavailable optional
198
+ provider must not block an agent from working.
199
+
200
+ ### Act 6: Improve Structural Quality Without Lock-in
201
+
202
+ Benchmark parser-backed and external CodeGraph-class providers on Windows,
203
+ package size, fidelity, and recovery behavior. Adopt a provider only when it
204
+ can be normalized, versioned, diagnosed, and safely replaced by the built-in
205
+ path.
206
+
207
+ ### Act 7: Prove the Product Helps
208
+
209
+ Test coding, debugging, onboarding, refactor, and non-code tasks with and
210
+ without a Workset. Measure faster first useful action, fewer broad scans,
211
+ correct stale-context warnings, and no unnecessary context cost. A feature that
212
+ looks sophisticated but does not improve those outcomes does not belong in 1.2.
213
+
214
+ ## What 1.2 Will Not Become
215
+
216
+ - A full IDE, language server, or code search replacement.
217
+ - A mandatory third-party CodeGraph installation.
218
+ - A generic company data lake or a clone of Cognee's broad ingestion platform.
219
+ - A second chat-history archive that captures everything by default.
220
+ - A huge MCP toolbox that makes every agent pay for graph features it will not
221
+ use.
222
+ - A black box that hides whether a recommendation came from current code,
223
+ older memory, or an incomplete scan.
224
+
225
+ ## The Release Test
226
+
227
+ 1.2 is ready when a capable new agent can enter an unfamiliar project, receive
228
+ a small and truthful workset from a normal task, locate the right starting code,
229
+ understand relevant project history, notice stale information before trusting
230
+ it, apply the relevant project workflow when one exists, and run the right
231
+ verification without the user teaching it a Memorix ritual.
232
+
233
+ If the project offers no reliable advantage over an ordinary file read,
234
+ Memorix should say less, not more.