create-agdf 0.4.1 → 0.4.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 (36) hide show
  1. package/README.md +21 -0
  2. package/bin/create-agdf.js +89 -5
  3. package/generated/.agdf/control/templates/AGDF_RUN.md +1 -0
  4. package/generated/.agdf/control/templates/artefacts/OR.md +1 -0
  5. package/generated/.github/skills/README.md +1 -0
  6. package/generated/.github/skills/agdf-delivery-closeout/SKILL.md +9 -4
  7. package/generated/.github/skills/agdf-delivery-path-search/SKILL.md +75 -0
  8. package/generated/.github/skills/agdf-release-or/SKILL.md +8 -4
  9. package/generated/.github/skills/agdf-runtime-contract.md +24 -0
  10. package/generated/.opencode/AGDF.md +2 -0
  11. package/generated/.opencode/README.md +1 -0
  12. package/generated/.opencode/agdf-runtime-contract.md +24 -0
  13. package/generated/.opencode/agents/agdf-delivery-closeout.md +9 -4
  14. package/generated/.opencode/agents/agdf-delivery-path-search.md +76 -0
  15. package/generated/.opencode/agents/agdf-release-or.md +8 -4
  16. package/generated/AGENTS.md +2 -0
  17. package/generated/plugins/agdf/.codex-plugin/plugin.json +1 -1
  18. package/generated/plugins/agdf/control/templates/AGDF_RUN.md +1 -0
  19. package/generated/plugins/agdf/control/templates/artefacts/OR.md +1 -0
  20. package/generated/plugins/agdf/meta/agdf-agent-router.md +2 -0
  21. package/generated/plugins/agdf/meta/agdf-plugin.definition.json +6 -1
  22. package/generated/plugins/agdf/meta/agdf-runtime-contract.md +24 -0
  23. package/generated/plugins/agdf/skills/delivery-closeout/SKILL.md +9 -4
  24. package/generated/plugins/agdf/skills/delivery-path-search/SKILL.md +75 -0
  25. package/generated/plugins/agdf/skills/delivery-path-search/help.md +5 -0
  26. package/generated/plugins/agdf/skills/release-or/SKILL.md +8 -4
  27. package/lib/delivery-path-search/candidate-policy.js +34 -0
  28. package/lib/delivery-path-search/contracts.js +110 -0
  29. package/lib/delivery-path-search/evaluators/codex.js +67 -0
  30. package/lib/delivery-path-search/evaluators/protocol.js +13 -0
  31. package/lib/delivery-path-search/persistence.js +34 -0
  32. package/lib/delivery-path-search/scoring.js +21 -0
  33. package/lib/delivery-path-search/search-engine.js +92 -0
  34. package/lib/delivery-path-search/state-adapter.js +58 -0
  35. package/lib/delivery-path-search/surfaces/capabilities.js +14 -0
  36. package/package.json +4 -2
package/README.md CHANGED
@@ -149,6 +149,27 @@ The gate check reports `open | blocked`, the current gate, blocking reason, miss
149
149
 
150
150
  Use `gate-check --status-card` for compact interactive output, especially in OpenCode where shell output is highly visible. Keep `gate-check --json` for automation, CI, regression evidence and audit trails.
151
151
 
152
+ Use `delivery-path-search` only for high-impact planning decisions with several materially different next steps:
153
+
154
+ ```bash
155
+ npx --yes @agdf/cli@latest delivery-path-search --surface codex --json
156
+ ```
157
+
158
+ The first release 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 is the executable reference adapter; Claude Code, Copilot and OpenCode reuse the same skill and contracts while declaring whether enforcement is full, tool-enforced or instruction-only.
159
+
160
+ Requirements and boundaries:
161
+
162
+ - run it only in a repository with live `.agdf/control/AGDF_RUN.md` state
163
+ - the current control state must expose legal next actions
164
+ - Codex CLI must be installed and authenticated for `--surface codex`
165
+ - `--model <id>` optionally selects the Codex evaluator model
166
+ - `--persist` writes redacted `DELIVERY_PATH_SEARCH.json` and `.md` evidence under the current scope
167
+ - `--fixture <path>` is for deterministic contract tests, not a production evaluator
168
+ - Claude Code, Copilot and OpenCode have shared workflow mappings but no executable native evaluator in this release
169
+ - cost units are rubric values used for bounded comparison, not measured provider currency
170
+
171
+ The result is either one recommendation or `no_safe_recommendation`. In both cases run canonical `gate-check` afterwards.
172
+
152
173
  `gate-check --json` and `delivery-map --json` also expose a `status_card` object. It is a compact projection of the current control state: current gate, allowed and forbidden actions, blocker, next skill, next permissible step and `quality_outlook`. `next_step` is process permission; `quality_outlook` is the next meaningful quality-improvement focus and does not unlock gates.
153
174
 
