agentpack-cli 0.1.8 → 0.1.10

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.
@@ -0,0 +1,229 @@
1
+ # Task Passport
2
+
3
+ Task Passport is the handoff artifact for one coherent unit of agentic work.
4
+
5
+ It captures the reviewed state a future agent needs in order to continue the current task without rediscovering context, repeating dead ends, or guessing what is safe to touch.
6
+
7
+ ## Model
8
+
9
+ Default rule:
10
+
11
+ - one active Task Passport owns a repo worktree
12
+ - a repo may keep many completed or parked passports over time
13
+ - worktrees can carry different active passports
14
+ - the shared repo source cache remains repo-level
15
+ - decisions, dead ends, evidence, checkpoints, and next actions become passport-scoped
16
+
17
+ This keeps source knowledge reusable while preventing unrelated work from mixing task state.
18
+
19
+ ## File Shape
20
+
21
+ Target local layout:
22
+
23
+ ```text
24
+ .agentpack/
25
+ config.json
26
+ sources.json
27
+ tasks/
28
+ current
29
+ task_20260518_source_cleanup/
30
+ passport.json
31
+ events.jsonl
32
+ checkpoints/
33
+ evidence/
34
+ exports/
35
+ ```
36
+
37
+ `tasks/current` is a small pointer to the active task id for this worktree. If it is missing, Agentpack can fall back to the current v0 repo-level state.
38
+
39
+ ## Passport Schema
40
+
41
+ `passport.json` should be compact, readable, and safe to inspect manually.
42
+
43
+ ```json
44
+ {
45
+ "schemaVersion": 1,
46
+ "id": "task_20260518_source_cleanup",
47
+ "title": "Add source cache cleanup commands",
48
+ "status": "active",
49
+ "createdAt": "2026-05-18T11:00:00.000Z",
50
+ "updatedAt": "2026-05-18T11:30:00.000Z",
51
+ "closedAt": null,
52
+ "objective": "Let Agentpack remove stale source records safely.",
53
+ "constraints": [
54
+ "Preserve existing source add/status behavior",
55
+ "Do not delete source records broadly without an explicit guard"
56
+ ],
57
+ "branch": "main",
58
+ "baseHead": "8d22011",
59
+ "currentHead": "21fe674",
60
+ "worktree": "/path/to/repo",
61
+ "writeScope": [
62
+ "src/operations.ts",
63
+ "src/cli/index.ts",
64
+ "tests/agentpack.test.ts",
65
+ "docs/CLI.md"
66
+ ],
67
+ "risk": "low",
68
+ "roles": {
69
+ "scout": {
70
+ "status": "done",
71
+ "summary": "Inspected source add/status flow and tests."
72
+ },
73
+ "builder": {
74
+ "status": "done",
75
+ "summary": "Implemented remove/prune commands inside declared write scope."
76
+ },
77
+ "reviewer": {
78
+ "status": "done",
79
+ "summary": "Verified tests, doctor, and dogfood cleanup."
80
+ },
81
+ "archivist": {
82
+ "status": "done",
83
+ "summary": "Recorded source conclusions, evidence, and checkpoint."
84
+ }
85
+ },
86
+ "verification": {
87
+ "status": "passed",
88
+ "evidence": [
89
+ "evt_example_test_output"
90
+ ],
91
+ "summary": "npm test passed; doctor clean after source cache refresh."
92
+ },
93
+ "nextActions": [
94
+ "Design Task Passport schema and state transitions"
95
+ ],
96
+ "tags": [
97
+ "source-cache",
98
+ "trust-foundation"
99
+ ]
100
+ }
101
+ ```
102
+
103
+ Required fields for v1:
104
+
105
+ - `schemaVersion`
106
+ - `id`
107
+ - `title`
108
+ - `status`
109
+ - `createdAt`
110
+ - `updatedAt`
111
+ - `objective`
112
+ - `branch`
113
+ - `baseHead`
114
+ - `worktree`
115
+ - `writeScope`
116
+ - `nextActions`
117
+
118
+ Optional but recommended:
119
+
120
+ - `constraints`
121
+ - `currentHead`
122
+ - `risk`
123
+ - `roles`
124
+ - `verification`
125
+ - `tags`
126
+ - `closedAt`
127
+
128
+ ## Statuses
129
+
130
+ Initial statuses:
131
+
132
+ - `active`: current work is in progress in this worktree
133
+ - `parked`: intentionally paused and not the current task
134
+ - `blocked`: waiting on user input, external dependency, or unresolved risk
135
+ - `verifying`: implementation is done, but evidence/review is not complete
136
+ - `completed`: task finished with verification or explicit acceptance
137
+ - `abandoned`: task stopped and should not be resumed without a new decision
138
+
139
+ Default context should show the active passport in full, and show parked or blocked passports only as compact references unless explicitly requested.
140
+
141
+ ## State Transitions
142
+
143
+ Allowed transitions:
144
+
145
+ ```text
146
+ none -> active task start
147
+ active -> parked task park
148
+ parked -> active task switch/resume
149
+ active -> blocked task block
150
+ blocked -> active task unblock/resume
151
+ active -> verifying task update-verification
152
+ verifying -> active verification found more work
153
+ verifying -> completed verification passed
154
+ active -> completed small/docs task accepted directly
155
+ active -> abandoned task abandon
156
+ parked -> abandoned stale parked task is discarded
157
+ blocked -> abandoned blocked task is discarded
158
+ ```
159
+
160
+ Closed statuses are `completed` and `abandoned`. Closed passports remain inspectable history but should not appear in the default resume unless they are query-relevant.
161
+
162
+ ## CLI Shape
163
+
164
+ Target first CLI surface:
165
+
166
+ ```bash
167
+ agentpack task start "Add source cache cleanup commands" \
168
+ --objective "Let Agentpack remove stale source records safely" \
169
+ --write-scope src/operations.ts \
170
+ --write-scope src/cli/index.ts
171
+
172
+ agentpack task list
173
+ agentpack task passport
174
+ agentpack task switch task_20260518_source_cleanup
175
+ agentpack task audit
176
+ agentpack task park
177
+ agentpack task block --reason "Waiting for API decision"
178
+ agentpack task update-verification --status passed --evidence evt_... --summary "Focused checks passed"
179
+ agentpack task close
180
+ ```
181
+
182
+ `resume` and MCP `load_context` read the current passport automatically when one exists, then show the broader repo-level ledger below it.
183
+
184
+ `task audit` is a diagnostic pass for continuity risk. It checks the current passport for branch/head drift, missing next actions, open verification, stale source conclusions, and closed-current-task anomalies.
185
+
186
+ `task update-verification` updates the verification state. Without flags it marks verification as `pending`; with `--status`, `--evidence`, and `--summary` it links verification to recorded evidence so the audit warning can become a reviewed result.
187
+
188
+ ## Role Lanes
189
+
190
+ Roles are coordination lanes inside one passport, not separate tasks.
191
+
192
+ - Scout: read-oriented; records source conclusions, risks, and known unknowns
193
+ - Builder: write-oriented; works inside the declared write scope
194
+ - Reviewer: read-oriented; checks diff, tests, risks, and regression surface
195
+ - Archivist: state-oriented; records evidence, checkpoints, and handoff notes
196
+
197
+ For v1, roles should be metadata and prompts, not a multi-agent runtime. Orchestrators can later map their own workers onto these lanes.
198
+
199
+ ## Consistency Rules
200
+
201
+ Agentpack should warn before work continues when:
202
+
203
+ - the current git branch does not match the passport branch
204
+ - the current git head moved since the last passport update
205
+ - the current worktree path does not match the passport worktree
206
+ - a source conclusion in the current context is changed or missing
207
+ - a new active passport would overlap another open passport's write scope
208
+ - a Builder role attempts changes outside the declared write scope
209
+ - a task is marked completed without evidence or an explicit acceptance note
210
+
211
+ Agentpack should not try to resolve code conflicts. It should point the user toward one of three safe paths:
212
+
213
+ - reuse the current passport
214
+ - park one task before starting another
215
+ - move parallel work into a separate worktree
216
+
217
+ ## Migration
218
+
219
+ Existing v0 packs should remain valid.
220
+
221
+ When task support is introduced, Agentpack can create an initial passport from the current repo-level state:
222
+
223
+ - `goal` becomes `objective`
224
+ - `currentStatus` becomes a summary or active status note
225
+ - `nextActions` copy into the passport
226
+ - existing events remain readable as legacy repo-level events
227
+ - `sources.json` stays repo-level
228
+
229
+ This avoids breaking existing users while moving new work into passport-scoped ledgers.
package/docs/VISION.md CHANGED
@@ -12,11 +12,12 @@ As agent UIs evolve from chat boxes into execution workspaces, handoffs will bec
12
12
 
