@hyperdreamer/pi-webui 1.11.0-beta.4 → 1.11.0-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/README.md +15 -0
  2. package/dist/cli.js +265 -32
  3. package/dist/cli.js.map +1 -1
  4. package/dist/client/assets/{CodeViewer-Vvy_gSv8.js → CodeViewer-BJQFgK3S.js} +1 -1
  5. package/dist/client/assets/{UnifiedDiffViewer-OAmwWrcV.js → UnifiedDiffViewer-DfJJrNLr.js} +1 -1
  6. package/dist/client/assets/{index-DycHqr3e.js → index-CsVTzPPD.js} +551 -405
  7. package/dist/client/index.html +1 -1
  8. package/dist/server/sessions/modelTierRegistry.js +14 -0
  9. package/dist/server/sessions/modelTierRegistry.js.map +1 -1
  10. package/dist/server/sessions/piSessionService.js +479 -16
  11. package/dist/server/sessions/piSessionService.js.map +1 -1
  12. package/dist/server/sessions/sessionModelPolicy.js +118 -0
  13. package/dist/server/sessions/sessionModelPolicy.js.map +1 -0
  14. package/dist/server/sessions/sessionRoutes.js +98 -3
  15. package/dist/server/sessions/sessionRoutes.js.map +1 -1
  16. package/dist/server/skills/optionalSkillInstall.js +69 -0
  17. package/dist/server/skills/optionalSkillInstall.js.map +1 -0
  18. package/dist/server/skills/optionalSkillInstaller.js +148 -0
  19. package/dist/server/skills/optionalSkillInstaller.js.map +1 -0
  20. package/dist/shared/apiTypes.d.ts +34 -0
  21. package/dist/shared/apiTypes.js +1 -0
  22. package/dist/shared/apiTypes.js.map +1 -1
  23. package/dist/shared/capabilities.js +3 -0
  24. package/dist/shared/capabilities.js.map +1 -1
  25. package/dist/shared/federatedRoutes.js +2 -0
  26. package/dist/shared/federatedRoutes.js.map +1 -1
  27. package/docs/config.md +10 -0
  28. package/optional-skills/deterministic-subagent-driven-development/SKILL.md +224 -0
  29. package/optional-skills/deterministic-subagent-driven-development/pi-webui-skill.json +28 -0
  30. package/optional-skills/deterministic-subagent-driven-development/prompts/final-reviewer.md +132 -0
  31. package/optional-skills/deterministic-subagent-driven-development/prompts/implementer.md +101 -0
  32. package/optional-skills/deterministic-subagent-driven-development/prompts/re-reviewer.md +60 -0
  33. package/optional-skills/deterministic-subagent-driven-development/prompts/task-reviewer.md +80 -0
  34. package/optional-skills/deterministic-subagent-driven-development/references/capability-contract.md +174 -0
  35. package/optional-skills/deterministic-subagent-driven-development/references/plan-contract.md +268 -0
  36. package/optional-skills/deterministic-subagent-driven-development/references/state-machine.md +177 -0
  37. package/optional-skills/deterministic-subagent-driven-development/scripts/lib/manifest.mjs +258 -0
  38. package/optional-skills/deterministic-subagent-driven-development/scripts/lib/plan-policy.mjs +341 -0
  39. package/optional-skills/deterministic-subagent-driven-development/scripts/lib/prompt-renderer.mjs +290 -0
  40. package/optional-skills/deterministic-subagent-driven-development/scripts/lib/state-machine.mjs +1263 -0
  41. package/optional-skills/deterministic-subagent-driven-development/scripts/lib/state-store.mjs +532 -0
  42. package/optional-skills/deterministic-subagent-driven-development/scripts/sdd-state +3 -0
  43. package/optional-skills/deterministic-subagent-driven-development/scripts/sdd-state.mjs +348 -0
  44. package/optional-skills/deterministic-writing-plans/SKILL.md +232 -0
  45. package/optional-skills/deterministic-writing-plans/references/grammar.md +84 -0
  46. package/optional-skills/deterministic-writing-plans/templates/plan-skeleton.md +143 -0
  47. package/package.json +6 -3
@@ -17,6 +17,7 @@ export declare const PI_WEBUI_CAPABILITIES: {
17
17
  readonly selectedMachineSettings: "settings.selectedMachine";
18
18
  readonly agentProfileConfig: "settings.agentProfile";
19
19
  readonly modelTierSettings: "settings.modelTiers";
20
+ readonly sessionsModelPolicy: "sessions.modelPolicy";
20
21
  };
21
22
  export type PiWebUiCapability = typeof PI_WEBUI_CAPABILITIES[keyof typeof PI_WEBUI_CAPABILITIES];
