create-agdf 0.7.2 → 0.8.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.
- package/bin/create-agdf.js +93 -13
- package/generated/.github/skills/agdf-gate-check/SKILL.md +30 -8
- package/generated/.github/skills/agdf-runtime-contract.md +87 -3
- package/generated/.opencode/agdf-runtime-contract.md +87 -3
- package/generated/.opencode/skills/agdf-gate-check/SKILL.md +30 -8
- package/generated/plugins/agdf/.codex-plugin/plugin.json +1 -1
- package/generated/plugins/agdf/meta/agdf-plugin.definition.json +1 -1
- package/generated/plugins/agdf/meta/agdf-runtime-contract.md +87 -3
- package/generated/plugins/agdf/skills/gate-check/SKILL.md +30 -8
- package/lib/control-state/gate-approval-validator.js +28 -0
- package/lib/control-state/index.js +1 -0
- package/package.json +1 -1
package/bin/create-agdf.js
CHANGED
|
@@ -286,6 +286,17 @@ function resolveLanguagePreference(explicitLanguage) {
|
|
|
286
286
|
};
|
|
287
287
|
}
|
|
288
288
|
|
|
289
|
+
function resolveConfiguredChatLanguage(targetDir) {
|
|
290
|
+
const configPath = join(targetDir, ".agdf", "control", "config.json");
|
|
291
|
+
if (!existsSync(configPath)) return "en";
|
|
292
|
+
try {
|
|
293
|
+
const config = JSON.parse(readFileSync(configPath, "utf8"));
|
|
294
|
+
return normalizeLanguage(config.chat_language) || "en";
|
|
295
|
+
} catch {
|
|
296
|
+
return "en";
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
|
|
289
300
|
function languageConfigContent(languagePreference) {
|
|
290
301
|
return `${JSON.stringify({
|
|
291
302
|
artifact_language: languagePreference.artifact_language,
|
|
@@ -2149,26 +2160,44 @@ function postApprovalTransition(missingApproval) {
|
|
|
2149
2160
|
["Approval: UR", {
|
|
2150
2161
|
next_gate_after_approval: "Brownfield Review",
|
|
2151
2162
|
allowed_after_approval: "Run Brownfield Review and record Mode/Slice Decision before PRD or implementation.",
|
|
2163
|
+
internal_next_step: "Brownfield Review and Mode/Slice Decision",
|
|
2164
|
+
next_user_gate: "PRD",
|
|
2165
|
+
user_action_required: "yes",
|
|
2152
2166
|
}],
|
|
2153
2167
|
["Approval: PRD", {
|
|
2154
2168
|
next_gate_after_approval: "SD",
|
|
2155
2169
|
allowed_after_approval: "Draft Solution Design; implementation remains forbidden.",
|
|
2170
|
+
internal_next_step: "draft Solution Design",
|
|
2171
|
+
next_user_gate: "SD",
|
|
2172
|
+
user_action_required: "yes",
|
|
2156
2173
|
}],
|
|
2157
2174
|
["Approval: SD", {
|
|
2158
2175
|
next_gate_after_approval: "TP",
|
|
2159
2176
|
allowed_after_approval: "Draft Task/Test Plan; implementation remains forbidden.",
|
|
2177
|
+
internal_next_step: "draft Task/Test Plan",
|
|
2178
|
+
next_user_gate: "TP",
|
|
2179
|
+
user_action_required: "yes",
|
|
2160
2180
|
}],
|
|
2161
2181
|
["Approval: TP", {
|
|
2162
|
-
next_gate_after_approval: "
|
|
2163
|
-
allowed_after_approval: "Run implementation-prep Brownfield Analysis before CD+Tests.",
|
|
2182
|
+
next_gate_after_approval: "none",
|
|
2183
|
+
allowed_after_approval: "Run implementation-prep Brownfield Analysis before CD+Tests; no further user approval is required at this internal step.",
|
|
2184
|
+
internal_next_step: "pre-implementation Brownfield Analysis",
|
|
2185
|
+
next_user_gate: "none",
|
|
2186
|
+
user_action_required: "no",
|
|
2164
2187
|
}],
|
|
2165
2188
|
["Approval: QA", {
|
|
2166
2189
|
next_gate_after_approval: "UAT",
|
|
2167
2190
|
allowed_after_approval: "Request UAT when QA has passed; release remains gated.",
|
|
2191
|
+
internal_next_step: "prepare UAT evidence",
|
|
2192
|
+
next_user_gate: "UAT",
|
|
2193
|
+
user_action_required: "yes",
|
|
2168
2194
|
}],
|
|
2169
2195
|
["Approval: UAT", {
|
|
2170
2196
|
next_gate_after_approval: "OR",
|
|
2171
2197
|
allowed_after_approval: "Produce OR or delivery closeout; VCS and release actions still require explicit instruction.",
|
|
2198
|
+
internal_next_step: "OR or delivery closeout",
|
|
2199
|
+
next_user_gate: "none",
|
|
2200
|
+
user_action_required: "no",
|
|
2172
2201
|
}],
|
|
2173
2202
|
]);
|
|
2174
2203
|
|
|
@@ -2187,11 +2216,15 @@ function buildStatusCard({
|
|
|
2187
2216
|
missingApproval = "none",
|
|
2188
2217
|
nextAllowedAction,
|
|
2189
2218
|
runState,
|
|
2219
|
+
chatLanguage = "en",
|
|
2190
2220
|
findings = [],
|
|
2191
2221
|
}) {
|
|
2192
2222
|
const qualityOutlook = deriveQualityOutlook(runState, findings);
|
|
2193
2223
|
const postApproval = postApprovalTransition(missingApproval);
|
|
2224
|
+
const isUserGateApproval = missingApproval !== "none";
|
|
2194
2225
|
return {
|
|
2226
|
+
run_id: extractField(runState.content ?? "", "run_id") || "unknown",
|
|
2227
|
+
presentation_language: chatLanguage,
|
|
2195
2228
|
mode: extractField(runState.content ?? "", "mode") || "unknown",
|
|
2196
2229
|
status,
|
|
2197
2230
|
current_gate: currentGate,
|
|
@@ -2202,6 +2235,10 @@ function buildStatusCard({
|
|
|
2202
2235
|
missing_approval: missingApproval || "none",
|
|
2203
2236
|
next_gate_after_approval: postApproval.next_gate_after_approval,
|
|
2204
2237
|
allowed_after_approval: postApproval.allowed_after_approval,
|
|
2238
|
+
user_visible_outcome_after_approval: postApproval.allowed_after_approval,
|
|
2239
|
+
internal_next_step: postApproval.internal_next_step || (isUserGateApproval ? "none" : nextAllowedAction),
|
|
2240
|
+
next_user_gate: postApproval.next_user_gate || "none",
|
|
2241
|
+
user_action_required: postApproval.user_action_required || (isUserGateApproval ? "yes" : "no"),
|
|
2205
2242
|
evidence: runState.evidence_refs,
|
|
2206
2243
|
next_skill: nextSkillByGate[currentGate] ?? "gate-check",
|
|
2207
2244
|
next_step: nextAllowedAction,
|
|
@@ -2554,6 +2591,7 @@ function evaluateGateCheck(targetDir, selection = {}) {
|
|
|
2554
2591
|
missingApproval,
|
|
2555
2592
|
nextAllowedAction,
|
|
2556
2593
|
runState,
|
|
2594
|
+
chatLanguage: resolveConfiguredChatLanguage(targetDir),
|
|
2557
2595
|
findings: deliveryMap.findings,
|
|
2558
2596
|
}),
|
|
2559
2597
|
delivery_map: {
|
|
@@ -2571,17 +2609,58 @@ function evaluateGateCheck(targetDir, selection = {}) {
|
|
|
2571
2609
|
|
|
2572
2610
|
function printGateCheckStatusCard(report) {
|
|
2573
2611
|
const card = report.status_card;
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2612
|
+
const de = card.presentation_language === "de";
|
|
2613
|
+
const labels = de ? {
|
|
2614
|
+
title: "AGDF-Statuskarte",
|
|
2615
|
+
run: "Ausgewählter Run",
|
|
2616
|
+
gate: "Aktuelles Gate",
|
|
2617
|
+
blocked: "Blockiert durch",
|
|
2618
|
+
missing: "Fehlende Freigabe",
|
|
2619
|
+
outcome: "Ergebnis nach Freigabe",
|
|
2620
|
+
internal: "Interner nächster Schritt",
|
|
2621
|
+
userGate: "Nächstes User-Gate",
|
|
2622
|
+
userAction: "Nutzeraktion erforderlich",
|
|
2623
|
+
nextGate: "Nächstes Gate nach Freigabe",
|
|
2624
|
+
allowedAfter: "Nach Freigabe erlaubt",
|
|
2625
|
+
skill: "Nächster Skill",
|
|
2626
|
+
step: "Nächster Schritt",
|
|
2627
|
+
quality: "Qualitätsausblick",
|
|
2628
|
+
allowed: "Jetzt erlaubt",
|
|
2629
|
+
forbidden: "Aktuell verboten",
|
|
2630
|
+
} : {
|
|
2631
|
+
title: "AGDF status-card",
|
|
2632
|
+
run: "Selected run",
|
|
2633
|
+
gate: "Current gate",
|
|
2634
|
+
blocked: "Blocked by",
|
|
2635
|
+
missing: "Missing approval",
|
|
2636
|
+
outcome: "User-visible outcome after approval",
|
|
2637
|
+
internal: "Internal next step",
|
|
2638
|
+
userGate: "Next user gate",
|
|
2639
|
+
userAction: "User action required",
|
|
2640
|
+
nextGate: "Next gate after approval",
|
|
2641
|
+
allowedAfter: "Allowed after approval",
|
|
2642
|
+
skill: "Next skill",
|
|
2643
|
+
step: "Next step",
|
|
2644
|
+
quality: "Quality outlook",
|
|
2645
|
+
allowed: "Allowed now",
|
|
2646
|
+
forbidden: "Forbidden now",
|
|
2647
|
+
};
|
|
2648
|
+
console.log(`${labels.title}: ${card.status}`);
|
|
2649
|
+
console.log(`${labels.run}: ${card.run_id}`);
|
|
2650
|
+
console.log(`${labels.gate}: ${card.current_gate}`);
|
|
2651
|
+
console.log(`${labels.blocked}: ${card.blocking_condition}`);
|
|
2652
|
+
console.log(`${labels.missing}: ${card.missing_approval}`);
|
|
2653
|
+
console.log(`${labels.outcome}: ${card.user_visible_outcome_after_approval}`);
|
|
2654
|
+
console.log(`${labels.internal}: ${card.internal_next_step}`);
|
|
2655
|
+
console.log(`${labels.userGate}: ${card.next_user_gate}`);
|
|
2656
|
+
console.log(`${labels.userAction}: ${card.user_action_required}`);
|
|
2657
|
+
if (card.next_gate_after_approval !== "none") console.log(`${labels.nextGate}: ${card.next_gate_after_approval}`);
|
|
2658
|
+
if (card.allowed_after_approval !== "none") console.log(`${labels.allowedAfter}: ${card.allowed_after_approval}`);
|
|
2659
|
+
console.log(`${labels.skill}: ${card.next_skill}`);
|
|
2660
|
+
console.log(`${labels.step}: ${card.next_step}`);
|
|
2661
|
+
console.log(`${labels.quality}: ${card.quality_outlook}`);
|
|
2662
|
+
if (card.allowed_now.length > 0) console.log(`${labels.allowed}: ${card.allowed_now.join("; ")}`);
|
|
2663
|
+
if (card.forbidden_now.length > 0) console.log(`${labels.forbidden}: ${card.forbidden_now.join("; ")}`);
|
|
2585
2664
|
}
|
|
2586
2665
|
|
|
2587
2666
|
function printGateCheckReport(report, json, statusCard = false) {
|
|
@@ -2698,6 +2777,7 @@ function evaluateDeliveryMap(targetDir, selection = {}) {
|
|
|
2698
2777
|
missingApproval: gateDecision.missing_approval,
|
|
2699
2778
|
nextAllowedAction,
|
|
2700
2779
|
runState,
|
|
2780
|
+
chatLanguage: resolveConfiguredChatLanguage(targetDir),
|
|
2701
2781
|
findings: map.findings,
|
|
2702
2782
|
}),
|
|
2703
2783
|
backlog_pointers: readBacklogPointers(targetDir),
|
|
@@ -62,20 +62,37 @@ For a ready `gate_approval`:
|
|
|
62
62
|
|
|
63
63
|
1. Resolve exactly one selected run and evaluate the current gate.
|
|
64
64
|
2. Confirm the required durable artefact is present and ready before presenting a question.
|
|
65
|
-
3.
|
|
66
|
-
4.
|
|
67
|
-
5.
|
|
68
|
-
6.
|
|
69
|
-
7.
|
|
70
|
-
8.
|
|
65
|
+
3. Render a separate localized Gate Transition Card immediately before any native question or exact-text fallback. Never put the card only into the question, button description or hidden tool context.
|
|
66
|
+
4. Treat the operational Run Status Card as evaluation and audit input, not as the approval-time product surface. Do not paste its table, raw keys, machine statuses, evidence or diagnostic detail into the transition card.
|
|
67
|
+
5. Compose the transition card as one human-readable gate title with `run_id`, one ready-for-decision line, one short approval-effect block and one short next-transition block. It must answer only: where am I, what does this decision do, and what happens next.
|
|
68
|
+
6. Distinguish internal process steps from user decisions in natural language. For example, after `Approval: TP`, say that pre-implementation Brownfield Analysis runs next and that no further user action is required now; do not expose `next_user_gate: none` or `user_action_required: no`, and do not ask for a second approval for Brownfield Analysis.
|
|
69
|
+
7. Ask exactly one question that names the selected `run_id` and `current_gate`.
|
|
70
|
+
8. Offer the exact approving option `Approval: <GateName>` plus bounded revise and cancel/decline outcomes.
|
|
71
|
+
9. 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.
|
|
72
|
+
10. Re-run gate evaluation for the same run and expected gate after the response and immediately before persistence.
|
|
73
|
+
11. 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.
|
|
74
|
+
12. Persist accepted input only through the existing control-state workflow.
|
|
75
|
+
|
|
76
|
+
Before composing the question, resolve the configured chat locale from `.agdf/control/config.json`. Use German presentation text for `chat_language: de`; use English for `chat_language: en` or as the deterministic fallback for an absent or unsupported locale. Keep `Approval: <GateName>` exactly unchanged in every language, and do not mix presentation languages within one question.
|
|
77
|
+
|
|
78
|
+
For the transition card, German uses `Bereit für deine Entscheidung`, `Jetzt freigeben` and `Danach`; English uses `Ready for your decision`, `Approve now` and `Next`. Keep each card in one locale. Use a human-readable gate title rather than an internal status label. Do not render a Markdown table, dashboard rows, raw control-state keys, diagnostic codes, evidence lists, a duplicated gate question or a false user gate in the approval-time card.
|
|
79
|
+
|
|
80
|
+
The primary option remains exactly `Approval: SD`; only explanatory copy and non-authoritative outcome labels are localized. Concrete localized copy belongs to the user-facing interaction layer or the approved delivery artefact, not to English runtime rules.
|
|
81
|
+
|
|
82
|
+
Make exactly one native-attempt for the ready gate. If the host does not render,
|
|
83
|
+
apply or safely return the native question on that attempt, switch immediately
|
|
84
|
+
to the exact textual approval. Do not ask the user to request the buttons again
|
|
85
|
+
and do not create a retry loop or simulated control.
|
|
71
86
|
|
|
72
87
|
Surface behavior:
|
|
73
88
|
|
|
74
|
-
- Codex:
|
|
75
|
-
- Claude Code:
|
|
89
|
+
- 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.
|
|
90
|
+
- 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.
|
|
76
91
|
- 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.
|
|
77
92
|
- Other, unavailable or non-interactive surfaces: use exact textual approval and wait for a new explicit user response.
|
|
78
93
|
|
|
94
|
+
Localized labels such as `Überarbeiten`/`Revise`, `Ablehnen`/`Decline` and `Abbrechen`/`Cancel` are presentation mappings to stable non-approval outcomes only. Host-provided free-text or `Überspringen`/`Skip` actions never advance an AGDF gate.
|
|
95
|
+
|
|
79
96
|
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.
|
|
80
97
|
|
|
81
98
|
## Rules
|
|
@@ -165,6 +182,11 @@ Keep the result short and operational. Render the Runtime Contract's compact hum
|
|
|
165
182
|
|
|
166
183
|
When an approval is missing, also include `Next gate after approval` and `Allowed after approval` exactly as constrained by the Runtime Contract. Keep forbidden outputs, evidence and next-skill detail in the concise surrounding text when relevant; they are not extra status-card rows.
|
|
167
184
|
|
|
185
|
+
This operational status table is for status reporting. When the same response
|
|
186
|
+
immediately requests a ready gate approval, replace the table in the visible
|
|
187
|
+
approval experience with the Gate Transition Card defined above, then invoke
|
|
188
|
+
the native question or exact-text fallback. Do not show both cards.
|
|
189
|
+
|
|
168
190
|
If this skill creates or updates control artefacts, do not paste full file bodies into the chat.
|
|
169
191
|
List paths, summarize the decision, name the blocker or approval needed, and keep the durable content in the files.
|
|
170
192
|
|
|
@@ -83,6 +83,8 @@ When a run needs an operational status view, use the Run Status Card as a compac
|
|
|
83
83
|
It must not introduce a second gate model or override `agdf-gate-check`, `delivery-map`, QA, OR, or user approvals.
|
|
84
84
|
|
|
85
85
|
- `mode`: `quick_task | verified_change | structured_delivery | unknown`
|
|
86
|
+
- `run_id`: the exactly selected canonical run
|
|
87
|
+
- `presentation_language`: `de | en`, with unsupported or absent chat language resolved to `en`
|
|
86
88
|
- `status`: `open | blocked | pass | warn | revise | block | in_progress`
|
|
87
89
|
- `current_gate`: current user gate or internal step
|
|
88
90
|
- `mode_slice_decision`: `undecided | quick_task | verified_change | structured_slice | structured_delivery | block`
|
|
@@ -92,6 +94,10 @@ It must not introduce a second gate model or override `agdf-gate-check`, `delive
|
|
|
92
94
|
- `missing_approval`: exact missing approval formula or `none`
|
|
93
95
|
- `next_gate_after_approval`: the next user gate or internal step unlocked by the missing approval, or `none`
|
|
94
96
|
- `allowed_after_approval`: concise description of what becomes allowed after the missing approval, or `none`
|
|
97
|
+
- `user_visible_outcome_after_approval`: concise user-facing result of approving the current gate
|
|
98
|
+
- `internal_next_step`: the next agent-controlled process step, or `none`
|
|
99
|
+
- `next_user_gate`: the next actual user approval gate, or `none`
|
|
100
|
+
- `user_action_required`: `yes` only when the user must provide another deliberate approval or decision; otherwise `no`
|
|
95
101
|
- `evidence`: concrete evidence references currently visible
|
|
96
102
|
- `next_skill`: next AGDF skill or `none`
|
|
97
103
|
- `next_step`: the single next permissible process action
|
|
@@ -139,6 +145,56 @@ and `Allowed after approval` when a missing approval exists, `Next step` and
|
|
|
139
145
|
`Quality outlook`. Keep mode, forbidden actions, evidence and next-skill detail
|
|
140
146
|
in the surrounding control artefact when they are relevant.
|
|
141
147
|
|
|
148
|
+
## Gate Transition Card
|
|
149
|
+
|
|
150
|
+
The Gate Transition Card is the primary user-facing orientation message for a
|
|
151
|
+
ready `gate_approval`. It is derived from the Run Status Card and canonical
|
|
152
|
+
post-approval transition, but it is not another state model, persisted record,
|
|
153
|
+
renderer or approval authority. The Run Status Card remains the operational,
|
|
154
|
+
CLI and audit projection; the Gate Transition Card turns only the decision-
|
|
155
|
+
relevant subset into concise product copy immediately before the host-native
|
|
156
|
+
question or exact-text fallback.
|
|
157
|
+
|
|
158
|
+
The card answers exactly three user questions, in this order:
|
|
159
|
+
|
|
160
|
+
1. **Where am I?** A human-readable gate title, selected `run_id` as secondary
|
|
161
|
+
context and a clear ready-for-decision state.
|
|
162
|
+
2. **What does this decision do?** The exact `Approval: <GateName>` value, its
|
|
163
|
+
concrete next outcome and the most important boundary that remains.
|
|
164
|
+
3. **What happens next?** The immediate agent-controlled action and the next
|
|
165
|
+
actual user decision when one exists; otherwise a plain statement that no
|
|
166
|
+
further user action is required now.
|
|
167
|
+
|
|
168
|
+
Use this compact composition:
|
|
169
|
+
|
|
170
|
+
```text
|
|
171
|
+
<human-readable gate title> · <run_id>
|
|
172
|
+
<localized ready-for-decision line>
|
|
173
|
+
|
|
174
|
+
<localized approve heading>
|
|
175
|
+
`Approval: <GateName>` <localized concrete effect>. <localized remaining boundary>.
|
|
176
|
+
|
|
177
|
+
<localized next heading>
|
|
178
|
+
<localized immediate agent action>. <localized next user decision or no-action statement>.
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
Resolve all explanatory text through the Interaction Locale Contract. German
|
|
182
|
+
uses the approved German product labels for readiness, approval and the next
|
|
183
|
+
transition; English is the deterministic default for absent or unsupported
|
|
184
|
+
locales. Gate names, `run_id` and exact approval values are never translated.
|
|
185
|
+
The meaning, ordering and authority boundary must be identical across locales.
|
|
186
|
+
|
|
187
|
+
The approval-time card must not be a Markdown table or dashboard. It must not
|
|
188
|
+
present raw control-state keys, machine status values, diagnostic codes,
|
|
189
|
+
evidence lists, allowed/forbidden inventories or implementation detail that is
|
|
190
|
+
not needed for the decision. It must not repeat the native question. The card
|
|
191
|
+
normally fits in one title, one readiness line and two short content blocks.
|
|
192
|
+
|
|
193
|
+
For `Approval: TP`, the effect is permission to run pre-implementation
|
|
194
|
+
Brownfield Analysis, implementation remains gated until that analysis passes,
|
|
195
|
+
and the next block states plainly that no further user decision is required
|
|
196
|
+
now. Brownfield Analysis must not be presented as a user gate.
|
|
197
|
+
|
|
142
198
|
## Source Precedence
|
|
143
199
|
|
|
144
200
|
Every governed repository should make the normative instruction source visible.
|
|
@@ -295,24 +351,38 @@ response_origin: deliberate_user_input for gate_approval
|
|
|
295
351
|
|
|
296
352
|
This envelope is not a new persisted record. The selected canonical `RUN_STATE.md` and existing artefact chain remain the durable authority.
|
|
297
353
|
|
|
354
|
+
Before presenting `gate_approval` for any user gate (`UR`, `PRD`, `SD`, `TP`,
|
|
355
|
+
`QA`, or `UAT`), the agent must emit the localized Gate Transition Card as a
|
|
356
|
+
separate, immediately preceding interaction block. The card is not optional,
|
|
357
|
+
not hidden in the question text and not replaced by a host button label.
|
|
358
|
+
Native buttons or exact-text fallback may appear only after this card. The
|
|
359
|
+
underlying Run Status Card fields remain available to evaluation and audit,
|
|
360
|
+
but their dashboard projection must not be pasted into this approval-time
|
|
361
|
+
message.
|
|
362
|
+
|
|
298
363
|
Before presenting `gate_approval`, the agent must:
|
|
299
364
|
|
|
300
365
|
1. resolve exactly one selected run;
|
|
301
366
|
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;
|
|
367
|
+
3. emit the separate localized Gate Transition Card immediately before the gate question, then 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
368
|
4. wait for deliberate user input without a timeout, default, preselection, hook-supplied answer or agent-to-agent substitute;
|
|
304
369
|
5. re-run canonical gate evaluation against the same `run_id` and expected gate immediately before persistence;
|
|
305
370
|
6. reject missing evidence, ambiguous or wrong run, wrong gate, stale state and any response that is no longer valid;
|
|
306
371
|
7. persist an accepted approval only through the existing control-state workflow.
|
|
307
372
|
|
|
373
|
+
The first eligible native-attempt has a single bounded outcome: the declared
|
|
374
|
+
host control is presented, or the agent immediately uses the exact-text
|
|
375
|
+
fallback. A host that does not apply the control does not trigger a second
|
|
376
|
+
native prompt. AGDF must not simulate or force host-owned presentation.
|
|
377
|
+
|
|
308
378
|
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.
|
|
309
379
|
|
|
310
380
|
Surface adapter rules:
|
|
311
381
|
|
|
312
382
|
| Surface | Native question adapter | Gate-safe use | Technical permission boundary |
|
|
313
383
|
|---|---|---|---|
|
|
314
|
-
| Codex | native `request_user_input` or equivalent short-question control when callable | one gate question
|
|
315
|
-
| Claude Code | `AskUserQuestion` | use only when no timeout can auto-continue and no hook supplies `answers` or `updatedInput`;
|
|
384
|
+
| 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`. |
|
|
385
|
+
| 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. |
|
|
316
386
|
| 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. |
|
|
317
387
|
| 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. |
|
|
318
388
|
|
|
@@ -320,6 +390,20 @@ Native structured questions are for real decision points. Prefer repository insp
|
|
|
320
390
|
|
|
321
391
|
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.
|
|
322
392
|
|
|
393
|
+
### Interaction Locale Contract
|
|
394
|
+
|
|
395
|
+
User-facing native questions, option descriptions and exact-text fallback explanations use the configured project chat language from `.agdf/control/config.json`:
|
|
396
|
+
|
|
397
|
+
- `chat_language: de` selects the German presentation copy;
|
|
398
|
+
- `chat_language: en` selects English presentation copy;
|
|
399
|
+
- an absent, unsupported or not-yet-translated chat language falls back deterministically to English;
|
|
400
|
+
- one question must not mix presentation languages;
|
|
401
|
+
- durable artefacts, runtime rules, task identifiers and machine-facing approval values remain English;
|
|
402
|
+
- the exact approval value remains `Approval: <GateName>` in every locale;
|
|
403
|
+
- localized `revise`, `decline` and `cancel` labels are presentation text only and never carry gate authority.
|
|
404
|
+
|
|
405
|
+
The locale changes presentation only. It must not change gate meaning, option ordering, readiness, validation, revalidation or persistence. Host-provided free-text labels and skip actions are not AGDF-owned approval options and must never advance a gate.
|
|
406
|
+
|
|
323
407
|
## Brownfield Review After G-00
|
|
324
408
|
|
|
325
409
|
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.
|
|
@@ -83,6 +83,8 @@ When a run needs an operational status view, use the Run Status Card as a compac
|
|
|
83
83
|
It must not introduce a second gate model or override `agdf-gate-check`, `delivery-map`, QA, OR, or user approvals.
|
|
84
84
|
|
|
85
85
|
- `mode`: `quick_task | verified_change | structured_delivery | unknown`
|
|
86
|
+
- `run_id`: the exactly selected canonical run
|
|
87
|
+
- `presentation_language`: `de | en`, with unsupported or absent chat language resolved to `en`
|
|
86
88
|
- `status`: `open | blocked | pass | warn | revise | block | in_progress`
|
|
87
89
|
- `current_gate`: current user gate or internal step
|
|
88
90
|
- `mode_slice_decision`: `undecided | quick_task | verified_change | structured_slice | structured_delivery | block`
|
|
@@ -92,6 +94,10 @@ It must not introduce a second gate model or override `agdf-gate-check`, `delive
|
|
|
92
94
|
- `missing_approval`: exact missing approval formula or `none`
|
|
93
95
|
- `next_gate_after_approval`: the next user gate or internal step unlocked by the missing approval, or `none`
|
|
94
96
|
- `allowed_after_approval`: concise description of what becomes allowed after the missing approval, or `none`
|
|
97
|
+
- `user_visible_outcome_after_approval`: concise user-facing result of approving the current gate
|
|
98
|
+
- `internal_next_step`: the next agent-controlled process step, or `none`
|
|
99
|
+
- `next_user_gate`: the next actual user approval gate, or `none`
|
|
100
|
+
- `user_action_required`: `yes` only when the user must provide another deliberate approval or decision; otherwise `no`
|
|
95
101
|
- `evidence`: concrete evidence references currently visible
|
|
96
102
|
- `next_skill`: next AGDF skill or `none`
|
|
97
103
|
- `next_step`: the single next permissible process action
|
|
@@ -139,6 +145,56 @@ and `Allowed after approval` when a missing approval exists, `Next step` and
|
|
|
139
145
|
`Quality outlook`. Keep mode, forbidden actions, evidence and next-skill detail
|
|
140
146
|
in the surrounding control artefact when they are relevant.
|
|
141
147
|
|
|
148
|
+
## Gate Transition Card
|
|
149
|
+
|
|
150
|
+
The Gate Transition Card is the primary user-facing orientation message for a
|
|
151
|
+
ready `gate_approval`. It is derived from the Run Status Card and canonical
|
|
152
|
+
post-approval transition, but it is not another state model, persisted record,
|
|
153
|
+
renderer or approval authority. The Run Status Card remains the operational,
|
|
154
|
+
CLI and audit projection; the Gate Transition Card turns only the decision-
|
|
155
|
+
relevant subset into concise product copy immediately before the host-native
|
|
156
|
+
question or exact-text fallback.
|
|
157
|
+
|
|
158
|
+
The card answers exactly three user questions, in this order:
|
|
159
|
+
|
|
160
|
+
1. **Where am I?** A human-readable gate title, selected `run_id` as secondary
|
|
161
|
+
context and a clear ready-for-decision state.
|
|
162
|
+
2. **What does this decision do?** The exact `Approval: <GateName>` value, its
|
|
163
|
+
concrete next outcome and the most important boundary that remains.
|
|
164
|
+
3. **What happens next?** The immediate agent-controlled action and the next
|
|
165
|
+
actual user decision when one exists; otherwise a plain statement that no
|
|
166
|
+
further user action is required now.
|
|
167
|
+
|
|
168
|
+
Use this compact composition:
|
|
169
|
+
|
|
170
|
+
```text
|
|
171
|
+
<human-readable gate title> · <run_id>
|
|
172
|
+
<localized ready-for-decision line>
|
|
173
|
+
|
|
174
|
+
<localized approve heading>
|
|
175
|
+
`Approval: <GateName>` <localized concrete effect>. <localized remaining boundary>.
|
|
176
|
+
|
|
177
|
+
<localized next heading>
|
|
178
|
+
<localized immediate agent action>. <localized next user decision or no-action statement>.
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
Resolve all explanatory text through the Interaction Locale Contract. German
|
|
182
|
+
uses the approved German product labels for readiness, approval and the next
|
|
183
|
+
transition; English is the deterministic default for absent or unsupported
|
|
184
|
+
locales. Gate names, `run_id` and exact approval values are never translated.
|
|
185
|
+
The meaning, ordering and authority boundary must be identical across locales.
|
|
186
|
+
|
|
187
|
+
The approval-time card must not be a Markdown table or dashboard. It must not
|
|
188
|
+
present raw control-state keys, machine status values, diagnostic codes,
|
|
189
|
+
evidence lists, allowed/forbidden inventories or implementation detail that is
|
|
190
|
+
not needed for the decision. It must not repeat the native question. The card
|
|
191
|
+
normally fits in one title, one readiness line and two short content blocks.
|
|
192
|
+
|
|
193
|
+
For `Approval: TP`, the effect is permission to run pre-implementation
|
|
194
|
+
Brownfield Analysis, implementation remains gated until that analysis passes,
|
|
195
|
+
and the next block states plainly that no further user decision is required
|
|
196
|
+
now. Brownfield Analysis must not be presented as a user gate.
|
|
197
|
+
|
|
142
198
|
## Source Precedence
|
|
143
199
|
|
|
144
200
|
Every governed repository should make the normative instruction source visible.
|
|
@@ -295,24 +351,38 @@ response_origin: deliberate_user_input for gate_approval
|
|
|
295
351
|
|
|
296
352
|
This envelope is not a new persisted record. The selected canonical `RUN_STATE.md` and existing artefact chain remain the durable authority.
|
|
297
353
|
|
|
354
|
+
Before presenting `gate_approval` for any user gate (`UR`, `PRD`, `SD`, `TP`,
|
|
355
|
+
`QA`, or `UAT`), the agent must emit the localized Gate Transition Card as a
|
|
356
|
+
separate, immediately preceding interaction block. The card is not optional,
|
|
357
|
+
not hidden in the question text and not replaced by a host button label.
|
|
358
|
+
Native buttons or exact-text fallback may appear only after this card. The
|
|
359
|
+
underlying Run Status Card fields remain available to evaluation and audit,
|
|
360
|
+
but their dashboard projection must not be pasted into this approval-time
|
|
361
|
+
message.
|
|
362
|
+
|
|
298
363
|
Before presenting `gate_approval`, the agent must:
|
|
299
364
|
|
|
300
365
|
1. resolve exactly one selected run;
|
|
301
366
|
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;
|
|
367
|
+
3. emit the separate localized Gate Transition Card immediately before the gate question, then 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
368
|
4. wait for deliberate user input without a timeout, default, preselection, hook-supplied answer or agent-to-agent substitute;
|
|
304
369
|
5. re-run canonical gate evaluation against the same `run_id` and expected gate immediately before persistence;
|
|
305
370
|
6. reject missing evidence, ambiguous or wrong run, wrong gate, stale state and any response that is no longer valid;
|
|
306
371
|
7. persist an accepted approval only through the existing control-state workflow.
|
|
307
372
|
|
|
373
|
+
The first eligible native-attempt has a single bounded outcome: the declared
|
|
374
|
+
host control is presented, or the agent immediately uses the exact-text
|
|
375
|
+
fallback. A host that does not apply the control does not trigger a second
|
|
376
|
+
native prompt. AGDF must not simulate or force host-owned presentation.
|
|
377
|
+
|
|
308
378
|
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.
|
|
309
379
|
|
|
310
380
|
Surface adapter rules:
|
|
311
381
|
|
|
312
382
|
| Surface | Native question adapter | Gate-safe use | Technical permission boundary |
|
|
313
383
|
|---|---|---|---|
|
|
314
|
-
| Codex | native `request_user_input` or equivalent short-question control when callable | one gate question
|
|
315
|
-
| Claude Code | `AskUserQuestion` | use only when no timeout can auto-continue and no hook supplies `answers` or `updatedInput`;
|
|
384
|
+
| 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`. |
|
|
385
|
+
| 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. |
|
|
316
386
|
| 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. |
|
|
317
387
|
| 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. |
|
|
318
388
|
|
|
@@ -320,6 +390,20 @@ Native structured questions are for real decision points. Prefer repository insp
|
|
|
320
390
|
|
|
321
391
|
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.
|
|
322
392
|
|
|
393
|
+
### Interaction Locale Contract
|
|
394
|
+
|
|
395
|
+
User-facing native questions, option descriptions and exact-text fallback explanations use the configured project chat language from `.agdf/control/config.json`:
|
|
396
|
+
|
|
397
|
+
- `chat_language: de` selects the German presentation copy;
|
|
398
|
+
- `chat_language: en` selects English presentation copy;
|
|
399
|
+
- an absent, unsupported or not-yet-translated chat language falls back deterministically to English;
|
|
400
|
+
- one question must not mix presentation languages;
|
|
401
|
+
- durable artefacts, runtime rules, task identifiers and machine-facing approval values remain English;
|
|
402
|
+
- the exact approval value remains `Approval: <GateName>` in every locale;
|
|
403
|
+
- localized `revise`, `decline` and `cancel` labels are presentation text only and never carry gate authority.
|
|
404
|
+
|
|
405
|
+
The locale changes presentation only. It must not change gate meaning, option ordering, readiness, validation, revalidation or persistence. Host-provided free-text labels and skip actions are not AGDF-owned approval options and must never advance a gate.
|
|
406
|
+
|
|
323
407
|
## Brownfield Review After G-00
|
|
324
408
|
|
|
325
409
|
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.
|
|
@@ -62,20 +62,37 @@ For a ready `gate_approval`:
|
|
|
62
62
|
|
|
63
63
|
1. Resolve exactly one selected run and evaluate the current gate.
|
|
64
64
|
2. Confirm the required durable artefact is present and ready before presenting a question.
|
|
65
|
-
3.
|
|
66
|
-
4.
|
|
67
|
-
5.
|
|
68
|
-
6.
|
|
69
|
-
7.
|
|
70
|
-
8.
|
|
65
|
+
3. Render a separate localized Gate Transition Card immediately before any native question or exact-text fallback. Never put the card only into the question, button description or hidden tool context.
|
|
66
|
+
4. Treat the operational Run Status Card as evaluation and audit input, not as the approval-time product surface. Do not paste its table, raw keys, machine statuses, evidence or diagnostic detail into the transition card.
|
|
67
|
+
5. Compose the transition card as one human-readable gate title with `run_id`, one ready-for-decision line, one short approval-effect block and one short next-transition block. It must answer only: where am I, what does this decision do, and what happens next.
|
|
68
|
+
6. Distinguish internal process steps from user decisions in natural language. For example, after `Approval: TP`, say that pre-implementation Brownfield Analysis runs next and that no further user action is required now; do not expose `next_user_gate: none` or `user_action_required: no`, and do not ask for a second approval for Brownfield Analysis.
|
|
69
|
+
7. Ask exactly one question that names the selected `run_id` and `current_gate`.
|
|
70
|
+
8. Offer the exact approving option `Approval: <GateName>` plus bounded revise and cancel/decline outcomes.
|
|
71
|
+
9. 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.
|
|
72
|
+
10. Re-run gate evaluation for the same run and expected gate after the response and immediately before persistence.
|
|
73
|
+
11. 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.
|
|
74
|
+
12. Persist accepted input only through the existing control-state workflow.
|
|
75
|
+
|
|
76
|
+
Before composing the question, resolve the configured chat locale from `.agdf/control/config.json`. Use German presentation text for `chat_language: de`; use English for `chat_language: en` or as the deterministic fallback for an absent or unsupported locale. Keep `Approval: <GateName>` exactly unchanged in every language, and do not mix presentation languages within one question.
|
|
77
|
+
|
|
78
|
+
For the transition card, German uses `Bereit für deine Entscheidung`, `Jetzt freigeben` and `Danach`; English uses `Ready for your decision`, `Approve now` and `Next`. Keep each card in one locale. Use a human-readable gate title rather than an internal status label. Do not render a Markdown table, dashboard rows, raw control-state keys, diagnostic codes, evidence lists, a duplicated gate question or a false user gate in the approval-time card.
|
|
79
|
+
|
|
80
|
+
The primary option remains exactly `Approval: SD`; only explanatory copy and non-authoritative outcome labels are localized. Concrete localized copy belongs to the user-facing interaction layer or the approved delivery artefact, not to English runtime rules.
|
|
81
|
+
|
|
82
|
+
Make exactly one native-attempt for the ready gate. If the host does not render,
|
|
83
|
+
apply or safely return the native question on that attempt, switch immediately
|
|
84
|
+
to the exact textual approval. Do not ask the user to request the buttons again
|
|
85
|
+
and do not create a retry loop or simulated control.
|
|
71
86
|
|
|
72
87
|
Surface behavior:
|
|
73
88
|
|
|
74
|
-
- Codex:
|
|
75
|
-
- Claude Code:
|
|
89
|
+
- 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.
|
|
90
|
+
- 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.
|
|
76
91
|
- 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.
|
|
77
92
|
- Other, unavailable or non-interactive surfaces: use exact textual approval and wait for a new explicit user response.
|
|
78
93
|
|
|
94
|
+
Localized labels such as `Überarbeiten`/`Revise`, `Ablehnen`/`Decline` and `Abbrechen`/`Cancel` are presentation mappings to stable non-approval outcomes only. Host-provided free-text or `Überspringen`/`Skip` actions never advance an AGDF gate.
|
|
95
|
+
|
|
79
96
|
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.
|
|
80
97
|
|
|
81
98
|
## Rules
|
|
@@ -165,6 +182,11 @@ Keep the result short and operational. Render the Runtime Contract's compact hum
|
|
|
165
182
|
|
|
166
183
|
When an approval is missing, also include `Next gate after approval` and `Allowed after approval` exactly as constrained by the Runtime Contract. Keep forbidden outputs, evidence and next-skill detail in the concise surrounding text when relevant; they are not extra status-card rows.
|
|
167
184
|
|
|
185
|
+
This operational status table is for status reporting. When the same response
|
|
186
|
+
immediately requests a ready gate approval, replace the table in the visible
|
|
187
|
+
approval experience with the Gate Transition Card defined above, then invoke
|
|
188
|
+
the native question or exact-text fallback. Do not show both cards.
|
|
189
|
+
|
|
168
190
|
If this skill creates or updates control artefacts, do not paste full file bodies into the chat.
|
|
169
191
|
List paths, summarize the decision, name the blocker or approval needed, and keep the durable content in the files.
|
|
170
192
|
|
|
@@ -83,6 +83,8 @@ When a run needs an operational status view, use the Run Status Card as a compac
|
|
|
83
83
|
It must not introduce a second gate model or override `gate-check`, `delivery-map`, QA, OR, or user approvals.
|
|
84
84
|
|
|
85
85
|
- `mode`: `quick_task | verified_change | structured_delivery | unknown`
|
|
86
|
+
- `run_id`: the exactly selected canonical run
|
|
87
|
+
- `presentation_language`: `de | en`, with unsupported or absent chat language resolved to `en`
|
|
86
88
|
- `status`: `open | blocked | pass | warn | revise | block | in_progress`
|
|
87
89
|
- `current_gate`: current user gate or internal step
|
|
88
90
|
- `mode_slice_decision`: `undecided | quick_task | verified_change | structured_slice | structured_delivery | block`
|
|
@@ -92,6 +94,10 @@ It must not introduce a second gate model or override `gate-check`, `delivery-ma
|
|
|
92
94
|
- `missing_approval`: exact missing approval formula or `none`
|
|
93
95
|
- `next_gate_after_approval`: the next user gate or internal step unlocked by the missing approval, or `none`
|
|
94
96
|
- `allowed_after_approval`: concise description of what becomes allowed after the missing approval, or `none`
|
|
97
|
+
- `user_visible_outcome_after_approval`: concise user-facing result of approving the current gate
|
|
98
|
+
- `internal_next_step`: the next agent-controlled process step, or `none`
|
|
99
|
+
- `next_user_gate`: the next actual user approval gate, or `none`
|
|
100
|
+
- `user_action_required`: `yes` only when the user must provide another deliberate approval or decision; otherwise `no`
|
|
95
101
|
- `evidence`: concrete evidence references currently visible
|
|
96
102
|
- `next_skill`: next AGDF skill or `none`
|
|
97
103
|
- `next_step`: the single next permissible process action
|
|
@@ -139,6 +145,56 @@ and `Allowed after approval` when a missing approval exists, `Next step` and
|
|
|
139
145
|
`Quality outlook`. Keep mode, forbidden actions, evidence and next-skill detail
|
|
140
146
|
in the surrounding control artefact when they are relevant.
|
|
141
147
|
|
|
148
|
+
## Gate Transition Card
|
|
149
|
+
|
|
150
|
+
The Gate Transition Card is the primary user-facing orientation message for a
|
|
151
|
+
ready `gate_approval`. It is derived from the Run Status Card and canonical
|
|
152
|
+
post-approval transition, but it is not another state model, persisted record,
|
|
153
|
+
renderer or approval authority. The Run Status Card remains the operational,
|
|
154
|
+
CLI and audit projection; the Gate Transition Card turns only the decision-
|
|
155
|
+
relevant subset into concise product copy immediately before the host-native
|
|
156
|
+
question or exact-text fallback.
|
|
157
|
+
|
|
158
|
+
The card answers exactly three user questions, in this order:
|
|
159
|
+
|
|
160
|
+
1. **Where am I?** A human-readable gate title, selected `run_id` as secondary
|
|
161
|
+
context and a clear ready-for-decision state.
|
|
162
|
+
2. **What does this decision do?** The exact `Approval: <GateName>` value, its
|
|
163
|
+
concrete next outcome and the most important boundary that remains.
|
|
164
|
+
3. **What happens next?** The immediate agent-controlled action and the next
|
|
165
|
+
actual user decision when one exists; otherwise a plain statement that no
|
|
166
|
+
further user action is required now.
|
|
167
|
+
|
|
168
|
+
Use this compact composition:
|
|
169
|
+
|
|
170
|
+
```text
|
|
171
|
+
<human-readable gate title> · <run_id>
|
|
172
|
+
<localized ready-for-decision line>
|
|
173
|
+
|
|
174
|
+
<localized approve heading>
|
|
175
|
+
`Approval: <GateName>` <localized concrete effect>. <localized remaining boundary>.
|
|
176
|
+
|
|
177
|
+
<localized next heading>
|
|
178
|
+
<localized immediate agent action>. <localized next user decision or no-action statement>.
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
Resolve all explanatory text through the Interaction Locale Contract. German
|
|
182
|
+
uses the approved German product labels for readiness, approval and the next
|
|
183
|
+
transition; English is the deterministic default for absent or unsupported
|
|
184
|
+
locales. Gate names, `run_id` and exact approval values are never translated.
|
|
185
|
+
The meaning, ordering and authority boundary must be identical across locales.
|
|
186
|
+
|
|
187
|
+
The approval-time card must not be a Markdown table or dashboard. It must not
|
|
188
|
+
present raw control-state keys, machine status values, diagnostic codes,
|
|
189
|
+
evidence lists, allowed/forbidden inventories or implementation detail that is
|
|
190
|
+
not needed for the decision. It must not repeat the native question. The card
|
|
191
|
+
normally fits in one title, one readiness line and two short content blocks.
|
|
192
|
+
|
|
193
|
+
For `Approval: TP`, the effect is permission to run pre-implementation
|
|
194
|
+
Brownfield Analysis, implementation remains gated until that analysis passes,
|
|
195
|
+
and the next block states plainly that no further user decision is required
|
|
196
|
+
now. Brownfield Analysis must not be presented as a user gate.
|
|
197
|
+
|
|
142
198
|
## Source Precedence
|
|
143
199
|
|
|
144
200
|
Every governed repository should make the normative instruction source visible.
|
|
@@ -295,24 +351,38 @@ response_origin: deliberate_user_input for gate_approval
|
|
|
295
351
|
|
|
296
352
|
This envelope is not a new persisted record. The selected canonical `RUN_STATE.md` and existing artefact chain remain the durable authority.
|
|
297
353
|
|
|
354
|
+
Before presenting `gate_approval` for any user gate (`UR`, `PRD`, `SD`, `TP`,
|
|
355
|
+
`QA`, or `UAT`), the agent must emit the localized Gate Transition Card as a
|
|
356
|
+
separate, immediately preceding interaction block. The card is not optional,
|
|
357
|
+
not hidden in the question text and not replaced by a host button label.
|
|
358
|
+
Native buttons or exact-text fallback may appear only after this card. The
|
|
359
|
+
underlying Run Status Card fields remain available to evaluation and audit,
|
|
360
|
+
but their dashboard projection must not be pasted into this approval-time
|
|
361
|
+
message.
|
|
362
|
+
|
|
298
363
|
Before presenting `gate_approval`, the agent must:
|
|
299
364
|
|
|
300
365
|
1. resolve exactly one selected run;
|
|
301
366
|
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;
|
|
367
|
+
3. emit the separate localized Gate Transition Card immediately before the gate question, then 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
368
|
4. wait for deliberate user input without a timeout, default, preselection, hook-supplied answer or agent-to-agent substitute;
|
|
304
369
|
5. re-run canonical gate evaluation against the same `run_id` and expected gate immediately before persistence;
|
|
305
370
|
6. reject missing evidence, ambiguous or wrong run, wrong gate, stale state and any response that is no longer valid;
|
|
306
371
|
7. persist an accepted approval only through the existing control-state workflow.
|
|
307
372
|
|
|
373
|
+
The first eligible native-attempt has a single bounded outcome: the declared
|
|
374
|
+
host control is presented, or the agent immediately uses the exact-text
|
|
375
|
+
fallback. A host that does not apply the control does not trigger a second
|
|
376
|
+
native prompt. AGDF must not simulate or force host-owned presentation.
|
|
377
|
+
|
|
308
378
|
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.
|
|
309
379
|
|
|
310
380
|
Surface adapter rules:
|
|
311
381
|
|
|
312
382
|
| Surface | Native question adapter | Gate-safe use | Technical permission boundary |
|
|
313
383
|
|---|---|---|---|
|
|
314
|
-
| Codex | native `request_user_input` or equivalent short-question control when callable | one gate question
|
|
315
|
-
| Claude Code | `AskUserQuestion` | use only when no timeout can auto-continue and no hook supplies `answers` or `updatedInput`;
|
|
384
|
+
| 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`. |
|
|
385
|
+
| 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. |
|
|
316
386
|
| 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. |
|
|
317
387
|
| 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. |
|
|
318
388
|
|
|
@@ -320,6 +390,20 @@ Native structured questions are for real decision points. Prefer repository insp
|
|
|
320
390
|
|
|
321
391
|
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.
|
|
322
392
|
|
|
393
|
+
### Interaction Locale Contract
|
|
394
|
+
|
|
395
|
+
User-facing native questions, option descriptions and exact-text fallback explanations use the configured project chat language from `.agdf/control/config.json`:
|
|
396
|
+
|
|
397
|
+
- `chat_language: de` selects the German presentation copy;
|
|
398
|
+
- `chat_language: en` selects English presentation copy;
|
|
399
|
+
- an absent, unsupported or not-yet-translated chat language falls back deterministically to English;
|
|
400
|
+
- one question must not mix presentation languages;
|
|
401
|
+
- durable artefacts, runtime rules, task identifiers and machine-facing approval values remain English;
|
|
402
|
+
- the exact approval value remains `Approval: <GateName>` in every locale;
|
|
403
|
+
- localized `revise`, `decline` and `cancel` labels are presentation text only and never carry gate authority.
|
|
404
|
+
|
|
405
|
+
The locale changes presentation only. It must not change gate meaning, option ordering, readiness, validation, revalidation or persistence. Host-provided free-text labels and skip actions are not AGDF-owned approval options and must never advance a gate.
|
|
406
|
+
|
|
323
407
|
## Brownfield Review After G-00
|
|
324
408
|
|
|
325
409
|
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.
|
|
@@ -62,20 +62,37 @@ For a ready `gate_approval`:
|
|
|
62
62
|
|
|
63
63
|
1. Resolve exactly one selected run and evaluate the current gate.
|
|
64
64
|
2. Confirm the required durable artefact is present and ready before presenting a question.
|
|
65
|
-
3.
|
|
66
|
-
4.
|
|
67
|
-
5.
|
|
68
|
-
6.
|
|
69
|
-
7.
|
|
70
|
-
8.
|
|
65
|
+
3. Render a separate localized Gate Transition Card immediately before any native question or exact-text fallback. Never put the card only into the question, button description or hidden tool context.
|
|
66
|
+
4. Treat the operational Run Status Card as evaluation and audit input, not as the approval-time product surface. Do not paste its table, raw keys, machine statuses, evidence or diagnostic detail into the transition card.
|
|
67
|
+
5. Compose the transition card as one human-readable gate title with `run_id`, one ready-for-decision line, one short approval-effect block and one short next-transition block. It must answer only: where am I, what does this decision do, and what happens next.
|
|
68
|
+
6. Distinguish internal process steps from user decisions in natural language. For example, after `Approval: TP`, say that pre-implementation Brownfield Analysis runs next and that no further user action is required now; do not expose `next_user_gate: none` or `user_action_required: no`, and do not ask for a second approval for Brownfield Analysis.
|
|
69
|
+
7. Ask exactly one question that names the selected `run_id` and `current_gate`.
|
|
70
|
+
8. Offer the exact approving option `Approval: <GateName>` plus bounded revise and cancel/decline outcomes.
|
|
71
|
+
9. 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.
|
|
72
|
+
10. Re-run gate evaluation for the same run and expected gate after the response and immediately before persistence.
|
|
73
|
+
11. 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.
|
|
74
|
+
12. Persist accepted input only through the existing control-state workflow.
|
|
75
|
+
|
|
76
|
+
Before composing the question, resolve the configured chat locale from `.agdf/control/config.json`. Use German presentation text for `chat_language: de`; use English for `chat_language: en` or as the deterministic fallback for an absent or unsupported locale. Keep `Approval: <GateName>` exactly unchanged in every language, and do not mix presentation languages within one question.
|
|
77
|
+
|
|
78
|
+
For the transition card, German uses `Bereit für deine Entscheidung`, `Jetzt freigeben` and `Danach`; English uses `Ready for your decision`, `Approve now` and `Next`. Keep each card in one locale. Use a human-readable gate title rather than an internal status label. Do not render a Markdown table, dashboard rows, raw control-state keys, diagnostic codes, evidence lists, a duplicated gate question or a false user gate in the approval-time card.
|
|
79
|
+
|
|
80
|
+
The primary option remains exactly `Approval: SD`; only explanatory copy and non-authoritative outcome labels are localized. Concrete localized copy belongs to the user-facing interaction layer or the approved delivery artefact, not to English runtime rules.
|
|
81
|
+
|
|
82
|
+
Make exactly one native-attempt for the ready gate. If the host does not render,
|
|
83
|
+
apply or safely return the native question on that attempt, switch immediately
|
|
84
|
+
to the exact textual approval. Do not ask the user to request the buttons again
|
|
85
|
+
and do not create a retry loop or simulated control.
|
|
71
86
|
|
|
72
87
|
Surface behavior:
|
|
73
88
|
|
|
74
|
-
- Codex:
|
|
75
|
-
- Claude Code:
|
|
89
|
+
- 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.
|
|
90
|
+
- 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.
|
|
76
91
|
- 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.
|
|
77
92
|
- Other, unavailable or non-interactive surfaces: use exact textual approval and wait for a new explicit user response.
|
|
78
93
|
|
|
94
|
+
Localized labels such as `Überarbeiten`/`Revise`, `Ablehnen`/`Decline` and `Abbrechen`/`Cancel` are presentation mappings to stable non-approval outcomes only. Host-provided free-text or `Überspringen`/`Skip` actions never advance an AGDF gate.
|
|
95
|
+
|
|
79
96
|
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.
|
|
80
97
|
|
|
81
98
|
## Rules
|
|
@@ -165,6 +182,11 @@ Keep the result short and operational. Render the Runtime Contract's compact hum
|
|
|
165
182
|
|
|
166
183
|
When an approval is missing, also include `Next gate after approval` and `Allowed after approval` exactly as constrained by the Runtime Contract. Keep forbidden outputs, evidence and next-skill detail in the concise surrounding text when relevant; they are not extra status-card rows.
|
|
167
184
|
|
|
185
|
+
This operational status table is for status reporting. When the same response
|
|
186
|
+
immediately requests a ready gate approval, replace the table in the visible
|
|
187
|
+
approval experience with the Gate Transition Card defined above, then invoke
|
|
188
|
+
the native question or exact-text fallback. Do not show both cards.
|
|
189
|
+
|
|
168
190
|
If this skill creates or updates control artefacts, do not paste full file bodies into the chat.
|
|
169
191
|
List paths, summarize the decision, name the blocker or approval needed, and keep the durable content in the files.
|
|
170
192
|
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export function validateGateApprovalResponse({
|
|
2
|
+
response,
|
|
3
|
+
responseOrigin,
|
|
4
|
+
expectedApproval,
|
|
5
|
+
expectedRunId,
|
|
6
|
+
currentRunId,
|
|
7
|
+
expectedGate,
|
|
8
|
+
currentGate,
|
|
9
|
+
expectedRevisionId,
|
|
10
|
+
currentRevisionId,
|
|
11
|
+
durableArtefactReady,
|
|
12
|
+
}) {
|
|
13
|
+
const checks = [
|
|
14
|
+
[responseOrigin === "deliberate_user_input", "non_deliberate_response"],
|
|
15
|
+
[typeof response === "string" && response.length > 0, "empty_response"],
|
|
16
|
+
[expectedApproval === `Approval: ${expectedGate}`, "approval_formula_mismatch"],
|
|
17
|
+
[response === expectedApproval, "wrong_or_non_approval_response"],
|
|
18
|
+
[Boolean(expectedRunId) && expectedRunId === currentRunId, "changed_or_wrong_run"],
|
|
19
|
+
[Boolean(expectedGate) && expectedGate === currentGate, "changed_or_wrong_gate"],
|
|
20
|
+
[Boolean(expectedRevisionId) && expectedRevisionId === currentRevisionId, "stale_revision"],
|
|
21
|
+
[durableArtefactReady === true, "durable_artefact_not_ready"],
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
const failed = checks.find(([accepted]) => !accepted);
|
|
25
|
+
return failed
|
|
26
|
+
? { accepted: false, reason: failed[1] }
|
|
27
|
+
: { accepted: true, reason: "accepted" };
|
|
28
|
+
}
|
package/package.json
CHANGED