13
13
  Branches and transcripts are not enough. Agents need reviewed task state that is portable, inspectable, and client-neutral.
14
14
 
15
- Agentpack is not trying to replace execution engines. Codex, Claude Code, Cursor, LangGraph, Temporal, OpenAI Agents SDK, and similar systems can own execution loops, retries, approvals, tool calls, and durable runs. Agentpack should own the neutral repo-scoped continuity layer that those surfaces can share.
15
+ Codex, Claude Code, Cursor, LangGraph, Temporal, OpenAI Agents SDK, and similar systems can own execution loops, retries, approvals, tool calls, and durable runs. Agentpack should own the neutral repo-scoped continuity layer that those surfaces can share.
16
16
 
17
17
  ## What Agentpack Should Own
18
18
 
19
19
  - repo-native continuity
20
+ - task passports as the handoff artifact
20
21
  - semantic checkpoints
21
22
  - source-inspection cache
22
23
  - dead-end memory
@@ -25,19 +26,39 @@ Agentpack is not trying to replace execution engines. Codex, Claude Code, Cursor
25
26
  - portable bundles between worktrees, machines, and clients
26
27
  - orchestrator recipes later
27
28
 
29
+ ## Task Passport Model
30
+
31
+ A Task Passport is the handoff artifact for one coherent unit of agentic work. It should capture the objective, constraints, write scope, relevant source conclusions, decisions, dead ends, evidence, verification state, checkpoints, and next actions.
32
+
33
+ See [TASK-PASSPORT.md](TASK-PASSPORT.md) for the target schema and state transitions.
34
+
35
+ One active Task Passport should own the work in a repo worktree by default. A repo can keep many closed or parked passports over time, but Agentpack should not turn one working directory into a backlog or a multi-task merge engine.
36
+
37
+ Workstreams are how passports stay separated across repo work, branches, and worktrees. They are for history, parked work, and handoff boundaries, not a substitute for issue tracking or code conflict resolution.
38
+
39
+ Multi-role agents should collaborate inside one Task Passport:
40
+
41
+ - Scout: inspect sources and record source conclusions
42
+ - Builder: make changes inside the declared write scope
43
+ - Reviewer: check the diff, risks, and verification
44
+ - Archivist: record evidence, checkpoints, and handoff state
45
+
46
+ Agentpack should support those role lanes as lightweight prompts, metadata, and consistency checks before it attempts any heavier orchestration.
47
+
28
48
  ## Operating Principles
