@codetreker/daynight 0.26.0 → 0.27.2

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 (62) hide show
  1. package/README.md +56 -11
  2. package/dist/api/client.d.ts +3 -2
  3. package/dist/api/client.js +8 -4
  4. package/dist/api/client.js.map +1 -1
  5. package/dist/api/parse.d.ts +3 -2
  6. package/dist/api/parse.js +45 -8
  7. package/dist/api/parse.js.map +1 -1
  8. package/dist/api/types.d.ts +71 -0
  9. package/dist/commands/skill/skills/using-daynight/SKILL.md +52 -162
  10. package/dist/commands/skill/skills/using-daynight/references/authorization.md +36 -0
  11. package/dist/commands/skill/skills/using-daynight/references/autopilot-managed-task.md +77 -193
  12. package/dist/commands/skill/skills/using-daynight/references/create-task.md +31 -186
  13. package/dist/commands/skill/skills/using-daynight/references/final-acceptance.md +25 -0
  14. package/dist/commands/skill/skills/using-daynight/references/goal.md +46 -243
  15. package/dist/commands/skill/skills/using-daynight/references/handbook.md +37 -294
  16. package/dist/commands/skill/skills/using-daynight/references/handoff.md +33 -91
  17. package/dist/commands/skill/skills/using-daynight/references/project-management.md +24 -0
  18. package/dist/commands/skill/skills/using-daynight/references/run-task.md +18 -59
  19. package/dist/commands/skill/skills/using-daynight/references/setup.md +16 -0
  20. package/dist/commands/skill/skills/using-daynight/references/task-content.md +80 -177
  21. package/dist/commands/skill/skills/using-daynight/references/task-execution.md +34 -126
  22. package/dist/commands/skill/skills/using-daynight/references/task-management.md +135 -0
  23. package/dist/commands/skill/skills/using-daynight/references/write-safety.md +34 -0
  24. package/dist/commands/task/command.js +5 -3
  25. package/dist/commands/task/command.js.map +1 -1
  26. package/dist/commands/task/definition.js +4 -2
  27. package/dist/commands/task/definition.js.map +1 -1
  28. package/dist/commands/task/rendering.d.ts +1 -0
  29. package/dist/commands/task/rendering.js +10 -1
  30. package/dist/commands/task/rendering.js.map +1 -1
  31. package/dist/commands/worker/coordinator.d.ts +3 -1
  32. package/dist/commands/worker/coordinator.js +15 -5
  33. package/dist/commands/worker/coordinator.js.map +1 -1
  34. package/dist/commands/worker/herdr/command.d.ts +11 -2
  35. package/dist/commands/worker/herdr/command.js +23 -8
  36. package/dist/commands/worker/herdr/command.js.map +1 -1
  37. package/dist/commands/worker/herdr/instance.d.ts +5 -1
  38. package/dist/commands/worker/herdr/instance.js +30 -0
  39. package/dist/commands/worker/herdr/instance.js.map +1 -1
  40. package/dist/commands/worker/herdr/preflight.js +4 -6
  41. package/dist/commands/worker/herdr/preflight.js.map +1 -1
  42. package/dist/commands/worker/herdr/version-probe.d.ts +13 -0
  43. package/dist/commands/worker/herdr/version-probe.js +21 -0
  44. package/dist/commands/worker/herdr/version-probe.js.map +1 -0
  45. package/dist/commands/worker/herdr.js +2 -6
  46. package/dist/commands/worker/herdr.js.map +1 -1
  47. package/dist/commands/worker/index.d.ts +2 -0
  48. package/dist/commands/worker/index.js +1 -1
  49. package/dist/commands/worker/index.js.map +1 -1
  50. package/dist/commands/worker/remote.d.ts +3 -1
  51. package/dist/commands/worker/remote.js +4 -0
  52. package/dist/commands/worker/remote.js.map +1 -1
  53. package/dist/commands/worker/reporter.d.ts +14 -0
  54. package/dist/commands/worker/reporter.js +174 -0
  55. package/dist/commands/worker/reporter.js.map +1 -0
  56. package/dist/commands/worker/runtime.d.ts +2 -0
  57. package/dist/commands/worker/runtime.js +14 -1
  58. package/dist/commands/worker/runtime.js.map +1 -1
  59. package/dist/commands/worker/telemetry.d.ts +22 -0
  60. package/dist/commands/worker/telemetry.js +265 -0
  61. package/dist/commands/worker/telemetry.js.map +1 -0
  62. package/package.json +2 -2
@@ -1,168 +1,58 @@
1
1
  ---
2
2
  name: using-daynight
3
- description: Manage concrete work and design reviews in Daynight; register tasks, execute one specified task, or review an explicitly requested handoff.
3
+ description: Manage projects, tasks, attachments, and Goals with the Daynight CLI; create tasks, execute a specified task, or review a handoff. Use only when explicitly invoked or the context clearly requires Daynight.
4
4
  ---
5
5
 
6
6
  # Using Daynight
