@codetreker/daynight 0.10.1 → 0.13.1

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.
@@ -2,28 +2,45 @@
2
2
 
3
3
  Use this mode to prepare and register work that needs persistent tracking. Read
4
4
  [the handbook](handbook.md) before discovery, queries, or writes. Return after
5
- registration; creating work does not authorize approval, execution or autopilot.
5
+ registration; registration alone does not authorize approval, execution or
6
+ autopilot. An explicit request to start a Goal discussion routes the registered
7
+ current stage to run-task under the Goal protocol.
6
8
 
7
9
  Create tasks only with the user's explicit permission for the relevant scope.
10
+ An explicit user or applicable repository instruction requiring Daynight tracking
11
+ or review supplies standing creation permission for necessary tasks within the
12
+ confirmed scope. Reuse suitable tasks and do not ask for that permission again.
8
13
  Loading this mode, needing durable tracking, or permission to implement or run
9
- autopilot does not grant creation permission. Ask when it is missing; reuse
10
- permission already granted for the scope.
14
+ autopilot alone does not grant creation permission. Ask when it is missing; reuse
15
+ permission already granted for the scope. Creation does not authorize approval,
16
+ execution, or delivery.
11
17
 
12
18
  ## Choose the tracked outcome
13
19
 
14
- One-off operations and trivial work do not need a task. Keep transient commands,
15
- tests, and execution steps in the existing plan. With creation permission,
16
- register an independently understandable outcome when delivery needs continued
17
- tracking, cross-session continuity, handoff, or dependency coordination. If the
18
- request does not merit a task, explain that conclusion and return.
19
-
20
- For multiple independently tracked delivery stages, follow
21
- [the Goal protocol](goal.md). Register its Goal description task and dependent
22
- architecture-and-breakdown placeholder together. Their own stage briefs are
23
- required at registration; the finished Goal, UI prototype, architecture, and
24
- breakdown are outputs of the stages that produce them. Creating a Goal covers
25
- both starting tasks and its later in-scope breakdown within the granted creation
26
- permission. Do not execute a stage in this mode.
20
+ With creation permission, register or reuse a task for concrete work such as a
21
+ feature, bug fix, architecture/design assignment, or actual work item produced by
22
+ its breakdown. Each task has its own objective, scope, and observable completion
23
+ conditions. Solution, architecture, and design reviews use their owning task
24
+ under the entrypoint's required tracking and review rules.
25
+
26
+ Keep an agent's transient execution steps, such as reading files, running
27
+ commands, and routine checks, in the existing execution plan. Do not turn these
28
+ steps into Daynight tasks merely because an agent generated them. A distinct
29
+ acceptance or validation assignment with its own outcome can still be a task;
30
+ running a check while delivering an existing task is an execution step. If the
31
+ request contains only execution steps for existing work, keep them with that
32
+ work and return without registering additional tasks.
33
+
34
+ For a multi-stage Goal, follow [the Goal protocol](goal.md). Register only the
35
+ current requirements discussion task; do not create an architecture placeholder
36
+ or delivery tasks upfront. Its stage brief describes the discussion and its
37
+ user-confirmation gate; finished requirements and applicable prototypes are
38
+ outputs. User-confirmed requirements permit creation and start of solution
39
+ discussion. Only user-confirmed solution permits actual delivery registration.
40
+ A registration-only request leaves the current stage proposed and returns; an
41
+ explicit discussion-start request authorizes its approval and claim through
42
+ run-task. Creating a Goal covers the later in-scope stages and breakdown only
43
+ at those confirmation gates.
27
44
 
28
45
  For a single tracked outcome, prepare its solution, acceptance criteria, and
29
46
  applicable mock UI before registration, following the artifact rules below.
@@ -44,7 +61,7 @@ Use the target repository's document and workspace rules.
44
61
  | Concrete problem, current actions and scope, deliverables, constraints, completion summary, and real input references | Task `description` |
45
62
  | Detailed solution, full acceptance criteria, verification methods, and completion evidence | This task's primary Markdown attachment |
46
63
  | Applicable visual and interaction design | Owning task's interactive mock UI and resources, referenced by consumers |
47
- | Prerequisite tasks | `dependsOn` only |
64
+ | Prerequisite tasks and edge classification | Complete `dependsOn` plus its `externalDependsOn` subset |
48
65
  | Delivery PR URLs and titles | `properties.pullRequests` |
49
66
 
50
67
  Give each task an outcome-focused title and a self-contained Markdown