154
175
  Together, `init`, `doctor` and `gate-check --json` turn AGDF from an instruction layer into a repository control system when durable control state is needed. For normal fresh requests, keep the path lighter: draft the minimal UR in the response, request `Approval: UR`, and use CLI validators only when machine-readable proof is useful.
@@ -6,6 +6,12 @@ import { homedir } from "node:os";
6
6
  import { dirname, join, posix, resolve } from "node:path";
7
7
  import { fileURLToPath } from "node:url";
8
8
  import process from "node:process";
9
+ import { searchInputFromControl } from "../lib/delivery-path-search/state-adapter.js";
10
+ import { runDeliveryPathSearch } from "../lib/delivery-path-search/search-engine.js";
11
+ import { codexEvaluator } from "../lib/delivery-path-search/evaluators/codex.js";
12
+ import { fixtureEvaluator } from "../lib/delivery-path-search/evaluators/protocol.js";
13
+ import { enforcementForSurface } from "../lib/delivery-path-search/surfaces/capabilities.js";
14
+ import { persistSearchResult } from "../lib/delivery-path-search/persistence.js";
9
15
 
10
16
  const __dirname = dirname(fileURLToPath(import.meta.url));
11
17
  const packageRoot = resolve(__dirname, "..");
@@ -15,7 +21,7 @@ const pluginDefinition = JSON.parse(readFileSync(pluginDefinitionPath, "utf8"));
15
21
  const pluginInstallCommand = "npx --yes @agdf/cli@latest claude";
16
22
  const npmCommand = process.platform === "win32" ? process.execPath : "npm";
17
23
  const npmPrefixArgs = process.platform === "win32" ? [join(dirname(process.execPath), "node_modules", "npm", "bin", "npm-cli.js")] : [];
18
- const allowedTargets = new Set(["codex", "codex-repo", "claude", "copilot", "opencode", "opencode-status", "opencode-repo", "both", "init", "config", "doctor", "gate-check", "delivery-map"]);
24
+ const allowedTargets = new Set(["codex", "codex-repo", "claude", "copilot", "opencode", "opencode-status", "opencode-repo", "both", "init", "config", "doctor", "gate-check", "delivery-map", "delivery-path-search"]);
19
25
  const agdfFragmentPath = "AGENTS.agdf.md";
20
26
  const openCodeConfigFragmentPath = "opencode.agdf.json";
21
27
  const userGateOrder = ["UR", "PRD", "SD", "TP", "QA", "UAT"];
@@ -168,6 +174,7 @@ Preferred AGDF CLI:
168
174
  npx --yes @agdf/cli@latest init
169
175
  npx --yes @agdf/cli@latest doctor
170
176
  npx --yes @agdf/cli@latest gate-check --json
177
+ npx --yes @agdf/cli@latest delivery-path-search --surface codex --json
171
178
 
172
179
  Scaffold-compatible npm create usage:
173
180
  npm create agdf@latest -- codex
@@ -183,6 +190,7 @@ Scaffold-compatible npm create usage:
183
190
  npm create agdf@latest -- doctor
184
191
  npm create agdf@latest -- gate-check
185
192
  npm create agdf@latest -- delivery-map
193
+ npm create agdf@latest -- delivery-path-search --surface codex
186
194
 
187
195
  Backward-compatible create-agdf usage:
188
196
  npx --yes create-agdf@latest doctor --json
@@ -194,8 +202,14 @@ Options:
194
202
  --language <de|en>
195
203
  Set AGDF chat and artefact language. Defaults to detected system locale.
196
204
  --lang <de|en> Alias for --language
197
- --json Print doctor, gate-check or delivery-map output as JSON
205
+ --json Print machine-readable command output as JSON
198
206
  --status-card Print compact gate-check status-card output for interactive use
207
+ --surface <codex|claude|copilot|opencode|generic>
208
+ Declare the active Delivery Path Search surface
209
+ --fixture <path>
210
+ Use deterministic evaluator/candidate fixtures instead of a live evaluator
211
+ --persist Persist the redacted Delivery Path Search result under the current scope
212
+ --model <id> Optional Codex evaluator model
199
213
  --help Show this help
