ostacky 0.7.3 → 0.7.4
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/README.md +21 -14
- package/assets/agents/ostacky.md +548 -524
- package/assets/commands/install-stack.md +2 -2
- package/assets/mcp/ostacky-controller/index.js +543 -173
- package/assets/mcp/ostacky-controller/package.json +1 -1
- package/assets/mcp/ostacky-controller/security.js +87 -0
- package/assets/plugins/ostacky-guard.ts +111 -30
- package/assets/skills/brainstorming/SKILL.md +198 -197
- package/assets/skills/graceful-degradation/SKILL.md +251 -248
- package/dist/cli.js +231 -84
- package/manifest.json +30 -30
- package/package.json +1 -1
|
@@ -1,248 +1,251 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: graceful-degradation
|
|
3
|
-
description: "Handle situations where multiple tools (CodeGraph, Engram MCP, Controller) are unavailable. Provides a systematic approach to continue working with reduced capabilities."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Graceful Degradation
|
|
7
|
-
|
|
8
|
-
When critical tools are unavailable, this skill provides a systematic approach to continue working with reduced capabilities instead of failing completely.
|
|
9
|
-
|
|
10
|
-
**Follow Core Instructions** — `ostacky.md` Core Instructions section for CodeGraph and Engram usage patterns.
|
|
11
|
-
|
|
12
|
-
**IMPORTANT:** Engram is an **MCP server**, not a skill. Tools `engram_mem_save`, `engram_mem_search`, `engram_mem_context` are MCP tools. Do NOT use `skill("engram")` — it doesn't exist.
|
|
13
|
-
|
|
14
|
-
---
|
|
15
|
-
|
|
16
|
-
## Tool Availability Matrix
|
|
17
|
-
|
|
18
|
-
| Tool | Type | Fallback Chain | Impact |
|
|
19
|
-
|------|------|----------------|--------|
|
|
20
|
-
| CodeGraph | MCP server | Engram → Read + Glob | No structural analysis, manual exploration |
|
|
21
|
-
| Engram | MCP server | Continue without memory | No persistence across sessions |
|
|
22
|
-
| Controller | MCP server | Inline validation + manual state | No state machine, no edit validation |
|
|
23
|
-
| Context7 | MCP server (remote) | Skip documentation | No external API docs |
|
|
24
|
-
|
|
25
|
-
## Detection
|
|
26
|
-
|
|
27
|
-
After health check pre-vuelo, classify the situation:
|
|
28
|
-
|
|
29
|
-
### All Tools Available
|
|
30
|
-
Normal operation. No degradation needed.
|
|
31
|
-
|
|
32
|
-
### Partial Degradation (1-2 tools down)
|
|
33
|
-
Continue with available tools. Report to user.
|
|
34
|
-
|
|
35
|
-
### Complete Degradation (All tools down)
|
|
36
|
-
Switch to basic mode with manual workflows.
|
|
37
|
-
|
|
38
|
-
## Degraded Workflows
|
|
39
|
-
|
|
40
|
-
### Without CodeGraph
|
|
41
|
-
|
|
42
|
-
**Available alternatives:**
|
|
43
|
-
1. **Engram** — Check if previous analysis exists for the area
|
|
44
|
-
2. **Read + Glob** — Manual file exploration
|
|
45
|
-
|
|
46
|
-
**Workflow:**
|
|
47
|
-
```
|
|
48
|
-
1. engram_mem_search for related analysis (if Engram available)
|
|
49
|
-
2. Use Glob to find relevant files: **/*.ts, src/**/*.ts
|
|
50
|
-
3. Read files manually to understand structure
|
|
51
|
-
4. Proceed with caution — no blast radius analysis
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
**Limitations:**
|
|
55
|
-
- No call path analysis
|
|
56
|
-
- No blast radius calculation
|
|
57
|
-
- No symbol search
|
|
58
|
-
- Higher risk of missing dependencies
|
|
59
|
-
|
|
60
|
-
### Without Engram
|
|
61
|
-
|
|
62
|
-
**Available alternatives:**
|
|
63
|
-
1. **OpenSpec** — Check for active changes with proposals/designs
|
|
64
|
-
2. **Filesystem** — Check for previous analysis docs
|
|
65
|
-
|
|
66
|
-
**Workflow:**
|
|
67
|
-
```
|
|
68
|
-
1. Check openspec/changes/ for active change artifacts
|
|
69
|
-
2. Check docs/superpowers/specs/ for design documents
|
|
70
|
-
3. Proceed without session memory
|
|
71
|
-
4. At session end, document key decisions in a summary
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
**Limitations:**
|
|
75
|
-
- No cross-session memory
|
|
76
|
-
- No decision history
|
|
77
|
-
- Risk of repeating previous mistakes
|
|
78
|
-
|
|
79
|
-
### Without Controller
|
|
80
|
-
|
|
81
|
-
**Available alternatives:**
|
|
82
|
-
1. **Inline validation** — Manual edit validation
|
|
83
|
-
2. **Manual state tracking** — Track progress in conversation
|
|
84
|
-
|
|
85
|
-
**Workflow:**
|
|
86
|
-
```
|
|
87
|
-
1. For each edit:
|
|
88
|
-
- Read file fresh
|
|
89
|
-
- Verify oldString ≠ newString
|
|
90
|
-
- Verify oldString appears exactly once
|
|
91
|
-
- Execute edit
|
|
92
|
-
2. Track completed tasks mentally or in conversation
|
|
93
|
-
3. No automatic state persistence
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
**IMPORTANT — No check_pending_state:**
|
|
97
|
-
When controller is unavailable, `check_pending_state` does NOT exist.
|
|
98
|
-
- Do NOT try to call it — it will fail
|
|
99
|
-
- The enforcement rule in Core Instructions applies ONLY when controller is available
|
|
100
|
-
- In degraded mode, rely on the "Una pregunta por turno" rule directly
|
|
101
|
-
|
|
102
|
-
**
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
- No
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
✅
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
- **
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
- **
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
1
|
+
---
|
|
2
|
+
name: graceful-degradation
|
|
3
|
+
description: "Handle situations where multiple tools (CodeGraph, Engram MCP, Controller) are unavailable. Provides a systematic approach to continue working with reduced capabilities."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Graceful Degradation
|
|
7
|
+
|
|
8
|
+
When critical tools are unavailable, this skill provides a systematic approach to continue working with reduced capabilities instead of failing completely.
|
|
9
|
+
|
|
10
|
+
**Follow Core Instructions** — `ostacky.md` Core Instructions section for CodeGraph and Engram usage patterns.
|
|
11
|
+
|
|
12
|
+
**IMPORTANT:** Engram is an **MCP server**, not a skill. Tools `engram_mem_save`, `engram_mem_search`, `engram_mem_context` are MCP tools. Do NOT use `skill("engram")` — it doesn't exist.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Tool Availability Matrix
|
|
17
|
+
|
|
18
|
+
| Tool | Type | Fallback Chain | Impact |
|
|
19
|
+
|------|------|----------------|--------|
|
|
20
|
+
| CodeGraph | MCP server | Engram → Read + Glob | No structural analysis, manual exploration |
|
|
21
|
+
| Engram | MCP server | Continue without memory | No persistence across sessions |
|
|
22
|
+
| Controller | MCP server | Inline validation + manual state | No state machine, no edit validation |
|
|
23
|
+
| Context7 | MCP server (remote) | Skip documentation | No external API docs |
|
|
24
|
+
|
|
25
|
+
## Detection
|
|
26
|
+
|
|
27
|
+
After health check pre-vuelo, classify the situation:
|
|
28
|
+
|
|
29
|
+
### All Tools Available
|
|
30
|
+
Normal operation. No degradation needed.
|
|
31
|
+
|
|
32
|
+
### Partial Degradation (1-2 tools down)
|
|
33
|
+
Continue with available tools. Report to user.
|
|
34
|
+
|
|
35
|
+
### Complete Degradation (All tools down)
|
|
36
|
+
Switch to basic mode with manual workflows.
|
|
37
|
+
|
|
38
|
+
## Degraded Workflows
|
|
39
|
+
|
|
40
|
+
### Without CodeGraph
|
|
41
|
+
|
|
42
|
+
**Available alternatives:**
|
|
43
|
+
1. **Engram** — Check if previous analysis exists for the area
|
|
44
|
+
2. **Read + Glob** — Manual file exploration
|
|
45
|
+
|
|
46
|
+
**Workflow:**
|
|
47
|
+
```
|
|
48
|
+
1. engram_mem_search for related analysis (if Engram available)
|
|
49
|
+
2. Use Glob to find relevant files: **/*.ts, src/**/*.ts
|
|
50
|
+
3. Read files manually to understand structure
|
|
51
|
+
4. Proceed with caution — no blast radius analysis
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
**Limitations:**
|
|
55
|
+
- No call path analysis
|
|
56
|
+
- No blast radius calculation
|
|
57
|
+
- No symbol search
|
|
58
|
+
- Higher risk of missing dependencies
|
|
59
|
+
|
|
60
|
+
### Without Engram
|
|
61
|
+
|
|
62
|
+
**Available alternatives:**
|
|
63
|
+
1. **OpenSpec** — Check for active changes with proposals/designs
|
|
64
|
+
2. **Filesystem** — Check for previous analysis docs
|
|
65
|
+
|
|
66
|
+
**Workflow:**
|
|
67
|
+
```
|
|
68
|
+
1. Check openspec/changes/ for active change artifacts
|
|
69
|
+
2. Check docs/superpowers/specs/ for design documents
|
|
70
|
+
3. Proceed without session memory
|
|
71
|
+
4. At session end, document key decisions in a summary
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
**Limitations:**
|
|
75
|
+
- No cross-session memory
|
|
76
|
+
- No decision history
|
|
77
|
+
- Risk of repeating previous mistakes
|
|
78
|
+
|
|
79
|
+
### Without Controller
|
|
80
|
+
|
|
81
|
+
**Available alternatives:**
|
|
82
|
+
1. **Inline validation** — Manual edit validation
|
|
83
|
+
2. **Manual state tracking** — Track progress in conversation
|
|
84
|
+
|
|
85
|
+
**Workflow:**
|
|
86
|
+
```
|
|
87
|
+
1. For each edit:
|
|
88
|
+
- Read file fresh
|
|
89
|
+
- Verify oldString ≠ newString
|
|
90
|
+
- Verify oldString appears exactly once
|
|
91
|
+
- Execute edit
|
|
92
|
+
2. Track completed tasks mentally or in conversation
|
|
93
|
+
3. No automatic state persistence
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
**IMPORTANT — No check_pending_state:**
|
|
97
|
+
When controller is unavailable, `check_pending_state` does NOT exist.
|
|
98
|
+
- Do NOT try to call it — it will fail
|
|
99
|
+
- The enforcement rule in Core Instructions applies ONLY when controller is available
|
|
100
|
+
- In degraded mode, rely on the "Una pregunta por turno" rule directly
|
|
101
|
+
|
|
102
|
+
**Hard gate de credenciales (hardening-v2 P0):**
|
|
103
|
+
Incluso en degraded, el guard de credenciales sigue activo (hard gate incluso en degraded). `bash`/`read`/`write`/`edit` sobre `.env`, `.secrets`, `*.pem`, `*.key`, `.aws`, `.ssh`, `credentials.json`, `.npmrc` sin `allowedFiles` sigue lanzando `BLOCKED` — nunca uses `bash cat .env` sin `check_file_access → consume ALLOW` auditado (ver `assets/agents/ostacky.md` §Credential Guard).
|
|
104
|
+
|
|
105
|
+
**Limitations:**
|
|
106
|
+
- No automatic edit validation
|
|
107
|
+
- No task completion tracking
|
|
108
|
+
- No state persistence across crashes
|
|
109
|
+
- No pending state enforcement (check_pending_state unavailable)
|
|
110
|
+
|
|
111
|
+
### Without Context7
|
|
112
|
+
|
|
113
|
+
**Impact:** Minimal — only affects external API documentation lookups.
|
|
114
|
+
|
|
115
|
+
**Workflow:** Proceed normally. Use existing knowledge.
|
|
116
|
+
|
|
117
|
+
## Communication Protocol
|
|
118
|
+
|
|
119
|
+
### Status Report Format
|
|
120
|
+
|
|
121
|
+
When degradation is detected, report to user:
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
⚠️ [Tool] no disponible — usando fallback: [fallback]
|
|
125
|
+
|
|
126
|
+
Herramientas disponibles:
|
|
127
|
+
✅ [Tool1] — [status]
|
|
128
|
+
❌ [Tool2] — [fallback being used]
|
|
129
|
+
⚠️ [Tool3] — [degraded mode]
|
|
130
|
+
|
|
131
|
+
¿Continuar con funcionalidad reducida?
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### Example Reports
|
|
135
|
+
|
|
136
|
+
**CodeGraph down:**
|
|
137
|
+
```
|
|
138
|
+
⚠️ CodeGraph no disponible — usando fallback: Engram → Read
|
|
139
|
+
|
|
140
|
+
Herramientas disponibles:
|
|
141
|
+
✅ Controller — ping OK
|
|
142
|
+
❌ CodeGraph — timeout 10s
|
|
143
|
+
✅ Engram — disponible
|
|
144
|
+
✅ Context7 — disponible
|
|
145
|
+
|
|
146
|
+
¿Continuar con lectura manual de archivos?
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
**All tools down:**
|
|
150
|
+
```
|
|
151
|
+
🔴 Stack de herramientas no disponible — modo básico activado
|
|
152
|
+
|
|
153
|
+
Herramientas disponibles:
|
|
154
|
+
❌ Controller — no responde
|
|
155
|
+
❌ CodeGraph — no instalado
|
|
156
|
+
❌ Engram — timeout 5s
|
|
157
|
+
✅ Context7 — disponible (pero sin docs relevantes)
|
|
158
|
+
|
|
159
|
+
Modo básico: sin validación de edits, sin memoria persistente, sin análisis estructural.
|
|
160
|
+
¿Continuar o cancelar?
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
## Handoff Fallback (compaction)
|
|
164
|
+
|
|
165
|
+
Si el controller hizo `set_handoff` o el plugin escribió el fallback `dirname(OSTACKY_STATE_PATH)/.ostacky-handoff-compaction.json` antes de compaction, el próximo agente **debe** llamar `get_handoff` al inicio. `get_handoff` primero chequea `lastHandoff` en memoria y si es `null` lee el archivo fallback (mismo ancla que el writer). `clear_handoff` borra ambos. `cleanupTmpFiles` solo borra ese archivo si `ts >24h`. Ver `assets/plugins/engram.ts:experimental.session.compacting` y `assets/mcp/ostacky-controller/index.js:get_handoff`.
|
|
166
|
+
|
|
167
|
+
## Recovery After Degradation
|
|
168
|
+
|
|
169
|
+
When a tool becomes available again during the session:
|
|
170
|
+
|
|
171
|
+
1. **Detect:** Health check succeeds on next call
|
|
172
|
+
2. **Report:** "✅ [Tool] disponible nuevamente"
|
|
173
|
+
3. **Resume:** Switch back to normal workflow
|
|
174
|
+
4. **Catch up:** Use the tool to verify recent work
|
|
175
|
+
|
|
176
|
+
## Health via get_metrics y doctor (6.2)
|
|
177
|
+
|
|
178
|
+
- **Con Controller:** usar `get_metrics` como health — expone `degraded`, `diskFreeMB`, `auditSize`, `stateFileSize`, `codegraphBypassCount`, `stateOversizedCount`, `degradedEditsCount`, `sensitiveAccess`. Si `diskFreeMB<100` → ⚠️ Disco casi lleno; si `stateOversizedCount>0` → snapshots perdidos.
|
|
179
|
+
- **Sin Controller:** fallback a `ostacky doctor` (lee `.opencode/ostacky-state.json` sin MCP, verifica locks, tamaños, audit, binarios y `manifest.json` hashes). `doctor` es el fallback a `check:skills` cuando MCP caído.
|
|
180
|
+
- **Sin CodeGraph:** `get_metrics.codegraphBypassCount` incrementa cuando `record_discovery` sin `symbols` y no degraded; `get_audit` marca `inefficient: codegraph bypass` para review.
|
|
181
|
+
- **Sin Engram:** continuar sin memoria; `doctor` no requiere Engram.
|
|
182
|
+
|
|
183
|
+
No usar `skill("engram")` — Engram es MCP server, no skill. Usar `engram_mem_*` tools.
|
|
184
|
+
|
|
185
|
+
## Guardrails
|
|
186
|
+
|
|
187
|
+
### During Degradation
|
|
188
|
+
|
|
189
|
+
- **Never skip validation** — Use inline validation when controller is down
|
|
190
|
+
- **Never assume structure** — Read files even if you think you know them
|
|
191
|
+
- **Document decisions** — Write down key choices since Engram may be down
|
|
192
|
+
- **Report limitations** — User must know what's working and what's not
|
|
193
|
+
|
|
194
|
+
### When Choosing to Continue
|
|
195
|
+
|
|
196
|
+
Ask yourself:
|
|
197
|
+
1. Can I safely complete this task without the missing tool?
|
|
198
|
+
2. What's the worst case if I proceed without it?
|
|
199
|
+
3. Is the user aware of the limitations?
|
|
200
|
+
|
|
201
|
+
If unsure → ask the user.
|
|
202
|
+
|
|
203
|
+
### When to Stop
|
|
204
|
+
|
|
205
|
+
- All critical tools are down AND the task requires them
|
|
206
|
+
- The task is high-risk without structural analysis (CodeGraph)
|
|
207
|
+
- The user requests to stop
|
|
208
|
+
|
|
209
|
+
## Integration
|
|
210
|
+
|
|
211
|
+
This skill is loaded automatically when the agent detects tool failures during the health check pre-vuelo.
|
|
212
|
+
|
|
213
|
+
It does NOT replace other skills — it provides degraded workflows for them.
|
|
214
|
+
|
|
215
|
+
## Examples
|
|
216
|
+
|
|
217
|
+
### Example 1: CodeGraph fails, others work
|
|
218
|
+
|
|
219
|
+
```
|
|
220
|
+
Agent: ⚠️ CodeGraph no disponible (timeout 10s).
|
|
221
|
+
|
|
222
|
+
Voy a usar Engram para buscar análisis previos y luego leer archivos manualmente.
|
|
223
|
+
|
|
224
|
+
¿Continuar con esta aproximación?
|
|
225
|
+
|
|
226
|
+
User: Sí
|
|
227
|
+
|
|
228
|
+
Agent: [Uses engram_mem_search to find related analysis]
|
|
229
|
+
[Uses Glob to find relevant files]
|
|
230
|
+
[Reads files manually]
|
|
231
|
+
[Proceeds with task]
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
### Example 2: Controller fails
|
|
235
|
+
|
|
236
|
+
```
|
|
237
|
+
Agent: ⚠️ Controller no disponible — operando con validación inline.
|
|
238
|
+
|
|
239
|
+
Cada edit será validado manualmente:
|
|
240
|
+
- oldString ≠ newString
|
|
241
|
+
- oldString aparece exactamente una vez
|
|
242
|
+
|
|
243
|
+
¿Continuar?
|
|
244
|
+
|
|
245
|
+
User: Sí
|
|
246
|
+
|
|
247
|
+
Agent: [Reads file fresh]
|
|
248
|
+
[Validates oldString manually]
|
|
249
|
+
[Executes edit]
|
|
250
|
+
[Reports completion]
|
|
251
|
+
```
|