tickmarkr 2.4.2 → 2.5.1

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.
Files changed (89) hide show
  1. package/README.md +110 -24
  2. package/dist/adapters/fake.d.ts +1 -0
  3. package/dist/adapters/fake.js +2 -1
  4. package/dist/adapters/opencode.d.ts +1 -0
  5. package/dist/adapters/opencode.js +4 -1
  6. package/dist/adapters/types.d.ts +14 -0
  7. package/dist/adapters/types.js +25 -0
  8. package/dist/cli/commands/approve.d.ts +42 -0
  9. package/dist/cli/commands/approve.js +80 -13
  10. package/dist/cli/commands/doctor.d.ts +234 -0
  11. package/dist/cli/commands/doctor.js +139 -5
  12. package/dist/cli/commands/init.d.ts +2 -0
  13. package/dist/cli/commands/init.js +45 -5
  14. package/dist/cli/commands/plan.js +58 -6
  15. package/dist/cli/commands/report.js +18 -45
  16. package/dist/cli/commands/run.js +3 -0
  17. package/dist/cli/commands/scope.js +36 -6
  18. package/dist/cli/commands/stats.d.ts +2 -0
  19. package/dist/cli/commands/stats.js +42 -23
  20. package/dist/cli/commands/status.js +20 -4
  21. package/dist/cli/commands/ui.js +42 -53
  22. package/dist/cli/commands/unlock.d.ts +1 -1
  23. package/dist/cli/commands/unlock.js +59 -9
  24. package/dist/cli/help.d.ts +219 -0
  25. package/dist/cli/help.js +212 -0
  26. package/dist/cli/index.d.ts +42 -2
  27. package/dist/cli/index.js +23 -8
  28. package/dist/drivers/herdr.d.ts +7 -2
  29. package/dist/drivers/herdr.js +78 -48
  30. package/dist/drivers/orca.d.ts +3 -2
  31. package/dist/drivers/orca.js +43 -4
  32. package/dist/drivers/subprocess.d.ts +1 -0
  33. package/dist/drivers/subprocess.js +3 -0
  34. package/dist/drivers/types.d.ts +14 -0
  35. package/dist/gates/artifact-manifest.d.ts +50 -0
  36. package/dist/gates/artifact-manifest.js +23 -0
  37. package/dist/gates/llm.d.ts +5 -0
  38. package/dist/gates/llm.js +188 -3
  39. package/dist/gates/review.d.ts +6 -3
  40. package/dist/gates/review.js +79 -33
  41. package/dist/gates/run-gates.d.ts +3 -0
  42. package/dist/gates/run-gates.js +14 -4
  43. package/dist/plan/scope.d.ts +25 -0
  44. package/dist/plan/scope.js +92 -12
  45. package/dist/report/operator-record.d.ts +49 -0
  46. package/dist/report/operator-record.js +137 -0
  47. package/dist/run/daemon.d.ts +5 -5
  48. package/dist/run/daemon.js +166 -44
  49. package/dist/run/lock.d.ts +59 -2
  50. package/dist/run/lock.js +184 -26
  51. package/dist/run/operator-state.d.ts +86 -0
  52. package/dist/run/operator-state.js +165 -0
  53. package/dist/run/supervision.d.ts +32 -0
  54. package/dist/run/supervision.js +138 -17
  55. package/dist/tui/cockpit/capture.d.ts +19 -0
  56. package/dist/tui/cockpit/capture.js +89 -1
  57. package/dist/tui/cockpit/components.d.ts +15 -1
  58. package/dist/tui/cockpit/components.js +79 -9
  59. package/dist/tui/cockpit/decision-actions.d.ts +147 -0
  60. package/dist/tui/cockpit/decision-actions.js +315 -0
  61. package/dist/tui/cockpit/derive.d.ts +1 -1
  62. package/dist/tui/cockpit/derive.js +2 -0
  63. package/dist/tui/cockpit/evidence-view.d.ts +119 -0
  64. package/dist/tui/cockpit/evidence-view.js +210 -0
  65. package/dist/tui/cockpit/home-view.d.ts +88 -0
  66. package/dist/tui/cockpit/home-view.js +240 -0
  67. package/dist/tui/cockpit/keys.d.ts +125 -0
  68. package/dist/tui/cockpit/keys.js +31 -0
  69. package/dist/tui/cockpit/layout.d.ts +14 -0
  70. package/dist/tui/cockpit/layout.js +15 -0
  71. package/dist/tui/cockpit/live-runtime.d.ts +46 -0
  72. package/dist/tui/cockpit/live-runtime.js +683 -0
  73. package/dist/tui/cockpit/live-store.d.ts +289 -0
  74. package/dist/tui/cockpit/live-store.js +308 -0
  75. package/dist/tui/cockpit/live.d.ts +21 -1
  76. package/dist/tui/cockpit/live.js +12 -1
  77. package/dist/tui/cockpit/run-view.d.ts +100 -0
  78. package/dist/tui/cockpit/run-view.js +202 -0
  79. package/dist/tui/cockpit/shell.d.ts +50 -0
  80. package/dist/tui/cockpit/shell.js +74 -0
  81. package/dist/tui/cockpit/theme.d.ts +27 -0
  82. package/dist/tui/cockpit/theme.js +21 -0
  83. package/dist/tui/ink/init-app.d.ts +4 -0
  84. package/dist/tui/ink/init-app.js +18 -7
  85. package/package.json +1 -1
  86. package/skills/tickmarkr-auto/SKILL.md +10 -1
  87. package/skills/tickmarkr-loop/SKILL.md +72 -1
  88. package/skills/tickmarkr-overseer/SKILL.md +12 -0
  89. package/skills/tickmarkr-overseer/scripts/watch-context.sh +13 -2