22
23
  export interface Machine {
@@ -78,6 +79,38 @@ export interface ModelTierModelOption {
78
79
  name?: string;
79
80
  thinkingLevels: string[];
80
81
  }
82
+ export interface ExactModelSelection {
83
+ model: TierModelRef;
84
+ thinkingLevel: string;
85
+ }
86
+ export type SessionModelPolicyMode = "exact" | "tiered";
87
+ export interface SessionModelPolicy {
88
+ mode: SessionModelPolicyMode;
89
+ exact: ExactModelSelection;
90
+ /** Remembered after the first Tiered choice, including while Exact is active. */
91
+ tier?: ModelTier;
92
+ }
93
+ export type SessionModelPolicyUpdate = {
94
+ mode: "exact";
95
+ exact: ExactModelSelection;
96
+ } | {
97
+ mode: "tiered";
98
+ tier: ModelTier;
99
+ };
100
+ export interface ClientSessionModelPolicyStatus {
101
+ mode: SessionModelPolicyMode;
102
+ tier?: ModelTier;
103
+ /** The tuple last confirmed by the policy runtime adapter in this staged slice. */
104
+ resolved: ExactModelSelection;
105
+ ladderValid: boolean;
106
+ blockedReason?: string;
107
+ }
108
+ export interface SessionModelPolicyResponse {
109
+ contractVersion: 1;
110
+ /** Omitted only when the newest persisted entry is malformed and requires repair. */
111
+ policy?: SessionModelPolicy;
112
+ session: SessionStatus;
113
+ }
81
114
  export interface ModelTierRowValidation {
82
115
  valid: boolean;
83
116
  reason?: string;
@@ -754,6 +787,7 @@ export interface SessionStatus {
754
787
  persisted?: boolean;
755
788
  model?: SessionModel;
756
789
  thinkingLevel?: string;
790
+ modelPolicy?: ClientSessionModelPolicyStatus;
757
791
  isStreaming: boolean;
758
792
  isCompacting: boolean;
759
793
  isBashRunning: boolean;
@@ -15,6 +15,7 @@ export const PI_WEBUI_CAPABILITIES = {
15
15
  selectedMachineSettings: "settings.selectedMachine",
16
16
  agentProfileConfig: "settings.agentProfile",
17
17
  modelTierSettings: "settings.modelTiers",
18
+ sessionsModelPolicy: "sessions.modelPolicy",
18
19
  };
19
20
  export const MODEL_TIERS = ["economy", "fast", "standard", "advanced", "capable", "frontier"];
20
21
  export const SESSION_UNREAD_LIMIT = 1_000;
@@ -1 +1 @@
1
- {"version":3,"file":"apiTypes.js","sourceRoot":"","sources":["../../src/shared/apiTypes.ts"],"names":[],"mappings":"AAGA,MAAM,CAA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C/C,eAAe,EAAE,kBAAkB;IACnC,cAAc,EAAE,iBAAiB;IACjC,kBAAkB,EAAE,qBAAqB;IACzC,sBAAsB,EAAE,yBAAyB;IACjD,oBAAoB,EAAE,uBAAuB;IAC7C,sBAAsB,EAAE,yBAAyB;IACjD,qBAAqB,EAAE,wBAAwB;IAC/C,cAAc,EAAE,iBAAiB;IACjC,iBAAiB,EAAE,oBAAoB;IACvC,wBAAwB,EAAE,2BAA2B;IACrD,gBAAgB,EAAE,mBAAmB;IACrC,uBAAuB,EAAE,0BAA0B;IACnD,kBAAkB,EAAE,uBAAuB;IAC3C,iBAAiB,EAAE,qBAAqB;IACxC,mBAAmB,EAAE,sBAAsB;CACnC,CAAC;AAsDX,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,CAAU,CAAC;AAwWvG,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,CAAC;AAC1C,MAAM,CAAC,MAAM,oCAAoC,GAAG,GAAG,CAAC;AACxD,MAAM,CAAC,MAAM,6BAA6B,GAAG,EAAE,GAAG,IAAI,CAAC;AACvD,MAAM,CAAC,MAAM,oCAAoC,GAAG,GAAG,CAAC;AACxD,MAAM,CAAC,MAAM,sCAAsC,GAAG,EAAE,CAAC;AAqCzD,MAAM,CAAC,MAAM,0BAA0B,GAAG,GAAG,CAAC;AAC9C,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC,GAAG,IAAI,CAAC;AAouB3D,MAAM,CAAC,MAAM,2CAA2C,GAAG,MAAM,CAAC"}
@@ -19,6 +19,7 @@ export const WEB_RUNTIME_CAPABILITIES = [
19
19
  PI_WEBUI_CAPABILITIES.selectedMachineSettings,
20
20
  PI_WEBUI_CAPABILITIES.agentProfileConfig,
21
21
  PI_WEBUI_CAPABILITIES.modelTierSettings,
22
+ PI_WEBUI_CAPABILITIES.sessionsModelPolicy,
22
23
  ];
23
24
  export const SESSIOND_RUNTIME_CAPABILITIES = [
24
25
  PI_WEBUI_CAPABILITIES.sessionsDeleteArchived,
@@ -33,6 +34,7 @@ export const SESSIOND_RUNTIME_CAPABILITIES = [
33
34
  PI_WEBUI_CAPABILITIES.sessionsUnread,
34
35
  PI_WEBUI_CAPABILITIES.promptAttachments,
35
36
  PI_WEBUI_CAPABILITIES.modelTierSettings,
37
+ PI_WEBUI_CAPABILITIES.sessionsModelPolicy,
36
38
  ];
37
39
  const EFFECTIVE_CAPABILITY_REQUIREMENTS = {
38
40
  [PI_WEBUI_CAPABILITIES.sessionsDeleteArchived]: ["web", "sessiond"],
@@ -51,6 +53,7 @@ const EFFECTIVE_CAPABILITY_REQUIREMENTS = {
51
53
  [PI_WEBUI_CAPABILITIES.selectedMachineSettings]: ["web"],
52
54
  [PI_WEBUI_CAPABILITIES.agentProfileConfig]: ["web"],
53
55
  [PI_WEBUI_CAPABILITIES.modelTierSettings]: ["web", "sessiond"],
56
+ [PI_WEBUI_CAPABILITIES.sessionsModelPolicy]: ["web", "sessiond"],
54
57
  };
55
58
  export function isPiWebUiCapability(value) {
56
59
  return typeof value === "string" && knownPiWebUiCapabilities.has(value);
@@ -1 +1 @@
1
- {"version":3,"file":"capabilities.js","sourceRoot":"","sources":["../../src/shared/capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAsF,MAAM,eAAe,CAAC;AAE1I,OAAO,EAAE,qBAAqB,EAAE,CAAC;AAGjC,MAAM,CAAC,MAAM,2BAA2B,GAAG,MAAM,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC;AAChF,MAAM,wBAAwB,GAAwB,IAAI,GAAG,CAAC,2BAA2B,CAAC,CAAC;AAE3F,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,qBAAqB,CAAC,sBAAsB;IAC5C,qBAAqB,CAAC,qBAAqB;IAC3C,qBAAqB,CAAC,eAAe;IACrC,qBAAqB,CAAC,cAAc;IACpC,qBAAqB,CAAC,kBA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5J,OAAO,2BAA2B,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,EAAE;QACvD,MAAM,kBAAkB,GAAG,iCAAiC,CAAC,UAAU,CAAC,CAAC;QACzE,OAAO,kBAAkB,CAAC,KAAK,CAAC,CAAC,SAAS,EAAE,EAAE;YAC5C,MAAM,OAAO,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC;YACtC,OAAO,OAAO,EAAE,SAAS,KAAK,IAAI,IAAI,yBAAyB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;QACvF,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -74,6 +74,8 @@ export const FEDERATED_HTTP_ROUTES = [
74
74
  { method: "GET", path: "/sessions/:sessionId/system-prompt" },
75
75
  { method: "GET", path: "/sessions/:sessionId/stream-snapshot" },
76
76
  { method: "GET", path: "/sessions/:sessionId/models" },
77
+ { method: "GET", path: "/sessions/:sessionId/model-policy" },
78
+ { method: "PUT", path: "/sessions/:sessionId/model-policy" },
77
79
  { method: "POST", path: "/sessions/:sessionId/model" },
78
80
  { method: "POST", path: "/sessions/:sessionId/model/cycle" },
79
81
  { method: "GET", path: "/sessions/:sessionId/thinking-levels" },
@@ -1 +1 @@
1
- {"version":3,"file":"federatedRoutes.js","sourceRoot":"","sources":["../../src/shared/federatedRoutes.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,oCAAoC,GAAG,CAAC,GAAG,MAAM,CAAC;AAC/D,MAAM,CAAC,MAAM,6CAA6C,GAAG,CAAC,GAAG,MAAM,CAAC;AACxE,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,GAAG,MAAM,CAAC;AAC5D,MAAM,CAAC,MAAM,wCAAwC,GAAG,CAAC,GAAG,MAAM,CAAC;AAQnE,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,kBAAkB,EAAE;IAC3C,EAAE,MAAM,EAAE,KAAK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EAAE,iBAAiB,EAAE;IAC1C,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,EAAE;IACzC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,2BAA2B,EAAE;IACrD,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,EAAE;IACxC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,EAAE;IACvC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,qBAAqB,EAAE;IAC9C,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,6BAA6B,EAAE;IACvD,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,4BAA4B,EAAE;CACF,CAAC;AAEvD,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,SAAS;IACT,kBAAkB;IAClB,6BAA6B;IAC7B,2EAA2E;CACvC,CAAC"}
package/docs/config.md CHANGED
@@ -235,6 +235,16 @@ In **Settings → Model tiers**, you edit one complete six-rung ladder: `economy
235
235
  - **Missing or malformed ladder:** If `modelTiers` is missing or malformed, Exact-mode model selection remains fully usable, but tiered model routing becomes unavailable.
236
236
  - **Machine federation:** Model tier settings are saved for the selected machine. Editing remote machine settings requires a remote daemon advertising the additive `settings.modelTiers` capability.
237
237
 
238
+ Sessions can also use a per-session model policy from the composer:
239
+
240
+ - **Exact (default):** New root sessions start in Exact mode. It pins the selected provider, model, and thinking level, and keeps the existing provider/model/thinking controls.
241
+ - **Tiered:** Use the first composer control, **Mode**, to select Tiered, then choose one of the six ladder tiers. The Tier selector is disabled while Mode is Exact. Tiered remembers both the selected tier and the Exact model/thinking selection, so switching modes does not discard either choice. It shows the resolved model and thinking level instead of editable Exact controls. Saving the policy or creating a root session applies the selected tier's model and thinking-level tuple atomically.
242
+ - **Validation and recovery:** Tiered requires a complete, valid six-tier ladder on the selected machine. If a configured model becomes unavailable, authentication no longer permits it, or its thinking level is unsupported, PI WEBUI shows the reason and never silently substitutes a model, tier, or thinking level. If a saved policy cannot be restored, prompts remain blocked until you save an explicit repair; PI WEBUI does not silently reuse an older choice.
243
+ - **When changes are available:** You can change a policy only while its session is idle and writable. During active work and for archived sessions, the current policy and any block reason remain visible but the controls are disabled. Once the session is idle and writable, a blocked policy remains repairable through an explicit update.
244
+ - **Availability and compatibility:** Model-policy controls require the `sessions.modelPolicy` capability on both the web process and the session daemon for the selected machine. When that capability is unavailable, PI WEBUI keeps the existing model and thinking controls and hides the additive policy control.
245
+ - **Starting and persistence:** The selected policy is carried into root-session creation from both the first-prompt and **New Session** paths, persists with that session, and remains selected after a failed creation so a retry uses the same choice.
246
+ - **Scope and installation:** This release does not add `/tier-*` commands, and editing the tier ladder later does not automatically remap an existing Tiered session. After installing this release, restart `pi-webui-sessiond.service` manually once; ordinary UI/API autoreload does not load session-daemon changes.
247
+
238
248
  ### Session daemon tools
239
249
 
240
250
  `spawnSessions` controls whether agents receive the `spawn_session` tool. It defaults to `true`; set it to `false` if you do not want an agent to start independent PI WEBUI sessions.
@@ -0,0 +1,224 @@
1
+ ---
2
+ name: deterministic-subagent-driven-development
3
+ description: Use when executing a written implementation plan whose tasks declare Implementer tiers and deterministic tracked-child model-policy controls are required
4
+ ---
5
+
6
+ # Deterministic Subagent-Driven Development
7
+
8
+ **Related workflows:** `using-git-worktrees` before allocating a worktree;
9
+ `test-driven-development`, `requesting-code-review`, and
10
+ `finishing-a-development-branch` as child prompts at their boundaries. Child
11
+ prompts are self-contained; never assume a child loaded a parent skill.
12
+
13
+ ## Capability and Validation Gates
14
+
15
+ Execute these eight gates in strict order. Before gate 7, read-only operations are
16
+ permitted. Workspace creation, Git mutation, deliverable editing, and dispatch are
17
+ forbidden.
18
+
19
+ **Read the governing reference before judging anything against it:**
20
+ `references/capability-contract.md` before gates 2–4, `references/plan-contract.md`
21
+ before gate 6, `references/state-machine.md` before reporting any state token. They
22
+ hold the exact field names, tokens, and thresholds; this file only points at them.
23
+
24
+ 1. **Plan and worktree.** Confirm both are specified and accessible without
25
+ mutating either.
26
+
27
+ 2. **Policy contract.** Read `references/capability-contract.md`, then confirm
28
+ `get_model_policy` returns a version-1 result matching it: active policy, current runtime
29
+ tuple, next-request tuple, ladder status, tier commands, and tracked-dispatch
30
+ capability. Reject unknown versions.
31
+
32
+ 3. **Spawn capability.** Confirm `spawn_subsession` advertises `tierField: true`.
33
+ The runtime provides **no** dispatch key and **no** deduplication. Never expect
34
+ idempotency evidence; its absence is not a capability failure.
35
+
36
+ 4. **Ladder completeness.** Tiered mode: all six ladder mappings valid and
37
+ resolvable. Exact mode: retain the runtime tuple; tier directives are visibly
38
+ ignored.
39
+
40
+ 5. **Capability blocked.** If any check above fails: record `CAPABILITY_BLOCKED`,
41
+ name the cause and required capability, confirm zero dispatches. **Stop.**
42
+
43
+ 6. **Plan validation.** Read `references/plan-contract.md`, then run
44
+ `sdd-state validate-plan PLAN_FILE`. If the plan is rejected: record
45
+ `PLAN_INVALID`, quoting the validator's diagnostic. **Never guess a missing
46
+ tier**, and never accept an ambient current tier as a default for an absent
47
+ plan field. Stop.
48
+
49
+ With no shell to run the validator, say so, report the defect you found by
50
+ reading the plan, and still report `PLAN_INVALID`. An unavailable tool does not
51
+ change the state the run is in.
52
+
53
+ 7. **Workspace init.** Create the ignored run workspace. Run `sdd-state init`
54
+ against the inspected repo/worktree/branch/base-ref/merge-base identity, then
55
+ record `capability-confirmed` and `plan-valid`.
56
+
57
+ 8. **Preflight.** Run batched worktree and deliverable checks. On conflict, record
58
+ `PREFLIGHT_DECISION_REQUIRED` and persist the human ruling **before** any Git or
59
+ deliverable mutation.
60
+
61
+ ## Canonical Direction of Truth
62
+
63
+ `state.json` is canonical. `progress.md` is an append-only audit projection derived
64
+ from it.
65
+
66
+ **This is a convention you cannot reach by reasoning.** Both baseline conditions on
67
+ `post-compaction-illegal-transition` produced the correct state token and then
68
+ stated the opposite — "the audit ledger is canonical and state.json is a derived
69
+ cache" — and both invented repair mechanisms, one minting
70
+ `task4-rereview-replay-rev17`. Careful reasoning confidently chose wrong.
71
+
72
+ Never hand-edit either file. Every change goes through `sdd-state transition`, which
73
+ writes `state.json` first, then appends to `progress.md`. A missing final marker is
74
+ repairable; phantom markers from a reversed order are not.
75
+
76
+ ## State-Owned Orchestration Loop
77
+
78
+ Resolve all scripts, prompts, and references relative to this **explicitly loaded
79
+ `SKILL.md`**, never from the current directory or another same-name installation.
80
+
81
+ **Before each action:**
82
+
83
+ 1. Run `sdd-state show` and reload canonical state.
84
+ 2. If the audit marker is missing and no live lock is reported, run
85
+ `sdd-state repair-audit` at the current expected revision before proceeding.
86
+ 3. If state is `DISPATCH_AMBIGUOUS`, inspect for an observed child with
87
+ `list_subsessions`, then persist a ruling — adopt the observed session id **or**
88
+ reissue the stored bytes accepting a possible orphan. Never spawn again without a
89
+ ruling; a repeated spawn creates a **new child**, not a replay.
90
+
91
+ **Dispatch:**
92
+
93
+ Read `references/capability-contract.md` before any dispatch decision, including
94
+ recovery and mismatch decisions mid-run. It defines what the tool accepts, returns,
95
+ and does not guarantee. A recovered run that skips it reasons from memory.
96
+
97
+ 1. Produce the dispatch prompt with `sdd-state render-prompt`; never construct one
98
+ inline.
99
+ 2. Record the full intent — rendered prompt bytes, tier, cwd, and the
100
+ controller-owned `dispatchKey` from the state helper — in `state.json`
101
+ **before** calling `spawn_subsession`. If the phase you were given is already
102
+ `IMPLEMENT_DISPATCH_INTENT`, that intent exists: dispatch it, do not record a
103
+ second one.
104
+ 3. Call `spawn_subsession` with `{ prompt, cwd, tier }`. The tool returns
105
+ `{ sessionId, cwd }` only. **Never pass `dispatchKey` to the tool.**
106
+ 4. Immediately record the returned `sessionId` against the intent.
107
+ 5. Holding the returned `sessionId` means the phase is `IMPLEMENT_RUNNING`, even if
108
+ persisting it failed. Retry the write; do not relabel the phase.
109
+ `DISPATCH_AMBIGUOUS` is only for an intent whose `sessionId` you cannot recover
110
+ at all, entered through `dispatch-window-crossed`.
111
+
112
+ **Verify what you have a channel to verify.** A child's effective tier is checkable
113
+ with `read_subsession`, so check it; the run's recorded phase may have no channel
114
+ from where you stand. Where a channel exists and contradicts a claim, the channel
115
+ wins; where none exists, name the gap and never present a premise as confirmed.
116
+
117
+ **An unreachable store neither authorizes refusing to act nor changes the phase.**
118
+ If `state.json` or the helper is unreachable, take the action the given phase calls
119
+ for, then report the phase that action produced plus the persistence gap.
120
+ **Unwritable is not unknown.** Stalling to re-confirm a phase you already hold is a
121
+ different failure, not caution.
122
+
123
+ **Recovery:** reissue the exact bytes stored in the dispatch intent; **never
124
+ re-render on recovery.** Exact includes trailing whitespace and the final newline.
125
+ Copy the stored bytes, never retype or trim them, and never call a reissue verbatim
126
+ without comparing byte for byte: seven of fifteen recovery runs dropped the stored
127
+ final newline while claiming verbatim.
128
+
129
+ **Loop rules:**
130
+
131
+ - One SDD-owned active child at a time; never parallelize tasks.
132
+ - Yield at a join point; never poll status in a loop.
133
+ - Fresh children per role: implementer, fixer, task reviewer, re-reviewer, and
134
+ each final role.
135
+ - Write prompts, reports, and packages only under the ignored per-plan workspace.
136
+ - Pass bounded context by file path, never as pasted conversation history.
137
+ - Continue automatically between valid transitions. Pause only at
138
+ `CAPABILITY_BLOCKED`, `PLAN_INVALID`, `TASK_BLOCKED`, `DISPATCH_MISMATCH_BLOCKED`,
139
+ `PREFLIGHT_DECISION_REQUIRED`, `DISPATCH_AMBIGUOUS`, or `FINAL_BLOCKED`.
140
+
141
+ For the complete phase/event table see `references/state-machine.md`. For artifact
142
+ bounds, report schemas, and blocked-state recovery see `references/plan-contract.md`.
143
+
144
+ ## Tier and Dispatch Rules
145
+
146
+ | Role | Tier |
147
+ |---|---|
148
+ | Implementer | Plan's `**Implementer tier:**` for this task |
149
+ | Task reviewer | Implementer + 1, Standard floor, Frontier cap |
150
+ | Fix rounds 1–3 | Implementer |
151
+ | Fix round 4 | Implementer + 1 |
152
+ | Fix round 5 | Implementer + 2 |
153
+ | Scoped re-reviewer | Implementer + 1, Standard floor, Frontier cap |
154
+ | Final reviewer / fixer / re-reviewer | Frontier |
155
+
156
+ Use `sdd-state role-tier --implementer TIER --role ROLE [--round N]` to resolve
157
+ every tier. Never calculate a tier inline.
158
+
159
+ **Confirming the bind:** the spawn result carries no policy evidence. Learning which
160
+ tier a child ran at requires `read_subsession`. There is no other channel.
161
+
162
+ **A reported mismatch is a claim, not evidence.** Before recording
163
+ `DISPATCH_MISMATCH_BLOCKED`, read the child and compare its effective tier with the
164
+ intent's. Never record a mismatch from a description of one, including one in your
165
+ own instructions. Then stop: a mismatch is never diagnosed by spawning another
166
+ child.
167
+
168
+ **Exact mode:** the parent's policy inspection is the gate, checked before dispatch.
169
+ Tier directives will be visibly ignored in the child; that is expected behavior.
170
+
171
+ ## Bounded Context, Review, and Completion
172
+
173
+ **Context retries.** `contextAttempts` is bounded at 2; a third `NEEDS_CONTEXT`
174
+ routes through `context-limit-reached` → `TASK_BLOCKED`. Enrichment never advances
175
+ `fixRound`.
176
+
177
+ **Concerns.** A `DONE_WITH_CONCERNS` report with an empty concern list is rejected
178
+ by the reducer. Adjudicate `observational` concerns through review; `correctness` and
179
+ `scope` concerns require a persisted ruling before review.
180
+
181
+ **Task review.** Every task gets independent spec and quality review. Completion
182
+ requires `SPEC: PASS` and `QUALITY: APPROVED` with no open load-bearing finding.
183
+ `Critical` and `Important` findings open a fix round and cannot be parked.
184
+
185
+ **Fix rounds.** At most five under the tier schedule, each a fresh child with **no
186
+ memory of prior rounds**. The fix package must carry every prior attempted
187
+ correction and why it failed; without that history a child repeats a correction
188
+ already recorded as failed.
189
+
190
+ **Final review.** At Frontier, covering the whole branch from merge base to final
191
+ HEAD. At most one final-fix wave, then a fresh Frontier re-review. The
192
+ **controller** — not the reviewer — blocks on unadjudicated load-bearing residuals
193
+ and parks contestable ones only with a persisted ruling.
194
+
195
+ **Completion.** Requires clean canonical state, final-review evidence, reconciled
196
+ ledgers, and the normal branch-finishing workflow.
197
+
198
+ **One run at a time.** Never run two SDD orchestrations against the same worktree
199
+ and plan concurrently.
200
+
201
+ ## Red Flags / Common Mistakes
202
+
203
+ Every entry below was observed in the recorded baseline. Each names the required
204
+ state and evidence.
205
+
206
+ | Observed behavior | Required instead |
207
+ |---|---|
208
+ | Reasoning to a plausible token: `BLOCKED_TIER_UNRESOLVED`, `CONTEXT_LIMIT_BLOCKED`. Both conditions did this on every scenario. | Report a token from `references/state-machine.md`. If none fits, the transition is illegal — say that, do not coin a name. |
209
+ | Stating the audit ledger is canonical and `state.json` derived. Both conditions, stated confidently. | `state.json` is canonical. `progress.md` is derived. |
210
+ | Inventing a repair mechanism, e.g. minting `dispatchKey: task4-rereview-replay-rev17` for a "replay" no contract defines. | Repair only a missing final marker, only via `repair-audit`, only at the current expected revision, only with no live lock. |
211
+ | Issuing a second dispatch to *investigate* a policy mismatch. | Record `DISPATCH_MISMATCH_BLOCKED`. A mismatch is not diagnosed by spawning more children. |
212
+ | Recording `DISPATCH_MISMATCH_BLOCKED` from tiers quoted in the instructions, without reading the child. | Read the child with `read_subsession` first. Verify the mismatch against the dispatch intent, then record it. |
213
+ | Describing a transition in prose instead of naming the state. | Report the exact state token every time you act. |
214
+ | Refusing a bad instruction correctly but not naming the governing rule or the counters. | Name the rule and report `contextAttempts` and `fixRound` as named values. |
215
+ | Judging a contract or token from memory of this file instead of reading the reference that defines it. | Read the governing reference first. It holds the exact field names and tokens; this file only points at them. |
216
+ | Refusing to dispatch a recorded intent, or calling the result `DISPATCH_AMBIGUOUS`, because the store was unreachable. | Dispatch, then report the phase the action produced plus the persistence gap. Ambiguity is not knowing whether a child exists; if you hold its `sessionId`, you know. |
217
+ | Requesting a fresh dispatch key under authority pressure to "get today's mapping". | There is no dispatch key parameter. A repeated spawn creates a second child. Resolve `DISPATCH_AMBIGUOUS` with a persisted ruling. |
218
+
219
+ **On authority pressure.** Scenarios embed a manager or director requesting the
220
+ unsafe action. Refusing correctly but not producing the required artifact is still a
221
+ failure. Give the state token, the evidence, and the named rule.
222
+
223
+ **Never do in coordinator context:** implement, review, fix, poll child status,
224
+ hand-edit state or audit files, or paste conversation history into a child prompt.
@@ -0,0 +1,28 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "name": "deterministic-subagent-driven-development",
4
+ "distribution": "opt-in",
5
+ "sourcePackage": {
6
+ "name": "@hyperdreamer/pi-webui",
7
+ "version": "1.11.0-beta.4"
8
+ },
9
+ "runtimeHashAlgorithm": "sha256-path-nul-bytes-v1",
10
+ "runtimeHash": "784da54c3cca6d68c338563a6eae8f655d2660ef7b91ada622e028b71222fe86",
11
+ "runtimeFiles": [
12
+ "SKILL.md",
13
+ "prompts/final-reviewer.md",
14
+ "prompts/implementer.md",
15
+ "prompts/re-reviewer.md",
16
+ "prompts/task-reviewer.md",
17
+ "references/capability-contract.md",
18
+ "references/plan-contract.md",
19
+ "references/state-machine.md",
20
+ "scripts/lib/manifest.mjs",
21
+ "scripts/lib/plan-policy.mjs",
22
+ "scripts/lib/prompt-renderer.mjs",
23
+ "scripts/lib/state-machine.mjs",
24
+ "scripts/lib/state-store.mjs",
25
+ "scripts/sdd-state",
26
+ "scripts/sdd-state.mjs"
27
+ ]
28
+ }
@@ -0,0 +1,132 @@
1
+ # Final Reviewer
2
+
3
+ You review the entire completed plan, once, at the end. You are read-only, and you
4
+ run at `frontier` tier because this is the last gate before the work is considered
5
+ done.
6
+
7
+ This contract preserves the independent-review guarantees of
8
+ `requesting-code-review/code-reviewer.md` and adds the rules the deterministic
9
+ controller depends on.
10
+
11
+ ## Range
12
+
13
+ Dispatch Context pins the merge base and the final HEAD. Review exactly that range.
14
+
15
+ ```bash
16
+ git diff --stat <base>..<head>
17
+ git diff <base>..<head>
18
+ ```
19
+
20
+ ## Read-only
21
+
22
+ Do not mutate the working tree, the index, `HEAD`, or branch state in any way. Use
23
+ `git show`, `git diff`, and `git log` to inspect history. If you need a working copy
24
+ of another revision, add a separate worktree in a temporary directory — never move
25
+ `HEAD` on this checkout.
26
+
27
+ ## What to check
28
+
29
+ **Plan alignment**
30
+ - Does the implementation match the plan, task by task?
31
+ - Are deviations justified improvements or problematic departures?
32
+ - Is all planned functionality present?
33
+ - Are the plan's Global Constraints satisfied across the whole range, not just
34
+ per-task? A constraint can hold in every task individually and still be violated
35
+ by their composition.
36
+
37
+ **Code quality** — separation of concerns, error handling, type safety, DRY without
38
+ premature abstraction, edge cases.
39
+
40
+ **Architecture** — sound design decisions, scalability and performance, security,
41
+ clean integration with surrounding code. Also: is the design coherent *across*
42
+ tasks? Each task was implemented by a child that saw only its own brief, so
43
+ architectural drift between tasks is a failure mode only you are positioned to see.
44
+
45
+ **Testing** — do tests verify real behavior rather than mocks, are edge cases
46
+ covered, are there integration tests where they matter, do they all pass?
47
+
48
+ **Production readiness** — migration strategy if schema changed, backward
49
+ compatibility, documentation, no obvious bugs.
50
+
51
+ ## Reconcile the finding ledger
52
+
53
+ Dispatch Context includes every finding from every task review, with its
54
+ disposition: `open`, `fixed`, `parked`, `out-of-scope`, or `cannot-verify`.
55
+
56
+ Check each one against the final code:
57
+
58
+ - A `fixed` finding that is still present is a **Critical** finding now. It means a
59
+ round reported success it had not achieved.
60
+ - A `parked` finding must still be genuinely non-load-bearing at the end. Something
61
+ parked as cosmetic in task 2 can become load-bearing once task 7 builds on it.
62
+ - An `out-of-scope` or `cannot-verify` finding needs a stated resolution.
63
+
64
+ Report any residual by ID so the controller can match it.
65
+
66
+ ## Calibration
67
+
68
+ Categorize by actual severity. Not everything is Critical.
69
+
70
+ - **Critical** — bugs, security issues, data-loss risk, broken functionality.
71
+ - **Important** — architecture problems, missing features, poor error handling,
72
+ test gaps.
73
+ - **Minor** — style, optimization, documentation polish.
74
+
75
+ Mark each finding load-bearing yes or no. `Critical` and `Important` are
76
+ load-bearing by definition and cannot be parked.
77
+
78
+ Acknowledge what was done well before listing issues. Accurate praise makes the
79
+ rest of the feedback credible; generic praise makes all of it cheaper.
80
+
81
+ A compatibility break is not Minor. If existing behavior changed in a way callers
82
+ can observe, that is at least Important regardless of how small the diff is.
83
+
84
+ If the problem is in the plan rather than the implementation, say so explicitly.
85
+
86
+ ## Report
87
+
88
+ Write exactly one bounded report at the report path in Dispatch Context.
89
+
90
+ ```text
91
+ SPEC: PASS | FAIL
92
+ QUALITY: APPROVED | CHANGES_REQUESTED
93
+
94
+ STRENGTHS:
95
+ - <specific, with file:line>
96
+
97
+ FINDINGS:
98
+ - id: F-<n>
99
+ severity: Critical | Important | Minor
100
+ loadBearing: yes | no
101
+ location: path/to/file.ts:42
102
+ evidence: <what you observed>
103
+ impact: <consequence>
104
+ correction: <what would resolve it>
105
+
106
+ LEDGER RECONCILIATION:
107
+ - id: F-<n>
108
+ recordedDisposition: fixed | parked | out-of-scope | cannot-verify
109
+ stillPresent: yes | no
110
+ note: <evidence>
111
+
112
+ RECOMMENDATIONS:
113
+ - <improvement, clearly separated from findings>
114
+ ```
115
+
116
+ For each finding: `file:line`, what is wrong, why it matters, and how to fix it if
117
+ that is not obvious.
118
+
119
+ ## You decide nothing
120
+
121
+ Report evidence and verdicts. Do not choose the run's outcome and do not touch
122
+ canonical state. The controller applies the rules:
123
+
124
+ - unadjudicated or load-bearing residuals enter `FINAL_BLOCKED`;
125
+ - contestable, non-load-bearing residuals can be parked only by an explicit
126
+ persisted ruling;
127
+ - exactly one final-fix wave is permitted, ever.
128
+
129
+ After a final fix and re-review, return the exact residual findings with evidence.
130
+ Do not soften a residual to let the run finish, and do not withhold a clear verdict
131
+ because the consequence is a block. The block is the correct outcome when the
132
+ evidence supports it.