200
214
  `);
201
215
  }
@@ -260,6 +274,10 @@ function parseArgs(argv) {
260
274
  let statusCard = false;
261
275
  let language;
262
276
  let dirExplicit = false;
277
+ let surface = "generic";
278
+ let fixture;
279
+ let persist = false;
280
+ let model;
263
281
 
264
282
  for (let i = 0; i < args.length; i += 1) {
265
283
  const arg = args[i];
@@ -285,6 +303,29 @@ function parseArgs(argv) {
285
303
  continue;
286
304
  }
287
305
 
306
+ if (arg === "--persist") {
307
+ persist = true;
308
+ continue;
309
+ }
310
+
311
+ if (["--surface", "--fixture", "--model"].includes(arg)) {
312
+ const next = args[i + 1];
313
+ if (!next) {
314
+ console.error(`Missing value for ${arg}`);
315
+ process.exit(1);
316
+ }
317
+ if (arg === "--surface") {
318
+ if (!["codex", "claude", "copilot", "opencode", "generic"].includes(next)) {
319
+ console.error("Unsupported surface. Use codex, claude, copilot, opencode or generic.");
320
+ process.exit(1);
321
+ }
322
+ surface = next;
323
+ } else if (arg === "--fixture") fixture = next;
324
+ else model = next;
325
+ i += 1;
326
+ continue;
327
+ }
328
+
288
329
  if (arg === "--language" || arg === "--lang") {
289
330
  const next = args[i + 1];
290
331
  if (!next) {
@@ -334,7 +375,7 @@ function parseArgs(argv) {
334
375
  }
335
376
 
336
377
  if (!target || !allowedTargets.has(target)) {
337
- console.error("Please choose one target: codex, codex-repo, claude, copilot, opencode, opencode-status, opencode-repo, both, init, config, doctor, gate-check or delivery-map.");
378
+ console.error("Please choose one target: codex, codex-repo, claude, copilot, opencode, opencode-status, opencode-repo, both, init, config, doctor, gate-check, delivery-map or delivery-path-search.");
338
379
  printUsage();
339
380
  process.exit(1);
340
381
  }
@@ -347,6 +388,10 @@ function parseArgs(argv) {
347
388
  statusCard,
348
389
  dirExplicit,
349
390
  language: resolveLanguagePreference(language),
391
+ surface,
392
+ fixture: fixture ? resolve(process.cwd(), fixture) : null,
393
+ persist,
394
+ model,
350
395
  };
351
396
  }
352
397
 
@@ -1956,7 +2001,35 @@ function printDeliveryMapReport(report, json) {
1956
2001
  }
1957
2002
  }
1958
2003
 
1959
- function main() {
2004
+ async function executeDeliveryPathSearch(options) {
2005
+ const fixture = options.fixture ? JSON.parse(readFileSync(options.fixture, "utf8")) : null;
2006
+ const enforcement = fixture?.input?.enforcement ?? enforcementForSurface(options.surface);
2007
+ const input = fixture?.input ?? searchInputFromControl(options.dir, { enforcement });
2008
+ const evaluator = fixture
2009
+ ? fixtureEvaluator(fixture.evaluations ?? {})
2010
+ : options.surface === "codex"
2011
+ ? codexEvaluator({ cwd: options.dir, model: options.model })
2012
+ : null;
2013
+ if (!evaluator) {
2014
+ throw new Error(`${options.surface} has no executable evaluator in this release. Codex is the reference adapter; --fixture is available for deterministic contract testing.`);
2015
+ }
2016
+ const result = await runDeliveryPathSearch(input, evaluator, { candidates: fixture?.candidates });
2017
+ if (options.persist) result.persistence = persistSearchResult(options.dir, result);
2018
+ if (options.json) {
2019
+ console.log(JSON.stringify(result, null, 2));
2020
+ return result;
2021
+ }
2022
+ console.log(`AGDF Delivery Path Search: ${result.status}`);
2023
+ console.log(`Current gate: ${result.current_gate}`);
2024
+ console.log(`Enforcement: ${result.enforcement.level}`);
2025
+ console.log(`Recommendation: ${result.recommendation?.action ?? "none"}`);
2026
+ console.log(`Evaluations: ${result.budgets.evaluations}`);
2027
+ console.log(`Stopping reason: ${result.stopping_reason}`);
2028
+ console.log(result.next_gate_action);
2029
+ return result;
2030
+ }
2031
+
2032
+ async function main() {
1960
2033
  const options = parseArgs(process.argv.slice(2));
1961
2034
 
1962
2035
  if (options.target === "doctor") {
@@ -1977,6 +2050,17 @@ function main() {
1977
2050
  process.exit(report.status === "block" ? 2 : 0);
1978
2051
  }
1979
2052
 
2053
+ if (options.target === "delivery-path-search") {
2054
+ try {
2055
+ const result = await executeDeliveryPathSearch(options);
2056
+ process.exitCode = result.status === "recommendation" ? 0 : 2;
2057
+ } catch (error) {
2058
+ console.error(`Delivery Path Search failed: ${error.message}`);
2059
+ process.exitCode = 2;
2060
+ }
2061
+ return;
2062
+ }
2063
+
1980
2064
  if (options.target === "opencode-status") {
1981
2065
  const configDir = process.env.OPENCODE_CONFIG_DIR || defaultOpenCodeConfigDir();
1982
2066
  const report = evaluateOpenCodeStatus(options.dir, configDir);
@@ -2038,4 +2122,4 @@ function main() {
2038
2122
  printNextSteps(options.target, options.dir, files, wroteAgentsFragment, wroteOpenCodeConfigFragment);
2039
2123
  }
2040
2124
 
2041
- main();
2125
+ await main();
@@ -117,6 +117,7 @@ Keep the active work item traceable. A gate may open only when the previous gate
117
117
 
118
118
  - context_graph_impact: `none | link_only | update_existing_node | new_node_required | sot_drift`
119
119
  - context_graph_refs:
120
+ - context_graph_reconciliation: `resolved | not_applicable | open_gap`
120
121
  - context_graph_required_action: `none | link | update | create | resolve_drift`
121
122
  - context_graph_gate_effect: `none | warning | revise | block`
122
123
  - context_graph_evidence:
@@ -81,6 +81,7 @@ This is a compact projection of the control state. It does not replace gate-chec
81
81
 
82
82
  - context_graph_impact: `none | link_only | update_existing_node | new_node_required | sot_drift`
83
83
  - context_graph_refs:
84
+ - context_graph_reconciliation: `resolved | not_applicable | open_gap`
84
85
  - context_graph_required_action: `none | link | update | create | resolve_drift`
85
86
  - context_graph_gate_effect: `none | warning | revise | block`
86
87
  - context_graph_evidence:
@@ -8,6 +8,7 @@ These repository skills were generated from the AGDF source repository and are i
8
8
  - `agdf-clean-implementation-review`
9
9
  - `agdf-code-review`
10
10
  - `agdf-delivery-closeout`
11
+ - `agdf-delivery-path-search`
11
12
  - `agdf-gate-check`
12
13
  - `agdf-qa-gate`
13
14
  - `agdf-release-or`
@@ -32,6 +32,7 @@ Use `../agdf-runtime-contract.md` for closeout discipline, gate terms, Context G
32
32
  4. `Approval: UAT` unlocks an active commit offer when code changes exist.
33
33
  5. No commit handoff for runs without code changes.
34
34
  6. Always include exactly one next step and one quality outlook.
35
+ 7. If OR, QA or current run state reports `context_graph_reconciliation: open_gap`, do not provide a clean commit-ready handoff; set the next step to resolve or explicitly retain the Context Graph gap.
35
36
 
36
37
  ## When To Use
37
38
  - after `QA pass` with code changes
@@ -62,8 +63,10 @@ If code-change status is unclear, do not claim a commit handoff.
62
63
  - `uat_approved_with_code`
63
64
  - `uat_approved_without_code`
64
65
  - `non_delivery_closeout`
65
- 2. Derive Git handoff only when code changes exist.
66
- 3. Set exactly one next delivery step:
66
+ 2. Check Context Graph reconciliation from OR, QA, review and current run state.
67
+ 3. If reconciliation is `open_gap`, report the delivery status as not cleanly handoff-ready and do not derive commit-ready Git text.
68
+ 4. Derive Git handoff only when code changes exist and no unresolved Context Graph gap remains.
69
+ 5. Set exactly one next delivery step:
67
70
  - offer commit
68
71
  - offer push
69
72
  - offer PR
@@ -71,13 +74,15 @@ If code-change status is unclear, do not claim a commit handoff.
71
74
  - run QA/review
72
75
  - obtain UAT/approval
73
76
  - perform documentation follow-up
74
- 4. Set quality outlook:
77
+ - resolve Context Graph gap
78
+ 6. Set quality outlook:
75
79
  - no further technical follow-up
76
80
  - more tests
77
81
  - refactoring
78
82
  - documentation sharpening
79
83
  - monitoring/runtime verification
80
- 5. If `Approval: UAT` exists and code changes were delivered, actively offer the commit but do not run it.
84
+ - Context Graph reconciliation
85
+ 7. If `Approval: UAT` exists, code changes were delivered, and no Context Graph gap remains, actively offer the commit but do not run it.
81
86
 
82
87
  ## Output
83
88
  For code-changing runs:
@@ -0,0 +1,75 @@
1
+ ---
2
+ name: agdf-delivery-path-search
3
+ description: Use this skill for high-impact planning decisions when several materially different next delivery steps are plausible and comparing scope, risk, evidence, tests, cost and gate readiness would reduce expensive rework. Do not use for routine tasks, during implementation, or as gate permission.
4
+ ---
5
+
6
+ # Delivery Path Search
7
+
8
+ ## Purpose
9
+
10
+ Search a bounded set of possible delivery paths before implementation and return one safest evidence-backed next step.
11
+
12
+ The search is advisory and read-only. Canonical AGDF `agdf-gate-check` remains the only authority for whether the recommended step may proceed.
13
+
14
+ ## Runtime Contract
15
+
16
+ Use `../agdf-runtime-contract.md` for canonical gate state, output discipline and Delivery Path Search boundaries. This skill must not maintain a second gate or scoring model.
17
+
18
+ ## Trigger
19
+
20
+ Use only when at least one applies:
21
+
22
+ - high product, architecture, security, policy, persistence or release impact
23
+ - several materially different next actions are plausible
24
+ - a wrong decision would cause expensive rework
25
+ - the best evidence-gathering or test action is unclear
26
+
27
+ Skip for routine questions, obvious local fixes and approved implementation with one clear next action.
28
+
29
+ ## Workflow
30
+
31
+ 1. Run AGDF gate-check and inspect durable control state.
32
+ 2. Confirm that search is allowed and implementation is not occurring during exploration.
33
+ 3. Declare the active surface and its enforcement level.
34
+ 4. Invoke the shared CLI runtime:
35
+
36
+ ```bash
37
+ npx --yes @agdf/cli@latest delivery-path-search --surface <surface> --json
38
+ ```
39
+
40
+ 5. Treat facts, repository evidence, assumptions and model judgements separately.
41
+ 6. Return exactly one recommendation or `no_safe_recommendation`.
42
+ 7. Run canonical AGDF gate-check after search. Never translate a recommendation into permission.
43
+
44
+ ## Enforcement
45
+
46
+ Report exactly one:
47
+
48
+ - `full`: trusted lifecycle controls prevent writes
49
+ - `tool_enforced`: the evaluator receives read/evaluation tools only
50
+ - `instruction_only`: write prevention is instructional and not technically proven
51
+
52
+ Do not overstate the surface's guarantee.
53
+
54
+ ## Output
55
+
56
+ Keep chat output compact:
57
+
58
+ - recommendation or `no_safe_recommendation`
59
+ - current gate
60
+ - enforcement level
61
+ - decisive evidence and assumptions
62
+ - rejected alternatives and reasons
63
+ - budgets and stopping reason
64
+ - next AGDF gate action
65
+
66
+ Persist only the redacted decision summary when durable evidence is required. Do not persist raw prompts, hidden reasoning, secrets or source snapshots.
67
+
68
+ ## Boundaries
69
+
70
+ - This is bounded Delivery Path Search, not MCTS.
71
+ - Do not modify repository files during search.
72
+ - Do not execute evaluator-returned commands.
73
+ - Do not invent default scores for invalid evaluator output.
74
+ - Do not implement, approve or release based on search output.
75
+ - Do not create agent-specific scoring, gate logic or skill copies.
@@ -44,6 +44,8 @@ Use the Runtime Contract definition of `Relevant Run` to decide whether OR is ma
44
44
  10. `CD+Tests` is not completion.
45
45
  11. When moving a backlog item to Completed or Superseded, use the canonical human-readable table and link the final OR with a document-relative Markdown link.
46
46
  12. Keep machine status normalization in the CLI; do not write internal snake_case status values into the human-facing backlog.
47
+ 13. Reconcile Context Graph impact before clean closeout: report `context_graph_reconciliation: resolved | not_applicable | open_gap`.
48
+ 14. If Context Graph work remains unresolved, report it as an explicit open gap and do not describe the run as cleanly handoff-ready.
47
49
 
48
50
  ## When To Use
49
51
  - at the end of every relevant run
@@ -89,10 +91,11 @@ If information is missing, state the gap instead of guessing.
89
91
  6. Summarize Brownfield fit and solution integrity if reviewed.
90
92
  7. Summarize tests and verification.
91
93
  8. Summarize documentation and Context Graph impact if relevant.
92
- 9. Name retained fallbacks and exit criteria.
93
- 10. Set exactly one next permissible step.
94
- 11. Set exactly one quality outlook.
95
- 12. State whether `agdf-delivery-closeout` is the next operational handoff step when code changes exist and the delivery state allows it.
94
+ 9. Record Context Graph reconciliation as `resolved`, `not_applicable`, or `open_gap`.
95
+ 10. Name retained fallbacks and exit criteria.
96
+ 11. Set exactly one next permissible step.
97
+ 12. Set exactly one quality outlook.
98
+ 13. State whether `agdf-delivery-closeout` is the next operational handoff step when code changes exist and the delivery state allows it.
96
99
 
97
100
  ## Output
98
101
  Use a compact structure:
@@ -114,6 +117,7 @@ Use a compact structure:
114
117
  ```
