create-agdf 0.10.0 → 0.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/README.md +30 -22
  2. package/bin/agdf-validator.js +11 -0
  3. package/generated/.agdf/control/README.md +3 -3
  4. package/generated/.github/skills/agdf-brownfield-analysis/SKILL.md +1 -1
  5. package/generated/.github/skills/agdf-delivery-path-search/SKILL.md +7 -6
  6. package/generated/.github/skills/agdf-gate-check/SKILL.md +28 -91
  7. package/generated/.github/skills/agdf-interaction-locales.json +2 -0
  8. package/generated/.github/skills/contracts/gate-transition.md +4 -2
  9. package/generated/.github/skills/contracts/modes.md +12 -1
  10. package/generated/.opencode/README.md +6 -8
  11. package/generated/.opencode/agdf-interaction-locales.json +2 -0
  12. package/generated/.opencode/contracts/gate-transition.md +4 -2
  13. package/generated/.opencode/contracts/modes.md +12 -1
  14. package/generated/.opencode/skills/agdf-brownfield-analysis/SKILL.md +1 -1
  15. package/generated/.opencode/skills/agdf-delivery-path-search/SKILL.md +7 -6
  16. package/generated/.opencode/skills/agdf-gate-check/SKILL.md +28 -91
  17. package/generated/plugins/agdf/.claude-plugin/plugin.json +19 -0
  18. package/generated/plugins/agdf/.codex-plugin/plugin.json +1 -1
  19. package/generated/plugins/agdf/control/README.md +3 -3
  20. package/generated/plugins/agdf/hooks/session-start.sh +1 -1
  21. package/generated/plugins/agdf/meta/agdf-interaction-locales.json +2 -0
  22. package/generated/plugins/agdf/meta/agdf-plugin.definition.json +1 -1
  23. package/generated/plugins/agdf/meta/contracts/gate-transition.md +4 -2
  24. package/generated/plugins/agdf/meta/contracts/modes.md +12 -1
  25. package/generated/plugins/agdf/runtime/agdf-local.js +11 -0
  26. package/generated/plugins/agdf/runtime/create-agdf/NOTICE +10 -0
  27. package/generated/plugins/agdf/runtime/create-agdf/bin/agdf-validator.js +11 -0
  28. package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/agdf-interaction-locales.json +418 -0
  29. package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/agdf-plugin.definition.json +220 -0
  30. package/generated/plugins/agdf/runtime/create-agdf/lib/cli/command-registry.js +136 -0
  31. package/generated/plugins/agdf/runtime/create-agdf/lib/cli/delivery-path-search-command.js +75 -0
  32. package/generated/plugins/agdf/runtime/create-agdf/lib/cli/parse-args.js +156 -0
  33. package/generated/plugins/agdf/runtime/create-agdf/lib/cli/runtime-context.js +83 -0
  34. package/generated/plugins/agdf/runtime/create-agdf/lib/cli/validation-handlers.js +45 -0
  35. package/generated/plugins/agdf/runtime/create-agdf/lib/control-evaluation/delivery-map.js +291 -0
  36. package/generated/plugins/agdf/runtime/create-agdf/lib/control-evaluation/doctor.js +265 -0
  37. package/generated/plugins/agdf/runtime/create-agdf/lib/control-evaluation/gate-check.js +459 -0
  38. package/generated/plugins/agdf/runtime/create-agdf/lib/control-evaluation/gate-policy.js +283 -0
  39. package/generated/plugins/agdf/runtime/create-agdf/lib/control-evaluation/required-files.js +9 -0
  40. package/generated/plugins/agdf/runtime/create-agdf/lib/control-evaluation/run-state.js +217 -0
  41. package/generated/plugins/agdf/runtime/create-agdf/lib/control-evaluation/shared.js +344 -0
  42. package/generated/plugins/agdf/runtime/create-agdf/lib/control-evaluation/verified-change.js +156 -0
  43. package/generated/plugins/agdf/runtime/create-agdf/lib/control-state/aggregate.js +18 -0
  44. package/generated/plugins/agdf/runtime/create-agdf/lib/control-state/gate-approval-validator.js +49 -0
  45. package/generated/plugins/agdf/runtime/create-agdf/lib/control-state/index.js +7 -0
  46. package/generated/plugins/agdf/runtime/create-agdf/lib/control-state/legacy-migration.js +95 -0
  47. package/generated/plugins/agdf/runtime/create-agdf/lib/control-state/run-state-parser.js +227 -0
  48. package/generated/plugins/agdf/runtime/create-agdf/lib/control-state/run-state-repository.js +68 -0
  49. package/generated/plugins/agdf/runtime/create-agdf/lib/control-state/run-state-resolver.js +45 -0
  50. package/generated/plugins/agdf/runtime/create-agdf/lib/control-state/run-state-writer.js +97 -0
  51. package/generated/plugins/agdf/runtime/create-agdf/lib/delivery-path-search/candidate-policy.js +99 -0
  52. package/generated/plugins/agdf/runtime/create-agdf/lib/delivery-path-search/contracts.js +237 -0
  53. package/generated/plugins/agdf/runtime/create-agdf/lib/delivery-path-search/evaluators/claude.js +44 -0
  54. package/generated/plugins/agdf/runtime/create-agdf/lib/delivery-path-search/evaluators/codex.js +53 -0
  55. package/generated/plugins/agdf/runtime/create-agdf/lib/delivery-path-search/evaluators/protocol.js +13 -0
  56. package/generated/plugins/agdf/runtime/create-agdf/lib/delivery-path-search/generators/claude.js +40 -0
  57. package/generated/plugins/agdf/runtime/create-agdf/lib/delivery-path-search/generators/codex.js +38 -0
  58. package/generated/plugins/agdf/runtime/create-agdf/lib/delivery-path-search/generators/protocol.js +12 -0
  59. package/generated/plugins/agdf/runtime/create-agdf/lib/delivery-path-search/persistence.js +39 -0
  60. package/generated/plugins/agdf/runtime/create-agdf/lib/delivery-path-search/scoring.js +21 -0
  61. package/generated/plugins/agdf/runtime/create-agdf/lib/delivery-path-search/search-engine.js +154 -0
  62. package/generated/plugins/agdf/runtime/create-agdf/lib/delivery-path-search/state-adapter.js +161 -0
  63. package/generated/plugins/agdf/runtime/create-agdf/lib/delivery-path-search/surfaces/capabilities.js +14 -0
  64. package/generated/plugins/agdf/runtime/create-agdf/lib/delivery-path-search/transports/read-only-guard.js +43 -0
  65. package/generated/plugins/agdf/runtime/create-agdf/lib/interaction-presentation.js +590 -0
  66. package/generated/plugins/agdf/runtime/create-agdf/lib/runtime/local-validator.js +142 -0
  67. package/generated/plugins/agdf/runtime/create-agdf/lib/runtime/validator-application.js +40 -0
  68. package/generated/plugins/agdf/runtime/create-agdf/package.json +66 -0
  69. package/generated/plugins/agdf/runtime/runtime-manifest.json +8 -0
  70. package/generated/plugins/agdf/scripts/check-runtime-integrity.mjs +1040 -0
  71. package/generated/plugins/agdf/skills/brownfield-analysis/SKILL.md +1 -1
  72. package/generated/plugins/agdf/skills/delivery-path-search/SKILL.md +7 -6
  73. package/generated/plugins/agdf/skills/gate-check/SKILL.md +28 -91
  74. package/lib/cli/application.js +21 -59
  75. package/lib/cli/command-registry.js +9 -11
  76. package/lib/cli/validation-handlers.js +45 -0
  77. package/lib/control-evaluation/doctor.js +1 -1
  78. package/lib/control-evaluation/gate-check.js +7 -7
  79. package/lib/control-evaluation/required-files.js +9 -0
  80. package/lib/installers/local-marketplace.js +322 -0
  81. package/lib/installers/opencode-activation.js +43 -0
  82. package/lib/installers/opencode.js +60 -18
  83. package/lib/installers/plugin-installers.js +102 -26
  84. package/lib/runtime/local-validator.js +142 -0
  85. package/lib/runtime/validator-application.js +40 -0
  86. package/lib/scaffold/plan.js +1 -30
  87. package/lib/scaffold/presentation.js +9 -14
  88. package/opencode-plugin.js +32 -24
  89. package/package.json +6 -2
