@lumoai/cli 1.28.0 → 1.29.0

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.
@@ -1,225 +0,0 @@
1
- # Session Management
2
-
3
- ## Session Management
4
-
5
- ### Suggest-on-start from local git (no auto-bind)
6
-
7
- When a session starts **without** a bound task, the `session-start` hook tries to
8
- infer the task from local git so it can **suggest** one — it never binds for you
9
- (LUM-302):
10
-
11
- - It reads the **current branch name** first (e.g. `lumo/LUM-145-...`), then the
12
- **most recent commit subjects** (e.g. `... [LUM-145]`), extracting the first
13
- task identifier. Detection is **prefix-agnostic** (LUM-419): any team prefix
14
- matches — `SPEC-12` as much as `LUM-145` — using the same pattern the server
15
- uses to link PR branches to tasks. Well-known acronym-number tokens
16
- (`UTF-8`, `SHA-256`, `ISO-8601`, …) are skipped, never suggested.
17
- - On a hit it prints a single suggestion line and stops — the session stays
18
- **unbound** and no context is injected yet:
19
- `Detected LUM-145 (from branch name). Run lumo session attach LUM-145 to bind.`
20
- (the basis reads `from recent commits` when the hit came from commit subjects instead of the branch name)
21
- No task title is shown here because nothing was fetched; the title, memory,
22
- and PR-review todos appear only once you actually attach.
23
- - No match (detached HEAD, a branch with no identifier and no tagged commits,
24
- not a git repo) → it degrades to the normal unbound prompt.
25
-
26
- **Agent guidance:** when you see a suggestion line, confirm the inferred task is
27
- the one the user wants, then run `lumo session attach <LUM-N>` (followed by
28
- `lumo task context <LUM-N>` to load the background). `session attach` is the
29
- **only** path that binds — there is nothing to "undo" if the inference is wrong;
30
- just attach the correct task instead.
31
-
32
- ### Layer 2 project-memory review at session start
33
-
34
- When the session is bound, session-start may inject a **"🆕 Review needed: project memories auto-consolidated by the previous session"** section alongside the memory / PR-review blocks (LUM-165). It lists the **PROJECT-scope** memories that the member's **immediately-preceding session** auto-consolidated (Layer 2 runs asynchronously when a task is marked `done`). Each item shows its `id`.
35
-
36
- - **Why it's here:** Layer 2 promotions land async, so they can't be reviewed in the synchronous `session wrap` panel — they're surfaced at the _next_ session-start instead, when they've definitely landed.
37
- - **Show-once:** the section appears only at the session that immediately follows the one that produced the memories. It does **not** re-nag on later sessions, so act on it now or it scrolls off.
38
- - **Agent guidance:** briefly sanity-check each listed memory against the codebase/context. If one is wrong or over-generalized, remove it with `lumo memory rm <id> --yes` (ideally confirm with the user first). If they all look right, ignore the section and continue.
39
-
40
- Attribution requires the CC session id to reach the server: `lumo task update <id> --status done` automatically sends `CLAUDE_CODE_SESSION_ID` (via an `X-Lumo-Session-Id` header) so the resulting Layer 2 memories are attributed to the session. Marking a task done from the **web UI** leaves them unattributed (they won't surface for review) — that's expected.
41
-
42
- ### Blocker alert injected at `session attach` / session-start
43
-
44
- When the bound task has live blockers or SUGGESTED dependency candidates, the attach output and session-start hook context inject a dependency warning block. The warning is built by `buildBlockerWarningSectionForTask` and is **omitted entirely** (empty string) when nothing is actionable — no output appears when there are no live blockers and no SUGGESTED candidates.
45
-
46
- **Trigger conditions (OR — either or both may appear):**
47
- 1. At least one CONFIRMED "blocked by" edge where the blocking task's status is not DONE.
48
- 2. At least one SUGGESTED (unconfirmed) dependency candidate on the task.
49
-
50
- **Output form A — live blockers exist (with or without SUGGESTED candidates):**
51
-
52
- Starts with the `## ⚠ Dependency alerts` header, followed by one line per live blocker, then the advice line. If there are also SUGGESTED candidates the candidate-hint line is appended after the advice line.
53
-
54
- ```
55
- ## ⚠ Dependency alerts
56
-
57
- - This task is blocked by LUM-9 "Fix auth token expiry" (status IN_PROGRESS).
58
- - This task is blocked by LUM-15 "Upgrade Postgres driver" (status IN_REVIEW, PR #42 not merged).
59
-
60
- Consider waiting for the blocker(s) to merge before starting work to avoid a wasted run; if an edge is stale, clean it up with `lumo task deps rm/dismiss`.
61
- Detected 3 candidate dependencies awaiting confirmation: run `lumo task deps list LUM-42`.
62
- ```
63
-
64
- **Output form B — NO live blockers, but SUGGESTED candidates exist:**
65
-
66
- Output is **only** the hint line — no `## ⚠ Dependency alerts` header, no advice line. Design rationale: pure candidates are a hint, not an alert — they don't get the ⚠ header, so real alerts aren't diluted.
67
-
68
- ```
69
- Detected 3 candidate dependencies awaiting confirmation: run `lumo task deps list LUM-42`.
70
- ```
71
-
72
- - Each blocker line shows: identifier, title, current status. If the blocking task has an open pull request, a `, PR #N not merged` note is appended — `, PR #N (draft) not merged` for draft PRs.
73
- - The guidance line ("Consider waiting for the blocker(s) to merge…") appears only when there is at least one live blocker (form A).
74
- - The function never throws — if it fails it silently returns an empty string, leaving the session start unaffected.
75
-
76
- **Agent guidance — watch for EITHER the `## ⚠ Dependency alerts` header (form A) OR the standalone hint line (form B):**
77
- - **Form A — live blockers:** Evaluate whether to wait. If the blocking task's work overlaps with yours (same files, same API surface), starting immediately risks rework. Read the blocker's status and open PR note before deciding.
78
- - **Stale or wrong edge?** Run `lumo task deps list <LUM-N>` to inspect the full edge list, then `lumo task deps rm <LUM-N> <edge> --yes` (if manually added and now obsolete) or `lumo task deps dismiss <LUM-N> <edge>` (if a false positive from detection).
79
- - **Candidate hint present (form A or B)?** Run `lumo task deps list <LUM-N>` and review each SUGGESTED edge — confirm real ones, dismiss false positives. Leaving SUGGESTED edges unreviewed means repeated hints every session.
80
- - Do **not** blindly start work on a task whose live blocker is still IN_PROGRESS or IN_REVIEW unless the user explicitly decides to proceed in parallel.
81
-
82
- ### `lumo session attach <identifier>` — bind the current session to a task
83
-
84
- Use this whenever the user mentions a task ID. The command is the only way to bind a session to a task.
85
-
86
- ```bash
87
- lumo session attach LUM-42
88
- ```
89
-
90
- What it does:
91
-
92
- - Reads `CLAUDE_CODE_SESSION_ID` from the environment (Claude Code sets this automatically). If it is not set, the command errors out — it must run from inside a Claude Code session.
93
- - Calls `POST /api/sessions/<session_id>/bind-task` on the Lumo server, which sets the Session row's `taskId` and re-tags previously-untagged HookEvent rows in this session.
94
- - The binding lives entirely on the server (`Session.taskId`); subsequent hooks read it back via the session row. The CLI keeps no local sentinel.
95
-
96
- - Prints the task's **acceptance contract** (`## Acceptance criteria (contract)`, LUM-342) right after the bind confirmation — or, when a still-open task has none, the draft reminder telling you to draft 3–7 criteria before the first line of code (see [criteria.md](criteria.md)). The same section is auto-injected at session start when the session is already bound (highest priority in the injection budget, ahead of memory).
97
-
98
- **After attaching, always run `lumo task context <identifier>` to load the task background.**
99
-
100
- #### Overwriting an existing binding (LUM-266)
101
-
102
- Re-attaching a session that's already bound to a **different** task no longer silently clobbers the binding. The server returns the current binding instead of overwriting, and the CLI decides what to do:
103
-
104
- - **On a TTY** (a human running it directly): prompts `Already bound to LUM-X. Rebind to LUM-Y? [y/N]`. Answering `y`/`yes` re-binds to `LUM-Y`; anything else (including bare Enter) cancels and leaves `LUM-X` bound.
105
- - **Off a TTY** (the usual agent case — `stdin` is not interactive): the command **refuses** and prints `Session already bound to LUM-X … Re-run with --force …` without overwriting. Exit code is `0` (a safe refusal, not an error).
106
- - **`--force`**: skips the prompt/refusal and overwrites unconditionally. Re-attaching to the **same** task is always a no-op re-bind (never prompts).
107
-
108
- ```bash
109
- lumo session attach LUM-42 # already on LUM-7 → prompts (TTY) / refuses (agent)
110
- lumo session attach LUM-42 --force # overwrite without confirmation
111
- ```
112
-
113
- **Agent guidance:** when `session attach` reports the session is already bound to a different task, **ask the user** whether to switch before re-running with `--force`. Don't auto-`--force` — the existing binding may be intentional (e.g. a manual attach the user ran earlier). Alternatively run `lumo session detach` first, then a clean `session attach`.
114
-
115
- ### Parallel sessions
116
-
117
- Each Claude Code session has its own `CLAUDE_CODE_SESSION_ID`. Two terminals running `claude code` and binding to different tasks will not interfere with each other — the bindings are scoped per session row server-side.
118
-
119
- ### `lumo session status` — show current binding
120
-
121
- Prints which task the current Claude Code session is bound to, or "(no task)" if none. Requires `$CLAUDE_CODE_SESSION_ID` (i.e. must run inside Claude Code).
122
-
123
- ```bash
124
- lumo session status
125
- ```
126
-
127
- When to suggest: the user asks "which task am I on", "what's this session bound to", or you need to decide whether to suggest `session attach` for a mentioned task ID.
128
-
129
- ### `lumo session detach` — clear the current binding
130
-
131
- Idempotent — running it twice is fine, the second call reports `already unbound`. Past hook events keep their original `taskId`; only future events on this session will be untagged.
132
-
133
- ```bash
134
- lumo session detach
135
- ```
136
-
137
- When to suggest: the user wants to stop tagging the current session with the active task (e.g., switching to unrelated exploratory work without binding to a different task).
138
-
139
- ### `lumo session wrap [--yes] [--dry-run] [--used <indices>]` — wrap-up panel: progress comment + memory review + fragment-usage vote + blocked-tag prompt
140
-
141
- Session-end wrap-up panel with **four sections, run in order**:
142
-
143
- **1. Progress comment** — reads back the current Claude Code session's per-turn
144
- `turnSummary` rows (the one-line summaries written each STOP), aggregates
145
- every turn **since the last progress comment** into one bulleted body, and — after
146
- a `[y] post / [e] edit / [s] skip` confirmation — posts it as a comment on the
147
- session's bound task. A server-side watermark (`Session.lastProgressCommentAt`)
148
- means re-running never re-posts the same turns.
149
-
150
- **2. Memory review** — lists the Layer1 memories this session sedimented since the
151
- last review (deduped by a per-session watermark `Session.lastMemoryReviewAt`).
152
- Each new memory is shown as `[SCOPE] CATEGORY headline`, numbered from 1. You
153
- curate with a single line: `d 1,3` deletes rows 1 and 3, `p 2` promotes row 2 to
154
- project scope, and they combine (`d 1,3 p 2`). **Enter (empty) keeps all**; `s`
155
- skips the section. Keeping all (Enter or `--yes`) still **advances the watermark**
156
- so the next wrap won't re-list reviewed memories; `s` leaves them for next time.
157
- Out-of-range indices are ignored. Deletes/promotes run server-side, scoped to
158
- memories this session created (you can't touch other sessions' memories through
159
- this panel). With no new memories the section prints "(no content)" and does nothing.
160
-
161
- **3. Fragment-usage vote (LUM-300)** — lists the context
162
- fragments this session **consumed** (its lineage edges: memory / slack / web /
163
- figma / PR / review-todo / session), numbered from 1 with a content snippet
164
- label. The agent records which it **actually used** via
165
- `lumo session wrap --used <indices>` (1-based, comma/space separated; `--used
166
- none` = used nothing). Voted fragments get `used=true`, the rest of the
167
- session's fragments `used=false`. **Without `--used` the section only lists the
168
- candidates and writes nothing** (edges stay `null` = not voted — honest, not
169
- "unused"). A session that already voted (`usedAt` set) is skipped. **Why:** it
170
- upgrades the flywheel signal from "co-loaded" (constant, no information) to
171
- "actually used" (varies → discriminative); `task context` then prefers each
172
- fragment's usage-based merge rate, falling back to the weaker presence rate when
173
- usage samples are thin. With no consumed fragments the section prints "(no content)".
174
-
175
- **4. Blocked check (blocked-tag prompt, LUM-153)** — if the **same kind of failure
176
- recurred ≥ 3 times** in this session (server-aggregated from
177
- `POST_TOOL_USE_FAILURE` events grouped by tool name, plus `STOP_FAILURE`
178
- turn-level failures), the section surfaces the dominant failure (`This session looks repeatedly stuck on <tool> (N failures).` + last error summary) and prompts `[y] tag / [s] skip` whether to
179
- flag the bound task with a **`blocked` tag**. **Prompt-only — never auto-flips
180
- status.** It uses a plain tag (no `TaskStatus` enum, no board column, **no
181
- schema migration**). The prompt is **suppressed** when: there's no bound task,
182
- the threshold isn't met, or the task **already** carries a `blocked` tag (the
183
- idempotent gate — there's no watermark, the existing tag is what prevents
184
- re-nagging). The default on empty input / `s` is **do nothing** (tagging is
185
- opt-in), so a stray Enter never tags the task. Confirming with an explicit `y`
186
- attaches the tag idempotently. **`--yes` does NOT auto-tag** — tagging the
187
- shared board requires an interactive `y`, so `--yes` (and non-TTY) prints the
188
- suggestion and moves on rather than silently flipping board state. When there's
189
- nothing to prompt, the section prints "(no content)".
190
-
191
- ```bash
192
- lumo session wrap # interactive: preview each section, choose per-section
193
- lumo session wrap --yes # progress posted + memories kept; blocked tag NOT auto-applied (needs interactive y)
194
- lumo session wrap --yes --used 1,3 # also record fragments 1 & 3 as used (the rest used=false)
195
- lumo session wrap --used none # record that none of the injected fragments were used
196
- lumo session wrap --dry-run # print all drafts only; never posts, never mutates, never advances watermarks
197
- ```
198
-
199
- The usage vote is a two-step flow for agents: run `lumo session wrap` once to
200
- see the numbered fragment list, decide which you actually used, then re-run with
201
- `--used <indices>`. Re-running is safe — the other sections are watermark-guarded
202
- (progress won't double-post, reviewed memories won't re-list).
203
-
204
- - Requires `$CLAUDE_CODE_SESSION_ID` (must run inside Claude Code) and a bound
205
- task (`lumo session attach <LUM-N>` first). With no bound task or no new turn
206
- summaries, the Progress comment section prints "(no content)" and posts nothing.
207
- - `[e] edit` (Progress comment) opens `$EDITOR` (fallback vi/nano) on the drafted body;
208
- the edited text is posted and the watermark still advances to the turns the
209
- draft covered.
210
- - `--yes` posts the progress comment AND keeps all memories (no
211
- deletes/promotes) while advancing the memory-review watermark; for the
212
- blocked-tag section it prints the suggestion but does **not** apply the tag.
213
- - `--dry-run` prints all drafts; never posts, never mutates memories/tags, never
214
- advances either watermark.
215
- - Non-TTY without `--yes`: prints the drafts and does **not** post, mutate, or
216
- tag (safe default).
217
-
218
- When to suggest: at the end of a working session on a bound task, to record what
219
- was done as a progress comment — offer `lumo session wrap` rather than composing
220
- a `task comment` by hand.
221
-
222
- ### When to suggest session binding
223
-
224
- - If the user mentions a task ID (e.g., "let's work on LUM-42") and no session is currently bound, **suggest running `lumo session attach`**.
225
- - If the user switches tasks mid-session, run `attach` with the new task ID — the server overwrites the existing binding atomically.
@@ -1,157 +0,0 @@
1
- # Sprint Management
2
-
3
- ## Sprint Management
4
-
5
- ### `lumo sprint list [flags]` — list sprints in a team
6
-
7
- Prints fixed-width rows: `<NUMBER> <STATUS> <start> <end> <name>`, sorted newest-first (server sort).
8
-
9
- | Flag | Type | Notes |
10
- | ---------------------- | ------- | ----------------------------------------------------- |
11
- | `--team <ref>` | string | Team name or slug. Required in multi-team workspaces. |
12
- | `-s, --status <value>` | enum | `draft \| active \| closed`. |
13
- | `-n, --limit <count>` | integer | Cap output to the first N rows. |
14
-
15
- ```bash
16
- lumo sprint list
17
- lumo sprint list --status active
18
- lumo sprint list --team backend --limit 5
19
- ```
20
-
21
- When to suggest: user asks "what sprints do we have", "which sprint is active", "list sprints", "show me the current sprint", "active sprints".
22
-
23
- ### `lumo sprint create [flags]` — create a sprint
24
-
25
- | Flag | Type | Notes |
26
- | ---------------- | ------ | ----------------------------------------------------- |
27
- | `--team <ref>` | string | Team name or slug. Required in multi-team workspaces. |
28
- | `--start <date>` | string | **Required.** YYYY-MM-DD. |
29
- | `--end <date>` | string | **Required.** YYYY-MM-DD. |
30
- | `-n, --name <>` | string | Optional. Server fills a default name when omitted. |
31
-
32
- ```bash
33
- lumo sprint create --start 2026-06-01 --end 2026-06-14
34
- lumo sprint create --name "Sprint 4" --start 2026-06-01 --end 2026-06-14 --team backend
35
- ```
36
-
37
- On success: `Created sprint #<number> "<name>" <id>`.
38
-
39
- When to suggest: user says "create a sprint", "new sprint", "start a new iteration".
40
-
41
- ### `lumo sprint show <identifier> [--team <ref>]` — show sprint detail + task table
42
-
43
- `<identifier>` accepts a sprint number (e.g. `3`) or a UUID. `--team` is required when using a number in a multi-team workspace.
44
-
45
- Output: key:value header (number, name, status, dates, team), then a `Progress:` line, then a **`Health:` line** with the sprint's risk level (`HEALTHY` / `WATCH` / `AT-RISK`), then a task table listing every task in the sprint.
46
-
47
- The risk level reuses the same engine as project/workspace stats, fed the sprint's task set (thresholds come from the workspace risk config — sprints have no per-sprint overrides). When the engine flags reasons they print as `- <detail>` lines under `Health:`, and a `Blockers:` section lists the top offenders per category (`Overdue` / `Stalled` / `Agent fail` / `Stale PRs`). A healthy sprint with no blockers shows just the `Health:` line.
48
-
49
- ```
50
- Progress: 4 / 10
51
- Health: AT-RISK
52
- - 4/10 tasks overdue (40%)
53
- - 3 tasks with no progress in 7 days
54
- Blockers:
55
- Overdue: LUM-1 Fix login, LUM-8 Wire API
56
- Stalled: LUM-5 Add tests
57
- Stale PRs: #12, #15
58
- ```
59
-
60
- ```bash
61
- lumo sprint show 3
62
- lumo sprint show 3 --team backend
63
- lumo sprint show 11111111-2222-3333-4444-555555555555
64
- ```
65
-
66
- When to suggest: user asks "what's in sprint 3", "show me the current sprint", "what tasks are in this sprint", "is this sprint at risk", "sprint health".
67
-
68
- ### `lumo sprint update <identifier> [flags]` — patch a sprint
69
-
70
- Updates sprint metadata. At least one flag required. **No `--status` flag** — use `lumo sprint start` / `lumo sprint close` to transition status.
71
-
72
- | Flag | Type | Notes |
73
- | ---------------- | ------ | --------------------------------------------------------------- |
74
- | `--team <ref>` | string | Required when identifier is a number in a multi-team workspace. |
75
- | `-n, --name <>` | string | New name. Cannot be empty. |
76
- | `--start <date>` | string | YYYY-MM-DD. `--start ""` clears. |
77
- | `--end <date>` | string | YYYY-MM-DD. `--end ""` clears. |
78
-
79
- ```bash
80
- lumo sprint update 3 --name "Sprint 4 (extended)"
81
- lumo sprint update 3 --end 2026-06-21
82
- ```
83
-
84
- When to suggest: user wants to rename a sprint, extend dates, or fix sprint metadata.
85
-
86
- ### `lumo sprint delete <identifier> --yes` — delete a sprint (DRAFT only)
87
-
88
- Requires `--yes`; no interactive prompt (agent-friendly). Server rejects with an error if the sprint is ACTIVE or CLOSED.
89
-
90
- ```bash
91
- lumo sprint delete 3 --yes
92
- ```
93
-
94
- When to suggest: user wants to remove a draft sprint that was created by mistake.
95
-
96
- ### `lumo sprint start <identifier>` — transition DRAFT → ACTIVE
97
-
98
- No additional flags. Fails if the sprint is already ACTIVE or CLOSED.
99
-
100
- ```bash
101
- lumo sprint start 3
102
- ```
103
-
104
- When to suggest: user says "start the sprint", "kick off sprint 3", "activate sprint".
105
-
106
- ### `lumo sprint close <identifier> [flags]` — transition ACTIVE → CLOSED
107
-
108
- Handles unfinished tasks based on flags. Without flags: closes only if all tasks are done; otherwise prints a list of unfinished tasks and refuses.
109
-
110
- | Flag | Type | Notes |
111
- | --------------- | ------- | -------------------------------------------------------------------------------- |
112
- | `--move-all` | boolean | Move all unfinished tasks to the next sprint. Requires `--yes`. |
113
- | `--backlog-all` | boolean | Remove all unfinished tasks from the sprint (send to backlog). Requires `--yes`. |
114
- | `--yes` | boolean | Required when `--move-all` or `--backlog-all` is given. |
115
-
116
- ```bash
117
- lumo sprint close 3 # fails if unfinished tasks exist
118
- lumo sprint close 3 --move-all --yes # move unfinished to next sprint
119
- lumo sprint close 3 --backlog-all --yes # send unfinished to backlog
120
- ```
121
-
122
- When to suggest: user says "close the sprint", "end sprint 3", "wrap up the sprint". If they haven't decided what to do with unfinished tasks, ask before adding `--move-all` or `--backlog-all`.
123
-
124
- ### `lumo sprint summary <identifier> [--retry]` — fetch AI-generated sprint retro
125
-
126
- Prints the AI-generated retrospective summary for the sprint. A 404 response means no summary has been generated yet ("no summary yet").
127
-
128
- | Flag | Type | Notes |
129
- | --------- | ------- | ------------------------------------------------- |
130
- | `--retry` | boolean | Queue a regeneration (async, server returns 202). |
131
-
132
- ```bash
133
- lumo sprint summary 3
134
- lumo sprint summary 3 --retry
135
- ```
136
-
137
- When to suggest: user asks "summarize the sprint", "sprint retro", "give me a summary of sprint 3".
138
-
139
- ### `lumo sprint add <identifier> <task>` — bind a task to a sprint
140
-
141
- Adds `<task>` (e.g. `LUM-48`) to the sprint. Same-team check applies — the task's team must match the sprint's team.
142
-
143
- ```bash
144
- lumo sprint add 3 LUM-48
145
- ```
146
-
147
- When to suggest: user says "add LUM-48 to sprint 3", "put this task in the sprint".
148
-
149
- ### `lumo sprint remove <identifier> <task>` — unbind a task from a sprint
150
-
151
- Removes `<task>` from the sprint. Idempotent — if the task is not in the sprint, the server returns success.
152
-
153
- ```bash
154
- lumo sprint remove 3 LUM-48
155
- ```
156
-
157
- When to suggest: user says "remove LUM-48 from the sprint", "take this task out of sprint 3", "move task to backlog".
@@ -1,136 +0,0 @@
1
- # Task Context Loading & Context Retrieval
2
-
3
- ## Task Context Loading
4
-
5
- When the user mentions a task identifier or asks for task background, load the context:
6
-
7
- ```bash
8
- lumo task context <identifier>
9
- ```
10
-
11
- Example: `lumo task context LUM-42`
12
-
13
- ### Reading the output
14
-
15
- The command prints a markdown document to stdout containing:
16
-
17
- 1. **Task header** — identifier, title, status, description
18
- 2. **Acceptance criteria (contract)** — the task's acceptance criteria (LUM-342), shown right after the header as the `## Acceptance criteria (contract)` section. Each line: `[MACHINE|HUMAN] statement` with a `↳ check:` line for MACHINE checkpointers; HUMAN_EDIT / REVIEW_ADDED provenance is tagged inline. If a still-open task has none, a draft reminder appears instead — draft 3–7 criteria **before writing code** (see [criteria.md](criteria.md))
19
- 3. **Memory section** — cross-session learnings accumulated over prior sessions; treat as trusted background context
20
- 4. **Inline source cards** — Slack / web / Figma / artifacts / documents / comments / Pull Requests (see "Context Retrieval" below)
21
- 5. **PR review todos** — mirrored PR review comments as a checkbox todo list under the `## PR review todos` header: each line-level reviewer comment (shown as `` `file:line` `` + the reviewer's ask + a link to the GitHub comment) and each `changes_requested` review summary (shown as "🛑 Changes requested (whole PR)"). Present only when the task's PR(s) have review comments. This same block is **auto-injected at session start** (alongside the memory section) when the session is bound to a task — so reviewer asks surface without re-running `task context`.
22
- - The **inline source cards** (Slack / web / Figma / PR) are likewise **auto-injected at session start** when the session is bound, under a single global token budget shared with the memory section (priority: criteria > memory > PR > Slack > Figma > web). Cards that don't fit the budget are degraded to a one-line manifest carrying just the title and its `lumo task … show` retrieval command — so you still know they exist and can pull the full content on demand.
23
- 6. **Previous sessions** — ordered newest-first, each with:
24
- - A headline summary of what was done
25
- - Unresolved items (carry-over TODOs from that session)
26
- 7. **Flywheel signal · historical merge contribution** — appended at the very end as the `## Flywheel signal · historical merge contribution` section. For each context fragment with enough history, a one-line historical merge-contribution signal (e.g. `appeared in 5 resolved tasks · 4 merged (80%)`), computed from accumulated lineage edges. Denominator = distinct tasks where the fragment appeared with a resolved (non-UNKNOWN) outcome; only fragments with ≥3 such tasks are shown (cold-start gate), so the block is often absent early on. This is **historical correlation, not causation** — don't read it as a prediction.
27
-
28
- ### How to use the context
29
-
30
- - **Unresolved items** from the most recent session are the highest-priority carry-overs — address them before starting new work unless the user says otherwise
31
- - **PR review todos** items are reviewer-requested changes — treat each unchecked box as a TODO to resolve, then reply on the PR (a Lumo comment mirrors back to GitHub)
32
- - **Memory section** provides validated context that persists across sessions — use it to avoid re-learning decisions or constraints
33
- - Focus on the **most recent 1–2 sessions** for relevant state; older sessions are for historical reference only
34
- - If there are **no prior sessions**, this is a fresh start — read the task description carefully and ask clarifying questions if needed
35
-
36
- ## Context Retrieval (full text on demand)
37
-
38
- LUM-122 split task context injection into tiers. `lumo task context <LUM-N>`
39
- now emits a **cheap inline card** for each source — a short summary or just
40
- metadata — instead of dumping full bodies. Slack, docs, artifacts, and comments
41
- get an **LLM summary**; web links, Figma, and PRs get **metadata only**. Each
42
- card ends with the **retrieval command** you run to pull the heavy content on
43
- demand.
44
-
45
- **How to use it:** when the inline card is not enough and you need the full
46
- Slack thread, the web page body, the Figma metadata, the entire comment thread,
47
- or the PR detail — run the matching command below. Pass the same identifier
48
- (`LUM-N`) plus the id the card shows for that source (a Slack `contextId`, a web
49
- `linkId`, a Figma `linkId`, or a PR `number`).
50
-
51
- All five are **read-only** (no live Slack/GitHub/Figma calls except the web body
52
- fetch). Web/Figma/PR are v1 metadata-degraded: they print a `note:` explaining
53
- that live content needs an external integration.
54
-
55
- ### `lumo task slack show <identifier> <contextId>` — full Slack thread snapshot
56
-
57
- Prints the **stored** thread snapshot (no live Slack call), one line per message
58
- as `author: text`. Author falls back to `@<userId>` when the display name is
59
- missing. Empty snapshot prints `(no messages in stored snapshot)`.
60
-
61
- ```bash
62
- lumo task slack show LUM-42 ctx_abc123
63
- ```
64
-
65
- ### `lumo task web show <identifier> <linkId>` — fetched web link body
66
-
67
- Fetches the page body on demand behind the SSRF guard (cached after first read)
68
- and prints it as plain text. Empty body prints `(empty body)`. Fetch failures
69
- (blocked host, timeout) print the server's error message.
70
-
71
- ```bash
72
- lumo task web show LUM-42 wl_abc123
73
- ```
74
-
75
- ### `lumo task figma context <identifier> <linkId>` — Figma link metadata
76
-
77
- **v1 metadata fallback.** Prints the cached design metadata as `file:` /
78
- `frame:` / `url:` / `synced:` (and `syncError:` if the last sync failed) lines.
79
- Live design context (layers, variables, code connect) requires the Figma MCP
80
- server, so the command ends with a `note:` saying so.
81
-
82
- ```bash
83
- lumo task figma context LUM-42 cfl_abc123
84
- ```
85
-
86
- ### `lumo task comments list <identifier>` — full comment thread
87
-
88
- Prints the **entire** comment thread: each comment as `author · createdAt`
89
- followed by its plain-text body (comment bodies are stored as HTML and stripped
90
- to text). Replies are indented two spaces under their parent. Author falls back
91
- to `unknown`. No comments prints `(no comments)`.
92
-
93
- ```bash
94
- lumo task comments list LUM-42
95
- ```
96
-
97
- **Plural, and distinct from `task comment`.** `task comments list` _reads_ the
98
- whole thread (this retrieval command). `task comment <identifier> <body>`
99
- _writes_ a single new comment (see Task Management). Don't confuse the two —
100
- the plural `comments` is read-only.
101
-
102
- ### `lumo task pr show <identifier> <number>` — synced PR metadata
103
-
104
- **v1 metadata fallback.** Prints the synced PR record: a `#<number> (repo)
105
- title` header, then `state:` (with ` · draft` when draft), `ci:`, `author:`,
106
- `branch: <head> → <base>`, and `url:` lines. The live diff + review comments
107
- require the GitHub integration, so the command ends with a `note:` saying so.
108
-
109
- ```bash
110
- lumo task pr show LUM-42 128
111
- ```
112
-
113
- ## `lumo task lineage <id>`
114
-
115
- Read-only audit view over the task's `LineageEdge` rows. Given a task
116
- identifier (`LUM-N`), prints the causal trail:
117
-
118
- - **Totals banner** — distinct sessions, fragment count, edge count,
119
- total tokens (input/output/cache split) and loops, and the outcome
120
- distribution.
121
- - **One block per session** — the group's cost shown **once** (token/loop),
122
- the date it consumed context, then each context fragment as
123
- `[OUTCOME] TYPE — <source label>`, plus a per-group outcome summary.
124
-
125
- Cost is attributed once per session (a session that injected many fragments is
126
- not double-counted). Fragment ids are canonical — MEMORY fragments survive
127
- consolidation drift.
128
-
129
- **Cold start:** a task with no edges prints a friendly note (lineage is captured
130
- when a session-bound run consumes the task's context), not an error.
131
-
132
- **When to suggest:** the user wants to audit "what context did the AI actually
133
- use, and what did it cost" for a task / merged PR — CFO / compliance / trust
134
- narratives.
135
-
136
- Entry point is the task identifier only; PR-number lookup is a future addition.