@caiqueoak/flow 0.5.1 → 0.5.2
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 +1 -1
- package/package.json +1 -1
- package/src/artifacts/backlog.mjs +2 -7
- package/src/commands/graph.mjs +13 -4
- package/src/commands/route.mjs +1 -1
- package/src/commands/status.mjs +6 -3
package/README.md
CHANGED
|
@@ -38,7 +38,7 @@ PRD, engineering and plans use YAML frontmatter with `schema_version: 1`, `statu
|
|
|
38
38
|
- `gates.yaml`: schema 1, command/builtin checks only; qualitative judgment remains review instructions.
|
|
39
39
|
- `docs/graph.md`: deterministic derived projection; regenerate rather than hand-edit.
|
|
40
40
|
|
|
41
|
-
Persist only pending, in_progress and completed. Ready/Blocked are derived from dependency edges
|
|
41
|
+
Persist only pending, in_progress and completed. Ready/Blocked are derived exclusively from work-item dependency edges. Blockers use `{id, type: external_action|consequential_decision, description, status: unresolved|resolved}` as context for the agent to address within the work item; they do not change execution status. Only one mutating work item/task may be active across the project. Read-only analysis may be parallel; automatic concurrent worktrees are out of scope.
|
|
42
42
|
|
|
43
43
|
## CLI
|
|
44
44
|
|
package/package.json
CHANGED
|
@@ -120,13 +120,8 @@ export function validateAcyclic(items) {
|
|
|
120
120
|
export function deriveExecutionStatus(item, byId) {
|
|
121
121
|
if (item.state === 'completed') return { status: 'completed', reasons: [] };
|
|
122
122
|
const incompleteDependencies = item.depends_on.filter((id) => byId.get(id)?.state !== 'completed');
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
return {
|
|
126
|
-
status: 'blocked',
|
|
127
|
-
reasons: [...incompleteDependencies.map((id) => ({ type: 'dependency', ref: id })), ...explicitBlockers]
|
|
128
|
-
};
|
|
129
|
-
}
|
|
123
|
+
if (incompleteDependencies.length)
|
|
124
|
+
return { status: 'blocked', reasons: incompleteDependencies.map((id) => ({ type: 'dependency', ref: id })) };
|
|
130
125
|
return { status: item.state === 'in_progress' ? 'in_progress' : 'ready', reasons: [] };
|
|
131
126
|
}
|
|
132
127
|
|
package/src/commands/graph.mjs
CHANGED
|
@@ -22,6 +22,13 @@ const CLASSES = [
|
|
|
22
22
|
' classDef blocked fill:#fee2e2,stroke:#dc2626,color:#7f1d1d;'
|
|
23
23
|
];
|
|
24
24
|
|
|
25
|
+
const LINK_STYLES = {
|
|
26
|
+
completed: 'stroke:#16a34a,stroke-width:2px',
|
|
27
|
+
in_progress: 'stroke:#2563eb,stroke-width:3px',
|
|
28
|
+
ready: 'stroke:#d97706,stroke-width:2px,stroke-dasharray:6 4',
|
|
29
|
+
blocked: 'stroke:#dc2626,stroke-width:2px,stroke-dasharray:2 3'
|
|
30
|
+
};
|
|
31
|
+
|
|
25
32
|
export function generateGraphMarkdown(backlogText) {
|
|
26
33
|
const { work_items: items } = parseBacklog(backlogText);
|
|
27
34
|
const ordered = topologicalOrder(items);
|
|
@@ -39,10 +46,10 @@ export function generateGraphMarkdown(backlogText) {
|
|
|
39
46
|
'',
|
|
40
47
|
'## Status',
|
|
41
48
|
'',
|
|
42
|
-
'- **Completed** — accepted work.',
|
|
43
|
-
'- **In Progress** — currently executing.',
|
|
44
|
-
'- **Ready** — pending work with all dependencies satisfied.',
|
|
45
|
-
'- **Blocked** — pending work with at least one incomplete dependency
|
|
49
|
+
'- 🟩 **Completed** — accepted work.',
|
|
50
|
+
'- 🟦 **In Progress** — currently executing.',
|
|
51
|
+
'- 🟨 **Ready** — pending work with all dependencies satisfied.',
|
|
52
|
+
'- 🟥 **Blocked** — pending work with at least one incomplete work-item dependency.',
|
|
46
53
|
'',
|
|
47
54
|
'```mermaid',
|
|
48
55
|
"%%{init: {'flowchart': {'curve': 'linear', 'nodeSpacing': 32, 'rankSpacing': 54}} }%%",
|
|
@@ -51,6 +58,8 @@ export function generateGraphMarkdown(backlogText) {
|
|
|
51
58
|
for (const item of ordered) lines.push(` ${item.id}["${escapeMermaid(item.id)}<br/>${escapeMermaid(item.title)}"]`);
|
|
52
59
|
lines.push('');
|
|
53
60
|
for (const edge of edges) lines.push(` ${edge.source} --> ${edge.target}`);
|
|
61
|
+
lines.push('');
|
|
62
|
+
edges.forEach((edge, index) => lines.push(` linkStyle ${index} ${LINK_STYLES[statuses.get(edge.source)]};`));
|
|
54
63
|
lines.push('', ...CLASSES);
|
|
55
64
|
for (const status of ['completed', 'in_progress', 'ready', 'blocked']) {
|
|
56
65
|
const ids = ordered.filter((item) => statuses.get(item.id) === status).map((item) => item.id);
|
package/src/commands/route.mjs
CHANGED
|
@@ -79,7 +79,7 @@ export function routeProject(root) {
|
|
|
79
79
|
if (active && deriveExecutionStatus(active, byId).status === 'blocked')
|
|
80
80
|
return {
|
|
81
81
|
action: 'stop',
|
|
82
|
-
reason: '
|
|
82
|
+
reason: 'dependency_blocked',
|
|
83
83
|
work_item: active.id,
|
|
84
84
|
details: deriveExecutionStatus(active, byId).reasons
|
|
85
85
|
};
|
package/src/commands/status.mjs
CHANGED
|
@@ -14,7 +14,11 @@ export function runStatus({ args }) {
|
|
|
14
14
|
const groups = new Map(['in_progress', 'ready', 'blocked', 'completed'].map((status) => [status, []]));
|
|
15
15
|
for (const item of backlog.work_items) {
|
|
16
16
|
const derived = deriveExecutionStatus(item, byId);
|
|
17
|
-
groups.get(derived.status).push({
|
|
17
|
+
groups.get(derived.status).push({
|
|
18
|
+
...item,
|
|
19
|
+
reasons: derived.reasons,
|
|
20
|
+
blockers: item.blockers.filter((blocker) => blocker.status === 'unresolved')
|
|
21
|
+
});
|
|
18
22
|
}
|
|
19
23
|
const lines = [];
|
|
20
24
|
for (const [status, items] of groups) {
|
|
@@ -23,8 +27,7 @@ export function runStatus({ args }) {
|
|
|
23
27
|
for (const item of items) {
|
|
24
28
|
const deps = item.reasons.filter((r) => r.type === 'dependency').map((r) => r.ref);
|
|
25
29
|
lines.push(` ${item.id} — ${item.title}${deps.length ? ` ← ${deps.join(', ')}` : ''}`);
|
|
26
|
-
for (const
|
|
27
|
-
lines.push(` ${reason.type}: ${reason.description} [${reason.id}]`);
|
|
30
|
+
for (const blocker of item.blockers) lines.push(` blocker: ${blocker.description} [${blocker.id}]`);
|
|
28
31
|
}
|
|
29
32
|
lines.push('');
|
|
30
33
|
}
|