115
118
 
116
119
  When Context Graph impact is relevant, include the fields from `../agdf-runtime-contract.md`.
120
+ Include `context_graph_reconciliation` whenever Context Graph impact is present. If the value is `open_gap`, required next step must resolve or explicitly retain that gap before commit-ready or release-ready handoff.
117
121
 
118
122
  ## Forbidden
119
123
  This skill must not:
@@ -52,6 +52,18 @@ It must not introduce a second gate model or override `agdf-gate-check`, `delive
52
52
 
53
53
  `quality_outlook` must not unlock gates, imply QA pass, or substitute for missing evidence.
54
54
 
55
+ ## Delivery Path Search
56
+
57
+ Delivery Path Search is an optional read-only planning step for high-impact decisions with several materially different next actions.
58
+
59
+ - It consumes current AGDF state and must reject gate-illegal candidates before model evaluation.
60
+ - It returns one advisory recommendation or `no_safe_recommendation`.
61
+ - It must report budgets, stopping reason and `full | tool_enforced | instruction_only` enforcement.
62
+ - Model scores are judgements, not measurements.
63
+ - Search output is evidence only. Canonical `agdf-gate-check` independently decides what may proceed.
64
+ - The bounded first-release algorithm must not be labelled MCTS.
65
+ - Surface adapters may translate transport and presentation, but must not fork scoring, search or gate semantics.
66
+
55
67
  The field names above are the stable machine-readable contract used by JSON
56
68
  reports and automation. Human-facing Markdown must present the same projection
57
69
  with readable labels such as `Current gate`, `Allowed now`, `Blocked by`,
@@ -254,6 +266,7 @@ When a run affects project memory or a Context Graph, use:
254
266
  - `Situation:` short plain-language summary when the impact is non-trivial
255
267
  - `context_graph_impact`: `none | link_only | update_existing_node | new_node_required | sot_drift`
256
268
  - `context_graph_refs`
269
+ - `context_graph_reconciliation`: `resolved | not_applicable | open_gap`
257
270
  - `context_graph_required_action`: `none | link | update | create | resolve_drift`
258
271
  - `context_graph_gate_effect`: `none | warning | revise | block`
259
272
  - `context_graph_evidence`
@@ -261,6 +274,17 @@ When a run affects project memory or a Context Graph, use:
261
274
  Do not create a new node for a mere version, a general chat summary, or a local observation without a concrete next clean step.
262
275
  `sot_drift` must not pass silently as a warning.
263
276
 
277
+ ### Context Graph Reconciliation
278
+
279
+ Relevant-run closeout must reconcile Context Graph impact before presenting a clean delivery handoff.
280
+
281
+ - Use `not_applicable` only when `context_graph_impact: none` and no durable graph knowledge is claimed.
282
+ - Use `resolved` when required graph work is complete and concrete refs are present.
283
+ - Use `open_gap` when graph work remains pending, refs are missing, or a node/update must still be curated.
284
+ - `link`, `update`, `create` and `resolve_drift` require either `resolved` evidence or an explicit `open_gap`.
285
+ - Resolved `link_only`, `update_existing_node` and `new_node_required` states require concrete `context_graph_refs`; `none`, empty refs or vague future-action language are not enough.
286
+ - OR and delivery-closeout must not present commit-ready, release-ready or otherwise clean handoff while `context_graph_reconciliation: open_gap` remains.
287
+
264
288
  ## Control Scaffold
265
289
 
266
290
  When a repository needs durable AGDF state, use the plugin-local `control/` scaffold as the starting point.
@@ -11,6 +11,7 @@ OpenCode project agents do not have a plugin namespace.
11
11
 
12
12
  Therefore generated OpenCode agent names use the AGDF prefix:
13
13
 
14
+ - `agdf-delivery-path-search`
14
15
  - `agdf-brownfield-analysis`
15
16
  - `agdf-clean-implementation-review`
16
17
  - `agdf-code-review`
@@ -48,6 +49,7 @@ Structured Delivery Mode must respect gates, reviews and closeout discipline.
48
49
  ## Skill Routing
49
50
  | Skill | Use For | Boundary |
50
51
  |---|---|---|
52
+ | `agdf-delivery-path-search` | high-impact planning decisions with several plausible next delivery steps before implementation | read-only advisory search; never grants gate permission or replaces gate-check |
51
53
  | `agdf-brownfield-analysis` | after gate-check permits Brownfield Review or implementation preparation, before non-trivial changes in existing systems | clarifies reuse, owners, risks and Mode/Slice Decision; never bypasses gate-check; Brownfield Review is not implementation permission |
52
54
  | `agdf-clean-implementation-review` | inspect workarounds, fallbacks, parallel structures or symptom fixes | not a TP or QA substitute |
53
55
  | `agdf-code-review` | mandatory CR step after code changes, focused on defects, regression and security findings | does not replace TP review, clean review or QA |
@@ -19,6 +19,7 @@ These files were generated from the AGDF source repository for OpenCode.
19
19
  - `agdf-clean-implementation-review`
20
20
  - `agdf-code-review`
21
21
  - `agdf-delivery-closeout`
22
+ - `agdf-delivery-path-search`
22
23
  - `agdf-gate-check`
23
24
  - `agdf-qa-gate`
24
25
  - `agdf-release-or`
@@ -52,6 +52,18 @@ It must not introduce a second gate model or override `agdf-gate-check`, `delive
52
52
 