29
49
 
30
50
  - Git stores code state. Agentpack stores reviewed task state.
31
51
  - Execution engines run the work. Agentpack preserves what future agents need to continue it.
32
52
  - Continuity should be native to the repo, not reconstructed from chat history.
53
+ - One Task Passport owns the current work; multiple roles can contribute to it.
33
54
  - Prefer small, inspectable, local files before hosted sync or hidden databases.
34
55
  - Prefer portable MCP, CLI, and file surfaces over framework lock-in.
35
56
  - Record durable context, not every action.
36
57
 
37
- ## Non-Goals
58
+ ## Scope Boundaries
38
59
 
39
- - Do not become a general chat archive.
40
- - Do not replace LangGraph, Temporal, OpenAI Agents SDK, Codex, Claude Code, Cursor, or other execution engines.
41
- - Do not make cloud sync or hosted memory required for the core workflow.
42
- - Do not treat automatic full-session capture as the default source of truth.
43
- - Do not require embeddings or network calls before deterministic file/hash/source summaries stop being enough.
60
+ - Keep the core artifact focused on reviewed task state.
61
+ - Keep backlog, issue tracking, and code merge conflict resolution in the tools that already own them.
62
+ - Keep execution loops, retries, approvals, tool calls, and durable runs in execution engines.
63
+ - Keep the core workflow local-first; hosted sync can remain optional future work.
64
+ - Keep deterministic file, hash, and source summaries as the default before adding embeddings or network calls.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentpack-cli",
3
- "version": "0.1.8",
3
+ "version": "0.1.10",
4
4
  "description": "Local task-state ledger for AI coding agents.",