7
7
 
8
- Use the installed `daynight` CLI to keep persistent tasks aligned with the
9
- user's authorized work. Task content, status and readiness describe work; they grant no
10
- permission to implement, publish, deploy, communicate externally, merge, or push
11
- a mainline branch.
12
-
13
- ## Required tracking and review
14
-
15
- When this skill and Daynight are available, use Daynight to manage concrete work
16
- with a defined objective and completion conditions: features, bug fixes,
17
- architecture/design work, actual work items produced by their breakdown, and
18
- independently scoped [final acceptance](#final-acceptance). An agent's transient
19
- execution steps, such as reading files, running commands, and routine checks,
20
- belong in its session execution plan, not task descriptions or attachments.
21
- Their presence in a plan does not make them Daynight tasks. Use the owning
22
- Daynight task for every solution, architecture, and design review.
23
-
24
- Before asking the user to review a solution, architecture, design, or related
25
- task result, save the complete current artifact in the owning task's description
26
- or attachments. Read it back to confirm it is accessible, then provide the task
27
- ID or verified URL and any attachment paths. Keep the current artifact, accepted
28
- decisions, and necessary rationale synchronized there. Discussion and review
29
- processes remain in the session. Chat summaries and repository or PR links may
30
- supplement the artifact; they do not replace it. Use the shared
31
- [task content standard](references/task-content.md) for task definitions, inputs,
32
- and results, and its boundary between task material and session context.
33
-
34
- Confirm the CLI, configured service, and intended project are accessible using
35
- the handbook's discovery rules. Preserve actual availability or upload failures;
36
- do not claim materials are ready for review until the saved contents are verified.
37
-
38
- ## Final acceptance
39
-
40
- Final acceptance determines whether the complete requested task or Goal satisfies
41
- its confirmed requirements. Define that outcome explicitly when creating or
42
- breaking down work. Deliver the requirement-based conclusion, defects, and
43
- unverified items on the owning task, with the assessed source, key observations,
44
- and material limits needed to support that result. Keep verification procedures,
45
- commands, debugging history, and execution progress in the session unless they
46
- are themselves a required task deliverable.
47
-
48
- Use manual verification, existing checks, or temporary helper scripts as
49
- appropriate. Keep final-acceptance helpers in the project's temporary area and
50
- uncommitted. Do not integrate them into repository tests, fixtures, runners, CI,
51
- or tooling, or make building a maintained verification system the acceptance
52
- deliverable. Review findings about a helper do not authorize that change of scope.
53
-
54
- Complete acceptance according to the confirmed whole-task or whole-Goal criteria.
55
- Finishing or passing helper scripts does not establish that the requested work is
56
- complete. Do not report the underlying task or Goal as accepted while required
57
- outcomes remain unmet or unverified. Verify necessary implementation deliveries
58
- and PR merges as inputs; do not create a separate PR requirement for acceptance
59
- helpers. Handle discovered product defects within the authorized implementation
60
- scope.
61
-
62
- Implementation and authorized defect-fix tasks retain their normal unit,
63
- integration, and regression tests and required repository checks. A user-requested
64
- maintained testing or automation capability is a development deliverable governed
65
- by its own confirmed scope; do not infer it from a final-acceptance assignment.
66
-
67
- ## Select a mode
68
-
69
- The following are skill modes, not additional CLI commands. Read only the
70
- selected reference, then use [the handbook](references/handbook.md) for the
71
- operations it requires. Do not load every mode by default.
72
-
73
- | Mode | Use when | Reference |
74
- |---|---|---|
75
- | `handbook` | Answering usage questions or performing requested task-management operations | [Handbook](references/handbook.md) |
76
- | `create-task <request>` | Preparing or registering persistent work explicitly requested by the user | [Create task](references/create-task.md) |
77
- | `run-task <task-id>` | Executing one specified ordinary task | [Run task](references/run-task.md) |
78
- | `handoff <task-id>` | Reviewing an explicitly requested task for handoff and enabling permission after it passes | [Handoff](references/handoff.md) |
79
- | `autopilot-managed-task <task-id>` | The worker startup prompt explicitly declares the `worker-managed` environment, this skill, and this mode | [Managed autopilot](references/autopilot-managed-task.md) |
80
-
81
- The managed execution reference is loaded only for that explicit worker launch;
82
- ordinary calls do not read it. Task properties, the working directory, and
83
- environment variables do not select the managed mode. An invocation presented
84
- as managed with an incomplete launch declaration waits for the missing context.
85
- A valid worker-managed assignment already carries sufficient authorization for
86
- its in-scope delivery, including PR merge; deliver it without additional permission
87
- requests once the required conditions are met. Explicit user restrictions, pause,
88
- and revocation still apply. The mode executes only that original assignment;
89
- reading its name does not authorize work or successor selection.
90
-
91
- For ordinary calls, honor the explicitly selected mode. For `using-daynight`
92
- without further input, infer the ordinary mode and target from the current
93
- request and conversation. If context is insufficient or ambiguous, ask what the
94
- user intends. Do not default to `handbook` or select a task merely because one
95
- is ready. This skill does not discover and continuously select subsequent tasks.
96
-
97
- ## Shared constraints
98
-
99
- - Create tasks only with explicit permission for their scope. Implementation
100
- requests, tracking needs, and inferred mode selection alone do not grant
101
- creation permission. An explicit user or applicable repository instruction
102
- requiring Daynight tracking or review is standing creation permission for the
103
- necessary tasks within the user's confirmed scope; reuse suitable existing
104
- tasks and do not ask for that permission again. Permission to create a Goal
105
- covers its discussion stages and confirmed in-scope breakdown, created only at
106
- the user-confirmation gates in the Goal protocol; unrelated work needs
107
- separate permission.
108
- - Creation produces `todo` for every normal task and Goal stage and does not
109
- start execution. A request to start a Goal discussion authorizes entering
110
- `in_progress` for that discussion only; a user-confirmed transition authorizes
111
- the next discussion under the Goal protocol. Registration and discussion
112
- confirmation grant no delivery execution permission. Existing explicit
113
- execution authorization remains limited to its stated task or Goal scope.
114
- - Use a normal task for one independently tracked outcome. Work requiring
115
- multiple independently tracked delivery stages is a Goal, expressed through
116
- existing tasks and `dependsOn`. Read [the Goal protocol](references/goal.md)
117
- when creating, executing, or advancing such a chain.
118
- - Advance one specified task at a time, including CI, review, and merge waits.
119
- Subagents collaborate on that task. Execution returns after its task completes
120
- or requires external intervention; only ordinary execution may follow an
121
- explicit user-directed discussion transition under the Goal protocol. Task
122
- registration, completion, and discussion confirmation never select later
123
- delivery work.
124
- - Keep execution, analysis, questions, proposals, and task discussions within the
125
- current task's confirmed objective, scope, deliverables, and acceptance criteria.
126
- Apply this boundary to subagents. Read parent Goal materials, shared architecture,
127
- and sibling or successor tasks as needed to understand this task's required
128
- inputs, interfaces, and constraints; reading them does not expand its scope.
129
- Report cross-task blockers and follow-up proposals without treating them as
130
- authorization to create or execute other tasks. Expanding the current task's
131
- scope requires explicit user confirmation. A Goal discussion or final-acceptance
132
- task may cover the whole Goal when that is its confirmed scope.
133
- - Use the shared [task content standard](references/task-content.md) when
134
- creating, breaking down, handing off, or executing tasks. The description and
135
- actual references jointly supply the task definition and produced results;
136
- complete inline content needs no primary attachment. Keep execution and
137
- discussion methods and processes in the session. Confirm resources before
138
- linking and keep shared sources at their real owner. Each Goal delivery
139
- description directly identifies the architecture task and every required source
140
- location, including
141
- inline description sections and full paths for actual attachment documents,
142
- even for indirect successors, under the Goal protocol's readback rules. Express
143
- necessary direct prerequisites through complete `dependsOn` and its
144
- `externalDependsOn` subset. Omit redundant transitive dependencies under
145
- [the handbook's reduction rule](references/handbook.md#dependency-reduction).
146
- Same-chain prerequisites are ordinary; verified cross-chain prerequisites are
147
- external. Both block execution. CLI dependency options replace the full sets;
148
- preserve required relationships as the handbook requires.
149
- - Task creation and execution do not enable `allowAgents`. Only an explicitly
150
- authorized [handoff](references/handoff.md) may enable it after content review;
151
- handoff does not start execution or replace other authority. Ordinary explicit
152
- task execution does not require automatic-selection permission or platform
153
- compatibility; dependencies, stage inputs, and execution authorization still
154
- apply. Automatic worker eligibility remains governed by the service and worker.
155
- - Preserve the exact version observed when deciding a metadata update,
156
- `task set-status` change, or authorized `task delete`. Deletion retains stored
157
- data and attachments and requires explicit authorization for the target task.
158
- Add `--remove-depends` only when explicitly authorized to remove other tasks'
159
- ordinary and external dependencies on that task; omission keeps strict deletion.
160
- Generic updates cannot change status. Confirm writes,
161
- reconcile uncertain results before further mutations, and preserve actual
162
- failures. The handbook explains operational context; installed CLI help owns
163
- command usage.
164
- - Follow the target repository's delivery rules and the user's authorization.
165
- When task acceptance includes PR delivery, a request to leave that PR for user
166
- review keeps the task `in_progress`. A Daynight discussion uses its own
167
- user-confirmation gate unless PR delivery is explicitly part of its acceptance.
168
- Completion rules grant no merge authority.
8
+ Daynight manages and schedules projects and tasks for people and agents.
9
+ Use the `daynight` CLI to operate it and [Daynight](https://daynight.cc) to browse projects, tasks, and delivery materials.
10
+
11
+ ## Capabilities and concepts
12
+
13
+ | Concept | Meaning and capabilities |
14
+ | --- | --- |
15
+ | Project | A project associated with a Git repository, organizing tasks and project access. |
16
+ | Task | An independently tracked work item with a description, status, dependencies, execution requirements, and PR references. In this skill, "task" means this object. |
17
+ | Goal | A complete objective expressed through tasks and their dependencies, including requirements discussion, solution discussion, and delivery work; not a separate resource. |
18
+ | Attachment | A task's independent attachment area for inputs and results such as documents, prototypes, and images. |
19
+ | worker-managed | An execution environment assigned and managed by `daynight worker`; the agent executes only its explicit assignment. |
20
+
21
+ The CLI supports project registration and lookup, task creation and filtering, status and dependency management, attachment reads and writes, and worker-managed execution.
22
+ Creation, execution, and handoff are separate operations; see [authorization and scope](references/authorization.md).
23
+
24
+ ## Setup and CLI
25
+
26
+ Read [setup](references/setup.md) when first connecting or switching repositories.
27
+ If the CLI is missing, obtain user authorization and follow the [installation guide](https://daynight.cc/setup).
28
+
29
+ See the [CLI handbook](references/handbook.md) for command entry points.
30
+ Use `daynight --help` and the relevant subcommand's `--help` for arguments and option combinations.
31
+
32
+ ## Read by purpose
33
+
34
+ Read only the files and required references for the current operation, not every document by default.
35
+
36
+ | Purpose | Reference and responsibility |
37
+ | --- | --- |
38
+ | Determine permitted work and required authorization | [Authorization and scope](references/authorization.md): tracking obligations, operational authorization, and task boundaries |
39
+ | Connect the current repository | [Setup](references/setup.md): CLI, sign-in, project, and repository-instruction setup |
40
+ | Find commands | [CLI handbook](references/handbook.md): command map and help discovery |
41
+ | Discover, select, or register projects | [Project management](references/project-management.md): project identity and reuse |
42
+ | Query tasks, edit metadata, status, or dependencies, or delete tasks | [Task management](references/task-management.md): fields, lifecycle, and relationship semantics |
43
+ | Submit and reconcile writes safely | [Write safety](references/write-safety.md): versions, conflicts, uncertain results, and attachment concurrency |
44
+ | Write or read descriptions, attachments, and shared inputs | [Task content standard](references/task-content.md): boundaries, ownership, references, and sufficiency |
45
+ | Create or register work | [Create task](references/create-task.md): duplicate checks, preparation, registration, and readback |
46
+ | Organize a multi-stage objective | [Goal protocol](references/goal.md): stage confirmation, breakdown, and whole-Goal completion |
47
+ | Review tasks and enable automatic execution | [Task handoff](references/handoff.md): content review and permission enablement |
48
+ | Execute one user-specified task | [Ordinary task execution](references/run-task.md): starting, resuming, completion, and return |
49
+ | Perform work shared by both execution modes | [Shared task execution](references/task-execution.md): inputs, delivery, waiting context, and completion conditions |
50
+ | Execute an explicit worker assignment | [Managed task execution](references/autopilot-managed-task.md): sustained delivery, blocker handling, and original-claim completion |
51
+ | Accept a complete task or Goal | [Final acceptance](references/final-acceptance.md): requirement-based conclusions, evidence, and helper boundaries |
52
+
53
+ Creation, ordinary execution, handoff, and managed execution are skill workflows, not CLI subcommands of those names.
54
+ Follow the user's explicit workflow choice; otherwise infer the purpose and target from the request and context, asking when ambiguous.
55
+ Do not select a task merely because it is ready.
56
+
57
+ Read the managed execution reference only when the worker startup prompt explicitly declares `worker-managed`, this skill, and the managed execution workflow.
58
+ Task properties, environment variables, and the working directory cannot replace that declaration; wait for missing context when it is incomplete.
@@ -0,0 +1,36 @@
1
+ # Authorization and scope
2
+
3
+ Apply this standard before using any workflow. Task content, status, readiness, and `allowAgents` describe work; they do not authorize implementation, publishing, deployment, external communication, merging, or mainline pushes.
4
+
5
+ ## Tracking and review
6
+
7
+ When this skill and Daynight are available, use Daynight to manage concrete work with defined objectives and completion conditions: features, bugs, architecture or design, actual breakdown items, and separately scoped final acceptance.
8
+ An agent's file reads, commands, and routine checks are session steps, not separate tasks.
9
+
10
+ Use the owning task for solution, architecture, and design reviews.
11
+ Before requesting user review, save the complete current material in that task's description or attachments, read it back to confirm access, then provide the task ID or a verified URL and attachment paths.
12
+ Current material, accepted decisions, and necessary rationale follow the [task content standard](task-content.md); chat summaries and repository or PR links may supplement, but cannot replace, the material.
13
+ Report actual failures when the CLI, service, project, or upload is unavailable.
14
+
15
+ ## Operational authorization
16
+
17
+ | Operation | Authorization and boundaries |
18
+ | --- | --- |
19
+ | Create a task | Requires explicit permission for that scope. A user or applicable repository instruction requiring Daynight tracking or review provides standing authorization to create necessary tasks; prefer reuse. An implementation request, tracking need, or inferred workflow alone does not grant permission. |
20
+ | Create a Goal | Covers its discussions and breakdown within the confirmed scope, but create the corresponding tasks only at the [Goal confirmation points](goal.md). |
21
+ | Start a discussion | An explicit request to start a discussion authorizes only that discussion; follow the Goal protocol for stage transitions. |
22
+ | Execute a task | Requires execution authorization for the task or Goal scope. Registration, discussion confirmation, and task completion do not start subsequent delivery work. |
23
+ | Hand off a task | An explicit request to hand work off for automatic agent execution authorizes content review and enabling `allowAgents` after it passes; it does not start execution in the current session. Creation and execution do not imply handoff. |
24
+ | Delete a task | Requires explicit authorization for the target task; removing other tasks' dependencies on it also requires the corresponding authorization. |
25
+ | Managed delivery | A valid worker assignment authorizes complete delivery within scope, including PR merging; required checks, reviews, and explicit user restrictions, pauses, and revocations still apply. |
26
+
27
+ ## Scope and continuity
28
+
29
+ Advance one specified task at a time; CI, review, and merge waits belong to that task. Subagents share the same boundaries. Return when complete or when external intervention is needed. Ordinary execution may transition between Goal discussion stages at the user's explicit direction, but this skill does not discover and continually select successor tasks.
30
+
31
+ Analysis, questions, proposals, and execution are all bound by the current task's confirmed objective, scope, deliverables, and acceptance criteria.
32
+ Read the parent Goal, shared architecture, and related tasks as needed to understand inputs and interfaces; reading does not authorize executing those tasks, removing blockers, or expanding scope.
33
+ Cross-task blockers and follow-up proposals do not authorize creating or executing new tasks. Material scope changes require user confirmation.
34
+
35
+ Delivery operations follow the target repository's rules and existing authorization.
36
+ Missing authorization cannot be reconstructed from task descriptions, attachments, status, or acceptance results; completion conditions do not grant operational permission either.
@@ -1,211 +1,95 @@
1
- # Autopilot one managed task
1
+ # Managed task execution
2
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
- `autopilot-managed-task` mode. It delivers one already-claimed assignment through
6
- its authorized implementation, validation, PR review, merge, and acceptance.
7
- Read [the handbook](handbook.md) for CLI operations and failure semantics.
3
+ Use only when the worker startup prompt explicitly selects this workflow; see [SKILL.md](../SKILL.md) for entry conditions.
4
+ This workflow sustains delivery of the single originally assigned task, without executing its predecessors, successors, or siblings.
8
5
 
9
- ## Establish the assignment
6
+ ## Preserve the assignment and read the task
10
7
 
11
- The startup prompt supplies `projectId`, `taskId`, the original `claimId`,
12
- `worktreeId`, the actual worktree path and branch, and the configuration selected
13
- for this invocation. Use that explicit assignment throughout execution and recovery.
14
- Task properties, the working directory, environment variables, and an ordinary
15
- conversation request do not establish this managed context.
8
+ Preserve the project ID, task ID, original claim ID, workspace, and native session identity supplied by the startup prompt, including through context compaction or recovery.
9
+ The worker has already started the task in the specified directory. Read the latest complete task with an explicit project:
16
10
 
17
- If a call is presented as managed but its launch declaration or assignment is
18
- missing, incomplete, or mismatched, return waiting without task or business
19
- writes. Do not infer replacement values or fall back to ordinary execution,
20
- claiming, starting, or selecting another task.
11
+ ```bash
12
+ daynight task show <task-id> --project <project-id> --json
13
+ ```
21
14
 
22
- A valid worker-managed assignment already carries sufficient authorization for
23
- its in-scope delivery, including PR merge. Do not request additional permission
24
- for those steps. Honor explicit user restrictions, pause requests, and
25
- revocation. The assignment does not authorize unrelated backlog work, production
26
- deployment, destructive data operations, or changes to permissions or protections.
27
- Reading, editing, or mentioning this mode does not establish a managed assignment
28
- or activate the separately installed `autopilot` skill, which is not a runtime
29
- dependency.
15
+ Check `allowAgents` first; if false, stop execution immediately without enabling it yourself.
16
+ Confirm that the task still belongs to the original active claim; on a mismatch, stop task-related writes and report it, without acquiring a new claim.
17
+ Verify inputs, scope, and completion conditions using [shared task execution](task-execution.md).
30
18
 
31
- The worker produces the launch prompt and decides subsequent scheduling. A new
32
- agent started to recover the same claim receives the original mode and
33
- assignment again. Reconnecting an existing live agent does not imply that the
34
- startup prompt should be submitted again.
19
+ ## Complete delivery standard
35
20
 
36
- ## Verify the existing execution
21
+ | Task type | Required results |
22
+ | --- | --- |
23
+ | Research | Provide the full research report as a task attachment. |
24
+ | Design or architecture | Provide the full solution as a task attachment after multiple independent reviews, with no Critical/Major issues; attach a separate review file for remaining nonblocking issues. |
25
+ | Development | All required delivery PRs are actually merged, and task acceptance criteria are met. |
26
+ | Acceptance | Complete acceptance against the criteria, collect evidence, and upload it as task attachments. |
37
27
 
38
- Read the latest complete task using the supplied project and task IDs:
28
+ These requirements supplement the [shared completion conditions](task-execution.md#completion-conditions).
29
+ Task descriptions and source organization follow the [task content standard](task-content.md); inline content cannot replace attachments explicitly required by this table.
30
+ Goal confirmation points still require human confirmation; the assignment does not authorize executing other stages.
39
31
 
40
- ```bash
41
- daynight task show <task-id> --project <project-id> --json
42
- ```
32
+ ## Sustain complete delivery
33
+
34
+ A valid assignment includes the authorization needed for complete delivery of this task; see [authorization and scope](authorization.md) for the boundaries.
35
+ Keep advancing the task proactively; occasional user interaction does not authorize stopping, while explicit pauses, restrictions, and revocations still apply.
36
+ Continue while useful, authorized actions remain available.
37
+
38
+ Implement, synchronize related documents, and verify in the assigned workspace; collaborating agents share the task scope.
39
+ Use research and independent review agents when available and authorized; reassess the design when repeated failures expose structural problems.
40
+ For tasks without PR delivery, apply the complete delivery standard directly rather than inventing a PR workflow.
41
+
42
+ For PR delivery, sustain the following workflow:
43
43
 
44
- Verify its `projectId` and `id`, `status=in_progress`, and
45
- `properties.worker.state=active` with the supplied `claimId` and `worktreeId`.
46
- Verify the actual working directory and Git branch match the supplied worktree.
47
- Use the configuration supplied for this invocation. The controller selects the
48
- current settings appropriate to the recorded agent when it launches or resumes
49
- a native process; an executor does not independently replace that assignment.
50
- If the same claim is already `completed` and the task is `done`, report the
51
- existing completion and return without reexecuting it. Any other state or
52
- identity mismatch leaves execution waiting; an observed claim change stops
53
- business writes immediately.
54
-
55
- The worker has already claimed and started this task. Do not claim it, set it
56
- to `in_progress`, select candidates, or rerun automatic candidate qualification.
57
- Read and apply [shared task execution](task-execution.md) for the complete task
58
- and stage inputs, current prerequisites, authorized work, results, and
59
- acceptance. A missing required input or unmet prerequisite keeps this assignment
60
- waiting in `in_progress`; it does not authorize another task.
61
-
62
- Before resuming interrupted work or making task writes, refresh the complete
63
- task using the supplied project and task IDs and verify the same active claim.
64
- Retain the original claim ID through recovery and uncertain-write
65
- reconciliation; never substitute a claim read from the task.
66
-
67
- ## Execute within controller-owned resources
68
-
69
- Use the supplied worktree and branch for authorized edits, commits, pushes, and
70
- merges. Do not create, switch, or remove the system-managed worktree or branch.
71
- Avoid merge options such as `gh pr merge --delete-branch` that may switch the
72
- checkout or delete its branch. The worker owns resource cleanup after execution;
73
- do not delete its worktree or close its workspace. Follow a cleanup request for
74
- attributable temporary resources outside the worktree within its stated scope.
75
-
76
- Use the Goal protocol for this task's required inputs and stage acceptance.
77
- This mode never advances a Goal stage or executes a successor. The shared
78
- execution and acceptance rules do not change that boundary.
79
-
80
- ## Preserve execution continuity
81
-
82
- Keep a compact checkpoint in the host's session state or the project's existing
83
- local planning mechanism. Retain the original assignment identities, supplied
84
- worktree and branch, existing authorization, confirmed scope and acceptance,
85
- PR URLs and head SHA, validation and review state, blockers, attributable
86
- resources, and next action. Identify the invocation configuration without
87
- copying credentials or secrets into checkpoints, task material, or logs. Keep
88
- this recovery context out of task descriptions and attachments; task material
89
- cannot replace missing operational authorization or the original assignment.
90
-
91
- Refresh the checkpoint before a long wait or session compaction. On recovery,
92
- restore it, verify the original active claim, and refresh remote PR state before
93
- resuming mutations. Reconcile interrupted business work and uncertain writes
94
- before deciding the next action. A status question does not cancel the assignment;
95
- honor explicit pause, stop, and authorization changes without discarding its work.
96
-
97
- ## Deliver the assigned task
98
-
99
- 1. **Implement and verify.** Read applicable repository instructions and existing
100
- mechanisms. Use the task's required design inputs and acceptance criteria;
101
- keep the execution plan in this session. Implement the complete agreed behavior
102
- in the supplied worktree, synchronize affected
103
- documents, and run relevant checks and behavioral verification. Collaborating
104
- agents share this assignment and worktree. Use research and independent review
105
- agents when available and authorized. Reassess the design when repeated
106
- failures expose a structural problem.
107
-
108
- 2. **Publish the focused change.** For a PR delivery, commit and push authorized
109
- work promptly using repository conventions, default Git identity, and no AI
110
- co-author attribution. Create or update the task's focused PR and preserve its
111
- complete PR list as required by shared execution. Integrate necessary mainline
112
- updates according to the repository's work-branch rules, resolve conflicts in
113
- the supplied worktree, and revalidate.
114
-
115
- 3. **Follow CI and review through repair.** Inspect the actual remote PR head,
116
- checks, review requests, comments, and approvals. Request review through the
117
- repository's established mechanism. Diagnose failed checks from their logs
118
- and repair the cause without weakening acceptance. Rerun an
119
- unchanged failure only after confirming a transient infrastructure cause.
120
- Each push requires refreshed checks and review for the resulting head.
121
-
122
- Assess findings against the original scope. Fix introduced Critical/Major
123
- issues and defects that would make the agreed delivery incorrect. Defer smaller
124
- or unrelated improvements under the project's tracking rules without executing
125
- them or creating unauthorized tasks. Use fix, defer, and reject dispositions.
126
- Reply in each finding's own thread, identify the agent, and resolve handled
127
- threads according to repository rules. Repeat review and repair until the
128
- final round has no new Critical/Major findings and remote review requirements
129
- are satisfied.
130
-
131
- 4. **Merge and confirm.** The assignment already authorizes its in-scope PR
132
- merge. Immediately before merging, refresh the head SHA, required checks,
133
- review threads, mergeability, and approvals. Require successful required
134
- checks, handled blocking review threads, and actual reviewer approval for the
135
- current head. When required checks, current-head approvals, blocking-thread
136
- resolution, and mergeability all satisfy the repository's rules, merge
137
- immediately without requesting additional permission. Never infer approval
138
- from silence, approve your own PR, weaken checks or protections, or use an
139
- administrative override. Use the repository's
140
- permitted linear-history method and bind the merge to the verified head when
141
- the platform supports it. A changed head or failed precondition requires a
142
- fresh decision from current state.
143
-
144
- Confirm the platform reports every necessary delivery PR as merged and retain
145
- its merge result in the session. A final revision may identify the task's
146
- delivered artifact. An accepted auto-merge request or merge-queue
147
- entry is not completion. Do not wait for post-merge mainline CI unless the user
148
- explicitly requires that verification. Continue with required task acceptance
149
- and results after the platform confirms the merge.
150
-
151
- 5. **Record acceptance and close this claim.** Complete the task's confirmed
152
- acceptance and save its readable results at their actual owners, including the
153
- acceptance conclusion and material limitations. Keep verification procedures
154
- and CI/review/merge history in the session. Release attributable temporary
155
- services,
156
- probes, and monitoring resources, including those left by failed collaborators,
157
- while preserving controller-owned resources. Finish that cleanup before
158
- [original-claim completion](#complete-the-original-claim), because confirmed
159
- completion allows the worker to stop the agent and remove its workspace.
160
-
161
- For tasks without a PR delivery path, verify the actual artifact against their
162
- confirmed acceptance criteria. Do not invent a PR or reviewer gate for those
163
- tasks. Goal discussion confirmation gates remain mandatory; this assignment
164
- never authorizes execution of a later Goal stage.
165
-
166
- ## Wait for delivery results
167
-
168
- Pending PR CI or review is ongoing execution, not external intervention. Use
169
- bounded watches or yielding polls at reasonable intervals, inspect new results,
170
- and act on failures and feedback. A polling timeout ends only that poll; keep
171
- waiting and inspecting results. Do not return merely because a required PR
172
- remains unmerged while its CI or review is pending. Use the worker's existing
173
- continuation mechanism; do not claim monitoring continues without one or start
174
- an independent scheduling service.
175
-
176
- Continue while useful authorized actions remain. A demonstrated blocker such as
177
- missing credentials, an unavailable required reviewer, a material unresolved
178
- decision, an unmet human confirmation gate, or an explicit user restriction or
179
- revocation that prevents delivery requires external intervention. This is a
180
- background task: do not ask the user questions. Preserve the concrete blocker, actual task and PR state,
181
- completed work, minimum needed intervention, and next action in the checkpoint,
182
- then return waiting to the controller. Preserve the assignment in `in_progress`;
183
- never treat a blocker or ordinary waiting as completion.
44
+ 1. Commit, push, and create or update focused PRs promptly under repository conventions; use the default Git identity and omit AI co-author attribution.
45
+ Integrate necessary mainline updates, resolve conflicts, and verify in that workspace.
46
+ 2. Actively monitor remote HEAD, CI, reviews, and conflicts.
47
+ Diagnose failures; rerun an unchanged failure only after confirming a transient infrastructure cause.
48
+ Refresh checks and reviews after every push.
49
+ Fix Critical/Major issues in the current change and defects that would make delivery incorrect; defer smaller or unrelated improvements under project rules, without creating tasks on your own.
50
+ Respond in each thread with the fix, deferral, or reason for not adopting the finding, identify the agent, and resolve threads under repository rules.
51
+ Continue until the final round has no new Critical/Major issues and remote review requirements are met.
52
+ 3. Immediately before merging, refresh HEAD, required checks, blocking threads, mergeability, and approvals for the current HEAD.
53
+ Once all requirements are met, merge using a linear method permitted by the repository; bind the operation to the verified HEAD when the platform supports it.
54
+ Do not infer approval from silence, self-approve, bypass protections, or weaken checks.
55
+ Reassess if HEAD or conditions change.
56
+ 4. Verify that every required PR is actually merged, then complete task acceptance and save the results.
57
+ Do not additionally wait for post-merge mainline CI unless the user explicitly requires it.
58
+
59
+ ## Ongoing waits
60
+
61
+ Pending CI and reviews are part of continued execution.
62
+ Use bounded listeners or reasonable polling that yields execution; one wait timing out does not end the task.
63
+ Prefer the worker's existing continuation mechanism, without creating another scheduling service or claiming continued monitoring after it has stopped.
64
+ Inspect new results and handle failures, feedback, and conflicts; ordinary waits do not end the task.
65
+
66
+ ## Request user interaction
67
+
68
+ Request user intervention when a goal, architecture, execution plan, or acceptance criteria necessary to complete the task are missing, when a problem is not covered by the design, or when another blocker arises.
69
+ Do not invent missing decisions or treat the problem as completion.
70
+
71
+ 1. Record the specific issue on the current task: `set-property <task-id> worker.signaling "<reason>"`.
72
+ 2. Also print the issue to the terminal, preserve the [waiting context](task-execution.md#waiting-context), exit the execution loop, and wait for the user to address it; keep the task `in_progress` and do not select other work.
73
+ 3. After receiving feedback, verify the original assignment and confirm that the problem is solved, then clear the signal with `remove-property <task-id> worker.signaling`.
74
+ 4. Confirm the removal before resuming automatic execution of the current task. If the problem remains unresolved, retain the signal and keep waiting.
75
+
76
+ Signal writes and removal also follow [write safety](write-safety.md).
77
+ Recording a signal does not complete the task; do not resume blocked operations until the problem is solved.
184
78
 
185
79
  ## Complete the original claim
186
80
 
187
- When [shared acceptance readiness](task-execution.md#confirm-acceptance-readiness)
188
- is satisfied, all required task results are readable, and attributable temporary
189
- resources have been released, reread the complete task, verify the same active
190
- claim, and finish with the original claim ID and the version observed for that
191
- decision:
81
+ Once shared completion conditions are met and required results are readable, clean up this task's temporary services, probes, and monitoring, including resources left by failed collaborators; preserve controller-owned resources. Clean up before completing, because the worker may stop the agent and remove the workspace after confirming completion.
82
+
83
+ Read back the complete task, verify the same original active claim, and use the version observed at that point:
192
84
 
193
85
  ```bash
194
86
  daynight task set-status <task-id> done --project <project-id> --claim-id <claim-id> --if-version <observed-version>
195
87
  ```
196
88
 
197
- This is the final task mutation. Confirm `done`,
198
- `properties.worker.state=completed`, and the original claim ID in the service
199
- result. A refused or unconfirmed write never falls back to ordinary completion
200
- or automatic replay: read the actual task using the supplied project and task
201
- IDs and reconcile only the original claim. An unreadable result remains
202
- unconfirmed; an observed claim change stops further business writes.
203
-
204
- ## Return to the controller
205
-
206
- Return after this task completes or requires demonstrated external intervention.
207
- Preserve the assignment and waiting checkpoint when a human gate, an explicit
208
- user restriction or revocation, or unmet acceptance requires that intervention.
209
- A required PR with pending CI or review follows the ongoing wait above. The worker decides subsequent work
210
- and owns system-resource cleanup; this mode does not select a successor or advance
211
- a Goal stage.
89
+ The claim ID must be the UUID explicitly supplied in the startup assignment, used only for done, never inferred from the environment or task data.
90
+ This is the final task write. Confirm that the response is done, `properties.worker.state=completed`, and the original claim ID is retained.
91
+
92
+ If rejected or the response is uncertain, follow [write safety](write-safety.md) to reconcile the original claim read-only; do not automatically replay the operation or fall back to ordinary completion.
93
+ An unreadable result remains unconfirmed; stop task-related writes immediately if the claim has changed.
94
+ Return to the controller after completion; when user intervention is needed, enter the wait defined under [Request user interaction](#request-user-interaction).
95
+ The worker manages subsequent work and system resources.