@@ -80,11 +97,17 @@ other resources with working relative references. A static sketch or simplified
80
97
  styling does not satisfy this requirement. For a UI Goal, this prototype is
81
98
  produced by the Goal description stage and referenced by later tasks.
82
99
 
83
- Use established task IDs in `dependsOn` for real prerequisites. Do not add a
84
- Dependencies section or duplicate the dependency list in the description or
85
- Markdown. A top-level task has no dependencies. Repository specifications and
86
- design documents retain their full contracts; the task's own primary attachment
87
- must still provide a specific solution and verifiable acceptance criteria.
100
+ Use established task IDs for real prerequisites. Confirmed same-chain stages
101
+ use `--depends-on`; a verified prerequisite owned by another same-project chain uses
102
+ `--external-depends-on`. The CLI sends their complete union and explicit external
103
+ subset. Do not infer ownership from status, title, graph roots or array order,
104
+ and do not add a dependency only to make tasks appear together. Resolve unclear
105
+ ownership before registering the relationship. A top-level task has no ordinary
106
+ prerequisites; it may still have real external prerequisites that block execution.
107
+ Do not add a Dependencies section or duplicate the relationship lists in task
108
+ prose. Repository specifications and design documents retain their full contracts;
109
+ the task's own primary attachment still provides its specific solution and
110
+ verifiable acceptance criteria.
88
111
 
89
112
  ## Author Markdown
90
113
 
@@ -130,9 +153,13 @@ evidence. The prototype remains with its actual owner when shared across a Goal.
130
153
 
131
154
  ## Register and verify
132
155
 
156
+ New tasks have `allowAgents=false`; creation cannot enable the permission.
157
+ Automatic workers and agent workflows must not turn it on themselves. Approval
158
+ and automatic-execution permission remain separate explicit decisions.
159
+
133
160
  Reuse the established project and suitable tasks. Create new tasks in `proposed`,
134
- retaining each confirmed ID. Set their concrete descriptions and actual
135
- `dependsOn` prerequisites. Upload each task's own primary Markdown and required
161
+ retaining each confirmed ID. Set concrete descriptions and actual ordinary and
162
+ external prerequisites using the handbook's full CLI replacement rule. Upload each task's own primary Markdown and required
136
163
  resources; add actual attachment references to the complete description using
137
164
  the observed task version. Reference already readable shared inputs at their
138
165
  source. Do not present planned uploads as existing attachments.
@@ -140,14 +167,18 @@ source. Do not present planned uploads as existing attachments.
140
167
  Read back each complete task, its attachment inventory and required contents,
141
168
  and its referenced shared inputs. Verify self-contained Markdown descriptions,
142
169
  valid links and images, the two required primary-document sections, real source
143
- identities, intended dependencies, and applicable mock UI resources and
144
- interaction. For a Goal, verify both starting tasks and their stage briefs.
170
+ identities, complete prerequisites and their intended external subset, and applicable mock UI resources and
171
+ interaction. For a Goal, verify only the current discussion stage and its brief;
172
+ verify later stages and delivery tasks when their confirmation gate permits
173
+ registration.
145
174
  Registration is complete only when required artifacts and associations are
146
175
  confirmed readable. Without separate explicit approval authorization, leave
147
- registered work proposed and report that approval is pending. Goal-creation
148
- permission covers the two starting tasks and later in-scope breakdown, but never
149
- their approval. A user can explicitly approve a stated task or Goal-task scope,
150
- or approve directly through CLI/Web; an authorized Agent uses each reviewed
176
+ registered work proposed and report that approval is pending. A Goal
177
+ discussion-start request is scoped approval and claim authorization for that
178
+ discussion, as the Goal protocol specifies; registration alone grants none.
179
+ User solution confirmation permits registration of proposed delivery tasks,
180
+ without granting their approval or execution. A user can explicitly approve a
181
+ stated task or Goal-task scope, or approve directly through CLI/Web; an authorized Agent uses each reviewed
151
182
  task's exact version through `task approve`.
152
183
 
153
184
  If creation succeeds but a later operation fails, retain the confirmed IDs and
@@ -155,4 +186,6 @@ resume missing operations there. Tasks remain `proposed`. Reconcile uncertain re
155
186
  mutation. Report incomplete registration with the exact missing operation or
156
187
  artifact and next step. Do not move detailed plans into descriptions to bypass
157
188
  an attachment failure. Return after verified registration without selecting or
158
- executing a task.
189
+ executing a task for registration-only requests. If the user explicitly requested
190
+ the current Goal discussion to start, pass its confirmed ID to run-task under
191
+ the Goal protocol.
@@ -1,172 +1,184 @@
1
1
  # Goal protocol