53
53
  `quality_outlook` must not unlock gates, imply QA pass, or substitute for missing evidence.
54
54
 
55
+ ## Delivery Path Search
56
+
57
+ Delivery Path Search is an optional read-only planning step for high-impact decisions with several materially different next actions.
58
+
59
+ - It consumes current AGDF state and must reject gate-illegal candidates before model evaluation.
60
+ - It returns one advisory recommendation or `no_safe_recommendation`.
61
+ - It must report budgets, stopping reason and `full | tool_enforced | instruction_only` enforcement.
62
+ - Model scores are judgements, not measurements.
63
+ - Search output is evidence only. Canonical `agdf-gate-check` independently decides what may proceed.
64
+ - The bounded first-release algorithm must not be labelled MCTS.
65
+ - Surface adapters may translate transport and presentation, but must not fork scoring, search or gate semantics.
66
+
55
67
  The field names above are the stable machine-readable contract used by JSON
56
68
  reports and automation. Human-facing Markdown must present the same projection
57
69
  with readable labels such as `Current gate`, `Allowed now`, `Blocked by`,
@@ -254,6 +266,7 @@ When a run affects project memory or a Context Graph, use:
254
266
  - `Situation:` short plain-language summary when the impact is non-trivial
255
267
  - `context_graph_impact`: `none | link_only | update_existing_node | new_node_required | sot_drift`
