create-agdf 0.7.1 → 0.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/bin/create-agdf.js +3 -2
- package/generated/.github/skills/agdf-gate-check/SKILL.md +32 -0
- package/generated/.github/skills/agdf-runtime-contract.md +57 -0
- package/generated/.opencode/AGDF.md +2 -1
- package/generated/.opencode/README.md +2 -1
- package/generated/.opencode/agdf-runtime-contract.md +57 -0
- package/generated/.opencode/skills/agdf-gate-check/SKILL.md +32 -0
- package/generated/opencode.json +1 -0
- package/generated/plugins/agdf/.codex-plugin/plugin.json +1 -1
- package/generated/plugins/agdf/meta/agdf-plugin.definition.json +31 -1
- package/generated/plugins/agdf/meta/agdf-runtime-contract.md +57 -0
- package/generated/plugins/agdf/skills/gate-check/SKILL.md +32 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -79,7 +79,7 @@ If no language is provided, `create-agdf` derives the preference from the local
|
|
|
79
79
|
- `copilot` writes `AGENTS.md`, Copilot custom instructions under `.github/`, visible repository skills under `.github/skills/`, and AGDF control templates under `.agdf/control/`
|
|
80
80
|
- `opencode` installs the AGDF npm plugin and nine native skills as a user-wide OpenCode surface
|
|
81
81
|
- `opencode-status` reports OpenCode global config, package loadability, global native-skill completeness, session signals and repository surface presence
|
|
82
|
-
- `opencode-repo` writes `opencode.json`, `.opencode/AGDF.md`, prefixed native OpenCode skills under `.opencode/skills/`, explicit edit/bash/skill permissions, and AGDF control templates under `.agdf/control/`
|
|
82
|
+
- `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/`
|
|
83
83
|
- `both` writes the Codex repository-local marketplace plus the Copilot-facing repository files
|
|
84
84
|
- `config` writes or updates only `.agdf/control/config.json` for an already installed plugin or an existing repository
|
|
85
85
|
|
|
@@ -110,9 +110,9 @@ Use the `opencode-repo` target when AGDF should be available to OpenCode from re
|
|
|
110
110
|
npm create agdf@latest -- opencode-repo
|
|
111
111
|
```
|
|
112
112
|
|
|
113
|
-
OpenCode loads the AGDF npm plugin and global native skills from global OpenCode config, plus repository instructions from `.opencode/AGDF.md`, explicit `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`.
|
|
113
|
+
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`.
|
|
114
114
|
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.
|
|
115
|
-
If `opencode.json` already exists, AGDF keeps it unchanged and writes `opencode.agdf.json` as a merge fragment.
|
|
115
|
+
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.
|
|
116
116
|
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.
|
|
117
117
|
|
|
118
118
|
## Control scaffold
|
package/bin/create-agdf.js
CHANGED
|
@@ -514,9 +514,10 @@ function installOpenCodeGlobalPlugin(configDir) {
|
|
|
514
514
|
if (!nextConfig.instructions.includes("AGDF.md")) nextConfig.instructions.push("AGDF.md");
|
|
515
515
|
|
|
516
516
|
if (nextConfig.permission === undefined) {
|
|
517
|
-
nextConfig.permission = { skill: { "agdf-*": "allow" } };
|
|
517
|
+
nextConfig.permission = { question: "allow", skill: { "agdf-*": "allow" } };
|
|
518
518
|
} else if (nextConfig.permission && typeof nextConfig.permission === "object" && !Array.isArray(nextConfig.permission)) {
|
|
519
519
|
nextConfig.permission = { ...nextConfig.permission };
|
|
520
|
+
if (nextConfig.permission.question === undefined) nextConfig.permission.question = "allow";
|
|
520
521
|
if (nextConfig.permission.skill === undefined) {
|
|
521
522
|
nextConfig.permission.skill = { "agdf-*": "allow" };
|
|
522
523
|
} else if (nextConfig.permission.skill && typeof nextConfig.permission.skill === "object" && !Array.isArray(nextConfig.permission.skill)) {
|
|
@@ -1165,7 +1166,7 @@ function printNextSteps(target, destination, files, wroteAgentsFragment, wroteOp
|
|
|
1165
1166
|
}
|
|
1166
1167
|
if (target === "opencode-repo") {
|
|
1167
1168
|
if (wroteOpenCodeConfigFragment) {
|
|
1168
|
-
console.log(`- Existing opencode.json detected.
|
|
1169
|
+
console.log(`- Existing opencode.json detected. Review ${openCodeConfigFragmentPath} and merge its owned entries so OpenCode loads .opencode/AGDF.md; preserve an explicit permission.question decision.`);
|
|
1169
1170
|
}
|
|
1170
1171
|
console.log(`- OpenCode will install the ${pluginDefinition.opencode.npmPackage} npm plugin from opencode.json at startup.`);
|
|
1171
1172
|
console.log("- Optional: also add create-agdf to ~/.config/opencode/opencode.json plugin[] for a user-wide OpenCode hook.");
|
|
@@ -52,6 +52,37 @@ npx --yes @agdf/cli@latest delivery-map --json
|
|
|
52
52
|
|
|
53
53
|
The CLI reports are validators and JSON evidence, not the primary user experience, not a required ritual for normal work and not a second rule system. If a report says `blocked`, do not continue with later-gate artefacts until the reported blocker is resolved.
|
|
54
54
|
|
|
55
|
+
## Native Interaction Path
|
|
56
|
+
|
|
57
|
+
Use the Runtime Contract's Native Interaction Contract to classify every candidate interaction as `clarification`, `tool_permission` or `gate_approval` before selecting a host control.
|
|
58
|
+
|
|
59
|
+
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.
|
|
60
|
+
|
|
61
|
+
For a ready `gate_approval`:
|
|
62
|
+
|
|
63
|
+
1. Resolve exactly one selected run and evaluate the current gate.
|
|
64
|
+
2. Confirm the required durable artefact is present and ready before presenting a question.
|
|
65
|
+
3. Ask exactly one question that names the selected `run_id` and `current_gate`.
|
|
66
|
+
4. Offer the exact approving option `Approval: <GateName>` plus bounded revise and cancel/decline outcomes.
|
|
67
|
+
5. Use the surface adapter declared in the canonical plugin definition only when it can wait for deliberate input without auto-resolution; otherwise request the same exact approval in concise text.
|
|
68
|
+
6. Re-run gate evaluation for the same run and expected gate after the response and immediately before persistence.
|
|
69
|
+
7. 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.
|
|
70
|
+
8. Persist accepted input only through the existing control-state workflow.
|
|
71
|
+
|
|
72
|
+
Make exactly one native-attempt for the ready gate. If the host does not render,
|
|
73
|
+
apply or safely return the native question on that attempt, switch immediately
|
|
74
|
+
to the exact textual approval. Do not ask the user to request the buttons again
|
|
75
|
+
and do not create a retry loop or simulated control.
|
|
76
|
+
|
|
77
|
+
Surface behavior:
|
|
78
|
+
|
|
79
|
+
- Codex: invoke the native short-question/request-user-input control on the first eligible attempt when callable, ask one gate question and omit auto-resolution; if it is not rendered or applied, use exact text immediately.
|
|
80
|
+
- 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.
|
|
81
|
+
- 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.
|
|
82
|
+
- Other, unavailable or non-interactive surfaces: use exact textual approval and wait for a new explicit user response.
|
|
83
|
+
|
|
84
|
+
A free-form response must still exactly match the current gate's approval formula after revalidation. Revise, decline and cancel never advance the gate. Native presentation, host permission and plan approval are inputs or separate authority domains, never durable AGDF authority.
|
|
85
|
+
|
|
55
86
|
## Rules
|
|
56
87
|
1. Fail closed when a required approval or artefact status is missing.
|
|
57
88
|
2. The earliest blocking gate wins.
|
|
@@ -72,6 +103,7 @@ The CLI reports are validators and JSON evidence, not the primary user experienc
|
|
|
72
103
|
17. If multiple active scopes are plausible, list the evidenced competing lines and keep the current step at scope clarification or the earliest common safe gate.
|
|
73
104
|
18. When maintaining `MASTER_BACKLOG.md`, use its canonical compact columns, readable status labels and document-relative Markdown links. Do not expose raw long paths or internal snake_case statuses in the human-facing table. The canonical status/artefact label vocabulary is defined in the AGDF control scaffold's `MASTER_BACKLOG.md` template Rules section; do not invent other labels.
|
|
74
105
|
19. Preserve legacy backlog compatibility through the CLI parser; do not create a second surface-specific backlog format.
|
|
106
|
+
20. Native interaction must follow the Runtime Contract's interaction envelope, readiness check, deliberate-user-input requirement and post-response revalidation boundary.
|
|
75
107
|
|
|
76
108
|
## Gate Evaluation
|
|
77
109
|
|
|
@@ -268,6 +268,63 @@ section or any other existing line.
|
|
|
268
268
|
- `agdf-release-or` reports the run, but does not replace QA or produce the operative commit/PR handoff.
|
|
269
269
|
- `agdf-delivery-closeout` owns the operative Git handoff text when QA/OR/UAT state allows it.
|
|
270
270
|
|
|
271
|
+
## Native Interaction Contract
|
|
272
|
+
|
|
273
|
+
Native host controls improve how a decision is presented; they do not create a second approval model or authority source.
|
|
274
|
+
|
|
275
|
+
Every AGDF interaction belongs to exactly one semantic kind:
|
|
276
|
+
|
|
277
|
+
- `clarification`: asks for missing intent or a choice that does not itself authorize a gated transition.
|
|
278
|
+
- `tool_permission`: requests host-owned authority for a command, file change, network access, external path, app action or comparable technical side effect.
|
|
279
|
+
- `gate_approval`: requests deliberate user input for the one current AGDF user gate after its durable artefact and selected run are ready.
|
|
280
|
+
|
|
281
|
+
The semantic interaction envelope is:
|
|
282
|
+
|
|
283
|
+
```text
|
|
284
|
+
interaction_kind: clarification | tool_permission | gate_approval
|
|
285
|
+
surface: codex | claude | opencode | fallback
|
|
286
|
+
run_id: required for gate_approval
|
|
287
|
+
current_gate: required for gate_approval
|
|
288
|
+
prompt: required
|
|
289
|
+
options: required for a structured question
|
|
290
|
+
effects: required when the interaction can cause side effects
|
|
291
|
+
required_evidence: required for gate_approval
|
|
292
|
+
auto_resolution: forbidden for gate_approval
|
|
293
|
+
response_origin: deliberate_user_input for gate_approval
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
This envelope is not a new persisted record. The selected canonical `RUN_STATE.md` and existing artefact chain remain the durable authority.
|
|
297
|
+
|
|
298
|
+
Before presenting `gate_approval`, the agent must:
|
|
299
|
+
|
|
300
|
+
1. resolve exactly one selected run;
|
|
301
|
+
2. run the canonical gate evaluation and confirm that the current gate's durable artefact is present and ready;
|
|
302
|
+
3. ask exactly one gate question that identifies `run_id` and `current_gate` and offers the exact approving value `Approval: <GateName>` plus bounded revise and cancel/decline outcomes;
|
|
303
|
+
4. wait for deliberate user input without a timeout, default, preselection, hook-supplied answer or agent-to-agent substitute;
|
|
304
|
+
5. re-run canonical gate evaluation against the same `run_id` and expected gate immediately before persistence;
|
|
305
|
+
6. reject missing evidence, ambiguous or wrong run, wrong gate, stale state and any response that is no longer valid;
|
|
306
|
+
7. persist an accepted approval only through the existing control-state workflow.
|
|
307
|
+
|
|
308
|
+
The first eligible native-attempt has a single bounded outcome: the declared
|
|
309
|
+
host control is presented, or the agent immediately uses the exact-text
|
|
310
|
+
fallback. A host that does not apply the control does not trigger a second
|
|
311
|
+
native prompt. AGDF must not simulate or force host-owned presentation.
|
|
312
|
+
|
|
313
|
+
A free-form native response is valid only when the existing exact-approval validator accepts it for the current gate after revalidation. Revise, decline and cancel outcomes never advance a gate.
|
|
314
|
+
|
|
315
|
+
Surface adapter rules:
|
|
316
|
+
|
|
317
|
+
| Surface | Native question adapter | Gate-safe use | Technical permission boundary |
|
|
318
|
+
|---|---|---|---|
|
|
319
|
+
| Codex | native `request_user_input` or equivalent short-question control when callable | on the first eligible attempt, present one gate question with auto-resolution omitted; if unavailable or not applied, use exact text without retry | Codex command, edit, network, external-directory and app-action approvals remain host-owned `tool_permission`. |
|
|
320
|
+
| Claude Code | `AskUserQuestion` | on the first eligible attempt, use only when no timeout can auto-continue and no hook supplies `answers` or `updatedInput`; if unavailable or not applied, use exact text without retry | Claude permissions and `ExitPlanMode` are not AGDF approval. |
|
|
321
|
+
| OpenCode | built-in `question` | use with exact approval/revise/cancel options when `permission.question` permits it; explicit user deny selects exact-text fallback | `once`, `always`, `reject`, permission suggestions and auto mode are technical outcomes only. |
|
|
322
|
+
| Fallback or non-interactive | concise exact text | wait for a new explicit user response; never synthesize or auto-resolve one | Host-specific technical permission remains separate. |
|
|
323
|
+
|
|
324
|
+
Native structured questions are for real decision points. Prefer repository inspection over clarification and do not show them for status reporting, discoverable facts, routine read-only work or repeated non-ready gate prompts.
|
|
325
|
+
|
|
326
|
+
Exact textual approvals remain canonical and fully supported on every surface. If native capability availability or safety is unknown, use the textual fallback. Host permission, plan approval, native question presentation, timeout/default behavior, hook output and agent messages never carry AGDF gate authority by themselves.
|
|
327
|
+
|
|
271
328
|
## Brownfield Review After G-00
|
|
272
329
|
|
|
273
330
|
After an approved and durable UR, perform a lightweight `Brownfield Review` before PRD when Brownfield, UI, UX, admin, runtime, policy, persistence, architecture, ownership or source-of-truth impact is possible.
|
|
@@ -108,6 +108,7 @@ For relevant runs that change durable state, code, artefacts or gate status:
|
|
|
108
108
|
- For new build/change intent or unclear approval, load the `agdf-gate-check` skill before later artefacts or implementation.
|
|
109
109
|
- The AGDF OpenCode plugin is loaded from npm through `opencode.json` `plugin: ["create-agdf"]`.
|
|
110
110
|
- Use `npx --yes @agdf/cli@latest opencode-status --json` to verify global config, package loadability, global native-skill completeness, active session signals and repository surface presence separately.
|
|
111
|
-
- OpenCode permissions keep `edit` and `bash` on explicit approval and allow the generated `agdf-*` skills explicitly; global adapters use the `agdf-global-*` namespace.
|
|
111
|
+
- OpenCode permissions allow the built-in `question` tool, keep `edit` and `bash` on explicit approval and allow the generated `agdf-*` skills explicitly; global adapters use the `agdf-global-*` namespace.
|
|
112
|
+
- An explicit user `permission.question: deny` remains authoritative and selects the exact-text AGDF fallback; never convert an OpenCode permission outcome or auto mode into gate approval.
|
|
112
113
|
- Shared output and gate rules live in `.opencode/agdf-runtime-contract.md`.
|
|
113
114
|
- Do not paste full control files, templates or artefact bodies into chat unless the user explicitly asks for the full content; summarize and link paths instead.
|
|
@@ -5,7 +5,8 @@ These files were generated from the AGDF source repository for OpenCode.
|
|
|
5
5
|
- `opencode.json` loads the npm plugin `create-agdf` and `.opencode/AGDF.md` as repository instructions.
|
|
6
6
|
- AGDF for OpenCode has a global npm/native-skill discoverability layer and this repository-local governance surface.
|
|
7
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` keeps `edit` and `bash` on `ask` and explicitly allows the generated `agdf-*` skills; global adapters use `agdf-global-*` to avoid same-name masking.
|
|
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.
|
|
9
|
+
- 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.
|
|
9
10
|
- `.opencode/skills/` contains native OpenCode skills generated from the canonical AGDF skills.
|
|
10
11
|
- For new build/change intent or unclear approval, load `agdf-gate-check` through OpenCode's native `skill` tool.
|
|
11
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.
|
|
@@ -268,6 +268,63 @@ section or any other existing line.
|
|
|
268
268
|
- `agdf-release-or` reports the run, but does not replace QA or produce the operative commit/PR handoff.
|
|
269
269
|
- `agdf-delivery-closeout` owns the operative Git handoff text when QA/OR/UAT state allows it.
|
|
270
270
|
|
|
271
|
+
## Native Interaction Contract
|
|
272
|
+
|
|
273
|
+
Native host controls improve how a decision is presented; they do not create a second approval model or authority source.
|
|
274
|
+
|
|
275
|
+
Every AGDF interaction belongs to exactly one semantic kind:
|
|
276
|
+
|
|
277
|
+
- `clarification`: asks for missing intent or a choice that does not itself authorize a gated transition.
|
|
278
|
+
- `tool_permission`: requests host-owned authority for a command, file change, network access, external path, app action or comparable technical side effect.
|
|
279
|
+
- `gate_approval`: requests deliberate user input for the one current AGDF user gate after its durable artefact and selected run are ready.
|
|
280
|
+
|
|
281
|
+
The semantic interaction envelope is:
|
|
282
|
+
|
|
283
|
+
```text
|
|
284
|
+
interaction_kind: clarification | tool_permission | gate_approval
|
|
285
|
+
surface: codex | claude | opencode | fallback
|
|
286
|
+
run_id: required for gate_approval
|
|
287
|
+
current_gate: required for gate_approval
|
|
288
|
+
prompt: required
|
|
289
|
+
options: required for a structured question
|
|
290
|
+
effects: required when the interaction can cause side effects
|
|
291
|
+
required_evidence: required for gate_approval
|
|
292
|
+
auto_resolution: forbidden for gate_approval
|
|
293
|
+
response_origin: deliberate_user_input for gate_approval
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
This envelope is not a new persisted record. The selected canonical `RUN_STATE.md` and existing artefact chain remain the durable authority.
|
|
297
|
+
|
|
298
|
+
Before presenting `gate_approval`, the agent must:
|
|
299
|
+
|
|
300
|
+
1. resolve exactly one selected run;
|
|
301
|
+
2. run the canonical gate evaluation and confirm that the current gate's durable artefact is present and ready;
|
|
302
|
+
3. ask exactly one gate question that identifies `run_id` and `current_gate` and offers the exact approving value `Approval: <GateName>` plus bounded revise and cancel/decline outcomes;
|
|
303
|
+
4. wait for deliberate user input without a timeout, default, preselection, hook-supplied answer or agent-to-agent substitute;
|
|
304
|
+
5. re-run canonical gate evaluation against the same `run_id` and expected gate immediately before persistence;
|
|
305
|
+
6. reject missing evidence, ambiguous or wrong run, wrong gate, stale state and any response that is no longer valid;
|
|
306
|
+
7. persist an accepted approval only through the existing control-state workflow.
|
|
307
|
+
|
|
308
|
+
The first eligible native-attempt has a single bounded outcome: the declared
|
|
309
|
+
host control is presented, or the agent immediately uses the exact-text
|
|
310
|
+
fallback. A host that does not apply the control does not trigger a second
|
|
311
|
+
native prompt. AGDF must not simulate or force host-owned presentation.
|
|
312
|
+
|
|
313
|
+
A free-form native response is valid only when the existing exact-approval validator accepts it for the current gate after revalidation. Revise, decline and cancel outcomes never advance a gate.
|
|
314
|
+
|
|
315
|
+
Surface adapter rules:
|
|
316
|
+
|
|
317
|
+
| Surface | Native question adapter | Gate-safe use | Technical permission boundary |
|
|
318
|
+
|---|---|---|---|
|
|
319
|
+
| Codex | native `request_user_input` or equivalent short-question control when callable | on the first eligible attempt, present one gate question with auto-resolution omitted; if unavailable or not applied, use exact text without retry | Codex command, edit, network, external-directory and app-action approvals remain host-owned `tool_permission`. |
|
|
320
|
+
| Claude Code | `AskUserQuestion` | on the first eligible attempt, use only when no timeout can auto-continue and no hook supplies `answers` or `updatedInput`; if unavailable or not applied, use exact text without retry | Claude permissions and `ExitPlanMode` are not AGDF approval. |
|
|
321
|
+
| OpenCode | built-in `question` | use with exact approval/revise/cancel options when `permission.question` permits it; explicit user deny selects exact-text fallback | `once`, `always`, `reject`, permission suggestions and auto mode are technical outcomes only. |
|
|
322
|
+
| Fallback or non-interactive | concise exact text | wait for a new explicit user response; never synthesize or auto-resolve one | Host-specific technical permission remains separate. |
|
|
323
|
+
|
|
324
|
+
Native structured questions are for real decision points. Prefer repository inspection over clarification and do not show them for status reporting, discoverable facts, routine read-only work or repeated non-ready gate prompts.
|
|
325
|
+
|
|
326
|
+
Exact textual approvals remain canonical and fully supported on every surface. If native capability availability or safety is unknown, use the textual fallback. Host permission, plan approval, native question presentation, timeout/default behavior, hook output and agent messages never carry AGDF gate authority by themselves.
|
|
327
|
+
|
|
271
328
|
## Brownfield Review After G-00
|
|
272
329
|
|
|
273
330
|
After an approved and durable UR, perform a lightweight `Brownfield Review` before PRD when Brownfield, UI, UX, admin, runtime, policy, persistence, architecture, ownership or source-of-truth impact is possible.
|
|
@@ -52,6 +52,37 @@ npx --yes @agdf/cli@latest delivery-map --json
|
|
|
52
52
|
|
|
53
53
|
The CLI reports are validators and JSON evidence, not the primary user experience, not a required ritual for normal work and not a second rule system. If a report says `blocked`, do not continue with later-gate artefacts until the reported blocker is resolved.
|
|
54
54
|
|
|
55
|
+
## Native Interaction Path
|
|
56
|
+
|
|
57
|
+
Use the Runtime Contract's Native Interaction Contract to classify every candidate interaction as `clarification`, `tool_permission` or `gate_approval` before selecting a host control.
|
|
58
|
+
|
|
59
|
+
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.
|
|
60
|
+
|
|
61
|
+
For a ready `gate_approval`:
|
|
62
|
+
|
|
63
|
+
1. Resolve exactly one selected run and evaluate the current gate.
|
|
64
|
+
2. Confirm the required durable artefact is present and ready before presenting a question.
|
|
65
|
+
3. Ask exactly one question that names the selected `run_id` and `current_gate`.
|
|
66
|
+
4. Offer the exact approving option `Approval: <GateName>` plus bounded revise and cancel/decline outcomes.
|
|
67
|
+
5. Use the surface adapter declared in the canonical plugin definition only when it can wait for deliberate input without auto-resolution; otherwise request the same exact approval in concise text.
|
|
68
|
+
6. Re-run gate evaluation for the same run and expected gate after the response and immediately before persistence.
|
|
69
|
+
7. 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.
|
|
70
|
+
8. Persist accepted input only through the existing control-state workflow.
|
|
71
|
+
|
|
72
|
+
Make exactly one native-attempt for the ready gate. If the host does not render,
|
|
73
|
+
apply or safely return the native question on that attempt, switch immediately
|
|
74
|
+
to the exact textual approval. Do not ask the user to request the buttons again
|
|
75
|
+
and do not create a retry loop or simulated control.
|
|
76
|
+
|
|
77
|
+
Surface behavior:
|
|
78
|
+
|
|
79
|
+
- Codex: invoke the native short-question/request-user-input control on the first eligible attempt when callable, ask one gate question and omit auto-resolution; if it is not rendered or applied, use exact text immediately.
|
|
80
|
+
- 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.
|
|
81
|
+
- 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.
|
|
82
|
+
- Other, unavailable or non-interactive surfaces: use exact textual approval and wait for a new explicit user response.
|
|
83
|
+
|
|
84
|
+
A free-form response must still exactly match the current gate's approval formula after revalidation. Revise, decline and cancel never advance the gate. Native presentation, host permission and plan approval are inputs or separate authority domains, never durable AGDF authority.
|
|
85
|
+
|
|
55
86
|
## Rules
|
|
56
87
|
1. Fail closed when a required approval or artefact status is missing.
|
|
57
88
|
2. The earliest blocking gate wins.
|
|
@@ -72,6 +103,7 @@ The CLI reports are validators and JSON evidence, not the primary user experienc
|
|
|
72
103
|
17. If multiple active scopes are plausible, list the evidenced competing lines and keep the current step at scope clarification or the earliest common safe gate.
|
|
73
104
|
18. When maintaining `MASTER_BACKLOG.md`, use its canonical compact columns, readable status labels and document-relative Markdown links. Do not expose raw long paths or internal snake_case statuses in the human-facing table. The canonical status/artefact label vocabulary is defined in the AGDF control scaffold's `MASTER_BACKLOG.md` template Rules section; do not invent other labels.
|
|
74
105
|
19. Preserve legacy backlog compatibility through the CLI parser; do not create a second surface-specific backlog format.
|
|
106
|
+
20. Native interaction must follow the Runtime Contract's interaction envelope, readiness check, deliberate-user-input requirement and post-response revalidation boundary.
|
|
75
107
|
|
|
76
108
|
## Gate Evaluation
|
|
77
109
|
|
package/generated/opencode.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"id": "agdf",
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.3",
|
|
5
5
|
"displayName": "AI Governance & Delivery Framework",
|
|
6
6
|
"developerName": "Arndt Gold",
|
|
7
7
|
"description": "Codex-first operating system for governed AI-assisted delivery.",
|
|
@@ -57,6 +57,7 @@
|
|
|
57
57
|
"instructionsFileName": "AGDF.md",
|
|
58
58
|
"npmPackage": "create-agdf",
|
|
59
59
|
"permissions": {
|
|
60
|
+
"question": "allow",
|
|
60
61
|
"edit": "ask",
|
|
61
62
|
"bash": "ask",
|
|
62
63
|
"skill": {
|
|
@@ -64,6 +65,35 @@
|
|
|
64
65
|
}
|
|
65
66
|
}
|
|
66
67
|
},
|
|
68
|
+
"interactions": {
|
|
69
|
+
"fallback": "exact_text",
|
|
70
|
+
"surfaces": {
|
|
71
|
+
"codex": {
|
|
72
|
+
"questionAdapter": "request_user_input",
|
|
73
|
+
"availability": "when_callable",
|
|
74
|
+
"gateSafety": "omit_auto_resolution",
|
|
75
|
+
"technicalPermissionOwner": "codex_host"
|
|
76
|
+
},
|
|
77
|
+
"claude": {
|
|
78
|
+
"questionAdapter": "AskUserQuestion",
|
|
79
|
+
"availability": "when_no_auto_continue_timeout",
|
|
80
|
+
"gateSafety": "no_timeout_or_hook_supplied_answer",
|
|
81
|
+
"technicalPermissionOwner": "claude_host"
|
|
82
|
+
},
|
|
83
|
+
"opencode": {
|
|
84
|
+
"questionAdapter": "question",
|
|
85
|
+
"availability": "when_permission_question_allows",
|
|
86
|
+
"gateSafety": "preserve_explicit_deny",
|
|
87
|
+
"technicalPermissionOwner": "opencode_host"
|
|
88
|
+
},
|
|
89
|
+
"fallback": {
|
|
90
|
+
"questionAdapter": "exact_text",
|
|
91
|
+
"availability": "always",
|
|
92
|
+
"gateSafety": "wait_for_deliberate_user_input",
|
|
93
|
+
"technicalPermissionOwner": "host_specific"
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
},
|
|
67
97
|
"skillSet": [
|
|
68
98
|
{
|
|
69
99
|
"slug": "delivery-path-search",
|
|
@@ -268,6 +268,63 @@ section or any other existing line.
|
|
|
268
268
|
- `release-or` reports the run, but does not replace QA or produce the operative commit/PR handoff.
|
|
269
269
|
- `delivery-closeout` owns the operative Git handoff text when QA/OR/UAT state allows it.
|
|
270
270
|
|
|
271
|
+
## Native Interaction Contract
|
|
272
|
+
|
|
273
|
+
Native host controls improve how a decision is presented; they do not create a second approval model or authority source.
|
|
274
|
+
|
|
275
|
+
Every AGDF interaction belongs to exactly one semantic kind:
|
|
276
|
+
|
|
277
|
+
- `clarification`: asks for missing intent or a choice that does not itself authorize a gated transition.
|
|
278
|
+
- `tool_permission`: requests host-owned authority for a command, file change, network access, external path, app action or comparable technical side effect.
|
|
279
|
+
- `gate_approval`: requests deliberate user input for the one current AGDF user gate after its durable artefact and selected run are ready.
|
|
280
|
+
|
|
281
|
+
The semantic interaction envelope is:
|
|
282
|
+
|
|
283
|
+
```text
|
|
284
|
+
interaction_kind: clarification | tool_permission | gate_approval
|
|
285
|
+
surface: codex | claude | opencode | fallback
|
|
286
|
+
run_id: required for gate_approval
|
|
287
|
+
current_gate: required for gate_approval
|
|
288
|
+
prompt: required
|
|
289
|
+
options: required for a structured question
|
|
290
|
+
effects: required when the interaction can cause side effects
|
|
291
|
+
required_evidence: required for gate_approval
|
|
292
|
+
auto_resolution: forbidden for gate_approval
|
|
293
|
+
response_origin: deliberate_user_input for gate_approval
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
This envelope is not a new persisted record. The selected canonical `RUN_STATE.md` and existing artefact chain remain the durable authority.
|
|
297
|
+
|
|
298
|
+
Before presenting `gate_approval`, the agent must:
|
|
299
|
+
|
|
300
|
+
1. resolve exactly one selected run;
|
|
301
|
+
2. run the canonical gate evaluation and confirm that the current gate's durable artefact is present and ready;
|
|
302
|
+
3. ask exactly one gate question that identifies `run_id` and `current_gate` and offers the exact approving value `Approval: <GateName>` plus bounded revise and cancel/decline outcomes;
|
|
303
|
+
4. wait for deliberate user input without a timeout, default, preselection, hook-supplied answer or agent-to-agent substitute;
|
|
304
|
+
5. re-run canonical gate evaluation against the same `run_id` and expected gate immediately before persistence;
|
|
305
|
+
6. reject missing evidence, ambiguous or wrong run, wrong gate, stale state and any response that is no longer valid;
|
|
306
|
+
7. persist an accepted approval only through the existing control-state workflow.
|
|
307
|
+
|
|
308
|
+
The first eligible native-attempt has a single bounded outcome: the declared
|
|
309
|
+
host control is presented, or the agent immediately uses the exact-text
|
|
310
|
+
fallback. A host that does not apply the control does not trigger a second
|
|
311
|
+
native prompt. AGDF must not simulate or force host-owned presentation.
|
|
312
|
+
|
|
313
|
+
A free-form native response is valid only when the existing exact-approval validator accepts it for the current gate after revalidation. Revise, decline and cancel outcomes never advance a gate.
|
|
314
|
+
|
|
315
|
+
Surface adapter rules:
|
|
316
|
+
|
|
317
|
+
| Surface | Native question adapter | Gate-safe use | Technical permission boundary |
|
|
318
|
+
|---|---|---|---|
|
|
319
|
+
| Codex | native `request_user_input` or equivalent short-question control when callable | on the first eligible attempt, present one gate question with auto-resolution omitted; if unavailable or not applied, use exact text without retry | Codex command, edit, network, external-directory and app-action approvals remain host-owned `tool_permission`. |
|
|
320
|
+
| Claude Code | `AskUserQuestion` | on the first eligible attempt, use only when no timeout can auto-continue and no hook supplies `answers` or `updatedInput`; if unavailable or not applied, use exact text without retry | Claude permissions and `ExitPlanMode` are not AGDF approval. |
|
|
321
|
+
| OpenCode | built-in `question` | use with exact approval/revise/cancel options when `permission.question` permits it; explicit user deny selects exact-text fallback | `once`, `always`, `reject`, permission suggestions and auto mode are technical outcomes only. |
|
|
322
|
+
| Fallback or non-interactive | concise exact text | wait for a new explicit user response; never synthesize or auto-resolve one | Host-specific technical permission remains separate. |
|
|
323
|
+
|
|
324
|
+
Native structured questions are for real decision points. Prefer repository inspection over clarification and do not show them for status reporting, discoverable facts, routine read-only work or repeated non-ready gate prompts.
|
|
325
|
+
|
|
326
|
+
Exact textual approvals remain canonical and fully supported on every surface. If native capability availability or safety is unknown, use the textual fallback. Host permission, plan approval, native question presentation, timeout/default behavior, hook output and agent messages never carry AGDF gate authority by themselves.
|
|
327
|
+
|
|
271
328
|
## Brownfield Review After G-00
|
|
272
329
|
|
|
273
330
|
After an approved and durable UR, perform a lightweight `Brownfield Review` before PRD when Brownfield, UI, UX, admin, runtime, policy, persistence, architecture, ownership or source-of-truth impact is possible.
|
|
@@ -52,6 +52,37 @@ npx --yes @agdf/cli@latest delivery-map --json
|
|
|
52
52
|
|
|
53
53
|
The CLI reports are validators and JSON evidence, not the primary user experience, not a required ritual for normal work and not a second rule system. If a report says `blocked`, do not continue with later-gate artefacts until the reported blocker is resolved.
|
|
54
54
|
|
|
55
|
+
## Native Interaction Path
|
|
56
|
+
|
|
57
|
+
Use the Runtime Contract's Native Interaction Contract to classify every candidate interaction as `clarification`, `tool_permission` or `gate_approval` before selecting a host control.
|
|
58
|
+
|
|
59
|
+
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.
|
|
60
|
+
|
|
61
|
+
For a ready `gate_approval`:
|
|
62
|
+
|
|
63
|
+
1. Resolve exactly one selected run and evaluate the current gate.
|
|
64
|
+
2. Confirm the required durable artefact is present and ready before presenting a question.
|
|
65
|
+
3. Ask exactly one question that names the selected `run_id` and `current_gate`.
|
|
66
|
+
4. Offer the exact approving option `Approval: <GateName>` plus bounded revise and cancel/decline outcomes.
|
|
67
|
+
5. Use the surface adapter declared in the canonical plugin definition only when it can wait for deliberate input without auto-resolution; otherwise request the same exact approval in concise text.
|
|
68
|
+
6. Re-run gate evaluation for the same run and expected gate after the response and immediately before persistence.
|
|
69
|
+
7. 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.
|
|
70
|
+
8. Persist accepted input only through the existing control-state workflow.
|
|
71
|
+
|
|
72
|
+
Make exactly one native-attempt for the ready gate. If the host does not render,
|
|
73
|
+
apply or safely return the native question on that attempt, switch immediately
|
|
74
|
+
to the exact textual approval. Do not ask the user to request the buttons again
|
|
75
|
+
and do not create a retry loop or simulated control.
|
|
76
|
+
|
|
77
|
+
Surface behavior:
|
|
78
|
+
|
|
79
|
+
- Codex: invoke the native short-question/request-user-input control on the first eligible attempt when callable, ask one gate question and omit auto-resolution; if it is not rendered or applied, use exact text immediately.
|
|
80
|
+
- 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.
|
|
81
|
+
- 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.
|
|
82
|
+
- Other, unavailable or non-interactive surfaces: use exact textual approval and wait for a new explicit user response.
|
|
83
|
+
|
|
84
|
+
A free-form response must still exactly match the current gate's approval formula after revalidation. Revise, decline and cancel never advance the gate. Native presentation, host permission and plan approval are inputs or separate authority domains, never durable AGDF authority.
|
|
85
|
+
|
|
55
86
|
## Rules
|
|
56
87
|
1. Fail closed when a required approval or artefact status is missing.
|
|
57
88
|
2. The earliest blocking gate wins.
|
|
@@ -72,6 +103,7 @@ The CLI reports are validators and JSON evidence, not the primary user experienc
|
|
|
72
103
|
17. If multiple active scopes are plausible, list the evidenced competing lines and keep the current step at scope clarification or the earliest common safe gate.
|
|
73
104
|
18. When maintaining `MASTER_BACKLOG.md`, use its canonical compact columns, readable status labels and document-relative Markdown links. Do not expose raw long paths or internal snake_case statuses in the human-facing table. The canonical status/artefact label vocabulary is defined in the AGDF control scaffold's `MASTER_BACKLOG.md` template Rules section; do not invent other labels.
|
|
74
105
|
19. Preserve legacy backlog compatibility through the CLI parser; do not create a second surface-specific backlog format.
|
|
106
|
+
20. Native interaction must follow the Runtime Contract's interaction envelope, readiness check, deliberate-user-input requirement and post-response revalidation boundary.
|
|
75
107
|
|
|
76
108
|
## Gate Evaluation
|
|
77
109
|
|
package/package.json
CHANGED