2
2
 
3
- Read this reference when creating a multi-stage Goal, running one of its tasks,
4
- or advancing its authorized scope. Use [create-task](create-task.md) for content
5
- and registration rules, [run-task](run-task.md) for one task's lifecycle, and
3
+ Read this reference when starting or registering a Goal, discussing one of its
4
+ stages, or advancing its authorized scope. Use [create-task](create-task.md) for
5
+ content and registration, [run-task](run-task.md) for task execution, and
6
6
  [the handbook](handbook.md) for CLI semantics. A Goal uses existing tasks,
7
- attachments, `dependsOn`, and PR properties; it adds no CLI command, task type,
8
- status, or execution authority.
9
-
10
- ## Identify and register a Goal
11
-
12
- Use a Goal when completing the request requires multiple independently tracked
13
- delivery stages. One independently tracked outcome remains a normal task;
14
- commands, tests, and temporary execution steps do not each need persistent tasks.
15
- The user need not use the word Goal.
16
-
17
- Explicit permission to create a Goal covers its two starting tasks and the later
18
- breakdown within that Goal. It covers no unrelated tasks and grants no execution,
19
- publication, deployment, external communication, merge, or mainline push
20
- permission. Existing explicit authorization continues to apply within its scope.
21
- Implementation or autopilot permission alone does not grant creation permission.
22
- Goal-creation permission does not authorize approval. Approve only tasks or a
23
- Goal-task scope explicitly approved by the user, using each reviewed task's exact
24
- version; CLI and Web approval are available. Goal creation, requirements/prototype
25
- completion, design completion and autopilot never imply that instruction. Approval
26
- itself grants no execution or delivery permission.
27
-
28
- During registration, create or reuse both starting tasks:
29
-
30
- | Task | Title | Initial content |
31
- |---|---|---|
32
- | Goal description | `[Goal]<outcome>` | The known overall problem, intended results, scope, constraints, UI applicability, exclusions, and observable acceptance summary; a stage brief for resolving open requirements and producing the complete Goal. |
33
- | Architecture design and task breakdown | `Architecture design and task breakdown: <outcome>` | Its concrete work: consume the completed Goal, design the architecture, register the complete delivery breakdown, verify its artifacts and dependencies, and deliver any required design PR. Its own stage brief defines the approach and acceptance. |
34
-
35
- The `[Goal]` marker is followed directly by the outcome. Goal description names
36
- the stage; it is not the title prefix. Titles communicate purpose but do not
37
- establish stable identity. Preserve confirmed IDs and inspect full content when
38
- reusing an existing chain.
39
-
40
- Set the design task's `dependsOn` to the Goal description task. Each task starts
41
- in `proposed` with its own self-contained Markdown description and primary Markdown
42
- containing Solution and Acceptance criteria. State unanswered questions honestly.
43
- Complete requirements, prototypes, architecture, and breakdown are produced by their
44
- respective stages; they are not prerequisites for registering the chain or
45
- starting the stage that produces them. Confirm both tasks, stage briefs,
46
- references, and dependency through real reads, then return from `create-task`.
47
- Registration completeness leaves approval pending unless the user separately
48
- authorized approval for those tasks. Metadata and attachment writes do not approve.
7
+ attachments, complete `dependsOn` relationships, their `externalDependsOn`
8
+ classification, and PR properties. It adds no resource, command, or status.
9
+
10
+ ## Identify the current discussion
11
+
12
+ Use a Goal when a concrete outcome needs requirements discussion, solution or
13
+ architecture discussion, and actual delivery work. Independently understandable
14
+ features, bug fixes, architecture/design assignments, and real breakdown items
15
+ are tasks. Agent-generated commands, file reads, and routine checks stay in the
16
+ owning task's execution plan.
17
+
18
+ Permission to create a Goal covers its requirements discussion, the later solution
19
+ discussion, and the confirmed in-scope delivery breakdown. Create each only at
20
+ its stage below. Reuse suitable existing tasks after reading their full problem,
21
+ scope, materials, acceptance, and actual context; a title alone is not identity.
22
+ An explicit user or applicable repository tracking/review instruction supplies
23
+ standing creation permission within the confirmed scope. It grants no unrelated
24
+ work, implementation, external communication, deployment, merge, or mainline push
25
+ permission.
26
+
27
+ A request to start a Goal discussion authorizes creating, approving, and claiming
28
+ that discussion task so it becomes `in_progress`. A registration-only request
29
+ creates only the current discussion task in `proposed` and returns without
30
+ approval or execution. A generic run request, Goal registration, or autopilot
31
+ activation does not supply discussion-start or delivery approval authorization.
32
+
33
+ ## Start requirements discussion
34
+
35
+ Create or reuse only the requirements discussion task, titled `[Goal]<outcome>`.
36
+ The marker is followed directly by the outcome. Do not create an architecture
37
+ placeholder or delivery tasks at this point. Give the task a self-contained Markdown description
38
+ for the known problem, intended outcome, scope, constraints, open
39
+ questions, and observable completion conditions. Its primary Markdown's Solution
40
+ and Acceptance criteria describe this discussion and its user-confirmation gate;
41
+ finished requirements and prototypes are outputs, not prerequisites to starting.
42
+
43
+ Each task starts in `proposed`. For an explicit discussion-start request, read its
44
+ current materials and exact version, use `task approve`, confirm todo, then use
45
+ `task claim` with the version observed for that decision and confirm `in_progress`.
46
+ All direct prerequisites must be done. Preserve real external blockers rather
47
+ than removing dependencies to make a discussion ready. An already in-progress
48
+ task is resumed after checking its actual work and context.
49
+
50
+ Discuss requirements with the user: the whole problem, desired behavior, scope,
51
+ constraints, exclusions, and whole-Goal acceptance. Keep current material and open
52
+ questions in this task's description or attachments. The description remains a
53
+ self-contained brief; its primary Markdown owns detailed requirements, validation,
54
+ and evidence. Before requesting user review, save the complete current material,
55
+ read it back, and provide the task and resource reference.
56
+
57
+ For a UI Goal, produce a final-style interactive frontend-only prototype with
58
+ working relative resources and relevant populated, empty, loading, failure,
59
+ disabled, long-content, and narrow-screen states. View and exercise it. Prototype
60
+ code is a requirements artifact; this discussion does not implement production
61
+ code or decide the architecture.
62
+
63
+ ## Confirm requirements and start solution discussion
64
+
65
+ Keep the requirements task `in_progress` until the user explicitly confirms the
66
+ current requirements and directs the next discussion, for example, "Requirements
67
+ are settled; move to architecture discussion." Agent confidence, completed text,
68
+ a review result, or elapsed time does not satisfy this gate.
69
+
70
+ Record the user's confirmation with the accepted material in the owning task and
71
+ verify it is readable. A material revision after confirmation requires renewed
72
+ user confirmation before advancement. When the discussion's acceptance is met,
73
+ reread the task, use `task complete` with its observed version, and confirm done.
74
+ Do not create the solution discussion until that completion is confirmed; reconcile
75
+ an uncertain completion before another mutation.
76
+
77
+ Then create or reuse the solution discussion task, with a purpose-specific title
78
+ such as `Architecture discussion: <outcome>`, and an ordinary prerequisite on the
79
+ completed requirements task. The user's direction to start this discussion
80
+ provides its scoped approval and execution authorization. Prepare its stage brief,
81
+ read its current version, approve and claim through the same lifecycle, and
82
+ confirm `in_progress`. This user-directed transition does not require autopilot
83
+ and does not authorize selection of another unrelated task.
49
84
 