package/README.md CHANGED
@@ -25,7 +25,7 @@ Use a different target when Codex is not your agent surface:
25
25
  |---|---|---|
26
26
  | Claude Code | `npx --yes @agdf/cli@latest claude` | The AGDF plugin for Claude Code. |
27
27
  | OpenCode, user-wide discovery | `npx --yes @agdf/cli@latest opencode` | The npm plugin and global native skills; repository governance remains opt-in. |
28
- | OpenCode, one repository | `npx --yes @agdf/cli@latest opencode-repo` | Repository instructions, native skills, permissions and control templates. |
28
+ | OpenCode, one repository | `npx --yes @agdf/cli@latest opencode-repo` | Durable control configuration that activates the once-installed global runtime. |
29
29
  | GitHub Copilot | `npx --yes @agdf/cli@latest copilot` | Repository instructions, visible skills and control templates. |
30
30
  | Durable control state in an existing setup | `npx --yes @agdf/cli@latest init` | Live `.agdf/control/` state when the repository explicitly needs it. |
31
31
 
@@ -35,7 +35,7 @@ For prerequisites, all surface-specific flows and operational boundaries, use th
35
35
 
36
36
  The Quick Start above is the recommended entry point. For the exact current command and option reference, run `npx --yes @agdf/cli@latest --help`; the groups below explain the supported surfaces, validation paths and canonical run lifecycle.
37
37
 
38
- Preferred long-term CLI shape:
38
+ Installation, activation and explicit lifecycle changes:
39
39
 
40
40
  ```bash
41
41
  npx --yes @agdf/cli@latest codex
@@ -49,26 +49,26 @@ npx --yes @agdf/cli@latest disable --surface codex --scope repository
49
49
  npx --yes @agdf/cli@latest uninstall --surface codex --scope global
50
50
  npx --yes @agdf/cli@latest init
51
51
  npx --yes @agdf/cli@latest config --language en
52
- npx --yes @agdf/cli@latest doctor
53
- npx --yes @agdf/cli@latest gate-check --status-card
54
- npx --yes @agdf/cli@latest gate-check --approval-envelope
55
- npx --yes @agdf/cli@latest gate-check --json
56
52
  ```
57
53
 
58
- Operational validation and bounded planning:
54
+ Repeated operational validation and bounded planning use the installed, version-pinned local command:
59
55
 
60
56
  ```bash
61
- npx --yes @agdf/cli@latest delivery-map --json
62
- npx --yes @agdf/cli@latest delivery-path-search --surface codex --json
63
- npx --yes @agdf/cli@latest delivery-path-search --surface claude --json
57
+ agdf doctor
58
+ agdf gate-check --status-card
59
+ agdf gate-check --approval-envelope
60
+ agdf gate-check --json
61
+ agdf delivery-map --json
62
+ agdf delivery-path-search --surface codex --json
63
+ agdf delivery-path-search --surface claude --json
64
64
  ```
65
65
 
66
66
  Canonical run lifecycle:
67
67
 
68
68
  ```bash
69
- npx --yes @agdf/cli@latest run-create --run <run_id>
70
- npx --yes @agdf/cli@latest run-migrate [--run <run_id>]
71
- npx --yes @agdf/cli@latest run-render-legacy --run <run_id>
69
+ agdf run-create --run <run_id>
70
+ agdf run-migrate [--run <run_id>]
71
+ agdf run-render-legacy --run <run_id>
72
72
  ```
73
73
 
74
74
  ### Advanced / Compatibility
@@ -115,14 +115,22 @@ it does not localize the CLI lifecycle card.
115
115
  - `claude` installs the AGDF plugin globally for Claude Code
116
116
  - `copilot` writes `AGENTS.md`, Copilot custom instructions under `.github/`, visible repository skills under `.github/skills/`, and AGDF control templates under `.agdf/control/`
117
117
  - `opencode` installs the AGDF npm plugin and nine native skills as a user-wide OpenCode surface
118
- - `opencode-status` reports OpenCode global config, package loadability, global native-skill completeness, session signals and repository surface presence
118
+ - `opencode-status` reports OpenCode global config, package loadability, global native-skill completeness, durable repository activation, legacy compatibility and observable session signals
119
119
  - `status` reports installation, repository activation and delivery separately without mutating state
120
120
  - `disable` writes a supported repository-local opt-out while retaining global capability and durable control state
121
121
  - `uninstall` previews and, only with `--confirm`, applies a selected global removal through supported native/owned operations
122
- - `opencode-repo` writes `opencode.json`, `.opencode/AGDF.md`, prefixed native OpenCode skills under `.opencode/skills/`, explicit question/edit/bash/skill permissions, and AGDF control templates under `.agdf/control/`
122
+ - `opencode-repo` writes durable AGDF control configuration and templates under `.agdf/control/`; it does not copy a second OpenCode runtime surface
123
123
  - `both` writes the Codex repository-local marketplace plus the Copilot-facing repository files
124
124
  - `config` writes or updates only `.agdf/control/config.json` for an already installed plugin or an existing repository
125
125
 
