@dsmm/dsmm 0.3.36 → 0.3.37

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.
package/README.md CHANGED
@@ -4,14 +4,14 @@ DSMM 是 DeepSeek Harness(DSH)的插件。它让不同 Agent 分工处理任
4
4
 
5
5
  比如,让 Planner 拆解任务、Coding 写代码、Reviewer 检查结果,再由 Orchestrator 协调。各个角色可以用不同的模型,不必共用一套配置。
6
6
 
7
- 当前发布版本为 `@dsmm/dsmm@0.3.36`,支持 DSH `>=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0`。安装前请确认客户端版本;范围外的 DSH 版本不受支持。Desktop 使用自带运行时,独立命令行环境需要 Node.js 22 或更高版本。
7
+ 当前发布版本为 `@dsmm/dsmm@0.3.37`,支持 DSH `>=0.2.1-rc.2 <0.2.2-0 || >=0.2.2-rc.1 <0.3.0`。安装前请确认客户端版本;范围外的 DSH 版本不受支持。Desktop 使用自带运行时,独立命令行环境需要 Node.js 22 或更高版本。
8
8
 
9
9
  官方 DSH rc.3 以 `engines.dsh` 优先于 peer ranges 判定兼容性;锁文件保留 `0.2.1-rc.2` 作为开发基线。
10
10
 
11
11
  历史会话仅保守支持已有的原生读取和已验证的受限恢复路径,不承诺补齐旧版本行为或自动迁移。继续执行须满足当前身份与权限检查,历史批准不会恢复为当前授权。
12
12
 