50
85
  ## Execute the appropriate stage
51
86
 
52
- Every stage uses the same explicit task lifecycle. Proposed work waits for the
53
- user's scoped approval; an authorized `task approve` moves it to todo even with
54
- unfinished prerequisites. Begin only from approved ready todo with complete
55
- stage inputs and execution authorization: use `task claim` with the exact version
56
- observed for that decision and confirm in_progress. Resume existing in-progress
57
- work after checking its actual checkpoint. After the stage acceptance and every
58
- required authorized PR merge, reread and use `task complete` with the observed
59
- version. Completion satisfies dependencies but never approves the next stage.
60
- Unstarted todo work can return to proposed through explicitly authorized
61
- unapprove; it then waits for a new approval before claim.
62
-
63
- | Stage | Required inputs to start | Outputs and completion |
64
- |---|---|---|
65
- | Goal description | Its stage brief, current problem and scope, and available background. | Complete overall requirements, applicable final-style interactive UI prototype, verified stage acceptance, and repository-required delivery. Finishing this task completes problem definition. |
66
- | Architecture design and task breakdown | Completed Goal description, its full requirements and applicable prototype, and the design stage brief. | Complete architecture and the actual registered delivery tasks, verified task-specific artifacts and dependencies, satisfied stage acceptance, and platform-confirmed merge of every required design PR. |
67
- | Delivery task | Completed design prerequisite, delivered architecture, its own solution and acceptance criteria, and applicable prototype and resources. | This task's deliverable, verification, required review and PR merges, and readable acceptance evidence under the normal run-task rules. |
68
-
69
- ### Goal description
70
-
71
- Explain the whole problem and why it matters, the final observable results,
72
- required behavior and constraints, scope, explicit exclusions, and how the whole
73
- Goal will be accepted. The task description itself must communicate this complete
74
- overall brief and a concise acceptance summary. Its primary Markdown owns the
75
- full requirements, verification methods, and stage evidence. Resolve blocking
76
- ambiguities without making architecture decisions or changing production
77
- implementation code.
78
-
79
- For a UI Goal, specify final layout, visual styling, interactions, representative
80
- data, and relevant states. Produce an interactive prototype that runs with
81
- frontend code alone, with final styling and all necessary resources. Cover
82
- applicable populated, empty, loading, failure, disabled, long-content, and
83
- narrow-screen states; explain exclusions when a relevant-looking state does not
84
- apply. Prototype code is an allowed problem-definition artifact. View and
85
- exercise the result when verifying this stage.
86
-
87
- Confirm the full requirements are clear, the applicable prototype is usable,
88
- and this stage's acceptance and repository delivery rules are satisfied. If
89
- repository rules require a PR for these artifacts, use the existing PR completion
90
- rules. Otherwise use the stated stage acceptance. Complete only this in-progress
91
- task through `task complete` with its observed version after verification. This
92
- satisfies design's dependency; design still needs its own approval and claim, and
93
- whole-Goal delivery remains unverified.
94
-
95
- ### Architecture design and actual task breakdown
96
-
97
- Consume the completed Goal and prototype. Design the responsibilities, boundaries,
98
- data and control flow, contracts, error behavior, key decisions, and validation
99
- approach required by the target repository and Goal.
100
-
101
- During this task, register the complete set of persistent delivery tasks needed
102
- to satisfy the Goal. Each represents a concrete outcome with its own actions,
103
- scope, deliverables, constraints, solution, acceptance criteria, verification
104
- methods, and real input references. Their combined scope must cover the complete
105
- Goal. A future registration list or a vague implementation placeholder does not
106
- satisfy task breakdown.
107
-
108
- Use `dependsOn` for actual prerequisites. Every delivery root with no other
109
- implementation prerequisite depends directly on the design task; all delivery
110
- paths must therefore pass through design completion. Keep delivery tasks blocked
111
- while design is unfinished. This stage registers and verifies them; it does not
112
- execute them. New successors are proposed; approval requires a separate explicit
113
- user instruction covering them, even when Goal creation already permits their
114
- registration. Approved successors still wait for completed design prerequisites.
115
-
116
- Upload each successor's own primary Markdown and needed resources, referencing
117
- shared Goal and design inputs at their verified source. The design task owns its
118
- architecture and breakdown outputs. Read back every registered task, required
119
- attachment, source reference, and dependency. Verify the full breakdown before
120
- handing over the design PR. When review changes the design, update its owning
121
- artifacts and affected task summaries, plans, and references coherently, then
122
- reread them before completion.
123
-
124
- Follow repository document and independent review requirements. When a design
125
- PR is required, create it and maintain the full `properties.pullRequests` list.
126
- Keep this task `in_progress` until every necessary PR is platform-confirmed merged
127
- and stage acceptance is satisfied. An open PR, successful CI, or approval does
128
- not complete design. A user-review or no-merge instruction preserves this task
129
- and its blocking dependency while waiting; it grants no merge authority.
87
+ During solution discussion, consume the confirmed requirements and applicable
88
+ prototype. Discuss how to achieve the outcome: responsibilities, data and control
89
+ flow, interfaces, error behavior, key decisions, verification, and the proposed
90
+ breakdown. The solution task owns the current architecture, proposal, and draft
91
+ breakdown. Keep discussion material accessible in its description or attachments,
92
+ verify it before user review, and synchronize revisions and review decisions.
93
+ Do not register delivery subtasks before the user confirms the current solution.
94
+
95
+ A discussion task completes from user-confirmed Daynight material and its stated
96
+ stage acceptance. Repository document/code delivery still follows normal PR and
97
+ merge rules, but a generic repository PR rule does not add a merge prerequisite
98
+ to a Daynight discussion. If the user explicitly makes particular repository
99
+ artifacts or PR delivery part of that discussion's acceptance, honor that
100
+ requirement and its delivery permissions. An unresolved user review keeps the
101
+ current discussion `in_progress`. Successful CI or a design review cannot replace
102
+ the user's confirmation.
103
+
104
+ After explicit user confirmation of the current solution, record that confirmation
105
+ with the accepted material and register the delivery breakdown below. Complete
106
+ the solution discussion only after the accepted solution and actual registered delivery tasks,
107
+ their required materials, and their dependencies are read back
108
+ and verified. Use `task complete` with the observed version and confirm done.
109
+ Completion satisfies dependencies but never approves delivery tasks. Completing
110
+ either discussion does not establish whole-Goal completion.
111
+
112
+ ## Register the confirmed delivery breakdown
113
+
114
+ Only after user solution confirmation, create or reuse the concrete delivery tasks
115
+ needed for the agreed outcome. Each needs its own problem, objective, scope,
116
+ deliverables, constraints, solution, observable acceptance, verification methods,
117
+ and real input references. Include independently scoped acceptance work when it
118
+ has its own outcome; do not turn agent-generated execution steps into tasks.
119
+ The combined scope must cover the confirmed Goal, rather than a vague placeholder.
120
+
121
+ Create new delivery tasks in `proposed`. Solution confirmation authorizes the
122
+ confirmed breakdown's registration, not approval, implementation, autopilot,
123
+ automatic-execution permission, publishing, deployment, or merge. Apply any
124
+ separate explicit authorization only within its stated scope. New tasks have
125
+ `allowAgents=false`; automated workflows must not enable it themselves.
126
+
127
+ Use ordinary dependencies for real within-Goal prerequisites. Every delivery root
128
+ without another ordinary implementation prerequisite depends directly on the
129
+ solution discussion, so each delivery path includes confirmed design completion.
130
+ Mark verified prerequisites owned by another same-project chain as external;
131
+ external prerequisites remain real blockers and do not replace that ordinary
132
+ design gate. Preserve the complete relationship sets under the handbook's CLI
133
+ replacement semantics. Do not create dependencies merely to group cards.
134
+
135
+ Upload each task's own primary Markdown and needed resources. Keep shared
136
+ requirements with the requirements task and the solution and breakdown with the
137
+ solution task. Consumers reference the verified source task ID and attachment
138
+ path, or an immutable repository source. Read back every task, required attachment,
139
+ shared input, and dependency before reporting the breakdown registered. Keep the
140
+ solution discussion `in_progress` when registration is incomplete. If the accepted
141
+ solution materially changes, obtain renewed user confirmation before registering
142
+ or advancing the changed work.
130
143
 