126
+ The `codex` and `claude` commands install from the complete plugin built into the released
127
+ `create-agdf` package. They atomically stage it under an AGDF-owned user-data marketplace, register
128
+ that stable local path through the host CLI and verify the exposed version. Source `plugin/` therefore
129
+ contains no generated runtime bytes, and routine installed validation does not depend on the GitHub
130
+ checkout, npm cache, PATH or registry. Rerunning either command performs the explicit update and
131
+ migrates only the exact known legacy AGDF GitHub marketplace; foreign same-name registrations fail
132
+ closed and failed host operations restore the prior owned stage.
133
+
126
134
  If the target repository already has an `AGENTS.md`, `create-agdf` preserves it and writes `AGENTS.agdf.md` instead of replacing your existing instructions. Merge the AGDF fragment into your current `AGENTS.md` when you want Copilot to load both instruction sets. The generated `.github/copilot-instructions.md` keeps Copilot pointed at `AGENTS.md`, `.github/skills/` and `.agdf/control/` without duplicating the full AGDF rule model. Use `--force` only when you explicitly want to overwrite generated files.
127
135
 
128
136
  Use the `codex-repo` target when AGDF should be available only inside one repository instead of being installed as a personal/global Codex plugin.
@@ -141,19 +149,19 @@ Then verify the visible installation state:
141
149
  npx --yes @agdf/cli@latest opencode-status --json
142
150
  ```
143
151
 
144
- The status command reports global configuration, package loadability, global native-skill completeness, session signals and whether the current repository has `.opencode/AGDF.md` plus the `agdf-gate-check` surface. It does not infer an active OpenCode session from config alone.
152
+ The status command reports global configuration, package loadability, global native-skill completeness, durable repository activation, legacy local-surface compatibility and session signals. It does not infer an active OpenCode session from config alone.
145
153
  In JSON schema version 1, `repository_surface.gate_check_agent` remains a deprecated compatibility alias for the native `gate_check_skill` path so existing status consumers keep working during the agent-to-skill migration.
146
154
 
147
- Use the `opencode-repo` target when AGDF should be available to OpenCode from repository files:
155
+ Use the `opencode-repo` target when a repository should opt into the globally installed AGDF OpenCode runtime:
148
156
 
149
157
  ```bash
150
158
  npm create agdf@latest -- opencode-repo
151
159
  ```
152
160
 
153
- OpenCode loads the AGDF npm plugin and global native skills from global OpenCode config, plus repository instructions from `.opencode/AGDF.md`, explicit `question`/`edit`/`bash`/`skill` permissions and canonical `agdf-` project skills under `.opencode/skills/`. Global adapters use the collision-safe `agdf-global-` prefix. AGDF for OpenCode has a global discoverability layer installed with `npx --yes @agdf/cli@latest opencode` and a repository-local governance surface generated by `opencode-repo`.
154
- Those generated skills load on demand through OpenCode's native `skill` tool. Use `agdf-gate-check` first for new build/change intent or unclear approval.
155
- The built-in `question` tool can present a gate choice, but `.agdf/control/` and exact post-response validation remain authoritative; technical permission and auto-mode outcomes never approve an AGDF gate. If `opencode.json` already exists, AGDF keeps it unchanged and writes `opencode.agdf.json` as a merge fragment. Preserve any explicit `permission.question` decision when reviewing that fragment; `deny` uses exact-text fallback.
156
- The global layer makes the nine native AGDF skills discoverable, but does not activate repository governance by itself. Global skills fail closed until the current repository has `.opencode/AGDF.md`, `.opencode/skills/agdf-gate-check/SKILL.md` and `.agdf/control/`. Use `opencode-repo` to write that repository surface.
161
+ OpenCode loads the AGDF npm plugin and global native skills from global OpenCode config. Global adapters use the collision-safe `agdf-global-` prefix, including `agdf-global-gate-check`. `opencode-repo` adds the durable `.agdf/control/config.json` marker and control templates; it does not write `opencode.json`, `.opencode/AGDF.md`, copied contracts or copied skills.
162
+ The global skills load on demand through OpenCode's native `skill` tool. Use `agdf-global-gate-check` first for new build/change intent or unclear approval. Existing local `.opencode/` assets remain supported as a compatibility path and are not deleted.
163
+ The built-in `question` tool can present a gate choice, but `.agdf/control/` and exact post-response validation remain authoritative; technical permission and auto-mode outcomes never approve an AGDF gate. Explicit `permission.question: deny` remains unchanged and uses exact-text fallback.
164
+ The global layer makes the nine native AGDF skills discoverable, but does not activate repository governance by itself. Global skills fail closed until the current repository has valid `.agdf/control/config.json`. Use `opencode-repo` to create the durable activation marker.
157
165
 
158
166
  ## Control scaffold
159
167
 
@@ -224,7 +232,7 @@ the agent-native workflow or approve a gate.
224
232
  Use `delivery-path-search` only for high-impact planning decisions with several materially different next steps:
225
233
 
226
234
  ```bash
227
- npx --yes @agdf/cli@latest delivery-path-search --surface codex --json
235
+ agdf delivery-path-search --surface codex --json
228
236
  ```
229
237
 
230
238
  The runtime uses bounded best-first Delivery Path Search, not MCTS. It is read-only and advisory: the result must be checked by canonical `gate-check`. Codex and Claude Code are executable, tool-enforced evaluator adapters and support opt-in `--generate-candidates`; generated proposals supplement the deterministic baseline and are deterministically validated before evaluation. Copilot and OpenCode reuse the same skill and contracts as instruction-only surfaces until conforming executable adapters are available.
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env node
2
+
3
+ import process from "node:process";
4
+ import { runValidatorCli } from "../lib/runtime/validator-application.js";
5
+
6
+ try {
7
+ process.exitCode = await runValidatorCli(process.argv.slice(2));
8
+ } catch (error) {
9
+ console.error(error instanceof Error ? error.message : String(error));
10
+ process.exitCode = 1;
11
+ }
@@ -66,9 +66,9 @@ npx --yes @agdf/cli@latest config --language en
66
66
  Then check whether the live state is actionable:
67
67
 
68
68
  ```bash
