@bonesofspring/ai-rules 0.2.68 → 0.2.70
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/CHANGELOG.md +15 -0
- package/README.md +1 -1
- package/package.json +2 -2
- package/presets/_shared/hooks/chain-team-phases.sh.tmpl +137 -2
- package/presets/claude/android-kotlin/hooks/chain-team-phases.sh +137 -2
- package/presets/claude/go/hooks/chain-team-phases.sh +137 -2
- package/presets/claude/ios-swift/hooks/chain-team-phases.sh +137 -2
- package/presets/claude/java/hooks/chain-team-phases.sh +137 -2
- package/presets/claude/mcp-ts/hooks/chain-team-phases.sh +137 -2
- package/presets/claude/mol/hooks/chain-team-phases.sh +137 -2
- package/presets/claude/next/commands/README.md +5 -0
- package/presets/claude/next/commands/task-continue.md +17 -6
- package/presets/claude/next/commands/ui-start.md +54 -0
- package/presets/claude/next/commands/ui-stop.md +43 -0
- package/presets/claude/next/hooks/chain-team-phases.sh +137 -2
- package/presets/claude/nuxt/hooks/chain-team-phases.sh +137 -2
- package/presets/claude/php-hexagonal/hooks/chain-team-phases.sh +137 -2
- package/presets/claude/php-laravel/hooks/chain-team-phases.sh +137 -2
- package/presets/claude/svelte/hooks/chain-team-phases.sh +137 -2
- package/presets/cursor/android-kotlin/hooks/chain-team-phases.sh +137 -2
- package/presets/cursor/go/hooks/chain-team-phases.sh +137 -2
- package/presets/cursor/ios-swift/hooks/chain-team-phases.sh +137 -2
- package/presets/cursor/java/hooks/chain-team-phases.sh +137 -2
- package/presets/cursor/mcp-ts/hooks/chain-team-phases.sh +137 -2
- package/presets/cursor/mol/hooks/chain-team-phases.sh +137 -2
- package/presets/cursor/next/commands/README.md +5 -0
- package/presets/cursor/next/commands/task-continue.md +17 -6
- package/presets/cursor/next/commands/ui-start.md +54 -0
- package/presets/cursor/next/commands/ui-stop.md +43 -0
- package/presets/cursor/next/hooks/chain-team-phases.sh +137 -2
- package/presets/cursor/nuxt/hooks/chain-team-phases.sh +137 -2
- package/presets/cursor/php-hexagonal/hooks/chain-team-phases.sh +137 -2
- package/presets/cursor/php-laravel/hooks/chain-team-phases.sh +137 -2
- package/presets/cursor/svelte/hooks/chain-team-phases.sh +137 -2
- package/presets/mavis/android-kotlin/adapter-map.json +1 -1
- package/presets/mavis/android-kotlin/hooks/chain-team-phases.sh +137 -2
- package/presets/mavis/go/adapter-map.json +1 -1
- package/presets/mavis/go/hooks/chain-team-phases.sh +137 -2
- package/presets/mavis/ios-swift/adapter-map.json +1 -1
- package/presets/mavis/ios-swift/hooks/chain-team-phases.sh +137 -2
- package/presets/mavis/java/adapter-map.json +1 -1
- package/presets/mavis/java/hooks/chain-team-phases.sh +137 -2
- package/presets/mavis/mcp-ts/adapter-map.json +1 -1
- package/presets/mavis/mcp-ts/hooks/chain-team-phases.sh +137 -2
- package/presets/mavis/mol/adapter-map.json +1 -1
- package/presets/mavis/mol/hooks/chain-team-phases.sh +137 -2
- package/presets/mavis/next/adapter-map.json +17 -1
- package/presets/mavis/next/commands/README.md +5 -0
- package/presets/mavis/next/commands/task-continue.md +16 -5
- package/presets/mavis/next/commands/ui-start.md +49 -0
- package/presets/mavis/next/commands/ui-stop.md +38 -0
- package/presets/mavis/next/hooks/chain-team-phases.sh +137 -2
- package/presets/mavis/nuxt/adapter-map.json +1 -1
- package/presets/mavis/nuxt/hooks/chain-team-phases.sh +137 -2
- package/presets/mavis/php-hexagonal/adapter-map.json +1 -1
- package/presets/mavis/php-hexagonal/hooks/chain-team-phases.sh +137 -2
- package/presets/mavis/php-laravel/adapter-map.json +1 -1
- package/presets/mavis/php-laravel/hooks/chain-team-phases.sh +137 -2
- package/presets/mavis/svelte/adapter-map.json +1 -1
- package/presets/mavis/svelte/hooks/chain-team-phases.sh +137 -2
- package/presets/opencode/android-kotlin/adapter-map.json +1 -1
- package/presets/opencode/android-kotlin/hooks/chain-team-phases.sh +137 -2
- package/presets/opencode/go/adapter-map.json +1 -1
- package/presets/opencode/go/hooks/chain-team-phases.sh +137 -2
- package/presets/opencode/ios-swift/adapter-map.json +1 -1
- package/presets/opencode/ios-swift/hooks/chain-team-phases.sh +137 -2
- package/presets/opencode/java/adapter-map.json +1 -1
- package/presets/opencode/java/hooks/chain-team-phases.sh +137 -2
- package/presets/opencode/mcp-ts/adapter-map.json +1 -1
- package/presets/opencode/mcp-ts/hooks/chain-team-phases.sh +137 -2
- package/presets/opencode/mol/adapter-map.json +1 -1
- package/presets/opencode/mol/hooks/chain-team-phases.sh +137 -2
- package/presets/opencode/next/adapter-map.json +17 -1
- package/presets/opencode/next/commands/README.md +5 -0
- package/presets/opencode/next/commands/task-continue.md +17 -6
- package/presets/opencode/next/commands/ui-start.md +57 -0
- package/presets/opencode/next/commands/ui-stop.md +46 -0
- package/presets/opencode/next/hooks/chain-team-phases.sh +137 -2
- package/presets/opencode/nuxt/adapter-map.json +1 -1
- package/presets/opencode/nuxt/hooks/chain-team-phases.sh +137 -2
- package/presets/opencode/php-hexagonal/adapter-map.json +1 -1
- package/presets/opencode/php-hexagonal/hooks/chain-team-phases.sh +137 -2
- package/presets/opencode/php-laravel/adapter-map.json +1 -1
- package/presets/opencode/php-laravel/hooks/chain-team-phases.sh +137 -2
- package/presets/opencode/plugins/output-guard/README.md +33 -0
- package/presets/opencode/plugins/output-guard/index.ts +225 -3
- package/presets/opencode/svelte/adapter-map.json +1 -1
- package/presets/opencode/svelte/hooks/chain-team-phases.sh +137 -2
- package/presets/zcode/android-kotlin/adapter-map.json +1 -1
- package/presets/zcode/android-kotlin/hooks/chain-team-phases.sh +137 -2
- package/presets/zcode/go/adapter-map.json +1 -1
- package/presets/zcode/go/hooks/chain-team-phases.sh +137 -2
- package/presets/zcode/ios-swift/adapter-map.json +1 -1
- package/presets/zcode/ios-swift/hooks/chain-team-phases.sh +137 -2
- package/presets/zcode/java/adapter-map.json +1 -1
- package/presets/zcode/java/hooks/chain-team-phases.sh +137 -2
- package/presets/zcode/mcp-ts/adapter-map.json +1 -1
- package/presets/zcode/mcp-ts/hooks/chain-team-phases.sh +137 -2
- package/presets/zcode/mol/adapter-map.json +1 -1
- package/presets/zcode/mol/hooks/chain-team-phases.sh +137 -2
- package/presets/zcode/next/adapter-map.json +17 -1
- package/presets/zcode/next/commands/README.md +5 -0
- package/presets/zcode/next/commands/task-continue.md +17 -6
- package/presets/zcode/next/commands/ui-start.md +57 -0
- package/presets/zcode/next/commands/ui-stop.md +46 -0
- package/presets/zcode/next/hooks/chain-team-phases.sh +137 -2
- package/presets/zcode/nuxt/adapter-map.json +1 -1
- package/presets/zcode/nuxt/hooks/chain-team-phases.sh +137 -2
- package/presets/zcode/php-hexagonal/adapter-map.json +1 -1
- package/presets/zcode/php-hexagonal/hooks/chain-team-phases.sh +137 -2
- package/presets/zcode/php-laravel/adapter-map.json +1 -1
- package/presets/zcode/php-laravel/hooks/chain-team-phases.sh +137 -2
- package/presets/zcode/svelte/adapter-map.json +1 -1
- package/presets/zcode/svelte/hooks/chain-team-phases.sh +137 -2
- package/scripts/report-context-cost.mjs +216 -5
|
@@ -24,8 +24,12 @@ try {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
if (hookInput.status !== 'completed') {
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
// `resume_blocked` is a lifecycle repair, not a producer receipt: it runs
|
|
28
|
+
// with no `status`, and a `status` it carries is ignored.
|
|
29
|
+
if (hookInput.action !== 'resume_blocked') {
|
|
30
|
+
process.stdout.write('{}');
|
|
31
|
+
process.exit(0);
|
|
32
|
+
}
|
|
29
33
|
}
|
|
30
34
|
|
|
31
35
|
// Slug resolution, strongest first:
|
|
@@ -2092,6 +2096,137 @@ function syncMetricsProfile(pipeline) {
|
|
|
2092
2096
|
});
|
|
2093
2097
|
}
|
|
2094
2098
|
|
|
2099
|
+
function resumeBlockedRefuse(reason) {
|
|
2100
|
+
process.stdout.write(JSON.stringify({ ok: false, action: 'resume_blocked', reason }));
|
|
2101
|
+
}
|
|
2102
|
+
|
|
2103
|
+
/**
|
|
2104
|
+
* Arm attempt N+1 for one linear step. The ordinal read and the append share
|
|
2105
|
+
* one metrics critical section, like `completeTaskMetrics`: a second process
|
|
2106
|
+
* serializes on the lock and sees the first attempt instead of minting the
|
|
2107
|
+
* same ordinal.
|
|
2108
|
+
*/
|
|
2109
|
+
function armResumedAttempt(step, stepIndex, agent) {
|
|
2110
|
+
let attemptId = null;
|
|
2111
|
+
mutateMetrics((metrics) => {
|
|
2112
|
+
const ledgerRunId = metrics.task && typeof metrics.task.runId === 'string' ? metrics.task.runId : '';
|
|
2113
|
+
const runId = ledgerRunId || status.metricsRunId || `${slug}-${Date.now()}-${Math.random().toString(16).slice(2)}`;
|
|
2114
|
+
metrics.task = { ...(metrics.task || {}), runId };
|
|
2115
|
+
status.metricsRunId = runId;
|
|
2116
|
+
const events = Array.isArray(metrics.events) ? metrics.events : (metrics.events = []);
|
|
2117
|
+
const attempt =
|
|
2118
|
+
events.reduce(
|
|
2119
|
+
(highest, event) =>
|
|
2120
|
+
event && event.type === 'attempt_started' && event.stepIndex === stepIndex && event.agent === agent
|
|
2121
|
+
? Math.max(highest, Number(event.attempt) || 0)
|
|
2122
|
+
: highest,
|
|
2123
|
+
0,
|
|
2124
|
+
) + 1;
|
|
2125
|
+
attemptId = `${runId}:step-${stepIndex}:${agent}:attempt-${attempt}`;
|
|
2126
|
+
status.activeAttempts = {
|
|
2127
|
+
...(status.activeAttempts || {}),
|
|
2128
|
+
[attemptId]: { agent, stepIndex, attempt, startedAt: now, parallelGroupId: null, waveId: null },
|
|
2129
|
+
};
|
|
2130
|
+
events.push({
|
|
2131
|
+
eventId: `${runId}:${Date.now()}:${Math.random().toString(16).slice(2)}`,
|
|
2132
|
+
type: 'attempt_started',
|
|
2133
|
+
at: now,
|
|
2134
|
+
attemptId,
|
|
2135
|
+
stepIndex,
|
|
2136
|
+
stepLabel: step.label || null,
|
|
2137
|
+
agent,
|
|
2138
|
+
role: roleFor(agent),
|
|
2139
|
+
attempt,
|
|
2140
|
+
parallelGroupId: null,
|
|
2141
|
+
waveId: null,
|
|
2142
|
+
source: 'hook',
|
|
2143
|
+
attributionConfidence: 'high',
|
|
2144
|
+
});
|
|
2145
|
+
});
|
|
2146
|
+
return attemptId;
|
|
2147
|
+
}
|
|
2148
|
+
|
|
2149
|
+
// Re-arm the step a producer left `blocked`. It arms the attempt only: a stop
|
|
2150
|
+
// that finds `awaitingHumanGate: true` returns before the stop tail, so an open
|
|
2151
|
+
// gate would swallow the retried receipt. Gate/advance stays receipt-driven.
|
|
2152
|
+
if (hookInput.action === 'resume_blocked') {
|
|
2153
|
+
if (pauseBlocksAdvance()) process.exit(0);
|
|
2154
|
+
const pipeline = readPipeline();
|
|
2155
|
+
if (!pipeline || !Array.isArray(pipeline.steps) || pipeline.steps.length === 0) {
|
|
2156
|
+
resumeBlockedRefuse(
|
|
2157
|
+
`pipeline.json is missing, unparseable, or has no steps for slug "${slug}"; no attempt was armed and status.json is unchanged.`,
|
|
2158
|
+
);
|
|
2159
|
+
process.exit(0);
|
|
2160
|
+
}
|
|
2161
|
+
const stepIndex = typeof status.pipelineIndex === 'number' ? status.pipelineIndex : 0;
|
|
2162
|
+
const step = pipeline.steps[stepIndex];
|
|
2163
|
+
const blockedSteps = Array.isArray(status.blockedSteps) ? status.blockedSteps : [];
|
|
2164
|
+
if (blockedSteps.length > 0 || pipeline.steps.some((entry) => entry && Array.isArray(entry.dependsOn))) {
|
|
2165
|
+
resumeBlockedRefuse(
|
|
2166
|
+
`graph mode is not supported by resume_blocked for slug "${slug}" (status.blockedSteps or a step.dependsOn): nothing was armed; resume the wave by hand.`,
|
|
2167
|
+
);
|
|
2168
|
+
process.exit(0);
|
|
2169
|
+
}
|
|
2170
|
+
const agents = step ? getStepAgents(step).filter((agent) => typeof agent === 'string' && agent.length > 0) : [];
|
|
2171
|
+
if (agents.length === 0) {
|
|
2172
|
+
resumeBlockedRefuse(
|
|
2173
|
+
`pipeline.json has no executable step at pipelineIndex ${stepIndex} for slug "${slug}"; nothing was armed.`,
|
|
2174
|
+
);
|
|
2175
|
+
process.exit(0);
|
|
2176
|
+
}
|
|
2177
|
+
// A parallel wave is not a single linear step: re-arming it would re-run the
|
|
2178
|
+
// agents that already succeeded. Refuse the shape instead of arming the wave.
|
|
2179
|
+
if (agents.length > 1) {
|
|
2180
|
+
resumeBlockedRefuse(
|
|
2181
|
+
`step ${stepIndex} is a parallel wave for slug "${slug}" (${agents.join(', ')}); resume_blocked arms one linear step, so nothing was armed.`,
|
|
2182
|
+
);
|
|
2183
|
+
process.exit(0);
|
|
2184
|
+
}
|
|
2185
|
+
if (status.state !== 'blocked') {
|
|
2186
|
+
resumeBlockedRefuse(
|
|
2187
|
+
`state "${status.state || 'unknown'}" is not blocked for slug "${slug}"; resume_blocked only re-arms the step a producer left blocked.`,
|
|
2188
|
+
);
|
|
2189
|
+
process.exit(0);
|
|
2190
|
+
}
|
|
2191
|
+
if (status.currentAgent === 'mockup-reviewer') {
|
|
2192
|
+
resumeBlockedRefuse(
|
|
2193
|
+
`the mockup-reviewer BLOCKED_MCP skip-forward owns this state for slug "${slug}": run {"action":"end_human_gate","activateNext":true} instead; resume_blocked armed nothing.`,
|
|
2194
|
+
);
|
|
2195
|
+
process.exit(0);
|
|
2196
|
+
}
|
|
2197
|
+
const activeForStep = Object.values(status.activeAttempts || {}).filter(
|
|
2198
|
+
(entry) => entry && entry.stepIndex === stepIndex,
|
|
2199
|
+
);
|
|
2200
|
+
if (activeForStep.length > 0) {
|
|
2201
|
+
resumeBlockedRefuse(
|
|
2202
|
+
`step ${stepIndex} already has an active attempt for slug "${slug}" (${activeForStep.map((entry) => entry.agent).join(', ')}); resume_blocked changed nothing.`,
|
|
2203
|
+
);
|
|
2204
|
+
process.exit(0);
|
|
2205
|
+
}
|
|
2206
|
+
const attemptId = armResumedAttempt(step, stepIndex, agents[0]);
|
|
2207
|
+
// `currentAgent` names the blocked producer; a pipeline blocked without one
|
|
2208
|
+
// (missing consumer artifacts) falls back to the step's agent.
|
|
2209
|
+
const resumedAgent = status.currentAgent || agents[0];
|
|
2210
|
+
writeStatus({
|
|
2211
|
+
pipelineIndex: stepIndex,
|
|
2212
|
+
currentAgent: resumedAgent,
|
|
2213
|
+
phase: 'executing',
|
|
2214
|
+
state: 'in_progress',
|
|
2215
|
+
awaitingHumanGate: false,
|
|
2216
|
+
});
|
|
2217
|
+
process.stdout.write(
|
|
2218
|
+
JSON.stringify({
|
|
2219
|
+
ok: true,
|
|
2220
|
+
action: 'resume_blocked',
|
|
2221
|
+
pipelineIndex: stepIndex,
|
|
2222
|
+
agents,
|
|
2223
|
+
attemptIds: [attemptId],
|
|
2224
|
+
followup_message: handoffForAgent(resumedAgent, step.scope, step),
|
|
2225
|
+
}),
|
|
2226
|
+
);
|
|
2227
|
+
process.exit(0);
|
|
2228
|
+
}
|
|
2229
|
+
|
|
2095
2230
|
if (hookInput.action === 'bootstrap') {
|
|
2096
2231
|
if (pauseBlocksAdvance()) process.exit(0);
|
|
2097
2232
|
const pipeline = readPipeline();
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"platform": "mavis",
|
|
4
4
|
"stack": "mcp-ts",
|
|
5
5
|
"semanticSource": "cursor/mcp-ts",
|
|
6
|
-
"sourceRevision": "
|
|
6
|
+
"sourceRevision": "19b1dfe3f3234f09554e5840bf242e0ccd3dc4d7a3bccbfeabc29f8804054c42",
|
|
7
7
|
"entries": [
|
|
8
8
|
{
|
|
9
9
|
"source": "AGENTS.md",
|
|
@@ -26,8 +26,12 @@ try {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
if (hookInput.status !== 'completed') {
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
// `resume_blocked` is a lifecycle repair, not a producer receipt: it runs
|
|
30
|
+
// with no `status`, and a `status` it carries is ignored.
|
|
31
|
+
if (hookInput.action !== 'resume_blocked') {
|
|
32
|
+
process.stdout.write('{}');
|
|
33
|
+
process.exit(0);
|
|
34
|
+
}
|
|
31
35
|
}
|
|
32
36
|
|
|
33
37
|
// Slug resolution, strongest first:
|
|
@@ -2039,6 +2043,137 @@ function syncMetricsProfile(pipeline) {
|
|
|
2039
2043
|
});
|
|
2040
2044
|
}
|
|
2041
2045
|
|
|
2046
|
+
function resumeBlockedRefuse(reason) {
|
|
2047
|
+
process.stdout.write(JSON.stringify({ ok: false, action: 'resume_blocked', reason }));
|
|
2048
|
+
}
|
|
2049
|
+
|
|
2050
|
+
/**
|
|
2051
|
+
* Arm attempt N+1 for one linear step. The ordinal read and the append share
|
|
2052
|
+
* one metrics critical section, like `completeTaskMetrics`: a second process
|
|
2053
|
+
* serializes on the lock and sees the first attempt instead of minting the
|
|
2054
|
+
* same ordinal.
|
|
2055
|
+
*/
|
|
2056
|
+
function armResumedAttempt(step, stepIndex, agent) {
|
|
2057
|
+
let attemptId = null;
|
|
2058
|
+
mutateMetrics((metrics) => {
|
|
2059
|
+
const ledgerRunId = metrics.task && typeof metrics.task.runId === 'string' ? metrics.task.runId : '';
|
|
2060
|
+
const runId = ledgerRunId || status.metricsRunId || `${slug}-${Date.now()}-${Math.random().toString(16).slice(2)}`;
|
|
2061
|
+
metrics.task = { ...(metrics.task || {}), runId };
|
|
2062
|
+
status.metricsRunId = runId;
|
|
2063
|
+
const events = Array.isArray(metrics.events) ? metrics.events : (metrics.events = []);
|
|
2064
|
+
const attempt =
|
|
2065
|
+
events.reduce(
|
|
2066
|
+
(highest, event) =>
|
|
2067
|
+
event && event.type === 'attempt_started' && event.stepIndex === stepIndex && event.agent === agent
|
|
2068
|
+
? Math.max(highest, Number(event.attempt) || 0)
|
|
2069
|
+
: highest,
|
|
2070
|
+
0,
|
|
2071
|
+
) + 1;
|
|
2072
|
+
attemptId = `${runId}:step-${stepIndex}:${agent}:attempt-${attempt}`;
|
|
2073
|
+
status.activeAttempts = {
|
|
2074
|
+
...(status.activeAttempts || {}),
|
|
2075
|
+
[attemptId]: { agent, stepIndex, attempt, startedAt: now, parallelGroupId: null, waveId: null },
|
|
2076
|
+
};
|
|
2077
|
+
events.push({
|
|
2078
|
+
eventId: `${runId}:${Date.now()}:${Math.random().toString(16).slice(2)}`,
|
|
2079
|
+
type: 'attempt_started',
|
|
2080
|
+
at: now,
|
|
2081
|
+
attemptId,
|
|
2082
|
+
stepIndex,
|
|
2083
|
+
stepLabel: step.label || null,
|
|
2084
|
+
agent,
|
|
2085
|
+
role: roleFor(agent),
|
|
2086
|
+
attempt,
|
|
2087
|
+
parallelGroupId: null,
|
|
2088
|
+
waveId: null,
|
|
2089
|
+
source: 'hook',
|
|
2090
|
+
attributionConfidence: 'high',
|
|
2091
|
+
});
|
|
2092
|
+
});
|
|
2093
|
+
return attemptId;
|
|
2094
|
+
}
|
|
2095
|
+
|
|
2096
|
+
// Re-arm the step a producer left `blocked`. It arms the attempt only: a stop
|
|
2097
|
+
// that finds `awaitingHumanGate: true` returns before the stop tail, so an open
|
|
2098
|
+
// gate would swallow the retried receipt. Gate/advance stays receipt-driven.
|
|
2099
|
+
if (hookInput.action === 'resume_blocked') {
|
|
2100
|
+
if (pauseBlocksAdvance()) process.exit(0);
|
|
2101
|
+
const pipeline = readPipeline();
|
|
2102
|
+
if (!pipeline || !Array.isArray(pipeline.steps) || pipeline.steps.length === 0) {
|
|
2103
|
+
resumeBlockedRefuse(
|
|
2104
|
+
`pipeline.json is missing, unparseable, or has no steps for slug "${slug}"; no attempt was armed and status.json is unchanged.`,
|
|
2105
|
+
);
|
|
2106
|
+
process.exit(0);
|
|
2107
|
+
}
|
|
2108
|
+
const stepIndex = typeof status.pipelineIndex === 'number' ? status.pipelineIndex : 0;
|
|
2109
|
+
const step = pipeline.steps[stepIndex];
|
|
2110
|
+
const blockedSteps = Array.isArray(status.blockedSteps) ? status.blockedSteps : [];
|
|
2111
|
+
if (blockedSteps.length > 0 || pipeline.steps.some((entry) => entry && Array.isArray(entry.dependsOn))) {
|
|
2112
|
+
resumeBlockedRefuse(
|
|
2113
|
+
`graph mode is not supported by resume_blocked for slug "${slug}" (status.blockedSteps or a step.dependsOn): nothing was armed; resume the wave by hand.`,
|
|
2114
|
+
);
|
|
2115
|
+
process.exit(0);
|
|
2116
|
+
}
|
|
2117
|
+
const agents = step ? getStepAgents(step).filter((agent) => typeof agent === 'string' && agent.length > 0) : [];
|
|
2118
|
+
if (agents.length === 0) {
|
|
2119
|
+
resumeBlockedRefuse(
|
|
2120
|
+
`pipeline.json has no executable step at pipelineIndex ${stepIndex} for slug "${slug}"; nothing was armed.`,
|
|
2121
|
+
);
|
|
2122
|
+
process.exit(0);
|
|
2123
|
+
}
|
|
2124
|
+
// A parallel wave is not a single linear step: re-arming it would re-run the
|
|
2125
|
+
// agents that already succeeded. Refuse the shape instead of arming the wave.
|
|
2126
|
+
if (agents.length > 1) {
|
|
2127
|
+
resumeBlockedRefuse(
|
|
2128
|
+
`step ${stepIndex} is a parallel wave for slug "${slug}" (${agents.join(', ')}); resume_blocked arms one linear step, so nothing was armed.`,
|
|
2129
|
+
);
|
|
2130
|
+
process.exit(0);
|
|
2131
|
+
}
|
|
2132
|
+
if (status.state !== 'blocked') {
|
|
2133
|
+
resumeBlockedRefuse(
|
|
2134
|
+
`state "${status.state || 'unknown'}" is not blocked for slug "${slug}"; resume_blocked only re-arms the step a producer left blocked.`,
|
|
2135
|
+
);
|
|
2136
|
+
process.exit(0);
|
|
2137
|
+
}
|
|
2138
|
+
if (status.currentAgent === 'mockup-reviewer') {
|
|
2139
|
+
resumeBlockedRefuse(
|
|
2140
|
+
`the mockup-reviewer BLOCKED_MCP skip-forward owns this state for slug "${slug}": run {"action":"end_human_gate","activateNext":true} instead; resume_blocked armed nothing.`,
|
|
2141
|
+
);
|
|
2142
|
+
process.exit(0);
|
|
2143
|
+
}
|
|
2144
|
+
const activeForStep = Object.values(status.activeAttempts || {}).filter(
|
|
2145
|
+
(entry) => entry && entry.stepIndex === stepIndex,
|
|
2146
|
+
);
|
|
2147
|
+
if (activeForStep.length > 0) {
|
|
2148
|
+
resumeBlockedRefuse(
|
|
2149
|
+
`step ${stepIndex} already has an active attempt for slug "${slug}" (${activeForStep.map((entry) => entry.agent).join(', ')}); resume_blocked changed nothing.`,
|
|
2150
|
+
);
|
|
2151
|
+
process.exit(0);
|
|
2152
|
+
}
|
|
2153
|
+
const attemptId = armResumedAttempt(step, stepIndex, agents[0]);
|
|
2154
|
+
// `currentAgent` names the blocked producer; a pipeline blocked without one
|
|
2155
|
+
// (missing consumer artifacts) falls back to the step's agent.
|
|
2156
|
+
const resumedAgent = status.currentAgent || agents[0];
|
|
2157
|
+
writeStatus({
|
|
2158
|
+
pipelineIndex: stepIndex,
|
|
2159
|
+
currentAgent: resumedAgent,
|
|
2160
|
+
phase: 'executing',
|
|
2161
|
+
state: 'in_progress',
|
|
2162
|
+
awaitingHumanGate: false,
|
|
2163
|
+
});
|
|
2164
|
+
process.stdout.write(
|
|
2165
|
+
JSON.stringify({
|
|
2166
|
+
ok: true,
|
|
2167
|
+
action: 'resume_blocked',
|
|
2168
|
+
pipelineIndex: stepIndex,
|
|
2169
|
+
agents,
|
|
2170
|
+
attemptIds: [attemptId],
|
|
2171
|
+
followup_message: handoffForAgent(resumedAgent, step.scope, step),
|
|
2172
|
+
}),
|
|
2173
|
+
);
|
|
2174
|
+
process.exit(0);
|
|
2175
|
+
}
|
|
2176
|
+
|
|
2042
2177
|
if (hookInput.action === 'bootstrap') {
|
|
2043
2178
|
if (pauseBlocksAdvance()) process.exit(0);
|
|
2044
2179
|
const pipeline = readPipeline();
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"platform": "mavis",
|
|
4
4
|
"stack": "mol",
|
|
5
5
|
"semanticSource": "cursor/mol",
|
|
6
|
-
"sourceRevision": "
|
|
6
|
+
"sourceRevision": "60e6666948854d07151869f2cabe6fdf57eea1ece97f6343491744104b209f26",
|
|
7
7
|
"entries": [
|
|
8
8
|
{
|
|
9
9
|
"source": "AGENTS.md",
|
|
@@ -23,8 +23,12 @@ try {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
if (hookInput.status !== 'completed') {
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
// `resume_blocked` is a lifecycle repair, not a producer receipt: it runs
|
|
27
|
+
// with no `status`, and a `status` it carries is ignored.
|
|
28
|
+
if (hookInput.action !== 'resume_blocked') {
|
|
29
|
+
process.stdout.write('{}');
|
|
30
|
+
process.exit(0);
|
|
31
|
+
}
|
|
28
32
|
}
|
|
29
33
|
|
|
30
34
|
// Slug resolution, strongest first:
|
|
@@ -2094,6 +2098,137 @@ function syncMetricsProfile(pipeline) {
|
|
|
2094
2098
|
});
|
|
2095
2099
|
}
|
|
2096
2100
|
|
|
2101
|
+
function resumeBlockedRefuse(reason) {
|
|
2102
|
+
process.stdout.write(JSON.stringify({ ok: false, action: 'resume_blocked', reason }));
|
|
2103
|
+
}
|
|
2104
|
+
|
|
2105
|
+
/**
|
|
2106
|
+
* Arm attempt N+1 for one linear step. The ordinal read and the append share
|
|
2107
|
+
* one metrics critical section, like `completeTaskMetrics`: a second process
|
|
2108
|
+
* serializes on the lock and sees the first attempt instead of minting the
|
|
2109
|
+
* same ordinal.
|
|
2110
|
+
*/
|
|
2111
|
+
function armResumedAttempt(step, stepIndex, agent) {
|
|
2112
|
+
let attemptId = null;
|
|
2113
|
+
mutateMetrics((metrics) => {
|
|
2114
|
+
const ledgerRunId = metrics.task && typeof metrics.task.runId === 'string' ? metrics.task.runId : '';
|
|
2115
|
+
const runId = ledgerRunId || status.metricsRunId || `${slug}-${Date.now()}-${Math.random().toString(16).slice(2)}`;
|
|
2116
|
+
metrics.task = { ...(metrics.task || {}), runId };
|
|
2117
|
+
status.metricsRunId = runId;
|
|
2118
|
+
const events = Array.isArray(metrics.events) ? metrics.events : (metrics.events = []);
|
|
2119
|
+
const attempt =
|
|
2120
|
+
events.reduce(
|
|
2121
|
+
(highest, event) =>
|
|
2122
|
+
event && event.type === 'attempt_started' && event.stepIndex === stepIndex && event.agent === agent
|
|
2123
|
+
? Math.max(highest, Number(event.attempt) || 0)
|
|
2124
|
+
: highest,
|
|
2125
|
+
0,
|
|
2126
|
+
) + 1;
|
|
2127
|
+
attemptId = `${runId}:step-${stepIndex}:${agent}:attempt-${attempt}`;
|
|
2128
|
+
status.activeAttempts = {
|
|
2129
|
+
...(status.activeAttempts || {}),
|
|
2130
|
+
[attemptId]: { agent, stepIndex, attempt, startedAt: now, parallelGroupId: null, waveId: null },
|
|
2131
|
+
};
|
|
2132
|
+
events.push({
|
|
2133
|
+
eventId: `${runId}:${Date.now()}:${Math.random().toString(16).slice(2)}`,
|
|
2134
|
+
type: 'attempt_started',
|
|
2135
|
+
at: now,
|
|
2136
|
+
attemptId,
|
|
2137
|
+
stepIndex,
|
|
2138
|
+
stepLabel: step.label || null,
|
|
2139
|
+
agent,
|
|
2140
|
+
role: roleFor(agent),
|
|
2141
|
+
attempt,
|
|
2142
|
+
parallelGroupId: null,
|
|
2143
|
+
waveId: null,
|
|
2144
|
+
source: 'hook',
|
|
2145
|
+
attributionConfidence: 'high',
|
|
2146
|
+
});
|
|
2147
|
+
});
|
|
2148
|
+
return attemptId;
|
|
2149
|
+
}
|
|
2150
|
+
|
|
2151
|
+
// Re-arm the step a producer left `blocked`. It arms the attempt only: a stop
|
|
2152
|
+
// that finds `awaitingHumanGate: true` returns before the stop tail, so an open
|
|
2153
|
+
// gate would swallow the retried receipt. Gate/advance stays receipt-driven.
|
|
2154
|
+
if (hookInput.action === 'resume_blocked') {
|
|
2155
|
+
if (pauseBlocksAdvance()) process.exit(0);
|
|
2156
|
+
const pipeline = readPipeline();
|
|
2157
|
+
if (!pipeline || !Array.isArray(pipeline.steps) || pipeline.steps.length === 0) {
|
|
2158
|
+
resumeBlockedRefuse(
|
|
2159
|
+
`pipeline.json is missing, unparseable, or has no steps for slug "${slug}"; no attempt was armed and status.json is unchanged.`,
|
|
2160
|
+
);
|
|
2161
|
+
process.exit(0);
|
|
2162
|
+
}
|
|
2163
|
+
const stepIndex = typeof status.pipelineIndex === 'number' ? status.pipelineIndex : 0;
|
|
2164
|
+
const step = pipeline.steps[stepIndex];
|
|
2165
|
+
const blockedSteps = Array.isArray(status.blockedSteps) ? status.blockedSteps : [];
|
|
2166
|
+
if (blockedSteps.length > 0 || pipeline.steps.some((entry) => entry && Array.isArray(entry.dependsOn))) {
|
|
2167
|
+
resumeBlockedRefuse(
|
|
2168
|
+
`graph mode is not supported by resume_blocked for slug "${slug}" (status.blockedSteps or a step.dependsOn): nothing was armed; resume the wave by hand.`,
|
|
2169
|
+
);
|
|
2170
|
+
process.exit(0);
|
|
2171
|
+
}
|
|
2172
|
+
const agents = step ? getStepAgents(step).filter((agent) => typeof agent === 'string' && agent.length > 0) : [];
|
|
2173
|
+
if (agents.length === 0) {
|
|
2174
|
+
resumeBlockedRefuse(
|
|
2175
|
+
`pipeline.json has no executable step at pipelineIndex ${stepIndex} for slug "${slug}"; nothing was armed.`,
|
|
2176
|
+
);
|
|
2177
|
+
process.exit(0);
|
|
2178
|
+
}
|
|
2179
|
+
// A parallel wave is not a single linear step: re-arming it would re-run the
|
|
2180
|
+
// agents that already succeeded. Refuse the shape instead of arming the wave.
|
|
2181
|
+
if (agents.length > 1) {
|
|
2182
|
+
resumeBlockedRefuse(
|
|
2183
|
+
`step ${stepIndex} is a parallel wave for slug "${slug}" (${agents.join(', ')}); resume_blocked arms one linear step, so nothing was armed.`,
|
|
2184
|
+
);
|
|
2185
|
+
process.exit(0);
|
|
2186
|
+
}
|
|
2187
|
+
if (status.state !== 'blocked') {
|
|
2188
|
+
resumeBlockedRefuse(
|
|
2189
|
+
`state "${status.state || 'unknown'}" is not blocked for slug "${slug}"; resume_blocked only re-arms the step a producer left blocked.`,
|
|
2190
|
+
);
|
|
2191
|
+
process.exit(0);
|
|
2192
|
+
}
|
|
2193
|
+
if (status.currentAgent === 'mockup-reviewer') {
|
|
2194
|
+
resumeBlockedRefuse(
|
|
2195
|
+
`the mockup-reviewer BLOCKED_MCP skip-forward owns this state for slug "${slug}": run {"action":"end_human_gate","activateNext":true} instead; resume_blocked armed nothing.`,
|
|
2196
|
+
);
|
|
2197
|
+
process.exit(0);
|
|
2198
|
+
}
|
|
2199
|
+
const activeForStep = Object.values(status.activeAttempts || {}).filter(
|
|
2200
|
+
(entry) => entry && entry.stepIndex === stepIndex,
|
|
2201
|
+
);
|
|
2202
|
+
if (activeForStep.length > 0) {
|
|
2203
|
+
resumeBlockedRefuse(
|
|
2204
|
+
`step ${stepIndex} already has an active attempt for slug "${slug}" (${activeForStep.map((entry) => entry.agent).join(', ')}); resume_blocked changed nothing.`,
|
|
2205
|
+
);
|
|
2206
|
+
process.exit(0);
|
|
2207
|
+
}
|
|
2208
|
+
const attemptId = armResumedAttempt(step, stepIndex, agents[0]);
|
|
2209
|
+
// `currentAgent` names the blocked producer; a pipeline blocked without one
|
|
2210
|
+
// (missing consumer artifacts) falls back to the step's agent.
|
|
2211
|
+
const resumedAgent = status.currentAgent || agents[0];
|
|
2212
|
+
writeStatus({
|
|
2213
|
+
pipelineIndex: stepIndex,
|
|
2214
|
+
currentAgent: resumedAgent,
|
|
2215
|
+
phase: 'executing',
|
|
2216
|
+
state: 'in_progress',
|
|
2217
|
+
awaitingHumanGate: false,
|
|
2218
|
+
});
|
|
2219
|
+
process.stdout.write(
|
|
2220
|
+
JSON.stringify({
|
|
2221
|
+
ok: true,
|
|
2222
|
+
action: 'resume_blocked',
|
|
2223
|
+
pipelineIndex: stepIndex,
|
|
2224
|
+
agents,
|
|
2225
|
+
attemptIds: [attemptId],
|
|
2226
|
+
followup_message: handoffForAgent(resumedAgent, step.scope, step),
|
|
2227
|
+
}),
|
|
2228
|
+
);
|
|
2229
|
+
process.exit(0);
|
|
2230
|
+
}
|
|
2231
|
+
|
|
2097
2232
|
if (hookInput.action === 'bootstrap') {
|
|
2098
2233
|
if (pauseBlocksAdvance()) process.exit(0);
|
|
2099
2234
|
const pipeline = readPipeline();
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"platform": "mavis",
|
|
4
4
|
"stack": "next",
|
|
5
5
|
"semanticSource": "cursor/next",
|
|
6
|
-
"sourceRevision": "
|
|
6
|
+
"sourceRevision": "633684ed117315d643a4af6bfcaa880093da59c22aef618fafc931d070330711",
|
|
7
7
|
"entries": [
|
|
8
8
|
{
|
|
9
9
|
"source": "AGENTS.md",
|
|
@@ -527,6 +527,22 @@
|
|
|
527
527
|
"loadMode": "manual",
|
|
528
528
|
"reason": "No file-defined slash command API; keep as an explicit procedure plus exec --file"
|
|
529
529
|
},
|
|
530
|
+
{
|
|
531
|
+
"source": "commands/ui-start.md",
|
|
532
|
+
"target": "commands/ui-start.md",
|
|
533
|
+
"category": "commands",
|
|
534
|
+
"disposition": "transform",
|
|
535
|
+
"loadMode": "manual",
|
|
536
|
+
"reason": "No file-defined slash command API; keep as an explicit procedure plus exec --file"
|
|
537
|
+
},
|
|
538
|
+
{
|
|
539
|
+
"source": "commands/ui-stop.md",
|
|
540
|
+
"target": "commands/ui-stop.md",
|
|
541
|
+
"category": "commands",
|
|
542
|
+
"disposition": "transform",
|
|
543
|
+
"loadMode": "manual",
|
|
544
|
+
"reason": "No file-defined slash command API; keep as an explicit procedure plus exec --file"
|
|
545
|
+
},
|
|
530
546
|
{
|
|
531
547
|
"source": "commands/update.md",
|
|
532
548
|
"target": "commands/update.md",
|
|
@@ -46,6 +46,11 @@ On OpenCode, `/task-evil` runs as the `task-evil` primary agent: the `question`
|
|
|
46
46
|
→ reviewer only
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
+
## UI stack commands
|
|
50
|
+
|
|
51
|
+
- **`/ui-start`** — stop the running `team-tasks-ui` stack, run `team-db.mjs migrate-tasks`, then rebuild and start it.
|
|
52
|
+
- **`/ui-stop`** — stop the `team-tasks-ui` stack and the team-db API that `/ui-start` started.
|
|
53
|
+
|
|
49
54
|
## Related files
|
|
50
55
|
|
|
51
56
|
- Subagents: `../agents/` (**24** roles, including `task-router.md`, `codebase-analyzer.md`)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Task continue — after human gate or
|
|
1
|
+
# Task continue — after human gate, pause, or blocked receipt
|
|
2
2
|
|
|
3
3
|
Resume the pipeline from `pipeline.json`.
|
|
4
4
|
|
|
@@ -12,6 +12,7 @@ Resume the pipeline from `pipeline.json`.
|
|
|
12
12
|
2. Continue if:
|
|
13
13
|
- `awaitingHumanGate: true` or `state: awaiting_approval`, **or**
|
|
14
14
|
- `state: changes_requested` (after review), **or**
|
|
15
|
+
- `state: blocked` (a producer's terminal `blocked` receipt and the owner has resolved the blockers), **or**
|
|
15
16
|
- `state: paused` (the `.ai.local/STOP` / `.ai.local/ESTOP` sentinel is gone), **or**
|
|
16
17
|
- the task was interrupted and must resume from `pipelineIndex`.
|
|
17
18
|
|
|
@@ -29,10 +30,20 @@ printf '%s\n' '{"status":"completed","action":"end_human_gate","activateNext":tr
|
|
|
29
30
|
3. Re-read `status.json` (and the hook `followup_message`).
|
|
30
31
|
4. Invoke the subagent named in `status.currentAgent` / followup — do **not** advance the pipeline a second time.
|
|
31
32
|
3. **Review `changes_requested`** (not a human gate): if `currentAgent` is **`mockup-reviewer`**, this is the FAIL-only mockup gate — do **not** retry `feature-developer`. Read `mockup-review.md` and resume via the human-gate path (`end_human_gate` / `activateNext`). Otherwise: set `currentAgent` to `feature-developer` (same index / find developer in steps), `state: in_progress`, then invoke developer. Do **not** call `end_human_gate` unless `activeHumanGateEventId` is set.
|
|
32
|
-
4. **`blocked` + `currentAgent: mockup-reviewer`** (`BLOCKED_MCP`): skip-forward via the same `end_human_gate`/`activateNext` path (explicit «proceed without MCP»). Do not invent DS claims.
|
|
33
|
-
5. **
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
4. **`blocked` + `currentAgent: mockup-reviewer`** (`BLOCKED_MCP`): skip-forward via the same `end_human_gate`/`activateNext` path (explicit «proceed without MCP»). Do not invent DS claims. This exception keeps precedence: `resume_blocked` refuses this state and names the skip-forward.
|
|
34
|
+
5. **`state: blocked`** (every other producer): re-arm the blocked step through the **installed** hook — it activates attempt N+1 and is the **single authority** for the ledger:
|
|
35
|
+
1. **Do not** manually increment `pipelineIndex` or hand-write `status.json` fields.
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
printf '%s\n' '{"action":"resume_blocked"}' | TEAM_TASK_SLUG=<slug> bash .mavis/hooks/chain-team-phases.sh
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
2. `ok:false` with a `reason` (`is not blocked`, `pipeline.json`, `graph mode`, `already has an active attempt`) means nothing was armed: re-read `status.json` and act on the reason. A refusal carries no `followup_message` — never re-invoke a producer on it.
|
|
42
|
+
3. `ok:true` arms attempt N+1 on the same step: re-read `status.json`, then invoke the subagent named in `status.currentAgent` with the hook `followup_message`. Do **not** open the gate yourself: the retried receipt opens it (`awaiting_approval`) when the step has `after:<agent>` in `humanGates`, and advances the chain otherwise.
|
|
43
|
+
4. Fallback only for an installed hook that predates the action (the call answers `{}`): run `{"status":"completed","action":"bootstrap"}` then `{"status":"completed"}`. The second run opens the gate or advances; the retried producer is not ledgered, so record it in `.memlog.md`.
|
|
44
|
+
6. **Other resume**: restore `pipelineIndex` / `currentAgent` from status and invoke that agent.
|
|
45
|
+
7. **Paused** (`state: paused`, sentinel removed): if `awaitingHumanGate` is still true, use the human-gate resume path above. Otherwise close the pause through the installed hook with `{"status":"completed"}` and no `action`, then re-read `status.json` and the hook `followup_message`; do not advance by hand.
|
|
46
|
+
8. After the invoked agent completes, `chain-team-phases.sh` on `subagentStop` continues the chain when `autoChain: true`.
|
|
36
47
|
|
|
37
48
|
## Checkpoint & resume
|
|
38
49
|
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Start the team-tasks UI
|
|
2
|
+
|
|
3
|
+
Bring up `apps/team-tasks-ui` through its own Docker Compose project, rebuilt
|
|
4
|
+
from the current source, and guarantee the host team-db API the UI reads from.
|
|
5
|
+
|
|
6
|
+
## What to do
|
|
7
|
+
|
|
8
|
+
1. If `apps/team-tasks-ui/scripts/stack.mjs` is absent, stop and report that this
|
|
9
|
+
repository has no team-tasks UI. Otherwise, from the repository root, run:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
node apps/team-tasks-ui/scripts/stack.mjs start
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
2. Quote the command's stdout verbatim: the `ui:` line and the `api:` line,
|
|
16
|
+
including the owner state. On success the script prints
|
|
17
|
+
`ui: http://127.0.0.1:4300` and
|
|
18
|
+
`api: http://127.0.0.1:4178 (owner: pre-existing|started-by-this-script)`.
|
|
19
|
+
3. On a non-zero exit, quote the `error:` line verbatim and stop. Do not retry
|
|
20
|
+
with a different compose command and do not start the API by hand.
|
|
21
|
+
4. The start is restart-safe: when the `team-tasks-ui` project is already
|
|
22
|
+
running, the script stops it first, runs `team-db.mjs migrate-tasks` against
|
|
23
|
+
the projection, then rebuilds the image from the current source and starts
|
|
24
|
+
again. A second start never binds a second stack or a second listener on the
|
|
25
|
+
published port.
|
|
26
|
+
|
|
27
|
+
## What the script does
|
|
28
|
+
|
|
29
|
+
- Pins every project call to `apps/team-tasks-ui/docker-compose.yml` and the
|
|
30
|
+
`team-tasks-ui` project name.
|
|
31
|
+
- Stops a running `team-tasks-ui` project and the API this script started
|
|
32
|
+
before refreshing the projection.
|
|
33
|
+
- Runs `node .ai.local/scripts/team-db.mjs migrate-tasks --quiet --no-rebuild`
|
|
34
|
+
after that stop and before the rebuild, so the UI serves the current task
|
|
35
|
+
projection.
|
|
36
|
+
- Seeds `team/runner.json` from the default when it is absent.
|
|
37
|
+
- Starts the host API with `node .ai.local/scripts/team-db.mjs serve` only when
|
|
38
|
+
nothing answers on `127.0.0.1:4178`, and records that ownership in the
|
|
39
|
+
git-ignored `.ai.local/.ui/api.json` marker.
|
|
40
|
+
- Repairs a missing derived database once through `team-db.mjs sync`, and never
|
|
41
|
+
repairs an API this script did not start.
|
|
42
|
+
|
|
43
|
+
## Do not
|
|
44
|
+
|
|
45
|
+
- Write `status.json`, `metrics.json`, or any task or lifecycle file.
|
|
46
|
+
- Run `docker stop`, `docker rm`, `docker kill`, or a bare `docker compose down`.
|
|
47
|
+
- Edit `apps/team-tasks-ui/docker-compose.yml`, the Dockerfile, the app source,
|
|
48
|
+
or the team-db API.
|
|
49
|
+
- Open a browser, tail container logs, or start a second copy of the app.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Stop the team-tasks UI
|
|
2
|
+
|
|
3
|
+
Take down the `apps/team-tasks-ui` Docker Compose project and stop the host
|
|
4
|
+
team-db API only when `/ui-start` started it.
|
|
5
|
+
|
|
6
|
+
## What to do
|
|
7
|
+
|
|
8
|
+
1. If `apps/team-tasks-ui/scripts/stack.mjs` is absent, stop and report that this
|
|
9
|
+
repository has no team-tasks UI. Otherwise, from the repository root, run:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
node apps/team-tasks-ui/scripts/stack.mjs stop
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
2. Quote the command's stdout verbatim. On an already stopped stack it prints
|
|
16
|
+
`nothing running` and exits 0.
|
|
17
|
+
3. On a non-zero exit, quote the `error:` line verbatim and stop.
|
|
18
|
+
4. The stop is idempotent: a second stop exits 0 and changes nothing.
|
|
19
|
+
|
|
20
|
+
## What the script does
|
|
21
|
+
|
|
22
|
+
- Pins every project call to `apps/team-tasks-ui/docker-compose.yml` and the
|
|
23
|
+
`team-tasks-ui` project name, and removes that project's containers and
|
|
24
|
+
network.
|
|
25
|
+
- Stops only the API process recorded in `.ai.local/.ui/api.json` whose live
|
|
26
|
+
command line is still `team-db.mjs serve`, then removes that marker.
|
|
27
|
+
- Leaves a foreign API alone: a process the marker does not prove is never
|
|
28
|
+
signalled.
|
|
29
|
+
|
|
30
|
+
## Do not
|
|
31
|
+
|
|
32
|
+
- Write `status.json`, `metrics.json`, or any task or lifecycle file.
|
|
33
|
+
- Run `docker stop`, `docker rm`, `docker kill`, or a bare `docker compose down`.
|
|
34
|
+
- Stop a container outside the `team-tasks-ui` project.
|
|
35
|
+
- Edit `apps/team-tasks-ui/docker-compose.yml`, the Dockerfile, or the app
|
|
36
|
+
source.
|
|
37
|
+
- Kill a process on `127.0.0.1:4178` by port; only the ownership marker
|
|
38
|
+
authorizes a stop.
|