131
144
  ## Preserve ownership and recover partial registration
132
145
 
133
- Every stage and delivery task needs its own self-contained Markdown description
134
- and detailed primary Markdown. Follow create-task's Markdown and verified-resource
135
- rules without claiming unfinished stage outputs are already available. Keep shared
136
- requirements on the Goal description task and shared architecture and breakdown on the design task. Later tasks reference
137
- verified source task IDs and attachment paths, read through the installed CLI,
138
- or verified immutable repository references. Do not distribute a duplicate whole
139
- packet to all tasks. Only copy a snapshot when the consuming task needs it,
140
- recording the purpose, original source, and source revision or content identity.
141
-
142
- Registration comprises independent writes, not a transaction. Reuse confirmed
143
- IDs if creating the second starting task, uploading an artifact, updating a
144
- reference, or registering part of the breakdown fails. Before retrying an
145
- uncertain write, read the complete actual resource and operation context as the
146
- handbook requires. A similar title does not prove success, and a lost response
147
- does not prove failure. If identity cannot be established uniquely, preserve the
148
- specific error and request the information needed to reconcile it; do not create
149
- another chain.
150
-
151
- Apply the handbook's exact-version rules to metadata updates, approval,
152
- withdrawal, claim and completion, and preserve complete-field replacement semantics for updates. Attachments are independent of task versions, status, and timestamps;
153
- verify actual file contents and metadata separately. Do not unlock delivery by
154
- marking incomplete registration or unfinished design complete. Readiness and
155
- `in_progress` provide no ownership lock; claim is a versioned transition, not an
156
- assignee lease. Generic updates cannot write status or bypass stages.
146
+ Stage briefs describe the work to produce the stage's outputs; they do not claim
147
+ unfinished results exist. Every stage and delivery task has its own self-contained
148
+ Markdown brief and detailed primary Markdown. Keep shared inputs at their actual
149
+ owner. Do not distribute a duplicate whole packet to every task. An independently
150
+ needed snapshot records its purpose, original source, and source revision or
151
+ content identity. Existing attachment reads support these references; do not
152
+ invent a URL scheme, cross-task relative links, or fixed service host.
153
+
154
+ Creation, uploads, metadata changes, and lifecycle actions are independent writes.
155
+ Retain confirmed IDs and resume missing operations after partial success. Read
156
+ actual task fields and attachment contents before retrying an uncertain write;
157
+ a matching title or lost response does not establish success or failure. If the
158
+ identity cannot be established uniquely, preserve the failure and information
159
+ needed to reconcile it rather than creating a duplicate chain.
160
+
161
+ Bind metadata updates, approve, unapprove, claim, and complete to the exact version
162
+ observed for that decision. Attachment bytes have independent concurrency and
163
+ must be verified separately; task versions cannot prove the reviewed content is
164
+ unchanged. Generic updates cannot write status. A version conflict requires a
165
+ new decision. Readiness and `in_progress` provide no ownership lock or lease.
157
166
 