@@ -90,4 +90,75 @@ When spawning consultants (agents gathering synthesis input for decisions like S
90
90
  3. **Plan** — run `tickmarkr plan`. Review the routing table, capability-floor warnings, and every human gate, including work that each gate blocks.
91
91
  4. **Run** — run `tickmarkr run`. Watch the run journal for its terminal events rather than polling agents, using the shipped watcher — `.claude/skills/tickmarkr-overseer/scripts/watch-journal.sh <state-dir>/runs 20 28800` — which takes a line baseline at arm time, then wakes ONCE on `run-end`, `task-human`, `task-failed` or `consult-verdict` and grades the run-end summary against every green clause for you. Re-arm after every wake. ⛔ Never `tail -F | grep -m1` (run-end is the journal's last line, so tail never notices the broken pipe and the watcher hangs forever) and never a pane-level done wait (it fires on every agent turn end, not mission end). ⚠ A bare whole-file `grep -q '"event":"run-end"'` is the trap the watcher exists to avoid: on a resume it matches the PREVIOUS run's run-end and returns instantly, so a re-armed watcher reads as coverage that does not exist. Resolve blocked interactions in the agent session; do not turn them into proxy questions.
92
92
  5. **Verify and consolidate** — accept only a green run. A run is green when the run-end event exists in the journal, the tip verify is not "failed", and the summary's `failed`, `human`, `blocked` and `pending` buckets are all empty — a run with a parked task is partial, not green. Tickmarkr consolidates accepted task work on `tickmarkr/<runId>`; it never signs off to the main branch. A human may later merge that integration branch through the repository's normal release process.
93
- 6. **Record** — write `tickmarkr report <runId> --md` beside the source spec and commit the execution record when the repository tracks those records. Then [stand down](#stand-down-mission-end-and-retirement).
93
+ 6. **Record** — `tickmarkr report <runId> --md` prints Markdown to stdout. Redirect it explicitly beside the source spec (for example `tickmarkr report <runId> --md > feature.record.md`) and commit the execution record when the repository tracks those records. Then [stand down](#stand-down-mission-end-and-retirement).
94
+
95
+ ## Cockpit, parked decisions and printed twins
96
+
97
+ The shipped cockpit is **1 Home, 4 Run, 5 Evidence**: `tickmarkr ui [runId]` defaults to
98
+ Home on the latest journal, or empty Home with no run. `tickmarkr ui <runId> --view run`
99
+ and `--view evidence` select delivered views; `tickmarkr ui --setup <runId>` opens Run
100
+ Parks for that run. Fleet/Bootstrap and Plan/Health are follow-ons; keys 2/3/6 are not
101
+ installed. Continue using `fleet`, `init`, `plan` and `doctor` as CLI workflows.
102
+
103
+ Walk the recorded partial-human-park case before declaring green: **1/3 merged**, human
104
+ T2, blocked T3, tip passed is **PARTIAL**. T2 is a `humanGate: true` park before dispatch.
105
+ In Run select T2, press `a` Actions, choose Approve with Enter, then read the confirmation's
106
+ run/task, original park `#L`, actor/reason, exact argv, consequence and enactor. Only `y`
107
+ confirms; `n`/Esc cancel; Enter never confirms. Read the receipt's appended `task-approved`
108
+ line and actor/reason back from the journal. Approval records permission, never dispatch,
109
+ a passed gate or task completion. With no live owner it says **approved; resume required**:
110
+ exit the observer and run `tickmarkr resume <runId>` explicitly. A matching live daemon
111
+ enacts at its next task boundary; if a different live run owns the repository lock, wait
112
+ for that run to end before resuming this one.
113
+
114
+ For a non-TTY decision, the same command is
115
+ `tickmarkr approve <runId> T2 --by operator --reason 'ready to proceed'`; check its receipt
116
+ and explicitly resume. Preserve resume refusals and repair the named source/config issue
117
+ (including deny/prefer conflicts); never edit the compiled graph to force a result. Resume
118
+ makes CURRENT TIP PENDING; historical GATES RAN does not prove completion. The completed
119
+ case has 3/3 recorded merges, a latest run-end, a nonfailed known tip result and empty
120
+ `failed`, `human`, `blocked`, `pending` buckets. A mismatched graph is “not comparable.”
121
+
122
+ Run offers only validated park verbs: human/attempt-cap/other non-gate parks allow approve;
123
+ infra allows approve or `--recheck`; review gate-fail allows `--waive`, `--uphold` or
124
+ `--recheck`; other gate-fail allows waive/recheck. Waive satisfies only the identified
125
+ failed gate, uphold funds a fixed attempt carrying review findings, and recheck reruns the
126
+ declared battery without satisfying a gate. Attempt-cap approval resets the budget while
127
+ retaining routing exclusions. Tombstones and failures without identified gate evidence
128
+ are diagnostic-only. Decisions cannot be undone; stale or duplicate decisions refuse.
129
+
130
+ Use `tickmarkr status <runId>` and `tickmarkr status <runId> --oneline` for preserved
131
+ snapshots. `tickmarkr status <runId> --watch` opens Run on a TTY and uses line output on
132
+ non-TTY; `--watch --plain` keeps the line/ANSI fallback even on a TTY. `--watch --events`
133
+ replays and follows projected decision JSON documents on stdout; `--jsonl` and
134
+ `--decision-events` are aliases. Keep stderr keepalives separate, never `2>&1`; raw
135
+ `journal.jsonl` remains distinct. Webhooks require explicit opt-in. `report` retains text,
136
+ learning preview and comparison warnings; `report --md` stays stdout, `--compare
137
+ <baseline-runId>` compares records, `--bundle <path>` writes a proof bundle, and `stats`
138
+ reports all runs without a run ID. Keep `fleet --print` and `fleet --why` separate.
139
+ Absent usage/cost evidence remains “not measurable.”
140
+
141
+ Manual UI keeps a receipt at run-end and observes a later resume of that same run. The
142
+ daemon-owned board by default gracefully stops its own watch presence before closing its owned pane;
143
+ unconfirmed cleanup is reported; `visibility.keepPanes: forever` preserves panes. It preserves Herdr grouping, short titles and placement
144
+ beside the caller without taking focus. `q`, Ctrl-C and SIGTERM restore raw/pointer/title/
145
+ alternate-screen state and release only this observer's presence. `?` opens shortcuts,
146
+ Tab/Shift-Tab traverse visible focus, and Esc closes the deepest overlay. Text input keeps
147
+ `q1?` literal. Evidence retains original `#L` pointers and full verdict paging with stable
148
+ selection while Follow is off; Run's `o` focuses only a verified owned pane, otherwise
149
+ showing its evidence diagnostic. Missing historical reviewer-floor metadata stays unknown.
150
+
151
+ For inert guidance use `tickmarkr ui --help`, `tickmarkr eval --help`,
152
+ `tickmarkr unlock --help` and `tickmarkr profile reset --help`. Before `--`, help returns
153
+ without UI/probes/writes; after `--`, arguments are literal data. Displayed examples do
154
+ not execute. Recovery uses `unlock <runId>` for a matching dead lock or `unlock --garbage`
155
+ for malformed bytes, with confirmation (`--yes` for non-TTY) and identity recheck; live,
156
+ inaccessible or changed holders refuse. `doctor --cached`, `--probe-preflight`,
157
+ `--fix-only` and `--refresh-catalog` distinguish cached reads, budget disclosure, local
158
+ repair and catalog refresh; default doctor and `--fix` still probe. `scope <intent-file>
159
+ --preview` performs no probes, model calls or writes; authoring requires confirmation or
160
+ `--yes`. These actions remain CLI entries until their follow-on views ship.
161
+
162
+ Keep this skill's canonical identity `tickmarkr-loop`; sibling skills link to this
163
+ walkthrough. In this repository `skills/` is canonical and installed `.claude/skills/`
164
+ files resolve to it; change the canonical source, never create a second help skill.
@@ -12,6 +12,18 @@ to the user with evidence.
12
12
  The mission is the skill argument. If empty, ask the user what to run end-to-end before doing anything else.
13
13
  Requires `HERDR_ENV=1`; if unset, say so and stop.
14
14
 
15
+ Use the canonical loop skill's [cockpit, parked decisions and printed twins](../tickmarkr-loop/SKILL.md#cockpit-parked-decisions-and-printed-twins)
16
+ when reading or relaying operator evidence. Delivered views are **1 Home, 4 Run, 5 Evidence**;
17
+ Fleet/Bootstrap and Plan/Health remain follow-ons with existing CLI entries. A recorded
18
+ 1/3 merged, human T2, blocked T3 run is PARTIAL despite tip pass. The orchestrator owns
19
+ the Run confirmation and read-back of the appended `task-approved` receipt after a ruling;
20
+ permission is not dispatch, and a closed run needs explicit `tickmarkr resume <runId>`.
21
+ Manual UI retains the receipt; the daemon-owned board gracefully stands down only its own
22
+ presence before closing its owned pane. Non-TTY supervision keeps `status`, `report` and
23
+ default-watch line output (`--watch --plain` is also available on a TTY). Keep the canonical
24
+ `tickmarkr-overseer` identity and installed links to `skills/`; the linked walkthrough is
25
+ the shared guidance source, not a new help skill.
26
+
15
27
  **THE ENGINE IS THE DEFAULT EXECUTOR.** A mission that names a milestone, a phase, or a spec runs the
16
28
  loop: `tickmarkr compile` → `plan` → `run` → `report`, and the JOURNAL is the record. `compile` ingests
17
29
  GSD phase plans (`src/compile/gsd.ts`), so *"this repo uses GSD"* is not a reason to bypass it. The
@@ -212,19 +212,30 @@ banner_pct() {
212
212
  # The rule glyph is passed IN, never written as an escape: this host's awk (BWK 20200816) does not
213
213
  # honour \xNN, and an unsupported escape matches nothing — the selector would find no rule line and
214
214
  # report UNREADABLE on every real pane while staying green against any fixture that skipped awk.
215
+ # OBS-964 (2): a codex footer has NO rule line above it, so the rule selector is UNREADABLE for the whole
216
+ # life of a codex seat. Fall back to the self-labelled `Context N% used` row — the label IS the selector.
215
217
  banner=$(printf '%s\n' "$screen" | awk -v rule='─' '
216
218
  { line[NR] = $0
217
219
  bare = $0; gsub(/[[:space:]]/, "", bare)
218
220
  stripped = bare; gsub(rule, "", stripped)
219
221
  if (bare != "" && stripped == "") last = NR }
220
- END { if (last) for (i = last + 1; i <= NR; i++) if (line[i] ~ /[0-9]+%/) print line[i] }
222
+ END { labelled = 0
223
+ for (i = 1; i <= NR; i++) if (line[i] ~ /Context [0-9]+% used/) { print line[i]; labelled = 1 }
224
+ if (!labelled && last) for (i = last + 1; i <= NR; i++) if (line[i] ~ /[0-9]+%/) print line[i] }
221
225
  ' | tail -1)
222
226
  # No rule line in the window, or no percentage below it: say so out loud rather than guess.
223
227
  [ -n "$banner" ] || { printf 'UNREADABLE\n'; return 0; }
224
228
  printf '%s\n' "$banner" |
225
229
  grep -Eqi '(^|[^[:alnum:]])(claude|opus|sonnet|haiku|fable|gpt|gemini|glm|kimi|grok|composer|openai|zai)[[:alnum:]_./-]*([[:space:]]|$)' ||
226
230
  { printf 'UNREADABLE\n'; return 0; }
227
- pct=$(printf '%s\n' "$banner" | grep -oE '[0-9]+%' | tail -1 | tr -d '%')
231
+ # OBS-964: a codex banner carries TWO percentages ("Context 16% used · weekly 96% left"); the LAST one is the
232
+ # quota, not the fill. Prefer the labelled context figure; fall back to the last bare % (claude-code banner).
233
+ pct=$(printf '%s\n' "$banner" | grep -oE 'Context [0-9]+% used' | grep -oE '[0-9]+' | head -1)
234
+ # OBS-964 add.3: a codex footer while WORKING drops the labelled figure but keeps `weekly N% left`; strip the
235
+ # quota phrase before the bare-% fallback so a quota can never be read as fill.
236
+ [ -n "$pct" ] || pct=$(printf '%s\n' "$banner" | sed -E 's/weekly [0-9]+% left//g' | grep -oE '[0-9]+%' | tail -1 | tr -d '%')
237
+ # OBS-964 add.4: keep the row the number came from, so a false reading can be diagnosed from bytes.
238
+ printf '%s\t%s\n' "$(date -u +%H:%M:%SZ)" "$banner" >> "${TMPDIR:-/tmp}/tkr-watch-context-banner-$(printf '%s' "$TARGET" | tr -c 'A-Za-z0-9' _).log" 2>/dev/null || true
228
239
  [ -n "$pct" ] && printf '%s\n' "$pct" || printf 'UNREADABLE\n'
229
240
  }
230
241