5
5
  "type": "module",
6
6
  "repository": {
@@ -29,7 +29,7 @@ try {
29
29
 
30
30
  const toolsResponse = await client.request("tools/list", {});
31
31
  const toolNames = toolsResponse.result?.tools?.map((tool) => tool.name).sort() || [];
32
- for (const expected of ["load_context", "record_decision", "record_source", "resume", "source_status"]) {
32
+ for (const expected of ["load_context", "record_decision", "record_source", "resume", "source_status", "task_audit", "task_update_verification"]) {
33
33
  assertIncludes(toolNames, expected, `tools/list includes ${expected}`);
34
34
  }
35
35
 
@@ -55,6 +55,43 @@ try {
55
55
  });
56
56
  assertMatch(sourceStatus.result?.content?.[0]?.text || "", /UNCHANGED index\.js/, "source_status reports unchanged source");
57
57
 
58
+ const initialAudit = await client.request("tools/call", {
59
+ name: "task_audit",
60
+ arguments: {}
61
+ });
62
+ assertMatch(initialAudit.result?.content?.[0]?.text || "", /No current task passport/, "task_audit reports missing task before start");
63
+
64
+ runCli([
65
+ "task",
66
+ "start",
67
+ "MCP smoke verification",
68
+ "--write-scope",
69
+ "index.js",
70
+ "--next",
71
+ "Complete smoke verification"
72
+ ]);
73
+
74
+ const evidence = await client.request("tools/call", {
75
+ name: "attach_evidence",
76
+ arguments: {
77
+ kind: "test-output",
78
+ content: "MCP smoke verification passed."
79
+ }
80
+ });
81
+ const evidenceText = evidence.result?.content?.[0]?.text || "";
82
+ const evidenceId = evidenceText.match(/Attached evidence ([^.]+)\./)?.[1] || "";
83
+ assertMatch(evidenceId, /^evt_/, "attach_evidence returns an evidence event id");
84
+
85
+ const taskVerify = await client.request("tools/call", {
86
+ name: "task_update_verification",
87
+ arguments: {
88
+ status: "passed",
89
+ evidence: [evidenceId],
90
+ summary: "MCP smoke verification passed."
91
+ }
92
+ });
93
+ assertMatch(taskVerify.result?.content?.[0]?.text || "", /Updated verification for task .* \(passed\)/, "task_update_verification marks verification as passed");
94
+
58
95
  const resume = await client.request("tools/call", {
59
96
  name: "resume",
60
97
  arguments: {
@@ -67,7 +104,7 @@ try {
67
104
 
68
105
  console.log("MCP server OK");
69
106
  console.log(`Tools: ${toolNames.join(", ")}`);
70
- console.log("Flow: initialize -> tools/list -> record_decision -> record_source -> source_status -> resume");
107
+ console.log("Flow: initialize -> tools/list -> record_decision -> record_source -> source_status -> task_audit -> task_update_verification -> resume");
71
108
  } catch (error) {
72
109
  console.error("MCP smoke failed");
73
110
  console.error(error instanceof Error ? error.message : String(error));