158
167
  ## Advance and accept the whole Goal
159
168
 
160
- `run-task` returns after its specified task completes or requires external
161
- intervention. Completing registration, Goal description, or design never activates
162
- autopilot. Only explicitly active `autopilot` may select the next related task
163
- after confirming the current task `done`, within the user's authorized scope.
164
- CI, review, and merge waits remain with the current task.
165
-
166
- To report the whole Goal complete, inspect the full registered delivery scope,
167
- confirm every delivery task completed and every necessary PR actually merged,
168
- and verify the original Goal's overall acceptance criteria with recorded
169
- evidence. Description completion, design completion, one delivery PR, or an empty
170
- ready page is insufficient. Distinguish verified partial results and remaining
171
- blockers from whole-Goal completion. This check does not create a new Goal status
172
- or reopen the completed problem-definition task.
169
+ A user-directed requirements-to-solution transition follows the confirmation
170
+ protocol above. Ordinary `run-task` otherwise returns after its specified task
171
+ completes or needs external intervention. Neither discussion completion nor
172
+ breakdown registration activates autopilot or starts delivery. Only explicitly
173
+ active autopilot selects later delivery work, and only with the existing approval,
174
+ `allowAgents`, readiness, input, and execution requirements. CI, review, and merge
175
+ waits stay with the current delivery task.
176
+
177
+ Delivery tasks follow normal run-task completion: accepted outcomes, required
178
+ review, all necessary authorized PR merges, and readable evidence. To report the
179
+ whole Goal complete, inspect the full confirmed delivery scope, every delivery
180
+ task's completion, all required PR merges, and the original whole-Goal acceptance.
181
+ The requirements task being done means only that requirements discussion is
182
+ complete. The solution task being done means the confirmed solution and verified
183
+ breakdown are delivered. An empty ready page or a single delivery result proves
184
+ neither the whole outcome nor completion of all its work.
@@ -17,7 +17,7 @@ needed to use them correctly.
17
17
  | `task ready` | Read a bounded candidate page of approved todo tasks with completed prerequisites. |
