@jsonstudio/appsdk-linux-x64-gnu 0.0.0-stage → 0.1.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,86 @@
1
+ # Development and Debug
2
+
3
+ ## Feature or new project
4
+
5
+ When persistent Guidance is selected, project the task-specific intake:
6
+
7
+ ```bash
8
+ appsdk guide init --task <task-id> --mode develop --module <module-id>
9
+ ```
10
+
11
+ Read the returned AGENTS and Skill sources, invoke the suggested Skills, and ask
12
+ only unresolved questions. A PlanProposal is required only for the selected
13
+ Guidance workflow. Otherwise establish the same goal/scope directly and proceed.
14
+
15
+ Before implementation, bind the project context:
16
+
17
+ ```text
18
+ requirements + acceptance + non-goals
19
+ -> declared function owner + allowed/forbidden paths
20
+ -> declared verification gates + prior records
21
+ -> proportionate architecture and detailed design
22
+ ```
23
+
24
+ Architecture and detailed design are required for a new project or meaningful
25
+ cross-module or semantic change. A local change may use the existing design and
26
+ use it directly. Within a selected Guidance workflow, use its declared bypass.
27
+
28
+ Then:
29
+
30
+ ```text
31
+ latest origin/main
32
+ -> clean owner worktree
33
+ -> minimal implementation
34
+ -> candidate commit
35
+ -> verification/review/delivery
36
+ -> latest-main integration
37
+ -> remote receipt
38
+ -> lifecycle close
39
+ -> worktree/claim cleanup
40
+ ```
41
+
42
+ Candidate commit binds tree/artifact/evidence. It is not a delivery commit and
43
+ does not authorize merge.
44
+
45
+ Before adding behavior, perform an ablation check: confirm that the behavior is
46
+ necessary, no declared owner already provides it, and common semantics can
47
+ reuse an existing shared function. Preserve a fixed lifecycle skeleton only
48
+ when the project declares one. Choose direct code or configuration by actual
49
+ complexity, not by a universal preference. Missing capability fails or skips with a
50
+ reason. Control/configuration truth belongs only in declared typed control
51
+ resources, error chains, or project configuration sources, never business
52
+ payloads, metadata, debug logs, or implicit context.
53
+
54
+ ## Debug
55
+
56
+ When persistent Guidance is selected, start with:
57
+
58
+ ```bash
59
+ appsdk guide init --task <task-id> --mode debug --module <module-id>
60
+ ```
61
+
62
+ Use the projected questions to bind the real failing sample and experiment
63
+ contract before writing the debug PlanProposal.
64
+
65
+ Use one hypothesis per round:
66
+
67
+ ```text
68
+ read AGENTS + declared maps + prior notes/records
69
+ -> append observations, one hypothesis, and evidence to run notes
70
+ -> same-input reproduction when feasible
71
+ -> confirmation/falsification signals + first semantic divergence
72
+ -> forward and reversal intervention when feasible
73
+ -> unique-owner fix + proportionate regression
74
+ -> mapped gates + old-input replay when runtime-impacting
75
+ ```
76
+
77
+ Final error is not automatically root cause. Grep hit is not evidence. Do not
78
+ patch output layers, add fallback, or modify multiple owners to make one test
79
+ green.
80
+
81
+ Before merge, review maps, module boundary, owner, payload/control separation,
82
+ configured operations, registered hooks, declared gates, ablation, shared
83
+ function reuse, affected tests, and the latest-main integrated tree. A violation
84
+ introduced or modified by the candidate blocks review. An untouched historical
85
+ violation is a recommendation unless it affects the changed scope, safety,
86
+ ownership, evidence truth, or required delivery.
@@ -0,0 +1,69 @@
1
+ # Goal Prompt Generation
2
+
3
+ Use only when the user asks for a goal prompt. An ordinary development/debug
4
+ request does not require generating a prompt or writing a separate plan file.
5
+ For a requested prompt, clarify material unknowns:
6
+
7
+ 1. Restate the objective in one sentence.
8
+ 2. List acceptance criteria.
9
+ 3. List non-goals and assumptions.
10
+ 4. Identify ambiguity and ask only material questions.
11
+ 5. Wait for confirmation when scope, risk, permission, or irreversible behavior is unclear.
12
+ 6. Write `docs/goals/<feature-name>-plan.md` before emitting the prompt.
13
+
14
+ Never put a token, time, context, or turn budget in the plan or `/goal` prompt.
15
+ Do not emit fields such as `token_budget`, budget seconds, context limits, or
16
+ round limits. Completion is determined only by the plan's acceptance criteria
17
+ and evidence.
18
+
19
+ For an MVP→M1 migration or closeout, the plan is the single implementation
20
+ source and must additionally bind:
21
+
22
+ - the current MVP baseline and the intended M1 target;
23
+ - the owning endpoint/project scope, allowed and forbidden paths, and the
24
+ authorized master/worker boundaries;
25
+ - the legacy control-plane inventory, retained evidence, chosen preserve/reset
26
+ route, and exact destructive authorization (if any);
27
+ - the five Loop parts (`Trigger`, `Work`, `Gate`, `State`, `Stop`) and the
28
+ per-round order `Discover → Hand off → Verify → Persist → Schedule`;
29
+ - the AppSDK source-repository versus managed-project boundary, Codex TUI
30
+ identity and route evidence, two-way replay, and explicit failure/unknown
31
+ handling;
32
+ - exact candidate, merge, install, daemon-restart, and deployed replay gates.
33
+
34
+ Use the [AppSDK migration Skill](../../appsdk-migration/SKILL.md) for the complete
35
+ inspect/snapshot/migrate-or-reset/context-reconcile/restart/verify procedure. Do not copy
36
+ that state machine into the prompt or into this reference. A prompt cannot
37
+ register a goal or grant a role: Desktop never runs `appsdk goal subscribe`;
38
+ only the authorized live TUI/master endpoint may register the existing plan.
39
+ If the plan is absent, unconfirmed, or not admitted, stop before emitting a
40
+ usable execution prompt. A periodic interval is a scheduling choice, not a
41
+ ten-second liveness probe or permission to retry a blocked command.
42
+
43
+ Use this compact output:
44
+
45
+ ```text
46
+ /goal
47
+ 目标:<one-sentence objective>
48
+
49
+ 说明:本任务不需要再写新的提示词,直接按实现文档执行。
50
+
51
+ 实现文档:
52
+ docs/goals/<feature-name>-plan.md
53
+
54
+ 执行规范:
55
+ - 先查项目合同、owner、scope 和真源。
56
+ - 只在允许路径修改;禁止 fallback、silent strip、旁路和无关改动。
57
+ - 目标未 confirmed/admitted 时停止实现。
58
+ - 不声明 token、时间、上下文或轮次预算;按完成条件和证据收口。
59
+
60
+ 验证:
61
+ - 运行定向测试、build/compile、verify 和要求的 review gate。
62
+ - 无证据不宣称完成。
63
+
64
+ 完成标准:
65
+ - 实现计划中的验收标准全部满足。
66
+ - 记录、artifact、scope 和 review 结果一致。
67
+ ```
68
+
69
+ The prompt is the final execution task. Do not create another prompt for the same task.
@@ -0,0 +1,212 @@
1
+ # AppSDK + Collab: one query, one binding
2
+
3
+ Current client: Codex only. The binding is the Codex sessionID.
4
+
5
+ ## State ownership
6
+
7
+ Global truth:
8
+
9
+ ```text
10
+ ~/.appsdk/projects.jsonl
11
+ ~/.appsdk/runtimes.jsonl
12
+ ~/.appsdk/communication.jsonl
13
+ ~/.collab/server.sock
14
+ ~/.collab/events.jsonl
15
+ ~/.collab/log.txt
16
+ ```
17
+
18
+ Project-local `.appsdk/`, `.appsdk-control/`, and `.agent-collab/` are not the
19
+ global truth. `.appsdk/` is the committed project contract/maps/records;
20
+ `.appsdk-control/` is ignored local run/cache state; `.agent-collab/` is the
21
+ project registration/reducer input. Handle them only through
22
+ the AppSDK reset or Collab migration/reset owner. Do not inspect or edit them
23
+ to decide whether the peer is registered.
24
+
25
+ ## All state
26
+
27
+ Run one command:
28
+
29
+ ```sh
30
+ collab context
31
+ ```
32
+
33
+ `collab context` returns identity, liveness, tasks, inbox, `next_actions`,
34
+ master/authority state, `role_brief`, and truth. Registration returns the brief
35
+ effective at registration; `collab context` projects the current brief, and
36
+ promotion or delegation returns the replacement brief. That output is the
37
+ truth. `registered: true` ends bootstrap. If the snapshot returns
38
+ `required_fields`, supply only those real facts once:
39
+
40
+ ```sh
41
+ collab context --provide '<JSON>'
42
+ ```
43
+
44
+ The supplement may contain only requested `session_id`, `thread_id`,
45
+ `endpoint`, or `namespace` facts; it never supplies a worker, approval, token,
46
+ route, or binding. The supplement invocation returns the resulting snapshot.
47
+ Do not choose a worker or run another identity command. If context returns an
48
+ explicit daemon DOWN or runtime error, preserve the exact error and stop;
49
+ daemon lifecycle maintenance is human-authorized. Do not inspect local
50
+ environment/control paths or run any other exploratory command. Registration
51
+ and wake use the internal Codex App Server native thread.
52
+
53
+ Ordinary AppSDK project initialization runs only in the canonical project main
54
+ checkout. Agent identity bootstrap is `collab context`; it may run from the
55
+ project or worktree, and the daemon resolves the canonical route. A Git
56
+ worktree contains tracked `.appsdk/` files but does not inherit ignored
57
+ `.agent-collab/` or `.appsdk-control/` state. The separate authorized AppSDK
58
+ `--fresh --discard-legacy` reset may run from its clean non-main owner worktree
59
+ as specified below. Inside a worktree, the same Codex sessionID/thread remains
60
+ the same peer. Run `collab context` directly there; it reports the inherited
61
+ identity, liveness, tasks, inbox, `next_actions`, and master/authority state.
62
+ Never register the worktree as a second peer, promote yourself, or create a
63
+ second route.
64
+
65
+ ## If required facts are missing
66
+
67
+ `collab context` can return `registered: false`, `identity: null`, and
68
+ `required_fields`. Supply only the real requested facts once with
69
+ `collab context --provide '<JSON>'`. The supplement may contain only requested
70
+ `session_id`, `thread_id`, `endpoint`, or `namespace` facts; it never supplies
71
+ a worker, approval, token, route, or binding. The daemon owns identity
72
+ creation, selection, restoration, update, registration, route publication, and
73
+ lease restoration. Do not run AppSDK or Collab initialization to repair
74
+ identity, and do not inspect routes or worker state to guess a binding.
75
+
76
+ ## Master (after user approval for the exact project + peer)
77
+
78
+ ```sh
79
+ cd /abs/path/project
80
+ collab context # verify sessionID binding and role
81
+ # if required_fields are present, provide only those facts once
82
+ # only when the context snapshot has no live master and the user approved
83
+ # this exact peer:
84
+ collab master promote --approval "<user approval text>"
85
+ collab context
86
+ # only after the plan exists and long-horizon work is approved:
87
+ appsdk goal subscribe --goal docs/goals/<feature>-plan.md --interval 10m
88
+ appsdk goal status --json # active/observed/collab_subscribed
89
+ ```
90
+
91
+ The master then owns orchestration:
92
+
93
+ 1. Query `collab context` once. It must show the identity, liveness, tasks,
94
+ inbox, `next_actions`, `role_brief`, and master/authority state.
95
+ 2. Split the confirmed goal by dependency and unique write scope. Dispatch
96
+ through `collab subagent dispatch` or `appsdk subagent send`; every
97
+ assignment needs done-iff, artifacts, forbidden paths, exact tests, and
98
+ evidence location.
99
+ 3. Before execution or dispatch, run `appsdk bug intake --input <json>` and
100
+ bind the returned `issue_id`; read-only conversation skips this path.
101
+ 4. Keep workers saturated from the approved task graph, then from
102
+ `appsdk bug list --status open --json` in `P0 > P1 > P2` order.
103
+ 5. Own blockers, re-dispatch or auditable force-close stuck tasks, integrate
104
+ reviewed commits on latest main, and keep source/review/merge/install/
105
+ restart/live-replay evidence separate.
106
+ 6. Remove only resources created by this round. Preserve other peers'
107
+ worktrees, processes, and evidence.
108
+
109
+ Stop normal setup here. Do not run operator diagnostics, read `routes.jsonl`,
110
+ inspect processes, or list `.agent-collab/`. If context explicitly reports
111
+ daemon DOWN or a runtime error, preserve the exact error and stop; daemon
112
+ lifecycle maintenance is human-authorized.
113
+
114
+ ## Long-horizon master initialization and timer proof
115
+
116
+ The master creates the plan file before registering the timer:
117
+
118
+ ```sh
119
+ appsdk goal subscribe --goal docs/goals/<feature>-plan.md --interval 10m
120
+ appsdk goal status --json
121
+ appsdk longhorizon show --json
122
+ ```
123
+
124
+ `appsdk goal status --json` must report `active: true`,
125
+ `desired: subscribed`, `observed: subscribed`, `collab_subscribed: true`, a
126
+ non-null `subscription_id`, and `error: null`. Command output alone is not
127
+ timer proof. Run one short-interval live replay and record the armed
128
+ subscription, fired deadline notification, and consumed result. The current
129
+ implementation is a one-shot deadline; rearm it after consumption, expiry, or
130
+ a Collab restart.
131
+
132
+ ## Upstream AppSDK bug report
133
+
134
+ When a project hits a defect in AppSDK itself, do not patch around it or hide
135
+ it in project-local state:
136
+
137
+ ```sh
138
+ appsdk bug list -q "<symptom>" --json --upstream
139
+ appsdk bug new --upstream -t "[SDK Bug] <symptom>" -m "<reproduction, expected, observed, version, commit, logs>" -l "P0,appsdk"
140
+ appsdk bug show <id> --json --upstream
141
+ ```
142
+
143
+ Include the source commit, binary version/hash, exact command, first failing
144
+ layer, and whether the same path fails from a clean project. The upstream bug
145
+ is a report and evidence record; it is not proof that the local delivery
146
+ passed.
147
+
148
+ `--upstream` is the explicit git-bug upstream route. The report must use the
149
+ actual symptom, reproduction, expected/observed result, version/commit,
150
+ and relevant logs; do not turn it into a local project bug or a fallback
151
+ workaround.
152
+
153
+ ## Ordinary peer (project already has .appsdk/project.json and a live master)
154
+
155
+ ```sh
156
+ cd /abs/path/project
157
+ collab context
158
+ # if required_fields are present, provide only those facts once
159
+ ```
160
+
161
+ If context reports `role=master`, stop and report the conflict to the master;
162
+ do not promote yourself and do not start a second daemon.
163
+
164
+ Read master/authority state from the same context snapshot. A live master
165
+ exists iff the returned `master` is an object with `endpoint_live=true`.
166
+ `master: null` means no live master is recorded; a `master` object with
167
+ `endpoint_live=false` is a recorded-but-dead identity and is not a live master.
168
+ A worktree normally has no local `.agent-collab/`; that does not mean the peer
169
+ is unregistered or that no master exists. A failed `collab context`, including
170
+ `token mismatch`, is a registration problem, not evidence of no master. If it
171
+ fails, preserve the exact error. Report the registration error to the live
172
+ master only when the snapshot shows `endpoint_live=true`; when no live master
173
+ exists, report it to the explicitly authorized migration/reset owner or the
174
+ user and stop identity repair. Do not infer "no master", copy/edit identity
175
+ state, reset, or promote yourself from the worktree.
176
+
177
+ For an explicitly authorized clean epoch, the reset owners are separate. The
178
+ AppSDK line is a reset/reinitialize operation, not ordinary initialization:
179
+
180
+ ```sh
181
+ # AppSDK-owned project control plane, from a clean non-main owner worktree
182
+ appsdk init <project> --fresh --discard-legacy
183
+
184
+ # Collab-owned project control plane, during a controlled maintenance window
185
+ collab down
186
+ collab reset --project --discard-legacy --approval "<user authorization>"
187
+ collab up
188
+ collab context
189
+ ```
190
+
191
+ Neither reset removes the other owner's state or proves delivery, review,
192
+ install, restart, or live communication.
193
+
194
+ ## Identity and route reconciliation
195
+
196
+ Identity creation, selection, restoration, update, route publication,
197
+ registration, and lease restoration belong to the daemon. `collab context` and
198
+ its one factual supplement are the only agent bootstrap. Do not copy tokens,
199
+ edit identity state, or run separate route/status discovery for repair. If
200
+ context explicitly reports daemon DOWN or a runtime error, preserve the exact
201
+ error and stop.
202
+
203
+ ## Stale daemon, socket, or lock
204
+
205
+ `~/.collab/server.sock`, `server.pid`, and `daemon.lock` are host-owned runtime
206
+ objects. If `collab context` explicitly reports daemon DOWN or a runtime error,
207
+ preserve the exact output and stop. Starting, stopping, or restarting the host
208
+ daemon is human-authorized maintenance. An authorized human operator may use
209
+ the official `collab down` / `collab up` lifecycle when a maintenance window is
210
+ approved. Never diagnose identity by chaining status commands, remove lock or
211
+ socket files by hand, use broad process-kill commands, or start a project-local
212
+ daemon.
@@ -0,0 +1,162 @@
1
+ # Development Process Control Harness
2
+
3
+ This reference applies only when persistent Guidance is selected. `advisory`
4
+ and `warning` never require setup, a plan or workflow close for independent
5
+ development. Quality admission remains in canonical AppSDK gates. A missing
6
+ optional setup returns `guide_flow_required: false`; do not start a setup detour.
7
+
8
+ ## Functions
9
+
10
+ ```text
11
+ rule compiler declared sources -> deterministic rule context
12
+ plan controller PlanProposal -> PlanRecord/PlanRevisionRecord
13
+ execution ledger step result -> append-only StepExecutionRecord
14
+ state projector lifecycle + plan + events -> readiness/blocker/next
15
+ lifecycle bridge domain node -> canonical AppSDK command/gate
16
+ closeout projector final state -> gaps/cleanup/memory candidates
17
+ ```
18
+
19
+ Harness does not call a model, produce project evidence, mutate lifecycle truth,
20
+ or write memory automatically.
21
+
22
+ ## Tour and ordered review
23
+
24
+ Use `appsdk guide tour --task <id> --mode <domain>` to inspect the generated
25
+ workflow and let a human choose an adjacent path. Persist that choice with a
26
+ TourProposal input when needed. Submit `appsdk guide review` in two stages:
27
+ `node_review` checks and accepts node content first; only after every selected
28
+ node has an accepted revision may `flow_review` update edges, order, or rules.
29
+ The accepted flow patch retains node revision IDs and stays staged until the
30
+ declared source is explicitly updated and compiled.
31
+
32
+ ## Start
33
+
34
+ ```bash
35
+ appsdk guide status --task <task-id>
36
+ appsdk guide init --task <task-id> --mode develop --module <module-id>
37
+ appsdk guide develop --task <task-id> --module <module-id>
38
+ ```
39
+
40
+ If status returns `GUIDANCE_SETUP_REQUIRED`, do not call compile yet:
41
+
42
+ ```bash
43
+ appsdk guide init --task guidance-setup --mode bootstrap --module <module-id>
44
+ ```
45
+
46
+ Read the returned candidate sources, produce the requested
47
+ `GuidanceSetupProposal`, reuse session authorization that already covers a
48
+ difference, and obtain explicit approval only for uncovered changes. The Agent
49
+ then updates project-owned human and machine rule sources in a clean owner
50
+ worktree, declares them in `.appsdk/project.json`, and runs `appsdk guide
51
+ compile` plus `appsdk verify`. If status is only `GUIDANCE_NOT_COMPILED`,
52
+ approved sources are already declared and compile is the next command.
53
+
54
+ After an AppSDK update, or for an explicit rules refresh, a configured project
55
+ uses the same read-only bootstrap intake:
56
+
57
+ ```bash
58
+ appsdk init
59
+ appsdk guide init --task guidance-upgrade --mode bootstrap --module <module-id>
60
+ ```
61
+
62
+ Read current project sources before the returned standard template reference.
63
+ Read actual test commands and CI/hook entrypoints as well as the rules. The
64
+ resulting `template_upgrade_review` proposal may recommend changes, retain
65
+ project rules, or decline template items. Record owner, action, basis, retained
66
+ safeguard, and entrypoint impact for each difference; reuse session
67
+ authorization that already covers a difference and ask only for uncovered
68
+ changes. It does not write state or activate the template. Guidance is optional:
69
+ without it, apply the same authorized audit and CI/hook changes without
70
+ compile. Repeated init or unrelated version changes do not trigger a
71
+ whole-project audit. Apply authorized differences in a clean owner worktree,
72
+ then compile and verify when Guidance is selected.
73
+
74
+ Use `--mode debug` for a bug, regression, or incident. Use another declared
75
+ domain when appropriate. `guide init` is read-only and returns:
76
+
77
+ - declared AGENTS and local Skill paths to read in precedence order;
78
+ - unresolved develop/debug questions to ask the user;
79
+ - exact `$skill-id` suggestions for declared local Skills;
80
+ - missing commands and the next `appsdk guide` command sequence.
81
+
82
+ Ask only questions still unresolved after reading the returned sources and the
83
+ current user request. Then run the projected domain command and write the
84
+ PlanProposal. `appsdk guide --help` lists the full command surface.
85
+
86
+ `GuidanceSetupProposal` is project-level and user-approved. `PlanProposal` is
87
+ task-level and stored in local control state. Never promote a task plan into a
88
+ project Skill automatically.
89
+
90
+ If status returns `MODULE_PATH_MISSING`, treat it as a project module-binding
91
+ error. The named module owner updates that module's `owned_paths` or
92
+ `contract_paths` to real project paths in `.appsdk/project.json`, recompiles
93
+ guidance, and verifies. Do not classify it as a missing global package, Collab
94
+ failure, or reason to wait for an external AppSDK owner.
95
+
96
+ ## PlanProposal
97
+
98
+ ```json
99
+ {
100
+ "schema_version": 1,
101
+ "mode": "develop",
102
+ "goal_id": "goal-id",
103
+ "task_id": "task-id",
104
+ "module_id": "module-id",
105
+ "objective": "bounded objective",
106
+ "scope_paths": ["declared/module/path/**"],
107
+ "steps": [{
108
+ "step_id": "step-1",
109
+ "node_id": "requirements",
110
+ "action": "concrete action",
111
+ "owner": "module-id",
112
+ "expected_evidence": ["requirements"]
113
+ }]
114
+ }
115
+ ```
116
+
117
+ Do not provide `current_node`, `next_transition`, source hashes, scope hash, or
118
+ rule-context hash. Harness derives them.
119
+
120
+ ```bash
121
+ appsdk guide plan --task <task-id> --input plan.json
122
+ ```
123
+
124
+ This is the first task-state write. It creates the active PlanRecord under
125
+ `.appsdk-control/guidance/<task-id>/plan.json`; initialization does not create a
126
+ second intake truth.
127
+
128
+ ## Update
129
+
130
+ ```json
131
+ {
132
+ "schema_version": 1,
133
+ "event_id": "stable-unique-id",
134
+ "step_id": "step-1",
135
+ "result": "pass",
136
+ "observations": ["observed fact"],
137
+ "evidence": ["evidence-id"]
138
+ }
139
+ ```
140
+
141
+ ```bash
142
+ appsdk guide update --task <task-id> --input result.json
143
+ appsdk guide next --task <task-id>
144
+ ```
145
+
146
+ Same event ID and content is idempotent. Same ID with different content fails.
147
+ `pass` with required but absent evidence fails. Only projected step may update.
148
+
149
+ ## Revision
150
+
151
+ Resubmit PlanProposal with `revision_reason` when evidence, blocker, hypothesis,
152
+ scope, owner, source, environment, rules, contracts, gates, or dependencies
153
+ change. Old plan/events remain append-only. Never edit control files by hand.
154
+
155
+ ## Close
156
+
157
+ ```bash
158
+ appsdk guide close --task <task-id>
159
+ ```
160
+
161
+ Read `workflow_complete` and `appsdk_lifecycle_complete` separately. Apply
162
+ memory candidates only through a separate reviewed change.
@@ -0,0 +1,127 @@
1
+ # Review and Delivery
2
+
3
+ Apply this runtime lifecycle when runtime delivery is in scope. Documentation
4
+ and rule edits use targeted checks; they do not invent a runtime deployment,
5
+ Active artifact or freeze ceremony.
6
+
7
+ ## Authoritative requirement review packet
8
+
9
+ Every design or architecture review that consumes project requirements uses
10
+ [authoritative-review-template.md](authoritative-review-template.md). The
11
+ dispatch must provide or clearly reference:
12
+
13
+ - the project's authoritative requirement source, owner, exact read path, and
14
+ effective version;
15
+ - the user original text, acceptance criteria, applicable scope, and any
16
+ explicit user change instruction with its prior version;
17
+ - the exact candidate, base, review stage, allowed/forbidden paths, and current
18
+ stage evidence; and
19
+ - the existing AppSDK EvidenceRecord and ReviewRecord references and the
20
+ backend-supplied review output schema.
21
+
22
+ The executing agent fills only observed project facts and evidence references.
23
+ It must not replace the source with a plan or author summary, edit the template
24
+ for one task, or create an authorization. The independent reviewer reads the
25
+ source and current version, compares the prior version when a change is
26
+ claimed, and records each applicable item-to-design, item-to-implementation,
27
+ and item-to-evidence mapping in the existing backend fields. Missing required
28
+ sources, stale versions, unauthorized requirement changes, reduced acceptance,
29
+ and candidate/scope mismatches block the review. Do not create a second review
30
+ schema or a second requirement store.
31
+
32
+ ## Candidate to review
33
+
34
+ ```text
35
+ candidate commit/tree/scope
36
+ -> development whitebox
37
+ -> exact artifact build
38
+ -> install receipt when required
39
+ -> restart receipt when required
40
+ -> deployed public-entrypoint blackbox
41
+ -> PreReviewValidationRecord
42
+ -> appsdk verify --review-admission
43
+ -> selected architecture review PASS
44
+ ```
45
+
46
+ Review tool follows user choice; otherwise use configured default. Review is
47
+ read-only and bound to exact candidate, scope, maps, artifact, and evidence.
48
+
49
+ Required service operations come from module `deployment_operations`:
50
+ `["install", "restart"]`, `["install"]`, `["restart"]`, or `[]`. An omitted
51
+ field preserves the legacy install/restart requirement. The declaration is
52
+ artifact-bound; changing it invalidates existing validation. Every supplied
53
+ receipt is checked even when optional. Public-entrypoint blackbox and candidate,
54
+ artifact, environment and producer identity remain required. The legacy
55
+ `deployed_blackbox` label includes a library/CLI artifact's real consumer entry;
56
+ mock or source-only checks cannot stand in for that artifact.
57
+
58
+ Changed-scope architecture review must verify:
59
+
60
+ - control/configuration truth uses declared typed control resources, error
61
+ chains, or project configuration sources and never business payloads,
62
+ metadata, debug logs, or implicit context;
63
+ - each semantic behavior has one owner and one implementation, with no fallback
64
+ or temporary bypass;
65
+ - a project-declared lifecycle skeleton preserves its owning boundaries;
66
+ - additions passed an ablation check and common semantics use one shared
67
+ function;
68
+ - missing operators, hooks, or gates fail or skip explicitly and never mock
69
+ success.
70
+
71
+ Concrete quality, safety, contract or material structural regressions block.
72
+ Optional simplification and design preferences are advisory. Untouched
73
+ historical violations are reported as recommendations and do not block unless
74
+ they affect changed scope, safety, ownership, evidence truth, or required
75
+ delivery.
76
+
77
+ Any source, test, build config, environment, artifact, scope, owner, or required
78
+ rule change invalidates affected evidence. Refresh only affected evidence;
79
+ revise the plan only when goal, scope, acceptance, key approach, or dependencies
80
+ materially change. Follow the host contract for review triggers and finding
81
+ re-checks; internal progress does not dispatch another review.
82
+
83
+ ## Review to mainline
84
+
85
+ ```text
86
+ verify evidence freshness; reuse unchanged candidate evidence
87
+ -> fetch latest origin/main
88
+ -> exact integration build/test
89
+ -> protected merge/push
90
+ -> remote main receipt
91
+ ```
92
+
93
+ Conflict returns to owner worktree. Do not resolve inside a serial merge queue
94
+ and keep stale review evidence.
95
+
96
+ EffectivenessRecord can reference pre-review candidate interventions and the
97
+ validated blackbox when input hashes, artifact and candidate identity match
98
+ and evidence has not expired. No mandatory rerun just because review finished.
99
+ Environment or dependency/configuration changes require affected evidence to
100
+ be refreshed. The full lifecycle still validates the current artifact and
101
+ pre-review graph before accepting reused effectiveness.
102
+
103
+ ## Promotion and freeze
104
+
105
+ ```text
106
+ RegressionReport on merged source
107
+ -> appsdk compile
108
+ -> publish immutable Active
109
+ -> archive source/contracts/artifact in Protected
110
+ -> FreezeRecord
111
+ -> appsdk verify
112
+ ```
113
+
114
+ Merge alone is not lifecycle completion. Active/Protected are immutable; use
115
+ canonical version/open/rehydrate flows instead of manual edits or copies.
116
+
117
+ ## Cleanup
118
+
119
+ Resource close is separate from engineering delivery. Retain an owned worktree
120
+ with purpose recorded when needed; keep its cleanup obligation open. When
121
+ cleanup is authorized and required delivery/retention evidence exists:
122
+
123
+ 1. archive required evidence;
124
+ 2. create CleanupRecord or project equivalent;
125
+ 3. remove only the owned merged worktree and branch;
126
+ 4. verify removal;
127
+ 5. release claim.