@kynetic-ai/spec 0.5.0 → 0.7.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.
- package/dist/cli/commands/batch.d.ts.map +1 -1
- package/dist/cli/commands/batch.js +38 -6
- package/dist/cli/commands/batch.js.map +1 -1
- package/dist/cli/commands/item.d.ts.map +1 -1
- package/dist/cli/commands/item.js +42 -23
- package/dist/cli/commands/item.js.map +1 -1
- package/dist/cli/commands/ralph.d.ts.map +1 -1
- package/dist/cli/commands/ralph.js +15 -2
- package/dist/cli/commands/ralph.js.map +1 -1
- package/dist/cli/commands/session/checkpoint.d.ts +19 -0
- package/dist/cli/commands/session/checkpoint.d.ts.map +1 -0
- package/dist/cli/commands/session/checkpoint.js +161 -0
- package/dist/cli/commands/session/checkpoint.js.map +1 -0
- package/dist/cli/commands/session/commands.d.ts +18 -0
- package/dist/cli/commands/session/commands.d.ts.map +1 -0
- package/dist/cli/commands/session/commands.js +259 -0
- package/dist/cli/commands/session/commands.js.map +1 -0
- package/dist/cli/commands/session/context.d.ts +17 -0
- package/dist/cli/commands/session/context.d.ts.map +1 -0
- package/dist/cli/commands/session/context.js +493 -0
- package/dist/cli/commands/session/context.js.map +1 -0
- package/dist/cli/commands/session/create.d.ts +29 -0
- package/dist/cli/commands/session/create.d.ts.map +1 -0
- package/dist/cli/commands/session/create.js +147 -0
- package/dist/cli/commands/session/create.js.map +1 -0
- package/dist/cli/commands/session/format.d.ts +27 -0
- package/dist/cli/commands/session/format.d.ts.map +1 -0
- package/dist/cli/commands/session/format.js +401 -0
- package/dist/cli/commands/session/format.js.map +1 -0
- package/dist/cli/commands/session/index.d.ts +13 -0
- package/dist/cli/commands/session/index.d.ts.map +1 -0
- package/dist/cli/commands/session/index.js +17 -0
- package/dist/cli/commands/session/index.js.map +1 -0
- package/dist/cli/commands/session/log.d.ts +52 -0
- package/dist/cli/commands/session/log.d.ts.map +1 -0
- package/dist/cli/commands/session/log.js +570 -0
- package/dist/cli/commands/session/log.js.map +1 -0
- package/dist/cli/commands/session/types.d.ts +230 -0
- package/dist/cli/commands/session/types.d.ts.map +1 -0
- package/dist/cli/commands/session/types.js +7 -0
- package/dist/cli/commands/session/types.js.map +1 -0
- package/dist/cli/commands/session.d.ts +4 -251
- package/dist/cli/commands/session.d.ts.map +1 -1
- package/dist/cli/commands/session.js +6 -1870
- package/dist/cli/commands/session.js.map +1 -1
- package/dist/cli/commands/validate.d.ts.map +1 -1
- package/dist/cli/commands/validate.js +23 -7
- package/dist/cli/commands/validate.js.map +1 -1
- package/dist/parser/shadow.d.ts +5 -1
- package/dist/parser/shadow.d.ts.map +1 -1
- package/dist/parser/shadow.js +18 -10
- package/dist/parser/shadow.js.map +1 -1
- package/dist/parser/validate.d.ts +4 -1
- package/dist/parser/validate.d.ts.map +1 -1
- package/dist/parser/validate.js +50 -35
- package/dist/parser/validate.js.map +1 -1
- package/dist/sessions/store.d.ts +37 -1
- package/dist/sessions/store.d.ts.map +1 -1
- package/dist/sessions/store.js +133 -5
- package/dist/sessions/store.js.map +1 -1
- package/package.json +4 -1
- package/plugin/.claude-plugin/marketplace.json +1 -1
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/templates/agents-sections/03-task-lifecycle.md +4 -1
- package/templates/agents-sections/07-batch-usage.md +51 -0
|
@@ -0,0 +1,493 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session context data gathering.
|
|
3
|
+
*
|
|
4
|
+
* Loads and aggregates all data needed for session start output.
|
|
5
|
+
*/
|
|
6
|
+
import { getReadyTasks, loadAllItems, loadAllTasks, loadInboxItems, loadSessionContext, loadTriageRecords, ReferenceIndex, } from "../../../parser/index.js";
|
|
7
|
+
import { loadMetaContext } from "../../../parser/meta.js";
|
|
8
|
+
import { getCurrentBranch, getRecentCommits, getWorkingTreeStatus, isGitRepo, parseTimeSpec, } from "../../../utils/index.js";
|
|
9
|
+
import { isNoteSuperseded } from "../../output.js";
|
|
10
|
+
import { getDisplayRef } from "./format.js";
|
|
11
|
+
// ─── Mapper Functions ───────────────────────────────────────────────────────
|
|
12
|
+
/**
|
|
13
|
+
* Build a reverse dependency map: for each task ULID, count how many
|
|
14
|
+
* pending tasks depend on it. Unresolvable refs are silently skipped.
|
|
15
|
+
*/
|
|
16
|
+
function computeUnlocksMap(allTasks, index) {
|
|
17
|
+
const counts = new Map();
|
|
18
|
+
for (const task of allTasks) {
|
|
19
|
+
// Only count pending tasks as "unlockable" downstream work per spec
|
|
20
|
+
if (task.status !== "pending")
|
|
21
|
+
continue;
|
|
22
|
+
for (const depRef of task.depends_on) {
|
|
23
|
+
const result = index.resolve(depRef);
|
|
24
|
+
if (!result.ok)
|
|
25
|
+
continue; // AC: unresolvable refs silently skipped
|
|
26
|
+
const depUlid = result.item._ulid;
|
|
27
|
+
counts.set(depUlid, (counts.get(depUlid) || 0) + 1);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return counts;
|
|
31
|
+
}
|
|
32
|
+
function toActiveTaskSummary(task, index) {
|
|
33
|
+
const lastNote = task.notes.length > 0 ? task.notes[task.notes.length - 1] : null;
|
|
34
|
+
const incompleteTodos = task.todos.filter((t) => !t.done).length;
|
|
35
|
+
return {
|
|
36
|
+
ref: index.shortUlid(task._ulid),
|
|
37
|
+
slug: task.slugs.length > 0 ? task.slugs[0] : null,
|
|
38
|
+
title: task.title,
|
|
39
|
+
description: task.description || null,
|
|
40
|
+
status: task.status,
|
|
41
|
+
started_at: task.started_at || null,
|
|
42
|
+
priority: task.priority,
|
|
43
|
+
spec_ref: task.spec_ref || null,
|
|
44
|
+
note_count: task.notes.length,
|
|
45
|
+
last_note_at: lastNote ? lastNote.created_at : null,
|
|
46
|
+
todo_count: task.todos.length,
|
|
47
|
+
incomplete_todos: incompleteTodos,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
function toReadyTaskSummary(task, index, unlocksMap) {
|
|
51
|
+
return {
|
|
52
|
+
ref: index.shortUlid(task._ulid),
|
|
53
|
+
slug: task.slugs.length > 0 ? task.slugs[0] : null,
|
|
54
|
+
title: task.title,
|
|
55
|
+
description: task.description || null,
|
|
56
|
+
priority: task.priority,
|
|
57
|
+
spec_ref: task.spec_ref || null,
|
|
58
|
+
tags: task.tags,
|
|
59
|
+
unlocks: unlocksMap.get(task._ulid) || 0,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
function toBlockedTaskSummary(task, index, unlocksMap) {
|
|
63
|
+
// Find unmet dependencies
|
|
64
|
+
const unmetDeps = [];
|
|
65
|
+
for (const depRef of task.depends_on) {
|
|
66
|
+
const result = index.resolve(depRef);
|
|
67
|
+
if (result.ok) {
|
|
68
|
+
const depItem = result.item;
|
|
69
|
+
if ("status" in depItem && depItem.status !== "completed") {
|
|
70
|
+
unmetDeps.push(depRef);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return {
|
|
75
|
+
ref: index.shortUlid(task._ulid),
|
|
76
|
+
slug: task.slugs.length > 0 ? task.slugs[0] : null,
|
|
77
|
+
title: task.title,
|
|
78
|
+
description: task.description || null,
|
|
79
|
+
blocked_by: task.blocked_by,
|
|
80
|
+
unmet_deps: unmetDeps,
|
|
81
|
+
unlocks: unlocksMap.get(task._ulid) || 0,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
function toCompletedTaskSummary(task, index) {
|
|
85
|
+
return {
|
|
86
|
+
ref: index.shortUlid(task._ulid),
|
|
87
|
+
slug: task.slugs.length > 0 ? task.slugs[0] : null,
|
|
88
|
+
title: task.title,
|
|
89
|
+
completed_at: task.completed_at || "",
|
|
90
|
+
closed_reason: task.closed_reason || null,
|
|
91
|
+
origin: task.origin,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
function collectRecentNotes(tasks, index, options) {
|
|
95
|
+
const allNotes = [];
|
|
96
|
+
for (const task of tasks) {
|
|
97
|
+
// Only include notes from in_progress, pending_review, or completed tasks
|
|
98
|
+
const taskStatus = task.status;
|
|
99
|
+
if (!["in_progress", "pending_review", "needs_work", "completed"].includes(taskStatus)) {
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
for (const note of task.notes) {
|
|
103
|
+
const noteDate = new Date(note.created_at);
|
|
104
|
+
// Filter by since date if provided
|
|
105
|
+
if (options.since && noteDate < options.since) {
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
// Filter out superseded notes
|
|
109
|
+
if (isNoteSuperseded(note, task.notes)) {
|
|
110
|
+
continue;
|
|
111
|
+
}
|
|
112
|
+
allNotes.push({
|
|
113
|
+
task_ref: index.shortUlid(task._ulid),
|
|
114
|
+
task_title: task.title,
|
|
115
|
+
task_status: taskStatus,
|
|
116
|
+
note_ulid: note._ulid.slice(0, 8),
|
|
117
|
+
created_at: note.created_at,
|
|
118
|
+
author: note.author || null,
|
|
119
|
+
content: note.content,
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
// Sort by date descending, take limit
|
|
124
|
+
return allNotes
|
|
125
|
+
.sort((a, b) => new Date(b.created_at).getTime() - new Date(a.created_at).getTime())
|
|
126
|
+
.slice(0, options.limit);
|
|
127
|
+
}
|
|
128
|
+
function collectIncompleteTodos(tasks, index, options) {
|
|
129
|
+
const allTodos = [];
|
|
130
|
+
for (const task of tasks) {
|
|
131
|
+
for (const todo of task.todos) {
|
|
132
|
+
// Only include incomplete todos
|
|
133
|
+
if (todo.done)
|
|
134
|
+
continue;
|
|
135
|
+
allTodos.push({
|
|
136
|
+
task_ref: index.shortUlid(task._ulid),
|
|
137
|
+
task_title: task.title,
|
|
138
|
+
id: todo.id,
|
|
139
|
+
text: todo.text,
|
|
140
|
+
added_at: todo.added_at,
|
|
141
|
+
added_by: todo.added_by || null,
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
// Sort by added_at descending (most recent first), take limit
|
|
146
|
+
return allTodos
|
|
147
|
+
.sort((a, b) => new Date(b.added_at).getTime() - new Date(a.added_at).getTime())
|
|
148
|
+
.slice(0, options.limit);
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Build a unified activity timeline from completed tasks and git commits.
|
|
152
|
+
*
|
|
153
|
+
* - Commits with Task: @slug trailers are matched to completed tasks and shown
|
|
154
|
+
* as combined "linked_commit" entries (AC: ac-activity-trailer-link, ac-activity-dedup)
|
|
155
|
+
* - Unlinked commits appear as standalone "commit" entries
|
|
156
|
+
* - Tasks not linked to any commit appear as standalone "task_completion" entries
|
|
157
|
+
* - All items sorted most recent first (AC: ac-activity-sort)
|
|
158
|
+
*
|
|
159
|
+
* @param completedTasks - Completed task summaries
|
|
160
|
+
* @param commits - Recent commit summaries (with task_refs parsed from trailers)
|
|
161
|
+
* @param taskRefResolver - Maps a trailer ref (slug or ULID prefix) to a completed task's ref (short ULID)
|
|
162
|
+
*/
|
|
163
|
+
function buildActivityTimeline(completedTasks, commits, taskRefResolver) {
|
|
164
|
+
const items = [];
|
|
165
|
+
// Build lookup from short ULID ref to CompletedTaskSummary
|
|
166
|
+
const taskByRef = new Map();
|
|
167
|
+
for (const task of completedTasks) {
|
|
168
|
+
taskByRef.set(task.ref, task);
|
|
169
|
+
}
|
|
170
|
+
// Track which tasks have been linked to a commit (for dedup)
|
|
171
|
+
const linkedTaskRefs = new Set();
|
|
172
|
+
for (const commit of commits) {
|
|
173
|
+
if (commit.task_refs.length > 0) {
|
|
174
|
+
let linkedTask;
|
|
175
|
+
for (const trailerRef of commit.task_refs) {
|
|
176
|
+
// Resolve the trailer ref (slug or ULID) to the short ULID ref
|
|
177
|
+
const resolvedRef = taskRefResolver.get(trailerRef);
|
|
178
|
+
if (resolvedRef) {
|
|
179
|
+
linkedTask = taskByRef.get(resolvedRef);
|
|
180
|
+
}
|
|
181
|
+
// Also try direct match on short ULID ref
|
|
182
|
+
if (!linkedTask) {
|
|
183
|
+
linkedTask = taskByRef.get(trailerRef);
|
|
184
|
+
}
|
|
185
|
+
if (linkedTask) {
|
|
186
|
+
linkedTaskRefs.add(linkedTask.ref);
|
|
187
|
+
// Use the later of commit date and task completion date for sort accuracy
|
|
188
|
+
const commitTime = new Date(commit.date).getTime();
|
|
189
|
+
const taskTime = new Date(linkedTask.completed_at).getTime();
|
|
190
|
+
const laterDate = taskTime > commitTime ? linkedTask.completed_at : commit.date;
|
|
191
|
+
items.push({
|
|
192
|
+
type: "linked_commit",
|
|
193
|
+
date: laterDate,
|
|
194
|
+
commit,
|
|
195
|
+
task: linkedTask,
|
|
196
|
+
});
|
|
197
|
+
break; // One linked entry per commit
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
if (!linkedTask) {
|
|
201
|
+
// Task ref in trailer but no matching completed task found
|
|
202
|
+
items.push({ type: "commit", date: commit.date, commit });
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
else {
|
|
206
|
+
items.push({ type: "commit", date: commit.date, commit });
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
// Add task completions not already linked to a commit
|
|
210
|
+
for (const task of completedTasks) {
|
|
211
|
+
if (!linkedTaskRefs.has(task.ref)) {
|
|
212
|
+
items.push({
|
|
213
|
+
type: "task_completion",
|
|
214
|
+
date: task.completed_at,
|
|
215
|
+
task,
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
// AC: @session-start-activity-timeline ac-activity-sort
|
|
220
|
+
// Sort most recent first
|
|
221
|
+
items.sort((a, b) => new Date(b.date).getTime() - new Date(a.date).getTime());
|
|
222
|
+
return items;
|
|
223
|
+
}
|
|
224
|
+
// ─── Main Gather Function ───────────────────────────────────────────────────
|
|
225
|
+
/**
|
|
226
|
+
* Gather session context data
|
|
227
|
+
*/
|
|
228
|
+
export async function gatherSessionContext(ctx, options) {
|
|
229
|
+
const limit = parseInt(options.limit || "10", 10);
|
|
230
|
+
if (Number.isNaN(limit) || limit <= 0) {
|
|
231
|
+
throw new RangeError(`Invalid limit: "${options.limit}". Must be a positive integer.`);
|
|
232
|
+
}
|
|
233
|
+
const sinceDate = options.since ? parseTimeSpec(options.since) : null;
|
|
234
|
+
const showGit = options.git !== false; // default true
|
|
235
|
+
// Load all data
|
|
236
|
+
const allTasks = await loadAllTasks(ctx);
|
|
237
|
+
const items = await loadAllItems(ctx);
|
|
238
|
+
const inboxItems = await loadInboxItems(ctx);
|
|
239
|
+
const triageRecords = await loadTriageRecords(ctx);
|
|
240
|
+
const index = new ReferenceIndex(allTasks, items);
|
|
241
|
+
// AC: @session-start-inbox-triage ac-inbox-untriaged-def
|
|
242
|
+
// Build lookup: inbox ULID → triage record (most recent if multiple)
|
|
243
|
+
const triageByInboxRef = new Map();
|
|
244
|
+
for (const record of triageRecords) {
|
|
245
|
+
triageByInboxRef.set(record.inbox_ref, { action: record.action });
|
|
246
|
+
}
|
|
247
|
+
// ── Single-pass task bucketing ──────────────────────────────────────────
|
|
248
|
+
// Bucket all tasks by status in one pass instead of 14+ separate .filter() calls.
|
|
249
|
+
const tasksByStatus = new Map();
|
|
250
|
+
for (const task of allTasks) {
|
|
251
|
+
const existing = tasksByStatus.get(task.status);
|
|
252
|
+
if (existing) {
|
|
253
|
+
existing.push(task);
|
|
254
|
+
}
|
|
255
|
+
else {
|
|
256
|
+
tasksByStatus.set(task.status, [task]);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
// Helper to get a status bucket (returns empty array if none)
|
|
260
|
+
const bucket = (status) => tasksByStatus.get(status) || [];
|
|
261
|
+
// Cache getReadyTasks (expensive: checks dependencies for every pending task)
|
|
262
|
+
const allReadyTasks = getReadyTasks(allTasks);
|
|
263
|
+
// Cache sorted completed tasks (used for notes and recentlyCompleted list)
|
|
264
|
+
const completedWithDate = bucket("completed")
|
|
265
|
+
.filter((t) => t.completed_at)
|
|
266
|
+
.sort((a, b) => {
|
|
267
|
+
const aDate = new Date(a.completed_at || 0);
|
|
268
|
+
const bDate = new Date(b.completed_at || 0);
|
|
269
|
+
return bDate.getTime() - aDate.getTime();
|
|
270
|
+
});
|
|
271
|
+
// Active tasks = in_progress + needs_work
|
|
272
|
+
const activeStatusTasks = [...bucket("in_progress"), ...bucket("needs_work")];
|
|
273
|
+
// Compute stats from buckets
|
|
274
|
+
const stats = {
|
|
275
|
+
total_tasks: allTasks.length,
|
|
276
|
+
in_progress: bucket("in_progress").length,
|
|
277
|
+
needs_work: bucket("needs_work").length,
|
|
278
|
+
pending_review: bucket("pending_review").length,
|
|
279
|
+
ready: allReadyTasks.length,
|
|
280
|
+
blocked: bucket("blocked").length,
|
|
281
|
+
completed: bucket("completed").length,
|
|
282
|
+
inbox_items: inboxItems.length,
|
|
283
|
+
};
|
|
284
|
+
// Get active tasks (in_progress + needs_work, optionally filtered to automation-eligible only)
|
|
285
|
+
// AC: @cli-ralph ac-16
|
|
286
|
+
const activeTasks = activeStatusTasks
|
|
287
|
+
.filter((t) => !options.eligible || t.automation === "eligible")
|
|
288
|
+
.sort((a, b) => a.priority - b.priority)
|
|
289
|
+
.slice(0, options.full ? undefined : limit)
|
|
290
|
+
.map((t) => toActiveTaskSummary(t, index));
|
|
291
|
+
// Get pending review tasks
|
|
292
|
+
const pendingReviewTasks = bucket("pending_review")
|
|
293
|
+
.sort((a, b) => a.priority - b.priority)
|
|
294
|
+
.slice(0, options.full ? undefined : limit)
|
|
295
|
+
.map((t) => toActiveTaskSummary(t, index));
|
|
296
|
+
// Get recent notes from active, pending_review, and recently completed tasks
|
|
297
|
+
// AC: @cmd-session-start ac-1, ac-2
|
|
298
|
+
// Collect notes per-status first to prevent one status from starving others
|
|
299
|
+
// In full mode, uncap notes (consistent with other sections that use undefined in full mode).
|
|
300
|
+
// In non-full mode, split limit across 3 status buckets to prevent starvation.
|
|
301
|
+
const noteLimitPerStatus = options.full ? undefined : Math.ceil(limit / 3);
|
|
302
|
+
const inProgressNotes = collectRecentNotes(activeStatusTasks, index, { limit: noteLimitPerStatus, since: sinceDate });
|
|
303
|
+
const pendingReviewNotes = collectRecentNotes(bucket("pending_review"), index, { limit: noteLimitPerStatus, since: sinceDate });
|
|
304
|
+
const recentlyCompletedForNotes = completedWithDate
|
|
305
|
+
.slice(0, 5); // Last 3-5 completed tasks per AC-2
|
|
306
|
+
const completedNotes = collectRecentNotes(recentlyCompletedForNotes, index, { limit: noteLimitPerStatus, since: sinceDate });
|
|
307
|
+
// Combine notes from all statuses, preserving representation from each.
|
|
308
|
+
// In non-full mode, apply final cap to handle ceil() rounding across 3 buckets.
|
|
309
|
+
const noteLimit = options.full ? undefined : limit;
|
|
310
|
+
const recentNotes = [...inProgressNotes, ...pendingReviewNotes, ...completedNotes]
|
|
311
|
+
.sort((a, b) => new Date(b.created_at).getTime() - new Date(a.created_at).getTime())
|
|
312
|
+
.slice(0, noteLimit);
|
|
313
|
+
// Get incomplete todos from active tasks
|
|
314
|
+
const activeTodos = collectIncompleteTodos(activeStatusTasks, index, { limit: options.full ? limit * 2 : limit });
|
|
315
|
+
// Compute reverse dependency map for "unlocks N" annotations
|
|
316
|
+
const unlocksMap = computeUnlocksMap(allTasks, index);
|
|
317
|
+
// AC: @cmd-session-start ac-primer-default, ac-full-sections
|
|
318
|
+
// Primer: top 5 ready tasks; Full: all ready tasks
|
|
319
|
+
// Respect --limit as upper bound when provided
|
|
320
|
+
const readyLimit = options.full ? undefined : Math.min(limit, 5);
|
|
321
|
+
const readyTasks = allReadyTasks
|
|
322
|
+
.filter((t) => !options.eligible || t.automation === "eligible")
|
|
323
|
+
.slice(0, readyLimit)
|
|
324
|
+
.map((t) => toReadyTaskSummary(t, index, unlocksMap));
|
|
325
|
+
// Get blocked tasks
|
|
326
|
+
const blockedTasks = bucket("blocked")
|
|
327
|
+
.slice(0, options.full ? undefined : limit)
|
|
328
|
+
.map((t) => toBlockedTaskSummary(t, index, unlocksMap));
|
|
329
|
+
// Get recently completed tasks (reuse cached sorted list)
|
|
330
|
+
const recentlyCompleted = completedWithDate
|
|
331
|
+
.filter((t) => {
|
|
332
|
+
if (!sinceDate)
|
|
333
|
+
return true;
|
|
334
|
+
const completedDate = new Date(t.completed_at || 0);
|
|
335
|
+
return completedDate >= sinceDate;
|
|
336
|
+
})
|
|
337
|
+
.slice(0, options.full ? undefined : limit)
|
|
338
|
+
.map((t) => toCompletedTaskSummary(t, index));
|
|
339
|
+
// Get git info
|
|
340
|
+
let branch = null;
|
|
341
|
+
let recentCommits = [];
|
|
342
|
+
let workingTree = null;
|
|
343
|
+
if (showGit && isGitRepo(ctx.rootDir)) {
|
|
344
|
+
branch = getCurrentBranch(ctx.rootDir);
|
|
345
|
+
const commits = getRecentCommits({
|
|
346
|
+
limit: options.full ? limit * 2 : limit,
|
|
347
|
+
since: sinceDate || undefined,
|
|
348
|
+
cwd: ctx.rootDir,
|
|
349
|
+
});
|
|
350
|
+
recentCommits = commits.map((c) => ({
|
|
351
|
+
hash: c.hash,
|
|
352
|
+
full_hash: c.fullHash,
|
|
353
|
+
date: c.date.toISOString(),
|
|
354
|
+
message: c.message,
|
|
355
|
+
author: c.author,
|
|
356
|
+
task_refs: c.taskRefs,
|
|
357
|
+
}));
|
|
358
|
+
workingTree = getWorkingTreeStatus(ctx.rootDir);
|
|
359
|
+
}
|
|
360
|
+
// Get inbox items with triage status (oldest first to encourage triage)
|
|
361
|
+
// AC: @session-start-inbox-triage ac-inbox-untriaged-def
|
|
362
|
+
const allInboxSummaries = inboxItems
|
|
363
|
+
.sort((a, b) => new Date(a.created_at).getTime() - new Date(b.created_at).getTime())
|
|
364
|
+
.map((item) => {
|
|
365
|
+
const triageInfo = triageByInboxRef.get(item._ulid);
|
|
366
|
+
return {
|
|
367
|
+
ref: item._ulid.slice(0, 8),
|
|
368
|
+
text: item.text,
|
|
369
|
+
created_at: item.created_at,
|
|
370
|
+
tags: item.tags,
|
|
371
|
+
added_by: item.added_by || null,
|
|
372
|
+
triaged: !!triageInfo,
|
|
373
|
+
triage_action: triageInfo?.action ?? null,
|
|
374
|
+
};
|
|
375
|
+
});
|
|
376
|
+
// AC: @session-start-inbox-triage ac-inbox-stat-line, ac-inbox-all-triaged
|
|
377
|
+
const inboxStats = {
|
|
378
|
+
total: allInboxSummaries.length,
|
|
379
|
+
untriaged: allInboxSummaries.filter((i) => !i.triaged).length,
|
|
380
|
+
deferred: allInboxSummaries.filter((i) => i.triage_action === "defer")
|
|
381
|
+
.length,
|
|
382
|
+
triaged: allInboxSummaries.filter((i) => i.triaged).length,
|
|
383
|
+
};
|
|
384
|
+
// JSON always gets full list with triage status; human display filters in formatSessionContext
|
|
385
|
+
// Load session context (focus, threads, questions)
|
|
386
|
+
const sessionContext = await loadSessionContext(ctx);
|
|
387
|
+
// Build task ref resolver for activity timeline: maps slug/ULID to short ref
|
|
388
|
+
// This allows commits with Task: @task-slug trailers to match completed tasks
|
|
389
|
+
const taskRefResolver = new Map();
|
|
390
|
+
for (const task of allTasks) {
|
|
391
|
+
if (task.status !== "completed")
|
|
392
|
+
continue;
|
|
393
|
+
const shortRef = index.shortUlid(task._ulid);
|
|
394
|
+
// Map each slug to the short ref
|
|
395
|
+
for (const slug of task.slugs) {
|
|
396
|
+
taskRefResolver.set(slug, shortRef);
|
|
397
|
+
}
|
|
398
|
+
// Also map the full ULID and short ULID to itself
|
|
399
|
+
taskRefResolver.set(task._ulid, shortRef);
|
|
400
|
+
taskRefResolver.set(shortRef, shortRef);
|
|
401
|
+
}
|
|
402
|
+
// Build unified activity timeline
|
|
403
|
+
// AC: @session-start-activity-timeline ac-activity-merge
|
|
404
|
+
// AC: @cmd-session-start ac-primer-default, ac-full-sections
|
|
405
|
+
// Primer: 10 items; Full: 20 items
|
|
406
|
+
// Respect --limit as upper bound when provided
|
|
407
|
+
const activityLimit = options.full ? Math.min(limit * 2, 20) : Math.min(limit, 10);
|
|
408
|
+
const activityTimeline = buildActivityTimeline(recentlyCompleted, recentCommits, taskRefResolver).slice(0, activityLimit);
|
|
409
|
+
// AC: @cmd-session-start ac-full-sections — observations section (full mode only)
|
|
410
|
+
let observations = [];
|
|
411
|
+
if (options.full) {
|
|
412
|
+
const metaCtx = await loadMetaContext(ctx);
|
|
413
|
+
observations = metaCtx.observations
|
|
414
|
+
.filter((o) => !o.resolved)
|
|
415
|
+
.sort((a, b) => new Date(b.created_at).getTime() - new Date(a.created_at).getTime())
|
|
416
|
+
.map((o) => ({
|
|
417
|
+
ref: o._ulid.slice(0, 8),
|
|
418
|
+
type: o.type,
|
|
419
|
+
content: o.content,
|
|
420
|
+
created_at: o.created_at,
|
|
421
|
+
author: o.author || null,
|
|
422
|
+
resolved: o.resolved,
|
|
423
|
+
workflow_ref: o.workflow_ref || null,
|
|
424
|
+
}));
|
|
425
|
+
}
|
|
426
|
+
// AC: @session-start-computed-json ac-computed-unlocks
|
|
427
|
+
// Build task_unlocks map: short ULID ref → count of pending dependents
|
|
428
|
+
const taskUnlocks = {};
|
|
429
|
+
for (const [taskUlid, count] of unlocksMap) {
|
|
430
|
+
if (count > 0) {
|
|
431
|
+
taskUnlocks[index.shortUlid(taskUlid)] = count;
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
// AC: @session-start-computed-json ac-computed-inbox, ac-computed-unlocks, ac-computed-activity
|
|
435
|
+
const computed = {
|
|
436
|
+
inbox_untriaged_count: inboxStats.untriaged,
|
|
437
|
+
inbox_deferred_count: inboxStats.deferred,
|
|
438
|
+
inbox_total: inboxStats.total,
|
|
439
|
+
task_unlocks: taskUnlocks,
|
|
440
|
+
recent_activity: activityTimeline,
|
|
441
|
+
};
|
|
442
|
+
return {
|
|
443
|
+
generated_at: new Date().toISOString(),
|
|
444
|
+
branch,
|
|
445
|
+
context: sessionContext,
|
|
446
|
+
active_tasks: activeTasks,
|
|
447
|
+
pending_review_tasks: pendingReviewTasks,
|
|
448
|
+
recent_notes: recentNotes,
|
|
449
|
+
active_todos: activeTodos,
|
|
450
|
+
ready_tasks: readyTasks,
|
|
451
|
+
blocked_tasks: blockedTasks,
|
|
452
|
+
recently_completed: recentlyCompleted,
|
|
453
|
+
recent_commits: recentCommits,
|
|
454
|
+
activity_timeline: activityTimeline,
|
|
455
|
+
working_tree: workingTree,
|
|
456
|
+
inbox_items: allInboxSummaries,
|
|
457
|
+
inbox_stats: inboxStats,
|
|
458
|
+
observations,
|
|
459
|
+
stats,
|
|
460
|
+
computed,
|
|
461
|
+
};
|
|
462
|
+
}
|
|
463
|
+
// ─── Iteration Stats ────────────────────────────────────────────────────────
|
|
464
|
+
/**
|
|
465
|
+
* Get iteration stats - tasks completed/started since a given time.
|
|
466
|
+
* AC: @ralph-task-limit ac-detection
|
|
467
|
+
*/
|
|
468
|
+
export async function getIterationStats(ctx, since) {
|
|
469
|
+
const allTasks = await loadAllTasks(ctx);
|
|
470
|
+
// Count both completed and pending_review (submitted) tasks toward the limit.
|
|
471
|
+
// Submit means the agent's work is done — it should count the same as complete.
|
|
472
|
+
// AC: @ralph-task-limit ac-detection
|
|
473
|
+
const completedSince = allTasks.filter((t) => {
|
|
474
|
+
if (t.status === "completed" && t.completed_at) {
|
|
475
|
+
return new Date(t.completed_at) >= since;
|
|
476
|
+
}
|
|
477
|
+
if (t.status === "pending_review" && t.submitted_at) {
|
|
478
|
+
return new Date(t.submitted_at) >= since;
|
|
479
|
+
}
|
|
480
|
+
return false;
|
|
481
|
+
});
|
|
482
|
+
const startedSince = allTasks.filter((t) => {
|
|
483
|
+
if (!t.started_at)
|
|
484
|
+
return false;
|
|
485
|
+
return new Date(t.started_at) >= since;
|
|
486
|
+
});
|
|
487
|
+
return {
|
|
488
|
+
tasks_completed: completedSince.length,
|
|
489
|
+
tasks_started: startedSince.length,
|
|
490
|
+
completed_refs: completedSince.map((t) => getDisplayRef({ ref: t._ulid.slice(0, 8), slug: t.slugs[0] || null })),
|
|
491
|
+
};
|
|
492
|
+
}
|
|
493
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../../src/cli/commands/session/context.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,aAAa,EAGb,YAAY,EACZ,YAAY,EACZ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;QACzC,IAAI,CAAC,CAAC,CAAC,UAAU;YAAE,OAAO,KAAK,CAAC;QAChC,OAAO,IAAI,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,KAAK,CAAC;IACzC,CAAC,CAAC,CAAC;IAEH,OAAO;QACL,eAAe,EAAE,cAAc,CAAC,MAAM;QACtC,aAAa,EAAE,YAAY,CAAC,MAAM;QAClC,cAAc,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CACvC,aAAa,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CACtE;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session create action and environment injection.
|
|
3
|
+
*
|
|
4
|
+
* Creates new sessions with optional budget and injects session ID into agent environments.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Action handler for `kspec session create`.
|
|
8
|
+
*
|
|
9
|
+
* Creates a new session with optional budget and environment injection.
|
|
10
|
+
*
|
|
11
|
+
* AC: @session-creation-and-env-injection ac-create
|
|
12
|
+
* AC: @session-creation-and-env-injection ac-budget
|
|
13
|
+
* AC: @session-creation-and-env-injection ac-budget-local
|
|
14
|
+
* AC: @session-creation-and-env-injection ac-inject-claude
|
|
15
|
+
* AC: @session-creation-and-env-injection ac-inject-codex
|
|
16
|
+
* AC: @session-creation-and-env-injection ac-inject-fallback
|
|
17
|
+
*
|
|
18
|
+
* Exit codes documented per @trait-semantic-exit-codes ac-8:
|
|
19
|
+
* - 0: Session created successfully
|
|
20
|
+
* - 1: Validation error (invalid budget value)
|
|
21
|
+
* - 3: Runtime error (filesystem failure)
|
|
22
|
+
*/
|
|
23
|
+
export declare function sessionCreateAction(options: {
|
|
24
|
+
agentType: string;
|
|
25
|
+
budget?: string;
|
|
26
|
+
inject?: boolean;
|
|
27
|
+
taskId?: string;
|
|
28
|
+
}): Promise<void>;
|
|
29
|
+
//# sourceMappingURL=create.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/session/create.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAyDH;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,mBAAmB,CAAC,OAAO,EAAE;IACjD,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GAAG,OAAO,CAAC,IAAI,CAAC,CA0GhB"}
|