18
18
  | `task list` | Read every matching page; defaults to unfinished tasks. |
19
19
  | `task show` | Read one task's complete details and exact version. |
20
- | `task update` | Change metadata, dependencies, or PR references; status is not writable. |
20
+ | `task update` | Change metadata, automatic-execution permission, dependencies, or PR references; status is not writable. |
21
21
  | `task approve` | Change proposed to todo using an observed version and explicit approval authorization. |
22
22
  | `task unapprove` | Withdraw approval of todo work, returning it to proposed using an observed version. |
23
23
  | `task claim` | Change ready todo to in_progress using an observed version. |
@@ -73,11 +73,33 @@ in-progress or done work, execution release, or direct todo-to-done transition.
73
73
  Metadata, attachments and PR references cannot approve, withdraw approval or
74
74
  claim work. Approve or unapprove only when the user explicitly authorizes that
75
75
  action for the task or stated scope; creation, execution requests, `run-task`
76
- and autopilot grant none. In the Web, the title-row entry opens a confirmation;
76
+ and autopilot alone grant none. The Goal protocol treats an explicit request
77
+ to start a requirements or solution discussion as scoped authorization to approve
78
+ and claim that discussion task. Its user-confirmed transitions do not authorize
79
+ approval or execution of delivery tasks. In the Web, the title-row entry opens a confirmation;
77
80
  only deliberate confirmation is the user's approval or withdrawal instruction.
78
81
  Cancel and Escape submit no action. Task approval itself grants no implementation,
79
82
  publication, deployment or merge permission.
80
83
 
