@manhquy/flow-skill 0.7.2 → 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.
@@ -52,3 +52,82 @@ evidence. No hook install into `~/.claude` or `~/.omp`. No long-lived socket sub
52
52
 
53
53
  Own-runtime / own-PTY / own-wait is a successor ADR plus a separate product,
54
54
  not a card in this skill.
55
+
56
+ ## workspace port
57
+
58
+ Deterministic per-card port allocator for parallel worktree web verification (`flow workspace port <C-NNN>`).
59
+
60
+ - **Formula:** `port = FLOW_WORKSPACE_BASEPORT + port_offset` (where `port_offset` is the registered worktree offset from `.flow/workspaces.jsonl`). Stable per registration and matches `workspace enter`.
61
+ - **Port Bounds & Fail-Loud:** If `port = FLOW_WORKSPACE_BASEPORT + port_offset > 65535`, `workspace port` fails loudly with exit 2 (`FAIL - port range exhausted for '<card>' (baseport <b> + offset <o> = <raw> > 65535); lower FLOW_WORKSPACE_BASEPORT`) rather than wrapping or aliasing.
62
+ - **Environment Override:** `FLOW_WORKSPACE_BASEPORT` (defaults to `3000`; valid numeric range is `1..65535`). Out-of-range baseport exits 2.
63
+ - **Target File Contract:** Writes/overwrites strictly `<worktree>/.env.flow.local` inside the card's registered workspace root with:
64
+ ```sh
65
+ PORT=<port>
66
+ FLOW_CARD=<C-NNN>
67
+ ```
68
+ Mutates only this single file; zero locks needed beyond standard workspace mechanics.
69
+ - **Exit Codes:**
70
+ - `0`: Workspace resolved, port computed, `.env.flow.local` written.
71
+ - `2`: Card argument invalid shape, no registered workspace in `.flow/workspaces.jsonl`, missing `port_offset`, baseport out of range, or port range exhausted > 65535 (never creates worktrees implicitly).
72
+
73
+ ## resume output contract
74
+
75
+ `flow resume` is the external-orchestrator re-entry surface. It is read-only for planning/card state (event-tail + registry reads via
76
+ `inflight_display`; no lock, no plan/card mutation, no `next_verb`
77
+ execution) — but the runner's EXIT trap (`_log_on_exit` -> `_log_event`)
78
+ still appends telemetry on every invocation (a row to the project's
79
+ `events.jsonl` plus a compact row to the device-global log), so expect
80
+ those files to grow. The documented elements below describe shipped
81
+ behavior; anything not listed here is not to be parsed.
82
+
83
+ **Output shape, in order:**
84
+
85
+ 1. **Header.** `flow resume`, then indented `project:` (repo root) and
86
+ `auto:` (attestation auto state). If planning has not started
87
+ (`current_stage_idx < 0`), resume emits only `nothing to resume - <next
88
+ action>` + `NEXT_VERB=<verb>` and stops.
89
+ 2. **Last-session telemetry block.** The most recent foreign session_id in
90
+ `events.jsonl` (string inequality vs the current session), emitting that
91
+ session's rows as `<ts> <command> ok|FAIL(n) [stage_from -> stage_to]`.
92
+ Command **NAMES only — never raw args** (free-text args can carry
93
+ unmasked secrets). Rows are capped `tail -5` (most recent wins). A
94
+ `ppid:`-scheme session whose latest foreign row is < 900s from the anchor
95
+ (this session's own first row if present, else wall-clock `now` — the
96
+ no-own-row-yet case is exactly when resume runs) is labeled
97
+ `recent activity` instead of `last session`, because PID reuse makes a
98
+ "last session" that may never have existed. Absolute timestamps shown
99
+ either way. If `events.jsonl` is empty/absent: `no telemetry - showing
100
+ gate state only`, then gate state + NEXT, and no in-flight section.
101
+ 3. **In-flight section.** `in flight:` header, then one line per todo card
102
+ still registered in `$CARDS_DIR/.inflight` (`cards/.inflight`, per
103
+ `_inflight_file`): ` <id> (in flight, started
104
+ <Xm|Xh|Xd> ago)`. Stale ids (card file gone) self-skip; **completed cards
105
+ are never listed** (only `status: todo` rows qualify).
106
+ 4. **Gate state.** Identical block to `flow status` (`_gate_state_brief`):
107
+ current stage only — `planning: at stage <s>` plus `gate: PASS|BLOCKED`.
108
+ (In the rare earlier-stage-blocked state, NEXT may point at an earlier
109
+ stage than this current-stage gate; that is by design.)
110
+ 5. **Exactly one `NEXT -> <action>` + `NEXT_VERB=<verb>` line pair**, from
111
+ the same `_next_action` ladder as `status` — the two verbs can never
112
+ disagree.
113
+
114
+ **`--budget` semantics.** `resume --budget` caps the in-flight list at 5
115
+ lines plus one ` +M more in flight - see 'flow card'` summary line
116
+ (where M = hidden count). With ≤5 in-flight cards, `--budget` output is
117
+ **byte-identical to default resume output** (matching rule:
118
+ byte-identical-under-budget). No other section is affected; default resume
119
+ lists all in-flight cards and never emits the summary line. Extra arguments
120
+ to either form exit 2.
121
+
122
+ **`resume --json`.** Emits exactly one closed `flow_context/v1` object —
123
+ the same schema as `status --json`:
124
+ `{"v":"flow_context/v1","stage":...,"gate":"PASS|BLOCKED|none","next_verb":...,"card":...,"dwell":...,"load":...}`.
125
+ Display-only: it reports what to run next but never executes `next_verb`.
126
+
127
+ **Scope note (not a stability promise).** The elements above are parseable by external
128
+ orchestrators; parse only these, never ad-hoc prose. This documents shipped
129
+ behavior as of the current flow version (`version` in `skills/flow/SKILL.md`
130
+ — currently 0.33.0 — surfaced as `flow_version` in telemetry). The project
131
+ has not adopted a formal compatibility guarantee: when upgrading flow,
132
+ re-diff this contract against the runner (`cmd_resume`, `inflight_display`,
133
+ `_log_event`) before relying on it.
@@ -233,7 +233,7 @@ _att_git_clean_for_attest() {
233
233
  path="${path#\"}"; path="${path%\"}"
234
234
  case "$path" in
235
235
  .flow|.flow/*) continue ;;
236
- flow/.lock|flow/.lock.d|flow/.lock.d/*) continue ;;
236
+ flow/.lock|flow/.lock.*|flow/.lock.d|flow/.lock.d/*) continue ;;
237
237
  cards/C-*.md)
238
238
  _att_card_projection_matches_head "$path" || return 1
239
239
  continue