13
13
  - 源码仓库:[hugefiver/dsmm](https://github.com/hugefiver/dsmm)
14
- - 安装来源:[npm (@dsmm/dsmm)](https://www.npmjs.com/package/@dsmm/dsmm);发布资产:[GitHub Releases (v0.3.36)](https://github.com/hugefiver/dsmm/releases/tag/v0.3.36)
14
+ - 安装来源:[npm (@dsmm/dsmm)](https://www.npmjs.com/package/@dsmm/dsmm);发布资产:[GitHub Releases (v0.3.37)](https://github.com/hugefiver/dsmm/releases/tag/v0.3.37)
15
15
 
16
16
  ---
17
17
 
@@ -22,7 +22,7 @@ DSMM 是 DeepSeek Harness(DSH)的插件。它让不同 Agent 分工处理任
22
22
  ### 初次安装
23
23
 
24
24
  1. 打开 DeepSeek Harness Desktop,进入 **插件(Plugins)** 页面。
25
- 2. 点击 **添加插件(Add plugin)**,输入 `@dsmm/dsmm@0.3.36` 并确认。
25
+ 2. 点击 **添加插件(Add plugin)**,输入 `@dsmm/dsmm@0.3.37` 并确认。
26
26
  3. 安装完成后,检查插件是否处于启用状态。如果界面提示需要重启,请按提示重启客户端。
27
27
 
28
28
  Desktop 的插件由客户端自己管理。全局 npm 安装和独立 npm 版 `dsh` 命令不能替代这一步。
@@ -34,7 +34,7 @@ DSH Desktop 当前不支持在界面中用同名版本原位覆盖更新插件
34
34
  1. 保存好正在进行的任务,**正常退出并完全关闭 DSH Desktop**。
35
35
  2. 使用 Desktop 安装自带的命令行工具更新配置。以下示例适用于 Windows 默认安装路径(`%LOCALAPPDATA%\Programs\DeepSeek Harness\`):
36
36
  ```powershell
37
- & "$env:LOCALAPPDATA\Programs\DeepSeek Harness\resources\runtime\cli\bin\dsh.cmd" plugin --profile desktop add @dsmm/dsmm@0.3.36 --save-exact --ignore-scripts --registry=https://registry.npmjs.org
37
+ & "$env:LOCALAPPDATA\Programs\DeepSeek Harness\resources\runtime\cli\bin\dsh.cmd" plugin --profile desktop add @dsmm/dsmm@0.3.37 --save-exact --ignore-scripts --registry=https://registry.npmjs.org
38
38
  ```
39
39
  *若安装在自定义路径,请替换为对应的实际位置;非 Windows 系统请参考 Desktop 自身菜单或官方指引,不要混用非 Desktop 的独立 CLI 命令。*
40
40
  3. 重新打开 DSH Desktop 即可加载新版本。
@@ -44,11 +44,11 @@ stale. Generated assets are package resources, not an alternate source of truth.
44
44
  Ordinary native presets use `prompts/source/deepwork/general.md` while Deepwork is
45
45
  active. A neutral opening replaces the harness identity and the stock model announcement
46
46
  is omitted. Custom persona instructions, model selection, effort and delegation stay in place. DSMM identity comes from an explicit DSMM preset or trusted invocation,
47
- not mode activation or `defaultActive`. The full `deepwork/default.md` workflow and
48
- role/model workflow calibrations apply only to admitted DSMM roles. Ordinary
49
- Agents receive general guidance, a behavior-only calibration for the current model,
50
- lazy skills and applicable model-parameter tuning; they acquire no planner/critic
51
- dispatch requirement or DSMM role tools. Both preset types select calibration using
47
+ not mode activation or `defaultActive`. Ordinary Agents receive the short behavior-only
48
+ summary for the current model, lazy skills and applicable model-parameter tuning; they do
49
+ not receive the full role/model source files, planner/critic dispatch requirements or DSMM
50
+ role tools. Admitted DSMM roles and categories instead assemble the complete selected base
51
+ and additive sources under their role-first workflow. Both preset types select behavior using
52
52
  the current prompt assembly rather than the preceding request header.
53
53
 
54
54
  Model guidance is subordinate to the selected role and the current runtime's tools
@@ -58,25 +58,42 @@ the current runtime catalog. The six development workflow skills describe their
58
58
  engineering stage in both discovery metadata and their frontmatter. Other tasks can
59
59
  use domain skills and native delegation without loading a development workflow.
60
60
  Model identifiers and families select resources in code; calibration text, headings
61
- and tags are model-neutral. Source filenames retain selector identities. Kimi
62
- K3 and earlier, and names without a determinate version, use `deepwork/kimi.md`.
61
+ and tags are model-neutral. Source filenames retain selector identities. For admitted
62
+ functional roles, the selected whole-model base precedes additive layers. Planner profiles
63
+ use `deepwork/planner.md` as their base and still receive applicable additive guidance.
64
+ A category keeps its authoritative category role first, then its own family layer and
65
+ applicable additive source, without inheriting the planner base or an unrelated family base.
66
+
67
+ Kimi K3 and earlier, and names without a determinate version, use `deepwork/kimi.md`.
63
68
  K3.1 and later numeric generations, including K3.2 and K4+, exclusively use
64
69
  `deepwork/kimi-k3-1.md`. Prompt-only K aliases such as `k3p1` leave reasoning-family
65
70
  classification unchanged. Existing `kimi-k27` names retain their K2.7 meaning
66
71
  and the old calibration. Selection preserves the first model identity and keeps
67
72
  structured provider metadata outside model matching. Gemini 4 and later, including Argon,
68
- receive the `gemini-4` additive layer. No injected self-identification
69
- or textual model guard is needed. Prompt selection does not change provider,
70
- effort, fallback chains or DSH model capabilities. Fable and Mythos from 5.2 onward select
71
- `deepwork/claude-fable-5-2.md` for admitted roles and categories. It directs the
72
- agent to finish actionable work in its assignment and diagnose a failure before retrying.
73
-
74
- The K3.1+ scope-and-delivery calibration selectively adapts Senpi `2026.11.3-3`'s
73
+ receive the `gemini-4` additive layer. All Claude generations use the single `claude`
74
+ additive source for every role and category. Grok and DeepSeek likewise add `grok` and
75
+ `deepseek` without replacing the base. Grok prompt-only selection leaves its reasoning
76
+ family unknown. No injected self-identification or textual model guard is needed. Prompt
77
+ selection does not change provider, effort, fallback chains or DSH model capabilities.
78
+
79
+ Current generalized calibration uses OMO `59b4ac1f67` and Senpi `2026.11.23` as
80
+ reference sources under the local role-first, permission and workflow contracts. The K3.1+
81
+ scope-and-delivery source retains its original Senpi `2026.11.3-3` attribution for
75
82
  `kimi-k3-1.ts` at published source `29eedcbe7c0cdf1c89eac7c94d4093b485925303`.
76
- Its source embeds the complete MIT copyright and permission notice, retained in
77
- the packaged resource. The additive guidance prioritizes current intent, bounded
78
- action, complete outcomes, evidence reuse, and truthful handoff under the local
79
- role and workflow contracts; it adds no effort lock or workflow gate.
83
+ Its complete MIT copyright and permission notice remains embedded in the packaged resource.
84
+ The additive guidance prioritizes latest-turn conflict handling, implementation ownership
85
+ without duplicate or dead code, bounded action, complete outcomes, evidence reuse and
86
+ truthful handoff; it adds no effort lock or workflow gate.
87
+
88
+ The admitted `gpt` source is a compact whole-model/category calibration covering complete
89
+ named-source reading, material questions, diagnosed recovery, event-driven progress,
90
+ planner/critic ownership, operation-specific Git authorization, evidence reuse and
91
+ reader-first delivery. `claude` applies completion, scope, ownership, delegation-cost and
92
+ real-execution rules to every role. `grok` covers observable completion and defect-scoped
93
+ visual work; `deepseek` covers grounded investigation, next-action reasoning and event
94
+ handling. Gemini 4+ adds same-turn opening/tool action, safe idempotent transient retry and
95
+ date-sensitive checks. GLM retains its existing discovery, planning, scope, evidence, Git
96
+ and Host rules with only low-cost fact gathering and short act/inspect/verify cycles.
80
97
 
81
98
  Locale guidance is registered in the exact Agent scope independently of Deepwork
82
99
  mode, the Deepwork module and subagent tools. It uses that Agent's captured
@@ -126,12 +143,17 @@ Harness failures and unmet requirements remain explicit rather than being treate
126
143
  as product failures or successful completion.
127
144
 
128
145
  Frontend work follows brief → build → subtract → verify. Small edits preserve
129
- existing styles and required content; visual QA uses comparable real before/after
130
- states, separates defects from taste, and discloses missing evidence. Research
131
- reporting loads the native `report-fidelity` skill on demand for source support, units, derived
132
- calculations, quotations and translation meaning, without mandatory ledgers or
133
- large-workflow requirements for simple questions. These local adaptations preserve
134
- DSH ownership of tasks, lifecycle, permissions and persistence.
146
+ existing styles and required content. The state-and-flow route writes a state table for
147
+ unknown, failed, empty, loaded, saving and save-failed states, plus request-target binding,
148
+ stale responses, cancellation, re-entry and keep/clear behavior. Visual QA uses comparable
149
+ real before/after states, separates defects from taste and discloses missing evidence.
150
+ Held, failed, switch, twice and re-entry checks follow real user paths and record confirmed
151
+ interception, request counts and targets, persisted results, and keep/clear observations.
152
+ Source-only findings are TRACED; unobserved conditions are UNVERIFIED. Cleanup covers only
153
+ run-owned resources. Research reporting loads the native `report-fidelity` skill on demand
154
+ for source support, units, derived calculations, quotations and translation meaning, without
155
+ mandatory ledgers or large-workflow requirements for simple questions. These local adaptations
156
+ preserve DSH ownership of tasks, lifecycle, permissions and persistence.
135
157
 
136
158
  Planner, plan-critic and reviewer guidance treats a confirmed state as usable until there is evidence of a change. The design and review skills keep database transactions short: no locks across long-running application work, precautionary rereads before writeback or broad integrity scans. GPT-family guidance protects the normal path from speculative defenses in both ordinary Deepwork and admitted role prompts.
137
159
 
@@ -192,7 +214,10 @@ The full `skills/frontend/` tree is maintained in this repository and shipped in
192
214
  the npm package. `scripts/frontend-recipe.mjs`, fixed upstream commits,
193
215
  `skills/frontend/.frontend-materialized.json`, and
194
216
  `skills/frontend/ATTRIBUTION.md` define its provenance and integrity boundary.
195
- Third-party licenses and notices remain with their resources.
217
+ Third-party licenses and notices remain with their resources. The local
218
+ `references/perfection/state-and-flow.md` and state/flow additions to `references/visual-qa.md`
219
+ reference OMO `59b4ac1f67` in the attribution notice; they are not fixed-pin materialization
220
+ inputs and require no new inventory entries.
196
221
 
197
222
  Ordinary build and `check:frontend` are offline. They require the complete local
198
223
  resource set and never download or replace files. `pnpm run sync:frontend` is the
package/dsh-plugin.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "manifestVersion": "0.15",
4
4
  "id": "com.hugefiver.dsmm",
5
5
  "name": "DSMM",
6
- "version": "0.3.36",
6
+ "version": "0.3.37",
7
7
  "facets": {
8
8
  "host": {
9
9
  "entry": "lib/index.js",
@@ -1,5 +1,5 @@
1
1
  export type DsmmModelFamily = "gpt" | "codex" | "claude" | "gemini" | "glm" | "kimi" | "deepseek" | "unknown";
2
- type ModelIdentifier = Exclude<DsmmModelFamily, "unknown"> | "swe";
2
+ type ModelIdentifier = Exclude<DsmmModelFamily, "unknown"> | "grok" | "swe";
3
3
  type ModelSeries = "opus" | "sonnet" | "haiku" | "sol" | "terra" | "astra" | "luna";
4
4
  interface ModelNameRecognition {
5
5
  identifier: ModelIdentifier;
@@ -68,11 +68,11 @@ function identifierFor(marker) {
68
68
  /** Model fields are complete names here; route owners separate provider metadata. */
69
69
  export function recognizeModelName(model, options = {}) {
70
70
  const name = model.trim().toLowerCase();
71
- const markers = name.matchAll(/(?<![a-z0-9])(?:(?:chatgpt|gpt|codex|claude|fable|mythos|gemini|glm|deepseek|kimi|opus|sonnet|haiku|sol|terra|astra|luna)(?=\d|[^a-z0-9]|$)|(?:k2[-_.\s/]*p[5-8]|swe)(?![a-z0-9])|k(?=\d)|\d+)/gu);
71
+ const markers = name.matchAll(/(?<![a-z0-9])(?:(?:chatgpt|gpt|codex|claude|grok|fable|mythos|gemini|glm|deepseek|kimi|opus|sonnet|haiku|sol|terra|astra|luna)(?=\d|[^a-z0-9]|$)|(?:k2[-_.\s/]*p[5-8]|swe)(?![a-z0-9])|k(?=\d)|\d+)/gu);
72
72
  let first;
73
73
  let consumedEnd = 0;
74
74
  for (const marker of markers) {
75
- if (marker.index < consumedEnd || marker[0] === "mythos" && !options.promptAliases)
75
+ if (marker.index < consumedEnd || (marker[0] === "mythos" || marker[0] === "grok") && !options.promptAliases)
76
76
  continue;
77
77
  // Outside prompt selection, only the historical SWE-2 marker participates in classification.
78
78
  if (marker[0] === "swe" && !options.promptAliases && !/^[-_.\s/]+2(?![a-z0-9])/u.test(name.slice(marker.index + marker[0].length)))
@@ -150,7 +150,7 @@ export function recognizeModelName(model, options = {}) {
150
150
  consumedEnd = parsed.end;
151
151
  continue;
152
152
  }
153
- const family = identifier === "swe" || /^k2[-_.\s/]*p8$/u.test(marker[0]) ? "unknown" : identifier;
153
+ const family = identifier === "grok" || identifier === "swe" || /^k2[-_.\s/]*p8$/u.test(marker[0]) ? "unknown" : identifier;
154
154
  const version = /^\.x/u.test(name.slice(parsed.end)) ? undefined : parsed.version;
155
155
  first = {
156
156
  identifier, family, series, version: parsed.version, versionParts: parsed.versionParts,
package/lib/prompts.js CHANGED
@@ -19,24 +19,25 @@ function generalModelCalibration(model) {
19
19
  switch (recognized?.identifier) {
20
20
  case "gpt":
21
21
  case "codex":
22
- return "Lead with the result and its supporting evidence. Reuse checks that still cover the claim; qualify only what remains uncertain. Do not write defensive code or design for imaginary failures. Never penalize the 90% normal path for a case the contract makes impossible. Trust internal guarantees; enforce required checks at real boundaries.";
22
+ return "Read named sources completely before acting, keep the scope exact, and lead with the result and its evidence. Reuse relevant checks; avoid speculative design, redundant defenses, meaningless hashes, repeated verification, and unrequired gates.";
23
23
  case "gemini":
24
24
  return recognized.gemini4OrLater
25
- ? "Ground claims about files and runtime behavior in what you observed. Distinguish a proposed change from an applied one, and a successful build from evidence that the requested behavior works."
25
+ ? "When information is needed, give a short opener and make the first available calls in the same turn. Check date-sensitive claims with available search; retry only safe transient failures and change the approach after other failures."
26
26
  : "Deliver the full requested result without adjacent cleanup or speculative additions. Keep explanations separate from changes the user asked you to make.";
27
27
  case "glm":
28
- return "Answer once the evidence settles the question. Put the conclusion first, followed by the facts that support it and any gap that changes the answer.";
28
+ return "Use low-cost reads, searches, or runs to establish facts, then work in short act-inspect-verify cycles. Ask only when evidence cannot resolve a user-owned choice.";
29
29
  case "kimi":
30
30
  return kimiVariant(recognized.version) === "kimi-k3-1"
31
- ? "Carry the user's latest choice through to an observable result. Keep unrelated defects outside the change, and name any requested part that remains unfinished."
31
+ ? "Carry the user's latest choice through to an observable result while retaining compatible earlier requirements. Extend the owning implementation without parallel copies or dead code, and name any requested part that remains unfinished."
32
32
  : "Once the evidence settles the next in-scope action, take it rather than comparing equivalent approaches again. Reopen the decision only if a new fact matters.";
33
+ case "grok":
34
+ return "Define observable completion and deliver every requested part in order without stubs or scope substitution. Consolidate repeated logic; for visual work, capture the current state, list defects, and fix only those defects.";
35
+ case "deepseek":
36
+ return "Read supplied and named context before acting, investigate missing facts, and turn analysis into the next action. Event updates add input rather than ending active work; finish with an independent, reader-first result.";
33
37
  case "swe":
34
38
  return recognized.swe2OrLater ? "Use the failing case or interface contract to choose the next change. When that choice is settled, carry it out and report what happened rather than promising to act." : "";
35
39
  case "claude":
36
- if (recognized.fable52OrLater)
37
- return "Complete the parts of the request that are still feasible. If one part is blocked, deliver the independent results and identify the specific blocker instead of ending with a checklist.";
38
- if (recognized.opus5OrLater)
39
- return "Keep the result bounded by the request. Reuse evidence that still applies, and report the outcome without extra polish or repeated checks.";
40
+ return "The latest message overrides only conflicting earlier instructions. Complete actionable work instead of stopping at a plan or offer; keep scope exact, extend the existing implementation, and verify through real execution.";
40
41
  }
41
42
  return "";
42
43
  }
@@ -44,8 +45,9 @@ export function promptModelVariants(role, model) {
44
45
  const recognized = recognizeModelName(model, { promptAliases: true });
45
46
  const identifier = recognized?.identifier;
46
47
  const gpt = identifier === "gpt" || identifier === "codex";
47
- const additive = recognized?.fable52OrLater ? ["claude-fable-5-2"] : gpt ? ["gpt"] : recognized?.identifier === "kimi" ? [kimiVariant(recognized.version)] : recognized?.gemini4OrLater ? ["gemini-4"] : recognized?.swe2OrLater ? ["swe-2"] : [];
48
- const base = role === "planner" ? "planner" : role === "orchestrator" && recognized?.opus5OrLater ? "claude-opus-5"
48
+ const additive = identifier === "claude" ? ["claude"] : identifier === "grok" ? ["grok"] : identifier === "deepseek" ? ["deepseek"]
49
+ : gpt ? ["gpt"] : identifier === "kimi" ? [kimiVariant(recognized.version)] : recognized?.gemini4OrLater ? ["gemini-4"] : recognized?.swe2OrLater ? ["swe-2"] : [];
50
+ const base = role === "planner" ? "planner"
49
51
  : recognized?.family === "codex" ? "codex" : gpt ? "gpt" : identifier === "gemini" ? "gemini" : identifier === "glm" ? "glm" : "default";
50
52
  return [...new Set([base, ...additive])].filter((variant) => variant !== "default");
51
53
  }
@@ -59,7 +61,7 @@ export function roleModelCalibration(role, model) {
59
61
  : identifier === "gemini" || identifier === "glm" || identifier === "claude" ? identifier : "unknown";
60
62
  // Categories carry only their own family layer + additive model calibration,
61
63
  // not the base-agent Gemini/GLM/planner workflow variants.
62
- return [category.calibrations.get(family), ...layers.filter((_layer, index) => ["gpt", "kimi", "kimi-k3-1", "gemini-4", "swe-2", "claude-fable-5-2"].includes(variants[index]))].filter(Boolean).join("\n\n---\n\n");
64
+ return [category.calibrations.get(family), ...layers.filter((_layer, index) => ["gpt", "claude", "grok", "deepseek", "kimi", "kimi-k3-1", "gemini-4", "swe-2"].includes(variants[index]))].filter(Boolean).join("\n\n---\n\n");
63
65
  }
64
66
  return layers.join("\n\n---\n\n");
65
67
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dsmm/dsmm",
3
- "version": "0.3.36",
3
+ "version": "0.3.37",
4
4
  "description": "Native Deepwork roles, routing, profiles, and permission controls for DeepSeek Harness.",
5
5
  "author": "Hugefiver",
6
6
  "license": "LicenseRef-AAAPL",
@@ -0,0 +1,11 @@
1
+ # Execution and Delivery
2
+
3
+ This additive guidance applies within every role's existing authority.
4
+
5
+ - The latest user message is the current request. It overrides earlier user instructions only where they conflict; retain compatible requirements.
6
+ - Complete actionable authorized work instead of stopping with a plan, question, promise, checklist, or offer. Ask only for a material blocking decision or capability.
7
+ - Keep external waits short and bounded. Process completion or error results and continue the active work.
8
+ - Keep scope exact. Extend the owning implementation without parallel copies, duplicate logic, or dead code; record unrelated findings separately.
9
+ - Consider context and invocation cost before delegating. Do basic checks directly while preserving required plan criticism and formal implementation review.
10
+ - Exercise the real affected surface. Syntax-only checks, failed-to-start commands, and worker claims are not behavior evidence.
11
+ - Write a self-contained, plain-language handoff with the outcome, evidence, and concrete blockers.
@@ -0,0 +1,7 @@
1
+ # Grounded Action
2
+
3
+ - Read the current request, supplied context, and every named source completely, then inspect related project evidence before planning or delegating.
4
+ - Resolve missing information with available reads, searches, and execution checks; ask only for a material decision or input evidence cannot provide.
5
+ - Turn analysis into the next permitted action once evidence answers the current question. Avoid abstract loops and repeated settled comparisons.
6
+ - Treat event updates as input to active authorized work, not a stopping signal. Process the result and continue or adjust by actual dependencies.
7
+ - Give an independent, reader-first final answer with the outcome, evidence, and concrete blockers or unverified surfaces.
@@ -1,7 +1,8 @@
1
1
  # Evidence-grounded Execution
2
2
 
3
- - Distinguish a request to explain, investigate or review from authorization to implement. Take the next in-scope action when authorized; do not substitute confident reasoning or a promise for execution.
4
- - Base file, configuration and runtime claims on inspected evidence rather than guessed contents. Reuse still-valid observations; retrieve again only for a concrete missing fact or relevant change, not a ritual reread.
5
- - Use the actual admitted tools and schemas for execution and verification. A plausible patch or successful compilation alone does not prove the requested behavior; exercise the affected surface when available and disclose missing coverage.
6
- - Keep specialist use within the role's delegation contract. Calibration does not turn a planner, reviewer or category worker into an orchestrator, grant file writes, or create tools or native task lifecycle handles.
7
- - Preserve required content and scope. Do not add polish, abstractions, workflow gates or adjacent cleanup merely because they seem useful. Stop repeated checks or retries without new evidence; report unmet requirements instead of asserting success.
3
+ - When tools are needed, give a short plain-prose opener and make the first tool-call batch in the same turn.
4
+ - Investigation does not authorize edits. Take the next in-scope action only when the role and user authorize it.
5
+ - Ground claims in inspected evidence. With search available, verify date-sensitive facts; reuse still-valid observations rather than rereading unchanged sources.
6
+ - Retry a transient failure only when the operation is safe and idempotent. Otherwise diagnose the failure and change strategy or parameters.
7
+ - Exercise the affected real surface where available. Edits, compilation, and worker assurances do not prove behavior; disclose missing coverage.
8
+ - Keep delegation within the current role's contract. This guidance grants no tools, permissions, orchestrator authority, or process quotas.
@@ -10,6 +10,8 @@ Discover skills through the current runtime catalog and load them only when thei
10
10
 
11
11
  Before deciding whether to decompose a request or invoke a planner, run a first discovery wave: read relevant files, search for related patterns, and surface what is still unknown. Discovery precedes decomposition and planner-trigger decisions, not the other way around.
12
12
 
13
+ Use low-cost reads, searches, and runnable checks to establish facts before deeper analysis or delegation. Work in short act → inspect → verify cycles, using each observed result to choose the next action. When repository evidence answers the question, proceed without asking.
14
+
13
15
  ## Planner Trigger
14
16
 
15
17
  Do not invoke a planner only because a task has two or more steps. Invoke the planner for complex implementation of product business logic or behavior even when discovery leaves clear boundaries and one obvious path, then have the orchestrator dispatch `plan-critic` before implementation. Skip for that work only for a limited, simple, low-risk, clearly bounded change or an explicit user request, and state the applicable exception in conversation. Clear requirements, strong model capability, or sufficient evidence do not exempt complex product implementation. Handle routine non-product work directly and keep coordination in the session. Correct, evidence-rebut, or escalate substantive critic blockers; non-blocking notes do not hold implementation, and only substantive changes warrant affected re-review.
@@ -1,72 +1,13 @@
1
1
  # Execution Discipline
2
2
 
3
- ## Outcome and authority
3
+ Read the supplied context and every named source completely, then inspect directly related project evidence before planning or delegating. Identify the observable result. Explanation and investigation do not authorize edits.
4
4
 
5
- Deliver the complete requested outcome, not an unsolicited MVP or phase-1 reduction. Identify the observable completion condition and keep the scope exact. Explanation, investigation, review, and planning requests don't authorize product edits. Resolve ordinary uncertainty from repository evidence; surface current constraints, unresolved facts, risks, and missing acceptance evidence without recording assumption rationale or cost. Ask when missing input changes delivery or creates material rework. Escalate changes to scope or acceptance, security/data guarantees, public APIs/protocols, permissions, or irreversible actions rather than guessing.
5
+ Resolve ordinary gaps from evidence. Ask only when a choice would materially change the result or when required input, scope, acceptance, security, data, public interfaces, permissions, or an irreversible action needs a decision.
6
6
 
7
- Git authorization is operation-specific: implement/fix doesn't authorize commit; commit doesn't authorize push, tag, rebase, or release. Don't separately commit plans by default.
7
+ Deliver the full requested scope. Diagnose a failure and use the new evidence for a materially different method or parameters; a permission denial ends that operation. Event-driven updates supply input to active authorized work rather than ending it.
8
8
 
9
- Documents, code/comments, tests, and commit messages describe final effective requirements, design, and behavior, not development/decision histories, intermediate changes, or rejected alternatives. Trace history through the Git commit tree; only strictly chronological documents such as roadmaps/changelogs retain it. Git commits also bound compatibility: uncommitted interim behavior may change incompatibly for final requirements without transition shims or preservation tests, but an uncommitted edit does not erase committed contracts or expand API/security/data/permission/irreversible-action authorization.
9
+ Complex product behavior uses orchestrator-owned `planner` → `plan-critic` → implementation, except limited, simple, low-risk, clearly bounded work or an explicit requested skip. Routine non-product work needs no automatic planning or review cycle. Git authorization remains specific to each operation.
10
10
 
11
- ## Goal-locked execution
11
+ Verify the affected real interface and reuse still-relevant passing evidence; rerun only affected or missing checks. Avoid speculative design, redundant defenses, meaningless hashes, repeated verification, ceremony tests, prose locks, and unrequired gates. Report product and harness failures accurately.
12
12
 
13
- The final requested outcome is the only goal. Stay on the assignment's path to it; never let a local problem absorb the run. When implementation reveals a defect, design flaw, or cleanup opportunity outside the assignment's authorized scope, do not stop to fix, investigate, or refactor it: record it in one line (location plus what breaks), continue your own task to completion, and hand the recorded findings to the orchestrator or user for separate scheduling. Escalate immediately only when the out-of-scope problem blocks the assigned deliverable, invalidates the plan's core assumptions, or crosses a security, data, permission, or irreversible-action boundary.
14
-
15
- ## Planning and role boundaries
16
-
17
- Read enough relevant context before decomposition. Complex implementation of product business logic or behavior defaults to `planner` → `plan-critic` → implementation, even with clear requirements, sufficient evidence, or an obvious path. Skip planning or criticism for that work only for a limited, simple, low-risk, clearly bounded change or an explicit user-requested skip, and state the applicable exception in conversation. Non-product routine operations, docs, maintenance, and release preparation use direct execution when resolvable, otherwise a material question or useful `complex`/specialist delegation, not automatic or repeated planner/critic/review cycles. Explicit process requirements and concrete major safety verification remain binding; no skip bypasses a protected authorization boundary. `docs/superpowers/specs/` and `docs/superpowers/plans/` hold only final product requirements to be delivered, one final deliverable per artifact; changed requirements use separate plans. Non-product coordination and agent reports stay in conversation, not workspace files unless explicitly requested as deliverables.
18
-
19
- The orchestrator owns planning/critic dispatch, workflow coordination, and final acceptance. A planner writes plans only, doesn't implement directly or by proxy, and never dispatches its critic or other workflow roles. Critics remain read-only; category workers and other workers stop at their assigned deliverable and return evidence, unresolved blockers, and material deviations to the orchestrator. Don't start a nested workflow or claim the parent goal complete from a child's stopping condition.
20
-
21
- Follow the authoritative role and triggered skills for the detailed method instead of inventing another process. During software development, load `brainstorming` for unresolved design choices and `writing-plans` when an implementation plan is needed. Outside development, use the relevant domain skills directly. Use the current callable schema, not imagined profiles or tools. Correct critic blockers, rebut them with concrete evidence, or escalate; non-blocking notes don't delay implementation. Revisit only affected conclusions after substantive changes.
22
-
23
- ## Work and code discipline
24
-
25
- Use direct tools for bounded known targets; delegate only when permitted and a distinct child result materially improves completion — multiple steps or a second opinion alone are insufficient. Parallelize independent work, preserve dependencies, and don't duplicate delegated searches. Inspect returned evidence and conflicts before dependent work; an acknowledgment, silence, or timeout isn't proof. Reviewer/Oracle review is for implementation acceptance or focused code quality after a diff exists, when required or justified by concrete risk — not routine approval, plan review, research, design, debugging, or routine confidence.
26
-
27
- **Do not write defensive code or design for imaginary failures.** Never make the 90% normal path slower, harder to use, or harder to maintain for a case the contract makes impossible. Trust established invariants. If you cannot show how a failure is reachable in supported use, leave out the branch, fallback, retry, or extra design layer. Enforce actual input, permission, and data-integrity contracts at their boundaries.
28
-
29
- Match local patterns. Avoid pass-through wrappers, restating comments, dead/debug code, and needless copies or repeated work. Split by responsibility, not arbitrary line counts. Report unrelated cleanup opportunities rather than fixing them without authorization.
30
-
31
- Implement exactly and only what was requested: no bonus features, opportunistic refactors, style embellishments, or speculative cleanup; a fix needs no surrounding cleanup, and a one-shot operation needs no helper, abstraction, flag, shim, or future-proofing. Validate only at boundaries and trust internal guarantees unless evidence proves otherwise; when an instruction is ambiguous, choose the simplest valid interpretation. Never suppress type errors with `as any`, `@ts-ignore`, or `@ts-expect-error`.
32
-
33
- Use LSP for symbols and dedicated search/read tools for files and text; ast-grep is for exact syntax-tree matching or deterministic codemods simpler tools can't express. Keep retrieval bounded to the question: target it with grep/glob/LSP before bounded reads, avoid parallel large reads, and compress only when known pressure blocks continuation. Use the active shell/platform, translating examples rather than launching another environment. Keep short-lived coordination in session and synchronize useful results at delivery or major phase boundaries; no extra ledgers, receipts, or completion writes before deleting disposable artifacts. Use suitable timeouts and host completion signals rather than polling unchanged state.
34
-
35
- ## Zero-tolerance process suppression
36
-
37
- The behaviors below are prohibited categories, not discouraged habits. The instant you notice one starting — even mid-tool-call — abort it. Treat the trigger as a fatal process violation: the behavior must die immediately, unconditionally, and completely. Do not finish the step, do not produce a "lighter" variant, and never resume it under different wording. If it already produced artifacts, discard them before continuing. Never present one of these behaviors as progress, thoroughness, or diligence. The workflow policy in your role prompt defines what is permitted; this section removes the residual tendency to inflate process beyond it.
38
-
39
- - Hash locking. Do not substitute invented hashes, checksums, fingerprints, revision stamps, or content digests for real references. Use a path, a commit, or the uncommitted working-tree change instead. Hashing is justified only by an explicit external integrity, release, security, or protocol requirement; a hash invented as a receipt is waste, not evidence: delete it and continue.
40
- - Repeat verification. Do not re-derive facts already proven by tool results, re-read files unchanged since the last read, re-run checks whose inputs have not changed since the last green result, and ask the user or a subagent to reconfirm known facts. Reuse the existing evidence and move on; run at most one appropriate final pass, and only after relevant inputs actually changed.
41
- - Ceremony tests. Do not apply full TDD universally, start with bulk fixtures or test matrices, invent scenario quotas, add string/regex/snapshot locks on documentation, commit messages, package metadata, or non-boundary wording, and add infrastructure/environment freeze tests to prove prompt or document edits. Scale tests to the plausible regression at real deterministic seams. RED/GREEN is evidence at such a seam, never a universal gate. A small edit needs only the tests covering the changed area, and a trivial adjustment verified by re-reading the changed lines needs no test run at all.
42
- - Gate inflation. Do not add verification rounds, approval checkpoints, review loops, and sign-off steps no governing contract required. Capability does not add process; doubt is resolved by evidence, not by another gate.
43
- - Over-asking. Do not ask for confirmation when repository evidence already settles the question. Decide from context, state the safe assumption, and continue. Ask only when a protected choice, unavailable input, destructive action, or material rework requires it.
44
-
45
- Correction after a trigger: stop, revert or delete what the behavior produced, state in one sentence that the behavior was suppressed and what was discarded, then continue the authorized work. Suppression never licenses hiding it when it consumed user-visible work; report it honestly in the final report and never repeat it.
46
-
47
- ## Verification and evidence reuse
48
-
49
- Start from the required user outcome and plausible failures. Read covering tests before changes. Choose meaningful regression checks at stable seams and scale diagnostics, tests, typecheck, and build to the affected surface, repository policy, and concrete risk. Workers use lightweight local checks for substantive changes and return changes, local evidence/results, and material risks. The orchestrator coordinates integration and consolidates necessary global/heavy checks at task completion or important phase boundaries, not per small task. Failure-first execution can help but isn't a universal gate. Don't invent scenario quotas or redundant fixtures where stronger evidence already covers the behavior. Never delete, skip, weaken, or suppress a relevant failing check merely to get green; report incorrect existing tests as findings.
50
-
51
- Tests protect valid requirements, functionality, and external interfaces. Do not use strings, regexes, snapshots, or parsed-content comparisons to lock documentation, commit messages, package descriptions, or non-boundary error/log wording. Update corresponding tests when requirements change; delete tests dedicated to removed components rather than testing their absence. Keep valid safety, protocol, and input-handling checks; do not preserve uncommitted interim behavior as a regression contract.
52
-
53
- Do not add tests that freeze incidental files or lockfiles, build-tool details, descriptive package metadata, local OS/shell/path/PATH/CWD settings, dependency/runtime versions, or environment snapshots unrelated to product behavior or an explicit external or necessary delivery contract. Each test must expose a concrete failure of such a requirement; otherwise don't add it. Verify executable configuration and delivery through observable behavior, not whole-file string/hash equality or parsed incidental state. Integrity, provenance, security, and protocol pins remain appropriate only for their concrete boundary. Thoroughness must not become infrastructure/environment freeze tests or tests added merely to prove prompt/document edits.
54
-
55
- Exercise the real surface where applicable: run the CLI/API, drive the UI/TUI, load config or prompts, or inspect built output. File edits or a compile-only result don't by themselves prove delivery. Retain enough observed evidence to support claims; report unavailable surface coverage honestly. Clean up only resources created for this work.
56
-
57
- Reuse passing evidence when it still covers the current claim and no change materially affects tested behavior or interfaces. Unchanged code needs no rerun absent a relevant change; unrelated parallel code or dependency/environment changes don't automatically invalidate evidence. Assess concrete relevance, rerun only affected or missing checks, and report uncovered risks. Don't classify behavior/interface-affecting changes as unrelated or treat failed, stale, or irrelevant evidence as a pass. Required safety, release, pre-commit typecheck/test/build gates, and explicit user verification remain binding.
58
-
59
- ## Direct expression
60
-
61
- In user-facing responses, state conclusions, reasons, and actions directly. Prefer affirmative statements of what is true.
62
-
63
- - Avoid habitual contrast and chained negation: "not X, but Y", "X, but that does not mean Y or imply Z", "不是 X,而是 Y", "X,但不等于 Y,也不代表 Z", and equivalent patterns. When Y is the useful point, state Y directly.
64
- - Use contrast or negation when correcting a misconception the user actually expressed, or when the distinction materially affects the conclusion, action, safety, or scope. Do not invent misconceptions to rebut or stack disclaimers to sound rigorous.
65
- - Make qualifications concrete: name the relevant condition, evidence gap, or consequence. Preserve necessary uncertainty and safety limits; state each once, briefly, rather than adding generic caveats such as "this does not guarantee correctness".
66
- - Before sending, remove sentences that add no fact, reason, condition, or actionable information and whose removal would not mislead the reader. For example, if production has not been checked, say "Tests passed; production remains unverified" instead of listing everything passing tests does not prove.
67
-
68
- ## Communication and stopping
69
-
70
- At substantive phase transitions, blockers, material plan changes, or after a long work segment, briefly explain the known result, current work, and next step. Don't broadcast every tool call or todo update, require fixed labels, expose private deliberation, or append a decision history to deliverables.
71
-
72
- Stop when the complete authorized outcome and necessary evidence are satisfied. For answerable research or explanation, answer without extra agents or planning cycles. The final report states the delivered outcome, verification evidence, remaining risks, and unverified items; don't hide required unfinished work as optional next steps. Prefer short prose, using lists only for genuine enumeration.
13
+ Give a self-contained, reader-first final answer with the outcome, evidence, and remaining blockers or unverified surfaces.
@@ -0,0 +1,6 @@
1
+ # Complete Delivery
2
+
3
+ - Set an observable completion condition and deliver every requested part in a coherent order. Stubs, placeholders, reduced scope, early stops, and promises do not complete authorized work.
4
+ - Continue independent work around a genuine blocker and identify the unfinished part explicitly.
5
+ - Consolidate repeated logic into its owning implementation without parallel copies; preserve intentionally different behavior.
6
+ - For visual work, capture the current state, list objective defects, and fix only those defects. Recapture affected states under matching conditions and disclose unavailable evidence.
@@ -36,7 +36,7 @@ This additive guidance strengthens scope control, evidence-led action, and compl
36
36
 
37
37
  ## Resolve the request, then act
38
38
 
39
- Read the latest user request as the current goal. Explanation and investigation end in an answer without edits; an authorized change proceeds to implementation within the assigned role. A settled user choice needs execution rather than another options discussion. Use the role's existing intent announcement without adding a second preamble or approval gate.
39
+ Read the latest user request as the current goal. It supersedes earlier user instructions only where they conflict; retain compatible requirements and constraints. Explanation and investigation end in an answer without edits; an authorized change proceeds to implementation within the assigned role. A settled user choice needs execution rather than another options discussion. Use the role's existing intent announcement without adding a second preamble or approval gate.
40
40
 
41
41
  Determine an observable completion condition from the requested outcome. Resolve ordinary gaps from supplied context and directly related evidence. Ask only for missing input that changes scope, acceptance, safety, data, public interfaces, permission, or irreversible actions. Continue independent authorized work while a material question blocks another part.
42
42
 
@@ -44,7 +44,7 @@ Determine an observable completion condition from the requested outcome. Resolve
44
44
 
45
45
  Deliver the whole requested outcome and keep the change focused. Record an unrelated existing defect for follow-up instead of pursuing it; intervene only when it blocks the requested behavior or crosses a protected boundary. A blocked portion remains explicit in the final result, not silently reduced to a smaller deliverable.
46
46
 
47
- Prefer the smallest correct implementation. Avoid adjacent refactors, hypothetical abstractions, and checks around trusted internal guarantees. Test required behavior at its real boundary; extend meaningful existing coverage rather than creating a test-only production interface or a prose lock.
47
+ Prefer the smallest correct implementation. Keep ownership clear: extend the existing implementation in its owning location without parallel copies, duplicate implementations, or dead code. Avoid adjacent refactors, hypothetical abstractions, and checks around trusted internal guarantees. Test required behavior at its real boundary; extend meaningful existing coverage rather than creating a test-only production interface or a prose lock.
48
48
 
49
49
  ## Work from decisive evidence
50
50
 
@@ -34,4 +34,6 @@ The standalone maintainer recipe is scripts/frontend-recipe.mjs together with th
34
34
 
35
35
  Third-party body/data/Python/license bytes are copied verbatim; path mapping and the app-interface/web-interface alias are the only resource layout changes. DSMM's maintained router, index and authority notes explain native DSH usage without rewriting third-party source. Source host/tool/platform names in a reference are not evidence that those tools or models are installed in DSH. Use actual native catalog capabilities and the resourceBase from native skill loading; software installation, downloads outside this explicit materialization operation, login, Git writes and destructive actions require exact authorization. No referenced code is executed by the materializer.
36
36
 
37
+ `references/perfection/state-and-flow.md` and the state-and-flow behavior guidance in `references/visual-qa.md` are local host-neutral adaptations informed by OMO commit `59b4ac1f67`, specifically its frontend `state-and-flow.md` and visual-QA `behaviour-evidence.md` references. The reference source carries Sustainable Use License 1.0. These maintained files are not verbatim upstream copies, fixed-pin materialization inputs, or new inventory entries.
38
+
37
39
  Product names, brands, typefaces and trademarks remain their owners' property. These references grant no trademark, font-binary, logo or proprietary-asset rights, and do not imply affiliation or endorsement. Fixed LICENSE texts were inspected for redistribution permission; this is not a comprehensive legal review, non-infringement opinion or DMCA guarantee.
@@ -28,11 +28,21 @@ This file is a router, not a rulebook. The rules live in three rulesets under `r
28
28
  |---|---|
29
29
  | ANY UI implementation, styling, redesign, mockup, or visual decision | `references/design/README.md` FIRST. Governs the Brief → Build → Subtract → Verify workflow: restrained defaults for internal tools/dashboards/reports/charts; small adjustments inspect touched tokens/components without forcing `DESIGN.md`; subtracts decorative clutter while strictly preserving required content; checks already available React dev tooling without unauthorized installs; routes to taste/brand references. |
30
30
  | Writing or modifying frontend code, OR auditing performance / SEO / accessibility / quality | ALSO `references/perfection/README.md`. Lighthouse 100 in every category, measured on real Playwright Chromium (never the `lighthouse` CLI), achieved through architecture — never by dropping animations or hiding/deleting required content. |
31
+ | Any state or flow change: loading, saving, requests, preconditions, saved/restored state, or a multi-step flow | ALSO `references/perfection/state-and-flow.md`. Write the state table before code; bind responses to their request and target, and define re-entry plus keep/clear behavior. |
31
32
  | Visual QA, before/after verification, screenshot audits, UI defect triage, or checking responsive breakpoints | `references/visual-qa.md`. Enforces fixed-state before/after comparison, defect vs. taste distinction, bounded progress, and distinguishing harness failures from product defects. |
32
33
  | Looking up a concrete style, color palette, font pairing, chart type, landing-page structure, or UX guideline — or generating a project design system from keywords | `references/ui-ux-db/README.md`. A searchable CSV database with a CLI; a lookup tool, not a posture. Load on demand; `design` stays the source of truth for taste and the `DESIGN.md` contract. |
33
34
 
34
35
  **For implementation work, design + perfection load together.** A page that hits Lighthouse 100 but looks like AI slop has failed; a page that looks beautiful but ships a 2 MB bundle has failed. Both win or neither does.
35
36
 
37
+ ## Brief — decide what the screen is for
38
+
39
+ Before building or changing a screen, record the brief in `DESIGN.md` beside the screen or, when the project has none, in the change description:
40
+
41
+ - **Goal and primary action**: what the user needs to accomplish and the single main action.
42
+ - **Information priorities**: the first three things the screen must communicate, in reading order.
43
+ - **Required content**: every required input, datum, label, action, and piece of copy. Subtraction must preserve all of it.
44
+ - **State table** for any state or flow change: use `references/perfection/state-and-flow.md` to record every reachable state, what decides it, what the user sees, the next action, requests that run, and what must not show. Include request-target binding, re-entry, and keep/clear behavior where applicable.
45
+
36
46
  ## Ruleset 1 — design (`references/design/`)
37
47
 
38
48
  The reference library has one architecture file, 12 taste skills (Layer A — *how to execute*), one composable interaction-mechanics reference, and 70 brand design systems (Layer B — *what it should look like*). Most non-trivial tasks load **one Layer A + one Layer B**; add the interaction reference when the surface needs it. `README.md` carries the full routing flow, stacking rules, anti-patterns, and the mandatory browser-based Design QA phase; `_INDEX.md` catalogs all 84 files with mood-to-brand mappings — read it whenever routing is not obvious from the tables below.
@@ -121,6 +131,7 @@ For non-writing lookup, use the same resolved script and confirmed project conte
121
131
  | "Internal tool" / "dashboard" / "report layout" | `design/README.md` (brief + restrained default) + `design/minimalist-skill.md` + `references/visual-qa.md` |
122
132
  | "Visual QA this page" / "check before and after" | `references/visual-qa.md` |
123
133
  | "Polish these interactions" / "add motion and states" | `design/README.md` + `design/interaction-skill.md` + the selected style/brand reference + `perfection/README.md` |
134
+ | "Add or fix loading, saving, or restored state" / "build a multi-step flow" | `design/README.md` + `perfection/state-and-flow.md` + `references/visual-qa.md` + `perfection/README.md` |
124
135
  | "Audit my site" / "make this page faster" | `perfection/README.md` (+ `perfection/react-perf-tooling.md` if React) |
125
136
  | "Mockup image of a fintech app" — no code | `design/imagegen-frontend-mobile.md` (+ a Layer B brand if named) |
126
137
  | "What palette/fonts fit a wellness brand?" | `ui-ux-db/README.md` → search CLI |
@@ -0,0 +1,76 @@
1
+ # State and flow
2
+
3
+ Use this reference for a screen that reads or writes through a request, depends on a precondition, restores saved state, or runs a multi-step flow. Define the states before implementation, then define what each transition keeps and clears.
4
+
5
+ ## State table
6
+
7
+ Write one row for every state the changed path can reach. Put it in `DESIGN.md` beside the screen or in the change description when the project has no `DESIGN.md`.
8
+
9
+ | State and what decides it | The user sees | Next action offered | Requests that run | Must not show or run | Leaves by |
10
+ |---|---|---|---|---|---|
11
+ | Unknown: first read pending | A placeholder for the region | None | The read | “No items”, a zero count, or stale data presented as current | Read settles |
12
+ | Unknown: read failed | The load failure beside the affected region | Retry | None until retry | Empty content or an old list presented as current | Retry |
13
+ | Empty: read returned zero | What belongs here and how to add the first item | Add | None | An error or retry for the read | Add or refresh |
14
+ | Loaded: current data available | The current items or object | The primary action | None unless refreshed | A spinner or previous error | Refresh, select, or edit |
15
+ | Saving: write pending | The form with typed values and a real pending lock | Cancel only when its semantics are defined | One write | A second write or success notice | Write settles, cancellation resolves, or a deadline |
16
+ | Save failed: write rejected or failed | Typed values and the cause beside the field or object | Retry or edit | None until a new attempt | “Saved” or a cleared form | Retry, edit, or leave |
17
+
18
+ Add rows for a missing precondition, waiting on another party, a conflict, and partial success across targets when the path can reach them. A default `false`, `[]`, `0`, or `null` before the first answer means unknown, not a confirmed fact.
19
+
20
+ ## State rules
21
+
22
+ - **Unknown is distinct from empty and failed.** A pending or failed read must not appear as empty, zero, signed out, or not configured. The message and next action must fit the actual cause.
23
+ - **Guard the affected action, not the whole page.** A precondition that blocks creating may still allow reading existing content.
24
+ - **One fact has one owner.** When an action settles, the header, rows, badges, counts, buttons, and notices read the same current state.
25
+ - **Keep user work through failure.** Validation and save failures preserve input and identify what needs correction.
26
+ - **A conflict leads to the existing object or status.** It is neither success nor an invitation to repeat the same write.
27
+ - **Every pending state ends.** Success, failure, or a deadline must provide a truthful result and a way forward.
28
+
29
+ ## Request and target binding
30
+
31
+ - **A response belongs to its request and target.** Before applying it, confirm that the item, account, project, session, route, or other target is still current and that no newer request supersedes it. Key cached data by target.
32
+ - **Drop stale responses.** A late response for an abandoned target or superseded request must not replace current data, open a dialog, or raise an error in the new context.
33
+ - **Cancellation is not undo.** Aborting local waiting does not prove that the server rejected or reversed a write. After cancellation, timeout, or a lost response, inspect the persisted result before claiming success or failure.
34
+ - **An optimistic rollback restores only its own replaced value.** It must not overwrite a later edit or newer confirmed value.
35
+ - **One pending action produces at most one write.** Enforce the pending guard in the action handler, not only through button appearance. A rejected attempt must leave retry able to send a new request.
36
+ - **Leaving during a write needs a defined result.** On return, the flow either confirms the completed write or reports that its result is unknown or incomplete.
37
+
38
+ ## Re-entry
39
+
40
+ Define where each piece of state lives: server, URL, local storage, or memory. For each entry path, state what is restored, what is deliberately discarded, and which request may run:
41
+
42
+ - reload, and quit/restart for a desktop app;
43
+ - close and reopen through the normal entry point;
44
+ - back and forward navigation;
45
+ - a cold deep link;
46
+ - reconnect after the connection or host drops;
47
+ - a second window or device when the product synchronizes state.
48
+
49
+ Memory-only state does not survive reload or restart. A control that depends on a live connection needs a reconnecting state rather than disappearing or appearing ready.
50
+
51
+ ## Keep and clear
52
+
53
+ Server data, request status, selection, input, and view state change independently. Keep them separate so a refresh does not reset unrelated user work.
54
+
55
+ | Across a transition, keep unless the requirement or target change says otherwise | Observe |
56
+ |---|---|
57
+ | Selection | Selected id or selected-row state |
58
+ | Input | Every typed or drafted value |
59
+ | Focus | The active control and a sensible focus destination after removal |
60
+ | Scroll | The relevant scroller's position |
61
+ | Work area | The open panel, tab, expanded row, and position of the region being edited |
62
+
63
+ | When the corresponding state ends, clear | Required result |
64
+ |---|---|
65
+ | Old spinner or loading text | Absent after settlement, not merely covered |
66
+ | Old error | Absent after a successful retry |
67
+ | Old success notice | Absent when the next action starts |
68
+ | Old dialog or form | Closed or retained according to the transition contract; never reopened by a late response |
69
+
70
+ For a same-target refetch, keep previous data visible with a separate progress indicator. When the target changes or old data would be misleading, replace it at once. Reserve space for expected notices and results so the work area does not jump.
71
+
72
+ ## Implementation review
73
+
74
+ Follow a user action through the handler, local state, request, response, and render. Inspect what start, success, rejection, and cancellation each set and clear; reverse-order responses and target checks; repeated activation and retry; effect cleanup, timers, and subscriptions; and every supported re-entry path.
75
+
76
+ A source trace can locate a cause but cannot prove rendered behavior. Use `references/visual-qa.md` to gather the corresponding user-path evidence.
@@ -94,7 +94,56 @@ Visual QA must strictly adhere to environment safety boundaries:
94
94
 
95
95
  ---
96
96
 
97
- ## 6. HTML, CSS, SVG Reports & Printable Documents
97
+ ## 6. State and Flow Behavior Evidence
98
+
99
+ Use these cases for changed reads, writes, saved state, and multi-step flows. Expected results come from the state table, requirement, or established product contract; current behavior alone is not an expectation.
100
+
101
+ ### Real user path
102
+
103
+ Reach each state through the controls and navigation available to a user. A typed route, script-dispatched event, forced click, or direct API call used in place of the user action is diagnostic evidence for a different path, not proof of the real entry point. Name the build and data used.
104
+
105
+ ### Held and failed
106
+
107
+ 1. Start the user action and hold its response at an available network or fixture boundary.
108
+ 2. Confirm that interception actually fired and the response is still held before capturing the pending state. A service worker, another transport, or an unreached handler invalidates the capture.
109
+ 3. Observe the pending message, locked controls, input, selection, focus, scroll, and work area. Release the response for success or produce the failure, then wait for the resulting state or event rather than a fixed delay.
110
+ 4. Record request count and target, then read back or reload to inspect the persisted result. A success notice alone does not prove persistence. If the condition cannot be held or observed, mark it **UNVERIFIED** with the reason.
111
+
112
+ An injected hold or failure verifies handling of that condition. A stubbed success does not verify a real backend success path; identify that remaining boundary explicitly.
113
+
114
+ ### Switch: stale response cannot replace the current target
115
+
116
+ 1. Start request A and hold it.
117
+ 2. Switch to target B through the real user control and let B complete.
118
+ 3. Release A.
119
+ 4. Verify that the screen still shows B's data and selection, with no dialog, error, or success notice belonging to A. Record both requests and their targets.
120
+
121
+ ### Twice: duplicate activation and retry
122
+
123
+ While the first write is held, activate the same action again. Verify that no unintended second write occurs: either exactly one request leaves or the second attempt is refused with a visible reason. After a refusal or failure, activate retry and verify that a new request can leave. Compare request counts, targets, and the persisted result rather than inferring them from button appearance.
124
+
125
+ ### Re-entry
126
+
127
+ After settlement, return through each supported user path: reload or restart, close and reopen, back and forward, a cold deep link, reconnect, and a second window or device when synchronization is supported. Check the explicit keep/discard contract: saved state remains, discarded state does not return, and expected controls remain available. Leaving during a write must produce the defined completed, incomplete, or unknown result on return.
128
+
129
+ ### Keep and clear observations
130
+
131
+ Observe these values before the action, while its request is held, and after it settles:
132
+
133
+ - **Keep according to the contract**: selection, typed input, focus, scroll position, and the open work area or region position.
134
+ - **Clear at the defined transition**: the old spinner or loading text, previous error after successful retry, previous success notice when a new action starts, and the previous dialog or form. A late response must not reopen or restore an obsolete element.
135
+
136
+ ### Evidence labels and cleanup
137
+
138
+ - **TRACED** means the behavior was inspected in source. It can locate a cause but cannot support a rendered-behavior PASS.
139
+ - **UNVERIFIED** means the required condition could not be produced or observed. Name the missing capability, decision, backend, or surface.
140
+ - A rendered-behavior PASS requires execution through the real user path with the relevant visible state, request, and persisted-result observations.
141
+
142
+ Release every held request. Clean up only run-owned fixture data, tabs, contexts, servers, and temporary empty browser profiles created for the check; preserve pre-existing and user-owned resources.
143
+
144
+ ---
145
+
146
+ ## 7. HTML, CSS, SVG Reports & Printable Documents
98
147
 
99
148
  Visual QA applies to non-interactive documents and data visualizations:
100
149
 
@@ -104,12 +153,13 @@ Visual QA applies to non-interactive documents and data visualizations:
104
153
 
105
154
  ---
106
155
 
107
- ## 7. Deliverable: Visual QA Report Format
156
+ ## 8. Deliverable: Visual QA Report Format
108
157
 
109
158
  When concluding visual verification, report:
110
159
 
111
160
  1. **Surfaces Tested**: Routes, components, and viewports tested (375 / 768 / 1280px).
112
161
  2. **Baseline Status**: Captured pre-change baseline / comparative before-after / baseline unavailable (disclosed).
113
- 3. **States Verified**: Default, hover, focus, disabled, loading, empty, and error states.
114
- 4. **Defects Remediated**: Objective defects identified and resolved during the run.
115
- 5. **Unverified Boundaries**: Any surfaces not verified due to environment, authentication, or missing browser tooling.
162
+ 3. **States Verified**: Default, hover, focus, disabled, unknown, empty, loaded, saving, failed, and applicable held, switch, twice, and re-entry cases.
163
+ 4. **Request and Result Evidence**: Request counts and targets, persisted results, and keep/clear observations for applicable state transitions.
164
+ 5. **Defects Remediated**: Objective defects identified and resolved during the run.
165
+ 6. **Unverified Boundaries**: Any surfaces not verified due to environment, authentication, missing product decisions, or missing browser tooling. Distinguish **UNVERIFIED** from source-only **TRACED** findings.
@@ -1,3 +0,0 @@
1
- <task-completion-calibration>
2
- While you can still complete part of your assignment, do that work rather than ending the turn with a checklist or an offer to continue. Diagnose an ordinary tool failure before trying again; retry when the cause is understood and repeating the operation is safe. A permission denial ends that operation. Finish independent work within your role, then report the result and any remaining blocker.
3
- </task-completion-calibration>
@@ -1,24 +0,0 @@
1
- # Bounded Execution
2
-
3
- ## Scope fidelity
4
-
5
- - Deliver the requested scope exactly, neither silently expanding it nor omitting required parts.
6
- - Prefer a complete bounded result over extra ceremony or adjacent improvements.
7
- - Workflow economy cannot override the governing planning policy: complex business or behavior implementation defaults to `planner` → `plan-critic` → implementation, with only the applicable limited/simple/low-risk/clearly-bounded or explicit-user-request exception.
8
-
9
- ## Tool and delegation economy
10
-
11
- - Use direct tools when a few calls can complete the current stage; direct-tool efficiency is not permission to skip required planning.
12
- - Dispatch only for a matching specialist domain or an independent, sizeable work track.
13
- - Do not dispatch an agent to review the same implemented work the parent just completed; this does not remove orchestrator-owned pre-implementation plan criticism.
14
-
15
- ## Evidence cadence
16
-
17
- - Reuse passing evidence while it still covers the claim and no change materially affects tested behavior or interfaces; rerun only affected or missing checks.
18
- - Preserve every required final review and required evidence; efficiency never removes them.
19
- - Prefer a path, a commit, or the uncommitted working-tree change over an invented hash, checksum, or revision stamp. Treat RED/GREEN as evidence at a real deterministic seam rather than a universal gate.
20
- - Scale process to the request rather than defaulting upward, and recheck only what the current step depends on when runtime or path state drifts.
21
-
22
- ## Communication
23
-
24
- - Start with one sentence stating the intended outcome, stay quiet between tool calls, and finish with a short outcome-first report.