@fingerskier/augment 0.5.0 → 0.5.1

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.
@@ -1,132 +1,132 @@
1
- # Verifying the auto-memory flow
2
-
3
- Augment now *enforces* the memory loop through host lifecycle hooks rather than
4
- relying on the agent to remember to call the MCP tools:
5
-
6
- | Event | Hook command | Effect |
7
- | ------------------ | ---------------------------------- | ------ |
8
- | `SessionStart` | `augment hook session-start` | Warms the daemon and registers the project. |
9
- | `UserPromptSubmit` | `augment hook user-prompt-submit` | Recalls relevant memory and injects it as `additionalContext` **before** the model sees the prompt. |
10
- | `PreToolUse` | `augment hook pre-tool-use` | Recalls **additional** memory keyed to the matched tool action (the edited file / the Bash command) and injects it as `additionalContext`. Matcher-scoped to `Edit\|Write\|Bash` to bound the hot path; injection-only (never blocks, gates, or rewrites a tool call). Uses a raised relevance floor (`min_score` 0.45 — above the 0.4 search default, calibrated on the real model because tool queries are command/path-shaped, not prose) and injects each distinct query at most once per session. |
11
- | `Stop` | `augment hook stop` | Blocks the turn **once** with a directive to upsert a memory, then allows the stop (loop-guarded per turn). |
12
-
13
- `PreToolUse` fires before **every matched** tool call, so it is the only hook with a tool-name
14
- `matcher` (the others fire once per prompt/turn). Two host nuances: on Claude the injected text
15
- rides alongside the *tool result* on the next model request (it supplements, rather than precedes,
16
- the action); on Codex builds older than ~0.124.0 `PreToolUse` `additionalContext` is rejected and
17
- silently dropped (the tool still runs). It is purely additive — `UserPromptSubmit` remains the
18
- guaranteed memory path on both hosts.
19
-
20
- The same `hooks/hooks.json` ships in both the Claude Code and Codex plugins
21
- (Codex copied Claude's event names + stdin/stdout contract), so one set of
22
- handlers serves both hosts.
23
-
24
- This doc is the test process. Run the layers top-to-bottom; each is cheaper and
25
- more isolated than the one below it.
26
-
27
- ## 1. Automated (no network, no host) — `npm test`
28
-
29
- ```sh
30
- npm test
31
- ```
32
-
33
- Covers:
34
- - `test/hooks.test.ts` — the stdin→stdout contract of every hook event
35
- (UserPromptSubmit envelope, PreToolUse tool-query derivation + injection-only
36
- envelope + 0.45 floor + per-session dedupe, Stop block-once loop guard,
37
- fail-open paths).
38
- - `test/recall.test.ts` — recall degrades to `""` on any failure (a hook must
39
- never break the agent).
40
- - `test/cli.test.ts` — the `recall` and `hook` CLI commands.
41
- - `test/install.test.ts` — the installer writes `hooks/hooks.json` for both hosts.
42
- - `test/integration/memory-flow.test.ts` — a planted memory flows
43
- upsert → index → `recall()` → UserPromptSubmit **and** PreToolUse envelopes, against a **real**
44
- `AugmentService` (real store + sqlite index), using the deterministic hash
45
- embedder. Proves the wiring end-to-end without a model download.
46
-
47
- ## 2. CLI smoke (real daemon + real embeddings, one machine)
48
-
49
- Build first, then drive the real daemon by hand. Use a throwaway memory root so
50
- you don't pollute your real memories:
51
-
52
- ```sh
53
- npm run build
54
- export AUGMENT_MEMORY_ROOT="$(mktemp -d)" # PowerShell: $env:AUGMENT_MEMORY_ROOT = (New-Item -ItemType Directory -Path $env:TEMP\augver -Force).FullName
55
-
56
- # Plant a memory (project_id 1 after the first init), then recall it.
57
- node ./dist/bin/augment.js recall "the deploy pipeline" # prints recalled text (empty until something is stored)
58
-
59
- # Exercise the hook handlers exactly as a host would (JSON on stdin):
60
- echo '{"user_input":"fix the deploy pipeline","cwd":"."}' | node ./dist/bin/augment.js hook user-prompt-submit
61
- # -> {"hookSpecificOutput":{"hookEventName":"UserPromptSubmit","additionalContext":"## Augment memory ..."}} (or nothing if no match)
62
-
63
- # PreToolUse keys the query off the tool action (Bash -> command, Edit/Write -> file_path):
64
- echo '{"tool_name":"Bash","tool_input":{"command":"deploy the pipeline"},"cwd":"."}' | node ./dist/bin/augment.js hook pre-tool-use
65
- # -> {"hookSpecificOutput":{"hookEventName":"PreToolUse","additionalContext":"## Augment memory ..."}} (or nothing if no match)
66
- echo '{"tool_name":"Read","tool_input":{"file_path":"x"}}' | node ./dist/bin/augment.js hook pre-tool-use
67
- # -> (empty) Read isn't in the installed matcher; even if invoked it derives a query but stays injection-only
68
-
69
- echo '{"session_id":"s","prompt_id":"p"}' | node ./dist/bin/augment.js hook stop
70
- # -> {"decision":"block","reason":"Before ending this turn, record durable memory ..."}
71
- echo '{"session_id":"s","prompt_id":"p"}' | node ./dist/bin/augment.js hook stop
72
- # -> (empty) second stop for the same turn is allowed — proves the loop guard
73
- ```
74
-
75
- The first `recall`/`hook user-prompt-submit` call auto-starts the daemon and, on
76
- a cold machine, downloads the bge-small model — so the very first run is slow.
77
- This is real-model retrieval; ranking quality (not just wiring) is what you're
78
- eyeballing here.
79
-
80
- Two footnotes on the examples: they omit `session_id`, which deliberately skips
81
- the PreToolUse once-per-session dedupe — include one to demo it. And the Stop
82
- loop-guard marker persists in the OS tmpdir, so re-running the stop example
83
- later with the same `session_id`/`prompt_id` yields empty on the *first* call
84
- too — use fresh ids per run.
85
-
86
- For a binding version of the ranking-quality check, `npm run test:model` runs
87
- the pinned real-bge abstention/recall tripwires
88
- (`test/real-model-abstention.model.ts`) — what this layer can otherwise only
89
- eyeball.
90
-
91
- ## 3. Real project (host-level hook firing)
92
-
93
- 1. Install into a repo (or user scope):
94
- ```sh
95
- npm exec --yes --package @fingerskier/augment -- augment install all --scope repo --memory-root "<your shared memory root>"
96
- ```
97
- 2. Confirm the plugin is actually installed/enabled — hooks only fire when the
98
- plugin is active:
99
- - **Claude Code:** `/plugin` → `augment` listed and enabled. The installer
100
- best-effort-registers it via the `claude` CLI; if that was skipped, run the
101
- printed `/plugin marketplace add … && /plugin install …` commands.
102
- - **Codex:** plugin-shipped hooks need a **one-time trust** — run `/hooks` and
103
- approve the augment hooks. (Managed/enterprise distribution can pre-trust;
104
- a plain plugin install cannot.)
105
- 3. Observe the loop on a real task:
106
- - **Inject:** start a session and give a task that matches something in your
107
- memory. The recalled block ("## Augment memory (recalled for this task)")
108
- should appear in the model's context — confirm it influenced the answer.
109
- - **Capture:** finish the task. The Stop hook should prompt the agent to
110
- `upsert` a WORK/ARCH/ISSUE/TODO/SPEC memory; confirm a new file appears under
111
- your memory root and that `augment recall` surfaces it next time.
112
-
113
- ## Known caveats (logged, not blockers)
114
-
115
- - **Hook startup cost (resolved).** Hooks now invoke the install-time-provisioned
116
- runtime directly (`node <prefix>/node_modules/@fingerskier/augment/dist/bin/augment.js
117
- hook <event>`, tens of milliseconds) — the old `npm exec --yes` form paid a
118
- multi-second npm bootstrap per event. Residual caveat: provisioning is
119
- best-effort. If npm was missing at install time the installer prints a manual
120
- `npm install --prefix <prefix> @fingerskier/augment` command and hooks fail
121
- open (silent no-ops) until it is run. The MCP server itself still launches via
122
- `npm exec`; only the hook hot path changed.
123
- - **Claude hook activation depends on plugin install.** The MCP server is also
124
- direct-registered (so the tools always exist), but the hooks live in the plugin;
125
- if the plugin isn't installed, the loop degrades to the CLAUDE.md prose guidance.
126
- - **Retrieval floor calibration (resolved).** The `(cos+1)/2` mis-normalization
127
- is fixed by an empirically-anchored cosine rescale (`SEMANTIC_COSINE_BASELINE`
128
- 0.33), and abstention is now proven on the real model by `npm run test:model`.
129
- Remaining retrieval-quality follow-ups (ordinary-upsert credential warnings
130
- and HF revision pinning) are tracked in
131
- `.council/memory/retrieval-quality-roadmap.md` and
132
- [ROADMAP.md](../ROADMAP.md).
1
+ # Verifying the auto-memory flow
2
+
3
+ Augment now *enforces* the memory loop through host lifecycle hooks rather than
4
+ relying on the agent to remember to call the MCP tools:
5
+
6
+ | Event | Hook command | Effect |
7
+ | ------------------ | ---------------------------------- | ------ |
8
+ | `SessionStart` | `augment hook session-start` | Warms the daemon and registers the project. |
9
+ | `UserPromptSubmit` | `augment hook user-prompt-submit` | Recalls relevant memory and injects it as `additionalContext` **before** the model sees the prompt. |
10
+ | `PreToolUse` | `augment hook pre-tool-use` | Recalls **additional** memory keyed to the matched tool action (the edited file / the Bash command) and injects it as `additionalContext`. Matcher-scoped to `Edit\|Write\|Bash` to bound the hot path; injection-only (never blocks, gates, or rewrites a tool call). Uses a raised relevance floor (`min_score` 0.45 — above the 0.4 search default, calibrated on the real model because tool queries are command/path-shaped, not prose) and injects each distinct query at most once per session. |
11
+ | `Stop` | `augment hook stop` | Blocks the turn **once** with a directive to upsert a memory, then allows the stop (loop-guarded per turn). |
12
+
13
+ `PreToolUse` fires before **every matched** tool call, so it is the only hook with a tool-name
14
+ `matcher` (the others fire once per prompt/turn). Two host nuances: on Claude the injected text
15
+ rides alongside the *tool result* on the next model request (it supplements, rather than precedes,
16
+ the action); on Codex builds older than ~0.124.0 `PreToolUse` `additionalContext` is rejected and
17
+ silently dropped (the tool still runs). It is purely additive — `UserPromptSubmit` remains the
18
+ guaranteed memory path on both hosts.
19
+
20
+ The same `hooks/hooks.json` ships in both the Claude Code and Codex plugins
21
+ (Codex copied Claude's event names + stdin/stdout contract), so one set of
22
+ handlers serves both hosts.
23
+
24
+ This doc is the test process. Run the layers top-to-bottom; each is cheaper and
25
+ more isolated than the one below it.
26
+
27
+ ## 1. Automated (no network, no host) — `npm test`
28
+
29
+ ```sh
30
+ npm test
31
+ ```
32
+
33
+ Covers:
34
+ - `test/hooks.test.ts` — the stdin→stdout contract of every hook event
35
+ (UserPromptSubmit envelope, PreToolUse tool-query derivation + injection-only
36
+ envelope + 0.45 floor + per-session dedupe, Stop block-once loop guard,
37
+ fail-open paths).
38
+ - `test/recall.test.ts` — recall degrades to `""` on any failure (a hook must
39
+ never break the agent).
40
+ - `test/cli.test.ts` — the `recall` and `hook` CLI commands.
41
+ - `test/install.test.ts` — the installer writes `hooks/hooks.json` for both hosts.
42
+ - `test/integration/memory-flow.test.ts` — a planted memory flows
43
+ upsert → index → `recall()` → UserPromptSubmit **and** PreToolUse envelopes, against a **real**
44
+ `AugmentService` (real store + sqlite index), using the deterministic hash
45
+ embedder. Proves the wiring end-to-end without a model download.
46
+
47
+ ## 2. CLI smoke (real daemon + real embeddings, one machine)
48
+
49
+ Build first, then drive the real daemon by hand. Use a throwaway memory root so
50
+ you don't pollute your real memories:
51
+
52
+ ```sh
53
+ npm run build
54
+ export AUGMENT_MEMORY_ROOT="$(mktemp -d)" # PowerShell: $env:AUGMENT_MEMORY_ROOT = (New-Item -ItemType Directory -Path $env:TEMP\augver -Force).FullName
55
+
56
+ # Plant a memory (project_id 1 after the first init), then recall it.
57
+ node ./dist/bin/augment.js recall "the deploy pipeline" # prints recalled text (empty until something is stored)
58
+
59
+ # Exercise the hook handlers exactly as a host would (JSON on stdin):
60
+ echo '{"user_input":"fix the deploy pipeline","cwd":"."}' | node ./dist/bin/augment.js hook user-prompt-submit
61
+ # -> {"hookSpecificOutput":{"hookEventName":"UserPromptSubmit","additionalContext":"## Augment memory ..."}} (or nothing if no match)
62
+
63
+ # PreToolUse keys the query off the tool action (Bash -> command, Edit/Write -> file_path):
64
+ echo '{"tool_name":"Bash","tool_input":{"command":"deploy the pipeline"},"cwd":"."}' | node ./dist/bin/augment.js hook pre-tool-use
65
+ # -> {"hookSpecificOutput":{"hookEventName":"PreToolUse","additionalContext":"## Augment memory ..."}} (or nothing if no match)
66
+ echo '{"tool_name":"Read","tool_input":{"file_path":"x"}}' | node ./dist/bin/augment.js hook pre-tool-use
67
+ # -> (empty) Read isn't in the installed matcher; even if invoked it derives a query but stays injection-only
68
+
69
+ echo '{"session_id":"s","prompt_id":"p"}' | node ./dist/bin/augment.js hook stop
70
+ # -> {"decision":"block","reason":"Before ending this turn, record durable memory ..."}
71
+ echo '{"session_id":"s","prompt_id":"p"}' | node ./dist/bin/augment.js hook stop
72
+ # -> (empty) second stop for the same turn is allowed — proves the loop guard
73
+ ```
74
+
75
+ The first `recall`/`hook user-prompt-submit` call auto-starts the daemon and, on
76
+ a cold machine, downloads the bge-small model — so the very first run is slow.
77
+ This is real-model retrieval; ranking quality (not just wiring) is what you're
78
+ eyeballing here.
79
+
80
+ Two footnotes on the examples: they omit `session_id`, which deliberately skips
81
+ the PreToolUse once-per-session dedupe — include one to demo it. And the Stop
82
+ loop-guard marker persists in the OS tmpdir, so re-running the stop example
83
+ later with the same `session_id`/`prompt_id` yields empty on the *first* call
84
+ too — use fresh ids per run.
85
+
86
+ For a binding version of the ranking-quality check, `npm run test:model` runs
87
+ the pinned real-bge abstention/recall tripwires
88
+ (`test/real-model-abstention.model.ts`) — what this layer can otherwise only
89
+ eyeball.
90
+
91
+ ## 3. Real project (host-level hook firing)
92
+
93
+ 1. Install into a repo (or user scope):
94
+ ```sh
95
+ npm exec --yes --package @fingerskier/augment -- augment install all --scope repo --memory-root "<your shared memory root>"
96
+ ```
97
+ 2. Confirm the plugin is actually installed/enabled — hooks only fire when the
98
+ plugin is active:
99
+ - **Claude Code:** `/plugin` → `augment` listed and enabled. The installer
100
+ best-effort-registers it via the `claude` CLI; if that was skipped, run the
101
+ printed `/plugin marketplace add … && /plugin install …` commands.
102
+ - **Codex:** plugin-shipped hooks need a **one-time trust** — run `/hooks` and
103
+ approve the augment hooks. (Managed/enterprise distribution can pre-trust;
104
+ a plain plugin install cannot.)
105
+ 3. Observe the loop on a real task:
106
+ - **Inject:** start a session and give a task that matches something in your
107
+ memory. The recalled block ("## Augment memory (recalled for this task)")
108
+ should appear in the model's context — confirm it influenced the answer.
109
+ - **Capture:** finish the task. The Stop hook should prompt the agent to
110
+ `upsert` a WORK/ARCH/ISSUE/TODO/SPEC memory; confirm a new file appears under
111
+ your memory root and that `augment recall` surfaces it next time.
112
+
113
+ ## Known caveats (logged, not blockers)
114
+
115
+ - **Hook startup cost (resolved).** Hooks now invoke the install-time-provisioned
116
+ runtime directly (`node <prefix>/node_modules/@fingerskier/augment/dist/bin/augment.js
117
+ hook <event>`, tens of milliseconds) — the old `npm exec --yes` form paid a
118
+ multi-second npm bootstrap per event. Residual caveat: provisioning is
119
+ best-effort. If npm was missing at install time the installer prints a manual
120
+ `npm install --prefix <prefix> @fingerskier/augment` command and hooks fail
121
+ open (silent no-ops) until it is run. The MCP server itself still launches via
122
+ `npm exec`; only the hook hot path changed.
123
+ - **Claude hook activation depends on plugin install.** The MCP server is also
124
+ direct-registered (so the tools always exist), but the hooks live in the plugin;
125
+ if the plugin isn't installed, the loop degrades to the CLAUDE.md prose guidance.
126
+ - **Retrieval floor calibration (resolved).** The `(cos+1)/2` mis-normalization
127
+ is fixed by an empirically-anchored cosine rescale (`SEMANTIC_COSINE_BASELINE`
128
+ 0.33), and abstention is now proven on the real model by `npm run test:model`.
129
+ Remaining retrieval-quality follow-ups (ordinary-upsert credential warnings
130
+ and HF revision pinning) are tracked in
131
+ `.council/memory/retrieval-quality-roadmap.md` and
132
+ [ROADMAP.md](../ROADMAP.md).
@@ -1,74 +1,74 @@
1
- ---
2
- name: augment-context
3
- description: Use Augment MCP memories to gather and persist project context during coding sessions.
4
- ---
5
-
6
- # Augment Context
7
-
8
- Use this skill when working in a repository with the Augment MCP server available.
9
-
10
- ## Session Start
11
-
12
- 1. Call `init_project`.
13
- 2. Call `search` with the user's task summary.
14
- 3. Read exact memories when search results identify likely governing context.
15
-
16
- ## Memory Insights
17
-
18
- When the user asks for memory insights, stats, health, or an overview of what
19
- Augment knows, call `memory_insights` (and `memory_graph` when they want to see
20
- how memories connect). In hosts that support MCP Apps these render interactive
21
- dashboard snippets; elsewhere they return a text summary — either way, relay the
22
- findings rather than re-deriving them from raw memories.
23
-
24
- ## Before Code Changes
25
-
26
- 1. Search for the file, component, command, error, or behavior being touched.
27
- 2. If the work depends on a prior decision, read and follow the relevant `SPEC`
28
- or `ARCH` memory.
29
- 3. If no relevant memory exists but the task creates a durable requirement or
30
- decision, create one before implementation.
31
-
32
- ## Memory Triggers
33
-
34
- Call `upsert` whenever one of these durable events happens:
35
-
36
- - A requirement, API contract, data model, or tool contract is clarified:
37
- use `SPEC`.
38
- - An implementation approach, tradeoff, transport choice, persistence model, or
39
- architecture decision is made: use `ARCH`.
40
- - A bug, risk, failing behavior, or blocker is discovered: use `ISSUE`.
41
- - Follow-up work is intentionally deferred: use `TODO`.
42
- - A meaningful implementation milestone is completed: use `WORK`.
43
- - A test scenario, regression case, or verification rule is learned: use `SPEC`
44
- or `WORK`, whichever is more durable.
45
-
46
- ## Links
47
-
48
- After creating or updating a memory:
49
-
50
- 1. Use `link` when a memory implements, depends on, blocks, parents, or relates
51
- to another memory.
52
- 2. Prefer linking new `WORK` notes to the `SPEC`, `ARCH`, `ISSUE`, or `TODO`
53
- they address.
54
-
55
- ## Session Finish
56
-
57
- For almost every session that did real work (skip only pure Q&A, read-only
58
- inspection, or trivial mechanical ops like 'commit & push'):
59
-
60
- 1. Upsert a concise `WORK` memory with what changed, key files, and verification.
61
- 2. Upsert or update `TODO` memories for known remaining work.
62
- 3. Link the final `WORK` memory to the relevant planning/decision memories.
63
-
64
- ## Guardrails
65
-
66
- - Do not store secrets, credentials, tokens, or private keys.
67
- - Do not store huge logs, dependency dumps, generated files, or full source files.
68
- - Keep each memory focused; split large notes before calling `upsert`.
69
- - Treat numeric memory IDs as local handles. Relative paths are the durable identity.
70
- - Use returned search text directly as context; do not ask Augment to summarize.
71
- - Default to upserting when a turn did real work; only skip pure Q&A, read-only
72
- inspection, or trivial mechanical ops. When unsure, upsert.
73
- - Do not create memories for facts already obvious from the current diff, or that
74
- duplicate an existing memory (update that one instead).
1
+ ---
2
+ name: augment-context
3
+ description: Use Augment MCP memories to gather and persist project context during coding sessions.
4
+ ---
5
+
6
+ # Augment Context
7
+
8
+ Use this skill when working in a repository with the Augment MCP server available.
9
+
10
+ ## Session Start
11
+
12
+ 1. Call `init_project`.
13
+ 2. Call `search` with the user's task summary.
14
+ 3. Read exact memories when search results identify likely governing context.
15
+
16
+ ## Memory Insights
17
+
18
+ When the user asks for memory insights, stats, health, or an overview of what
19
+ Augment knows, call `memory_insights` (and `memory_graph` when they want to see
20
+ how memories connect). In hosts that support MCP Apps these render interactive
21
+ dashboard snippets; elsewhere they return a text summary — either way, relay the
22
+ findings rather than re-deriving them from raw memories.
23
+
24
+ ## Before Code Changes
25
+
26
+ 1. Search for the file, component, command, error, or behavior being touched.
27
+ 2. If the work depends on a prior decision, read and follow the relevant `SPEC`
28
+ or `ARCH` memory.
29
+ 3. If no relevant memory exists but the task creates a durable requirement or
30
+ decision, create one before implementation.
31
+
32
+ ## Memory Triggers
33
+
34
+ Call `upsert` whenever one of these durable events happens:
35
+
36
+ - A requirement, API contract, data model, or tool contract is clarified:
37
+ use `SPEC`.
38
+ - An implementation approach, tradeoff, transport choice, persistence model, or
39
+ architecture decision is made: use `ARCH`.
40
+ - A bug, risk, failing behavior, or blocker is discovered: use `ISSUE`.
41
+ - Follow-up work is intentionally deferred: use `TODO`.
42
+ - A meaningful implementation milestone is completed: use `WORK`.
43
+ - A test scenario, regression case, or verification rule is learned: use `SPEC`
44
+ or `WORK`, whichever is more durable.
45
+
46
+ ## Links
47
+
48
+ After creating or updating a memory:
49
+
50
+ 1. Use `link` when a memory implements, depends on, blocks, parents, or relates
51
+ to another memory.
52
+ 2. Prefer linking new `WORK` notes to the `SPEC`, `ARCH`, `ISSUE`, or `TODO`
53
+ they address.
54
+
55
+ ## Session Finish
56
+
57
+ For almost every session that did real work (skip only pure Q&A, read-only
58
+ inspection, or trivial mechanical ops like 'commit & push'):
59
+
60
+ 1. Upsert a concise `WORK` memory with what changed, key files, and verification.
61
+ 2. Upsert or update `TODO` memories for known remaining work.
62
+ 3. Link the final `WORK` memory to the relevant planning/decision memories.
63
+
64
+ ## Guardrails
65
+
66
+ - Do not store secrets, credentials, tokens, or private keys.
67
+ - Do not store huge logs, dependency dumps, generated files, or full source files.
68
+ - Keep each memory focused; split large notes before calling `upsert`.
69
+ - Treat numeric memory IDs as local handles. Relative paths are the durable identity.
70
+ - Use returned search text directly as context; do not ask Augment to summarize.
71
+ - Default to upserting when a turn did real work; only skip pure Q&A, read-only
72
+ inspection, or trivial mechanical ops. When unsure, upsert.
73
+ - Do not create memories for facts already obvious from the current diff, or that
74
+ duplicate an existing memory (update that one instead).
@@ -1,36 +1,36 @@
1
- ---
2
- name: augment-decoction
3
- description: Distill recurring cross-project memory into generic SPEC/ARCH records and optionally remove fully subsumed originals. Use when the user asks to "decoct", "glean", generalize, or clean up repeated memories across projects.
4
- ---
5
-
6
- # Augment Decoction
7
-
8
- Decoction extracts durable, project-independent knowledge from recurring
9
- memories. It is separate from sleep: sleep consolidates settled work within one
10
- project, while decoction finds patterns across projects and writes them under
11
- `.generic/`.
12
-
13
- 1. Call `decoction_glean` with `action: "discover"`. If no cluster spans at
14
- least four distinct projects, report that and stop.
15
- 2. Pick a cluster and `read` every source. Synthesize one generic record:
16
- - use SPEC for a reusable contract or rule;
17
- - use ARCH for a reusable decision or tradeoff;
18
- - retain only claims supported across the projects;
19
- - put every source used in `derived_from`.
20
- 3. Suggest source removal only when the generic preserves the original's entire
21
- durable content. Do not suggest a source that also contains project-specific
22
- facts, history, caveats, or unresolved work.
23
- 4. Call `decoction_glean` with `action: "write"`, the complete draft, and the
24
- reasoned `suggested_removals`. For an existing generic, read it fresh and
25
- pass both of its expected hashes.
26
- 5. Report the generic path and any warnings. Warnings are advisory and do not
27
- block the write.
28
- 6. Show each suggested cleanup path and reason verbatim. Ask for explicit user
29
- approval of the exact paths; never infer approval from approval of the
30
- generic itself.
31
- 7. Only after approval, call `decoction_cleanup` with the generic path and the
32
- approved source paths. Report every deletion and any failure.
33
-
34
- Cleanup hard-deletes the selected originals after retargeting inbound links to
35
- the generic. It has no journal or rollback. The user may approve a subset or
36
- decline cleanup entirely.
1
+ ---
2
+ name: augment-decoction
3
+ description: Distill recurring cross-project memory into generic SPEC/ARCH records and optionally remove fully subsumed originals. Use when the user asks to "decoct", "glean", generalize, or clean up repeated memories across projects.
4
+ ---
5
+
6
+ # Augment Decoction
7
+
8
+ Decoction extracts durable, project-independent knowledge from recurring
9
+ memories. It is separate from sleep: sleep consolidates settled work within one
10
+ project, while decoction finds patterns across projects and writes them under
11
+ `.generic/`.
12
+
13
+ 1. Call `decoction_glean` with `action: "discover"`. If no cluster spans at
14
+ least four distinct projects, report that and stop.
15
+ 2. Pick a cluster and `read` every source. Synthesize one generic record:
16
+ - use SPEC for a reusable contract or rule;
17
+ - use ARCH for a reusable decision or tradeoff;
18
+ - retain only claims supported across the projects;
19
+ - put every source used in `derived_from`.
20
+ 3. Suggest source removal only when the generic preserves the original's entire
21
+ durable content. Do not suggest a source that also contains project-specific
22
+ facts, history, caveats, or unresolved work.
23
+ 4. Call `decoction_glean` with `action: "write"`, the complete draft, and the
24
+ reasoned `suggested_removals`. For an existing generic, read it fresh and
25
+ pass both of its expected hashes.
26
+ 5. Report the generic path and any warnings. Warnings are advisory and do not
27
+ block the write.
28
+ 6. Show each suggested cleanup path and reason verbatim. Ask for explicit user
29
+ approval of the exact paths; never infer approval from approval of the
30
+ generic itself.
31
+ 7. Only after approval, call `decoction_cleanup` with the generic path and the
32
+ approved source paths. Report every deletion and any failure.
33
+
34
+ Cleanup hard-deletes the selected originals after retargeting inbound links to
35
+ the generic. It has no journal or rollback. The user may approve a subset or
36
+ decline cleanup entirely.
@@ -1,34 +1,34 @@
1
- ---
2
- name: augment-dream
3
- description: Explore globally recalled Augment memories and propose speculative memories or links for explicit user approval. Use when the user asks to "dream" over memory, imagine hypotheses, or surface hidden connections across the current, generic, or foreign projects.
4
- ---
5
-
6
- # Augment Dream
7
-
8
- Dreams are hypotheses, not established facts. Discover and draft freely, but
9
- never mutate the corpus before the user explicitly approves a named proposal.
10
- Use a real project as the active project; `.generic` is inspiration or a link
11
- target only.
12
-
13
- 1. Call `search` separately for each exploratory query, always passing the
14
- active `project_name` and the singular `query` argument. Use normal global
15
- results as ranked: the current project receives its normal priority, while
16
- generic and foreign memories remain eligible.
17
- Do not reserve a generic quota or add a generic fallback.
18
- 2. Call `read` with each useful result's numeric memory id, and retain its
19
- returned relative path for provenance. Imagine 1-5 coherent candidates:
20
- - dream memory: a new record in the active project, with `derived_from`
21
- equal to the exact inspiration paths;
22
- - dream link: a link from an active-project memory to any current, generic,
23
- or foreign memory.
24
- Generic-only and foreign-only inspiration are valid.
25
- 3. Call `dream_propose` for each worthwhile candidate. State the speculation
26
- plainly in the content and rationale; do not present it as settled truth.
27
- 4. Show each proposal to the user. Only after explicit approval call
28
- `dream_apply` with its filename. Call `dream_reject` when the user rejects
29
- it. If approval is unclear, leave the proposal pending.
30
- 5. Report the applied speculative memory or link and its `dream:` commit.
31
-
32
- Keep evidence and conjecture distinguishable. Do not invent supporting source
33
- paths, and do not rewrite a foreign memory: foreign projects are inspiration
34
- and link targets only.
1
+ ---
2
+ name: augment-dream
3
+ description: Explore globally recalled Augment memories and propose speculative memories or links for explicit user approval. Use when the user asks to "dream" over memory, imagine hypotheses, or surface hidden connections across the current, generic, or foreign projects.
4
+ ---
5
+
6
+ # Augment Dream
7
+
8
+ Dreams are hypotheses, not established facts. Discover and draft freely, but
9
+ never mutate the corpus before the user explicitly approves a named proposal.
10
+ Use a real project as the active project; `.generic` is inspiration or a link
11
+ target only.
12
+
13
+ 1. Call `search` separately for each exploratory query, always passing the
14
+ active `project_name` and the singular `query` argument. Use normal global
15
+ results as ranked: the current project receives its normal priority, while
16
+ generic and foreign memories remain eligible.
17
+ Do not reserve a generic quota or add a generic fallback.
18
+ 2. Call `read` with each useful result's numeric memory id, and retain its
19
+ returned relative path for provenance. Imagine 1-5 coherent candidates:
20
+ - dream memory: a new record in the active project, with `derived_from`
21
+ equal to the exact inspiration paths;
22
+ - dream link: a link from an active-project memory to any current, generic,
23
+ or foreign memory.
24
+ Generic-only and foreign-only inspiration are valid.
25
+ 3. Call `dream_propose` for each worthwhile candidate. State the speculation
26
+ plainly in the content and rationale; do not present it as settled truth.
27
+ 4. Show each proposal to the user. Only after explicit approval call
28
+ `dream_apply` with its filename. Call `dream_reject` when the user rejects
29
+ it. If approval is unclear, leave the proposal pending.
30
+ 5. Report the applied speculative memory or link and its `dream:` commit.
31
+
32
+ Keep evidence and conjecture distinguishable. Do not invent supporting source
33
+ paths, and do not rewrite a foreign memory: foreign projects are inspiration
34
+ and link targets only.
@@ -1,4 +1,4 @@
1
- interface:
2
- display_name: "Augment Dream"
3
- short_description: "Propose speculative memory connections"
4
- default_prompt: "Use $augment-dream to explore memory and propose speculative memories or links for my approval."
1
+ interface:
2
+ display_name: "Augment Dream"
3
+ short_description: "Propose speculative memory connections"
4
+ default_prompt: "Use $augment-dream to explore memory and propose speculative memories or links for my approval."
@@ -1,26 +1,26 @@
1
- ---
2
- name: augment-sleep
3
- description: Consolidate settled WORK memories into durable SPEC/ARCH records via user-approved sleep proposals. Use when the user asks to "sleep", consolidate, or distill project memory.
4
- ---
5
-
6
- # Augment Sleep
7
-
8
- Sleep folds related, settled WORK memories into one durable SPEC or ARCH
9
- record. You draft; the user approves; `sleep_apply` writes. Never skip the
10
- approval step.
11
-
12
- 1. Call `sleep_candidates` (current project unless the user names one).
13
- If no clusters, report that and stop.
14
- 2. For each cluster (or the one the user picks): `read` every member, then
15
- draft ONE consolidated record — SPEC if a stable contract emerged, ARCH if
16
- a decision stuck. The draft must state every fact worth keeping from the
17
- sources; sources will be archived (down-weighted, never deleted).
18
- 3. Call `sleep_propose` with the draft (kind, name, content,
19
- derived_from = the cluster's relative paths). Tell the user where the
20
- proposal file lives — they may edit it directly before approving.
21
- 4. Show the user the draft and ask for approval. On an explicit yes, call
22
- `sleep_apply` with the proposal filename. On no, call `sleep_reject`.
23
- 5. Report what was consolidated, what was archived, and the git commit.
24
-
25
- Constraints: one project per pass; never invent facts not present in the
26
- sources; if a cluster mixes unrelated work, propose only the coherent subset.
1
+ ---
2
+ name: augment-sleep
3
+ description: Consolidate settled WORK memories into durable SPEC/ARCH records via user-approved sleep proposals. Use when the user asks to "sleep", consolidate, or distill project memory.
4
+ ---
5
+
6
+ # Augment Sleep
7
+
8
+ Sleep folds related, settled WORK memories into one durable SPEC or ARCH
9
+ record. You draft; the user approves; `sleep_apply` writes. Never skip the
10
+ approval step.
11
+
12
+ 1. Call `sleep_candidates` (current project unless the user names one).
13
+ If no clusters, report that and stop.
14
+ 2. For each cluster (or the one the user picks): `read` every member, then
15
+ draft ONE consolidated record — SPEC if a stable contract emerged, ARCH if
16
+ a decision stuck. The draft must state every fact worth keeping from the
17
+ sources; sources will be archived (down-weighted, never deleted).
18
+ 3. Call `sleep_propose` with the draft (kind, name, content,
19
+ derived_from = the cluster's relative paths). Tell the user where the
20
+ proposal file lives — they may edit it directly before approving.
21
+ 4. Show the user the draft and ask for approval. On an explicit yes, call
22
+ `sleep_apply` with the proposal filename. On no, call `sleep_reject`.
23
+ 5. Report what was consolidated, what was archived, and the git commit.
24
+
25
+ Constraints: one project per pass; never invent facts not present in the
26
+ sources; if a cluster mixes unrelated work, propose only the coherent subset.