256
268
  - `context_graph_refs`
269
+ - `context_graph_reconciliation`: `resolved | not_applicable | open_gap`
257
270
  - `context_graph_required_action`: `none | link | update | create | resolve_drift`
258
271
  - `context_graph_gate_effect`: `none | warning | revise | block`
259
272
  - `context_graph_evidence`
@@ -261,6 +274,17 @@ When a run affects project memory or a Context Graph, use:
261
274
  Do not create a new node for a mere version, a general chat summary, or a local observation without a concrete next clean step.
262
275
  `sot_drift` must not pass silently as a warning.
263
276
 
277
+ ### Context Graph Reconciliation
278
+
279
+ Relevant-run closeout must reconcile Context Graph impact before presenting a clean delivery handoff.
280
+
281
+ - Use `not_applicable` only when `context_graph_impact: none` and no durable graph knowledge is claimed.
282
+ - Use `resolved` when required graph work is complete and concrete refs are present.
283
+ - Use `open_gap` when graph work remains pending, refs are missing, or a node/update must still be curated.
284
+ - `link`, `update`, `create` and `resolve_drift` require either `resolved` evidence or an explicit `open_gap`.
285
+ - Resolved `link_only`, `update_existing_node` and `new_node_required` states require concrete `context_graph_refs`; `none`, empty refs or vague future-action language are not enough.
286
+ - OR and delivery-closeout must not present commit-ready, release-ready or otherwise clean handoff while `context_graph_reconciliation: open_gap` remains.
287
+
264
288
  ## Control Scaffold
