memtrace-skills 1.2.8 → 1.2.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/rail-hook.d.ts +7 -1
- package/dist/rail-hook.js +176 -57
- package/dist/rail-install.js +3 -6
- package/dist/rail-lifecycle.js +6 -3
- package/dist/rail-runtime.d.ts +37 -3
- package/dist/rail-runtime.js +79 -7
- package/dist/tool-names.js +6 -0
- package/dist/transformers/claude.d.ts +14 -2
- package/dist/transformers/claude.js +50 -23
- package/dist/transformers/opencode.js +6 -6
- package/dist/transformers/rail-hooks.d.ts +6 -1
- package/dist/transformers/rail-hooks.js +31 -9
- package/dist/transformers/shared.d.ts +2 -1
- package/dist/transformers/shared.js +22 -10
- package/dist/transformers/vscode.js +3 -1
- package/package.json +2 -2
- package/plugins/memtrace-skills/references/mcp-parameters.md +14 -3
- package/plugins/memtrace-skills/skills/memtrace-codebase-exploration/SKILL.md +4 -0
- package/plugins/memtrace-skills/skills/memtrace-daily/SKILL.md +4 -0
- package/plugins/memtrace-skills/skills/memtrace-first/SKILL.md +14 -8
- package/plugins/memtrace-skills/skills/memtrace-graph/SKILL.md +4 -0
- package/plugins/memtrace-skills/skills/memtrace-guided-refactor/SKILL.md +88 -0
- package/plugins/memtrace-skills/skills/memtrace-impact/SKILL.md +4 -0
- package/plugins/memtrace-skills/skills/memtrace-index/SKILL.md +21 -0
- package/plugins/memtrace-skills/skills/memtrace-preflight/SKILL.md +4 -0
- package/plugins/memtrace-skills/skills/memtrace-quality/SKILL.md +16 -2
- package/plugins/memtrace-skills/skills/memtrace-refactoring-guide/SKILL.md +4 -0
- package/plugins/memtrace-skills/skills/memtrace-search/SKILL.md +1 -0
- package/plugins/memtrace-skills/skills/memtrace-session-continuity/SKILL.md +4 -0
- package/skills/commands/memtrace-daily.md +4 -0
- package/skills/commands/memtrace-graph.md +4 -0
- package/skills/commands/memtrace-impact.md +4 -0
- package/skills/commands/memtrace-index.md +22 -0
- package/skills/commands/memtrace-preflight.md +4 -0
- package/skills/commands/memtrace-quality.md +19 -2
- package/skills/commands/memtrace-search.md +1 -0
- package/skills/workflows/memtrace-codebase-exploration.md +4 -0
- package/skills/workflows/memtrace-first.md +14 -8
- package/skills/workflows/memtrace-guided-refactor.md +89 -0
- package/skills/workflows/memtrace-refactoring-guide.md +4 -0
- package/skills/workflows/memtrace-session-continuity.md +4 -0
|
@@ -100,3 +100,24 @@ After indexing completes, call `list_indexed_repositories` to confirm the repo a
|
|
|
100
100
|
```
|
|
101
101
|
|
|
102
102
|
While running, the job advances through the pipeline stages listed in step 3; `status = "failed"` carries an error message. The final user-facing report (confirmed via `list_indexed_repositories`) covers: `repo_id`, languages detected, total symbols, total relationships (node/edge counts).
|
|
103
|
+
|
|
104
|
+
## Source revision barrier and multi-query reports
|
|
105
|
+
|
|
106
|
+
After the job finishes, call `get_query_revision` with `repo_id`. It returns the
|
|
107
|
+
worktree, branch, source commit, content-and-save `source_revision`, indexing
|
|
108
|
+
revision, publication status and an opaque `token`. This is an explicit scan;
|
|
109
|
+
use it at report boundaries, not for every lookup.
|
|
110
|
+
|
|
111
|
+
To wait for a particular saved tree, take its `source_revision` from the first
|
|
112
|
+
observation and pass `expected_source_revision` with `wait_ms: 10000`. Repeat
|
|
113
|
+
within the same five-minute polling budget until `ready: true`. A source mismatch
|
|
114
|
+
means the working tree changed again; choose the new source revision deliberately.
|
|
115
|
+
Missing publication or file-hash evidence remains partial.
|
|
116
|
+
|
|
117
|
+
For a report, capture a ready token, run the repository queries (use the returned
|
|
118
|
+
branch wherever supported), then call `get_query_revision` with that token as
|
|
119
|
+
`expected_revision`. Accept only if this final check is ready and each answer's
|
|
120
|
+
`_meta.graph_revision.publication_unchanged_during_call` is true. Otherwise retry
|
|
121
|
+
the whole dependent group. Repeat the boundary checks for every repository in
|
|
122
|
+
a cross-repository report. This current-source protocol does not certify explicit
|
|
123
|
+
historical queries; Cortex has independent revisions.
|
|
@@ -5,6 +5,10 @@ description: "Run a one-call pre-flight check on a single existing symbol before
|
|
|
5
5
|
|
|
6
6
|
## Overview
|
|
7
7
|
|
|
8
|
+
### Choose the scope
|
|
9
|
+
|
|
10
|
+
Use this entry for the bundled gate before editing one existing symbol. For only upstream/downstream impact, use `memtrace-impact`. These remain separate so a request for a quick blast radius does not silently grow into a full preflight.
|
|
11
|
+
|
|
8
12
|
Pre-flight check: the two minutes before an edit that prevent the bug. One
|
|
9
13
|
`preflight_check` call composes the dependency graph, the bi-temporal change
|
|
10
14
|
history, and the complexity metrics into an actionable radar for a single
|
|
@@ -46,13 +46,27 @@ Results are still candidates, not proof — unmodeled dynamic dispatch can look
|
|
|
46
46
|
live or dead incorrectly. Verify before deleting. Prefer false-live over
|
|
47
47
|
false-dead.
|
|
48
48
|
|
|
49
|
-
### 3.
|
|
49
|
+
### 3. Change hotspots
|
|
50
|
+
|
|
51
|
+
Call `find_hotspots` for the same churn ? complexity ranking used by the dashboard:
|
|
52
|
+
|
|
53
|
+
```json
|
|
54
|
+
{ "repo_id": "memdb", "window_days": 14, "top_n": 10, "include_tests": false }
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Pass `branch` when investigating a particular branch. The default window is 14
|
|
58
|
+
days; windows up to 90 days are supported and longer-than-14-day queries carry
|
|
59
|
+
`slow_path: true`. Inspect `below_threshold`, `empty_reason`, and `census` before
|
|
60
|
+
interpreting the rows: fallback candidates are not qualifying hotspots.
|
|
61
|
+
Use `get_symbol_context` and `preflight_check` before changing a candidate.
|
|
62
|
+
|
|
63
|
+
### 3a. Complexity ranking
|
|
50
64
|
|
|
51
65
|
```json
|
|
52
66
|
{ "repo_id": "memdb", "top_n": 10 }
|
|
53
67
|
```
|
|
54
68
|
|
|
55
|
-
|
|
69
|
+
Use `find_most_complex_functions` for complexity alone, without change frequency.
|
|
56
70
|
|
|
57
71
|
| Score | Rating | Action |
|
|
58
72
|
|-------|--------|--------|
|
|
@@ -5,6 +5,10 @@ description: "Build a phased, risk-scored refactoring plan from Memtrace complex
|
|
|
5
5
|
|
|
6
6
|
## Overview
|
|
7
7
|
|
|
8
|
+
For an executable sequence with persisted progress and checks between edits, use
|
|
9
|
+
`memtrace-guided-refactor`. This guide remains the broader prioritization and
|
|
10
|
+
planning workflow; a guided run carries an approved bounded plan into execution.
|
|
11
|
+
|
|
8
12
|
Guided refactoring workflow — identifies refactoring candidates using structural analysis, scores them by risk and priority, checks Cortex decision memory for rationale/bans/contracts, and produces a phased refactoring plan. Combines complexity metrics, dead code detection, bridge analysis, temporal evolution, and decision memory to prioritize what to refactor first and how to do it safely.
|
|
9
13
|
|
|
10
14
|
## Steps
|
|
@@ -82,6 +82,7 @@ For a code change, inspect the relevant caller/callee contracts before editing.
|
|
|
82
82
|
symbol and flow; use these directly when they address the investigation.
|
|
83
83
|
They preserve repository, branch and file disambiguation. Process navigation
|
|
84
84
|
uses the returned process UUID. Symbol navigation uses name plus file path.
|
|
85
|
+
Rows are compact; `verbose: true` returns the full answer.
|
|
85
86
|
Expand only the evidence needed; an empty sampled process list does not mean
|
|
86
87
|
the symbol has no callers or callees.
|
|
87
88
|
|
|
@@ -5,6 +5,10 @@ description: "Catch up on everything that changed in an indexed source-code repo
|
|
|
5
5
|
|
|
6
6
|
## Overview
|
|
7
7
|
|
|
8
|
+
### Choose the scope
|
|
9
|
+
|
|
10
|
+
Use this entry to resume from a saved session anchor. For the fixed last-24-hour briefing, hotspots, or a session self-audit, use `memtrace-daily`. Preserve the requested time window instead of treating both workflows as the same catch-up.
|
|
11
|
+
|
|
8
12
|
Session continuity for agents. Store a timestamp from your last session and call `get_changes_since` to see exactly what happened since then — then drill into details with `get_evolution` if needed.
|
|
9
13
|
|
|
10
14
|
**Core principle:** Persist a `since` timestamp (or the `until` from your last catch-up call). Never invent a `days` parameter.
|
|
@@ -15,6 +15,10 @@ user-invocable: true
|
|
|
15
15
|
|
|
16
16
|
## Overview
|
|
17
17
|
|
|
18
|
+
### Choose the scope
|
|
19
|
+
|
|
20
|
+
Use this entry for the fixed last-24-hour briefing, hotspots, and session self-audit. To resume from your own saved anchor, use `memtrace-session-continuity`; do not substitute a 24-hour window for time since the user's last session.
|
|
21
|
+
|
|
18
22
|
Session bookends: orient before you start, audit before you finish. All
|
|
19
23
|
three tools read the bi-temporal version history — every save is a change
|
|
20
24
|
event with complexity deltas, so "what happened" includes "did it make the
|
|
@@ -17,6 +17,10 @@ user-invocable: true
|
|
|
17
17
|
|
|
18
18
|
## Overview
|
|
19
19
|
|
|
20
|
+
### Choose the scope
|
|
21
|
+
|
|
22
|
+
Use this entry for a specific graph algorithm or structural question: centrality, bridges, communities, or dependency paths. For a narrative introduction spanning scale, architecture, APIs, and recent activity, use `memtrace-codebase-exploration`.
|
|
23
|
+
|
|
20
24
|
Graph algorithms over the knowledge graph — communities (Louvain), PageRank centrality, bridge symbols (articulation points), shortest paths, and execution flows.
|
|
21
25
|
|
|
22
26
|
## Quick Reference
|
|
@@ -15,6 +15,10 @@ user-invocable: true
|
|
|
15
15
|
|
|
16
16
|
## Overview
|
|
17
17
|
|
|
18
|
+
### Choose the scope
|
|
19
|
+
|
|
20
|
+
Use this entry for a quick upstream/downstream blast radius. For the bundled pre-edit gate, including co-change, complexity, churn, and a verification checklist, use `memtrace-preflight`. Keep the narrower impact query available when a full preflight is unnecessary.
|
|
21
|
+
|
|
18
22
|
Compute the blast radius of changing a specific symbol. Traces upstream (what depends on this) and downstream (what this depends on) through the knowledge graph to quantify risk before making modifications.
|
|
19
23
|
|
|
20
24
|
## Quick Reference
|
|
@@ -6,6 +6,7 @@ allowed-tools:
|
|
|
6
6
|
- mcp__memtrace__check_job_status
|
|
7
7
|
- mcp__memtrace__list_jobs
|
|
8
8
|
- mcp__memtrace__list_indexed_repositories
|
|
9
|
+
- mcp__memtrace__get_query_revision
|
|
9
10
|
metadata:
|
|
10
11
|
author: "Syncable <support@syncable.dev>"
|
|
11
12
|
version: "1.0.0"
|
|
@@ -110,3 +111,24 @@ After indexing completes, call `list_indexed_repositories` to confirm the repo a
|
|
|
110
111
|
```
|
|
111
112
|
|
|
112
113
|
While running, the job advances through the pipeline stages listed in step 3; `status = "failed"` carries an error message. The final user-facing report (confirmed via `list_indexed_repositories`) covers: `repo_id`, languages detected, total symbols, total relationships (node/edge counts).
|
|
114
|
+
|
|
115
|
+
## Source revision barrier and multi-query reports
|
|
116
|
+
|
|
117
|
+
After the job finishes, call `get_query_revision` with `repo_id`. It returns the
|
|
118
|
+
worktree, branch, source commit, content-and-save `source_revision`, indexing
|
|
119
|
+
revision, publication status and an opaque `token`. This is an explicit scan;
|
|
120
|
+
use it at report boundaries, not for every lookup.
|
|
121
|
+
|
|
122
|
+
To wait for a particular saved tree, take its `source_revision` from the first
|
|
123
|
+
observation and pass `expected_source_revision` with `wait_ms: 10000`. Repeat
|
|
124
|
+
within the same five-minute polling budget until `ready: true`. A source mismatch
|
|
125
|
+
means the working tree changed again; choose the new source revision deliberately.
|
|
126
|
+
Missing publication or file-hash evidence remains partial.
|
|
127
|
+
|
|
128
|
+
For a report, capture a ready token, run the repository queries (use the returned
|
|
129
|
+
branch wherever supported), then call `get_query_revision` with that token as
|
|
130
|
+
`expected_revision`. Accept only if this final check is ready and each answer's
|
|
131
|
+
`_meta.graph_revision.publication_unchanged_during_call` is true. Otherwise retry
|
|
132
|
+
the whole dependent group. Repeat the boundary checks for every repository in
|
|
133
|
+
a cross-repository report. This current-source protocol does not certify explicit
|
|
134
|
+
historical queries; Cortex has independent revisions.
|
|
@@ -17,6 +17,10 @@ user-invocable: true
|
|
|
17
17
|
|
|
18
18
|
## Overview
|
|
19
19
|
|
|
20
|
+
### Choose the scope
|
|
21
|
+
|
|
22
|
+
Use this entry for the bundled gate before editing one existing symbol. For only upstream/downstream impact, use `memtrace-impact`. These remain separate so a request for a quick blast radius does not silently grow into a full preflight.
|
|
23
|
+
|
|
20
24
|
Pre-flight check: the two minutes before an edit that prevent the bug. One
|
|
21
25
|
`preflight_check` call composes the dependency graph, the bi-temporal change
|
|
22
26
|
history, and the complexity metrics into an actionable radar for a single
|
|
@@ -4,6 +4,9 @@ description: "Find dead code, complexity hotspots, and refactoring candidates in
|
|
|
4
4
|
allowed-tools:
|
|
5
5
|
- mcp__memtrace__find_dead_code
|
|
6
6
|
- mcp__memtrace__calculate_cyclomatic_complexity
|
|
7
|
+
- mcp__memtrace__get_symbol_context
|
|
8
|
+
- mcp__memtrace__preflight_check
|
|
9
|
+
- mcp__memtrace__find_hotspots
|
|
7
10
|
- mcp__memtrace__find_most_complex_functions
|
|
8
11
|
- mcp__memtrace__get_repository_stats
|
|
9
12
|
- mcp__memtrace__get_evolution
|
|
@@ -57,13 +60,27 @@ Results are still candidates, not proof — unmodeled dynamic dispatch can look
|
|
|
57
60
|
live or dead incorrectly. Verify before deleting. Prefer false-live over
|
|
58
61
|
false-dead.
|
|
59
62
|
|
|
60
|
-
### 3.
|
|
63
|
+
### 3. Change hotspots
|
|
64
|
+
|
|
65
|
+
Call `find_hotspots` for the same churn ? complexity ranking used by the dashboard:
|
|
66
|
+
|
|
67
|
+
```json
|
|
68
|
+
{ "repo_id": "memdb", "window_days": 14, "top_n": 10, "include_tests": false }
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Pass `branch` when investigating a particular branch. The default window is 14
|
|
72
|
+
days; windows up to 90 days are supported and longer-than-14-day queries carry
|
|
73
|
+
`slow_path: true`. Inspect `below_threshold`, `empty_reason`, and `census` before
|
|
74
|
+
interpreting the rows: fallback candidates are not qualifying hotspots.
|
|
75
|
+
Use `get_symbol_context` and `preflight_check` before changing a candidate.
|
|
76
|
+
|
|
77
|
+
### 3a. Complexity ranking
|
|
61
78
|
|
|
62
79
|
```json
|
|
63
80
|
{ "repo_id": "memdb", "top_n": 10 }
|
|
64
81
|
```
|
|
65
82
|
|
|
66
|
-
|
|
83
|
+
Use `find_most_complex_functions` for complexity alone, without change frequency.
|
|
67
84
|
|
|
68
85
|
| Score | Rating | Action |
|
|
69
86
|
|-------|--------|--------|
|
|
@@ -94,6 +94,7 @@ For a code change, inspect the relevant caller/callee contracts before editing.
|
|
|
94
94
|
symbol and flow; use these directly when they address the investigation.
|
|
95
95
|
They preserve repository, branch and file disambiguation. Process navigation
|
|
96
96
|
uses the returned process UUID. Symbol navigation uses name plus file path.
|
|
97
|
+
Rows are compact; `verbose: true` returns the full answer.
|
|
97
98
|
Expand only the evidence needed; an empty sampled process list does not mean
|
|
98
99
|
the symbol has no callers or callees.
|
|
99
100
|
|
|
@@ -23,6 +23,10 @@ user-invocable: true
|
|
|
23
23
|
|
|
24
24
|
## Overview
|
|
25
25
|
|
|
26
|
+
### Choose the scope
|
|
27
|
+
|
|
28
|
+
Use this entry for a narrative overview and onboarding. For a specific algorithm such as PageRank, bridge detection, communities, or dependency paths, use `memtrace-graph`. A broad overview and an algorithm query remain distinct entry points.
|
|
29
|
+
|
|
26
30
|
Full codebase exploration workflow — from indexing through architectural understanding. Chains indexing, graph algorithms, community detection, and temporal analysis into a structured onboarding experience. Use this when someone is new to a codebase and needs to build a mental model.
|
|
27
31
|
|
|
28
32
|
## Steps
|
|
@@ -43,8 +43,9 @@ matters. Retrieval is evidence, not a guarantee of complete coverage.
|
|
|
43
43
|
|
|
44
44
|
## Establish scope
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
Select the actual repository and branch; pass `repo_id` explicitly when
|
|
47
|
+
possible. When the task already names the repository, use it directly; call
|
|
48
|
+
`list_indexed_repositories` only when the repository or branch is unknown. It lists this session's
|
|
48
49
|
store only, so a repository missing from it may still be indexed and live in
|
|
49
50
|
another store. Do not index a parent containing unrelated repositories. For a
|
|
50
51
|
deliberately shared workspace, verify its workspace marker and scope before
|
|
@@ -85,7 +86,7 @@ answer from stale repos.
|
|
|
85
86
|
## Search, then investigate
|
|
86
87
|
|
|
87
88
|
- Exact symbol: `find_symbol(name=..., repo_id=...)`.
|
|
88
|
-
- Behavior or concept: `find_code(query=..., repo_id
|
|
89
|
+
- Behavior or concept: `find_code(query=..., repo_id=..., limit=10)` (default 20 rows).
|
|
89
90
|
- Relationships: `get_symbol_context` or `analyze_relationships` on the useful hit.
|
|
90
91
|
- Change impact: `get_impact`; confirm relevant callers against source.
|
|
91
92
|
- Execution path: `get_process_flow`; follow its `next_offset` for further steps.
|
|
@@ -101,7 +102,8 @@ Treat partial context, truncation and unavailable overlay context as incomplete
|
|
|
101
102
|
evidence; selected static flows are not complete runtime traces.
|
|
102
103
|
|
|
103
104
|
`context.next_calls` provides scoped follow-up arguments for the useful symbol
|
|
104
|
-
and process
|
|
105
|
+
and process; copy them rather than rebuilding arguments. A `context.processes[].id`
|
|
106
|
+
is the `process` for `get_process_flow`. Before changing shared behavior, inspect relevant callers and
|
|
105
107
|
callees to identify contracts the patch must preserve. Use process IDs for
|
|
106
108
|
flow navigation. No sampled flow is not proof that no call path exists.
|
|
107
109
|
|
|
@@ -112,8 +114,11 @@ Run related existing tests to detect regressions before claiming completion.
|
|
|
112
114
|
|
|
113
115
|
Read the bounded source span when verifying behavior, editing or quoting. Do not
|
|
114
116
|
fetch whole files or entire process traces when a local span answers the question.
|
|
115
|
-
`get_symbol_context`
|
|
116
|
-
|
|
117
|
+
`get_symbol_context` returns 5 rows per relationship section and omits source
|
|
118
|
+
bodies and references by default: `pagination` names sections with more
|
|
119
|
+
(`limit`/`offset`), `omitted` names what was left out (`include_references: true`,
|
|
120
|
+
`include_details: true`), and `include_content: true` returns the symbol's body whole
|
|
121
|
+
with short neighbour previews. An omitted
|
|
117
122
|
risk diagnostic means unknown, not zero callers or low risk. Check truncation and
|
|
118
123
|
pagination metadata before describing a neighborhood as complete.
|
|
119
124
|
|
|
@@ -241,8 +246,9 @@ when choosing among competing local idioms.
|
|
|
241
246
|
|
|
242
247
|
Use JSON numbers for limits/depths and booleans for switches. Use symbol names
|
|
243
248
|
for `get_symbol_context.symbol`, `get_impact.target` and relationship targets;
|
|
244
|
-
use IDs only where the specific schema asks for one.
|
|
245
|
-
|
|
249
|
+
use IDs only where the specific schema asks for one. When a call is rejected,
|
|
250
|
+
check that tool's schema rather than retrying from memory; do not pre-read schemas.
|
|
251
|
+
`find_code` has no `kind` filter; use `find_symbol` for it.
|
|
246
252
|
Search without an explicit repository uses safe scope inference, not an implicit
|
|
247
253
|
search of every repository. `get_evolution` uses `from`, not `days`.
|
|
248
254
|
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: memtrace-guided-refactor
|
|
3
|
+
description: "Run a saved, staged refactor shared with Memtrace's Quality page. Use for splitting tangled functions, extracting helpers, or continuing a guided refactor run with fixed file scope and checks between edits."
|
|
4
|
+
user-invocable: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Use the `guided_refactor` MCP tool to track the same run shown in Quality. This
|
|
8
|
+
skill coordinates the agent's edits and language tools; Memtrace does not execute
|
|
9
|
+
shell commands or rewrite source on behalf of the browser. Never invent check
|
|
10
|
+
results. Recorded checks are agent-reported evidence, not proof of equivalence.
|
|
11
|
+
|
|
12
|
+
## Diagnose
|
|
13
|
+
|
|
14
|
+
1. Resolve the repository and exact symbol/file with `find_symbol` and
|
|
15
|
+
`get_symbol_context`. Use the runtime attached to that repository.
|
|
16
|
+
2. If a run ID was supplied, call `guided_refactor` with `action: "get"`,
|
|
17
|
+
`repo_id`, and `run_id`. Otherwise call `action: "list"` and reuse a relevant
|
|
18
|
+
unfinished run; create one with `file_path` and `symbol` only when needed.
|
|
19
|
+
3. Inspect function complexity, affected callers, evolution/churn, module
|
|
20
|
+
boundaries, existing tests, and decision-memory constraints. Use
|
|
21
|
+
`get_function_quality_metrics`, `get_impact`, `get_evolution`, and
|
|
22
|
+
`get_symbol_context` as available; read the selected source. Record missing
|
|
23
|
+
evidence explicitly. LOC alone is never a reason to split code.
|
|
24
|
+
4. Respect the returned classification. `Manual` runs permit diagnosis and
|
|
25
|
+
blueprint only. In this first version, staged source work is available for
|
|
26
|
+
Rust, TypeScript, JavaScript, Python, and Go in Git checkouts. Other indexed
|
|
27
|
+
languages and configuration files still get a saved manual plan. Nothing is
|
|
28
|
+
classified Automatic.
|
|
29
|
+
|
|
30
|
+
## Blueprint
|
|
31
|
+
|
|
32
|
+
Call `get` before running baseline checks and retain its `snapshot`. Run the
|
|
33
|
+
project's compiler/type checker and relevant behavior tests. Compare the exported
|
|
34
|
+
API and affected callers. If a check fails or is unavailable, record that fact;
|
|
35
|
+
do not label it passed or begin source work.
|
|
36
|
+
|
|
37
|
+
Submit `action: "blueprint"` with the returned `revision`, retained `snapshot`,
|
|
38
|
+
diagnostic evidence in `note`, baseline `checks`, and 1–12 ordered `steps`:
|
|
39
|
+
|
|
40
|
+
```json
|
|
41
|
+
{
|
|
42
|
+
"title": "Capture diagnostic behavior",
|
|
43
|
+
"operation": "capture_tests",
|
|
44
|
+
"files": ["src/parser.rs", "tests/parser.rs"],
|
|
45
|
+
"boundary": "Add cases for existing diagnostics; preserve parsing behavior"
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
The only staged operations are `capture_tests` and `extract_helper`. Name every
|
|
50
|
+
file a step can change, including planned new files, with repository-relative
|
|
51
|
+
paths. Keep each step small enough to review. Do not change generated code,
|
|
52
|
+
ownership or lifetime contracts, macros, import side effects, public APIs, or
|
|
53
|
+
configuration semantics as an incidental extraction. If those boundaries cannot
|
|
54
|
+
be justified, pause and explain the manual decision needed.
|
|
55
|
+
|
|
56
|
+
Every check has `kind` (`compiler`, `tests`, or `api`), `command`, `passed`, and
|
|
57
|
+
`evidence`. All three kinds are required. Evidence should include exact commands,
|
|
58
|
+
results/counts, and uncertainty. API evidence can be a documented source/caller
|
|
59
|
+
comparison when the project has no API-check command.
|
|
60
|
+
|
|
61
|
+
## Execute one step
|
|
62
|
+
|
|
63
|
+
1. Call `get`, inspect saved state, and send `action: "begin"` with `revision`,
|
|
64
|
+
`snapshot`, and one stable `agent_id`. The coordinator refuses overlapping
|
|
65
|
+
active runs and source changes between steps. Do not delegate overlapping edits.
|
|
66
|
+
2. Make only the active step's bounded change. Preserve existing unrelated edits.
|
|
67
|
+
Do not commit during a run: a changed Git HEAD requires a fresh diagnosis.
|
|
68
|
+
3. Call `get` after editing and **before** running the checks. Retain that snapshot,
|
|
69
|
+
run the compiler, tests, and API comparison, then send `action: "checkpoint"`
|
|
70
|
+
with that same `snapshot`, current `revision`, `agent_id`, `checks`, and `note`.
|
|
71
|
+
Never refresh the snapshot after tests merely to get past a stale-source gate.
|
|
72
|
+
4. Inspect the response. A paused run is not a passed checkpoint. Stop editing
|
|
73
|
+
until the failure is understood. Keep failed evidence visible. To resume after
|
|
74
|
+
fixing the active step, obtain a fresh snapshot, rerun all checks, and send
|
|
75
|
+
`action: "resume"` with checks and an explanation, then checkpoint the step.
|
|
76
|
+
Restore an accidental scope escape without discarding someone else's work;
|
|
77
|
+
otherwise create a new diagnosis with an explicitly reviewed scope.
|
|
78
|
+
5. Begin the next step only after the preceding checkpoint is accepted.
|
|
79
|
+
|
|
80
|
+
## Verify
|
|
81
|
+
|
|
82
|
+
After every step is checked, the run enters Verify. Compare before/after
|
|
83
|
+
complexity, callers, public API, test results, and the actual diff. Get a snapshot,
|
|
84
|
+
run final checks, then submit `action: "complete"` with `revision`, `snapshot`,
|
|
85
|
+
`agent_id`, `checks`, and the comparison in `note`. State what remains unproven.
|
|
86
|
+
|
|
87
|
+
The Quality page shows saved stages, agent, scope, current tracked-file diff,
|
|
88
|
+
failed checks, and the final comparison. Closing the browser does not discard the
|
|
89
|
+
run. Use `pause` with a reason whenever the next safe step needs a decision.
|
|
@@ -23,6 +23,10 @@ user-invocable: true
|
|
|
23
23
|
|
|
24
24
|
## Overview
|
|
25
25
|
|
|
26
|
+
For an executable sequence with persisted progress and checks between edits, use
|
|
27
|
+
`memtrace-guided-refactor`. This guide remains the broader prioritization and
|
|
28
|
+
planning workflow; a guided run carries an approved bounded plan into execution.
|
|
29
|
+
|
|
26
30
|
Guided refactoring workflow — identifies refactoring candidates using structural analysis, scores them by risk and priority, checks Cortex decision memory for rationale/bans/contracts, and produces a phased refactoring plan. Combines complexity metrics, dead code detection, bridge analysis, temporal evolution, and decision memory to prioritize what to refactor first and how to do it safely.
|
|
27
31
|
|
|
28
32
|
## Steps
|
|
@@ -14,6 +14,10 @@ user-invocable: true
|
|
|
14
14
|
|
|
15
15
|
## Overview
|
|
16
16
|
|
|
17
|
+
### Choose the scope
|
|
18
|
+
|
|
19
|
+
Use this entry to resume from a saved session anchor. For the fixed last-24-hour briefing, hotspots, or a session self-audit, use `memtrace-daily`. Preserve the requested time window instead of treating both workflows as the same catch-up.
|
|
20
|
+
|
|
17
21
|
Session continuity for agents. Store a timestamp from your last session and call `get_changes_since` to see exactly what happened since then — then drill into details with `get_evolution` if needed.
|
|
18
22
|
|
|
19
23
|
**Core principle:** Persist a `since` timestamp (or the `until` from your last catch-up call). Never invent a `days` parameter.
|