@codetreker/daynight 0.21.3 → 0.21.8

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 (47) hide show
  1. package/README.md +29 -6
  2. package/dist/api/client.js +15 -2
  3. package/dist/api/client.js.map +1 -1
  4. package/dist/api/types.d.ts +1 -0
  5. package/dist/commands/review/instance-lock.js +2 -114
  6. package/dist/commands/review/instance-lock.js.map +1 -1
  7. package/dist/commands/skill/skills/using-daynight/SKILL.md +36 -40
  8. package/dist/commands/skill/skills/using-daynight/references/create-task.md +4 -5
  9. package/dist/commands/skill/skills/using-daynight/references/execute-task-in-managed.md +91 -0
  10. package/dist/commands/skill/skills/using-daynight/references/goal.md +23 -26
  11. package/dist/commands/skill/skills/using-daynight/references/handbook.md +22 -10
  12. package/dist/commands/skill/skills/using-daynight/references/handoff.md +1 -1
  13. package/dist/commands/skill/skills/using-daynight/references/run-task.md +55 -164
  14. package/dist/commands/skill/skills/using-daynight/references/task-execution.md +136 -0
  15. package/dist/commands/task/command.js +13 -1
  16. package/dist/commands/task/command.js.map +1 -1
  17. package/dist/commands/task/definition.js +3 -2
  18. package/dist/commands/task/definition.js.map +1 -1
  19. package/dist/commands/worker/identity.d.ts +2 -0
  20. package/dist/commands/worker/identity.js +41 -0
  21. package/dist/commands/worker/identity.js.map +1 -0
  22. package/dist/commands/worker/instance-lock.d.ts +6 -0
  23. package/dist/commands/worker/instance-lock.js +7 -0
  24. package/dist/commands/worker/instance-lock.js.map +1 -0
  25. package/dist/commands/worker/paths.d.ts +11 -0
  26. package/dist/commands/worker/paths.js +16 -0
  27. package/dist/commands/worker/paths.js.map +1 -0
  28. package/dist/commands/worker/store.d.ts +55 -0
  29. package/dist/commands/worker/store.js +460 -0
  30. package/dist/commands/worker/store.js.map +1 -0
  31. package/dist/commands/worker/types.d.ts +101 -0
  32. package/dist/commands/worker/types.js +2 -0
  33. package/dist/commands/worker/types.js.map +1 -0
  34. package/dist/commands/worker/worktrees.d.ts +29 -0
  35. package/dist/commands/worker/worktrees.js +285 -0
  36. package/dist/commands/worker/worktrees.js.map +1 -0
  37. package/dist/config/document.d.ts +1 -1
  38. package/dist/config/document.js +1 -0
  39. package/dist/config/document.js.map +1 -1
  40. package/dist/platform/instance-lock.d.ts +5 -0
  41. package/dist/platform/instance-lock.js +115 -0
  42. package/dist/platform/instance-lock.js.map +1 -0
  43. package/dist/repository/git.d.ts +2 -0
  44. package/dist/repository/git.js +8 -5
  45. package/dist/repository/git.js.map +1 -1
  46. package/package.json +2 -2
  47. package/dist/commands/skill/skills/using-daynight/references/autopilot.md +0 -136
