You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .opencode/knowledge/workflow/flowr-spec.md
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,13 +12,13 @@ last-updated: 2026-05-06
12
12
- Declare `exits` on every flow as its contract with parent flows; parent `next` keys must match child `exits` exactly.
13
13
- Use `conditions` blocks on states to define named condition groups; reference them in transitions with `when`.
14
14
- Guarded transitions use `when` with expression strings (`==true`, `>=80%`); `when` accepts a dict, a named ref string, or a list mixing both; conditions are AND-combined with no inheritance.
15
-
- Carry runtime metadata in state-level `attrs` (agent, skills, git, input_artifacts, etc.); `attrs` is opaque to the engine and replaces flow-level attrs entirely (no merge).
15
+
- Carry runtime metadata in state-level `attrs` (agent, skills, input_artifacts, etc.); `attrs` is opaque to the engine and replaces flow-level attrs entirely (no merge).
16
16
- All CLI commands output **JSON by default** (structured, machine-parseable). Use `--text` flag for human-readable plain text.
17
17
-`next` command shows **all** transitions with status markers (`"open"` / `"blocked"`) and condition hints for blocked transitions.
18
-
- Sessions track workflow progress (flow, state, call stack) as YAML files in `.flowr/sessions/` with atomic writes; `--session` on check/next/transition resolves flow/state automatically.
18
+
- Sessions track workflow progress (flow, state, call stack) as YAML files in `.cache/sessions/` with atomic writes; `--session` on check/next/transition resolves flow/state automatically.
19
19
- Subflow exit names resolve through the parent flow's transition map (not used directly as state IDs). Enables subflow chaining and recursive entry up to 3 levels.
20
20
- Configuration reads `[tool.flowr]` from `pyproject.toml` (flows_dir, sessions_dir, default_flow, default_session); CLI flags override pyproject.toml which overrides defaults.
21
-
- Flow name resolution: commands accept short names (e.g., `planning-flow`) resolved from the configured flows directory, or full file paths.
21
+
- Flow name resolution: commands accept short names (e.g., `architecture-flow`) resolved from the configured flows directory, or full file paths.
22
22
- Immutable loaded flows, closed evidence schema, isolated subflow context, filesystem wins over session on conflict. Extension fields (non-reserved keys) are allowed and not interpreted by the validator.
23
23
24
24
## Concepts
@@ -31,11 +31,11 @@ last-updated: 2026-05-06
31
31
32
32
**Conditions and Guards**: States may define `conditions` blocks containing named condition groups. Transitions reference these groups with `when` to create guarded transitions. The `when` field accepts three forms: a dict (inline condition-map), a string (reference to a named group), or a list (mix of named refs and inline dicts). All conditions are AND-combined. A named ref that does not match a group defined on the same state causes a validation error. Condition expressions use operators `==`, `!=`, `>=`, `<=`, `>`, `<`. Numeric extraction is applied to both sides (e.g., `>=80%` vs `75%` compares 80 vs 75). Plain strings without operators are treated as `==` (implicit equality). No inheritance; every condition is explicit on the transition where it applies.
33
33
34
-
**State Attrs**: State-level `attrs` carry runtime metadata that the flowr engine ignores but agents and skills read. Common keys: `description`, `owner`, `skills`, `git`, `input_artifacts`, `edited_artifacts`, `output_artifacts`. The `git` key (`main` or `feature`) determines the branch for commits. State-level `attrs` replace flow-level attrs entirely (no merge, no deep merge). The `attrs` field is the designated extension point: implementations should place implementation-specific data inside `attrs` rather than as top-level keys.
34
+
**State Attrs**: State-level `attrs` carry runtime metadata that the flowr engine ignores but agents and skills read. Common keys: `description`, `owner`, `skills`, `input_artifacts`, `edited_artifacts`, `output_artifacts`. State-level `attrs` replace flow-level attrs entirely (no merge, no deep merge). The `attrs` field is the designated extension point: implementations should place implementation-specific data inside `attrs` rather than as top-level keys.
35
35
36
36
**Subflow Invocation**: A state with a `flow:` field becomes a subflow invocation. The parent's `next` keys must match the child's `exits` exactly. Subflows use a call-stack mechanism: push on entry, pop on exit. Context is isolated: only the current flow is visible. Cross-flow cycles are forbidden.
37
37
38
-
**Subflow Exit Resolution (v1.0.0)**: Exit names resolve through the parent flow's transition map instead of being used directly as state IDs. This enables subflow chaining (atomic exit + re-enter next subflow) and recursive subflow entry up to 3 levels deep (e.g., main-flow → feature-dev-flow → planning-flow). Stack frames record the correct parent state (subflow wrapper, not pre-transition state).
38
+
**Subflow Exit Resolution (v1.0.0)**: Exit names resolve through the parent flow's transition map instead of being used directly as state IDs. This enables subflow chaining (atomic exit + re-enter next subflow) and recursive subflow entry up to 3 levels deep (e.g., define-flow → spec-validation-flow). Stack frames record the correct parent state (subflow wrapper, not pre-transition state).
39
39
40
40
## Content
41
41
@@ -102,18 +102,18 @@ States may define a `conditions` block (sibling of `attrs` and `next`) containin
102
102
103
103
```yaml
104
104
conditions:
105
-
invest_passed:
105
+
invest-passed:
106
106
independent: ==true
107
107
negotiable: ==true
108
108
valuable: ==true
109
109
next:
110
110
done:
111
111
to: next-state
112
-
when: invest_passed
112
+
when: invest-passed
113
113
partial:
114
114
to: review
115
115
when:
116
-
- invest_passed
116
+
- invest-passed
117
117
- { override: "==yes" }
118
118
```
119
119
@@ -137,7 +137,7 @@ Named condition references in `when` clauses must resolve to a key in the same s
137
137
- Cross-flow cycles are forbidden (detected via DFS at load time)
138
138
- Exit names resolve through parent flow's transition map (not used directly as state IDs)
139
139
- Subflow chaining: atomic exit + re-enter next subflow without manual state manipulation
140
-
- Recursive entry: supports up to 3-level nesting (main → feature-dev → planning)
140
+
- Recursive entry: supports up to 3-level nesting (define-flow → discovery-flow, develop-flow → development-flow, etc.)
141
141
- Stack frames record the subflow wrapper state (not the pre-transition state)
142
142
- `.yaml` extension fallback: flow references without extension are resolved automatically
143
143
- `session init`auto-enters subflow when first state has a `flow:` field
@@ -176,7 +176,7 @@ A flow definition MAY contain fields not specified in the specification. Such ex
176
176
177
177
### Session Model
178
178
179
-
Sessions persist workflow progress as YAML files in `.flowr/sessions/` with atomic writes (temp-file-then-rename). Each session tracks:
179
+
Sessions persist workflow progress as YAML files in `.cache/sessions/` with atomic writes (temp-file-then-rename). Each session tracks:
0 commit comments