265
289
 
266
290
  When a repository needs durable AGDF state, use the plugin-local `control/` scaffold as the starting point.
@@ -32,6 +32,7 @@ Use `../agdf-runtime-contract.md` for closeout discipline, gate terms, Context G
32
32
  4. `Approval: UAT` unlocks an active commit offer when code changes exist.
33
33
  5. No commit handoff for runs without code changes.
34
34
  6. Always include exactly one next step and one quality outlook.
35
+ 7. If OR, QA or current run state reports `context_graph_reconciliation: open_gap`, do not provide a clean commit-ready handoff; set the next step to resolve or explicitly retain the Context Graph gap.
35
36
 
36
37
  ## When To Use
37
38
  - after `QA pass` with code changes
@@ -62,8 +63,10 @@ If code-change status is unclear, do not claim a commit handoff.
62
63
  - `uat_approved_with_code`
63
64
  - `uat_approved_without_code`
64
65
  - `non_delivery_closeout`
65
- 2. Derive Git handoff only when code changes exist.
66
- 3. Set exactly one next delivery step:
66
+ 2. Check Context Graph reconciliation from OR, QA, review and current run state.
67
+ 3. If reconciliation is `open_gap`, report the delivery status as not cleanly handoff-ready and do not derive commit-ready Git text.
68
+ 4. Derive Git handoff only when code changes exist and no unresolved Context Graph gap remains.
69
+ 5. Set exactly one next delivery step:
67
70
  - offer commit
68
71
  - offer push
69
72
  - offer PR
@@ -71,13 +74,15 @@ If code-change status is unclear, do not claim a commit handoff.
71
74
  - run QA/review
72
75
  - obtain UAT/approval
73
76
  - perform documentation follow-up
74
- 4. Set quality outlook:
77
+ - resolve Context Graph gap
78
+ 6. Set quality outlook:
75
79
  - no further technical follow-up
76
80
  - more tests
77
81
  - refactoring
78
82
  - documentation sharpening
79
83
  - monitoring/runtime verification
80
- 5. If `Approval: UAT` exists and code changes were delivered, actively offer the commit but do not run it.
84
+ - Context Graph reconciliation
85
+ 7. If `Approval: UAT` exists, code changes were delivered, and no Context Graph gap remains, actively offer the commit but do not run it.
81
86
 
82
87
  ## Output
83
88
  For code-changing runs:
