@caiqueoak/flow 0.5.1 → 0.5.3

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 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 and explicit blockers. Blockers use `{id, type: external_action|consequential_decision, description, status: unresolved|resolved}`. 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.
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@caiqueoak/flow",
3
- "version": "0.5.1",
3
+ "version": "0.5.3",
4
4
  "description": "Readability-first, agent-agnostic software development workflow for coding agents.",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -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
- const explicitBlockers = (item.blockers ?? []).filter((blocker) => blocker.status !== 'resolved');
124
- if (incompleteDependencies.length || explicitBlockers.length) {
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
 
@@ -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 or explicit external blocker.',
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);
@@ -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: 'external_action',
82
+ reason: 'dependency_blocked',
83
83
  work_item: active.id,
84
84
  details: deriveExecutionStatus(active, byId).reasons
85
85
  };
@@ -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({ ...item, reasons: derived.reasons });
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 reason of item.reasons.filter((reason) => reason.type !== 'dependency'))
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
  }
@@ -4,7 +4,12 @@ const text = fs.readFileSync(
4
4
  new URL('../../skills/flow/engineering/profiles/readability-first.md', import.meta.url),
5
5
  'utf8'
6
6
  );
7
- export const READABILITY_FIRST_PROFILE = parse(text.match(/^---\r?\n([\s\S]*?)\r?\n---/)[1]);
7
+ export function parseProfileFrontmatter(text) {
8
+ const match = text.match(/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);
9
+ if (!match) throw new Error('Missing YAML frontmatter in Flow profile.');
10
+ return parse(match[1]);
11
+ }
12
+ export const READABILITY_FIRST_PROFILE = parseProfileFrontmatter(text);
8
13
  export const ENGINEERING_PROFILES = {
9
14
  'readability-first': READABILITY_FIRST_PROFILE,
10
15
  [READABILITY_FIRST_PROFILE.id]: READABILITY_FIRST_PROFILE