create-agdf 0.7.3 → 0.8.1
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 +149 -35
- package/generated/.github/skills/agdf-gate-check/SKILL.md +27 -8
- package/generated/.github/skills/agdf-interaction-locales.json +184 -0
- package/generated/.github/skills/agdf-runtime-contract.md +134 -3
- package/generated/.opencode/agdf-interaction-locales.json +184 -0
- package/generated/.opencode/agdf-runtime-contract.md +134 -3
- package/generated/.opencode/skills/agdf-gate-check/SKILL.md +27 -8
- package/generated/plugins/agdf/.codex-plugin/plugin.json +1 -1
- package/generated/plugins/agdf/meta/agdf-interaction-locales.json +184 -0
- package/generated/plugins/agdf/meta/agdf-plugin.definition.json +44 -1
- package/generated/plugins/agdf/meta/agdf-runtime-contract.md +134 -3
- package/generated/plugins/agdf/skills/gate-check/SKILL.md +27 -8
- package/lib/control-state/gate-approval-validator.js +49 -0
- package/lib/control-state/index.js +1 -0
- package/lib/interaction-presentation.js +169 -0
- package/package.json +3 -2
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"fallbackLocale": "en",
|
|
4
|
+
"optionOrder": ["approve", "revise", "decline", "cancel"],
|
|
5
|
+
"lengthBudgets": {
|
|
6
|
+
"label": 40,
|
|
7
|
+
"description": 160,
|
|
8
|
+
"title": 100
|
|
9
|
+
},
|
|
10
|
+
"locales": {
|
|
11
|
+
"en": {
|
|
12
|
+
"statusCard": {
|
|
13
|
+
"title": "AGDF status-card",
|
|
14
|
+
"run": "Selected run",
|
|
15
|
+
"humanTitle": "Run title",
|
|
16
|
+
"gate": "Current gate",
|
|
17
|
+
"blocked": "Blocked by",
|
|
18
|
+
"missing": "Missing approval",
|
|
19
|
+
"outcome": "Outcome after approval",
|
|
20
|
+
"internal": "Internal next step",
|
|
21
|
+
"userGate": "Next user gate",
|
|
22
|
+
"userAction": "User action required",
|
|
23
|
+
"nextGate": "Next gate after approval",
|
|
24
|
+
"allowedAfter": "Allowed after approval",
|
|
25
|
+
"skill": "Next skill",
|
|
26
|
+
"step": "Next step",
|
|
27
|
+
"quality": "Quality outlook",
|
|
28
|
+
"allowed": "Allowed now",
|
|
29
|
+
"forbidden": "Forbidden now",
|
|
30
|
+
"artefacts": "Artefacts"
|
|
31
|
+
},
|
|
32
|
+
"gateTitles": {
|
|
33
|
+
"UR": "User requirements",
|
|
34
|
+
"PRD": "Product requirements",
|
|
35
|
+
"SD": "Solution design",
|
|
36
|
+
"TP": "Task and test plan",
|
|
37
|
+
"QA": "Quality assurance",
|
|
38
|
+
"UAT": "User acceptance",
|
|
39
|
+
"Brownfield Review": "Brownfield review",
|
|
40
|
+
"Mode/Slice Decision": "Delivery scope decision",
|
|
41
|
+
"Brownfield Analysis": "Implementation preparation",
|
|
42
|
+
"CD+Tests": "Implementation and tests",
|
|
43
|
+
"CR": "Code review",
|
|
44
|
+
"OR": "Delivery report"
|
|
45
|
+
},
|
|
46
|
+
"interaction": {
|
|
47
|
+
"ready": "Ready for your decision",
|
|
48
|
+
"approveHeading": "Approve now",
|
|
49
|
+
"nextHeading": "Next",
|
|
50
|
+
"approveDescription": "Approve this gate with the exact authorization value.",
|
|
51
|
+
"reviseLabel": "Revise",
|
|
52
|
+
"reviseDescription": "Keep the gate open and request changes.",
|
|
53
|
+
"declineLabel": "Decline",
|
|
54
|
+
"declineDescription": "Reject this gate deliberately; authority remains unchanged.",
|
|
55
|
+
"cancelLabel": "Cancel",
|
|
56
|
+
"cancelDescription": "Close this decision without approving or declining it."
|
|
57
|
+
},
|
|
58
|
+
"artefacts": {
|
|
59
|
+
"notYetCreated": "not yet created"
|
|
60
|
+
},
|
|
61
|
+
"primary": {
|
|
62
|
+
"status": {
|
|
63
|
+
"open": "open",
|
|
64
|
+
"blocked": "blocked",
|
|
65
|
+
"pass": "passed",
|
|
66
|
+
"warn": "attention needed",
|
|
67
|
+
"revise": "revision needed",
|
|
68
|
+
"in_progress": "in progress"
|
|
69
|
+
},
|
|
70
|
+
"none": "none",
|
|
71
|
+
"blocked": "current gate prerequisites",
|
|
72
|
+
"quality": "Keep the presentation contract, evidence and gate authority aligned.",
|
|
73
|
+
"actions": {
|
|
74
|
+
"UR": "Clarify and approve the user requirements.",
|
|
75
|
+
"Brownfield Review": "Review existing owners and choose the smallest safe delivery path.",
|
|
76
|
+
"Mode/Slice Decision": "Decide the proportionate delivery scope from repository evidence.",
|
|
77
|
+
"PRD": "Define and approve the product behavior.",
|
|
78
|
+
"SD": "Define and approve the solution design.",
|
|
79
|
+
"TP": "Define and approve the task and test plan.",
|
|
80
|
+
"Brownfield Analysis": "Verify owners, reuse and regression coverage before implementation.",
|
|
81
|
+
"CD+Tests": "Implement the approved plan and collect test evidence.",
|
|
82
|
+
"CR": "Review the implementation and resolve blocking findings.",
|
|
83
|
+
"QA": "Evaluate quality evidence and make the QA decision.",
|
|
84
|
+
"UAT": "Make the deliberate user-acceptance decision.",
|
|
85
|
+
"OR": "Prepare the auditable delivery report."
|
|
86
|
+
},
|
|
87
|
+
"afterApproval": {
|
|
88
|
+
"UR": "Review existing owners and choose the proportionate delivery path; implementation remains blocked.",
|
|
89
|
+
"PRD": "Draft the solution design; implementation remains blocked.",
|
|
90
|
+
"SD": "Draft the task and test plan; implementation remains blocked.",
|
|
91
|
+
"TP": "Run pre-implementation Brownfield Analysis; implementation starts only if it passes.",
|
|
92
|
+
"QA": "Prepare the user-acceptance decision; release remains blocked.",
|
|
93
|
+
"UAT": "Prepare the delivery report; version-control and release actions still require explicit instruction."
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
"de": {
|
|
98
|
+
"statusCard": {
|
|
99
|
+
"title": "AGDF-Statuskarte",
|
|
100
|
+
"run": "Ausgewählter Run",
|
|
101
|
+
"humanTitle": "Run-Titel",
|
|
102
|
+
"gate": "Aktuelles Gate",
|
|
103
|
+
"blocked": "Blockiert durch",
|
|
104
|
+
"missing": "Fehlende Freigabe",
|
|
105
|
+
"outcome": "Ergebnis nach Freigabe",
|
|
106
|
+
"internal": "Interner nächster Schritt",
|
|
107
|
+
"userGate": "Nächstes User-Gate",
|
|
108
|
+
"userAction": "Nutzeraktion erforderlich",
|
|
109
|
+
"nextGate": "Nächstes Gate nach Freigabe",
|
|
110
|
+
"allowedAfter": "Nach Freigabe erlaubt",
|
|
111
|
+
"skill": "Nächster Skill",
|
|
112
|
+
"step": "Nächster Schritt",
|
|
113
|
+
"quality": "Qualitätsausblick",
|
|
114
|
+
"allowed": "Jetzt erlaubt",
|
|
115
|
+
"forbidden": "Aktuell verboten",
|
|
116
|
+
"artefacts": "Artefakte"
|
|
117
|
+
},
|
|
118
|
+
"gateTitles": {
|
|
119
|
+
"UR": "Nutzeranforderungen",
|
|
120
|
+
"PRD": "Produktanforderungen",
|
|
121
|
+
"SD": "Lösungsdesign",
|
|
122
|
+
"TP": "Aufgaben- und Testplan",
|
|
123
|
+
"QA": "Qualitätssicherung",
|
|
124
|
+
"UAT": "Nutzerabnahme",
|
|
125
|
+
"Brownfield Review": "Brownfield-Prüfung",
|
|
126
|
+
"Mode/Slice Decision": "Entscheidung zum Lieferumfang",
|
|
127
|
+
"Brownfield Analysis": "Implementierungsvorbereitung",
|
|
128
|
+
"CD+Tests": "Implementierung und Tests",
|
|
129
|
+
"CR": "Code-Review",
|
|
130
|
+
"OR": "Lieferbericht"
|
|
131
|
+
},
|
|
132
|
+
"interaction": {
|
|
133
|
+
"ready": "Bereit für deine Entscheidung",
|
|
134
|
+
"approveHeading": "Jetzt freigeben",
|
|
135
|
+
"nextHeading": "Danach",
|
|
136
|
+
"approveDescription": "Dieses Gate mit dem exakten Freigabewert autorisieren.",
|
|
137
|
+
"reviseLabel": "Überarbeiten",
|
|
138
|
+
"reviseDescription": "Das Gate offen lassen und Änderungen anfordern.",
|
|
139
|
+
"declineLabel": "Ablehnen",
|
|
140
|
+
"declineDescription": "Dieses Gate bewusst ablehnen; die Berechtigung bleibt unverändert.",
|
|
141
|
+
"cancelLabel": "Abbrechen",
|
|
142
|
+
"cancelDescription": "Diese Entscheidung ohne Freigabe oder Ablehnung schließen."
|
|
143
|
+
},
|
|
144
|
+
"artefacts": {
|
|
145
|
+
"notYetCreated": "noch nicht erstellt"
|
|
146
|
+
},
|
|
147
|
+
"primary": {
|
|
148
|
+
"status": {
|
|
149
|
+
"open": "offen",
|
|
150
|
+
"blocked": "blockiert",
|
|
151
|
+
"pass": "bestanden",
|
|
152
|
+
"warn": "Prüfung erforderlich",
|
|
153
|
+
"revise": "Überarbeitung erforderlich",
|
|
154
|
+
"in_progress": "in Arbeit"
|
|
155
|
+
},
|
|
156
|
+
"none": "keine",
|
|
157
|
+
"blocked": "Voraussetzungen des aktuellen Gates",
|
|
158
|
+
"quality": "Präsentationsvertrag, Nachweise und Gate-Berechtigung konsistent halten.",
|
|
159
|
+
"actions": {
|
|
160
|
+
"UR": "Nutzeranforderungen klären und freigeben.",
|
|
161
|
+
"Brownfield Review": "Bestehende Owner prüfen und den kleinsten sicheren Lieferweg wählen.",
|
|
162
|
+
"Mode/Slice Decision": "Den angemessenen Lieferumfang anhand der Repository-Nachweise festlegen.",
|
|
163
|
+
"PRD": "Produktverhalten definieren und freigeben.",
|
|
164
|
+
"SD": "Lösungsdesign definieren und freigeben.",
|
|
165
|
+
"TP": "Aufgaben- und Testplan definieren und freigeben.",
|
|
166
|
+
"Brownfield Analysis": "Owner, Wiederverwendung und Regressionstests vor der Implementierung prüfen.",
|
|
167
|
+
"CD+Tests": "Den freigegebenen Plan implementieren und Testnachweise sammeln.",
|
|
168
|
+
"CR": "Implementierung prüfen und blockierende Befunde beheben.",
|
|
169
|
+
"QA": "Qualitätsnachweise bewerten und die QA-Entscheidung treffen.",
|
|
170
|
+
"UAT": "Die bewusste Nutzerabnahme entscheiden.",
|
|
171
|
+
"OR": "Den auditierbaren Lieferbericht erstellen."
|
|
172
|
+
},
|
|
173
|
+
"afterApproval": {
|
|
174
|
+
"UR": "Bestehende Owner prüfen und den angemessenen Lieferweg wählen; die Implementierung bleibt gesperrt.",
|
|
175
|
+
"PRD": "Das Lösungsdesign entwerfen; die Implementierung bleibt gesperrt.",
|
|
176
|
+
"SD": "Den Aufgaben- und Testplan entwerfen; die Implementierung bleibt gesperrt.",
|
|
177
|
+
"TP": "Die Brownfield-Analyse vor der Implementierung durchführen; die Implementierung startet nur nach bestandenem Ergebnis.",
|
|
178
|
+
"QA": "Die Nutzerabnahme vorbereiten; die Veröffentlichung bleibt gesperrt.",
|
|
179
|
+
"UAT": "Den Lieferbericht vorbereiten; Versionskontroll- und Veröffentlichungsaktionen benötigen weiterhin eine ausdrückliche Anweisung."
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"id": "agdf",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.8.1",
|
|
5
5
|
"displayName": "AI Governance & Delivery Framework",
|
|
6
6
|
"developerName": "Arndt Gold",
|
|
7
7
|
"description": "Codex-first operating system for governed AI-assisted delivery.",
|
|
@@ -67,29 +67,72 @@
|
|
|
67
67
|
},
|
|
68
68
|
"interactions": {
|
|
69
69
|
"fallback": "exact_text",
|
|
70
|
+
"localeRegistry": "meta/agdf-interaction-locales.json",
|
|
71
|
+
"fallbackLocale": "en",
|
|
72
|
+
"optionOrder": [
|
|
73
|
+
"approve",
|
|
74
|
+
"revise",
|
|
75
|
+
"decline",
|
|
76
|
+
"cancel"
|
|
77
|
+
],
|
|
78
|
+
"outcomes": [
|
|
79
|
+
"approve",
|
|
80
|
+
"revise",
|
|
81
|
+
"decline",
|
|
82
|
+
"cancel",
|
|
83
|
+
"no_response",
|
|
84
|
+
"timeout",
|
|
85
|
+
"empty",
|
|
86
|
+
"invalid",
|
|
87
|
+
"stale"
|
|
88
|
+
],
|
|
70
89
|
"surfaces": {
|
|
71
90
|
"codex": {
|
|
72
91
|
"questionAdapter": "request_user_input",
|
|
73
92
|
"availability": "when_callable",
|
|
74
93
|
"gateSafety": "omit_auto_resolution",
|
|
94
|
+
"explicitOutcomes": [
|
|
95
|
+
"approve",
|
|
96
|
+
"revise",
|
|
97
|
+
"decline"
|
|
98
|
+
],
|
|
99
|
+
"dismissOutcome": "cancel",
|
|
75
100
|
"technicalPermissionOwner": "codex_host"
|
|
76
101
|
},
|
|
77
102
|
"claude": {
|
|
78
103
|
"questionAdapter": "AskUserQuestion",
|
|
79
104
|
"availability": "when_no_auto_continue_timeout",
|
|
80
105
|
"gateSafety": "no_timeout_or_hook_supplied_answer",
|
|
106
|
+
"explicitOutcomes": [
|
|
107
|
+
"approve",
|
|
108
|
+
"revise",
|
|
109
|
+
"decline"
|
|
110
|
+
],
|
|
111
|
+
"dismissOutcome": "cancel",
|
|
81
112
|
"technicalPermissionOwner": "claude_host"
|
|
82
113
|
},
|
|
83
114
|
"opencode": {
|
|
84
115
|
"questionAdapter": "question",
|
|
85
116
|
"availability": "when_permission_question_allows",
|
|
86
117
|
"gateSafety": "preserve_explicit_deny",
|
|
118
|
+
"explicitOutcomes": [
|
|
119
|
+
"approve",
|
|
120
|
+
"revise",
|
|
121
|
+
"decline"
|
|
122
|
+
],
|
|
123
|
+
"dismissOutcome": "cancel",
|
|
87
124
|
"technicalPermissionOwner": "opencode_host"
|
|
88
125
|
},
|
|
89
126
|
"fallback": {
|
|
90
127
|
"questionAdapter": "exact_text",
|
|
91
128
|
"availability": "always",
|
|
92
129
|
"gateSafety": "wait_for_deliberate_user_input",
|
|
130
|
+
"explicitOutcomes": [
|
|
131
|
+
"approve",
|
|
132
|
+
"revise",
|
|
133
|
+
"decline",
|
|
134
|
+
"cancel"
|
|
135
|
+
],
|
|
93
136
|
"technicalPermissionOwner": "host_specific"
|
|
94
137
|
}
|
|
95
138
|
}
|
|
@@ -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`: the resolved complete locale-pack tag; absent, unsupported or incomplete packs resolve to the registry's deterministic `en` fallback
|
|
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,61 @@ 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 localized human-readable gate title, deterministic human
|
|
161
|
+
run title, selected `run_id` as secondary context, compact `UR · PRD · SD · TP`
|
|
162
|
+
artefact links and a clear ready-for-decision state.
|
|
163
|
+
2. **What does this decision do?** The exact `Approval: <GateName>` value, its
|
|
164
|
+
concrete next outcome and the most important boundary that remains.
|
|
165
|
+
3. **What happens next?** The immediate agent-controlled action and the next
|
|
166
|
+
actual user decision when one exists; otherwise a plain statement that no
|
|
167
|
+
further user action is required now.
|
|
168
|
+
|
|
169
|
+
Use this compact composition:
|
|
170
|
+
|
|
171
|
+
```text
|
|
172
|
+
<localized gate title> · <human run title> · <run_id>
|
|
173
|
+
<UR link or localized missing text> · <PRD link or localized missing text> · <SD link or localized missing text> · <TP link or localized missing text>
|
|
174
|
+
<localized ready-for-decision line>
|
|
175
|
+
|
|
176
|
+
<localized approve heading>
|
|
177
|
+
`Approval: <GateName>` <localized concrete effect>. <localized remaining boundary>.
|
|
178
|
+
|
|
179
|
+
<localized next heading>
|
|
180
|
+
<localized immediate agent action>. <localized next user decision or no-action statement>.
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
Resolve all AGDF-owned explanatory text through the canonical Interaction
|
|
184
|
+
Locale Registry. `en` and `de` are initial reviewed packs, not a closed locale
|
|
185
|
+
list. English is the deterministic fallback for absent, unsupported or
|
|
186
|
+
incomplete packs. Gate identifiers, `run_id`, canonical paths and exact
|
|
187
|
+
approval values are never translated. The visible gate title is localized;
|
|
188
|
+
for example, the German title may be `Lösungsdesign` while the authorization
|
|
189
|
+
value remains `Approval: SD`. Meaning, ordering and authority boundaries are
|
|
190
|
+
identical across locale packs.
|
|
191
|
+
|
|
192
|
+
The approval-time card must not be a Markdown table or dashboard. It must not
|
|
193
|
+
present raw control-state keys, machine status values, diagnostic codes,
|
|
194
|
+
evidence lists, allowed/forbidden inventories or implementation detail that is
|
|
195
|
+
not needed for the decision. It must not repeat the native question. The card
|
|
196
|
+
normally fits in one title, one readiness line and two short content blocks.
|
|
197
|
+
|
|
198
|
+
For `Approval: TP`, the effect is permission to run pre-implementation
|
|
199
|
+
Brownfield Analysis, implementation remains gated until that analysis passes,
|
|
200
|
+
and the next block states plainly that no further user decision is required
|
|
201
|
+
now. Brownfield Analysis must not be presented as a user gate.
|
|
202
|
+
|
|
142
203
|
## Source Precedence
|
|
143
204
|
|
|
144
205
|
Every governed repository should make the normative instruction source visible.
|
|
@@ -277,11 +338,13 @@ Every AGDF interaction belongs to exactly one semantic kind:
|
|
|
277
338
|
- `clarification`: asks for missing intent or a choice that does not itself authorize a gated transition.
|
|
278
339
|
- `tool_permission`: requests host-owned authority for a command, file change, network access, external path, app action or comparable technical side effect.
|
|
279
340
|
- `gate_approval`: requests deliberate user input for the one current AGDF user gate after its durable artefact and selected run are ready.
|
|
341
|
+
- `blocked`: explains a blocker and the one permissible recovery action without offering approval controls.
|
|
342
|
+
- `status`: reports current state without asking for a decision.
|
|
280
343
|
|
|
281
344
|
The semantic interaction envelope is:
|
|
282
345
|
|
|
283
346
|
```text
|
|
284
|
-
interaction_kind: clarification | tool_permission | gate_approval
|
|
347
|
+
interaction_kind: clarification | tool_permission | gate_approval | blocked | status
|
|
285
348
|
surface: codex | claude | opencode | fallback
|
|
286
349
|
run_id: required for gate_approval
|
|
287
350
|
current_gate: required for gate_approval
|
|
@@ -295,11 +358,20 @@ response_origin: deliberate_user_input for gate_approval
|
|
|
295
358
|
|
|
296
359
|
This envelope is not a new persisted record. The selected canonical `RUN_STATE.md` and existing artefact chain remain the durable authority.
|
|
297
360
|
|
|
361
|
+
Before presenting `gate_approval` for any user gate (`UR`, `PRD`, `SD`, `TP`,
|
|
362
|
+
`QA`, or `UAT`), the agent must emit the localized Gate Transition Card as a
|
|
363
|
+
separate, immediately preceding interaction block. The card is not optional,
|
|
364
|
+
not hidden in the question text and not replaced by a host button label.
|
|
365
|
+
Native buttons or exact-text fallback may appear only after this card. The
|
|
366
|
+
underlying Run Status Card fields remain available to evaluation and audit,
|
|
367
|
+
but their dashboard projection must not be pasted into this approval-time
|
|
368
|
+
message.
|
|
369
|
+
|
|
298
370
|
Before presenting `gate_approval`, the agent must:
|
|
299
371
|
|
|
300
372
|
1. resolve exactly one selected run;
|
|
301
373
|
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>`
|
|
374
|
+
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>` followed by stable `revise` and `decline` outcomes; host-owned dismissal maps to `cancel` where only three choices are available;
|
|
303
375
|
4. wait for deliberate user input without a timeout, default, preselection, hook-supplied answer or agent-to-agent substitute;
|
|
304
376
|
5. re-run canonical gate evaluation against the same `run_id` and expected gate immediately before persistence;
|
|
305
377
|
6. reject missing evidence, ambiguous or wrong run, wrong gate, stale state and any response that is no longer valid;
|
|
@@ -310,7 +382,7 @@ host control is presented, or the agent immediately uses the exact-text
|
|
|
310
382
|
fallback. A host that does not apply the control does not trigger a second
|
|
311
383
|
native prompt. AGDF must not simulate or force host-owned presentation.
|
|
312
384
|
|
|
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.
|
|
385
|
+
A free-form native response is valid only when the existing exact-approval validator accepts it for the current gate after revalidation. A localized label, description, option position, recommendation style or host action never authorizes a gate. Revise, decline and cancel outcomes never advance a gate.
|
|
314
386
|
|
|
315
387
|
Surface adapter rules:
|
|
316
388
|
|
|
@@ -325,6 +397,65 @@ Native structured questions are for real decision points. Prefer repository insp
|
|
|
325
397
|
|
|
326
398
|
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
399
|
|
|
400
|
+
### Interaction Locale Contract
|
|
401
|
+
|
|
402
|
+
User-facing native questions, option descriptions, primary chat cards, exact-text
|
|
403
|
+
fallback and human CLI output use the configured project chat language from
|
|
404
|
+
`.agdf/control/config.json` and the canonical registry
|
|
405
|
+
`plugin/meta/agdf-interaction-locales.json`:
|
|
406
|
+
|
|
407
|
+
- resolve an exact complete pack, then its language subtag, then deterministic English fallback;
|
|
408
|
+
- `en` and `de` are the initial complete packs; additional reviewed complete packs are supported without changing runtime logic;
|
|
409
|
+
- an incomplete pack is unsupported and must fail to English as a unit;
|
|
410
|
+
- one interaction must not mix presentation languages, including labels and descriptions;
|
|
411
|
+
- durable artefacts, runtime rules, task identifiers and machine-facing approval values remain English;
|
|
412
|
+
- the exact approval value remains `Approval: <GateName>` in every locale;
|
|
413
|
+
- localized `revise`, `decline` and `cancel` labels are presentation text only and never carry gate authority;
|
|
414
|
+
- host-owned chrome follows the host's own UI language and must not be presented as AGDF-translated chat copy.
|
|
415
|
+
|
|
416
|
+
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.
|
|
417
|
+
|
|
418
|
+
### Human Decision Presentation Contract
|
|
419
|
+
|
|
420
|
+
The primary user surface is a pure projection of the selected canonical run.
|
|
421
|
+
It must never become a second evaluator, state store, renderer authority or
|
|
422
|
+
approval path. Native controls, exact-text fallback and human CLI output use
|
|
423
|
+
the same semantic payload and outcome ordering; machine JSON retains its
|
|
424
|
+
stable field names and diagnostic values.
|
|
425
|
+
|
|
426
|
+
For every primary chat card:
|
|
427
|
+
|
|
428
|
+
1. Resolve a human run title deterministically from the current artefact
|
|
429
|
+
heading, approved UR heading, first non-empty Objective line, then normalized
|
|
430
|
+
`run_id`.
|
|
431
|
+
2. Show `UR · PRD · SD · TP` in that stable order. Existing selected-run
|
|
432
|
+
artefacts are links with readable labels; missing artefacts use localized
|
|
433
|
+
non-link text. Never guess a path or emit a broken link.
|
|
434
|
+
3. Use a localized visible gate title while preserving the exact gate identifier
|
|
435
|
+
and `Approval: <GateName>` authorization value.
|
|
436
|
+
4. Keep primary copy decision-oriented. Raw keys such as `next_user_gate`,
|
|
437
|
+
`mode_slice_decision` and `required_next_gate`, diagnostic codes and machine
|
|
438
|
+
status values belong to JSON or audit detail, not the primary interaction.
|
|
439
|
+
|
|
440
|
+
For a ready approval, explicit options are ordered `approve`, `revise`,
|
|
441
|
+
`decline`; an explicit `cancel` follows only on surfaces that support it, while
|
|
442
|
+
host dismissal maps to `cancel` on three-choice surfaces. Do not preselect,
|
|
443
|
+
auto-submit, recommend as authorization, skip or reorder an option. Labels and
|
|
444
|
+
descriptions use the same resolved locale and must have distinct, non-empty
|
|
445
|
+
accessible names. Translation length budgets must preserve meaning without
|
|
446
|
+
truncation being the only distinction.
|
|
447
|
+
|
|
448
|
+
Normalize outcomes as distinct values:
|
|
449
|
+
|
|
450
|
+
```text
|
|
451
|
+
approve | revise | decline | cancel | no_response | timeout | empty | invalid | stale
|
|
452
|
+
```
|
|
453
|
+
|
|
454
|
+
Missing input, timeout, cancellation and empty input are not decline. Only
|
|
455
|
+
`approve` backed by the exact revalidated `Approval: <GateName>` value may
|
|
456
|
+
advance a gate. Clarification, blocked, internal-step and status-only
|
|
457
|
+
interactions must not display gate-approval controls.
|
|
458
|
+
|
|
328
459
|
## Brownfield Review After G-00
|
|
329
460
|
|
|
330
461
|
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.
|
|
@@ -54,7 +54,7 @@ The CLI reports are validators and JSON evidence, not the primary user experienc
|
|
|
54
54
|
|
|
55
55
|
## Native Interaction Path
|
|
56
56
|
|
|
57
|
-
Use the Runtime Contract's Native Interaction Contract to classify every candidate interaction as `clarification`, `tool_permission` or `
|
|
57
|
+
Use the Runtime Contract's Native Interaction Contract to classify every candidate interaction as `clarification`, `tool_permission`, `gate_approval`, `blocked` or `status` before selecting a host control.
|
|
58
58
|
|
|
59
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
60
|
|
|
@@ -62,12 +62,22 @@ 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. It includes the deterministic human run title and `UR · PRD · SD · TP` links from the selected run. 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 options in stable order: exact `Approval: <GateName>`, localized revise and localized decline. Add explicit cancel only where supported after decline; otherwise host dismissal maps to cancel. Never preselect, skip, auto-submit or reorder an option.
|
|
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` through `plugin/meta/agdf-interaction-locales.json`: exact complete pack, language subtag, then English fallback. German and English are initial packs, not a closed language list. Keep `Approval: <GateName>` exactly unchanged in every language, and do not mix presentation languages within one interaction. Labels and descriptions use the same resolved locale; host-owned UI chrome remains host-owned and may use a different language.
|
|
77
|
+
|
|
78
|
+
For the transition card, use the complete resolved locale pack. The initial German pack includes `Bereit für deine Entscheidung`, `Jetzt freigeben` and `Danach`; the initial English pack includes `Ready for your decision`, `Approve now` and `Next`. Keep each card in one locale. Use a localized human-readable gate title rather than an internal status label, while leaving the exact gate identifier and approval value unchanged. 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.
|
|
71
81
|
|
|
72
82
|
Make exactly one native-attempt for the ready gate. If the host does not render,
|
|
73
83
|
apply or safely return the native question on that attempt, switch immediately
|
|
@@ -81,7 +91,11 @@ Surface behavior:
|
|
|
81
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.
|
|
82
92
|
- Other, unavailable or non-interactive surfaces: use exact textual approval and wait for a new explicit user response.
|
|
83
93
|
|
|
84
|
-
|
|
94
|
+
Localized labels such as `Überarbeiten`/`Revise`, `Ablehnen`/`Decline` and `Abbrechen`/`Cancel` are presentation mappings to stable non-approval outcomes only. A label, description, option position or recommendation never authorizes a gate. Host-provided free-text or `Überspringen`/`Skip` actions never advance an AGDF gate.
|
|
95
|
+
|
|
96
|
+
A free-form response must still exactly match the current gate's approval formula after revalidation. Keep `decline`, `cancel`, `no_response`, `timeout`, `empty`, `invalid` and `stale` distinct; none advances the gate. Native presentation, host permission and plan approval are inputs or separate authority domains, never durable AGDF authority.
|
|
97
|
+
|
|
98
|
+
Every primary chat card shows the selected run's `UR`, `PRD`, `SD` and `TP` in that order. Render an existing canonical path as a readable link and a missing artefact as localized non-link text; never guess paths. Resolve the human run title from current artefact heading, approved UR heading, Objective, then normalized `run_id`. Status, blocked, clarification and internal-step interactions use the same locale and artefact projection but do not show approval buttons. Keep raw process keys and machine status values in JSON or audit detail.
|
|
85
99
|
|
|
86
100
|
## Rules
|
|
87
101
|
1. Fail closed when a required approval or artefact status is missing.
|
|
@@ -170,6 +184,11 @@ Keep the result short and operational. Render the Runtime Contract's compact hum
|
|
|
170
184
|
|
|
171
185
|
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.
|
|
172
186
|
|
|
187
|
+
This operational status table is for status reporting. When the same response
|
|
188
|
+
immediately requests a ready gate approval, replace the table in the visible
|
|
189
|
+
approval experience with the Gate Transition Card defined above, then invoke
|
|
190
|
+
the native question or exact-text fallback. Do not show both cards.
|
|
191
|
+
|
|
173
192
|
If this skill creates or updates control artefacts, do not paste full file bodies into the chat.
|
|
174
193
|
List paths, summarize the decision, name the blocker or approval needed, and keep the durable content in the files.
|
|
175
194
|
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { normalizeInteractionOutcome } from "../interaction-presentation.js";
|
|
2
|
+
|
|
3
|
+
export function validateGateApprovalResponse({
|
|
4
|
+
response,
|
|
5
|
+
responseOutcome,
|
|
6
|
+
responseOrigin,
|
|
7
|
+
expectedApproval,
|
|
8
|
+
expectedRunId,
|
|
9
|
+
currentRunId,
|
|
10
|
+
expectedGate,
|
|
11
|
+
currentGate,
|
|
12
|
+
expectedRevisionId,
|
|
13
|
+
currentRevisionId,
|
|
14
|
+
durableArtefactReady,
|
|
15
|
+
timedOut = false,
|
|
16
|
+
noResponse = false,
|
|
17
|
+
}) {
|
|
18
|
+
const checks = [
|
|
19
|
+
[responseOrigin === "deliberate_user_input", "non_deliberate_response"],
|
|
20
|
+
[expectedApproval === `Approval: ${expectedGate}`, "approval_formula_mismatch"],
|
|
21
|
+
[Boolean(expectedRunId) && expectedRunId === currentRunId, "changed_or_wrong_run"],
|
|
22
|
+
[Boolean(expectedGate) && expectedGate === currentGate, "changed_or_wrong_gate"],
|
|
23
|
+
[Boolean(expectedRevisionId) && expectedRevisionId === currentRevisionId, "stale_revision"],
|
|
24
|
+
[durableArtefactReady === true, "durable_artefact_not_ready"],
|
|
25
|
+
];
|
|
26
|
+
|
|
27
|
+
const failed = checks.find(([accepted]) => !accepted);
|
|
28
|
+
if (failed) return { accepted: false, reason: failed[1] };
|
|
29
|
+
|
|
30
|
+
const outcomeCandidate = responseOutcome && responseOutcome !== "approve" ? responseOutcome : response;
|
|
31
|
+
const outcome = normalizeInteractionOutcome(outcomeCandidate, {
|
|
32
|
+
expectedApproval,
|
|
33
|
+
timedOut,
|
|
34
|
+
noResponse,
|
|
35
|
+
});
|
|
36
|
+
const rejectionReasons = {
|
|
37
|
+
revise: "revision_requested",
|
|
38
|
+
decline: "declined",
|
|
39
|
+
cancel: "cancelled",
|
|
40
|
+
no_response: "no_response",
|
|
41
|
+
timeout: "timed_out",
|
|
42
|
+
empty: "empty_response",
|
|
43
|
+
invalid: "wrong_or_non_approval_response",
|
|
44
|
+
stale: "stale_response",
|
|
45
|
+
};
|
|
46
|
+
return outcome === "approve"
|
|
47
|
+
? { accepted: true, reason: "accepted" }
|
|
48
|
+
: { accepted: false, reason: rejectionReasons[outcome] ?? "wrong_or_non_approval_response" };
|
|
49
|
+
}
|