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,189 @@
1
+ # Memorix 1.2 Code Provider Quality
2
+
3
+ Memorix needs useful code evidence without pretending that every local index is
4
+ a full semantic graph. This document defines the quality contract for Code
5
+ Memory providers and the optional integration with a locally indexed CodeGraph
6
+ CLI.
7
+
8
+ ## The User-Facing Rule
9
+
10
+ Project Context may say one of three truthful things:
11
+
12
+ 1. **Lite structural evidence**: Memorix found files, declarations, and import
13
+ hints with its built-in offline index. It is useful for starting points, but
14
+ it is heuristic rather than a language-server-quality graph.
15
+ 2. **External semantic evidence**: a locally indexed CodeGraph installation
16
+ returned validated symbols and relationships for this task. Memorix may use
17
+ those results as an extra, bounded outline.
18
+ 3. **External graph unavailable or stale**: Memorix falls back to Lite and
19
+ tells the agent why it did not use the external graph. It never labels the
20
+ fallback as complete semantic coverage.
21
+
22
+ An agent does not need to remember a different command for these cases. The
23
+ normal path remains `memorix_project_context` or `memorix context --task ...`.
24
+ The diagnostics path shows which evidence quality was actually used.
25
+
26
+ ## Built-In Lite: Useful, but Bounded
27
+
28
+ Lite is bundled with Memorix and needs no parser download, service, or network
29
+ connection. It incrementally records supported source files, declaration-like
30
+ symbols, import hints, file hashes, and versioned Code State snapshots.
31
+
32
+ It currently recognizes source-file extensions for TypeScript/JavaScript,
33
+ Python, Go, Rust, Java, C#, C/C++, PHP, Ruby, and Kotlin. Its declaration and
34
+ import recognition uses conservative language profiles, not a compiler or AST.
35
+ Therefore Lite must not claim any of the following:
36
+
37
+ - complete symbol extraction;
38
+ - resolved imports or cross-file call targets;
39
+ - type-aware references, routes, tests, inheritance, or data flow;
40
+ - immunity to comments, strings, unusual syntax, generated code, or parser
41
+ ambiguity.
42
+
43
+ Lite is still the durable fallback. It owns local snapshots and code-reference
44
+ freshness, so an external provider is never required to recover existing
45
+ Memorix memory.
46
+
47
+ ## Optional External CodeGraph
48
+
49
+ When a repository already has a healthy, local CodeGraph index, Memorix can ask
50
+ its CLI for a small task-specific semantic outline. This is an enhancement, not
51
+ a replacement database and not an automatic installation.
52
+
53
+ Memorix only considers the external provider when all of these are true:
54
+
55
+ 1. external context is enabled by the project configuration;
56
+ 2. the project already contains CodeGraph's `.codegraph` marker;
57
+ 3. `codegraph status --json` reports an initialized index for the exact project
58
+ root;
59
+ 4. the index has no reported pending changes or worktree mismatch;
60
+ 5. the bounded command completes before its configured timeout; and
61
+ 6. the returned JSON passes Memorix's schema, path, count, and output-size
62
+ validation.
63
+
64
+ Memorix never runs `codegraph init`, `index`, or `sync` on the user's behalf.
65
+ It does not transmit the repository to a remote service. Its default request is
66
+ equivalent to:
67
+
68
+ ~~~powershell
69
+ codegraph context --path <project-root> --format json --max-nodes 8 --no-code <task>
70
+ ~~~
71
+
72
+ `--no-code` is intentional. Memorix consumes a small outline of paths,
73
+ symbols, locations, and relationships; it does not copy raw code blocks into
74
+ the Workset or its own database. The CodeGraph command itself remains under the
75
+ user's local installation and project boundary.
76
+
77
+ ## Configuration
78
+
79
+ The default is `auto`: a pre-existing local `.codegraph` index is treated as an
80
+ explicit project-level opt-in, but Memorix will not create or refresh it. Set
81
+ the mode to `off` to use Lite only.
82
+
83
+ ~~~toml
84
+ [codegraph]
85
+ # "auto" (default) uses a healthy, pre-indexed local CodeGraph when present.
86
+ # "off" always uses the built-in Lite provider.
87
+ external_context = "auto"
88
+
89
+ # Optional only when CodeGraph is not available on PATH.
90
+ # external_command = "C:\\tools\\codegraph.cmd"
91
+
92
+ # A bounded local query. Values outside the safe range are clamped.
93
+ external_timeout_ms = 1200
94
+ ~~~
95
+
96
+ The equivalent YAML keys are `externalContext`, `externalCommand`, and
97
+ `externalTimeoutMs`. Configuration contains a command path and timeout only;
98
+ it must never hold an API key or provider credential.
99
+
100
+ ## Provider Contract
101
+
102
+ Both providers report a machine-readable quality object with:
103
+
104
+ | Field | Meaning |
105
+ | --- | --- |
106
+ | selected provider | Lite or external semantic provider actually used for this brief |
107
+ | mode | configured external policy (`auto` or `off`) |
108
+ | state | ready, disabled, unavailable, stale, timed out, invalid, or fallback |
109
+ | capabilities | declared symbols, imports, resolved relations, locations, and coverage level |
110
+ | coverage | provider-reported indexed file/language counts and Lite scan limits when known |
111
+ | reason | a short sanitized explanation for a downgrade |
112
+
113
+ The status is visible through `memorix codegraph status --json`, `memorix
114
+ doctor --json`, and Project Context JSON. Prompt output keeps it compact: it
115
+ adds semantic start points only when a valid external outline is available, and
116
+ adds one caution when a requested external outline was not safe to use.
117
+
118
+ ## Validation and Fallback
119
+
120
+ The external adapter executes without a shell, pins the working directory to
121
+ the actual project root, uses a bounded timeout and stdout limit, and accepts
122
+ JSON only. It rejects a result when:
123
+
124
+ - the status belongs to another project root;
125
+ - the index is uninitialized, has pending changes, or reports a worktree
126
+ mismatch;
127
+ - required output fields have the wrong type;
128
+ - a returned path is absolute, escapes the project root, or is excluded;
129
+ - returned node, edge, or related-file counts exceed Memorix's caps; or
130
+ - the command times out, exits unsuccessfully, or emits oversized output.
131
+
132
+ Rejected data is never persisted as Lite facts, claims, or wiki evidence. The
133
+ agent receives Lite context plus a short caution. This protects the durable
134
+ memory layer from a stale or malformed external tool while preserving a useful
135
+ offline response.
136
+
137
+ ## Reproducible Quality Gate
138
+
139
+ The provider suite uses deterministic fixture repositories and a fake command
140
+ runner. It verifies:
141
+
142
+ 1. Lite capability and scan-limit reporting remains honest.
143
+ 2. A valid external outline adds only bounded semantic start points and
144
+ relationship facts.
145
+ 3. Stale, mismatched, malformed, timed-out, and oversized external output
146
+ safely falls back to Lite.
147
+ 4. Raw code blocks and credentials do not enter the default Workset.
148
+ 5. `codegraph status` and `doctor` identify the active/fallback provider.
149
+
150
+ The optional real smoke can be run on a Windows project that already has an
151
+ indexed CodeGraph installation:
152
+
153
+ ~~~powershell
154
+ memorix codegraph status --json
155
+ memorix context --task "trace the authentication request"
156
+ ~~~
157
+
158
+ For a comparable Lite refresh and task-context measurement, build Memorix and
159
+ run the checked-in harness. It does not create or sync an external CodeGraph
160
+ index; point it at a project that has already opted in and been indexed.
161
+
162
+ ~~~powershell
163
+ npm run build
164
+ npm run benchmark:codegraph -- --path C:\\work\\my-project --task "trace the authentication request"
165
+ ~~~
166
+
167
+ The JSON result records Lite refresh time/counts, selected task provider,
168
+ external health, semantic entry-point/relation counts, and prompt tokens. It
169
+ contains no raw source code.
170
+
171
+ ### Windows Smoke Record
172
+
173
+ The following is a real 2026-07-18 Windows smoke against a two-file TypeScript
174
+ fixture using the locally installed CodeGraph CLI. It is a small reproducible
175
+ sanity check, not a general performance claim:
176
+
177
+ | Measurement | Result |
178
+ | --- | --- |
179
+ | `codegraph status --json` cold process | 609 ms |
180
+ | `codegraph context --format json --max-nodes 8 --no-code` | 376 ms |
181
+ | semantic result | 2 symbols, 1 resolved `calls` relation |
182
+ | Memorix task Workset | external semantic provider, 1 relation, 100 tokens |
183
+
184
+ The built-in Lite provider intentionally reports no resolved relation
185
+ capability. This is why the optional provider is treated as an enhancement,
186
+ not silently presented as equivalent evidence.
187
+
188
+ The result is successful only when it reports exactly what was used. A missing
189
+ or stale external index is a supported state, not a hidden failure.
@@ -0,0 +1,101 @@
1
+ # Memorix 1.2 Workflow Inheritance
2
+
3
+ Workflow inheritance gives a project a portable, reviewable description of how
4
+ it is normally changed. It is deliberately separate from a chat summary and
5
+ from any one agent's configuration format.
6
+
7
+ ## What a workflow is
8
+
9
+ A canonical workflow is a Markdown file in the Knowledge Workspace
10
+ \`workflows/\` directory. Its frontmatter describes:
11
+
12
+ - a stable id, title, description, version, and lifecycle state;
13
+ - task lenses and trigger phrases used for selection;
14
+ - assumptions, required context, guardrails, and allowed tools;
15
+ - ordered phases, branches, expected outputs, and verification gates;
16
+ - source claim, evidence, and code references; and
17
+ - the agent formats it may be rendered to.
18
+
19
+ The body contains the concise project-specific instructions. A workflow is not
20
+ a replacement for agent judgment: it makes the project's recurring quality
21
+ checks and delivery shape discoverable at the moment they are useful.
22
+
23
+ ## Ownership and safety
24
+
25
+ The canonical Markdown file is the source of truth. Agent-specific files are
26
+ adapters, not peer sources.
27
+
28
+ - Existing \`.windsurf/workflows/*.md\` files can be imported read-only. Import
29
+ never alters the source file.
30
+ - Memorix-generated adapters contain an ownership marker. Apply may replace
31
+ only a file carrying that exact marker.
32
+ - A user-created file at an adapter target is preserved. The operation reports
33
+ a conflict instead of overwriting it.
34
+ - Adapter writes stay project-scoped. They never edit global settings,
35
+ \`CLAUDE.md\`, MCP configuration, or an agent's unrelated rules.
36
+ - Preview is the default. Apply is explicit and uses atomic writes.
37
+
38
+ The result is compatible with agents that support project skills or rules,
39
+ while keeping the workflow understandable without any particular agent
40
+ installed.
41
+
42
+ ## Selection and progressive delivery
43
+
44
+ Memorix uses the current task wording and a compact task lens to choose no
45
+ more than two active workflows. It selects only an explicit match; a generic
46
+ task receives no workflow rather than boilerplate.
47
+
48
+ The normal Project Context result contains the workflow title, why it matched,
49
+ its first phase, and its verification gates. It does not inject the complete
50
+ workflow body into every prompt. A caller can request the full workflow when
51
+ that work actually begins.
52
+
53
+ ## Workflow runs
54
+
55
+ Each run records the task, selected workflow, starting code snapshot, phase
56
+ state, selected evidence, outcome, verification verdict, and failure reason.
57
+ Runs are operational metadata in SQLite; canonical Markdown remains the
58
+ reviewable project artifact.
59
+
60
+ A failed verification gate is carried into later Worksets as a visible caution.
61
+ Repeated failure may create an improvement proposal. Memorix never changes a
62
+ workflow source file merely because an agent failed a run.
63
+
64
+ ## Example
65
+
66
+ \`\`\`markdown
67
+ ---
68
+ id: release-checklist
69
+ title: Release checklist
70
+ description: Prepare a patch release without losing release evidence.
71
+ status: active
72
+ version: 1
73
+ taskLenses: [release]
74
+ triggers: [release, publish, npm]
75
+ allowedAgents: [codex, claude-code, cursor, windsurf]
76
+ verificationGates: [tests pass, package smoke passes, changelog reviewed]
77
+ ---
78
+
79
+ ## Prepare
80
+
81
+ 1. Read current package metadata, changelog, and unresolved release blockers.
82
+ 2. Run the focused verification before changing release files.
83
+
84
+ ## Publish
85
+
86
+ Only publish after package smoke and changelog review pass.
87
+ \`\`\`
88
+
89
+ ## Operator commands
90
+
91
+ \`\`\`text
92
+ memorix knowledge workflow import
93
+ memorix knowledge workflow list
94
+ memorix knowledge workflow select --task "prepare the patch release"
95
+ memorix knowledge workflow preview --id release-checklist --agent codex
96
+ memorix knowledge workflow apply --id release-checklist --agent codex
97
+ memorix knowledge workflow run --id release-checklist --task "publish 1.2.0" --outcome passed
98
+ \`\`\`
99
+
100
+ The workflow namespace is an advanced operator surface. Normal agents use the
101
+ existing Project Context path and should not need to memorize these commands.
@@ -0,0 +1,80 @@
1
+ # Memorix 1.2 Task Workset Retrieval
2
+
3
+ A Task Workset is the compact answer Memorix prepares for one concrete task.
4
+ It is the product surface of the 1.2 data model: code state, source-qualified
5
+ claims, reviewed knowledge pages, workflow starts, and verification evidence
6
+ become useful only when they are selected together and kept small.
7
+
8
+ ## Normal agent experience
9
+
10
+ The normal entry point remains:
11
+
12
+ memorix_project_context({ task: "..." })
13
+
14
+ No new MCP tool is required. The same task can be passed to the CLI:
15
+
16
+ memorix context --task "..."
17
+
18
+ Memorix returns an action-oriented brief:
19
+
20
+ 1. start files or symbols;
21
+ 2. only task-matching claims with stable claim and evidence references;
22
+ 3. at most two matching workflow starts, not full playbook text;
23
+ 4. visible cautions for dirty code, incomplete scans, stale memory, disputed
24
+ claims, and failed workflow verification; and
25
+ 5. a short verification plan.
26
+
27
+ When no current claim, page, or workflow is relevant, Memorix returns less
28
+ context. It does not insert a generic knowledge dump merely because a project
29
+ has a database.
30
+
31
+ ## Selection policy
32
+
33
+ The Workset starts with the existing task lens and source ranking, then applies
34
+ these bounded additions:
35
+
36
+ | Source | Inclusion rule | Default cap |
37
+ | --- | --- | --- |
38
+ | Start points | Existing lens-ranked current paths | 5 |
39
+ | Claims | Approved, task-matching active/disputed/unknown assertions | 3 |
40
+ | Knowledge pages | Published pages linked to selected claims | 2 |
41
+ | Workflows | Explicit task-lens or trigger match | 2 |
42
+ | Verification | Workflow gates, evidence-backed test hints, then lens hints | 4 |
43
+ | Cautions | Current safety state; never silently dropped | 6 |
44
+
45
+ The default rendered brief has a 180-token target. Whole items are dropped
46
+ before any source text is cut. The JSON form retains stable ids, source
47
+ references, selection reasons, and truncation information for diagnostics.
48
+
49
+ ## Evidence and freshness
50
+
51
+ A claim in the Workset carries its claim id and evidence refs; it is not
52
+ formatted as unqualified project truth. A published knowledge page is a
53
+ navigation pointer, not its entire Markdown body.
54
+
55
+ Code state has precedence:
56
+
57
+ - a dirty worktree becomes a Workset caution;
58
+ - an incomplete latest scan becomes a Workset caution;
59
+ - suspect or stale code-memory bindings become cautions;
60
+ - disputed or review-needed claims remain visible as cautions rather than
61
+ being silently ranked above current code;
62
+ - a previously failed selected workflow verification is shown before that
63
+ workflow is reused.
64
+
65
+ ## Performance and failure boundary
66
+
67
+ Workset assembly reads existing local SQLite metadata and known workflow/page
68
+ records. It does not scan the repository, compile pages, read full wiki bodies,
69
+ call an LLM, or invoke an external graph service in the foreground request.
70
+
71
+ If a knowledge artifact is missing or unavailable, the code-state brief still
72
+ works. A missing optional layer removes only that layer; it does not make
73
+ Project Context fail or substitute unqualified text.
74
+
75
+ ## Compatibility
76
+
77
+ The existing context pack remains available and compatible. It keeps its
78
+ current source/memory shape while sharing Workset provenance in its structured
79
+ form. The default MCP profile stays small: Project Context is still the
80
+ single recommended first call.
@@ -25,9 +25,9 @@ It supports:
25
25
  - local-first project-scoped memory
26
26
  - cross-agent recall across Cursor, Claude Code, Codex, Windsurf, Gemini CLI, GitHub Copilot, OpenCode, OpenClaw, Hermes Agent, Oh-my-Pi, Pi, Kiro, Antigravity, and Trae
27
27
 
28
- ### Current 1.1 Baseline
28
+ ### Current 1.2 Baseline
29
29
 
30
- For the 1.1 release line, the visible product shape is:
30
+ For the 1.2 release line, the visible product shape is:
31
31
 
32
32
  - `memorix setup --agent <agent> --global` is the default integration command for an existing coding agent or IDE
33
33
  - setup installs plugin packages where supported, MCP config, usage guidance, hooks, and skills according to agent capability
@@ -38,6 +38,9 @@ For the 1.1 release line, the visible product shape is:
38
38
  - model lanes are separate: `[memory.llm]` for formation/rerank/summaries, `[embedding]` for semantic search, `[agent]` for the model memcode talks to while coding
39
39
  - legacy `memorix.yml`, `.env`, and `~/.memorix/config.json` are compatibility inputs, not the recommended setup path
40
40
  - generated agent rules treat `memorix_session_start` as optional unless explicit session semantics matter
41
+ - `memorix_project_context` / `memorix context --task "..."` is the normal black-box entry for non-trivial coding work: it assembles a bounded task Workset instead of injecting a generic memory dump
42
+ - Code State keeps local snapshots and freshness links; a healthy pre-existing local CodeGraph index can add a bounded semantic outline, but Memorix never initializes or synchronizes that external index itself
43
+ - `memorix knowledge` is an explicit review path for source-backed Markdown knowledge and canonical workflows. Do not initialize a versioned workspace or apply a proposal unless the user asks for that managed artifact
41
44
  - integration surfaces are agent-specific: Claude Code, Codex, GitHub Copilot CLI, Antigravity, and Hermes receive plugin packages; OpenClaw receives a compatible bundle; Pi and Oh-my-Pi receive package entries; Gemini CLI receives an extension package; OpenCode receives a plugin file and skill; Cursor and other agents receive MCP/rules/hooks where supported
42
45
  - privacy-safe diagnostics and receipts avoid raw chat, memory text, query text, tool payloads, and local file paths
43
46
 
@@ -47,7 +50,7 @@ For the 1.1 release line, the visible product shape is:
47
50
 
48
51
  ### CLI is the direct command surface; MCP is the integration layer
49
52
 
50
- For direct use, prefer `memorix ...` commands first. In the 1.1 line, the CLI covers session, memory, reasoning, retention, formation, audit, transfer, skills, orchestration coordination, sync, ingest workflows, and the bundled terminal agent.
53
+ For direct use, prefer `memorix ...` commands first. In the 1.2 line, the CLI covers session, memory, Code State, knowledge workspaces, reasoning, retention, formation, audit, transfer, skills, orchestration coordination, sync, ingest workflows, and the bundled terminal agent.
51
54
 
52
55
  Do not ask memory-only users to join coordination state. A lightweight session is enough for memory, retrieval, reasoning, and continuation. Use `joinTeam` / `team_manage(join)` only for explicit task/message/lock coordination or for CLI-agent work managed by `memorix orchestrate`.
53
56
 
@@ -37,6 +37,7 @@ The current CLI namespaces are:
37
37
  - `memorix session`
38
38
  - `memorix memory`
39
39
  - `memorix codegraph`
40
+ - `memorix knowledge`
40
41
  - `memorix reasoning`
41
42
  - `memorix retention`
42
43
  - `memorix formation`
@@ -61,6 +62,7 @@ memorix memory search --query "release blocker"
61
62
  memorix context --task "continue auth bug"
62
63
  memorix codegraph refresh
63
64
  memorix codegraph status --json
65
+ memorix knowledge status
64
66
  memorix reasoning search --query "why sqlite"
65
67
  memorix retention status
66
68
  memorix task list
@@ -78,9 +80,9 @@ memorix receipt --json --probe "release blocker"
78
80
 
79
81
  The CLI is for direct terminal use, not a 1:1 mirror of MCP tool names. The only MCP-only area is the optional graph-compatibility tools (`create_entities`, `read_graph`, and related tools) for workflows that expect the official memory-server style graph API.
80
82
 
81
- ### Memory Autopilot, CodeGraph Memory, and Context Packs
83
+ ### Memory Autopilot, Code State, and Context Packs
82
84
 
83
- Memory Autopilot is the default agent-facing path for coding context. It uses CodeGraph Memory, project observations, task-lens heuristics, and freshness labels to produce a compact brief instead of dumping raw old chat text. CodeGraph Memory stores structured file, symbol, import-edge, and memory-to-code reference facts in the same local SQLite database as project memory. It is not a replacement for normal file reads. Its job is to help agents decide which memories still point at current code, which ones are stale, and which files/symbols deserve inspection next.
85
+ Memory Autopilot is the default agent-facing path for coding context. It builds a bounded task Workset instead of dumping old chat text: current project facts, Code State, selected observations, source-backed claims, matching knowledge/workflow starts, cautions, and verification hints. Code State stores versioned local file, symbol, import-edge, and memory-to-code reference facts beside project memory. It is not a replacement for normal file reads. Its job is to help agents decide which memories still point at current code, which ones are stale, and which files/symbols deserve inspection next.
84
86
 
85
87
  CLI:
86
88
 
@@ -97,19 +99,36 @@ memorix codegraph context-pack --task "continue auth bug"
97
99
 
98
100
  MCP:
99
101
 
100
- - `memorix_project_context` builds the default Memory Autopilot brief. It can auto-refresh CodeGraph Memory when the index is missing or stale, infer a task lens (`bugfix`, `feature`, `release`, `onboarding`, `refactor`, `docs`, `test`, or `general`), then return current project facts, Start here files, reliable code-bound memories, stale/suspect cautions, and lens-specific verification hints.
102
+ - `memorix_project_context` builds the default Memory Autopilot brief. It can auto-refresh Code State when the local index is missing or stale, infer a task lens (`bugfix`, `feature`, `release`, `onboarding`, `refactor`, `docs`, `test`, or `general`), then return current project facts, Start here files, selected evidence, stale/suspect cautions, and lens-specific verification hints.
101
103
  - `memorix_codegraph_status` returns provider/index counts for the current project.
102
104
  - `memorix_context_pack` builds a task-specific packet with reliable current memories, lower-trust unbound memories, current code facts, freshness warnings, suggested reads, and suggested verification.
103
105
 
104
- `memorix context` defaults to `--refresh auto`, so first use can seed CodeGraph Memory without a separate manual `memorix codegraph refresh`. Its brief puts live package/changelog/Git facts before memory hints and flags old `progress.txt` / dev-log notes as historical when they predate the latest changelog, so agents should treat current facts as the source of truth when files disagree. Task lenses keep the packet shaped to the work: bugfix briefs prefer failing tests and repros, release briefs prefer metadata/changelog/package checks, and onboarding briefs prefer docs and entry points while hiding unrelated suspect details. Use `--refresh never` for read-only inspection and `--refresh always` when you want to force a fresh scan.
106
+ `memorix context` defaults to `--refresh auto`, so first use can seed Code State without a separate manual `memorix codegraph refresh`. Its brief puts live package/changelog/Git facts before memory hints and flags old `progress.txt` / dev-log notes as historical when they predate the latest changelog, so agents should treat current facts as the source of truth when files disagree. Task lenses keep the packet shaped to the work: bugfix briefs prefer failing tests and repros, release briefs prefer metadata/changelog/package checks, and onboarding briefs prefer docs and entry points while hiding unrelated suspect details. Use `--refresh never` for read-only inspection and `--refresh always` when you want to force a fresh scan.
105
107
 
106
- Project-specific generated, vendored, or cache paths can be excluded from CodeGraph Memory with `[codegraph].exclude_patterns` in `memorix.toml` or `~/.memorix/config.toml` (`codegraph.excludePatterns` in legacy YAML). User patterns extend the built-in excludes and are applied to indexing, Project Context suggested reads, and Context Pack suggested reads.
108
+ Project-specific generated, vendored, or cache paths can be excluded from Code State with `[codegraph].exclude_patterns` in `memorix.toml` or `~/.memorix/config.toml` (`codegraph.excludePatterns` in legacy YAML). User patterns extend the built-in excludes and are applied to indexing, Project Context suggested reads, and Context Pack suggested reads.
107
109
 
108
110
  SessionStart hooks keep the default minimal hint lightweight. When memory behavior is configured with `sessionInject=full`, Memorix injects the compact Memory Autopilot brief at session start instead of only listing recent text memories.
109
111
 
110
112
  The intended loop for agents is: get the project brief when it helps, inspect the suggested current files, use stale or unbound memory only as a lead, store durable outcomes after the work changes the project, and resolve obsolete memories.
111
113
 
112
- The built-in Lite provider indexes common code files with lightweight file, symbol, and import facts. Future providers can feed richer graph data into the same store and context APIs.
114
+ The built-in Lite provider indexes common code files with lightweight file, symbol, and import facts. It is a structural fallback, not a language-server-quality graph. When a project already has a healthy local CodeGraph index, `[codegraph].external_context = "auto"` may add a validated, bounded semantic outline to the Workset. Memorix never initializes, syncs, or exports that external index, and never stores its raw source output. `memorix codegraph status --json`, `memorix doctor --json`, and Project Context JSON identify the actual provider quality.
115
+
116
+ ### Knowledge Workspace and Workflows
117
+
118
+ `memorix knowledge` is the deliberate, reviewable knowledge-management path. It uses source-backed claims to compile Markdown proposals, protects manually edited pages, and can keep canonical project workflows separate from agent-specific adapters.
119
+
120
+ ```bash
121
+ memorix knowledge init --mode local
122
+ memorix knowledge status
123
+ memorix knowledge compile
124
+ memorix knowledge lint
125
+ memorix knowledge apply --proposal <id>
126
+ memorix knowledge workflow import
127
+ memorix knowledge workflow select --task "prepare a release"
128
+ memorix knowledge workflow preview --id <workflow-id> --agent codex
129
+ ```
130
+
131
+ The advanced MCP action tool is `memorix_knowledge`. It is registered only in the `team` and `full` tool profiles so normal agents keep the compact micro/lite tool surface. Its actions are `workspace_init`, `status`, `compile`, `lint`, `proposal_apply`, `workflow_import`, `workflow_list`, `workflow_select`, `workflow_preview`, `workflow_apply`, and `workflow_run`. Use it only when an agent is explicitly managing the reviewable Knowledge Workspace; ordinary coding work should stay on `memorix_project_context`.
113
132
 
114
133
  ### Cross-Agent Handoff Receipt
115
134
 
@@ -65,6 +65,11 @@ noise_keywords = ["format", "typo"]
65
65
  exclude_patterns = ["vendor/**", "third_party/**", "generated/**"]
66
66
  max_file_bytes = 2097152
67
67
 
68
+ # Optional: use an already-indexed local CodeGraph only when it is healthy.
69
+ external_context = "auto"
70
+ # external_command = "C:\\tools\\codegraph.cmd"
71
+ external_timeout_ms = 1200
72
+
68
73
  [server]
69
74
  transport = "stdio"
70
75
  dashboard = true
@@ -209,15 +214,19 @@ the Memorix project ID.
209
214
 
210
215
  ### `[codegraph]`
211
216
 
212
- CodeGraph Memory and Project Context scan limits.
217
+ Code State, CodeGraph Memory, and Project Context scan/provider settings.
213
218
 
214
219
  Common keys:
215
220
 
216
221
  - `exclude_patterns = ["vendor/**", "third_party/**", "generated/**"]`
217
222
  - `max_file_bytes = 2097152` (2 MiB per source file by default)
223
+ - `external_context = "auto"` (`"off"` keeps the built-in Lite provider only)
224
+ - `external_command = "C:\\tools\\codegraph.cmd"` (optional path when CodeGraph is not on `PATH`)
225
+ - `external_timeout_ms = 1200` (bounded local semantic-query timeout)
218
226
 
219
- Legacy YAML uses `codegraph.excludePatterns` and `codegraph.maxFileBytes` for
220
- the same settings.
227
+ Legacy YAML uses `codegraph.excludePatterns`, `codegraph.maxFileBytes`,
228
+ `codegraph.externalContext`, `codegraph.externalCommand`, and
229
+ `codegraph.externalTimeoutMs` for the same settings.
221
230
 
222
231
  These patterns extend Memorix's built-in CodeGraph excludes (`node_modules`,
223
232
  build outputs, worktrees, and similar generated directories). Matching paths are
@@ -226,6 +235,15 @@ suggested reads. Files larger than `max_file_bytes` are also skipped so a
226
235
  generated or minified source file cannot monopolize an incremental scan. Raise
227
236
  the limit only for a repository where that file is intentional source.
228
237
 
238
+ `external_context = "auto"` is deliberately conservative. Memorix checks for
239
+ an already-initialized local `.codegraph` index and uses it only when its status
240
+ matches the current project and has no pending changes. It never runs
241
+ `codegraph init`, `index`, or `sync`, and it never sends repository content to
242
+ a remote service. A valid external response contributes only a small semantic
243
+ outline to the current task Workset; raw code is neither copied into the
244
+ Workset nor persisted as Memorix knowledge. See
245
+ [1.2 Provider Quality](1.2.0-PROVIDER-QUALITY.md) for the complete contract.
246
+
229
247
  ### `[server]`
230
248
 
231
249
  Server and dashboard behavior.
package/docs/README.md CHANGED
@@ -31,7 +31,8 @@ The public docs are organized by user intent:
31
31
  | Topic | Document |
32
32
  | --- | --- |
33
33
  | CLI commands and MCP tools | [API_REFERENCE.md](API_REFERENCE.md) |
34
- | Memory Autopilot, CodeGraph Memory, and context packs | [API_REFERENCE.md § Memory Autopilot, CodeGraph Memory, and Context Packs](API_REFERENCE.md#memory-autopilot-codegraph-memory-and-context-packs), [context fabric design](superpowers/specs/2026-06-29-codegraph-memory-context-fabric-design.md), and [auto context design](superpowers/specs/2026-06-29-auto-context-layer-design.md) |
34
+ | Memory Autopilot, Code State, and context packs | [API_REFERENCE.md § Memory Autopilot, Code State, and Context Packs](API_REFERENCE.md#memory-autopilot-code-state-and-context-packs), [1.2 Code State](1.2.0-CODE-STATE.md), and [1.2 Workset Retrieval](1.2.0-WORKSET-RETRIEVAL.md) |
35
+ | Reviewable knowledge pages and workflow inheritance | [API_REFERENCE.md § Knowledge Workspace and Workflows](API_REFERENCE.md#knowledge-workspace-and-workflows), [1.2 Knowledge Workspace](1.2.0-KNOWLEDGE-WORKSPACE.md), and [1.2 Workflow Inheritance](1.2.0-WORKFLOW-INHERITANCE.md) |
35
36
  | Git-derived engineering memory | [GIT_MEMORY.md](GIT_MEMORY.md) |
36
37
  | Memory formation and quality pipeline | [MEMORY_FORMATION_PIPELINE.md](MEMORY_FORMATION_PIPELINE.md) |
37
38
  | Performance and resource profile | [PERFORMANCE.md](PERFORMANCE.md) |
@@ -75,6 +76,18 @@ The public docs are organized by user intent:
75
76
  | Module-by-module notes | [MODULES.md](MODULES.md) |
76
77
  | CodeGraph Memory / Context Fabric design | [2026-06-29-codegraph-memory-context-fabric-design.md](superpowers/specs/2026-06-29-codegraph-memory-context-fabric-design.md) |
77
78
  | Auto Context Layer design | [2026-06-29-auto-context-layer-design.md](superpowers/specs/2026-06-29-auto-context-layer-design.md) |
79
+ | 1.2 product direction and user journey | [1.2 Product Story](1.2.0-PRODUCT-STORY.md) |
80
+ | 1.2 knowledge base and workflow inheritance research | [Knowledge and Workflow Research](1.2.0-KNOWLEDGE-WORKFLOW-RESEARCH.md) |
81
+ | 1.2 execution contract and phase gates | [1.2 Implementation Plan](1.2.0-IMPLEMENTATION-PLAN.md) |
82
+ | 1.2 deterministic Workset evaluation fixtures | [1.2 Evaluation Harness](1.2.0-EVALUATION-HARNESS.md) |
83
+ | 1.2 versioned code-state contract | [1.2 Code State Snapshots](1.2.0-CODE-STATE.md) |
84
+ | 1.2 source-backed claim and conflict contract | [1.2 Claim Ledger](1.2.0-CLAIM-LEDGER.md) |
85
+ | 1.2 reviewable Markdown knowledge workspace | [1.2 Knowledge Workspace](1.2.0-KNOWLEDGE-WORKSPACE.md) |
86
+ | 1.2 canonical workflows and safe agent adapters | [1.2 Workflow Inheritance](1.2.0-WORKFLOW-INHERITANCE.md) |
87
+ | 1.2 task-shaped evidence selection | [1.2 Workset Retrieval](1.2.0-WORKSET-RETRIEVAL.md) |
88
+ | 1.2 non-blocking refresh and maintenance contract | [1.2 Dynamic Lifecycle](1.2.0-DYNAMIC-LIFECYCLE.md) |
89
+ | 1.2 honest Lite and optional semantic CodeGraph provider contract | [1.2 Provider Quality](1.2.0-PROVIDER-QUALITY.md) |
90
+ | Active 1.2 multi-dimensional memory work | [1.2.0 Development Charter](1.2.0-DEVELOPMENT-CHARTER.md) |
78
91
  | Historical cloud sync and multi-agent research | [CLOUD_SYNC_AND_MULTI_AGENT_RESEARCH.md](CLOUD_SYNC_AND_MULTI_AGENT_RESEARCH.md) |
79
92
  | Known issues and old roadmap notes | [KNOWN_ISSUES_AND_ROADMAP.md](KNOWN_ISSUES_AND_ROADMAP.md) |
80
93
 
@@ -102,7 +115,9 @@ Historical/deep-reference documents may describe older designs. If they conflict
102
115
 
103
116
  ## Current Product Line
104
117
 
105
- These docs target the **1.1 release line**, where:
118
+ The released product is on the **1.1 line**. Active 1.2 design work is tracked
119
+ in the [1.2 Development Charter](1.2.0-DEVELOPMENT-CHARTER.md). The current
120
+ released baseline has:
106
121
 
107
122
  - `memorix setup --agent <agent> --global` is the default agent integration command
108
123
  - `memorix serve` is the manual stdio MCP server for external agents