@jaggerxtrm/specialists 3.14.1 → 3.15.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.
- package/LICENSE +21 -0
- package/README.md +24 -3
- package/config/catalog/gitnexus.json +12 -0
- package/config/catalog/index.json +59 -0
- package/config/catalog/native.json +12 -0
- package/config/catalog/serena.json +12 -0
- package/config/mandatory-rules/README.md +7 -6
- package/config/mandatory-rules/code-quality-defaults.md +5 -0
- package/config/mandatory-rules/diagnose-loop.md +13 -0
- package/config/mandatory-rules/gitnexus-required.md +1 -0
- package/config/mandatory-rules/research-tool-routing.md +12 -0
- package/config/mandatory-rules/security-review-defaults.md +9 -0
- package/config/mandatory-rules/serena-cheatsheet.md +16 -4
- package/config/presets.json +1 -1
- package/config/skills/memory-audit-transaction/SKILL.md +196 -0
- package/config/skills/memory-audit-transaction/scripts/pre-bulk-export.sh +58 -0
- package/config/skills/using-specialists/SKILL.md +13 -12
- package/config/skills/using-specialists-auto/SKILL.md +137 -0
- package/config/skills/using-specialists-v2/SKILL.md +14 -21
- package/config/skills/using-specialists-v3/SKILL.md +399 -27
- package/config/specialists/changelog-drafter.specialist.json +3 -2
- package/config/specialists/changelog-keeper.specialist.json +1 -1
- package/config/specialists/code-sanity.specialist.json +3 -5
- package/config/specialists/debugger.specialist.json +4 -8
- package/config/specialists/executor.specialist.json +6 -8
- package/config/specialists/explorer.specialist.json +7 -8
- package/config/specialists/memory-processor.specialist.json +14 -7
- package/config/specialists/node-coordinator.specialist.json +2 -2
- package/config/specialists/overthinker.specialist.json +7 -10
- package/config/specialists/planner.specialist.json +3 -4
- package/config/specialists/researcher.specialist.json +15 -19
- package/config/specialists/reviewer.specialist.json +4 -8
- package/config/specialists/security-auditor.specialist.json +3 -8
- package/config/specialists/specialists-creator.specialist.json +4 -2
- package/config/specialists/test-runner.specialist.json +10 -10
- package/config/specialists/xt-merge.specialist.json +10 -4
- package/dist/asset-contract.json +205 -0
- package/dist/index.js +2085 -734
- package/dist/lib.js +99 -17
- package/dist/types/cli/clean.d.ts.map +1 -1
- package/dist/types/cli/doctor.d.ts +1 -0
- package/dist/types/cli/doctor.d.ts.map +1 -1
- package/dist/types/cli/edit.d.ts.map +1 -1
- package/dist/types/cli/epic.d.ts +0 -1
- package/dist/types/cli/epic.d.ts.map +1 -1
- package/dist/types/cli/feed.d.ts.map +1 -1
- package/dist/types/cli/finalize.d.ts +2 -0
- package/dist/types/cli/finalize.d.ts.map +1 -0
- package/dist/types/cli/format-helpers.d.ts.map +1 -1
- package/dist/types/cli/init.d.ts +1 -1
- package/dist/types/cli/init.d.ts.map +1 -1
- package/dist/types/cli/list-rules.d.ts.map +1 -1
- package/dist/types/cli/merge.d.ts +4 -3
- package/dist/types/cli/merge.d.ts.map +1 -1
- package/dist/types/cli/prune-stale-defaults.d.ts.map +1 -1
- package/dist/types/cli/ps.d.ts.map +1 -1
- package/dist/types/cli/quickstart.d.ts.map +1 -1
- package/dist/types/cli/run.d.ts +1 -0
- package/dist/types/cli/run.d.ts.map +1 -1
- package/dist/types/pi/session.d.ts.map +1 -1
- package/dist/types/specialist/drift-detector.d.ts +2 -2
- package/dist/types/specialist/drift-detector.d.ts.map +1 -1
- package/dist/types/specialist/epic-lifecycle.d.ts +5 -5
- package/dist/types/specialist/epic-lifecycle.d.ts.map +1 -1
- package/dist/types/specialist/epic-readiness.d.ts +1 -1
- package/dist/types/specialist/epic-readiness.d.ts.map +1 -1
- package/dist/types/specialist/jobRegistry.d.ts +5 -0
- package/dist/types/specialist/jobRegistry.d.ts.map +1 -1
- package/dist/types/specialist/observability-sqlite.d.ts +8 -0
- package/dist/types/specialist/observability-sqlite.d.ts.map +1 -1
- package/dist/types/specialist/process-health.d.ts +77 -0
- package/dist/types/specialist/process-health.d.ts.map +1 -0
- package/dist/types/specialist/runner.d.ts.map +1 -1
- package/dist/types/specialist/schema.d.ts +162 -0
- package/dist/types/specialist/schema.d.ts.map +1 -1
- package/dist/types/specialist/script-runner.d.ts +31 -1
- package/dist/types/specialist/script-runner.d.ts.map +1 -1
- package/dist/types/specialist/supervisor.d.ts +8 -0
- package/dist/types/specialist/supervisor.d.ts.map +1 -1
- package/dist/types/specialist/timeline-query.d.ts +1 -1
- package/dist/types/specialist/timeline-query.d.ts.map +1 -1
- package/dist/types/specialist/worktree.d.ts.map +1 -1
- package/package.json +32 -7
- package/config/benchmarks/executor-benchmark-matrix.json +0 -25
- package/config/mandatory-rules/debugger-trace-first.md +0 -5
- package/config/skills/using-specialists/evals/evals.json +0 -68
- package/config/skills/using-specialists-v3/evals/evals.json +0 -89
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Dawid (Jaggerxtrm)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -16,12 +16,33 @@ A specialist is a reusable execution spec: model, allowed tools, skills, system
|
|
|
16
16
|
|
|
17
17
|
---
|
|
18
18
|
|
|
19
|
+
## Vision
|
|
20
|
+
|
|
21
|
+
Specialists turns one overloaded agent chat into a coordinated agent mind: a central orchestrator keeps task identity and evidence, while fresh specialist sessions act as scoped capabilities with their own prompts, rules, memory, and contracts. See [specialists.scheme.md](specialists.scheme.md) for diagrams comparing the single-chat model with specialist pipelines, herd memory, adaptive chains, and service specialists.
|
|
22
|
+
|
|
19
23
|
## Quick start
|
|
20
24
|
|
|
25
|
+
1. Install Bun.
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
bun --version
|
|
29
|
+
curl -fsSL https://bun.sh/install | bash
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
2. Install xtrm-tools.
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npm install -g xtrm-tools
|
|
36
|
+
xt install
|
|
37
|
+
xt init
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
3. Install Specialists.
|
|
41
|
+
|
|
21
42
|
```bash
|
|
22
43
|
npm install -g @jaggerxtrm/specialists
|
|
23
|
-
|
|
24
|
-
|
|
44
|
+
sp init
|
|
45
|
+
sp list
|
|
25
46
|
```
|
|
26
47
|
|
|
27
48
|
`sp` is a shorter alias for `specialists` — both commands are identical:
|
|
@@ -62,7 +83,7 @@ specialists run codebase-explorer --prompt "Map the CLI architecture"
|
|
|
62
83
|
- creates `specialists/`
|
|
63
84
|
- creates `.specialists/` runtime dirs (`jobs/`, `ready/`)
|
|
64
85
|
- adds `.specialists/` to `.gitignore`
|
|
65
|
-
- injects the canonical Specialists Workflow block into `AGENTS.md`
|
|
86
|
+
- injects the canonical Specialists Workflow block into `AGENTS.md`
|
|
66
87
|
- registers the Specialists MCP server at project scope
|
|
67
88
|
|
|
68
89
|
Verify bootstrap state:
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"catalog": "gitnexus",
|
|
3
|
+
"package": "pi-gitnexus",
|
|
4
|
+
"version": "0.6.1",
|
|
5
|
+
"precedence": 1,
|
|
6
|
+
"source_tiers": {
|
|
7
|
+
"READ_ONLY": ["gitnexus_list_repos", "gitnexus_query", "gitnexus_context", "gitnexus_impact", "gitnexus_detect_changes"],
|
|
8
|
+
"LOW": ["gitnexus_list_repos", "gitnexus_query", "gitnexus_context", "gitnexus_impact", "gitnexus_detect_changes"],
|
|
9
|
+
"MEDIUM": ["gitnexus_list_repos", "gitnexus_query", "gitnexus_context", "gitnexus_impact", "gitnexus_detect_changes", "gitnexus_rename", "gitnexus_cypher"],
|
|
10
|
+
"HIGH": ["gitnexus_list_repos", "gitnexus_query", "gitnexus_context", "gitnexus_impact", "gitnexus_detect_changes", "gitnexus_rename", "gitnexus_cypher"]
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"precedence_order": ["native", "gitnexus", "serena"],
|
|
3
|
+
"default_overrides": {
|
|
4
|
+
"READ_ONLY": {
|
|
5
|
+
"denied_natives_when_extension": ["read", "grep", "find", "ls"],
|
|
6
|
+
"denied_natives_mode": "hard"
|
|
7
|
+
},
|
|
8
|
+
"LOW": {
|
|
9
|
+
"denied_natives_when_extension": ["read", "grep", "find", "ls"],
|
|
10
|
+
"denied_natives_mode": "hard"
|
|
11
|
+
},
|
|
12
|
+
"MEDIUM": {
|
|
13
|
+
"denied_natives_when_extension": ["read", "grep", "find", "ls"],
|
|
14
|
+
"denied_natives_mode": "hard"
|
|
15
|
+
},
|
|
16
|
+
"HIGH": {
|
|
17
|
+
"denied_natives_when_extension": ["read", "grep", "find", "ls"],
|
|
18
|
+
"denied_natives_mode": "hard"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"catalogs": [
|
|
22
|
+
{
|
|
23
|
+
"catalog": "native",
|
|
24
|
+
"package": "specialists",
|
|
25
|
+
"version": "3.11.0",
|
|
26
|
+
"precedence": 0,
|
|
27
|
+
"source_tiers": {
|
|
28
|
+
"READ_ONLY": ["read", "grep", "find", "ls"],
|
|
29
|
+
"LOW": ["read", "grep", "find", "ls", "bash"],
|
|
30
|
+
"MEDIUM": ["read", "grep", "find", "ls", "bash", "edit"],
|
|
31
|
+
"HIGH": ["read", "grep", "find", "ls", "bash", "edit", "write"]
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"catalog": "gitnexus",
|
|
36
|
+
"package": "pi-gitnexus",
|
|
37
|
+
"version": "0.6.1",
|
|
38
|
+
"precedence": 1,
|
|
39
|
+
"source_tiers": {
|
|
40
|
+
"READ_ONLY": ["gitnexus_list_repos", "gitnexus_query", "gitnexus_context", "gitnexus_impact", "gitnexus_detect_changes"],
|
|
41
|
+
"LOW": ["gitnexus_list_repos", "gitnexus_query", "gitnexus_context", "gitnexus_impact", "gitnexus_detect_changes"],
|
|
42
|
+
"MEDIUM": ["gitnexus_list_repos", "gitnexus_query", "gitnexus_context", "gitnexus_impact", "gitnexus_detect_changes", "gitnexus_rename", "gitnexus_cypher"],
|
|
43
|
+
"HIGH": ["gitnexus_list_repos", "gitnexus_query", "gitnexus_context", "gitnexus_impact", "gitnexus_detect_changes", "gitnexus_rename", "gitnexus_cypher"]
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"catalog": "serena",
|
|
48
|
+
"package": "pi-serena-tools",
|
|
49
|
+
"version": "0.1.0",
|
|
50
|
+
"precedence": 2,
|
|
51
|
+
"source_tiers": {
|
|
52
|
+
"READ_ONLY": ["serena_list_tools", "find_symbol", "find_referencing_symbols", "read_file", "get_symbols_overview", "jet_brains_get_symbols_overview", "jet_brains_find_symbol", "jet_brains_find_referencing_symbols", "jet_brains_type_hierarchy", "search_for_pattern", "list_dir", "find_file", "get_current_config", "activate_project", "check_onboarding_performed", "initial_instructions", "think_about_collected_information", "think_about_task_adherence", "think_about_whether_you_are_done", "list_memories", "read_memory"],
|
|
53
|
+
"LOW": ["serena_list_tools", "find_symbol", "find_referencing_symbols", "read_file", "get_symbols_overview", "jet_brains_get_symbols_overview", "jet_brains_find_symbol", "jet_brains_find_referencing_symbols", "jet_brains_type_hierarchy", "search_for_pattern", "list_dir", "find_file", "get_current_config", "activate_project", "check_onboarding_performed", "initial_instructions", "think_about_collected_information", "think_about_task_adherence", "think_about_whether_you_are_done", "list_memories", "read_memory", "execute_shell_command"],
|
|
54
|
+
"MEDIUM": ["serena_list_tools", "find_symbol", "find_referencing_symbols", "read_file", "get_symbols_overview", "jet_brains_get_symbols_overview", "jet_brains_find_symbol", "jet_brains_find_referencing_symbols", "jet_brains_type_hierarchy", "search_for_pattern", "list_dir", "find_file", "get_current_config", "activate_project", "check_onboarding_performed", "initial_instructions", "think_about_collected_information", "think_about_task_adherence", "think_about_whether_you_are_done", "list_memories", "read_memory", "execute_shell_command", "insert_after_symbol", "replace_symbol_body", "insert_before_symbol", "rename_symbol", "restart_language_server", "create_text_file", "replace_content", "delete_lines", "replace_lines", "insert_at_line", "remove_project", "switch_modes", "open_dashboard", "onboarding", "prepare_for_new_conversation", "summarize_changes", "write_memory", "delete_memory", "rename_memory", "edit_memory", "serena_mcp_reset"],
|
|
55
|
+
"HIGH": ["serena_list_tools", "find_symbol", "find_referencing_symbols", "read_file", "get_symbols_overview", "jet_brains_get_symbols_overview", "jet_brains_find_symbol", "jet_brains_find_referencing_symbols", "jet_brains_type_hierarchy", "search_for_pattern", "list_dir", "find_file", "get_current_config", "activate_project", "check_onboarding_performed", "initial_instructions", "think_about_collected_information", "think_about_task_adherence", "think_about_whether_you_are_done", "list_memories", "read_memory", "execute_shell_command", "insert_after_symbol", "replace_symbol_body", "insert_before_symbol", "rename_symbol", "restart_language_server", "create_text_file", "replace_content", "delete_lines", "replace_lines", "insert_at_line", "remove_project", "switch_modes", "open_dashboard", "onboarding", "prepare_for_new_conversation", "summarize_changes", "write_memory", "delete_memory", "rename_memory", "edit_memory", "serena_mcp_reset"]
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"catalog": "native",
|
|
3
|
+
"package": "specialists",
|
|
4
|
+
"version": "3.11.0",
|
|
5
|
+
"precedence": 0,
|
|
6
|
+
"source_tiers": {
|
|
7
|
+
"READ_ONLY": ["read", "grep", "find", "ls"],
|
|
8
|
+
"LOW": ["read", "grep", "find", "ls", "bash"],
|
|
9
|
+
"MEDIUM": ["read", "grep", "find", "ls", "bash", "edit"],
|
|
10
|
+
"HIGH": ["read", "grep", "find", "ls", "bash", "edit", "write"]
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"catalog": "serena",
|
|
3
|
+
"package": "pi-serena-tools",
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"precedence": 2,
|
|
6
|
+
"source_tiers": {
|
|
7
|
+
"READ_ONLY": ["serena_list_tools", "find_symbol", "find_referencing_symbols", "read_file", "get_symbols_overview", "jet_brains_get_symbols_overview", "jet_brains_find_symbol", "jet_brains_find_referencing_symbols", "jet_brains_type_hierarchy", "search_for_pattern", "list_dir", "find_file", "get_current_config", "activate_project", "check_onboarding_performed", "initial_instructions", "think_about_collected_information", "think_about_task_adherence", "think_about_whether_you_are_done", "list_memories", "read_memory"],
|
|
8
|
+
"LOW": ["serena_list_tools", "find_symbol", "find_referencing_symbols", "read_file", "get_symbols_overview", "jet_brains_get_symbols_overview", "jet_brains_find_symbol", "jet_brains_find_referencing_symbols", "jet_brains_type_hierarchy", "search_for_pattern", "list_dir", "find_file", "get_current_config", "activate_project", "check_onboarding_performed", "initial_instructions", "think_about_collected_information", "think_about_task_adherence", "think_about_whether_you_are_done", "list_memories", "read_memory", "execute_shell_command"],
|
|
9
|
+
"MEDIUM": ["serena_list_tools", "find_symbol", "find_referencing_symbols", "read_file", "get_symbols_overview", "jet_brains_get_symbols_overview", "jet_brains_find_symbol", "jet_brains_find_referencing_symbols", "jet_brains_type_hierarchy", "search_for_pattern", "list_dir", "find_file", "get_current_config", "activate_project", "check_onboarding_performed", "initial_instructions", "think_about_collected_information", "think_about_task_adherence", "think_about_whether_you_are_done", "list_memories", "read_memory", "execute_shell_command", "insert_after_symbol", "replace_symbol_body", "insert_before_symbol", "rename_symbol", "restart_language_server", "create_text_file", "replace_content", "delete_lines", "replace_lines", "insert_at_line", "remove_project", "switch_modes", "open_dashboard", "onboarding", "prepare_for_new_conversation", "summarize_changes", "write_memory", "delete_memory", "rename_memory", "edit_memory", "serena_mcp_reset"],
|
|
10
|
+
"HIGH": ["serena_list_tools", "find_symbol", "find_referencing_symbols", "read_file", "get_symbols_overview", "jet_brains_get_symbols_overview", "jet_brains_find_symbol", "jet_brains_find_referencing_symbols", "jet_brains_type_hierarchy", "search_for_pattern", "list_dir", "find_file", "get_current_config", "activate_project", "check_onboarding_performed", "initial_instructions", "think_about_collected_information", "think_about_task_adherence", "think_about_whether_you_are_done", "list_memories", "read_memory", "execute_shell_command", "insert_after_symbol", "replace_symbol_body", "insert_before_symbol", "rename_symbol", "restart_language_server", "create_text_file", "replace_content", "delete_lines", "replace_lines", "insert_at_line", "remove_project", "switch_modes", "open_dashboard", "onboarding", "prepare_for_new_conversation", "summarize_changes", "write_memory", "delete_memory", "rename_memory", "edit_memory", "serena_mcp_reset"]
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -7,17 +7,18 @@ behaviors the model must follow regardless of the specific task.
|
|
|
7
7
|
> Filter with `sp list-rules --rule <id>` or `sp list-rules --specialist <name>`,
|
|
8
8
|
> machine output via `--json`.
|
|
9
9
|
|
|
10
|
-
## Layout (
|
|
10
|
+
## Layout (four tiers)
|
|
11
11
|
|
|
12
|
-
The loader reads and unions indexes from
|
|
12
|
+
The loader reads and unions indexes from four paths, in this precedence:
|
|
13
13
|
|
|
14
14
|
| Tier | Path | Writer | Role |
|
|
15
15
|
|------|------|--------|------|
|
|
16
|
-
| 1.
|
|
17
|
-
| 2.
|
|
18
|
-
| 3.
|
|
16
|
+
| 1. User overlay | `.specialists/user/mandatory-rules/` | you (per-repo) | Highest-priority repo-specific additions and overrides. Wins on set-id conflict. |
|
|
17
|
+
| 2. Source | `config/mandatory-rules/` | specialists repo commits | Canonical source of truth. Ships with the tool. |
|
|
18
|
+
| 3. Canonical copy | `.specialists/default/mandatory-rules/` | `sp init --sync-defaults` | Mirror of canonical, placed in every downstream project. |
|
|
19
|
+
| 4. Overlay | `.specialists/mandatory-rules/` | you (per-repo) | Repo-specific additions and overrides. Wins on set-id conflict. |
|
|
19
20
|
|
|
20
|
-
A rule set defined in tier
|
|
21
|
+
A rule set defined in tier 4 overrides a same-id rule set from tier 3, 2, or 1,
|
|
21
22
|
letting a repo tailor or replace canonical rules without editing the source.
|
|
22
23
|
|
|
23
24
|
## What gets injected
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: code-quality-defaults
|
|
3
|
+
kind: mandatory-rule
|
|
4
|
+
---
|
|
5
|
+
SRP, DRY, KISS, YAGNI. No premature abstraction. No speculative features. Don't add comments to explain what well-named code already says. Match existing project conventions; never invent a new style mid-file.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: diagnose-loop
|
|
3
|
+
kind: mandatory-rule
|
|
4
|
+
---
|
|
5
|
+
Trace symptom to root cause before editing. Pinpoint suspects via stack trace and call graph, apply the minimal fix on the fault line, then verify. Do not refactor surrounding code, change style, or expand scope. Cite evidence as `file:line` for every claim.
|
|
6
|
+
|
|
7
|
+
Discipline:
|
|
8
|
+
|
|
9
|
+
- Build a fast deterministic feedback loop before any code change. If you cannot reproduce the symptom, report it as a blocker — do not patch in the dark.
|
|
10
|
+
- After reproducing, write 3–5 falsifiable hypotheses before touching code. Test one variable at a time.
|
|
11
|
+
- Tag any temporary instrumentation with `[DEBUG-<short-id>]` so it is greppable. Remove every tagged line before completing the fix.
|
|
12
|
+
- When a correct test seam exists, convert the minimized repro into a regression test. When it does not, name the missing seam as an architecture/testability finding and route it to overthinker or planner instead of forcing a brittle test.
|
|
13
|
+
- Verify with targeted lint/typecheck and the focused repro. Full suites belong to test-runner — do not run them yourself.
|
|
@@ -8,6 +8,7 @@ Tools (prefer MCP; fall back to CLI if MCP unavailable):
|
|
|
8
8
|
- Blast radius before edit: `gitnexus_impact({target, direction:"upstream"})` or `npx gitnexus impact <target>`. STOP and warn if HIGH/CRITICAL.
|
|
9
9
|
- Symbol callers/callees: `gitnexus_context({name})` or `npx gitnexus context <name>`.
|
|
10
10
|
- Concept search: `gitnexus_query({query})` or `npx gitnexus query "<text>"`.
|
|
11
|
+
- Execution flow trace: `gitnexus_query({query: "<flow-keyword>"})` (process-grouped results) or read the MCP resource `gitnexus://repo/<name>/process/<flow-name>` for the step-by-step trace.
|
|
11
12
|
- Pre-commit scope check: `gitnexus_detect_changes()` (MCP only — fallback: `git diff --stat`).
|
|
12
13
|
|
|
13
14
|
Rules:
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: research-tool-routing
|
|
3
|
+
kind: mandatory-rule
|
|
4
|
+
---
|
|
5
|
+
Pick the right source before invoking research. Default to the project knowledge graph and repo evidence first; reach for external tools only when the answer cannot come from local sources.
|
|
6
|
+
|
|
7
|
+
- `find-docs` / context7 — library, framework, SDK, CLI, or cloud-service docs (API syntax, config, migration).
|
|
8
|
+
- `deepwiki` — public GitHub repo internals (architecture, conventions, code paths).
|
|
9
|
+
- `github-search` (ghgrep) — real-world code patterns and API usage examples.
|
|
10
|
+
- `last30days` — recent web/social signals (Reddit, X, HN, YouTube). Early-warning only, never authoritative.
|
|
11
|
+
|
|
12
|
+
Invoke skills on demand, not by default. Cite the source for every external claim.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: security-review-defaults
|
|
3
|
+
kind: mandatory-rule
|
|
4
|
+
---
|
|
5
|
+
Scan-only stance. Do not edit files, modify dependencies, run destructive tools, exfiltrate secrets, or run exploits against live targets. Recommend fixes; let executor apply them in a separate bead.
|
|
6
|
+
|
|
7
|
+
Threat-model surfaces: auth, session, input validation, injection sinks, file upload, SSRF, deserialization, secrets and crypto, dependency CVEs, agent/MCP/hook config, prompt-injection vectors.
|
|
8
|
+
|
|
9
|
+
Evidence required for any finding: a local path with line/symbol, an audit-tool output line, or an authoritative advisory (OSV, GHSA, NVD/CVE, vendor). Community chatter cannot be the sole proof. Keep findings to plausible user-controlled paths to a meaningful sink; drop low-signal noise.
|
|
@@ -5,6 +5,9 @@ rules:
|
|
|
5
5
|
- id: prefer-serena
|
|
6
6
|
level: required
|
|
7
7
|
text: "Prefer Serena tools over read/grep/find/ls for source code (.ts .py .go .rs .js etc.). Native tools fine for .md .json .yaml configs."
|
|
8
|
+
|
|
9
|
+
# --- Read tier (always applicable) ---
|
|
10
|
+
|
|
8
11
|
- id: get_symbols_overview
|
|
9
12
|
level: required
|
|
10
13
|
text: "get_symbols_overview <path> — symbol skeleton of a file or dir (~300 tokens vs reading the whole file). Use first to pick what you actually need."
|
|
@@ -23,18 +26,27 @@ rules:
|
|
|
23
26
|
- id: read_file
|
|
24
27
|
level: required
|
|
25
28
|
text: "read_file <path> — full or sliced read. Use only when navigation tools are not enough; check get_symbols_overview first."
|
|
29
|
+
|
|
30
|
+
# --- Edit tier (apply only if your specialist permission_required is MEDIUM or HIGH; READ_ONLY skip) ---
|
|
31
|
+
|
|
32
|
+
- id: edit-tier-applicability
|
|
33
|
+
level: info
|
|
34
|
+
text: "The rules below are edit-only. If your specialist's permission_required is READ_ONLY, ignore them — you cannot call these tools and they do not apply to your work."
|
|
26
35
|
- id: replace_symbol_body
|
|
27
36
|
level: required
|
|
28
|
-
text: "replace_symbol_body <name_path> — swap a function or class body in place. Use instead of Edit string-match for symbol-scoped changes (MEDIUM+ permission)
|
|
37
|
+
text: "replace_symbol_body <name_path> — swap a function or class body in place. Use instead of Edit string-match for symbol-scoped changes. (MEDIUM+ permission)"
|
|
29
38
|
- id: insert_around_symbol
|
|
30
39
|
level: required
|
|
31
|
-
text: "insert_before_symbol / insert_after_symbol <name_path> — add adjacent code such as imports or helpers (MEDIUM+ permission)
|
|
40
|
+
text: "insert_before_symbol / insert_after_symbol <name_path> — add adjacent code such as imports or helpers. (MEDIUM+ permission)"
|
|
32
41
|
- id: rename_symbol
|
|
33
42
|
level: required
|
|
34
|
-
text: "rename_symbol <name_path> <new_name> — refactor-safe across all references. Use instead of find-and-replace (MEDIUM+ permission)
|
|
43
|
+
text: "rename_symbol <name_path> <new_name> — refactor-safe across all references. Use instead of find-and-replace. (MEDIUM+ permission)"
|
|
35
44
|
- id: replace_content
|
|
36
45
|
level: required
|
|
37
|
-
text: "replace_content <path> <pattern> <replacement> — line-range or regex edits when no symbol target fits (MEDIUM+ permission)
|
|
46
|
+
text: "replace_content <path> <pattern> <replacement> — line-range or regex edits when no symbol target fits. (MEDIUM+ permission)"
|
|
47
|
+
|
|
48
|
+
# --- Cost guidance ---
|
|
49
|
+
|
|
38
50
|
- id: cost-rule
|
|
39
51
|
level: info
|
|
40
52
|
text: "Rule of thumb: read of a 500-line source file ~5000 tokens; find_symbol on one function ~200 tokens (~25x cheaper). Use get_symbols_overview before deciding."
|
package/config/presets.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"cheap": {
|
|
3
3
|
"description": "Low-cost, fast responses — best for exploration and simple tasks",
|
|
4
4
|
"fields": {
|
|
5
|
-
"specialist.execution.model": "
|
|
5
|
+
"specialist.execution.model": "nano-gpt/moonshotai/kimi-k2.5",
|
|
6
6
|
"specialist.execution.thinking_level": "off",
|
|
7
7
|
"specialist.execution.stall_timeout_ms": 60000
|
|
8
8
|
}
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: memory-audit-transaction
|
|
3
|
+
kind: skill
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Memory Audit Transaction
|
|
7
|
+
|
|
8
|
+
Pattern for auditing the project's persistent bd memories at any scale (N=500, N=2000+) without exhausting the agent's context window.
|
|
9
|
+
|
|
10
|
+
The naive workflow — `bd memories` → per-key `bd recall` → per-entry classification text in chat → per-key `bd forget` — collapses past ~150-200 memories because every classification row cumulates in conversation history. This skill replaces it with a **transactional file-backed audit ledger**: per-entry decisions persist to a JSONL artifact on disk, chunked work bounds the per-turn token cost, and pruning happens through one hash-guarded batch step rather than N inline `bd forget` calls.
|
|
11
|
+
|
|
12
|
+
## When This Activates
|
|
13
|
+
|
|
14
|
+
- The memory-processor specialist's input bead targets `.xtrm/memory.md` consolidation
|
|
15
|
+
- Project has more than ~50 bd memories (`bd memories | wc -l`)
|
|
16
|
+
- A previous memory-processor run hit context CRITICAL or produced "all current" without per-entry evidence
|
|
17
|
+
|
|
18
|
+
## Workflow
|
|
19
|
+
|
|
20
|
+
### Phase 1 — Read existing synthesized memory
|
|
21
|
+
|
|
22
|
+
Read `.xtrm/memory.md` if present. Single Read call. Tells you what was synthesized last time and prevents regressions.
|
|
23
|
+
|
|
24
|
+
### Phase 2 — Read last 3 session reports (targeted sections)
|
|
25
|
+
|
|
26
|
+
For each of the latest 3 `.xtrm/reports/*.md`, extract only:
|
|
27
|
+
- `## Summary`
|
|
28
|
+
- `## Problems Encountered`
|
|
29
|
+
- `## Memories Saved`
|
|
30
|
+
- `## Suggested Next Priority`
|
|
31
|
+
|
|
32
|
+
Ignore everything else. These are the highest-signal sections.
|
|
33
|
+
|
|
34
|
+
### Phase 3 — Bulk-export memories (already done by pre-script)
|
|
35
|
+
|
|
36
|
+
The specialist's pre-script (`config/skills/memory-audit-transaction/scripts/pre-bulk-export.sh`, registered in `skills.scripts` phase=pre) has **already executed before your first turn** and produced three artifacts:
|
|
37
|
+
|
|
38
|
+
- `.tmp/memory-audit/memories.json` — full `{key: content}` JSON object from one `bd memories --json` call (single dolt query, no per-key round-trips)
|
|
39
|
+
- `.tmp/memory-audit/keys.txt` — one key per line, for chunking
|
|
40
|
+
- `.tmp/memory-audit/decisions.jsonl` — initialized empty, you append to it
|
|
41
|
+
|
|
42
|
+
Verify the pre-script summary in `$pre_script_output` (injected at the top of the task). Confirm `keys.txt` count matches expectation. Do NOT re-export — running `bd recall` 500+ times in your bash window WILL time out (~150-300ms per call × 500 = 75-150s vs 120s bash stall window). The pre-script bypasses that entirely.
|
|
43
|
+
|
|
44
|
+
Read a chunk's content by slicing the JSON object:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
# extract the next 20-30 keys for this chunk
|
|
48
|
+
sed -n '1,30p' .tmp/memory-audit/keys.txt > .tmp/memory-audit/chunk-1-keys.txt
|
|
49
|
+
# fetch their content from the bulk JSON
|
|
50
|
+
jq --slurpfile keys <(jq -R . .tmp/memory-audit/chunk-1-keys.txt | jq -s .) \
|
|
51
|
+
'with_entries(select(.key as $k | $keys[0] | index($k)))' \
|
|
52
|
+
.tmp/memory-audit/memories.json > .tmp/memory-audit/chunk-1.json
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Simpler if jq feels heavy — just read keys.txt for the chunk's slice and look up each key with `jq -r --arg k "<key>" '.[$k]' memories.json` one at a time in a bash heredoc. Either way, the dump is on disk; do NOT echo memories.json into chat.
|
|
56
|
+
|
|
57
|
+
### Phase 4 — Fill gaps from project state (single pass)
|
|
58
|
+
|
|
59
|
+
One Bash call combining several quick reads:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
git log --oneline -30
|
|
63
|
+
cat CLAUDE.md 2>/dev/null | head -100
|
|
64
|
+
cat README.md 2>/dev/null | head -50
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Use this as the cross-reference baseline for Phase 5 classification.
|
|
68
|
+
|
|
69
|
+
### Phase 5 — Chunked classification with on-disk ledger
|
|
70
|
+
|
|
71
|
+
Read `.tmp/memory-audit/keys.txt` to know how many memories there are. Process them in **chunks of 20-30 keys**. For each chunk:
|
|
72
|
+
|
|
73
|
+
1. Read only the slice of `memories.txt` for the chunk's keys (use `awk`/`sed` to extract `=== key ===` … blocks for the N keys in this chunk).
|
|
74
|
+
2. For each memory in the chunk, decide its classification using the cross-reference baseline from Phase 4 plus targeted file spot-checks where needed.
|
|
75
|
+
3. **Append decisions to `.tmp/memory-audit/decisions.jsonl`** — one JSON line per memory:
|
|
76
|
+
|
|
77
|
+
```json
|
|
78
|
+
{"key":"<memory-key>","content_hash":"sha256:<hex>","status":"Current|Stale|Contradicted|Redundant|Skipped","confidence":"high|medium|low","evidence":["file:line or memory-key or report-ref"],"reason":"one sentence","duplicate_of":"optional-key"}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
4. **Do NOT print the decisions to chat**. Use a single Bash heredoc to append the chunk's rows to the JSONL file. The chat-side summary for each chunk is just one line: `chunk N: X classified (Current=a, Stale=b, Contradicted=c, Redundant=d, Skipped=e)`.
|
|
82
|
+
|
|
83
|
+
5. After each chunk, optionally write a checkpoint marker file `.tmp/memory-audit/chunk-N.done` so a re-dispatch can resume.
|
|
84
|
+
|
|
85
|
+
Compute `content_hash` with `sha256sum` against the exact `bd recall` output captured in Phase 3. The hash will be re-verified at Phase 7 apply time.
|
|
86
|
+
|
|
87
|
+
### Phase 6 — Ledger completeness validation (HARD GATE)
|
|
88
|
+
|
|
89
|
+
Before writing `.xtrm/memory.md`:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
KEYS=$(wc -l < .tmp/memory-audit/keys.txt)
|
|
93
|
+
ROWS=$(wc -l < .tmp/memory-audit/decisions.jsonl)
|
|
94
|
+
echo "keys=${KEYS} rows=${ROWS}"
|
|
95
|
+
test "${KEYS}" = "${ROWS}" || { echo "INCOMPLETE — missing $((KEYS - ROWS)) decisions"; exit 1; }
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
If the count does not match, the audit is incomplete. **Do not proceed to Phase 7 or Phase 8**. Report the gap and stop. Never default missing rows to `Current` to "make it work" — that is the c791ef failure mode (`bead unitAI-aofbp` empirical evidence).
|
|
99
|
+
|
|
100
|
+
### Phase 7 — Atomic prune with hash guard
|
|
101
|
+
|
|
102
|
+
When bd CLI gains `bd forget --batch --apply --if-hash-matches --transaction --backup` (tracked in Phase B of the parent epic, `unitAI-pwojn.2`), use it directly. Until then, the Phase A fallback is a single bash loop that re-verifies the hash before each delete and writes a backup:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
mkdir -p .tmp/memory-audit/backup
|
|
106
|
+
PRUNED=0; SKIPPED_HASH=0
|
|
107
|
+
jq -c 'select(.status=="Stale" or .status=="Contradicted" or .status=="Redundant")' \
|
|
108
|
+
.tmp/memory-audit/decisions.jsonl > .tmp/memory-audit/prune-set.jsonl
|
|
109
|
+
|
|
110
|
+
while read -r row; do
|
|
111
|
+
key=$(echo "${row}" | jq -r .key)
|
|
112
|
+
want_hash=$(echo "${row}" | jq -r .content_hash | sed 's/^sha256://')
|
|
113
|
+
have_hash=$(bd recall "${key}" 2>/dev/null | sha256sum | awk '{print $1}')
|
|
114
|
+
if [ "${want_hash}" = "${have_hash}" ]; then
|
|
115
|
+
bd recall "${key}" > ".tmp/memory-audit/backup/${key}.txt"
|
|
116
|
+
bd forget "${key}" && PRUNED=$((PRUNED + 1))
|
|
117
|
+
else
|
|
118
|
+
SKIPPED_HASH=$((SKIPPED_HASH + 1))
|
|
119
|
+
echo "${key}: hash mismatch — skipping" >> .tmp/memory-audit/apply-log.txt
|
|
120
|
+
fi
|
|
121
|
+
done < .tmp/memory-audit/prune-set.jsonl
|
|
122
|
+
|
|
123
|
+
echo "pruned=${PRUNED} skipped_hash=${SKIPPED_HASH}"
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
The chat output stays the count line only. The list of pruned keys lives in the apply-log file on disk; the report links to it.
|
|
127
|
+
|
|
128
|
+
### Phase 8 — Write .xtrm/memory.md from Current rows
|
|
129
|
+
|
|
130
|
+
Use `jq` to filter `decisions.jsonl` to only `Current` entries, then synthesize the 3-section `.xtrm/memory.md`:
|
|
131
|
+
|
|
132
|
+
```markdown
|
|
133
|
+
# Project Memory — <project-name>
|
|
134
|
+
_Updated: <YYYY-MM-DD> | <N-current> memories synthesized, <N-pruned> pruned, <N-skipped> skipped | last session: <YYYY-MM-DD>_
|
|
135
|
+
|
|
136
|
+
## Do Not Repeat
|
|
137
|
+
- ❌ <wrong action> → ✅ <correct action>
|
|
138
|
+
|
|
139
|
+
## How This Project Works
|
|
140
|
+
- <directive bullet>
|
|
141
|
+
|
|
142
|
+
## Active Context
|
|
143
|
+
- <situational brief from last 2-3 session reports>
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Target 100-200 lines. Imperative voice. No descriptive prose. Each bullet ends in "do Y" or "never Z".
|
|
147
|
+
|
|
148
|
+
### Phase 9 — Final report (counts only, NOT per-entry text)
|
|
149
|
+
|
|
150
|
+
```
|
|
151
|
+
## Memory Processor Report
|
|
152
|
+
|
|
153
|
+
### Synthesized → .xtrm/memory.md
|
|
154
|
+
<N> memories synthesized into 3 sections (~<line count> lines)
|
|
155
|
+
|
|
156
|
+
### Pruned (<N> applied, <M> hash-mismatch-skipped)
|
|
157
|
+
See `.tmp/memory-audit/apply-log.txt` for the full list and `.tmp/memory-audit/backup/` for restore data.
|
|
158
|
+
|
|
159
|
+
### Kept in bd (<N> entries)
|
|
160
|
+
Raw detail store intact. Use `bd recall <key>` to dig deeper.
|
|
161
|
+
|
|
162
|
+
### Ledger artifact
|
|
163
|
+
`.tmp/memory-audit/decisions.jsonl` (one row per memory, every status decision evidence-backed).
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
## Conservative-Pruning Rule (Inviolable)
|
|
167
|
+
|
|
168
|
+
When in doubt, **status=Skipped** — never default to Current. A false negative (slightly stale memory survives) is less harmful than a false positive (delete still-relevant entry). The completeness validator (Phase 6) ensures missing rows do not slip through as "all current."
|
|
169
|
+
|
|
170
|
+
## Decision-Row Evidence Requirements
|
|
171
|
+
|
|
172
|
+
Every row in `decisions.jsonl` must have non-empty `evidence`. Acceptable evidence forms:
|
|
173
|
+
|
|
174
|
+
- `"src/foo.ts:42"` — file:line reference verified against current repo
|
|
175
|
+
- `"memory:other-key"` — duplicate-of reference to another existing memory
|
|
176
|
+
- `"reports/2026-05-10:Summary"` — section reference in a recent session report
|
|
177
|
+
- `"commit:abc1234"` — git commit hash that fixed/changed the memorialized behavior
|
|
178
|
+
- `"unverifiable: <reason>"` — explicit acknowledgment when nothing concrete supports the classification → forces `status=Skipped`
|
|
179
|
+
|
|
180
|
+
A row with status not in {Current, Skipped} and evidence `["unverifiable: …"]` is a contract violation and is treated as Skipped during Phase 7.
|
|
181
|
+
|
|
182
|
+
## Failure-Mode Mapping
|
|
183
|
+
|
|
184
|
+
| Past failure | Symptom | Guarded by |
|
|
185
|
+
|---|---|---|
|
|
186
|
+
| c791ef (deepseek pre-DSML-fix) | 82% context, false "all 507 current" without per-entry evidence | Phase 6 completeness validator + evidence requirement; missing/uncertain → Skipped |
|
|
187
|
+
| fad36f (qwen with bulk-export) | 105% context, STALE for 80s, then flailing into gitnexus_* + destructive git | Phase 5 chunked decisions written to disk not chat; Phase 7 single batch not N inline forget; prompt forbids git sync commands |
|
|
188
|
+
|
|
189
|
+
## Anti-Patterns (Do Not)
|
|
190
|
+
|
|
191
|
+
- **Do not** echo `bd recall` output into chat. Read from `.tmp/memory-audit/memories.txt` slice instead.
|
|
192
|
+
- **Do not** classify multiple chunks worth of memories in one turn. Cap N at 20-30 per chunk.
|
|
193
|
+
- **Do not** emit per-entry decision text to chat. Append to the JSONL ledger; chat gets the count summary.
|
|
194
|
+
- **Do not** run `bd forget` inline per decision. Always go through Phase 7 batch path.
|
|
195
|
+
- **Do not** run `git pull --rebase`, `git push`, `git reset --hard`, or any destructive git command. The memory audit is a project-local read+forget+single-file-write operation. No remote sync, no history rewrite.
|
|
196
|
+
- **Do not** proceed to Phase 8 if Phase 6 completeness check fails. Stop and report the gap.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Pre-script for the memory-processor specialist.
|
|
3
|
+
#
|
|
4
|
+
# Phase 3 of the memory-audit-transaction skill: bulk-export every bd memory
|
|
5
|
+
# to a single JSON artifact so the model can slice chunks without per-key
|
|
6
|
+
# round-trips at runtime.
|
|
7
|
+
#
|
|
8
|
+
# `bd memories --json` returns one JSON object {key: content, ...} from a
|
|
9
|
+
# single dolt query (~ms), independent of N. This is the bulk surface that
|
|
10
|
+
# makes the Transactional File-Backed Audit Ledger pattern viable at any
|
|
11
|
+
# scale.
|
|
12
|
+
#
|
|
13
|
+
# Output:
|
|
14
|
+
# .tmp/memory-audit/memories.json — full {key: content} object
|
|
15
|
+
# .tmp/memory-audit/keys.txt — one key per line
|
|
16
|
+
# .tmp/memory-audit/decisions.jsonl — initialized empty (model appends)
|
|
17
|
+
#
|
|
18
|
+
# stdout: one-line summary that the runner injects as $pre_script_output.
|
|
19
|
+
|
|
20
|
+
set -euo pipefail
|
|
21
|
+
|
|
22
|
+
ART_DIR=".tmp/memory-audit"
|
|
23
|
+
mkdir -p "${ART_DIR}"
|
|
24
|
+
|
|
25
|
+
# Refuse to clobber an in-flight ledger (resumable runs land here).
|
|
26
|
+
if [ -s "${ART_DIR}/decisions.jsonl" ] && [ -s "${ART_DIR}/memories.json" ]; then
|
|
27
|
+
KEYS_PREV=$(jq -r 'keys[]' "${ART_DIR}/memories.json" 2>/dev/null | wc -l || echo 0)
|
|
28
|
+
ROWS_PREV=$(wc -l < "${ART_DIR}/decisions.jsonl" 2>/dev/null || echo 0)
|
|
29
|
+
echo "RESUMABLE: ${ROWS_PREV}/${KEYS_PREV} decisions already in ${ART_DIR}/decisions.jsonl"
|
|
30
|
+
echo " Bulk export skipped (artifact still present)."
|
|
31
|
+
exit 0
|
|
32
|
+
fi
|
|
33
|
+
|
|
34
|
+
# Bulk export — single dolt query, no per-key recall.
|
|
35
|
+
bd memories --json > "${ART_DIR}/memories.json"
|
|
36
|
+
|
|
37
|
+
# Key list (one per line) for chunking.
|
|
38
|
+
jq -r 'keys[]' "${ART_DIR}/memories.json" > "${ART_DIR}/keys.txt"
|
|
39
|
+
|
|
40
|
+
# Initialize the ledger (empty; model appends per-chunk).
|
|
41
|
+
: > "${ART_DIR}/decisions.jsonl"
|
|
42
|
+
|
|
43
|
+
KEYS=$(wc -l < "${ART_DIR}/keys.txt" | tr -d ' ')
|
|
44
|
+
BYTES=$(wc -c < "${ART_DIR}/memories.json" | tr -d ' ')
|
|
45
|
+
|
|
46
|
+
cat <<EOF
|
|
47
|
+
Bulk export complete:
|
|
48
|
+
artifact: ${ART_DIR}/memories.json
|
|
49
|
+
keys: ${ART_DIR}/keys.txt (${KEYS} keys)
|
|
50
|
+
size: ${BYTES} bytes
|
|
51
|
+
ledger: ${ART_DIR}/decisions.jsonl (initialized empty)
|
|
52
|
+
|
|
53
|
+
Read each chunk's content from memories.json with jq, e.g.:
|
|
54
|
+
jq -r --arg k "<key>" '.[\$k]' ${ART_DIR}/memories.json
|
|
55
|
+
|
|
56
|
+
Append per-entry decisions to ${ART_DIR}/decisions.jsonl with bash heredocs.
|
|
57
|
+
Do NOT echo memories.json into chat history.
|
|
58
|
+
EOF
|
|
@@ -119,13 +119,13 @@ specialists status --job <job-id> # single-job detail view (legacy
|
|
|
119
119
|
# Epic lifecycle (canonical publication path)
|
|
120
120
|
specialists epic list [--unresolved] # list epics with lifecycle state
|
|
121
121
|
specialists epic status <epic-id> # show chains, blockers, readiness
|
|
122
|
-
specialists epic sync <epic-id> [--apply] #
|
|
123
|
-
specialists epic resolve <epic-id> # transition open -> resolving
|
|
122
|
+
specialists epic sync <epic-id> [--apply] # recompute derived readiness; repair drift
|
|
124
123
|
specialists epic abandon <epic-id> --reason <text> [--force] # terminal transition for stuck epics
|
|
125
|
-
specialists epic merge <epic-id> [--pr] # publish all epic-owned chains
|
|
124
|
+
specialists epic merge <epic-id> [--pr] # publish all epic-owned chains; auto-finalizes PASS chains
|
|
126
125
|
|
|
127
|
-
# Merge (
|
|
128
|
-
specialists merge <chain-root-bead> [--rebuild]
|
|
126
|
+
# Merge (per-chain or standalone; PASS chains can merge inside an active epic)
|
|
127
|
+
specialists merge <chain-root-bead> [--rebuild]
|
|
128
|
+
specialists finalize <chain-root-bead> # manual recovery if PASS auto-finalize did not fire
|
|
129
129
|
|
|
130
130
|
# Session close (chain-aware, epic-aware)
|
|
131
131
|
specialists end [--pr] # close session, publish via merge or PR
|
|
@@ -682,14 +682,15 @@ sp epic list --unresolved # show non-terminal epics
|
|
|
682
682
|
|
|
683
683
|
# Inspect one epic
|
|
684
684
|
sp epic status unitAI-3f7b
|
|
685
|
-
# Shows:
|
|
685
|
+
# Shows: derived readiness state, persisted state (audit only), chains[], blockers[], summary
|
|
686
686
|
|
|
687
|
-
#
|
|
688
|
-
sp epic
|
|
689
|
-
|
|
690
|
-
# Publish
|
|
691
|
-
sp epic merge unitAI-3f7b # merge_ready → merged
|
|
687
|
+
# Publish (no manual state transition — readiness is derived live)
|
|
688
|
+
sp epic merge unitAI-3f7b # batch publish all chains; auto-finalizes PASS chains
|
|
692
689
|
sp epic merge unitAI-3f7b --pr # PR mode
|
|
690
|
+
|
|
691
|
+
# Or per-chain (PASS chain inside active epic is allowed)
|
|
692
|
+
sp merge <chain-root-bead>
|
|
693
|
+
sp finalize <chain-root-bead> # manual recovery if PASS auto-finalize missed
|
|
693
694
|
```
|
|
694
695
|
|
|
695
696
|
### Conflict handling
|
|
@@ -1136,7 +1137,7 @@ sp stop <job-id> --force
|
|
|
1136
1137
|
|
|
1137
1138
|
### 5) `sp end` open-state loop fix
|
|
1138
1139
|
|
|
1139
|
-
If `sp end` detects open-state mismatch, tool
|
|
1140
|
+
If `sp end` detects open-state mismatch, tool surfaces the derived readiness summary (`sp epic status <epic-id>`) and the per-chain merge path. There is no `sp epic resolve` anymore — readiness is recomputed live from chain state.
|
|
1140
1141
|
|
|
1141
1142
|
- **RPC timeout on worktree job start** (30s, `command id=1`) → pi runs `npm install` in fresh
|
|
1142
1143
|
worktrees if `.pi/settings.json` lists local packages. Root cause: worktree gets a stale copy
|