@@ -0,0 +1,76 @@
1
+ ---
2
+ description: high-impact planning decisions with several plausible next delivery steps before implementation
3
+ mode: subagent
4
+ ---
5
+
6
+ # Delivery Path Search
7
+
8
+ ## Purpose
9
+
10
+ Search a bounded set of possible delivery paths before implementation and return one safest evidence-backed next step.
11
+
12
+ The search is advisory and read-only. Canonical AGDF `agdf-gate-check` remains the only authority for whether the recommended step may proceed.
13
+
14
+ ## Runtime Contract
15
+
16
+ Use `../agdf-runtime-contract.md` for canonical gate state, output discipline and Delivery Path Search boundaries. This skill must not maintain a second gate or scoring model.
17
+
18
+ ## Trigger
19
+
20
+ Use only when at least one applies:
21
+
22
+ - high product, architecture, security, policy, persistence or release impact
23
+ - several materially different next actions are plausible
24
+ - a wrong decision would cause expensive rework
25
+ - the best evidence-gathering or test action is unclear
26
+
27
+ Skip for routine questions, obvious local fixes and approved implementation with one clear next action.
28
+
29
+ ## Workflow
30
+
31
+ 1. Run AGDF gate-check and inspect durable control state.
32
+ 2. Confirm that search is allowed and implementation is not occurring during exploration.
33
+ 3. Declare the active surface and its enforcement level.
34
+ 4. Invoke the shared CLI runtime:
35
+
36
+ ```bash
37
+ npx --yes @agdf/cli@latest delivery-path-search --surface <surface> --json
38
+ ```
39
+
40
+ 5. Treat facts, repository evidence, assumptions and model judgements separately.
41
+ 6. Return exactly one recommendation or `no_safe_recommendation`.
42
+ 7. Run canonical AGDF gate-check after search. Never translate a recommendation into permission.
43
+
44
+ ## Enforcement
45
+
46
+ Report exactly one:
47
+
48
+ - `full`: trusted lifecycle controls prevent writes
49
+ - `tool_enforced`: the evaluator receives read/evaluation tools only
50
+ - `instruction_only`: write prevention is instructional and not technically proven
51
+
52
+ Do not overstate the surface's guarantee.
53
+
54
+ ## Output
55
+
56
+ Keep chat output compact:
57
+
58
+ - recommendation or `no_safe_recommendation`
59
+ - current gate
60
+ - enforcement level
61
+ - decisive evidence and assumptions
62
+ - rejected alternatives and reasons
63
+ - budgets and stopping reason
64
+ - next AGDF gate action
65
+
66
+ Persist only the redacted decision summary when durable evidence is required. Do not persist raw prompts, hidden reasoning, secrets or source snapshots.
67
+
68
+ ## Boundaries
69
+
70
+ - This is bounded Delivery Path Search, not MCTS.
71
+ - Do not modify repository files during search.
72
+ - Do not execute evaluator-returned commands.
73
+ - Do not invent default scores for invalid evaluator output.
74
+ - Do not implement, approve or release based on search output.
75
+ - Do not create agent-specific scoring, gate logic or skill copies.
76
+
@@ -44,6 +44,8 @@ Use the Runtime Contract definition of `Relevant Run` to decide whether OR is ma
44
44
  10. `CD+Tests` is not completion.
45
45
  11. When moving a backlog item to Completed or Superseded, use the canonical human-readable table and link the final OR with a document-relative Markdown link.
46
46
  12. Keep machine status normalization in the CLI; do not write internal snake_case status values into the human-facing backlog.
47
+ 13. Reconcile Context Graph impact before clean closeout: report `context_graph_reconciliation: resolved | not_applicable | open_gap`.
48
+ 14. If Context Graph work remains unresolved, report it as an explicit open gap and do not describe the run as cleanly handoff-ready.
47
49
 
48
50
  ## When To Use
49
51
  - at the end of every relevant run
@@ -89,10 +91,11 @@ If information is missing, state the gap instead of guessing.
89
91
  6. Summarize Brownfield fit and solution integrity if reviewed.
90
92
  7. Summarize tests and verification.
91
93
  8. Summarize documentation and Context Graph impact if relevant.
92
- 9. Name retained fallbacks and exit criteria.
93
- 10. Set exactly one next permissible step.
94
- 11. Set exactly one quality outlook.
95
- 12. State whether `agdf-delivery-closeout` is the next operational handoff step when code changes exist and the delivery state allows it.
94
+ 9. Record Context Graph reconciliation as `resolved`, `not_applicable`, or `open_gap`.
95
+ 10. Name retained fallbacks and exit criteria.
96
+ 11. Set exactly one next permissible step.
97
+ 12. Set exactly one quality outlook.
98
+ 13. State whether `agdf-delivery-closeout` is the next operational handoff step when code changes exist and the delivery state allows it.
96
99
 
97
100
  ## Output
98
101
  Use a compact structure:
@@ -114,6 +117,7 @@ Use a compact structure:
114
117
  ```
115
118
 
116
119
  When Context Graph impact is relevant, include the fields from `../agdf-runtime-contract.md`.
120
+ Include `context_graph_reconciliation` whenever Context Graph impact is present. If the value is `open_gap`, required next step must resolve or explicitly retain that gap before commit-ready or release-ready handoff.
117
121
 
118
122
  ## Forbidden
119
123
  This skill must not: