create-agdf 0.11.3 → 0.12.0

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 (80) hide show
  1. package/README.md +5 -4
  2. package/generated/.agdf/control/templates/MASTER_BACKLOG.md +1 -1
  3. package/generated/.agdf/control/templates/artefacts/BROWNFIELD_REVIEW.md +25 -0
  4. package/generated/.github/skills/agdf-brownfield-analysis/SKILL.md +26 -0
  5. package/generated/.github/skills/agdf-gate-check/SKILL.md +40 -18
  6. package/generated/.github/skills/agdf-interaction-locales.json +50 -0
  7. package/generated/.github/skills/agdf-runtime-contract.md +1 -0
  8. package/generated/.github/skills/contracts/control-scaffold.md +2 -0
  9. package/generated/.github/skills/contracts/gate-transition.md +7 -3
  10. package/generated/.github/skills/contracts/interaction.md +22 -0
  11. package/generated/.github/skills/contracts/modes.md +81 -0
  12. package/generated/.github/skills/contracts/task-target-resolution.md +102 -0
  13. package/generated/.opencode/AGDF.md +2 -0
  14. package/generated/.opencode/agdf-interaction-locales.json +50 -0
  15. package/generated/.opencode/agdf-runtime-contract.md +1 -0
  16. package/generated/.opencode/contracts/control-scaffold.md +2 -0
  17. package/generated/.opencode/contracts/gate-transition.md +7 -3
  18. package/generated/.opencode/contracts/interaction.md +22 -0
  19. package/generated/.opencode/contracts/modes.md +81 -0
  20. package/generated/.opencode/contracts/task-target-resolution.md +102 -0
  21. package/generated/.opencode/skills/agdf-brownfield-analysis/SKILL.md +26 -0
  22. package/generated/.opencode/skills/agdf-gate-check/SKILL.md +40 -18
  23. package/generated/AGENTS.md +1 -0
  24. package/generated/plugins/agdf/.claude-plugin/plugin.json +1 -1
  25. package/generated/plugins/agdf/.codex-plugin/plugin.json +1 -1
  26. package/generated/plugins/agdf/control/templates/MASTER_BACKLOG.md +1 -1
  27. package/generated/plugins/agdf/control/templates/artefacts/BROWNFIELD_REVIEW.md +25 -0
  28. package/generated/plugins/agdf/meta/agdf-agent-router.md +16 -0
  29. package/generated/plugins/agdf/meta/agdf-interaction-locales.json +50 -0
  30. package/generated/plugins/agdf/meta/agdf-plugin.definition.json +2 -1
  31. package/generated/plugins/agdf/meta/agdf-runtime-contract.md +1 -0
  32. package/generated/plugins/agdf/meta/contracts/control-scaffold.md +2 -0
  33. package/generated/plugins/agdf/meta/contracts/gate-transition.md +7 -3
  34. package/generated/plugins/agdf/meta/contracts/interaction.md +22 -0
  35. package/generated/plugins/agdf/meta/contracts/modes.md +81 -0
  36. package/generated/plugins/agdf/meta/contracts/task-target-resolution.md +102 -0
  37. package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/agdf-interaction-locales.json +50 -0
  38. package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/agdf-plugin.definition.json +2 -1
  39. package/generated/plugins/agdf/runtime/create-agdf/lib/cli/command-registry.js +2 -2
  40. package/generated/plugins/agdf/runtime/create-agdf/lib/cli/delivery-path-search-command.js +78 -14
  41. package/generated/plugins/agdf/runtime/create-agdf/lib/control-evaluation/gate-policy.js +14 -7
  42. package/generated/plugins/agdf/runtime/create-agdf/lib/control-evaluation/shared.js +1 -0
  43. package/generated/plugins/agdf/runtime/create-agdf/lib/delivery-path-search/evaluators/claude.js +2 -11
  44. package/generated/plugins/agdf/runtime/create-agdf/lib/delivery-path-search/evaluators/codex.js +2 -11
  45. package/generated/plugins/agdf/runtime/create-agdf/lib/delivery-path-search/evaluators/opencode.js +234 -0
  46. package/generated/plugins/agdf/runtime/create-agdf/lib/delivery-path-search/evaluators/prompt.js +13 -0
  47. package/generated/plugins/agdf/runtime/create-agdf/lib/delivery-path-search/search-engine.js +1 -0
  48. package/generated/plugins/agdf/runtime/create-agdf/lib/delivery-path-search/surfaces/capabilities.js +15 -2
  49. package/generated/plugins/agdf/runtime/create-agdf/lib/interaction-presentation.js +85 -0
  50. package/generated/plugins/agdf/runtime/create-agdf/package.json +6 -2
  51. package/generated/plugins/agdf/runtime/runtime-manifest.json +2 -2
  52. package/generated/plugins/agdf/scripts/check-runtime-integrity.mjs +119 -3
  53. package/generated/plugins/agdf/skills/brownfield-analysis/SKILL.md +26 -0
  54. package/generated/plugins/agdf/skills/gate-check/SKILL.md +40 -18
  55. package/lib/cli/application.js +29 -3
  56. package/lib/cli/command-registry.js +2 -2
  57. package/lib/cli/delivery-path-search-command.js +78 -14
  58. package/lib/control-evaluation/gate-policy.js +14 -7
  59. package/lib/control-evaluation/shared.js +1 -0
  60. package/lib/delivery-path-search/evaluators/claude.js +2 -11
  61. package/lib/delivery-path-search/evaluators/codex.js +2 -11
  62. package/lib/delivery-path-search/evaluators/opencode.js +234 -0
  63. package/lib/delivery-path-search/evaluators/prompt.js +13 -0
  64. package/lib/delivery-path-search/search-engine.js +1 -0
  65. package/lib/delivery-path-search/surfaces/capabilities.js +15 -2
  66. package/lib/installers/opencode.js +341 -10
  67. package/lib/interaction-presentation.js +85 -0
  68. package/lib/lifecycle/operations.js +4 -0
  69. package/lib/live-agent/read-only-structured.js +43 -0
  70. package/lib/proportionality-benchmark/blind-prompt.js +37 -0
  71. package/lib/proportionality-benchmark/contracts.js +120 -0
  72. package/lib/proportionality-benchmark/corpus-loader.js +110 -0
  73. package/lib/proportionality-benchmark/evaluator.js +250 -0
  74. package/lib/proportionality-benchmark/index.js +7 -0
  75. package/lib/proportionality-benchmark/live-recorder.js +100 -0
  76. package/lib/proportionality-benchmark/report.js +51 -0
  77. package/lib/proportionality-benchmark/source-fingerprint.js +30 -0
  78. package/lib/skill-evals/live-recorder.js +3 -26
  79. package/opencode-plugin.js +59 -3
  80. package/package.json +6 -2
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "id": "agdf",
4
- "version": "0.11.3",
4
+ "version": "0.12.0",
5
5
  "displayName": "AI Governance & Delivery Framework",
6
6
  "developerName": "Arndt Gold",
7
7
  "description": "Operating system for governed AI-assisted delivery.",
@@ -59,6 +59,7 @@
59
59
  "opencode": {
60
60
  "skillPrefix": "agdf-",
61
61
  "globalSkillPrefix": "agdf-global-",
62
+ "evaluatorAgentName": "agdf-evaluator",
62
63
  "runtimeContractFileName": "agdf-runtime-contract.md",
63
64
  "instructionsFileName": "AGDF.md",
64
65
  "npmPackage": "create-agdf",
@@ -4,6 +4,7 @@ This manifest indexes the thematic runtime-contract modules used by AGDF skills
4
4
 
5
5
  | Module | Path | Coverage |
6
6
  |---|---|---|
7
+ | Task target resolution | `contracts/task-target-resolution.md` | Primary target authority, evidence/mutation separation, governance derivation, continuation and fail-closed target states |
7
8
  | Gate transitions | `contracts/gate-transition.md` | Source precedence, scope ambiguity, gate rules, Brownfield routing and transition model |
8
9
  | Interaction | `contracts/interaction.md` | Run Status Card, approval orientation, native interaction and locale contracts |
9
10
  | Modes | `contracts/modes.md` | Mode selection, Quick Task, Verified Change, trivial and bug boundaries |
@@ -17,6 +17,8 @@ Delivery Path Search is an optional read-only planning step for high-impact deci
17
17
  - External generation receives only bounded normalized control summaries and references, never secrets, full artefacts, raw prompts, hidden reasoning or source snapshots.
18
18
  - Generator status, provenance, accepted/rejected counts, separate budget use and typed failure must remain visible. Failure retains the deterministic baseline; automatic provider fallback is forbidden.
19
19
  - Codex and Claude Code may provide tool-enforced generator transports. Copilot, OpenCode and generic surfaces remain instruction-only without conforming evidence.
20
+ - OpenCode may provide a tool-enforced evaluator only for an invocation whose capability preflight proves `opencode run --pure --agent`, the owned evaluator agent and effective executable-tool denies. Preflight or transport failure must return `evaluator_unavailable` with `instruction_only` enforcement and point to the existing instruction-only workflow; it must not continue through a weaker subprocess.
21
+ - OpenCode candidate generation remains unavailable.
20
22
 
21
23
  The field names above are the stable machine-readable contract used by JSON
22
24
  reports and automation. Human-facing Markdown must present the same projection
@@ -93,9 +93,13 @@ Mode/Slice Decision rules:
93
93
 
94
94
  - `quick_task`: use only when Brownfield Review shows a narrow local change, no new product semantics beyond the approved UR, no architecture/policy/persistence/contract expansion, and evidence is sufficient to proceed with a small implementation plus relevant checks.
95
95
  - `verified_change`: use only when the compact record can prove one canonical owner, bounded clean-at-baseline paths, no prohibited impact, deterministic propagation/validation and a structured escalation target. It skips later approvals only after every condition is evidenced and machine-validated.
96
- - `structured_slice`: use when some formal artefacts are needed, but they can stay intentionally small and scoped to the approved slice.
97
- - `structured_delivery`: use when the change has broad product, architecture, runtime, policy, persistence, release or cross-owner impact.
98
- - `block`: use when ownership, SoT, impact, evidence or product direction is not clear enough to choose a safe path.
96
+ - `structured_slice` and `structured_delivery`: apply the sole normative `Structured Depth Decision`
97
+ in `modes.md`; this contract owns only the operational transition and does not duplicate its
98
+ trigger or bounded-slice matrix.
99
+ - `block`: use when ownership, SoT, impact, evidence or product direction is not clear enough to
100
+ choose a safe path. A `depth_unresolved` product result is persisted through this existing value
101
+ with `depth_facts_missing | depth_facts_conflicting`, a Brownfield Review evidence link and a
102
+ precise evidence-owner/re-evaluation next action; it never creates a new mode or advances a gate.
99
103
 
100
104
  A Mode/Slice Decision without scope reason and evidence is not recorded. Treat it as missing and keep the next step at `Mode/Slice Decision`.
101
105
 
@@ -338,6 +338,28 @@ repeat the sentence later in the same request. Existing-run status inspection re
338
338
  uses the existing status projection; this branch must not create a second status-card or narration
339
339
  owner.
340
340
 
341
+ ### Task Target Orientation
342
+
343
+ Task-target semantics and ordering live in `task-target-resolution.md`. When target/context
344
+ separation is material, a confirmed target changes, or resolution is unresolved, the agent consumes
345
+ the canonical `task_target_orientation.markdown` verbatim from `renderTaskTargetOrientation` in
346
+ `create-agdf/lib/interaction-presentation.js`.
347
+
348
+ The projection may show the primary target, governance target, evidence sources and working
349
+ directory for a resolved result. For an unresolved result it shows the localized reason and required
350
+ next action. It carries `authorizes: false`, never renders approval controls and never selects or
351
+ derives a target.
352
+
353
+ For a fresh request, render the target orientation before read-only orientation, Scope
354
+ Classification or any gate presentation when it is required. An unresolved result suppresses every
355
+ downstream orientation and gate surface. A resolved result with material target separation may be
356
+ followed by the one applicable downstream surface. Avoid a redundant target block for an obvious
357
+ unchanged target.
358
+
359
+ If the input is incomplete or contradictory, the renderer returns `null`. The agent then fails closed
360
+ to target clarification and must not model-reconstruct Markdown. `gate-check` must not maintain a
361
+ skill-local target-orientation template.
362
+
341
363
  ### Scope Classification Card
342
364
 
343
365
  When `gate-check` classifies a fresh scope as ungated (Quick Task or Trivial Change Boundary),
@@ -36,6 +36,87 @@ reason, evidence and required next depth in the same internal operation. `Mode/S
36
36
  only a fail-closed recovery step for incomplete or legacy records and is not a normal second user
37
37
  decision.
38
38
 
39
+ ### Structured Depth Decision
40
+
41
+ This section is the sole normative owner for choosing between `structured_slice` and
42
+ `structured_delivery`. Apply it only after an approved durable UR, a Brownfield Review of the
43
+ existing-system context, and unchanged evaluation of Quick Task/Compact Delivery and Verified
44
+ Change. A compact path must be ineligible or explicitly escalated, and the decisive depth facts must
45
+ be durably evidenced before a positive structured decision is recorded.
46
+
47
+ Choose `structured_delivery` when any one evidenced full-depth trigger applies:
48
+
49
+ 1. **Authority, policy or security** — a trust or authority boundary, permission, security,
50
+ compliance or normative policy changes, or independent decision owners require coordinated
51
+ approval.
52
+ 2. **Architecture or runtime** — execution, orchestration, durable execution, concurrency, failure
53
+ or recovery boundaries change beyond a local slice.
54
+ 3. **Persistence, data or migration** — persistent schema or meaning changes, data migration,
55
+ irreversible state transition, coordinated cutover, an extended compatibility window or
56
+ non-local rollback is required.
57
+ 4. **External or public contract** — an external API, public CLI behavior, protocol, file format or
58
+ compatibility-sensitive integration contract changes, including independent consumer
59
+ coordination or versioning.
60
+ 5. **Release, deployment or cross-host** — the work needs its own rollout, deployment, rollback,
61
+ feature-flag or release plan, or coordinated activation across hosts, products or operational
62
+ boundaries.
63
+ 6. **Unbounded consumer or owner coordination** — the outcome cannot be delivered as an
64
+ independently acceptable and reversible slice, or consumers or owners require a shared cutover
65
+ or compatibility window.
66
+
67
+ A single trigger is decisive because of its effect, never because of a numeric count.
68
+
69
+ Choose `structured_slice` only when `depth_facts_status` is `complete`, no full-depth trigger is
70
+ evidenced, and all seven bounded-slice checks are positively evidenced as `pass`:
71
+
72
+ | Check ID | Required evidence |
73
+ |---|---|
74
+ | `coherent_outcome` | One coherent user or product outcome has a clear acceptance boundary. |
75
+ | `authority_boundary` | Authority and source of truth are known and no new trust, policy, permission or security boundary is introduced. |
76
+ | `owner_consumer_coordination` | Owners and consumers are identified and coordination stays inside the slice without a shared external cutover. |
77
+ | `full_depth_impacts_absent` | Architecture, runtime, persistence, data, external API, public CLI, release and cross-host effects are evidenced as not full-depth relevant. |
78
+ | `migration_propagation_bounded` | Migration and propagation are bounded, compatible, testable and locally reversible. |
79
+ | `failure_recovery_local` | Failure, recovery and rollback remain controllable inside the slice. |
80
+ | `independently_acceptable` | The slice has independent acceptance signals and hides no unknown later work as a prerequisite. |
81
+
82
+ Multiple files, owners, consumers or derived paths do not fail these checks by themselves. File,
83
+ owner, consumer, task or derived-path counts are not a decision proxy and must never be used as a
84
+ threshold for either structured mode.
85
+
86
+ If a decisive fact is missing or conflicting and no evidenced full-depth trigger already supports
87
+ `structured_delivery`, the product-language result is `depth_unresolved`. This is not a persisted
88
+ mode. Persist the existing Mode/Slice value `block`, use `depth_facts_missing` or
89
+ `depth_facts_conflicting`, name the affected facts and evidence owner where known, link the
90
+ Brownfield Review, forbid later artefacts and implementation, and provide a precise next action for
91
+ evidence completion and Brownfield/Mode-Slice re-evaluation. Unknown facts must not default to
92
+ `structured_delivery`.
93
+
94
+ Positive decisions persist the existing `structured_slice | structured_delivery` value, required
95
+ next gate, a `scope_reason` containing the primary reason code and decisive rationale plus the
96
+ rejected alternative, and evidence linking the complete Structured Depth Evidence. Re-evaluate
97
+ before continuing whenever scope growth reveals a new full-depth trigger.
98
+
99
+ Normalized reason codes are audit and rationale categories, not new modes or gates:
100
+
101
+ - `bounded_structured_slice`
102
+ - `authority_policy_security_depth`
103
+ - `architecture_runtime_depth`
104
+ - `persistence_migration_depth`
105
+ - `external_contract_depth`
106
+ - `release_cross_host_depth`
107
+ - `unbounded_consumer_coordination`
108
+ - `depth_facts_missing`
109
+ - `depth_facts_conflicting`
110
+
111
+ Structured Slice and Structured Delivery use the same existing gate and approval sequence. Their
112
+ difference is artefact depth: Slice artefacts cover only the coherent bounded outcome and its owners,
113
+ contracts, propagation, recovery, tasks and tests; Full Delivery covers every affected authority,
114
+ architecture, runtime, consumer, migration, operational and release boundary.
115
+
116
+ Historical or deterministic benchmark observations are non-authorizing evidence. They do not define
117
+ this policy, retroactively regrade historical runs or prove live-host behavior. A future benchmark
118
+ may apply this policy only with complete, versioned neutral depth facts.
119
+
39
120
  ### Verified Change
40
121
 
41
122
  `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.
@@ -0,0 +1,102 @@
1
+ # AGDF Runtime Contract — Task Target Resolution
2
+
3
+ ## Purpose And Ordering
4
+
5
+ Resolve the user's primary work target before repository activation, Scope Classification, mode
6
+ selection or gate evaluation. Repository governance is downstream of the task target; the current
7
+ working directory, an inspected repository or a source mentioned as evidence must never become the
8
+ work target by accident.
9
+
10
+ The canonical order is:
11
+
12
+ 1. resolve or revalidate the task target;
13
+ 2. derive the governance target from that resolved target;
14
+ 3. activate repository-local AGDF control only for that governance target;
15
+ 4. then apply read-only orientation, Scope Classification, mode selection and gate evaluation.
16
+
17
+ If task-target resolution is unresolved, steps 2–4 and every mutation are forbidden.
18
+
19
+ ## Resolution Result
20
+
21
+ Use one normalized result:
22
+
23
+ - `resolution_state`: `resolved | unresolved`
24
+ - `reason_code`: `explicit_target | continued_target | multiple_plausible_targets |
25
+ target_content_mismatch | target_unavailable | no_reliable_target`
26
+ - `primary_target`: exactly one requested work object when resolved, otherwise empty
27
+ - `evidence_sources`: zero or more mentioned or inspected sources that do not gain mutation authority
28
+ - `working_directory`: execution context only, never target authority by itself
29
+ - `governance_target`: the repository whose control state applies to the primary target, otherwise empty
30
+ - `target_changed`: whether an explicit new target replaced the previously confirmed target
31
+ - `next_action`: required clarification, supply or retry action when unresolved
32
+
33
+ A resolved result requires a non-empty `primary_target` and a reason code of `explicit_target` or
34
+ `continued_target`. An unresolved result requires an empty `primary_target`, an empty
35
+ `governance_target`, one of the four unresolved reason codes and a non-empty `next_action`.
36
+ Contradictory or incomplete results fail closed.
37
+
38
+ ## Target Authority Precedence
39
+
40
+ Resolve in this order:
41
+
42
+ 1. an explicit file, artefact or repository named as the work target in the current user turn;
43
+ 2. a previously confirmed target only when the current turn unambiguously continues the same action,
44
+ object and scope;
45
+ 3. the current repository or working directory only when the request explicitly or deictically asks
46
+ for work on "this project", "this repository" or an equivalent current-scope reference;
47
+ 4. otherwise `no_reliable_target`.
48
+
49
+ An explicit current-turn target always replaces an inherited target. Make the change visible when
50
+ the previous target could otherwise remain plausible.
51
+
52
+ Do not fall back to the working directory, a neighboring file or an evidence source when the
53
+ explicit target is unavailable or its content does not support the requested change.
54
+
55
+ ## Evidence And Mutation Boundary
56
+
57
+ Reading, inspecting, mentioning or relying on a repository or artefact makes it an evidence source,
58
+ not a mutation target. Evidence access never grants mutation authority and never activates that
59
+ repository's AGDF control state.
60
+
61
+ Derive `governance_target` only from:
62
+
63
+ - the repository containing the resolved `primary_target`; or
64
+ - an explicit user statement that a named repository governs the target.
65
+
66
+ An external standalone artefact may have no repository governance target. In that case the router
67
+ continues with the applicable non-repository path; it must not borrow governance from the current
68
+ working directory.
69
+
70
+ ## Continuation And Target Change
71
+
72
+ A confirmed target may continue across related turns only when the current request remains
73
+ unambiguous. Revalidate it before every mutation or gate decision. New explicit target evidence wins.
74
+ New ambiguity ends the inherited binding and produces `multiple_plausible_targets`.
75
+
76
+ When a durable AGDF run exists, its Source And Scope State may record the confirmed target as
77
+ evidence. It does not override a newer explicit user target. Outside a run, continuation remains
78
+ transient conversation state; do not create a global target store or a second run-state owner.
79
+
80
+ ## Fail-Closed States
81
+
82
+ - `multiple_plausible_targets`: more than one work target remains plausible; list the candidates and
83
+ request the smallest clarification.
84
+ - `target_content_mismatch`: the requested content change is not supported by the explicit target's
85
+ observable content; name the mismatch and ask whether the target or requested change should change.
86
+ - `target_unavailable`: the named file, attachment or artefact cannot be inspected; request supply or
87
+ access and offer a visible retry.
88
+ - `no_reliable_target`: neither an explicit target nor an unambiguous continuation exists; request a
89
+ target.
90
+
91
+ These states forbid repository activation, Scope Classification, gate evaluation and mutation.
92
+ Never silently expand scope to make the request fit a different project.
93
+
94
+ ## Presentation Boundary
95
+
96
+ `contracts/interaction.md` owns the visible, non-authorizing Task Target Orientation.
97
+ `create-agdf/lib/interaction-presentation.js` owns its rendering. The renderer projects a normalized
98
+ result; it must not resolve targets, derive governance or become a state store.
99
+
100
+ Show orientation when target/context separation is material, when the target changes, or when the
101
+ result is unresolved. Avoid redundant presentation for an obvious unchanged target. Presentation
102
+ never grants mutation or gate authority.
@@ -58,6 +58,31 @@
58
58
  "escalation": "Escalation triggers",
59
59
  "challenge": "Challenge path"
60
60
  },
61
+ "taskTargetResolution": {
62
+ "title": "AGDF task target",
63
+ "field": "Field",
64
+ "value": "Value",
65
+ "state": "Resolution",
66
+ "resolved": "Resolved",
67
+ "unresolved": "Clarification required",
68
+ "primaryTarget": "Primary target",
69
+ "governanceTarget": "Governance target",
70
+ "evidenceSources": "Evidence sources",
71
+ "workingDirectory": "Working directory",
72
+ "targetChanged": "Target changed",
73
+ "yes": "yes",
74
+ "none": "none",
75
+ "reason": "Reason",
76
+ "nextAction": "Next action",
77
+ "reasonCodes": {
78
+ "explicit_target": "Explicit current-turn target",
79
+ "continued_target": "Confirmed target continued",
80
+ "multiple_plausible_targets": "Multiple plausible work targets",
81
+ "target_content_mismatch": "Requested change mismatches target",
82
+ "target_unavailable": "Named target is unavailable",
83
+ "no_reliable_target": "No reliable work target"
84
+ }
85
+ },
61
86
  "internalStateLabels": {
62
87
  "verifiedChange": "Compact change under review",
63
88
  "verifiedChangeEscalated": "Escalated to structured delivery",
@@ -284,6 +309,31 @@
284
309
  "escalation": "Eskalationsauslöser",
285
310
  "challenge": "Widerspruchspfad"
286
311
  },
312
+ "taskTargetResolution": {
313
+ "title": "AGDF-Arbeitsziel",
314
+ "field": "Feld",
315
+ "value": "Wert",
316
+ "state": "Auflösung",
317
+ "resolved": "Aufgelöst",
318
+ "unresolved": "Klärung erforderlich",
319
+ "primaryTarget": "Primäres Ziel",
320
+ "governanceTarget": "Governance-Ziel",
321
+ "evidenceSources": "Evidenzquellen",
322
+ "workingDirectory": "Arbeitsordner",
323
+ "targetChanged": "Ziel gewechselt",
324
+ "yes": "ja",
325
+ "none": "keines",
326
+ "reason": "Grund",
327
+ "nextAction": "Nächste Aktion",
328
+ "reasonCodes": {
329
+ "explicit_target": "Explizites Ziel im aktuellen Turn",
330
+ "continued_target": "Bestätigtes Ziel wird fortgesetzt",
331
+ "multiple_plausible_targets": "Mehrere plausible Arbeitsziele",
332
+ "target_content_mismatch": "Änderung passt nicht zum Zielinhalt",
333
+ "target_unavailable": "Benanntes Ziel ist nicht verfügbar",
334
+ "no_reliable_target": "Kein belastbares Arbeitsziel"
335
+ }
336
+ },
287
337
  "internalStateLabels": {
288
338
  "verifiedChange": "Kompakte Änderung wird geprüft",
289
339
  "verifiedChangeEscalated": "Eskaliert zu structured delivery",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "id": "agdf",
4
- "version": "0.11.3",
4
+ "version": "0.12.0",
5
5
  "displayName": "AI Governance & Delivery Framework",
6
6
  "developerName": "Arndt Gold",
7
7
  "description": "Operating system for governed AI-assisted delivery.",
@@ -59,6 +59,7 @@
59
59
  "opencode": {
60
60
  "skillPrefix": "agdf-",
61
61
  "globalSkillPrefix": "agdf-global-",
62
+ "evaluatorAgentName": "agdf-evaluator",
62
63
  "runtimeContractFileName": "agdf-runtime-contract.md",
63
64
  "instructionsFileName": "AGDF.md",
64
65
  "npmPackage": "create-agdf",
@@ -27,8 +27,8 @@ export const commandRegistry = Object.freeze([
27
27
  command("gate-check", { local: [" --approval-envelope", " --json"], scaffold: [""], legacy: [" --json"] }),
28
28
  command("delivery-map", { local: [" --json"], scaffold: [""] }),
29
29
  command("delivery-path-search", {
30
- local: [" --surface codex --json", " --surface claude --json"],
31
- scaffold: [" --surface codex", " --surface claude"],
30
+ local: [" --surface codex --json", " --surface claude --json", " --surface opencode --json"],
31
+ scaffold: [" --surface codex", " --surface claude", " --surface opencode"],
32
32
  }),
33
33
  command("run-create", { local: [" --run <run_id>"] }),
34
34
  command("run-migrate", { local: [" [--run <run_id>]"] }),
@@ -3,6 +3,7 @@ import { searchInputFromControl } from '../delivery-path-search/state-adapter.js
3
3
  import { runDeliveryPathSearch } from '../delivery-path-search/search-engine.js';
4
4
  import { codexEvaluator } from '../delivery-path-search/evaluators/codex.js';
5
5
  import { claudeEvaluator } from '../delivery-path-search/evaluators/claude.js';
6
+ import { openCodeEvaluator, preflightOpenCodeEvaluator } from '../delivery-path-search/evaluators/opencode.js';
6
7
  import { fixtureEvaluator } from '../delivery-path-search/evaluators/protocol.js';
7
8
  import { codexGenerator } from '../delivery-path-search/generators/codex.js';
8
9
  import { claudeGenerator } from '../delivery-path-search/generators/claude.js';
@@ -10,12 +11,56 @@ import { fixtureGenerator } from '../delivery-path-search/generators/protocol.js
10
11
  import { enforcementForSurface } from '../delivery-path-search/surfaces/capabilities.js';
11
12
  import { persistSearchResult } from '../delivery-path-search/persistence.js';
12
13
 
13
- export async function executeDeliveryPathSearch(options, io = console) {
14
+ function unavailableOpenCodeResult({ options, preflight, input = null, error = null }) {
15
+ const mutation = error?.code === "OPENCODE_EVALUATOR_MUTATION_DETECTED";
16
+ const attempted = Boolean(input);
17
+ const nextAction = mutation
18
+ ? "Investigate and revert the detected repository mutation before any evaluator fallback or retry."
19
+ : "Repair the reported OpenCode capability and retry, or use the existing instruction-only Delivery Path Search workflow.";
20
+ return {
21
+ contract_version: "1",
22
+ surface: "opencode",
23
+ scope_key: input?.scope_key ?? options.runId ?? null,
24
+ current_gate: input?.current_gate ?? null,
25
+ status: mutation ? "evaluator_error" : "evaluator_unavailable",
26
+ recommendation: null,
27
+ enforcement: enforcementForSurface("opencode"),
28
+ evaluator: {
29
+ name: "opencode",
30
+ preflight: preflight?.code ?? "not_run",
31
+ failure_code: error?.code ?? preflight?.code,
32
+ detail: error?.message ?? preflight?.detail,
33
+ evidence: preflight?.evidence ?? [],
34
+ },
35
+ executable_evaluator: {
36
+ attempted,
37
+ preflight: preflight?.status ?? "failed",
38
+ failure_code: error?.code ?? preflight?.code,
39
+ evidence: preflight?.evidence ?? [],
40
+ },
41
+ stopping_reason: mutation ? "opencode_mutation_detected" : attempted ? "opencode_evaluator_failed" : "opencode_preflight_failed",
42
+ next_action: nextAction,
43
+ next_gate_action: nextAction,
44
+ };
45
+ }
46
+
47
+ export async function executeDeliveryPathSearch(options, io = console, dependencies = {}) {
14
48
  const fixture = options.fixture ? JSON.parse(readFileSync(options.fixture, "utf8")) : null;
15
- const enforcement = fixture?.input?.enforcement ?? enforcementForSurface(options.surface);
49
+ const preflight = !fixture && options.surface === "opencode"
50
+ ? (dependencies.preflightOpenCodeEvaluator ?? preflightOpenCodeEvaluator)({ cwd: options.dir })
51
+ : null;
52
+ if (preflight?.status === "failed") {
53
+ const result = unavailableOpenCodeResult({ options, preflight });
54
+ printDeliveryPathSearchResult(result, options, io);
55
+ return result;
56
+ }
57
+ const enforcement = fixture?.input?.enforcement
58
+ ?? (preflight
59
+ ? enforcementForSurface("opencode", preflight.evidence, { preflight })
60
+ : enforcementForSurface(options.surface));
16
61
  const fixtureGeneration = fixture?.generator_response;
17
62
  const generationEnabled = Boolean(fixtureGeneration || options.generateCandidates);
18
- const baseInput = fixture?.input ?? searchInputFromControl(options.dir, {
63
+ const baseInput = fixture?.input ?? (dependencies.searchInputFromControl ?? searchInputFromControl)(options.dir, {
19
64
  scopeKey: options.runId,
20
65
  enforcement,
21
66
  generation: generationEnabled ? {
@@ -41,9 +86,11 @@ export async function executeDeliveryPathSearch(options, io = console) {
41
86
  ? codexEvaluator({ cwd: options.dir, model: options.model })
42
87
  : options.surface === "claude"
43
88
  ? claudeEvaluator({ cwd: options.dir, model: options.model })
44
- : null;
89
+ : options.surface === "opencode"
90
+ ? (dependencies.openCodeEvaluator ?? openCodeEvaluator)({ cwd: options.dir, model: options.model, preflight })
91
+ : null;
45
92
  if (!evaluator) {
46
- throw new Error(`${options.surface} has no executable evaluator in this release. Codex and Claude are the reference adapters; --fixture is available for deterministic contract testing.`);
93
+ throw new Error(`${options.surface} has no executable evaluator in this release. Codex, Claude and preflight-qualified OpenCode are the executable adapters; --fixture is available for deterministic contract testing.`);
47
94
  }
48
95
  const generator = fixtureGeneration
49
96
  ? fixtureGenerator(fixtureGeneration)
@@ -55,21 +102,38 @@ export async function executeDeliveryPathSearch(options, io = console) {
55
102
  if (options.generateCandidates && !generator) {
56
103
  throw new Error(`${options.surface} has no executable candidate generator; Codex and Claude are tool-enforced reference transports.`);
57
104
  }
58
- const result = await runDeliveryPathSearch(input, evaluator, { candidates: fixture?.candidates, generator });
59
- if (options.persist) result.persistence = persistSearchResult(options.dir, result);
105
+ let result;
106
+ try {
107
+ result = await (dependencies.runDeliveryPathSearch ?? runDeliveryPathSearch)(input, evaluator, { candidates: fixture?.candidates, generator });
108
+ if (!fixture && options.surface === "opencode" && result.budgets?.evaluations === 0) {
109
+ result.enforcement = enforcementForSurface("opencode");
110
+ }
111
+ } catch (error) {
112
+ if (!error?.fatalEvaluator || options.surface !== "opencode") throw error;
113
+ result = unavailableOpenCodeResult({ options, preflight, input, error });
114
+ }
115
+ if (options.persist && ["recommendation", "no_safe_recommendation"].includes(result.status)) {
116
+ result.persistence = (dependencies.persistSearchResult ?? persistSearchResult)(options.dir, result);
117
+ }
118
+ printDeliveryPathSearchResult(result, options, io);
119
+ return result;
120
+ }
121
+
122
+ function printDeliveryPathSearchResult(result, options, io) {
60
123
  if (options.json) {
61
124
  io.log(JSON.stringify(result, null, 2));
62
- return result;
125
+ return;
63
126
  }
64
127
  io.log(`AGDF Delivery Path Search: ${result.status}`);
65
- io.log(`Current gate: ${result.current_gate}`);
128
+ io.log(`Current gate: ${result.current_gate ?? "unknown"}`);
66
129
  io.log(`Enforcement: ${result.enforcement.level}`);
67
130
  io.log(`Recommendation: ${result.recommendation?.action ?? "none"}`);
68
- io.log(`Evaluations: ${result.budgets.evaluations}`);
69
- io.log(`Generation: ${result.generation.status} (${result.generation.accepted}/${result.generation.returned} accepted)`);
70
- io.log(`Generation budget: ${result.generation.cost_units} cost units, ${result.generation.duration_ms} ms`);
71
- if (result.generation.failure_code) io.log(`Generation failure: ${result.generation.failure_code}`);
131
+ if (result.budgets) io.log(`Evaluations: ${result.budgets.evaluations}`);
132
+ if (result.generation) {
133
+ io.log(`Generation: ${result.generation.status} (${result.generation.accepted}/${result.generation.returned} accepted)`);
134
+ io.log(`Generation budget: ${result.generation.cost_units} cost units, ${result.generation.duration_ms} ms`);
135
+ if (result.generation.failure_code) io.log(`Generation failure: ${result.generation.failure_code}`);
136
+ }
72
137
  io.log(`Stopping reason: ${result.stopping_reason}`);
73
138
  io.log(result.next_gate_action);
74
- return result;
75
139
  }
@@ -29,8 +29,9 @@ export function isGateSatisfied(runState, gate) {
29
29
  return isDurableGateArtefactSatisfied(runState, gate);
30
30
  }
31
31
 
32
- function qaRevisionRequired(runState) {
33
- return gateArtefactStatus(runState, "QA").status === "revise";
32
+ function qaNonPassDecision(runState) {
33
+ const status = gateArtefactStatus(runState, "QA").status;
34
+ return status === "revise" || status === "block" ? status : null;
34
35
  }
35
36
 
36
37
  export function transitionDecisionForRunState(runState, verifiedChange = null) {
@@ -233,15 +234,21 @@ export function transitionDecisionForRunState(runState, verifiedChange = null) {
233
234
  };
234
235
  }
235
236
 
236
- if (qaRevisionRequired(runState)) {
237
+ const qaNonPass = qaNonPassDecision(runState);
238
+ if (qaNonPass) {
239
+ const blocked = qaNonPass === "block";
237
240
  return {
238
- status: "open",
241
+ status: blocked ? "blocked" : "open",
239
242
  current_gate: "QA",
240
- blocking_reason: "qa_revise_required",
243
+ blocking_reason: blocked ? "qa_blocked" : "qa_revise_required",
241
244
  missing_approval: "none",
242
- allowed: ["revise the implementation against the QA findings", "refresh CD+Tests and mandatory reviews", "rerun QA with refreshed evidence"],
245
+ allowed: blocked
246
+ ? ["route the blocking QA findings to their authoritative owner", "record the next permitted remediation or upstream decision", "rerun QA only after the blocker is resolved"]
247
+ : ["revise the implementation against the QA findings", "refresh CD+Tests and mandatory reviews", "rerun QA with refreshed evidence"],
243
248
  forbidden: ["request QA approval", "request UAT approval", "release", "claim delivery readiness"],
244
- next_allowed_action: "Resolve the QA revise findings, refresh CD+Tests and reviews, then rerun QA. Do not request Approval: QA from a revise report.",
249
+ next_allowed_action: blocked
250
+ ? "Resolve or route the blocking QA findings through their authoritative owner, then rerun the required delivery steps. Do not request Approval: QA from a block report."
251
+ : "Resolve the QA revise findings, refresh CD+Tests and reviews, then rerun QA. Do not request Approval: QA from a revise report.",
245
252
  };
246
253
  }
247
254
 
@@ -56,6 +56,7 @@ const backlogStatusLabels = new Map([
56
56
  ["blocked", "blocked"],
57
57
  ["awaiting qa", "awaiting_qa"],
58
58
  ["awaiting uat", "awaiting_uat"],
59
+ ["awaiting or", "awaiting_or"],
59
60
  ["completed", "completed"],
60
61
  ["superseded", "superseded"],
61
62
  ["abandoned", "abandoned"],
@@ -1,6 +1,7 @@
1
1
  import { execFileSync } from "node:child_process";
2
2
  import { evaluatorOutputSchema, validateEvaluation } from "../contracts.js";
3
3
  import { guardedExecFileSync } from "../transports/read-only-guard.js";
4
+ import { buildEvaluatorPrompt } from "./prompt.js";
4
5
 
5
6
  export function claudeEvaluator(options = {}) {
6
7
  const claudeBin = options.claudeBin ?? "claude";
@@ -13,17 +14,7 @@ export function claudeEvaluator(options = {}) {
13
14
  name: "claude",
14
15
  metadata: { name: "claude", runtime, model: options.model ?? "configured-default" },
15
16
  async evaluate(input, candidate) {
16
- const prompt = [
17
- "You are an evaluation-only component. Do not use tools, execute commands, or modify files.",
18
- `Return JSON matching contract version ${input.contract_version}.`,
19
- `Objective: ${input.objective}`,
20
- `Current gate: ${input.current_gate}`,
21
- `Candidate id: ${candidate.id}`,
22
- `Candidate action: ${candidate.action}`,
23
- "Score scope_fit, gate_readiness, risk_reduction, evidence_gain, testability, reversibility and cost from 0 to 5.",
24
- "Cost 0 is low and 5 is high. uncertainty is 0 low to 5 high.",
25
- "Keep rationale concise. child_actions must only contain actions permitted by the current gate.",
26
- ].join("\n");
17
+ const prompt = buildEvaluatorPrompt(input, candidate);
27
18
  const args = [
28
19
  "-p", "--disallowedTools", "Edit,Write,Bash",
29
20
  "--output-format", "json", "--json-schema", JSON.stringify(evaluatorOutputSchema()),
@@ -4,6 +4,7 @@ import { tmpdir } from "node:os";
4
4
  import { join } from "node:path";
5
5
  import { evaluatorOutputSchema, validateEvaluation } from "../contracts.js";
6
6
  import { guardedExecFileSync } from "../transports/read-only-guard.js";
7
+ import { buildEvaluatorPrompt } from "./prompt.js";
7
8
 
8
9
  export function codexEvaluator(options = {}) {
9
10
  const codexBin = options.codexBin ?? "codex";
@@ -21,17 +22,7 @@ export function codexEvaluator(options = {}) {
21
22
  const outputPath = join(temp, "output.json");
22
23
  try {
23
24
  writeFileSync(schemaPath, `${JSON.stringify(evaluatorOutputSchema(), null, 2)}\n`, "utf8");
24
- const prompt = [
25
- "You are an evaluation-only component. Do not use tools, execute commands, or modify files.",
26
- `Return JSON matching contract version ${input.contract_version}.`,
27
- `Objective: ${input.objective}`,
28
- `Current gate: ${input.current_gate}`,
29
- `Candidate id: ${candidate.id}`,
30
- `Candidate action: ${candidate.action}`,
31
- "Score scope_fit, gate_readiness, risk_reduction, evidence_gain, testability, reversibility and cost from 0 to 5.",
32
- "Cost 0 is low and 5 is high. uncertainty is 0 low to 5 high.",
33
- "Keep rationale concise. child_actions must only contain actions permitted by the current gate.",
34
- ].join("\n");
25
+ const prompt = buildEvaluatorPrompt(input, candidate);
35
26
  const args = [
36
27
  "exec", "--sandbox", "read-only", "--ephemeral", "--ignore-user-config",
37
28
  "--output-schema", schemaPath, "--output-last-message", outputPath, "--color", "never",