84
+ **Automatic execution permission.** Tasks expose the required boolean
85
+ `allowAgents`, independent of status approval and dependency readiness. New tasks
86
+ start false; public creation cannot set it. Existing tasks receive true through
87
+ the database migration. Use `task update <task-id> --allow-agents true|false --if-version <version>` only
88
+ for an explicitly authorized permission change.
89
+ Omission preserves the current value, including explicit false. Actual changes
90
+ are locked during in_progress; exact-version same-value requests keep the
91
+ version and timestamps, while stale versions still conflict. Approve, unapprove,
92
+ claim, complete and other metadata updates preserve the flag.
93
+
94
+ `task list` and `task ready` accept `--allow-agents true|false`. The server
95
+ combines that condition with other filters before pagination and the ready limit;
96
+ an unfiltered ready page may contain tasks without automatic-execution permission.
97
+ Automatic selection requires true and automated workflows must not enable it
98
+ themselves. An explicitly user-selected task may still use manual claim regardless
99
+ of the flag. Permission does not grant execution, publication or merge authority.
100
+ A lost permission PATCH response is an unconfirmed write: read actual task state
101
+ before reconsidering the operation, without resubmitting automatically.
102
+
81
103
  **Task concurrency.** Bind each metadata update, approve, unapprove, claim and complete to
82
104
  the exact version read for that decision using `--if-version`; the CLI's default
83
105
  pre-submit read cannot protect an earlier decision. Preserve full int64 decimal
@@ -86,9 +108,43 @@ assignee lock, renewable lease or proof that existing work belongs to this
86
108
  session. On a conflict, reread and reconsider; a new action needs a fresh
87
109
  decision, not merely a newer version. Never retry a mutation automatically.
88
110
 
89
- **Replacement fields.** Descriptions, dependency sets, and PR reference lists
90
- replace the whole supplied field. Preserve every still-needed value. Omitted
91
- fields stay unchanged; clearing and option-pairing syntax is in command help.
111
+ **Dependency classification.** `dependsOn` contains every direct prerequisite;
112
+ `externalDependsOn` is its explicit external subset. Ordinary prerequisites are
113
+ `dependsOn` minus that subset. Both are canonical, duplicate-free UUID sets,
114
+ not insertion order. Every prerequisite must be done before claim or completion,
115
+ including external ones; cycle checks and project access rules use all edges.
116
+ External means cross-chain within the same project, not a cross-project
117
+ reference. It separates chain ownership, not blocking or authorization. Use
118
+ ordinary relationships for confirmed same-chain work and external relationships
119
+ for verified prerequisites owned by another chain. Confirm task content and
120
+ ownership; done status, a similar title, current graph roots or the displayed
121
+ component do not establish the classification.
122
+
123
+ **CLI relationship replacement.** `--depends-on` declares ordinary prerequisites;
124
+ `--external-depends-on` declares external ones. Supplying either option compiles
125
+ their full union as `dependsOn` and the exact external set as `externalDependsOn`.
126
+ This replaces every relationship and its classification. An external-only option
127
+ replaces the set with only those external edges; it does not append or merely
128
+ mark an existing edge. An ordinary-only option makes every supplied edge ordinary
129
+ by explicitly sending an empty external subset. Repeat options for the complete
130
+ intended sets. Duplicate or cross-declared IDs fail, including case-equivalent
131
+ UUIDs. Omit both options to preserve relationships; `--clear-dependencies` sends
132
+ both empty sets and conflicts with either option. Before a dependency edit, read
133
+ all D/E values and derive the ordinary set D−E, then preserve every still-needed
134
+ relationship under its intended declaration. Read back the full sets afterward.
135
+ Installed command help owns exact syntax.
136
+
137
+ **Direct API patches.** API fields are independently optional. Omitting both
138
+ preserves relationships. Supplying only `dependsOn` replaces IDs, preserves
139
+ classification on surviving edges and makes new edges ordinary. Supplying only
140
+ `externalDependsOn` preserves IDs and replaces the complete external subset;
141
+ supplying both replaces both sets exactly. The external set must belong to the
142
+ final complete set. This API partial-patch rule differs from the CLI compiler's
143
+ explicit full relationship replacement; do not infer CLI append semantics from it.
144
+
145
+ **Other replacement fields.** Descriptions and PR reference lists replace the
146
+ whole supplied field. Preserve every still-needed value. Omitted fields stay
147
+ unchanged; clearing and option-pairing syntax is in command help.
92
148
 
93
149
  **Markdown descriptions.** Write self-contained task briefs in Markdown following
94
150
  [create-task](create-task.md). The Web displays CommonMark/GFM, while API and CLI