69
- npx --yes @agdf/cli@latest doctor
70
- npx --yes @agdf/cli@latest doctor --json
71
- npx --yes @agdf/cli@latest gate-check --json
69
+ agdf doctor
70
+ agdf doctor --json
71
+ agdf gate-check --json
72
72
  ```
73
73
 
74
74
  `doctor` does not replace agent judgment. It catches basic control failures: missing live files, missing current gate, missing next allowed action, empty evidence, empty backlog pointer, empty source-of-truth registry, duplicate active SoT rows and invalid quality contracts.
@@ -37,7 +37,7 @@ Do not mix both modes silently. Name the active mode in the output.
37
37
 
38
38
  ## Rules
39
39
  1. Brownfield first: understand the existing codebase before PRD/SD decisions when existing-system impact is possible, and again before implementation.
40
- 2. Brownfield Review after `Approval: UR` is a sizing and routing step. It must visibly decide `quick_task`, `verified_change`, `structured_slice`, `structured_delivery`, or `block` before PRD depth or implementation is chosen.
40
+ 2. Brownfield Review after `Approval: UR` is a sizing and routing step. It must visibly decide `quick_task`, `verified_change`, `structured_slice`, `structured_delivery`, or `block` before PRD depth or implementation is chosen. Persist the completed review and its decision, scope reason, evidence and required next gate in the same internal operation; mark the review `done` only after both the artefact and canonical run projection are complete. An interrupted, incomplete or legacy record stays at fail-closed `Mode/Slice Decision` recovery without another user approval.
41
41
  3. Reuse-before-create: prefer existing modules, services, components, tables, endpoints, tests, and configuration.
42
42
  4. Minimal clean slice: choose the smallest durable intervention, not merely the smallest technical diff.
43
43
  5. No silent parallel structures.
@@ -35,16 +35,17 @@ Skip for routine questions, obvious local fixes and approved implementation with
35
35
  1. Run AGDF gate-check and inspect durable control state.
36
36
  2. Confirm that search is allowed and implementation is not occurring during exploration.
37
37
  3. Declare the active surface and its enforcement level.
38
- 4. Invoke the shared CLI runtime:
38
+ 4. Resolve the exact-version surface-local validator using the same ownership rules as `agdf-gate-check`. Do not search `PATH`, query a registry, install a package or invoke `npx ...@latest` during routine planning. If no owned or explicitly configured exact-version validator is available, report `machine_validation: unavailable` or `machine_validation: external_required` and stop the machine-evaluated search.
39
+ 5. Invoke the shared CLI runtime:
39
40
 
40
41
  ```bash
41
- npx --yes @agdf/cli@latest delivery-path-search --surface <surface> --json
42
+ node <surface-local-agdf> delivery-path-search --surface <surface> --json
42
43
  ```
43
44
 
44
45
  Optional AI-native candidate generation is explicit:
45
46
 
46
47
  ```bash
47
- npx --yes @agdf/cli@latest delivery-path-search \
48
+ node <surface-local-agdf> delivery-path-search \
48
49
  --surface codex \
49
50
  --generate-candidates \
50
51
  --json
@@ -52,9 +53,9 @@ npx --yes @agdf/cli@latest delivery-path-search \
52
53
 
53
54
  It supplements the deterministic baseline with at most one bounded generator call. Treat proposals as untrusted until the canonical core validates schema, gate action, scope, duplicates and material diversity. Report generation provenance, budgets, rejections and failure. Never hide deterministic fallback or switch providers automatically.
54
55
 
55
- 5. Treat facts, repository evidence, assumptions and model judgements separately.
56
- 6. Return exactly one recommendation or `no_safe_recommendation`.
57
- 7. Run canonical AGDF gate-check after search. Never translate a recommendation into permission.
56
+ 6. Treat facts, repository evidence, assumptions and model judgements separately.
57
+ 7. Return exactly one recommendation or `no_safe_recommendation`.
58
+ 8. Run canonical AGDF gate-check after search. Never translate a recommendation into permission.
58
59
 
59
60
  ## Enforcement
60
61
 
@@ -44,17 +44,23 @@ If required control files are missing, do not automatically create a full `.agdf
44
44
  The default first action is to draft the minimal UR in the response and request `Approval: UR`.
45
45
  Use `init` only when the user explicitly asks for durable AGDF control state, the repository already uses `.agdf/control/` as its live working state, or a deterministic CLI/CI setup path is being executed.
46
46
 
47
- Use the executable control path when a machine-readable check is requested, when the gate state is ambiguous, when CI or PR evidence is needed, when deterministic ready-gate rendering is required, or when a repository-local automation needs JSON output. Prefer an already installed `agdf` executable; use registry-resolved `npx ...@latest` only for bootstrap, installation, explicit refresh or when no local executable exists:
47
+ Use the executable control path when a machine-readable check is requested, when the gate state is ambiguous, when CI or PR evidence is needed, when deterministic ready-gate rendering is required, or when a repository-local automation needs JSON output. Resolve the version-matched validator owned by the active surface first: `<plugin-root>/runtime/agdf-local.js` for Codex or Claude, or `<opencode-config>/agdf/bin/agdf-local.js` for OpenCode. Run its `--resolve-only --json` probe before treating its output as machine evidence. An explicitly configured absolute `AGDF_VALIDATOR_PATH` is the only secondary local candidate and must match the active AGDF version.
48
+
49
+ Routine validation uses that resolved local entrypoint:
48
50
 
49
51
  ```bash
50
- npx --yes @agdf/cli@latest init
51
- npx --yes @agdf/cli@latest doctor --json
52
- npx --yes @agdf/cli@latest gate-check --json
53
- npx --yes @agdf/cli@latest delivery-map --json
52
+ node <surface-local-agdf> doctor --json
53
+ node <surface-local-agdf> gate-check --json
54
+ node <surface-local-agdf> delivery-map --json
54
55
  ```
55
56
 
56
- For repeated local checks, use `agdf doctor --json`, `agdf gate-check --json` or
57
- `agdf gate-check --approval-envelope`. The last command prints the validated
57
+ If no exact-version local validator exists, continue through agent-native inspection where permitted
58
+ and state `machine_validation: unavailable` or `external_required`; do not automatically invoke
59
+ `npx`, install a package or contact the registry. Registry-resolved commands are reserved for an
60
+ explicit bootstrap, installation, repair or refresh requested as a lifecycle action.
61
+
62
+ For repeated local checks, use the resolved entrypoint with `doctor --json`, `gate-check --json` or
63
+ `gate-check --approval-envelope`. The last command prints the validated
58
64
  two-card exact-text interaction; JSON exposes the same `approval_presentation`
59
65
  for a native-capable adapter.
60
66
 
@@ -65,93 +71,24 @@ The CLI reports are validators and JSON evidence, not the primary user experienc
65
71
 
66
72
  ## Native Interaction Path
67
73
 
68
- Use the Runtime Contract's Native Interaction Contract to classify every candidate interaction as `clarification`, `tool_permission`, `gate_approval`, `blocked` or `status` before selecting a host control.
69
-
70
- Prefer inspection over asking. Do not invoke a structured question for status reporting, facts available in the repository, routine read-only work or a gate that is not ready. Do not repeatedly prompt for the same non-ready gate.
71
-
72
- For a fresh request classified as read-only with no required run decision, emit the locale pack's
73
- `primary.readOnlyOrientationDescription` sentence once before the findings. This path creates no run, persists
74
- nothing, requests no approval and reuses the existing status projection. Do not repeat the sentence
75
- during the same request.
76
-
77
- For a ready `gate_approval`:
78
-
79
- 1. Resolve exactly one selected run and evaluate the current gate.
80
- 2. Confirm the required durable artefact is present and ready before presenting a question.
81
- 3. Consume the validated canonical `approval_presentation` for the same selected run, gate and revision. Do not compose or rewrite headings, fields, card order, locale copy or Markdown in the model.
82
- 4. Emit its complete `run_status_card` block first and `gate_transition_card` block second in one immediately preceding assistant message. The first heading is neutral; the five status fields are selected run, readiness, current gate, human-readable required decision and a neutral approve/revise/decline instruction. The exact approval value appears only in the transition card across these two blocks.
83
- 5. Never put either card only into the question, button description or hidden tool context. Do not invoke a native question until both rendered blocks are visible.
84
- 6. If the projection is absent or invalid, render no partial card and invoke no native control. Re-evaluate the gate. Use only the exact-text request when the same gate is still ready and its canonical value is independently valid; otherwise report the non-ready reason and request no decision.
85
- 7. Distinguish internal process steps from user decisions in natural language. For example, after `Approval: TP`, say that pre-implementation Brownfield Analysis runs next and that no further user action is required now; do not expose `next_user_gate: none` or `user_action_required: no`, and do not ask for a second approval for Brownfield Analysis.
86
- 8. Ask exactly one question that names the selected `run_id` and `current_gate`.
87
- 9. Offer options in stable order: exact `Approval: <GateName>`, localized revise and localized decline. Add explicit cancel only where supported after decline; otherwise host dismissal maps to cancel. Never preselect, skip, auto-submit or reorder an option.
88
- 10. Use the surface adapter declared in the canonical plugin definition only when it can wait for deliberate input without auto-resolution and can transport `exact_option_value` or `separate_label_and_value`; never invoke a `decorated_label_only` adapter. Otherwise request the same exact approval in concise text.
89
- 11. Render both supplied cards once in that single complete assistant message. Never merge, reverse, omit, duplicate or reconstruct them; the decision heading does not replace either card. If the native attempt is unavailable or not applied, continue to exact text without repeating either card.
90
- 12. Re-run gate evaluation for the same run and expected gate after the response and immediately before persistence.
91
- 13. Reject a missing artefact, ambiguous or wrong run, wrong gate, stale expected gate, timeout/default, hook-supplied answer, agent message, technical permission outcome or plan approval.
92
- 14. Persist accepted input only through the existing control-state workflow.
93
-
94
- Before projecting a ready gate, evaluate adapter callability, deliberate wait safety and canonical
95
- approval-value transport. Expose `native_attempt_required: true` only when that preflight proves
96
- `exact_option_value` or `separate_label_and_value` transport with safe deliberate waiting. Decorated-only,
97
- missing, conflicting or unknown capability exposes false and `unavailable_before_invocation`; unsafe
98
- waiting exposes false and `unsafe_to_wait`. In both cases use exact text without invoking the adapter.
99
- A hook, permission result or session context message cannot replace an eligible attempt or supply its answer.
100
-
101
- Before composing the question, resolve the configured chat locale from `.agdf/control/config.json` through `../agdf-interaction-locales.json`: exact complete pack, language subtag, then English fallback. German and English are initial packs, not a closed language list. Keep `Approval: <GateName>` exactly unchanged in every language, and do not mix presentation languages within one interaction. Labels and descriptions use the same resolved locale; host-owned UI chrome remains host-owned and may use a different language.
102
-
103
- The canonical renderer resolves the complete locale pack. The initial German pack includes `Bereit für deine Entscheidung`, `Jetzt freigeben` and `Danach`; the initial English pack includes `Ready for your decision`, `Approve now` and `Next`. Verify that the supplied blocks use one locale and a neutral decision heading while leaving the exact gate identifier and approval value unchanged. Do not model-edit the supplied Markdown.
104
-
105
- The primary option is derived exactly as `Approval: <GateName>` from the evaluated current gate; only explanatory copy and non-authoritative outcome labels are localized. Concrete localized copy belongs to the user-facing interaction layer or the approved delivery artefact, not to English runtime rules.
106
-
107
- Make exactly one native-attempt for the eligible ready gate. If the host does not render,
108
- apply or safely return the native question on that attempt, switch immediately
109
- to the exact textual approval. Do not ask the user to request the buttons again
110
- and do not create a retry loop or simulated control.
111
-
112
- State the outcome visibly: `presented`, `unavailable_before_invocation`,
113
- `attempted_not_applied` or `unsafe_to_wait`. For every fallback, say in the
114
- configured locale why a native control was not usable, show the exact approval
115
- value and confirm that authority is unchanged. This transient outcome is not
116
- approval evidence. A new explicit user request may reopen the unchanged decision
117
- only after fresh run/gate/artefact revalidation; never retry automatically.
118
-
119
- Surface behavior:
120
-
121
- - Codex: invoke the native short-question/request-user-input control only when preflight proves `exact_option_value` or `separate_label_and_value`, and omit auto-resolution. The canonical `decorated_label_only` capability must use exact text without invoking the adapter. `Approval: <GateName> (Recommended)` is never a valid option or approval.
122
- - Claude Code: invoke `AskUserQuestion` on the first eligible attempt only when no timeout can auto-continue and no hook supplies `answers` or `updatedInput`; if it is not rendered or applied, use exact text immediately. Claude permissions and `ExitPlanMode` remain separate.
123
- - OpenCode: use built-in `question` when permitted. Preserve explicit `permission.question` denial and use exact text in that case. `once`, `always`, `reject` and auto mode never become gate input.
124
- - GitHub Copilot: the current repository-instruction surface has no conforming native approval adapter. Transmit the canonical rendered cards followed by the exact-text request; never claim or simulate a native control. Copilot tool confirmations, plan interactions and repository permissions remain separate.
125
- - Other, unavailable or non-interactive surfaces: use exact textual approval and wait for a new explicit user response.
126
-
127
- Localized labels such as `Überarbeiten`/`Revise`, `Ablehnen`/`Decline` and `Abbrechen`/`Cancel` are presentation mappings to stable non-approval outcomes only. A label, description, option position or recommendation never authorizes a gate. Host-provided free-text or `Überspringen`/`Skip` actions never advance an AGDF gate.
128
-
129
- A free-form response must still exactly match the current gate's approval formula after revalidation. Keep `decline`, `cancel`, `no_response`, `timeout`, `empty`, `invalid` and `stale` distinct; none advances the gate. Native presentation, host permission and plan approval are inputs or separate authority domains, never durable AGDF authority.
130
-
131
- Every primary chat card shows the selected run's `UR`, `PRD`, `SD` and `TP` in that order. Render an existing canonical path as a readable link and a missing artefact as localized non-link text; never guess paths. Resolve the human run title from current artefact heading, approved UR heading, Objective, then normalized `run_id`. Status, blocked, clarification and internal-step interactions use the same locale and artefact projection but do not show approval buttons. Keep raw process keys and machine status values in JSON or audit detail.
132
-
133
- ### Breadcrumb Rendering
134
-
135
- The compact human Run Status Card includes a single-line path-derived breadcrumb showing the user's position in the delivery journey. Derive it from the Mode/Slice Decision and the Approvals table — not a fixed template. Use `✓` for fulfilled, `●` for current, `○` for open, separated by ` · `. Non-applicable gates are absent. See the Runtime Contract §Breadcrumb for the path templates and the derived `breadcrumb` array.
136
-
137
- ### Post-Acceptance Transition Narration
138
-
139
- After each accepted gate approval is persisted, emit exactly one narration line using the template `<what was satisfied> → <what the agent does next internally> → <user action: yes/no>`. This generalizes the existing TP pattern (step 7 above) to every gate advancement. The narration is post-acceptance only: it never appears in the same message as the Gate Transition Card, never contains the `Approval:` value, and never repeats the decision's effect. For internal steps (Brownfield Review, Brownfield Analysis), state what the agent does next and that no user action is required, without exposing `next_user_gate: none` or asking for a second approval. See the Runtime Contract §Post-Acceptance Transition Narration for the full contract.
140
-
141
- ### Internal-State Collapse in the Human Card
142
-
143
- When rendering the compact human Run Status Card, collapse internal sub-states (`verified_change` sub-states, `context_graph_required_action`, `multi_scope_state`) to stable human labels. `escalated`, `open_gap` and `blocked` remain explicitly visible. The full machine/audit projection retains all raw values unchanged. See the Runtime Contract §Internal-State Collapse for the complete mapping table.
144
-
145
- ### On-Demand "Why?" Response
74
+ `../contracts/interaction.md` is the complete normative owner for interaction kinds, locale,
75
+ canonical values, presentation order, adapter capability, deliberate waiting, native/fallback
76
+ behavior, transient outcomes, permissions and post-response validation. Load and apply that contract;
77
+ do not restate or infer a surface matrix in this skill.
146
78
 
147
- When the user asks "why?" or "Warum?" at any gate or internal step, respond with a `status` interaction (not `gate_approval`):
79
+ This skill owns only these operational responsibilities:
148
80
 
149
- 1. Pull the curated rationale from `gateRationale()` in the resolved locale.
150
- 2. Compose one fulfilled line from the selected run's Approvals table and artefact status.
151
- 3. Compose one protects-against line from the gate's rationale and the existing `primary.actions` copy.
152
- 4. Do not show approval controls. Do not advance any gate. Do not merge with the approval envelope.
81
+ 1. Select exactly one run and evaluate its current gate.
82
+ 2. Confirm that the required durable artefact is present and ready.
83
+ 3. Consume the canonical `approval_presentation` verbatim for the selected run, gate and revision.
84
+ 4. Present that projection and obtain deliberate input through the contract-selected native or exact-text path.
85
+ 5. Revalidate the same run, gate and revision immediately after the response and before persistence.
86
+ 6. Persist only a currently valid exact approval through the existing control-state workflow.
153
87
 
154
- The response is deterministic: same gate, same question, same answer. The `gate_approval` options remain exactly `approve | revise | decline | cancel`; no "why" option is added. See the Runtime Contract §Gate-Rationale-Registry and §On-Demand "Why?" Interaction for the full contract.
88
+ For status, blocked, read-only or rationale interactions, consume the same canonical projection and
89
+ locale contract without asking for approval. Internal process steps remain distinct from user
90
+ decisions. If the projection, adapter evidence or revalidation is missing, follow the contract's
91
+ fail-closed outcome and leave authority unchanged.
155
92
 
156
93
  ## Rules
157
94
  1. Fail closed when a required approval or artefact status is missing.
@@ -79,6 +79,7 @@
79
79
  "OR": "Delivery report",
80
80
  "Verified Change": "Verified change",
81
81
  "Quick Task": "Quick task",
82
+ "Compact Delivery": "Compact Delivery",
82
83
  "Block": "Block"
83
84
  },
84
85
  "gateActionTitles": {
@@ -281,6 +282,7 @@
281
282
  "OR": "Lieferbericht",
282
283
  "Verified Change": "Verified Change",
283
284
  "Quick Task": "Quick Task",
285
+ "Compact Delivery": "Kompakte Lieferung",
284
286
  "Block": "Block"
285
287
  },
286
288
  "gateActionTitles": {
@@ -57,7 +57,7 @@ They must not override AGDF gates, approvals or the Runtime Contract.
57
57
  - Approval of one user gate permits work on the next allowed gate artefact or required internal step only. It does not permit implementation unless the approved gate is `TP` and required internal implementation prerequisites are satisfied.
58
58
  - Gates must never be skipped or inferred from urgency, tone, chat history, task wording or an instruction to "start". The next allowed action is always the next unsatisfied gate or internal mandatory step.
59
59
  - Missing control files or missing current-state fields do not forbid the agent from preparing the current allowed artefact. They forbid later-gate work and implementation. For a fresh request, the default allowed work is to draft a minimal UR in the response and request `Approval: UR`. Initialize or write `.agdf/control/` only when the user explicitly asks for durable AGDF control state, the repository already uses `.agdf/control/` as its live working state, or a deterministic CLI/CI setup path is being executed.
60
- - `Approval: UR` permits Brownfield Review after G-00 first, then a Mode/Slice Decision. It never permits implementation by itself.
60
+ - `Approval: UR` permits Brownfield Review after G-00 first. The review records its Mode/Slice Decision in the same internal operation when evidence is sufficient; the user is told that no action is required now. A separate `Mode/Slice Decision` step is fail-closed recovery for incomplete or legacy review state, not a normal user decision. UR approval never permits implementation by itself and does not preselect PRD.
61
61
  - PRD, SD and TP depth is chosen after Brownfield Review through the Mode/Slice Decision, not before existing-system impact is understood.
62
62
  - The Mode/Slice Decision must be visible before any PRD shortcut, Quick Task execution or implementation: record the decision, required next gate, scope reason and evidence in the selected canonical `RUN_STATE.md` or an equivalent linked control artefact.
63
63
  - `Approval: PRD` permits Solution Design drafting, not implementation.
@@ -76,6 +76,9 @@ After an approved and durable UR, perform a lightweight `Brownfield Review` befo
76
76
 
77
77
  This review is not a new user approval gate, not PRD, not SD, not TP and not implementation permission.
78
78
  It is the sizing and routing step that decides how much later gate discipline is actually needed.
79
+ When evidence is sufficient, persist the review and Mode/Slice selection together; do not expose a
80
+ second routine user decision. Keep the standalone Mode/Slice step only for fail-closed recovery when
81
+ the review record is incomplete or legacy.
79
82
 
80
83
  Its output is limited to:
81
84
 
@@ -131,4 +134,3 @@ The `agdf-brownfield-analysis` skill has two explicit modes:
131
134
  - `pre_implementation_analysis`: implementation-preparation analysis after approved durable TP; verifies reuse path, owners, regression risk and fit before `CD+Tests`.
132
135
 
133
136
  Do not mix the modes silently. Name the active mode in Brownfield output.
134
-
@@ -24,6 +24,18 @@ Use this compact output shape when no formal gate artefact is required:
24
24
 
25
25
  Do not add a separate `Quality outlook` line for pure Quick Tasks unless the task became a relevant run.
26
26
 
27
+ ### Quick Task and Compact Delivery
28
+
29
+ Use **Quick Task** for ungated questions, reviews, debugging and eligible narrow fixes that introduce
30
+ no new product semantics or formal artefacts. When an approved UR is followed by a Brownfield Review
31
+ that selects the persisted `quick_task` mode, use **Compact Delivery** as the human-facing label. The
32
+ stored and JSON value remains `quick_task`; Compact Delivery is not a new mode or approval gate.
33
+
34
+ Brownfield Review owns the Mode/Slice selection. A completed review records its decision, scope
35
+ reason, evidence and required next depth in the same internal operation. `Mode/Slice Decision` remains
36
+ only a fail-closed recovery step for incomplete or legacy records and is not a normal second user
37
+ decision.
38
+
27
39
  ### Verified Change
28
40
 
29
41
  `verified_change` is a compact, fail-closed path for a bounded user-visible change with one canonical owner and deterministic proof. It is neither a prose exception nor a new user approval gate.
@@ -88,4 +100,3 @@ For narrow defect work, a repository may use a lightweight bug scope instead of
88
100
 
89
101
  The Bug Lightweight Track does not remove QA, OR, evidence, Brownfield fit or exact approvals required by the target repository.
90
102
  If the bug grows beyond the stated boundary, escalate to normal AGDF gate flow.
91
-
@@ -2,16 +2,14 @@
2
2
 
3
3
  These files were generated from the AGDF source repository for OpenCode.
4
4
 
5
- - `opencode.json` loads the npm plugin `create-agdf` and `.opencode/AGDF.md` as repository instructions.
6
- - AGDF for OpenCode has a global npm/native-skill discoverability layer and this repository-local governance surface.
7
- - The global plugin and skills do not replace `.opencode/AGDF.md`, `.opencode/skills/` or `.agdf/control/`; repository files remain the AGDF source of truth.
8
- - `opencode.json` allows the built-in `question` tool, keeps `edit` and `bash` on `ask` and explicitly allows the generated `agdf-*` skills; global adapters use `agdf-global-*` to avoid same-name masking.
5
+ - The globally installed npm plugin `create-agdf` owns the shared OpenCode runtime surface.
6
+ - A repository is AGDF-active when `.agdf/control/config.json` is valid; this activation does not copy `.opencode/` assets.
7
+ - Global adapters use `agdf-global-*` to avoid same-name masking by supported legacy local `agdf-*` skills.
9
8
  - Preserve an explicit user `permission.question: deny`; AGDF then uses exact textual approval and never interprets OpenCode permission outcomes or auto mode as gate authority.
10
- - `.opencode/skills/` contains native OpenCode skills generated from the canonical AGDF skills.
11
- - For new build/change intent or unclear approval, load `agdf-gate-check` through OpenCode's native `skill` tool.
12
- - Use `npx --yes @agdf/cli@latest opencode-status --json` to distinguish global hook/native-skill configuration, package loadability, session activity and this repository surface.
9
+ - For new build/change intent or unclear approval, load `agdf-global-gate-check` through OpenCode's native `skill` tool.
10
+ - Use `npx --yes @agdf/cli@latest opencode-status --json` to distinguish global hook/native-skill configuration, package loadability, durable activation, legacy compatibility and session activity.
13
11
  - For deterministic ready-gate rendering, prefer an installed `agdf gate-check --approval-envelope`; reserve `agdf gate-check --json` for native-adapter input, automation or audit evidence and use `npx ...@latest` only for bootstrap, refresh or a missing local executable.
14
- - `.opencode/agdf-runtime-contract.md` is the shared gate and output contract.
12
+ - The globally installed runtime contract is the shared gate and output contract.
15
13
 
16
14
  ## Skills
17
15
 
@@ -79,6 +79,7 @@
79
79
  "OR": "Delivery report",
80
80
  "Verified Change": "Verified change",
81
81
  "Quick Task": "Quick task",
82
+ "Compact Delivery": "Compact Delivery",
82
83
  "Block": "Block"
83
84
  },
84
85
  "gateActionTitles": {
@@ -281,6 +282,7 @@
281
282
  "OR": "Lieferbericht",
282
283
  "Verified Change": "Verified Change",
283
284
  "Quick Task": "Quick Task",
285
+ "Compact Delivery": "Kompakte Lieferung",
284
286
  "Block": "Block"
285
287
  },
286
288
  "gateActionTitles": {
@@ -57,7 +57,7 @@ They must not override AGDF gates, approvals or the Runtime Contract.
57
57
  - Approval of one user gate permits work on the next allowed gate artefact or required internal step only. It does not permit implementation unless the approved gate is `TP` and required internal implementation prerequisites are satisfied.
58
58
  - Gates must never be skipped or inferred from urgency, tone, chat history, task wording or an instruction to "start". The next allowed action is always the next unsatisfied gate or internal mandatory step.
59
59
  - Missing control files or missing current-state fields do not forbid the agent from preparing the current allowed artefact. They forbid later-gate work and implementation. For a fresh request, the default allowed work is to draft a minimal UR in the response and request `Approval: UR`. Initialize or write `.agdf/control/` only when the user explicitly asks for durable AGDF control state, the repository already uses `.agdf/control/` as its live working state, or a deterministic CLI/CI setup path is being executed.
60
- - `Approval: UR` permits Brownfield Review after G-00 first, then a Mode/Slice Decision. It never permits implementation by itself.
60
+ - `Approval: UR` permits Brownfield Review after G-00 first. The review records its Mode/Slice Decision in the same internal operation when evidence is sufficient; the user is told that no action is required now. A separate `Mode/Slice Decision` step is fail-closed recovery for incomplete or legacy review state, not a normal user decision. UR approval never permits implementation by itself and does not preselect PRD.
61
61
  - PRD, SD and TP depth is chosen after Brownfield Review through the Mode/Slice Decision, not before existing-system impact is understood.
62
62
  - The Mode/Slice Decision must be visible before any PRD shortcut, Quick Task execution or implementation: record the decision, required next gate, scope reason and evidence in the selected canonical `RUN_STATE.md` or an equivalent linked control artefact.
63
63
  - `Approval: PRD` permits Solution Design drafting, not implementation.
@@ -76,6 +76,9 @@ After an approved and durable UR, perform a lightweight `Brownfield Review` befo
76
76
 
77
77
  This review is not a new user approval gate, not PRD, not SD, not TP and not implementation permission.
78
78
  It is the sizing and routing step that decides how much later gate discipline is actually needed.
79
+ When evidence is sufficient, persist the review and Mode/Slice selection together; do not expose a
80
+ second routine user decision. Keep the standalone Mode/Slice step only for fail-closed recovery when
81
+ the review record is incomplete or legacy.
79
82
 
80
83
  Its output is limited to:
81
84
 
@@ -131,4 +134,3 @@ The `agdf-brownfield-analysis` skill has two explicit modes:
131
134
  - `pre_implementation_analysis`: implementation-preparation analysis after approved durable TP; verifies reuse path, owners, regression risk and fit before `CD+Tests`.
132
135
 
133
136
  Do not mix the modes silently. Name the active mode in Brownfield output.
134
-
@@ -24,6 +24,18 @@ Use this compact output shape when no formal gate artefact is required:
24
24
 
25
25
  Do not add a separate `Quality outlook` line for pure Quick Tasks unless the task became a relevant run.
26
26
 
27
+ ### Quick Task and Compact Delivery
28
+
29
+ Use **Quick Task** for ungated questions, reviews, debugging and eligible narrow fixes that introduce
30
+ no new product semantics or formal artefacts. When an approved UR is followed by a Brownfield Review
31
+ that selects the persisted `quick_task` mode, use **Compact Delivery** as the human-facing label. The
32
+ stored and JSON value remains `quick_task`; Compact Delivery is not a new mode or approval gate.
33
+
34
+ Brownfield Review owns the Mode/Slice selection. A completed review records its decision, scope
35
+ reason, evidence and required next depth in the same internal operation. `Mode/Slice Decision` remains
36
+ only a fail-closed recovery step for incomplete or legacy records and is not a normal second user
37
+ decision.
38
+
27
39
  ### Verified Change
28
40
 
29
41
  `verified_change` is a compact, fail-closed path for a bounded user-visible change with one canonical owner and deterministic proof. It is neither a prose exception nor a new user approval gate.
@@ -88,4 +100,3 @@ For narrow defect work, a repository may use a lightweight bug scope instead of
88
100
 
89
101
  The Bug Lightweight Track does not remove QA, OR, evidence, Brownfield fit or exact approvals required by the target repository.
90
102
  If the bug grows beyond the stated boundary, escalate to normal AGDF gate flow.
91
-
@@ -37,7 +37,7 @@ Do not mix both modes silently. Name the active mode in the output.
37
37
 
38
38
  ## Rules
39
39
  1. Brownfield first: understand the existing codebase before PRD/SD decisions when existing-system impact is possible, and again before implementation.
40
- 2. Brownfield Review after `Approval: UR` is a sizing and routing step. It must visibly decide `quick_task`, `verified_change`, `structured_slice`, `structured_delivery`, or `block` before PRD depth or implementation is chosen.
40
+ 2. Brownfield Review after `Approval: UR` is a sizing and routing step. It must visibly decide `quick_task`, `verified_change`, `structured_slice`, `structured_delivery`, or `block` before PRD depth or implementation is chosen. Persist the completed review and its decision, scope reason, evidence and required next gate in the same internal operation; mark the review `done` only after both the artefact and canonical run projection are complete. An interrupted, incomplete or legacy record stays at fail-closed `Mode/Slice Decision` recovery without another user approval.
41
41
  3. Reuse-before-create: prefer existing modules, services, components, tables, endpoints, tests, and configuration.
42
42
  4. Minimal clean slice: choose the smallest durable intervention, not merely the smallest technical diff.
43
43
  5. No silent parallel structures.
@@ -35,16 +35,17 @@ Skip for routine questions, obvious local fixes and approved implementation with
35
35
  1. Run AGDF gate-check and inspect durable control state.
36
36
  2. Confirm that search is allowed and implementation is not occurring during exploration.
37
37
  3. Declare the active surface and its enforcement level.
38
- 4. Invoke the shared CLI runtime:
38
+ 4. Resolve the exact-version surface-local validator using the same ownership rules as `agdf-gate-check`. Do not search `PATH`, query a registry, install a package or invoke `npx ...@latest` during routine planning. If no owned or explicitly configured exact-version validator is available, report `machine_validation: unavailable` or `machine_validation: external_required` and stop the machine-evaluated search.
39
+ 5. Invoke the shared CLI runtime:
39
40
 
40
41
  ```bash
41
- npx --yes @agdf/cli@latest delivery-path-search --surface <surface> --json
42
+ node <surface-local-agdf> delivery-path-search --surface <surface> --json
42
43
  ```
43
44
 
44
45
  Optional AI-native candidate generation is explicit:
45
46
 
46
47
  ```bash
47
- npx --yes @agdf/cli@latest delivery-path-search \
48
+ node <surface-local-agdf> delivery-path-search \
48
49
  --surface codex \
49
50
  --generate-candidates \
50
51
  --json
@@ -52,9 +53,9 @@ npx --yes @agdf/cli@latest delivery-path-search \
52
53
 
53
54
  It supplements the deterministic baseline with at most one bounded generator call. Treat proposals as untrusted until the canonical core validates schema, gate action, scope, duplicates and material diversity. Report generation provenance, budgets, rejections and failure. Never hide deterministic fallback or switch providers automatically.
54
55
 
55
- 5. Treat facts, repository evidence, assumptions and model judgements separately.
56
- 6. Return exactly one recommendation or `no_safe_recommendation`.
57
- 7. Run canonical AGDF gate-check after search. Never translate a recommendation into permission.
56
+ 6. Treat facts, repository evidence, assumptions and model judgements separately.
57
+ 7. Return exactly one recommendation or `no_safe_recommendation`.
58
+ 8. Run canonical AGDF gate-check after search. Never translate a recommendation into permission.
58
59
 
59
60
  ## Enforcement
60
61