@@ -0,0 +1,91 @@
1
+ # Execute one task in a managed environment
2
+
3
+ Use this mode only when the worker's startup prompt explicitly declares the
4
+ `worker-managed` environment, the `using-daynight` skill, and the
5
+ `execute-task-in-managed` mode. It executes one already-claimed assignment.
6
+ Read [the handbook](handbook.md) for CLI operations and failure semantics.
7
+
8
+ ## Establish the assignment
9
+
10
+ The startup prompt supplies `projectId`, `taskId`, the original `claimId`,
11
+ `worktreeId`, the actual worktree path and branch, and the execution's frozen
12
+ configuration. Use that explicit assignment throughout execution and recovery.
13
+ Task properties, the working directory, environment variables, and an ordinary
14
+ conversation request do not establish this managed context.
15
+
16
+ If a call is presented as managed but its launch declaration or assignment is
17
+ missing, incomplete, or mismatched, return waiting without task or business
18
+ writes. Do not infer replacement values or fall back to ordinary execution,
19
+ claiming, starting, or selecting another task.
20
+
21
+ The worker produces the launch prompt and decides subsequent scheduling. A new
22
+ agent started to recover the same claim receives the original mode and
23
+ assignment again. Reconnecting an existing live agent does not imply that the
24
+ startup prompt should be submitted again.
25
+
26
+ ## Verify the existing execution
27
+
28
+ Read the latest complete task using the supplied project and task IDs:
29
+
30
+ ```bash
31
+ daynight task show <task-id> --project <project-id> --json
32
+ ```
33
+
34
+ Verify its `projectId` and `id`, `status=in_progress`, and
35
+ `properties.worker.state=active` with the supplied `claimId` and `worktreeId`.
36
+ Verify the actual working directory and Git branch match the supplied worktree.
37
+ Use the supplied frozen execution configuration without replacing it from
38
+ current defaults. If the same claim is already `completed` and the task is
39
+ `done`, report the existing completion and return without reexecuting it. Any
40
+ other state or identity mismatch leaves execution waiting; an observed claim
41
+ change stops business writes immediately.
42
+
43
+ The worker has already claimed and started this task. Do not claim it, set it
44
+ to `in_progress`, select candidates, or rerun automatic candidate qualification.
45
+ Read and apply [shared task execution](task-execution.md) for the complete task
46
+ and stage inputs, current prerequisites, authorized work, evidence, and
47
+ acceptance. A missing required input or unmet prerequisite keeps this assignment
48
+ waiting in `in_progress`; it does not authorize another task.
49
+
50
+ Before resuming interrupted work or making task writes, refresh the complete
51
+ task using the supplied project and task IDs and verify the same active claim.
52
+ Retain the original claim ID through recovery and uncertain-write
53
+ reconciliation; never substitute a claim read from the task.
54
+
55
+ ## Execute within controller-owned resources
56
+
57
+ Use the supplied worktree and branch for authorized edits, commits, pushes, and
58
+ merges. Do not create, switch, or remove the system-managed worktree or branch.
59
+ Avoid merge options such as `gh pr merge --delete-branch` that may switch the
60
+ checkout or delete its branch. The worker owns resource cleanup after execution;
61
+ do not delete its worktree or close its workspace. Follow a cleanup request for
62
+ attributable temporary resources outside the worktree within its stated scope.
63
+
64
+ Use the Goal protocol for this task's required inputs and stage acceptance.
65
+ This mode never advances a Goal stage or executes a successor. The shared
66
+ execution and acceptance rules do not change that boundary.
67
+
68
+ ## Complete the original claim
69
+
70
+ When [shared acceptance readiness](task-execution.md#confirm-acceptance-readiness)
71
+ is satisfied, reread the complete task, verify the same active claim, and finish
72
+ with the original claim ID and the version observed for that decision:
73
+
74
+ ```bash
75
+ daynight task set-status <task-id> done --project <project-id> --claim-id <claim-id> --if-version <observed-version>
76
+ ```
77
+
78
+ This is the final task mutation. Confirm `done`,
79
+ `properties.worker.state=completed`, and the original claim ID in the service
80
+ result. A refused or unconfirmed write never falls back to ordinary completion
81
+ or automatic replay: read the actual task using the supplied project and task
82
+ IDs and reconcile only the original claim. An unreadable result remains
83
+ unconfirmed; an observed claim change stops further business writes.
84
+
85
+ ## Return to the controller
86
+
87
+ Return after this task completes or requires external intervention. Preserve the
88
+ assignment and waiting checkpoint when a human gate, an unmerged required PR,
89
+ missing permission, or unmet acceptance prevents completion. The worker decides
90
+ subsequent work and owns system-resource cleanup; this mode does not select a
91
+ successor or advance a Goal stage.
@@ -3,8 +3,9 @@
3
3
  Read this reference when starting or registering a Goal, discussing one of its
4
4
  stages, or advancing its authorized scope. Use [create-task](create-task.md) for
5
5
  registration, [the task content standard](task-content.md) for the shared six
6
- content requirements, [run-task](run-task.md) for task execution, and
7
- [the handbook](handbook.md) for CLI semantics. A Goal uses existing tasks,
6
+ content requirements, [shared task execution](task-execution.md) for input,
7
+ delivery, and acceptance rules, and [the handbook](handbook.md) for CLI semantics.
8
+ The selected execution mode owns task lifecycle and return behavior. A Goal uses existing tasks,
8
9
  attachments, complete `dependsOn` relationships, their `externalDependsOn`
9
10
  classification, and PR properties. It adds no resource, command, or status.
10
11
 
@@ -27,8 +28,9 @@ permission.
27
28
 
28
29
  A request to start a Goal discussion authorizes creating and starting
29
30
  that discussion task so it becomes `in_progress`. A registration-only request
30
- creates only the current discussion task in `todo` and returns without execution. A generic run request, Goal registration, or autopilot
31
- activation does not supply discussion-start or delivery execution authorization.
31
+ creates only the current discussion task in `todo` and returns without execution.
32
+ Goal registration alone does not supply discussion-start or delivery execution
33
+ authorization.
32
34
 
33
35
  ## Start requirements discussion
34
36
 
@@ -80,8 +82,8 @@ such as `Architecture discussion: <outcome>`, and an ordinary prerequisite on th
80
82
  completed requirements task. The user's direction to start this discussion
81
83
  provides its scoped execution authorization. Prepare its stage brief,
82
84
  read its current version, set in_progress through the same lifecycle, and
83
- confirm `in_progress`. This user-directed transition does not require autopilot
84
- and does not authorize selection of another unrelated task.
85
+ confirm `in_progress`. This user-directed transition is available to ordinary
86
+ execution only; it does not authorize selection of another unrelated task.
85
87
 
86
88
  ## Execute the appropriate stage
87
89
 
@@ -123,8 +125,8 @@ steps into tasks. The combined scope must cover the confirmed Goal, rather than
123
125
  vague placeholder.
124
126
 
125
127
  Create new delivery tasks in `todo`. Solution confirmation authorizes the
126
- confirmed breakdown's registration, not implementation, autopilot,
127
- automatic-execution permission, publishing, deployment, or merge. Apply any
128
+ confirmed breakdown's registration, not implementation, automatic-execution
129
+ permission, publishing, deployment, or merge. Apply any
128
130
  separate explicit authorization only within its stated scope. New tasks have
129
131
  `allowAgents=false`; registration does not enable it. Only a separately explicit
130
132
  [handoff](handoff.md) may review and enable permission; it does not supply delivery
@@ -224,26 +226,21 @@ new decision. Readiness and `in_progress` provide no ownership lock or lease.
224
226
 
225
227
  ## Advance and accept the whole Goal
226
228
 
227
- Automatic delivery discovery requires actual-runtime platform compatibility.
228
- Use autopilot's platform-filtered queries and preserve automatic-selection context
229
- for run-task's full-task recheck before setting in_progress. A user-specified fixed
230
- Goal queue keeps its manual path and existing execution scope across ready successors;
231
- it does not enable automatic discovery permission or bypass stage confirmation.
232
-
233
- A user-directed requirements-to-solution transition follows the confirmation
234
- protocol above. Ordinary `run-task` otherwise returns after its specified task
235
- completes or needs external intervention. Neither discussion completion nor
236
- breakdown registration activates autopilot or starts delivery. Only explicitly
237
- active autopilot selects later delivery work, and only with the existing readiness, input, and execution requirements. Automatic discovery
238
- requires `allowAgents=true`; an explicitly selected task or fixed Goal queue
239
- uses the manual execution path regardless of that flag. CI, review, and merge
240
- waits stay with the current delivery task.
241
-
242
- Delivery tasks follow normal run-task completion: accepted outcomes, required
229
+ Ordinary execution processes one specified task and returns after completion or
230
+ external wait. A user-directed requirements-to-solution transition follows the
231
+ confirmation protocol above and the ordinary execution mode. Neither discussion
232
+ completion nor breakdown registration starts delivery or selects later work.
233
+ Existing execution authorization for a fixed Goal scope remains within that
234
+ scope, but does not make the skill discover or continuously select successors.
235
+ CI, review, and merge waits stay with the current delivery task. Other execution
236
+ modes preserve their own return boundary when reading this stage protocol.
237
+
238
+ Delivery tasks satisfy [shared acceptance readiness](task-execution.md#confirm-acceptance-readiness)
239
+ and complete through their selected execution mode: accepted outcomes, required
243
240
  review, all necessary authorized PR merges, and readable evidence. To report the
244
241
  whole Goal complete, inspect the full confirmed delivery scope, every delivery
245
- task's completion, all required delivery PR merges, and the original
246
- whole-Goal requirements with their confirmed changes. Apply
242
+ task's completion, all required delivery PR merges, and the original whole-Goal
243
+ requirements with their confirmed changes. Apply
247
244
  [Final acceptance](../SKILL.md#final-acceptance) to the combined delivery and its
248
245
  evidence; completing or passing temporary helpers does not establish that the
249
246
  Goal is complete.
@@ -80,7 +80,20 @@ individual task reads.
80
80
 
81
81
  **Task status.** Creation starts in `todo` with no task approval stage and does
82
82
  not start execution. `task set-status <task-id> <status> --if-version <version>`
83
- sets any of `todo`, `in_progress`, or `done`. The service checks the exact version
83
+ sets any of `todo`, `in_progress`, or `done` through ordinary status setting.
84
+ To finish an explicitly supplied active worker claim, use
85
+ `task set-status <task-id> done --claim-id <claim-id> --if-version <version>`.
86
+ The claim ID must be a UUID and is valid only with `done`; the CLI never infers
87
+ it from task data or the environment. This path uses the existing worker
88
+ completion operation: a real completion requires the current owner, active
89
+ claim, in-progress task, and exact version, and retains worker history with
90
+ `state=completed`. Omit `--claim-id` for ordinary status setting; refusal never
91
+ causes fallback between these operations. Read the
92
+ [managed execution reference](execute-task-in-managed.md) only when the worker
93
+ startup prompt explicitly selects that mode; ordinary status operations do not
94
+ load its execution rules.
95
+
96
+ The service checks the exact version
84
97
  before a same-status no-op; it preserves all fields for a current-version no-op
85
98
  and refuses stale versions. A real change increments the version once. Generic
86
99
  metadata updates cannot write status. Status, materials, and readiness grant no
@@ -92,7 +105,7 @@ done; successors are never changed automatically. Entering in_progress starts a
92
105
  new execution interval and clears completion; returning to todo clears both
93
106
  endpoints. In_progress to done retains the nullable start and records completion.
94
107
  Todo to done records only completion, with unknown duration. Same-status and
95
- metadata updates preserve timing. State changes provide no process ownership,
108
+ metadata updates preserve timing. Ordinary status changes provide no process ownership,
96
109
  release, transfer, stop, or lease semantics. The Web confirms every status choice,
97
110
  including the current status; cancel and Escape submit no request.
98
111
 
@@ -267,11 +280,10 @@ create, establish identity from complete fields and operation context; a matchin
267
280
  title or an empty lookup alone is insufficient. Preserve actual errors and
268
281
  resource IDs rather than reporting success or blindly resending a write.
269
282
 
270
- Task registration, execution, selection, and requested handoff follow
271
- [create-task](create-task.md), [run-task](run-task.md), [autopilot](autopilot.md),
272
- and [handoff](handoff.md), respectively. For a chain of independently tracked
273
- delivery stages, use [the Goal protocol](goal.md).
274
- Every stage and delivery task follows the same todo/in_progress/done contract.
275
- A fixed Goal queue may use existing scoped execution authorization for its ready
276
- successors; registration and discussion confirmation grant no delivery execution
277
- permission.
283
+ Task registration, ordinary execution, and requested handoff follow
284
+ [create-task](create-task.md), [run-task](run-task.md), and [handoff](handoff.md),
285
+ respectively. For a chain of independently tracked delivery stages, use
286
+ [the Goal protocol](goal.md). Every stage and delivery task follows the same
287
+ todo/in_progress/done contract. Registration and discussion confirmation grant
288
+ no delivery execution permission. Each execution remains on its specified task;
289
+ listing ready work does not select or start it.
@@ -8,7 +8,7 @@ not authorize permission changes. Read [the handbook](handbook.md) for CLI
8
8
  operations and [the task content standard](task-content.md) for sufficiency.
9
9
 
10
10
  Handoff ends after review, any authorized permission update, and reconciliation.
11
- It does not start this session's run-task or autopilot, change status,
11
+ It does not start this session's task execution, change status,
12
12
  dependencies or platform, or grant independent implementation, merge, mainline
13
13
  push, deployment, or external-communication authority. Existing execution and
14
14
  delivery authorization remains applicable to later scheduling.
@@ -2,174 +2,65 @@
2
2
 
3
3
  Execute exactly one specified task ID within the user's authorized scope. Read
4
4
  [the handbook](handbook.md) for CLI operations, data semantics, and failures.
5
- This mode owns execution and completion; it returns without choosing a successor
6
- or activating autopilot. An explicit user-directed requirements-to-solution
7
- discussion transition follows the Goal protocol after current-task completion;
8
- it is not automatic backlog selection.
5
+ This mode owns the ordinary task lifecycle. It returns without choosing a
6
+ successor, except for the explicit user-directed requirements-to-solution
7
+ transition under [the Goal protocol](goal.md).
9
8
 
10
- ## Establish the task and stage
9
+ ## Establish the task
11
10
 
12
- Read the complete task with `daynight task show <task-id> --json`. Its Markdown
13
- description must identify the concrete current work, responsibility, and content
14
- sources. Read it and its actual required references under
15
- [the task content standard](task-content.md), including the solution, acceptance
16
- criteria, and explicit task-owned confirmation/evidence location. Complete inline
17
- content needs no primary attachment; document-owned and mixed organization are
18
- valid when the combined contents satisfy the same six requirements.
19
- Resolve description-relative links and images from the current task's attachment
20
- root; links inside a Markdown attachment use its own directory. Resolve real
21
- shared input references using the owning task ID and description/sections,
22
- complete paths for actual attachments, or a verified immutable repository
23
- reference. Read source descriptions through `task show --json` and actual
24
- attachment contents through the attachment commands; a task read does not load
25
- attachment inventory or bytes.
11
+ Read the complete task with `daynight task show <task-id> --json`. Preserve the
12
+ requested task ID through recovery and waiting. Read and apply
13
+ [shared task execution](task-execution.md) for its required inputs,
14
+ prerequisites, confirmed scope, work, evidence, and acceptance.
26
15
 
27
- For a Goal stage or delivery task, read [the Goal protocol](goal.md) and identify
28
- its role from the actual task content and context. Apply that stage's input and
29
- output requirements. Requirements and solution discussions start from their stage briefs;
30
- the completed requirements, applicable UI prototype, and architecture are outputs
31
- of the stages that produce them. Delivery tasks require the delivered design and
32
- applicable prototype. Before implementation, read every required architecture
33
- source listed in the delivery task's description: the owning architecture task's
34
- inline description and applicable sections, full paths for actual attachment
35
- documents, or verified immutable repository references. This also applies when
36
- the architecture task is only an indirect prerequisite. Confirm the
37
- description's references satisfy the Goal protocol. When a prototype is a required
38
- input, view and exercise it with its resources. An unfinished output of the current
39
- stage is not a missing input.
40
-
41
- An explicitly user-selected task may use the manual execution path regardless of
42
- `allowAgents` or platform compatibility; a fixed queue explicitly selected by the
43
- user has the same manual path. These conditions gate automatic selection, not
44
- explicit assignment. Automated task selection requires true and must not enable
45
- the flag itself. An automatically selected ID passed here remains automatic
46
- selection, even though run-task receives a concrete ID. Carry its actual runtime
47
- platform from autopilot and wait if unsupported or unknown. Immediately before
48
- setting in_progress, reread the full task and recheck `todo`, ready,
49
- `allowAgents=true`, and `requiredPlatform` either null or equal to that same actual
50
- platform. A changed or incompatible requirement prevents starting and requires a
51
- new selection decision; a changed execution environment requires fresh runtime
52
- identification and candidate queries. Use the exact version from this full-task
53
- recheck with `--if-version`; an earlier candidate page does not authorize the
54
- manual exception after automatic eligibility changes.
55
-
56
- Check state, every direct prerequisite, authorized scope, and required stage
57
- inputs. Read `dependsOn` and its `externalDependsOn` subset: ordinary edges
58
- express same-chain prerequisites, external marks distinguish verified cross-chain
59
- ownership. Both kinds must be done before entering in_progress or done. Classification
60
- never grants permission to execute a prerequisite, enable automatic
61
- execution, or remove a blocker.
62
- Missing required content, an unreadable required source, or a missing required
63
- architecture reference or input leaves execution unready. Resolve it within
64
- existing authorization or return the concrete issue. Do not infer requirements
65
- from a title or silently invent acceptance criteria. Do not execute prerequisites
66
- as an implicit expansion of the requested task.
16
+ An explicitly user-selected task may use this execution path regardless of
17
+ `allowAgents` or platform compatibility. These conditions gate automatic worker
18
+ selection, not an explicit task assignment. They do not remove dependencies,
19
+ stage inputs, or execution and delivery authorization. This mode does not select
20
+ candidates or automatically advance a fixed task queue.
67
21
 
68
22
  Creation leaves a task `todo` and does not execute it. An explicit request to
69
23
  start the current Goal discussion, or the user-directed transition that starts
70
- solution discussion, authorizes entering in_progress for that discussion under
24
+ solution discussion, authorizes entering `in_progress` for that discussion under
71
25
  the Goal protocol; registration alone does not. Existing execution authorization
72
- may cover the stated task or fixed Goal queue and its ready successors. Task
73
- status never expands implementation or delivery authorization.
74
-
75
- For ready `todo`, begin only when dependencies are done, required stage inputs are complete
76
- and the work is authorized. Use `task set-status <task-id> in_progress` with the exact version observed for
77
- that decision and confirm in_progress before starting. A stale version or
78
- changed prerequisite requires rereading and reconsidering, with no automatic
79
- mutation retry. For `in_progress`, recover existing work and coordinate using the
80
- project's established mechanisms; the state is not an assignee lock or lease.
81
- A task already `done` is reported as such unless reopening is within the explicit requested scope; use the same versioned status setter and dependency protection.
82
- Preserve the requested task ID through recovery and waiting.
83
-
84
- ## Execute and maintain continuity
85
-
86
- Before analysis, questions, or proposals, establish this task's confirmed scope
87
- and acceptance criteria and apply the [shared scope constraint](../SKILL.md#shared-constraints)
88
- to execution and discussion.
89
-
90
- Identify [final acceptance](../SKILL.md#final-acceptance) from the task's confirmed
91
- outcome before applying a development or PR delivery lifecycle. Read the complete
92
- requirements and actual deliveries for the task or Goal being assessed, and apply
93
- the shared rule to verification methods, temporary helpers, and result ownership.
94
-
95
- Follow the target repository's instructions for worktrees, implementation,
96
- review, validation, and delivery. Use the task's stage-appropriate solution and
97
- acceptance criteria, including applicable final-style prototype interactions.
98
- Requirements discussion defines the problem without architecture decisions or
99
- production implementation. Only user-confirmed requirements and direction to
100
- continue permit completing that discussion and starting solution discussion.
101
- Solution discussion keeps the draft architecture and breakdown in its owning
102
- task. Only explicit user confirmation of the current solution permits registering
103
- and verifying the actual delivery tasks. Do not start delivery from either
104
- discussion. Keep the discussion in_progress while its user-confirmation gate is
105
- unmet; a material revision after confirmation needs renewed user confirmation.
106
-
107
- Resolve material changes to the agreed solution or acceptance within the current
108
- authorization. Rewrite the owning artifact and affected task summaries and input
109
- references coherently. Preserve requirements; do not silently weaken acceptance.
110
- Descriptions remain self-contained Markdown task summaries. Preserve valid
111
- syntax, original content, and actual resource references during full-field
112
- updates; confirm new or replaced resources before linking them. Dependency edits
113
- must follow the handbook's CLI replacement contract: read full D/E, retain needed
114
- ordinary D−E and external E declarations, submit their intended complete sets
115
- with the observed version, and read back both. Omit all dependency options for
116
- unrelated metadata updates. Keep detailed content at its identified owner and
117
- confirmations and evidence at their explicit task-owned location; shared inputs
118
- remain at their verified source.
119
-
120
- Advance only this task. Subagents collaborate on it, and waiting for CI, review,
121
- approval, or merge remains part of it. Keep all required delivery PR URLs and
122
- titles in the complete `properties.pullRequests` list, preserving existing
123
- entries. Record acceptance results and necessary delivery evidence, including
124
- merge commits, at this task's identified evidence location against the
125
- corresponding acceptance criteria.
126
- Rewrite current evidence coherently rather than accumulating an execution log.
127
- Keep operational progress, blockers, waiting items, and next action in the
128
- conversation or existing execution checkpoint, retaining the task ID and needed
129
- PR and workspace references.
130
-
131
- ## Confirm completion or return waiting
132
-
133
- Goal requirements and solution discussion tasks use the user-confirmed material
134
- and stage acceptance in the Goal protocol. A generic repository PR rule does not
135
- add a PR-merge prerequisite to these Daynight discussions. If particular
136
- repository artifacts or PR delivery are explicitly part of that discussion
137
- task's acceptance, honor that requirement under the delivery rules below.
138
- Unconfirmed discussion material keeps its discussion task in_progress.
139
-
140
- Development tasks and design or documentation delivery tasks with PRs remain
141
- `in_progress` until the hosting platform confirms **every necessary delivery PR
142
- is merged** and all stage acceptance criteria are satisfied. Code completion,
143
- passing CI, approved review, and an open PR do not satisfy this condition. Verify
144
- actual merge state through the host's native client or API; do not assume a
145
- particular host.
146
-
147
- Completion rules grant no merge, deployment, external communication, or mainline
148
- push permission. Follow existing authorization without asking again for actions
149
- it covers. If the user requests an open PR for review or forbids merging, deliver
150
- the reviewable PR, preserve `in_progress` and the waiting checkpoint, and return
151
- its URL and required user action. Do not enable auto-merge. Missing permission,
152
- unavailable merge visibility, or an unmet merge check likewise keeps completion
153
- pending and successors blocked.
154
-
155
- For tasks without a development or PR delivery path, use their stated stage
156
- acceptance. For [final acceptance](../SKILL.md#final-acceptance), also apply the
157
- shared whole-task or whole-Goal completion rule. In every case, confirm required
158
- evidence is recorded and readable, then reread the complete in-progress
159
- task and use `task set-status <task-id> done` with its exact
160
- observed version. For Goal discussions, use their confirmation gates and verified
161
- accepted materials; for delivery tasks, use their acceptance and required authorized PR
162
- merges.
163
- Only service confirmation establishes the status update; reconcile uncertain
164
- results before reporting success. A Goal requirements discussion task's completion
165
- means requirements are confirmed; solution discussion completion means the user-confirmed solution and
166
- actual verified breakdown are delivered. Neither establishes whole-Goal completion.
167
-
168
- Continue ordinary CI and review waits as this task. When progress requires
169
- external intervention, preserve the target, actual state, concrete blocker,
170
- existing work, and next action in the checkpoint, then return the waiting result.
171
- Unstarted work stays `todo`; active work stays `in_progress`. Do not declare
172
- completion or select other work to bypass a wait. After completion, return
173
- without selecting a successor, except for an explicit user-directed discussion
174
- transition under the Goal protocol. That transition does not activate autopilot
175
- or authorize delivery. Whole-Goal acceptance follows the Goal protocol.
26
+ remains limited to its stated scope. Task status never expands implementation
27
+ or delivery authorization.
28
+
29
+ ## Start or resume the task
30
+
31
+ For ready `todo`, begin only when dependencies are done, required stage inputs
32
+ are complete, and the work is authorized. Use
33
+ `task set-status <task-id> in_progress --if-version <observed-version>` with the
34
+ exact version observed for that decision and confirm `in_progress` before
35
+ starting. A stale version or changed prerequisite requires rereading and
36
+ reconsidering, with no automatic mutation retry.
37
+
38
+ For `in_progress`, recover existing work and coordinate using the project's
39
+ established mechanisms; the state is not an assignee lock or lease. A task
40
+ already `done` is reported as such unless reopening is within the explicit
41
+ requested scope. An authorized reopening uses the same versioned status setter
42
+ and dependency protection.
43
+
44
+ Perform the authorized work and establish acceptance readiness under
45
+ [shared task execution](task-execution.md). Starting a task is not evidence that
46
+ its delivery or acceptance is complete.
47
+
48
+ ## Complete or return waiting
49
+
50
+ When all task acceptance and delivery conditions are satisfied and its evidence
51
+ is readable, reread the complete in-progress task and use
52
+ `task set-status <task-id> done --if-version <observed-version>` with its exact
53
+ observed version. Only service confirmation establishes the status update;
54
+ reconcile uncertain results before reporting success. Do not replay an
55
+ unconfirmed mutation automatically.
56
+
57
+ For Goal discussions, completion follows the confirmation gates and accepted
58
+ materials in the Goal protocol. After requirements completion is confirmed, an
59
+ explicit user direction can start the specified solution discussion under that
60
+ protocol. It grants no automatic successor selection or delivery authorization.
61
+ Whole-Goal acceptance follows the Goal protocol.
62
+
63
+ Otherwise return after this task completes or needs external intervention.
64
+ Unstarted work stays `todo`; active work stays `in_progress`. Keep the target and
65
+ waiting checkpoint when necessary PR merges, human confirmation, permission, or
66
+ acceptance remain pending; do not select another task to bypass the wait.
@@ -0,0 +1,136 @@
1
+ # Shared task execution
2
+
3
+ Read this reference after the selected execution mode establishes the task's
4
+ identity. It owns required inputs, authorized work, delivery, evidence, and
5
+ acceptance readiness. The execution mode owns starting or resuming the task,
6
+ its final status operation, and returning to its caller.
7
+
8
+ ## Read the task and stage inputs
9
+
10
+ Read the complete task and its actual required references under
11
+ [the task content standard](task-content.md), including the solution, acceptance
12
+ criteria, and explicit task-owned confirmation/evidence location. Its Markdown
13
+ description must identify the concrete current work, responsibility, and content
14
+ sources. Complete inline content needs no primary attachment; document-owned
15
+ and mixed organization are valid when their combined contents satisfy the same
16
+ six requirements.
17
+
18
+ Resolve description-relative links and images from the current task's attachment
19
+ root; links inside a Markdown attachment use its own directory. Resolve real
20
+ shared input references using the owning task ID and description/sections,
21
+ complete paths for actual attachments, or a verified immutable repository
22
+ reference. Read source descriptions through `task show --json` and actual
23
+ attachment contents through the attachment commands; a task read does not load
24
+ attachment inventory or bytes.
25
+
26
+ For a Goal stage or delivery task, read [the Goal protocol](goal.md) and identify
27
+ its role from the actual task content and context. Apply that stage's input and
28
+ output requirements. Requirements and solution discussions start from their
29
+ stage briefs; the completed requirements, applicable UI prototype, and
30
+ architecture are outputs of the stages that produce them. Delivery tasks
31
+ require the delivered design and applicable prototype. Before implementation,
32
+ read every required architecture source listed in the delivery task's
33
+ description: the owning architecture task's inline description and applicable
34
+ sections, full paths for actual attachment documents, or verified immutable
35
+ repository references. This also applies when the architecture task is only an
36
+ indirect prerequisite. Confirm that the description's references satisfy the
37
+ Goal protocol. When a prototype is a required input, view and exercise it with
38
+ its resources. An unfinished output of the current stage is not a missing input.
39
+
40
+ ## Verify prerequisites and scope
41
+
42
+ Check state, every direct prerequisite, authorized scope, and required stage
43
+ inputs. Read `dependsOn` and its `externalDependsOn` subset: ordinary edges
44
+ express same-chain prerequisites, and external marks distinguish verified
45
+ cross-chain ownership. Both kinds must be done before starting or completing
46
+ work. Classification never grants permission to execute a prerequisite, enable
47
+ automatic execution, or remove a blocker.
48
+
49
+ Missing required content, an unreadable required source, or a missing required
50
+ architecture reference or input leaves execution unready. Resolve it within
51
+ existing authorization or return the concrete issue. Do not infer requirements
52
+ from a title or silently invent acceptance criteria. Do not execute prerequisites
53
+ as an implicit expansion of the requested task.
54
+
55
+ Before analysis, questions, or proposals, establish this task's confirmed scope
56
+ and acceptance criteria and apply the [shared scope constraint](../SKILL.md#shared-constraints)
57
+ to execution and discussion.
58
+
59
+ ## Execute and maintain continuity
60
+
61
+ Identify [final acceptance](../SKILL.md#final-acceptance) from the task's confirmed
62
+ outcome before applying a development or PR delivery lifecycle. Read the complete
63
+ requirements and actual deliveries for the task or Goal being assessed, and
64
+ apply the shared rule to verification methods, temporary helpers, and result
65
+ ownership.
66
+
67
+ Follow the target repository's instructions for worktrees, implementation,
68
+ review, validation, and delivery. Use the task's stage-appropriate solution and
69
+ acceptance criteria, including applicable final-style prototype interactions.
70
+ Requirements discussion defines the problem without architecture decisions or
71
+ production implementation. Solution discussion keeps its draft architecture and
72
+ breakdown in its owning task. Preserve the Goal's user-confirmation gates:
73
+ completed text, a review result, or successful checks cannot replace the user's
74
+ confirmation or authorize delivery. Keep an unconfirmed discussion in progress;
75
+ a material revision after confirmation needs renewed user confirmation.
76
+
77
+ Resolve material changes to the agreed solution or acceptance within the current
78
+ authorization. Rewrite the owning artifact and affected task summaries and input
79
+ references coherently. Preserve requirements; do not silently weaken acceptance.
80
+ Descriptions remain self-contained Markdown task summaries. Preserve valid
81
+ syntax, original content, and actual resource references during full-field
82
+ updates; confirm new or replaced resources before linking them. Dependency edits
83
+ must follow the handbook's CLI replacement contract: read full D/E, retain needed
84
+ ordinary D−E and external E declarations, submit their intended complete sets
85
+ with the observed version, and read back both. Omit all dependency options for
86
+ unrelated metadata updates. Keep detailed content at its identified owner and
87
+ confirmations and evidence at their explicit task-owned location; shared inputs
88
+ remain at their verified source.
89
+
90
+ Advance only this task. Subagents collaborate on it, and waiting for CI, review,
91
+ approval, or merge remains part of it. Keep all required delivery PR URLs and
92
+ titles in the complete `properties.pullRequests` list, preserving existing
93
+ entries. Record acceptance results and necessary delivery evidence, including
94
+ merge commits, at this task's identified evidence location against the
95
+ corresponding acceptance criteria. Rewrite current evidence coherently rather
96
+ than accumulating an execution log. Keep operational progress, blockers, waiting
97
+ items, and next action in the conversation or existing execution checkpoint,
98
+ retaining the task ID and needed PR and workspace references.
99
+
100
+ ## Confirm acceptance readiness
101
+
102
+ Goal requirements and solution discussion tasks use the user-confirmed material
103
+ and stage acceptance in the Goal protocol. A generic repository PR rule does not
104
+ add a PR-merge prerequisite to these Daynight discussions. If particular
105
+ repository artifacts or PR delivery are explicitly part of that discussion
106
+ task's acceptance, honor that requirement under its delivery rules.
107
+ Unconfirmed discussion material keeps its discussion task in progress.
108
+
109
+ Development tasks and design or documentation delivery tasks with PRs remain
110
+ in progress until the hosting platform confirms **every necessary delivery PR
111
+ is merged** and all stage acceptance criteria are satisfied. Code completion,
112
+ passing CI, approved review, and an open PR do not satisfy this condition. Verify
113
+ actual merge state through the host's native client or API; do not assume a
114
+ particular host.
115
+
116
+ Completion rules grant no merge, deployment, external communication, or mainline
117
+ push permission. Follow existing authorization without asking again for actions
118
+ it covers. If the user requests an open PR for review or forbids merging, deliver
119
+ the reviewable PR and preserve the waiting checkpoint. Do not enable auto-merge.
120
+ Missing permission, unavailable merge visibility, or an unmet merge check keeps
121
+ completion pending and successors blocked.
122
+
123
+ For tasks without a development or PR delivery path, use their stated stage
124
+ acceptance. For [final acceptance](../SKILL.md#final-acceptance), also apply the
125
+ shared whole-task or whole-Goal completion rule. In every case, confirm required
126
+ evidence is recorded and readable before returning to the execution mode's
127
+ completion operation. Discussion completion establishes that stage's accepted
128
+ output; it does not establish whole-Goal completion.
129
+
130
+ ## Preserve waiting context
131
+
132
+ Continue CI and review waits as this task. When progress requires external
133
+ intervention, preserve the target, actual state, concrete blocker, existing work,
134
+ and next action in the checkpoint, then return the waiting result through the
135
+ selected execution mode. Do not declare completion or select other work to
136
+ bypass a wait. Preserve the task ID through recovery and waiting.