create-agdf 0.8.2 → 0.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/create-agdf.js +61 -2
- package/generated/.github/skills/agdf-gate-check/SKILL.md +18 -14
- package/generated/.github/skills/agdf-interaction-locales.json +42 -0
- package/generated/.github/skills/agdf-qa-gate/SKILL.md +7 -0
- package/generated/.github/skills/agdf-runtime-contract.md +59 -16
- package/generated/.opencode/AGDF.md +4 -4
- package/generated/.opencode/agdf-interaction-locales.json +42 -0
- package/generated/.opencode/agdf-runtime-contract.md +59 -16
- package/generated/.opencode/skills/agdf-gate-check/SKILL.md +18 -14
- package/generated/.opencode/skills/agdf-qa-gate/SKILL.md +7 -0
- package/generated/AGENTS.md +4 -4
- package/generated/plugins/agdf/.codex-plugin/plugin.json +1 -1
- package/generated/plugins/agdf/meta/agdf-agent-router.md +4 -4
- package/generated/plugins/agdf/meta/agdf-interaction-locales.json +42 -0
- package/generated/plugins/agdf/meta/agdf-plugin.definition.json +8 -8
- package/generated/plugins/agdf/meta/agdf-runtime-contract.md +59 -16
- package/generated/plugins/agdf/skills/delivery-path-search/help.md +21 -3
- package/generated/plugins/agdf/skills/gate-check/SKILL.md +18 -14
- package/generated/plugins/agdf/skills/qa-gate/SKILL.md +7 -0
- package/lib/interaction-presentation.js +112 -1
- package/package.json +1 -1
package/bin/create-agdf.js
CHANGED
|
@@ -26,8 +26,10 @@ import {
|
|
|
26
26
|
verifyLegacyProjection,
|
|
27
27
|
} from "../lib/control-state/index.js";
|
|
28
28
|
import {
|
|
29
|
+
attachApprovalOrientationSnapshot,
|
|
29
30
|
buildArtefactRefs,
|
|
30
31
|
buildRunCandidates,
|
|
32
|
+
buildQualityReadiness,
|
|
31
33
|
canonicalizeLanguageTag,
|
|
32
34
|
formatArtefactRefs,
|
|
33
35
|
gateTitle,
|
|
@@ -60,7 +62,7 @@ const agdfFragmentPath = "AGENTS.agdf.md";
|
|
|
60
62
|
const openCodeConfigFragmentPath = "opencode.agdf.json";
|
|
61
63
|
const userGateOrder = ["UR", "PRD", "SD", "TP", "QA", "UAT"];
|
|
62
64
|
const durableGateArtefacts = new Set(["UR", "PRD", "SD", "TP", "QA"]);
|
|
63
|
-
const internalStepArtefacts = new Set(["Brownfield Review", "Verified Change", "Brownfield Analysis", "CD+Tests", "CR"]);
|
|
65
|
+
const internalStepArtefacts = new Set(["Brownfield Review", "Verified Change", "Brownfield Analysis", "CD+Tests", "TP Review", "Clean Implementation Review", "Clean Review", "CR", "Code Review"]);
|
|
64
66
|
const deliveryRelationships = [
|
|
65
67
|
{ from: "UR", relationship: "approved_by", to: "Approval: UR", requiredBy: "UR" },
|
|
66
68
|
{ from: "PRD", relationship: "derived_from", to: "UR", requiredBy: "PRD" },
|
|
@@ -2281,6 +2283,36 @@ function buildStatusCard({
|
|
|
2281
2283
|
};
|
|
2282
2284
|
}
|
|
2283
2285
|
|
|
2286
|
+
function statusFromReviewArtefact(artefact) {
|
|
2287
|
+
if (!artefact) return "unknown";
|
|
2288
|
+
const text = `${artefact.status ?? ""} ${artefact.notes ?? ""}`.toLowerCase();
|
|
2289
|
+
for (const status of ["block", "revise", "warn", "pass"]) {
|
|
2290
|
+
if (new RegExp(`\\b${status}(?:ed)?\\b`).test(text)) return status;
|
|
2291
|
+
}
|
|
2292
|
+
return "unknown";
|
|
2293
|
+
}
|
|
2294
|
+
|
|
2295
|
+
function qualityReadinessForRunState(runState, nextAction) {
|
|
2296
|
+
const artefacts = runState.artefacts;
|
|
2297
|
+
const plan = artefacts.get("TP Review");
|
|
2298
|
+
const clean = artefacts.get("Clean Implementation Review") ?? artefacts.get("Clean Review");
|
|
2299
|
+
const code = artefacts.get("CR") ?? artefacts.get("Code Review");
|
|
2300
|
+
const qa = artefacts.get("QA");
|
|
2301
|
+
if (![plan, clean, code, qa].some(Boolean)) return null;
|
|
2302
|
+
const reviewRows = [plan, clean, code, qa].filter(Boolean);
|
|
2303
|
+
const decisive = reviewRows.find((artefact) => /\b(?:block|revise)\b/i.test(`${artefact.status ?? ""} ${artefact.notes ?? ""}`));
|
|
2304
|
+
const readiness = buildQualityReadiness({
|
|
2305
|
+
planCoverage: statusFromReviewArtefact(plan),
|
|
2306
|
+
solutionIntegrity: statusFromReviewArtefact(clean),
|
|
2307
|
+
codeQuality: statusFromReviewArtefact(code),
|
|
2308
|
+
qaDecision: statusFromReviewArtefact(qa),
|
|
2309
|
+
decisiveReason: decisive?.notes ?? "",
|
|
2310
|
+
nextAction,
|
|
2311
|
+
});
|
|
2312
|
+
if (!readiness) return null;
|
|
2313
|
+
return Object.freeze({ ...readiness, decisive_reference: decisive?.path ?? "" });
|
|
2314
|
+
}
|
|
2315
|
+
|
|
2284
2316
|
function resolvedArtefactFile(targetDir, rawPath) {
|
|
2285
2317
|
const normalizedPath = String(rawPath ?? "").replace(/^`|`$/g, "").trim();
|
|
2286
2318
|
if (!normalizedPath || isAbsolute(normalizedPath) || normalizedPath.includes("<") || normalizedPath.includes(">")) return "";
|
|
@@ -2672,8 +2704,20 @@ function evaluateGateCheck(targetDir, selection = {}) {
|
|
|
2672
2704
|
chatLanguage: presentationLocale,
|
|
2673
2705
|
findings: deliveryMap.findings,
|
|
2674
2706
|
});
|
|
2707
|
+
const humanPresentation = buildHumanPresentation(targetDir, runState, currentGate, presentationLocale);
|
|
2675
2708
|
Object.defineProperty(statusCard, "humanPresentation", {
|
|
2676
|
-
value:
|
|
2709
|
+
value: humanPresentation,
|
|
2710
|
+
enumerable: false,
|
|
2711
|
+
});
|
|
2712
|
+
attachApprovalOrientationSnapshot(statusCard, {
|
|
2713
|
+
ready: status === "open" && missingApproval === `Approval: ${currentGate}`,
|
|
2714
|
+
humanPresentation,
|
|
2715
|
+
revisionId: extractField(runState.content ?? "", "revision_id"),
|
|
2716
|
+
registry: interactionLocales,
|
|
2717
|
+
requestedLocale: presentationLocale,
|
|
2718
|
+
});
|
|
2719
|
+
Object.defineProperty(statusCard, "runState", {
|
|
2720
|
+
value: runState,
|
|
2677
2721
|
enumerable: false,
|
|
2678
2722
|
});
|
|
2679
2723
|
|
|
@@ -2730,6 +2774,21 @@ function printGateCheckStatusCard(report) {
|
|
|
2730
2774
|
console.log(`${labels.allowed}: ${primary.actions[card.current_gate] ?? primary.none}`);
|
|
2731
2775
|
console.log(`${labels.step}: ${primary.actions[card.current_gate] ?? primary.none}`);
|
|
2732
2776
|
console.log(`${labels.quality}: ${primary.quality}`);
|
|
2777
|
+
const readiness = qualityReadinessForRunState(card.runState, report.next_allowed_action);
|
|
2778
|
+
if (readiness) {
|
|
2779
|
+
const quality = localePack(interactionLocales, card.presentation_language).qualityReadiness;
|
|
2780
|
+
console.log("");
|
|
2781
|
+
console.log(`${quality.title}: ${primary.status[readiness.status] ?? readiness.status}`);
|
|
2782
|
+
for (const row of readiness.rows) {
|
|
2783
|
+
console.log(`${quality.rows[row.id]}: ${primary.status[row.status] ?? quality.unknown}`);
|
|
2784
|
+
}
|
|
2785
|
+
const reason = readiness.decisive_reason
|
|
2786
|
+
|| (readiness.status === "pass" ? primary.none : quality.fallbackReasons[readiness.decisive_dimension] || primary.none);
|
|
2787
|
+
console.log(`${quality.reason}: ${reason}`);
|
|
2788
|
+
if (readiness.status !== "pass" && readiness.decisive_reference) console.log(`${quality.reference}: ${readiness.decisive_reference}`);
|
|
2789
|
+
console.log(`${quality.nextAction}: ${readiness.next_action || primary.none}`);
|
|
2790
|
+
console.log(`${quality.decisionOwner}: ${quality.decisionOwnerValue}`);
|
|
2791
|
+
}
|
|
2733
2792
|
}
|
|
2734
2793
|
|
|
2735
2794
|
function printGateCheckReport(report, json, statusCard = false) {
|
|
@@ -62,16 +62,18 @@ 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.
|
|
71
|
-
9.
|
|
72
|
-
10.
|
|
73
|
-
11.
|
|
74
|
-
12.
|
|
65
|
+
3. Build one immutable, non-authorizing presentation snapshot from the selected evaluated run and current revision identity.
|
|
66
|
+
4. Compose one Approval Orientation Envelope as one immediately preceding assistant message containing two distinct blocks. Render the compact localized approval-time Run Status Card first. It contains exactly selected run, readiness status, current gate, missing exact approval, one next action and quality outlook; omit raw keys, machine statuses, evidence, diagnostics and allowed/forbidden inventories.
|
|
67
|
+
5. In the same assistant message, render a separate localized Gate Transition Card second, 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 either card only into the question, button description or hidden tool context. Do not invoke the native question tool until the complete two-card envelope is visible.
|
|
68
|
+
6. 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. Run and gate identity may anchor both cards; do not duplicate status rows, action inventories or the native question.
|
|
69
|
+
7. 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.
|
|
70
|
+
8. Ask exactly one question that names the selected `run_id` and `current_gate`.
|
|
71
|
+
9. 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.
|
|
72
|
+
10. 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.
|
|
73
|
+
11. Render both cards once in that single complete assistant message. If the native attempt is unavailable or not applied, continue to exact text without repeating either card.
|
|
74
|
+
12. Re-run gate evaluation for the same run and expected gate after the response and immediately before persistence.
|
|
75
|
+
13. 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.
|
|
76
|
+
14. Persist accepted input only through the existing control-state workflow.
|
|
75
77
|
|
|
76
78
|
Before composing the question, resolve the configured chat locale from `.agdf/control/config.json` through `../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
79
|
|
|
@@ -191,10 +193,12 @@ Keep the result short and operational. Render the Runtime Contract's compact hum
|
|
|
191
193
|
|
|
192
194
|
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.
|
|
193
195
|
|
|
194
|
-
This operational status table
|
|
195
|
-
immediately requests a ready gate approval,
|
|
196
|
-
|
|
197
|
-
|
|
196
|
+
This complete operational status table remains the status-reporting and detail
|
|
197
|
+
surface. When the same response immediately requests a ready gate approval,
|
|
198
|
+
render its six-field compact approval-time projection first, then the Gate
|
|
199
|
+
Transition Card in the same immediately preceding assistant message, then
|
|
200
|
+
invoke exactly one native question or exact-text fallback. Both cards derive
|
|
201
|
+
from the same snapshot and are shown exactly once.
|
|
198
202
|
|
|
199
203
|
If this skill creates or updates control artefacts, do not paste full file bodies into the chat.
|
|
200
204
|
List paths, summarize the decision, name the blocker or approval needed, and keep the durable content in the files.
|
|
@@ -29,6 +29,27 @@
|
|
|
29
29
|
"forbidden": "Forbidden now",
|
|
30
30
|
"artefacts": "Artefacts"
|
|
31
31
|
},
|
|
32
|
+
"qualityReadiness": {
|
|
33
|
+
"title": "Quality Readiness",
|
|
34
|
+
"rows": {
|
|
35
|
+
"plan_coverage": "Plan coverage",
|
|
36
|
+
"solution_integrity": "Solution integrity",
|
|
37
|
+
"code_quality": "Code quality",
|
|
38
|
+
"qa_decision": "QA decision"
|
|
39
|
+
},
|
|
40
|
+
"reason": "Reason",
|
|
41
|
+
"reference": "Evidence report",
|
|
42
|
+
"nextAction": "Next action",
|
|
43
|
+
"decisionOwner": "Decision owner",
|
|
44
|
+
"decisionOwnerValue": "QA Gate",
|
|
45
|
+
"unknown": "evidence missing",
|
|
46
|
+
"fallbackReasons": {
|
|
47
|
+
"plan_coverage": "Plan coverage requires revision before QA can pass.",
|
|
48
|
+
"solution_integrity": "Solution integrity requires revision before QA can pass.",
|
|
49
|
+
"code_quality": "Code quality findings require revision before QA can pass.",
|
|
50
|
+
"qa_decision": "QA evidence requires revision before the gate can pass."
|
|
51
|
+
}
|
|
52
|
+
},
|
|
32
53
|
"gateTitles": {
|
|
33
54
|
"UR": "User requirements",
|
|
34
55
|
"PRD": "Product requirements",
|
|
@@ -115,6 +136,27 @@
|
|
|
115
136
|
"forbidden": "Aktuell verboten",
|
|
116
137
|
"artefacts": "Artefakte"
|
|
117
138
|
},
|
|
139
|
+
"qualityReadiness": {
|
|
140
|
+
"title": "Quality Readiness",
|
|
141
|
+
"rows": {
|
|
142
|
+
"plan_coverage": "Planabdeckung",
|
|
143
|
+
"solution_integrity": "Lösungsintegrität",
|
|
144
|
+
"code_quality": "Code-Qualität",
|
|
145
|
+
"qa_decision": "QA-Entscheidung"
|
|
146
|
+
},
|
|
147
|
+
"reason": "Grund",
|
|
148
|
+
"reference": "Nachweisbericht",
|
|
149
|
+
"nextAction": "Nächste Aktion",
|
|
150
|
+
"decisionOwner": "Entscheidungsinstanz",
|
|
151
|
+
"decisionOwnerValue": "QA-Gate",
|
|
152
|
+
"unknown": "Nachweis fehlt",
|
|
153
|
+
"fallbackReasons": {
|
|
154
|
+
"plan_coverage": "Die Planabdeckung muss vor einem QA-Pass überarbeitet werden.",
|
|
155
|
+
"solution_integrity": "Die Lösungsintegrität muss vor einem QA-Pass überarbeitet werden.",
|
|
156
|
+
"code_quality": "Code-Qualitätsbefunde müssen vor einem QA-Pass überarbeitet werden.",
|
|
157
|
+
"qa_decision": "Die QA-Nachweise müssen vor einem QA-Pass überarbeitet werden."
|
|
158
|
+
}
|
|
159
|
+
},
|
|
118
160
|
"gateTitles": {
|
|
119
161
|
"UR": "Nutzeranforderungen",
|
|
120
162
|
"PRD": "Produktanforderungen",
|
|
@@ -28,6 +28,13 @@ QA-specific `decision` is exactly `pass | revise | block`.
|
|
|
28
28
|
`pass` is allowed only when TP coverage, Brownfield fit, solution integrity, and relevant documentation/Context Graph impact are sufficiently evidenced.
|
|
29
29
|
`sot_drift` must not pass silently as a warning.
|
|
30
30
|
|
|
31
|
+
When post-CD+Tests review evidence exists, present the Runtime Contract's derived Quality
|
|
32
|
+
Readiness projection before the detailed QA report: Plan coverage, Solution integrity, Code
|
|
33
|
+
quality and QA decision in that order. Name `agdf-qa-gate` as the sole decision owner, show one
|
|
34
|
+
decisive reason and one permissible next action, and keep detailed reports as evidence links or
|
|
35
|
+
on-demand detail. The projection is non-authorizing and must not replace the Run Status Card,
|
|
36
|
+
Gate Transition Card or the durable QA report.
|
|
37
|
+
|
|
31
38
|
## Rules
|
|
32
39
|
1. No QA pass without strong evidence.
|
|
33
40
|
2. TP is the reference, not merely working code.
|
|
@@ -145,15 +145,55 @@ and `Allowed after approval` when a missing approval exists, `Next step` and
|
|
|
145
145
|
`Quality outlook`. Keep mode, forbidden actions, evidence and next-skill detail
|
|
146
146
|
in the surrounding control artefact when they are relevant.
|
|
147
147
|
|
|
148
|
+
## Quality Readiness Projection
|
|
149
|
+
|
|
150
|
+
After CD+Tests, when any of the four review/QA artefacts exists, surfaces may show one compact
|
|
151
|
+
derived `Quality Readiness` projection. It answers the user-facing question "what is the current
|
|
152
|
+
quality outcome and what should happen next?" without replacing evidence or creating another
|
|
153
|
+
decision authority.
|
|
154
|
+
|
|
155
|
+
- It contains exactly four rows, in this order: `Plan coverage` from `agdf-task-plan-review`,
|
|
156
|
+
`Solution integrity` from `agdf-clean-implementation-review`, `Code quality` from `agdf-code-review`,
|
|
157
|
+
and `QA decision` from `agdf-qa-gate`.
|
|
158
|
+
- `agdf-qa-gate` is always labeled as the sole decision owner. The other three rows are evidence
|
|
159
|
+
dimensions, not competing pass/revise/block decisions.
|
|
160
|
+
- Overall status reuses canonical severity ordering. Missing or conflicting required evidence
|
|
161
|
+
must not render `pass`; surface `revise` or `block` with the decisive reason and one permitted
|
|
162
|
+
next action instead.
|
|
163
|
+
- The projection is derived, non-persistent and non-authorizing. It cannot accept an approval,
|
|
164
|
+
advance a gate, suppress a report or replace the Run Status Card, Gate Transition Card, JSON
|
|
165
|
+
projection or durable review artefacts.
|
|
166
|
+
- Show compact rows on `pass`. On `revise` or `block`, expand only the decisive row with its
|
|
167
|
+
canonical report reference; do not paste complete reports into chat.
|
|
168
|
+
|
|
148
169
|
## Gate Transition Card
|
|
149
170
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
171
|
+
Every ready `gate_approval` uses one fixed visible sequence: first the compact
|
|
172
|
+
approval-time Run Status Card, then the Gate Transition Card, then exactly one
|
|
173
|
+
native question or exact-text fallback. Both cards derive from one immutable,
|
|
174
|
+
non-authorizing presentation snapshot produced after canonical selected-run,
|
|
175
|
+
gate and durable-artefact readiness evaluation. The snapshot never selects a
|
|
176
|
+
run, decides a gate, persists state or grants approval.
|
|
177
|
+
|
|
178
|
+
The two distinct card blocks form one Approval Orientation Envelope in one
|
|
179
|
+
immediately preceding assistant message. The agent must complete that message
|
|
180
|
+
before invoking any native question tool or emitting an exact-text approval
|
|
181
|
+
request. Splitting the cards across separate assistant turns or invoking the
|
|
182
|
+
tool after only one card is a failed interaction, not a valid presentation.
|
|
183
|
+
|
|
184
|
+
The compact approval-time Run Status Card contains exactly six operational
|
|
185
|
+
fields: selected run, readiness status, current gate, missing exact approval,
|
|
186
|
+
one next action and quality outlook. It uses localized human-readable labels
|
|
187
|
+
and must not contain evidence, diagnostic codes, raw control-state keys,
|
|
188
|
+
allowed/forbidden inventories or machine values. The complete Run Status Card remains the operational,
|
|
189
|
+
CLI and audit projection and remains available for complete detail outside the
|
|
190
|
+
approval-time compact view.
|
|
191
|
+
|
|
192
|
+
The Gate Transition Card is the second orientation message. It is derived from
|
|
193
|
+
the same snapshot and canonical post-approval transition, but it is not another
|
|
194
|
+
state model, persisted record, renderer or approval authority. It turns only
|
|
195
|
+
the decision-relevant subset into concise product copy immediately before the
|
|
196
|
+
host-native question or exact-text fallback.
|
|
157
197
|
|
|
158
198
|
The card answers exactly three user questions, in this order:
|
|
159
199
|
|
|
@@ -189,11 +229,13 @@ for example, the German title may be `Lösungsdesign` while the authorization
|
|
|
189
229
|
value remains `Approval: SD`. Meaning, ordering and authority boundaries are
|
|
190
230
|
identical across locale packs.
|
|
191
231
|
|
|
192
|
-
The
|
|
232
|
+
The Gate Transition Card must not be a Markdown table or dashboard. It must not
|
|
193
233
|
present raw control-state keys, machine status values, diagnostic codes,
|
|
194
234
|
evidence lists, allowed/forbidden inventories or implementation detail that is
|
|
195
235
|
not needed for the decision. It must not repeat the native question. The card
|
|
196
236
|
normally fits in one title, one readiness line and two short content blocks.
|
|
237
|
+
Run and gate identity may appear in both cards to anchor the shared snapshot;
|
|
238
|
+
status rows, action inventories and transition prose must not be duplicated.
|
|
197
239
|
|
|
198
240
|
For `Approval: TP`, the effect is permission to run pre-implementation
|
|
199
241
|
Brownfield Analysis, implementation remains gated until that analysis passes,
|
|
@@ -359,19 +401,20 @@ response_origin: deliberate_user_input for gate_approval
|
|
|
359
401
|
This envelope is not a new persisted record. The selected canonical `RUN_STATE.md` and existing artefact chain remain the durable authority.
|
|
360
402
|
|
|
361
403
|
Before presenting `gate_approval` for any user gate (`UR`, `PRD`, `SD`, `TP`,
|
|
362
|
-
`QA`, or `UAT`), the agent must emit the localized
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
404
|
+
`QA`, or `UAT`), the agent must emit the compact localized Run Status Card and
|
|
405
|
+
the localized Gate Transition Card as two distinct blocks in that order within
|
|
406
|
+
one immediately preceding assistant message. Neither card is optional, hidden
|
|
407
|
+
in the question text or replaced by a host button label. Do not invoke the
|
|
408
|
+
native question tool until the complete two-card envelope is visible. Native
|
|
409
|
+
buttons or exact-text fallback may appear only after both cards. Render the two
|
|
410
|
+
cards once per eligible attempt; an unavailable or not-applied native control
|
|
411
|
+
proceeds to exact text without repeating them.
|
|
369
412
|
|
|
370
413
|
Before presenting `gate_approval`, the agent must:
|
|
371
414
|
|
|
372
415
|
1. resolve exactly one selected run;
|
|
373
416
|
2. run the canonical gate evaluation and confirm that the current gate's durable artefact is present and ready;
|
|
374
|
-
3. emit
|
|
417
|
+
3. build one immutable non-authorizing presentation snapshot, emit its compact Run Status Card and Gate Transition Card in that order 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;
|
|
375
418
|
4. wait for deliberate user input without a timeout, default, preselection, hook-supplied answer or agent-to-agent substitute;
|
|
376
419
|
5. re-run canonical gate evaluation against the same `run_id` and expected gate immediately before persistence;
|
|
377
420
|
6. reject missing evidence, ambiguous or wrong run, wrong gate, stale state and any response that is no longer valid;
|
|
@@ -51,13 +51,13 @@ Structured Delivery Mode must respect gates, reviews and closeout discipline.
|
|
|
51
51
|
|---|---|---|
|
|
52
52
|
| `agdf-delivery-path-search` | high-impact planning decisions with several plausible next delivery steps before implementation | read-only advisory search; never grants gate permission or replaces gate-check |
|
|
53
53
|
| `agdf-brownfield-analysis` | after gate-check permits Brownfield Review or implementation preparation, before non-trivial changes in existing systems | clarifies reuse, owners, risks and Mode/Slice Decision; never bypasses gate-check; Brownfield Review is not implementation permission |
|
|
54
|
-
| `agdf-clean-implementation-review` | inspect
|
|
55
|
-
| `agdf-code-review` |
|
|
54
|
+
| `agdf-clean-implementation-review` | evidence dimension: inspect whether the solution is structurally clean | supports Quality Readiness; not a TP or QA substitute |
|
|
55
|
+
| `agdf-code-review` | evidence dimension: review the actual diff for defects, regression and security findings | supports Quality Readiness; does not replace QA |
|
|
56
56
|
| `agdf-delivery-closeout` | commit/PR-near handoff after QA/OR/UAT | never performs VCS actions automatically |
|
|
57
57
|
| `agdf-gate-check` | new build/change intent, unclear approval, Structured Delivery, later-gate artefact requested | does not create later artefacts or skip Mode/Slice Decision after Brownfield Review |
|
|
58
|
-
| `agdf-qa-gate` | final
|
|
58
|
+
| `agdf-qa-gate` | sole final Quality Readiness decision | only instance for `pass | revise | block` |
|
|
59
59
|
| `agdf-release-or` | auditable closeout for every relevant run | not a QA substitute |
|
|
60
|
-
| `agdf-task-plan-review` |
|
|
60
|
+
| `agdf-task-plan-review` | evidence dimension: verify whether the approved Task Plan was fulfilled | supports Quality Readiness; no final QA decision |
|
|
61
61
|
|
|
62
62
|
Select exactly one primary skill first.
|
|
63
63
|
Add more only when they cover a distinct concrete risk dimension.
|
|
@@ -29,6 +29,27 @@
|
|
|
29
29
|
"forbidden": "Forbidden now",
|
|
30
30
|
"artefacts": "Artefacts"
|
|
31
31
|
},
|
|
32
|
+
"qualityReadiness": {
|
|
33
|
+
"title": "Quality Readiness",
|
|
34
|
+
"rows": {
|
|
35
|
+
"plan_coverage": "Plan coverage",
|
|
36
|
+
"solution_integrity": "Solution integrity",
|
|
37
|
+
"code_quality": "Code quality",
|
|
38
|
+
"qa_decision": "QA decision"
|
|
39
|
+
},
|
|
40
|
+
"reason": "Reason",
|
|
41
|
+
"reference": "Evidence report",
|
|
42
|
+
"nextAction": "Next action",
|
|
43
|
+
"decisionOwner": "Decision owner",
|
|
44
|
+
"decisionOwnerValue": "QA Gate",
|
|
45
|
+
"unknown": "evidence missing",
|
|
46
|
+
"fallbackReasons": {
|
|
47
|
+
"plan_coverage": "Plan coverage requires revision before QA can pass.",
|
|
48
|
+
"solution_integrity": "Solution integrity requires revision before QA can pass.",
|
|
49
|
+
"code_quality": "Code quality findings require revision before QA can pass.",
|
|
50
|
+
"qa_decision": "QA evidence requires revision before the gate can pass."
|
|
51
|
+
}
|
|
52
|
+
},
|
|
32
53
|
"gateTitles": {
|
|
33
54
|
"UR": "User requirements",
|
|
34
55
|
"PRD": "Product requirements",
|
|
@@ -115,6 +136,27 @@
|
|
|
115
136
|
"forbidden": "Aktuell verboten",
|
|
116
137
|
"artefacts": "Artefakte"
|
|
117
138
|
},
|
|
139
|
+
"qualityReadiness": {
|
|
140
|
+
"title": "Quality Readiness",
|
|
141
|
+
"rows": {
|
|
142
|
+
"plan_coverage": "Planabdeckung",
|
|
143
|
+
"solution_integrity": "Lösungsintegrität",
|
|
144
|
+
"code_quality": "Code-Qualität",
|
|
145
|
+
"qa_decision": "QA-Entscheidung"
|
|
146
|
+
},
|
|
147
|
+
"reason": "Grund",
|
|
148
|
+
"reference": "Nachweisbericht",
|
|
149
|
+
"nextAction": "Nächste Aktion",
|
|
150
|
+
"decisionOwner": "Entscheidungsinstanz",
|
|
151
|
+
"decisionOwnerValue": "QA-Gate",
|
|
152
|
+
"unknown": "Nachweis fehlt",
|
|
153
|
+
"fallbackReasons": {
|
|
154
|
+
"plan_coverage": "Die Planabdeckung muss vor einem QA-Pass überarbeitet werden.",
|
|
155
|
+
"solution_integrity": "Die Lösungsintegrität muss vor einem QA-Pass überarbeitet werden.",
|
|
156
|
+
"code_quality": "Code-Qualitätsbefunde müssen vor einem QA-Pass überarbeitet werden.",
|
|
157
|
+
"qa_decision": "Die QA-Nachweise müssen vor einem QA-Pass überarbeitet werden."
|
|
158
|
+
}
|
|
159
|
+
},
|
|
118
160
|
"gateTitles": {
|
|
119
161
|
"UR": "Nutzeranforderungen",
|
|
120
162
|
"PRD": "Produktanforderungen",
|
|
@@ -145,15 +145,55 @@ and `Allowed after approval` when a missing approval exists, `Next step` and
|
|
|
145
145
|
`Quality outlook`. Keep mode, forbidden actions, evidence and next-skill detail
|
|
146
146
|
in the surrounding control artefact when they are relevant.
|
|
147
147
|
|
|
148
|
+
## Quality Readiness Projection
|
|
149
|
+
|
|
150
|
+
After CD+Tests, when any of the four review/QA artefacts exists, surfaces may show one compact
|
|
151
|
+
derived `Quality Readiness` projection. It answers the user-facing question "what is the current
|
|
152
|
+
quality outcome and what should happen next?" without replacing evidence or creating another
|
|
153
|
+
decision authority.
|
|
154
|
+
|
|
155
|
+
- It contains exactly four rows, in this order: `Plan coverage` from `agdf-task-plan-review`,
|
|
156
|
+
`Solution integrity` from `agdf-clean-implementation-review`, `Code quality` from `agdf-code-review`,
|
|
157
|
+
and `QA decision` from `agdf-qa-gate`.
|
|
158
|
+
- `agdf-qa-gate` is always labeled as the sole decision owner. The other three rows are evidence
|
|
159
|
+
dimensions, not competing pass/revise/block decisions.
|
|
160
|
+
- Overall status reuses canonical severity ordering. Missing or conflicting required evidence
|
|
161
|
+
must not render `pass`; surface `revise` or `block` with the decisive reason and one permitted
|
|
162
|
+
next action instead.
|
|
163
|
+
- The projection is derived, non-persistent and non-authorizing. It cannot accept an approval,
|
|
164
|
+
advance a gate, suppress a report or replace the Run Status Card, Gate Transition Card, JSON
|
|
165
|
+
projection or durable review artefacts.
|
|
166
|
+
- Show compact rows on `pass`. On `revise` or `block`, expand only the decisive row with its
|
|
167
|
+
canonical report reference; do not paste complete reports into chat.
|
|
168
|
+
|
|
148
169
|
## Gate Transition Card
|
|
149
170
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
171
|
+
Every ready `gate_approval` uses one fixed visible sequence: first the compact
|
|
172
|
+
approval-time Run Status Card, then the Gate Transition Card, then exactly one
|
|
173
|
+
native question or exact-text fallback. Both cards derive from one immutable,
|
|
174
|
+
non-authorizing presentation snapshot produced after canonical selected-run,
|
|
175
|
+
gate and durable-artefact readiness evaluation. The snapshot never selects a
|
|
176
|
+
run, decides a gate, persists state or grants approval.
|
|
177
|
+
|
|
178
|
+
The two distinct card blocks form one Approval Orientation Envelope in one
|
|
179
|
+
immediately preceding assistant message. The agent must complete that message
|
|
180
|
+
before invoking any native question tool or emitting an exact-text approval
|
|
181
|
+
request. Splitting the cards across separate assistant turns or invoking the
|
|
182
|
+
tool after only one card is a failed interaction, not a valid presentation.
|
|
183
|
+
|
|
184
|
+
The compact approval-time Run Status Card contains exactly six operational
|
|
185
|
+
fields: selected run, readiness status, current gate, missing exact approval,
|
|
186
|
+
one next action and quality outlook. It uses localized human-readable labels
|
|
187
|
+
and must not contain evidence, diagnostic codes, raw control-state keys,
|
|
188
|
+
allowed/forbidden inventories or machine values. The complete Run Status Card remains the operational,
|
|
189
|
+
CLI and audit projection and remains available for complete detail outside the
|
|
190
|
+
approval-time compact view.
|
|
191
|
+
|
|
192
|
+
The Gate Transition Card is the second orientation message. It is derived from
|
|
193
|
+
the same snapshot and canonical post-approval transition, but it is not another
|
|
194
|
+
state model, persisted record, renderer or approval authority. It turns only
|
|
195
|
+
the decision-relevant subset into concise product copy immediately before the
|
|
196
|
+
host-native question or exact-text fallback.
|
|
157
197
|
|
|
158
198
|
The card answers exactly three user questions, in this order:
|
|
159
199
|
|
|
@@ -189,11 +229,13 @@ for example, the German title may be `Lösungsdesign` while the authorization
|
|
|
189
229
|
value remains `Approval: SD`. Meaning, ordering and authority boundaries are
|
|
190
230
|
identical across locale packs.
|
|
191
231
|
|
|
192
|
-
The
|
|
232
|
+
The Gate Transition Card must not be a Markdown table or dashboard. It must not
|
|
193
233
|
present raw control-state keys, machine status values, diagnostic codes,
|
|
194
234
|
evidence lists, allowed/forbidden inventories or implementation detail that is
|
|
195
235
|
not needed for the decision. It must not repeat the native question. The card
|
|
196
236
|
normally fits in one title, one readiness line and two short content blocks.
|
|
237
|
+
Run and gate identity may appear in both cards to anchor the shared snapshot;
|
|
238
|
+
status rows, action inventories and transition prose must not be duplicated.
|
|
197
239
|
|
|
198
240
|
For `Approval: TP`, the effect is permission to run pre-implementation
|
|
199
241
|
Brownfield Analysis, implementation remains gated until that analysis passes,
|
|
@@ -359,19 +401,20 @@ response_origin: deliberate_user_input for gate_approval
|
|
|
359
401
|
This envelope is not a new persisted record. The selected canonical `RUN_STATE.md` and existing artefact chain remain the durable authority.
|
|
360
402
|
|
|
361
403
|
Before presenting `gate_approval` for any user gate (`UR`, `PRD`, `SD`, `TP`,
|
|
362
|
-
`QA`, or `UAT`), the agent must emit the localized
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
404
|
+
`QA`, or `UAT`), the agent must emit the compact localized Run Status Card and
|
|
405
|
+
the localized Gate Transition Card as two distinct blocks in that order within
|
|
406
|
+
one immediately preceding assistant message. Neither card is optional, hidden
|
|
407
|
+
in the question text or replaced by a host button label. Do not invoke the
|
|
408
|
+
native question tool until the complete two-card envelope is visible. Native
|
|
409
|
+
buttons or exact-text fallback may appear only after both cards. Render the two
|
|
410
|
+
cards once per eligible attempt; an unavailable or not-applied native control
|
|
411
|
+
proceeds to exact text without repeating them.
|
|
369
412
|
|
|
370
413
|
Before presenting `gate_approval`, the agent must:
|
|
371
414
|
|
|
372
415
|
1. resolve exactly one selected run;
|
|
373
416
|
2. run the canonical gate evaluation and confirm that the current gate's durable artefact is present and ready;
|
|
374
|
-
3. emit
|
|
417
|
+
3. build one immutable non-authorizing presentation snapshot, emit its compact Run Status Card and Gate Transition Card in that order 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;
|
|
375
418
|
4. wait for deliberate user input without a timeout, default, preselection, hook-supplied answer or agent-to-agent substitute;
|
|
376
419
|
5. re-run canonical gate evaluation against the same `run_id` and expected gate immediately before persistence;
|
|
377
420
|
6. reject missing evidence, ambiguous or wrong run, wrong gate, stale state and any response that is no longer valid;
|
|
@@ -62,16 +62,18 @@ 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.
|
|
71
|
-
9.
|
|
72
|
-
10.
|
|
73
|
-
11.
|
|
74
|
-
12.
|
|
65
|
+
3. Build one immutable, non-authorizing presentation snapshot from the selected evaluated run and current revision identity.
|
|
66
|
+
4. Compose one Approval Orientation Envelope as one immediately preceding assistant message containing two distinct blocks. Render the compact localized approval-time Run Status Card first. It contains exactly selected run, readiness status, current gate, missing exact approval, one next action and quality outlook; omit raw keys, machine statuses, evidence, diagnostics and allowed/forbidden inventories.
|
|
67
|
+
5. In the same assistant message, render a separate localized Gate Transition Card second, 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 either card only into the question, button description or hidden tool context. Do not invoke the native question tool until the complete two-card envelope is visible.
|
|
68
|
+
6. 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. Run and gate identity may anchor both cards; do not duplicate status rows, action inventories or the native question.
|
|
69
|
+
7. 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.
|
|
70
|
+
8. Ask exactly one question that names the selected `run_id` and `current_gate`.
|
|
71
|
+
9. 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.
|
|
72
|
+
10. 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.
|
|
73
|
+
11. Render both cards once in that single complete assistant message. If the native attempt is unavailable or not applied, continue to exact text without repeating either card.
|
|
74
|
+
12. Re-run gate evaluation for the same run and expected gate after the response and immediately before persistence.
|
|
75
|
+
13. 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.
|
|
76
|
+
14. Persist accepted input only through the existing control-state workflow.
|
|
75
77
|
|
|
76
78
|
Before composing the question, resolve the configured chat locale from `.agdf/control/config.json` through `../../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
79
|
|
|
@@ -191,10 +193,12 @@ Keep the result short and operational. Render the Runtime Contract's compact hum
|
|
|
191
193
|
|
|
192
194
|
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.
|
|
193
195
|
|
|
194
|
-
This operational status table
|
|
195
|
-
immediately requests a ready gate approval,
|
|
196
|
-
|
|
197
|
-
|
|
196
|
+
This complete operational status table remains the status-reporting and detail
|
|
197
|
+
surface. When the same response immediately requests a ready gate approval,
|
|
198
|
+
render its six-field compact approval-time projection first, then the Gate
|
|
199
|
+
Transition Card in the same immediately preceding assistant message, then
|
|
200
|
+
invoke exactly one native question or exact-text fallback. Both cards derive
|
|
201
|
+
from the same snapshot and are shown exactly once.
|
|
198
202
|
|
|
199
203
|
If this skill creates or updates control artefacts, do not paste full file bodies into the chat.
|
|
200
204
|
List paths, summarize the decision, name the blocker or approval needed, and keep the durable content in the files.
|
|
@@ -28,6 +28,13 @@ QA-specific `decision` is exactly `pass | revise | block`.
|
|
|
28
28
|
`pass` is allowed only when TP coverage, Brownfield fit, solution integrity, and relevant documentation/Context Graph impact are sufficiently evidenced.
|
|
29
29
|
`sot_drift` must not pass silently as a warning.
|
|
30
30
|
|
|
31
|
+
When post-CD+Tests review evidence exists, present the Runtime Contract's derived Quality
|
|
32
|
+
Readiness projection before the detailed QA report: Plan coverage, Solution integrity, Code
|
|
33
|
+
quality and QA decision in that order. Name `agdf-qa-gate` as the sole decision owner, show one
|
|
34
|
+
decisive reason and one permissible next action, and keep detailed reports as evidence links or
|
|
35
|
+
on-demand detail. The projection is non-authorizing and must not replace the Run Status Card,
|
|
36
|
+
Gate Transition Card or the durable QA report.
|
|
37
|
+
|
|
31
38
|
## Rules
|
|
32
39
|
1. No QA pass without strong evidence.
|
|
33
40
|
2. TP is the reference, not merely working code.
|
package/generated/AGENTS.md
CHANGED
|
@@ -51,13 +51,13 @@ Structured Delivery Mode must respect gates, reviews and closeout discipline.
|
|
|
51
51
|
|---|---|---|
|
|
52
52
|
| `agdf-delivery-path-search` | high-impact planning decisions with several plausible next delivery steps before implementation | read-only advisory search; never grants gate permission or replaces gate-check |
|
|
53
53
|
| `agdf-brownfield-analysis` | after gate-check permits Brownfield Review or implementation preparation, before non-trivial changes in existing systems | clarifies reuse, owners, risks and Mode/Slice Decision; never bypasses gate-check; Brownfield Review is not implementation permission |
|
|
54
|
-
| `agdf-clean-implementation-review` | inspect
|
|
55
|
-
| `agdf-code-review` |
|
|
54
|
+
| `agdf-clean-implementation-review` | evidence dimension: inspect whether the solution is structurally clean | supports Quality Readiness; not a TP or QA substitute |
|
|
55
|
+
| `agdf-code-review` | evidence dimension: review the actual diff for defects, regression and security findings | supports Quality Readiness; does not replace QA |
|
|
56
56
|
| `agdf-delivery-closeout` | commit/PR-near handoff after QA/OR/UAT | never performs VCS actions automatically |
|
|
57
57
|
| `agdf-gate-check` | new build/change intent, unclear approval, Structured Delivery, later-gate artefact requested | does not create later artefacts or skip Mode/Slice Decision after Brownfield Review |
|
|
58
|
-
| `agdf-qa-gate` | final
|
|
58
|
+
| `agdf-qa-gate` | sole final Quality Readiness decision | only instance for `pass | revise | block` |
|
|
59
59
|
| `agdf-release-or` | auditable closeout for every relevant run | not a QA substitute |
|
|
60
|
-
| `agdf-task-plan-review` |
|
|
60
|
+
| `agdf-task-plan-review` | evidence dimension: verify whether the approved Task Plan was fulfilled | supports Quality Readiness; no final QA decision |
|
|
61
61
|
|
|
62
62
|
Select exactly one primary skill first.
|
|
63
63
|
Add more only when they cover a distinct concrete risk dimension.
|
|
@@ -52,13 +52,13 @@ Structured Delivery Mode must respect gates, reviews and closeout discipline.
|
|
|
52
52
|
|---|---|---|
|
|
53
53
|
| `delivery-path-search` | high-impact planning decisions with several plausible next delivery steps before implementation | read-only advisory search; never grants gate permission or replaces gate-check |
|
|
54
54
|
| `brownfield-analysis` | after gate-check permits Brownfield Review or implementation preparation, before non-trivial changes in existing systems | clarifies reuse, owners, risks and Mode/Slice Decision; never bypasses gate-check; Brownfield Review is not implementation permission |
|
|
55
|
-
| `clean-implementation-review` | inspect
|
|
56
|
-
| `code-review` |
|
|
55
|
+
| `clean-implementation-review` | evidence dimension: inspect whether the solution is structurally clean | supports Quality Readiness; not a TP or QA substitute |
|
|
56
|
+
| `code-review` | evidence dimension: review the actual diff for defects, regression and security findings | supports Quality Readiness; does not replace QA |
|
|
57
57
|
| `delivery-closeout` | commit/PR-near handoff after QA/OR/UAT | never performs VCS actions automatically |
|
|
58
58
|
| `gate-check` | new build/change intent, unclear approval, Structured Delivery, later-gate artefact requested | does not create later artefacts or skip Mode/Slice Decision after Brownfield Review |
|
|
59
|
-
| `qa-gate` | final
|
|
59
|
+
| `qa-gate` | sole final Quality Readiness decision | only instance for `pass | revise | block` |
|
|
60
60
|
| `release-or` | auditable closeout for every relevant run | not a QA substitute |
|
|
61
|
-
| `task-plan-review` |
|
|
61
|
+
| `task-plan-review` | evidence dimension: verify whether the approved Task Plan was fulfilled | supports Quality Readiness; no final QA decision |
|
|
62
62
|
|
|
63
63
|
Select exactly one primary skill first.
|
|
64
64
|
Add more only when they cover a distinct concrete risk dimension.
|
|
@@ -29,6 +29,27 @@
|
|
|
29
29
|
"forbidden": "Forbidden now",
|
|
30
30
|
"artefacts": "Artefacts"
|
|
31
31
|
},
|
|
32
|
+
"qualityReadiness": {
|
|
33
|
+
"title": "Quality Readiness",
|
|
34
|
+
"rows": {
|
|
35
|
+
"plan_coverage": "Plan coverage",
|
|
36
|
+
"solution_integrity": "Solution integrity",
|
|
37
|
+
"code_quality": "Code quality",
|
|
38
|
+
"qa_decision": "QA decision"
|
|
39
|
+
},
|
|
40
|
+
"reason": "Reason",
|
|
41
|
+
"reference": "Evidence report",
|
|
42
|
+
"nextAction": "Next action",
|
|
43
|
+
"decisionOwner": "Decision owner",
|
|
44
|
+
"decisionOwnerValue": "QA Gate",
|
|
45
|
+
"unknown": "evidence missing",
|
|
46
|
+
"fallbackReasons": {
|
|
47
|
+
"plan_coverage": "Plan coverage requires revision before QA can pass.",
|
|
48
|
+
"solution_integrity": "Solution integrity requires revision before QA can pass.",
|
|
49
|
+
"code_quality": "Code quality findings require revision before QA can pass.",
|
|
50
|
+
"qa_decision": "QA evidence requires revision before the gate can pass."
|
|
51
|
+
}
|
|
52
|
+
},
|
|
32
53
|
"gateTitles": {
|
|
33
54
|
"UR": "User requirements",
|
|
34
55
|
"PRD": "Product requirements",
|
|
@@ -115,6 +136,27 @@
|
|
|
115
136
|
"forbidden": "Aktuell verboten",
|
|
116
137
|
"artefacts": "Artefakte"
|
|
117
138
|
},
|
|
139
|
+
"qualityReadiness": {
|
|
140
|
+
"title": "Quality Readiness",
|
|
141
|
+
"rows": {
|
|
142
|
+
"plan_coverage": "Planabdeckung",
|
|
143
|
+
"solution_integrity": "Lösungsintegrität",
|
|
144
|
+
"code_quality": "Code-Qualität",
|
|
145
|
+
"qa_decision": "QA-Entscheidung"
|
|
146
|
+
},
|
|
147
|
+
"reason": "Grund",
|
|
148
|
+
"reference": "Nachweisbericht",
|
|
149
|
+
"nextAction": "Nächste Aktion",
|
|
150
|
+
"decisionOwner": "Entscheidungsinstanz",
|
|
151
|
+
"decisionOwnerValue": "QA-Gate",
|
|
152
|
+
"unknown": "Nachweis fehlt",
|
|
153
|
+
"fallbackReasons": {
|
|
154
|
+
"plan_coverage": "Die Planabdeckung muss vor einem QA-Pass überarbeitet werden.",
|
|
155
|
+
"solution_integrity": "Die Lösungsintegrität muss vor einem QA-Pass überarbeitet werden.",
|
|
156
|
+
"code_quality": "Code-Qualitätsbefunde müssen vor einem QA-Pass überarbeitet werden.",
|
|
157
|
+
"qa_decision": "Die QA-Nachweise müssen vor einem QA-Pass überarbeitet werden."
|
|
158
|
+
}
|
|
159
|
+
},
|
|
118
160
|
"gateTitles": {
|
|
119
161
|
"UR": "Nutzeranforderungen",
|
|
120
162
|
"PRD": "Produktanforderungen",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"id": "agdf",
|
|
4
|
-
"version": "0.8.
|
|
4
|
+
"version": "0.8.3",
|
|
5
5
|
"displayName": "AI Governance & Delivery Framework",
|
|
6
6
|
"developerName": "Arndt Gold",
|
|
7
7
|
"description": "Codex-first operating system for governed AI-assisted delivery.",
|
|
@@ -153,14 +153,14 @@
|
|
|
153
153
|
{
|
|
154
154
|
"slug": "clean-implementation-review",
|
|
155
155
|
"discovery": "automatic",
|
|
156
|
-
"useFor": "inspect
|
|
157
|
-
"boundary": "not a TP or QA substitute"
|
|
156
|
+
"useFor": "evidence dimension: inspect whether the solution is structurally clean",
|
|
157
|
+
"boundary": "supports Quality Readiness; not a TP or QA substitute"
|
|
158
158
|
},
|
|
159
159
|
{
|
|
160
160
|
"slug": "code-review",
|
|
161
161
|
"discovery": "automatic",
|
|
162
|
-
"useFor": "
|
|
163
|
-
"boundary": "does not replace
|
|
162
|
+
"useFor": "evidence dimension: review the actual diff for defects, regression and security findings",
|
|
163
|
+
"boundary": "supports Quality Readiness; does not replace QA"
|
|
164
164
|
},
|
|
165
165
|
{
|
|
166
166
|
"slug": "delivery-closeout",
|
|
@@ -177,7 +177,7 @@
|
|
|
177
177
|
{
|
|
178
178
|
"slug": "qa-gate",
|
|
179
179
|
"discovery": "automatic",
|
|
180
|
-
"useFor": "final
|
|
180
|
+
"useFor": "sole final Quality Readiness decision",
|
|
181
181
|
"boundary": "only instance for `pass | revise | block`"
|
|
182
182
|
},
|
|
183
183
|
{
|
|
@@ -189,8 +189,8 @@
|
|
|
189
189
|
{
|
|
190
190
|
"slug": "task-plan-review",
|
|
191
191
|
"discovery": "automatic",
|
|
192
|
-
"useFor": "
|
|
193
|
-
"boundary": "no final QA decision"
|
|
192
|
+
"useFor": "evidence dimension: verify whether the approved Task Plan was fulfilled",
|
|
193
|
+
"boundary": "supports Quality Readiness; no final QA decision"
|
|
194
194
|
}
|
|
195
195
|
],
|
|
196
196
|
"marketplaces": {
|
|
@@ -145,15 +145,55 @@ and `Allowed after approval` when a missing approval exists, `Next step` and
|
|
|
145
145
|
`Quality outlook`. Keep mode, forbidden actions, evidence and next-skill detail
|
|
146
146
|
in the surrounding control artefact when they are relevant.
|
|
147
147
|
|
|
148
|
+
## Quality Readiness Projection
|
|
149
|
+
|
|
150
|
+
After CD+Tests, when any of the four review/QA artefacts exists, surfaces may show one compact
|
|
151
|
+
derived `Quality Readiness` projection. It answers the user-facing question "what is the current
|
|
152
|
+
quality outcome and what should happen next?" without replacing evidence or creating another
|
|
153
|
+
decision authority.
|
|
154
|
+
|
|
155
|
+
- It contains exactly four rows, in this order: `Plan coverage` from `task-plan-review`,
|
|
156
|
+
`Solution integrity` from `clean-implementation-review`, `Code quality` from `code-review`,
|
|
157
|
+
and `QA decision` from `qa-gate`.
|
|
158
|
+
- `qa-gate` is always labeled as the sole decision owner. The other three rows are evidence
|
|
159
|
+
dimensions, not competing pass/revise/block decisions.
|
|
160
|
+
- Overall status reuses canonical severity ordering. Missing or conflicting required evidence
|
|
161
|
+
must not render `pass`; surface `revise` or `block` with the decisive reason and one permitted
|
|
162
|
+
next action instead.
|
|
163
|
+
- The projection is derived, non-persistent and non-authorizing. It cannot accept an approval,
|
|
164
|
+
advance a gate, suppress a report or replace the Run Status Card, Gate Transition Card, JSON
|
|
165
|
+
projection or durable review artefacts.
|
|
166
|
+
- Show compact rows on `pass`. On `revise` or `block`, expand only the decisive row with its
|
|
167
|
+
canonical report reference; do not paste complete reports into chat.
|
|
168
|
+
|
|
148
169
|
## Gate Transition Card
|
|
149
170
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
171
|
+
Every ready `gate_approval` uses one fixed visible sequence: first the compact
|
|
172
|
+
approval-time Run Status Card, then the Gate Transition Card, then exactly one
|
|
173
|
+
native question or exact-text fallback. Both cards derive from one immutable,
|
|
174
|
+
non-authorizing presentation snapshot produced after canonical selected-run,
|
|
175
|
+
gate and durable-artefact readiness evaluation. The snapshot never selects a
|
|
176
|
+
run, decides a gate, persists state or grants approval.
|
|
177
|
+
|
|
178
|
+
The two distinct card blocks form one Approval Orientation Envelope in one
|
|
179
|
+
immediately preceding assistant message. The agent must complete that message
|
|
180
|
+
before invoking any native question tool or emitting an exact-text approval
|
|
181
|
+
request. Splitting the cards across separate assistant turns or invoking the
|
|
182
|
+
tool after only one card is a failed interaction, not a valid presentation.
|
|
183
|
+
|
|
184
|
+
The compact approval-time Run Status Card contains exactly six operational
|
|
185
|
+
fields: selected run, readiness status, current gate, missing exact approval,
|
|
186
|
+
one next action and quality outlook. It uses localized human-readable labels
|
|
187
|
+
and must not contain evidence, diagnostic codes, raw control-state keys,
|
|
188
|
+
allowed/forbidden inventories or machine values. The complete Run Status Card remains the operational,
|
|
189
|
+
CLI and audit projection and remains available for complete detail outside the
|
|
190
|
+
approval-time compact view.
|
|
191
|
+
|
|
192
|
+
The Gate Transition Card is the second orientation message. It is derived from
|
|
193
|
+
the same snapshot and canonical post-approval transition, but it is not another
|
|
194
|
+
state model, persisted record, renderer or approval authority. It turns only
|
|
195
|
+
the decision-relevant subset into concise product copy immediately before the
|
|
196
|
+
host-native question or exact-text fallback.
|
|
157
197
|
|
|
158
198
|
The card answers exactly three user questions, in this order:
|
|
159
199
|
|
|
@@ -189,11 +229,13 @@ for example, the German title may be `Lösungsdesign` while the authorization
|
|
|
189
229
|
value remains `Approval: SD`. Meaning, ordering and authority boundaries are
|
|
190
230
|
identical across locale packs.
|
|
191
231
|
|
|
192
|
-
The
|
|
232
|
+
The Gate Transition Card must not be a Markdown table or dashboard. It must not
|
|
193
233
|
present raw control-state keys, machine status values, diagnostic codes,
|
|
194
234
|
evidence lists, allowed/forbidden inventories or implementation detail that is
|
|
195
235
|
not needed for the decision. It must not repeat the native question. The card
|
|
196
236
|
normally fits in one title, one readiness line and two short content blocks.
|
|
237
|
+
Run and gate identity may appear in both cards to anchor the shared snapshot;
|
|
238
|
+
status rows, action inventories and transition prose must not be duplicated.
|
|
197
239
|
|
|
198
240
|
For `Approval: TP`, the effect is permission to run pre-implementation
|
|
199
241
|
Brownfield Analysis, implementation remains gated until that analysis passes,
|
|
@@ -359,19 +401,20 @@ response_origin: deliberate_user_input for gate_approval
|
|
|
359
401
|
This envelope is not a new persisted record. The selected canonical `RUN_STATE.md` and existing artefact chain remain the durable authority.
|
|
360
402
|
|
|
361
403
|
Before presenting `gate_approval` for any user gate (`UR`, `PRD`, `SD`, `TP`,
|
|
362
|
-
`QA`, or `UAT`), the agent must emit the localized
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
404
|
+
`QA`, or `UAT`), the agent must emit the compact localized Run Status Card and
|
|
405
|
+
the localized Gate Transition Card as two distinct blocks in that order within
|
|
406
|
+
one immediately preceding assistant message. Neither card is optional, hidden
|
|
407
|
+
in the question text or replaced by a host button label. Do not invoke the
|
|
408
|
+
native question tool until the complete two-card envelope is visible. Native
|
|
409
|
+
buttons or exact-text fallback may appear only after both cards. Render the two
|
|
410
|
+
cards once per eligible attempt; an unavailable or not-applied native control
|
|
411
|
+
proceeds to exact text without repeating them.
|
|
369
412
|
|
|
370
413
|
Before presenting `gate_approval`, the agent must:
|
|
371
414
|
|
|
372
415
|
1. resolve exactly one selected run;
|
|
373
416
|
2. run the canonical gate evaluation and confirm that the current gate's durable artefact is present and ready;
|
|
374
|
-
3. emit
|
|
417
|
+
3. build one immutable non-authorizing presentation snapshot, emit its compact Run Status Card and Gate Transition Card in that order 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;
|
|
375
418
|
4. wait for deliberate user input without a timeout, default, preselection, hook-supplied answer or agent-to-agent substitute;
|
|
376
419
|
5. re-run canonical gate evaluation against the same `run_id` and expected gate immediately before persistence;
|
|
377
420
|
6. reject missing evidence, ambiguous or wrong run, wrong gate, stale state and any response that is no longer valid;
|
|
@@ -1,5 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
## NAME
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`delivery-path-search` - delivery path search
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## SYNOPSIS
|
|
6
|
+
|
|
7
|
+
`/delivery-path-search` [`--help`|`-h`]
|
|
8
|
+
|
|
9
|
+
## DESCRIPTION
|
|
10
|
+
|
|
11
|
+
Compares materially different high-impact delivery paths using scope, risk, evidence, tests, cost, and gate readiness. The result is advisory and read-only; canonical AGDF `gate-check` remains the authority for what may happen next.
|
|
12
|
+
|
|
13
|
+
## EXAMPLES
|
|
14
|
+
|
|
15
|
+
Trigger the skill:
|
|
16
|
+
|
|
17
|
+
```text
|
|
18
|
+
> /delivery-path-search
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## SEE ALSO
|
|
22
|
+
|
|
23
|
+
See the full SKILL.md for detailed workflow, enforcement levels, bounded search rules, and output requirements.
|
|
@@ -62,16 +62,18 @@ 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.
|
|
71
|
-
9.
|
|
72
|
-
10.
|
|
73
|
-
11.
|
|
74
|
-
12.
|
|
65
|
+
3. Build one immutable, non-authorizing presentation snapshot from the selected evaluated run and current revision identity.
|
|
66
|
+
4. Compose one Approval Orientation Envelope as one immediately preceding assistant message containing two distinct blocks. Render the compact localized approval-time Run Status Card first. It contains exactly selected run, readiness status, current gate, missing exact approval, one next action and quality outlook; omit raw keys, machine statuses, evidence, diagnostics and allowed/forbidden inventories.
|
|
67
|
+
5. In the same assistant message, render a separate localized Gate Transition Card second, 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 either card only into the question, button description or hidden tool context. Do not invoke the native question tool until the complete two-card envelope is visible.
|
|
68
|
+
6. 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. Run and gate identity may anchor both cards; do not duplicate status rows, action inventories or the native question.
|
|
69
|
+
7. 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.
|
|
70
|
+
8. Ask exactly one question that names the selected `run_id` and `current_gate`.
|
|
71
|
+
9. 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.
|
|
72
|
+
10. 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.
|
|
73
|
+
11. Render both cards once in that single complete assistant message. If the native attempt is unavailable or not applied, continue to exact text without repeating either card.
|
|
74
|
+
12. Re-run gate evaluation for the same run and expected gate after the response and immediately before persistence.
|
|
75
|
+
13. 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.
|
|
76
|
+
14. Persist accepted input only through the existing control-state workflow.
|
|
75
77
|
|
|
76
78
|
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
79
|
|
|
@@ -191,10 +193,12 @@ Keep the result short and operational. Render the Runtime Contract's compact hum
|
|
|
191
193
|
|
|
192
194
|
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.
|
|
193
195
|
|
|
194
|
-
This operational status table
|
|
195
|
-
immediately requests a ready gate approval,
|
|
196
|
-
|
|
197
|
-
|
|
196
|
+
This complete operational status table remains the status-reporting and detail
|
|
197
|
+
surface. When the same response immediately requests a ready gate approval,
|
|
198
|
+
render its six-field compact approval-time projection first, then the Gate
|
|
199
|
+
Transition Card in the same immediately preceding assistant message, then
|
|
200
|
+
invoke exactly one native question or exact-text fallback. Both cards derive
|
|
201
|
+
from the same snapshot and are shown exactly once.
|
|
198
202
|
|
|
199
203
|
If this skill creates or updates control artefacts, do not paste full file bodies into the chat.
|
|
200
204
|
List paths, summarize the decision, name the blocker or approval needed, and keep the durable content in the files.
|
|
@@ -28,6 +28,13 @@ QA-specific `decision` is exactly `pass | revise | block`.
|
|
|
28
28
|
`pass` is allowed only when TP coverage, Brownfield fit, solution integrity, and relevant documentation/Context Graph impact are sufficiently evidenced.
|
|
29
29
|
`sot_drift` must not pass silently as a warning.
|
|
30
30
|
|
|
31
|
+
When post-CD+Tests review evidence exists, present the Runtime Contract's derived Quality
|
|
32
|
+
Readiness projection before the detailed QA report: Plan coverage, Solution integrity, Code
|
|
33
|
+
quality and QA decision in that order. Name `qa-gate` as the sole decision owner, show one
|
|
34
|
+
decisive reason and one permissible next action, and keep detailed reports as evidence links or
|
|
35
|
+
on-demand detail. The projection is non-authorizing and must not replace the Run Status Card,
|
|
36
|
+
Gate Transition Card or the durable QA report.
|
|
37
|
+
|
|
31
38
|
## Rules
|
|
32
39
|
1. No QA pass without strong evidence.
|
|
33
40
|
2. TP is the reference, not merely working code.
|
|
@@ -2,6 +2,14 @@ const REQUIRED_GATES = ["UR", "PRD", "SD", "TP", "QA", "UAT"];
|
|
|
2
2
|
const ARTEFACT_ORDER = ["UR", "PRD", "SD", "TP"];
|
|
3
3
|
const OUTCOMES = new Set(["approve", "revise", "decline", "cancel", "no_response", "timeout", "empty", "invalid", "stale"]);
|
|
4
4
|
const ATTEMPT_OUTCOMES = new Set(["presented", "unavailable_before_invocation", "attempted_not_applied", "unsafe_to_wait"]);
|
|
5
|
+
const APPROVAL_SEQUENCE = Object.freeze(["run_status_card", "gate_transition_card", "approval_interaction"]);
|
|
6
|
+
const QUALITY_STATUS_RANK = { pass: 0, warn: 1, revise: 2, block: 3 };
|
|
7
|
+
const QUALITY_DIMENSIONS = Object.freeze([
|
|
8
|
+
Object.freeze({ id: "plan_coverage", owner: "task-plan-review" }),
|
|
9
|
+
Object.freeze({ id: "solution_integrity", owner: "clean-implementation-review" }),
|
|
10
|
+
Object.freeze({ id: "code_quality", owner: "code-review" }),
|
|
11
|
+
Object.freeze({ id: "qa_decision", owner: "qa-gate" }),
|
|
12
|
+
]);
|
|
5
13
|
|
|
6
14
|
function plainObject(value) {
|
|
7
15
|
return value && typeof value === "object" && !Array.isArray(value);
|
|
@@ -55,7 +63,7 @@ export function validateLocaleRegistry(registry) {
|
|
|
55
63
|
for (const [key, value] of visibleStrings(pack)) {
|
|
56
64
|
if (!value.trim()) errors.push(`empty_copy:${locale}:${key}`);
|
|
57
65
|
const budget = key.startsWith("gateTitles.") ? budgets.title
|
|
58
|
-
: key.includes("Description") || key.startsWith("primary.actions.") || key.startsWith("primary.afterApproval.") || key === "primary.quality"
|
|
66
|
+
: key.includes("Description") || key.includes("fallbackReasons") || key.startsWith("primary.actions.") || key.startsWith("primary.afterApproval.") || key === "primary.quality"
|
|
59
67
|
? budgets.description
|
|
60
68
|
: budgets.label;
|
|
61
69
|
if (Number.isInteger(budget) && value.length > budget) errors.push(`length_budget:${locale}:${key}`);
|
|
@@ -203,8 +211,111 @@ export function normalizeInteractionOutcome(value, { expectedApproval, stale = f
|
|
|
203
211
|
return "invalid";
|
|
204
212
|
}
|
|
205
213
|
|
|
214
|
+
export function buildApprovalOrientationSnapshot({
|
|
215
|
+
ready = false,
|
|
216
|
+
statusCard,
|
|
217
|
+
humanPresentation,
|
|
218
|
+
revisionId = "",
|
|
219
|
+
registry,
|
|
220
|
+
requestedLocale,
|
|
221
|
+
} = {}) {
|
|
222
|
+
if (!ready || !plainObject(statusCard) || !plainObject(humanPresentation)) return null;
|
|
223
|
+
const gate = String(statusCard.current_gate ?? "").trim();
|
|
224
|
+
const runId = String(statusCard.run_id ?? "").trim();
|
|
225
|
+
const expectedApproval = `Approval: ${gate}`;
|
|
226
|
+
if (!REQUIRED_GATES.includes(gate) || !runId || statusCard.status !== "open" || statusCard.missing_approval !== expectedApproval) return null;
|
|
227
|
+
|
|
228
|
+
const locale = resolvePresentationLocale(registry, requestedLocale);
|
|
229
|
+
const pack = localePack(registry, locale);
|
|
230
|
+
const runTitle = String(humanPresentation.runTitle ?? "").trim() || normalizedRunTitle(runId);
|
|
231
|
+
const currentGateTitle = String(humanPresentation.gateTitle ?? "").trim() || gateTitle(registry, locale, gate);
|
|
232
|
+
const artefactRefs = Object.freeze([...(humanPresentation.artefactRefs ?? [])].map((ref) => Object.freeze({ ...ref })));
|
|
233
|
+
const statusFields = Object.freeze([
|
|
234
|
+
Object.freeze({ id: "selected_run", label: pack.statusCard.run, value: `${runTitle} · ${runId}` }),
|
|
235
|
+
Object.freeze({ id: "readiness_status", label: pack.statusCard.title, value: pack.interaction.ready }),
|
|
236
|
+
Object.freeze({ id: "current_gate", label: pack.statusCard.gate, value: `${gate} — ${currentGateTitle}` }),
|
|
237
|
+
Object.freeze({ id: "missing_approval", label: pack.statusCard.missing, value: expectedApproval }),
|
|
238
|
+
Object.freeze({ id: "next_action", label: pack.statusCard.step, value: pack.primary.actions[gate] ?? String(statusCard.next_step ?? "") }),
|
|
239
|
+
Object.freeze({ id: "quality_outlook", label: pack.statusCard.quality, value: pack.primary.quality }),
|
|
240
|
+
]);
|
|
241
|
+
const options = Object.freeze(gateOptions(registry, locale, gate).map((option) => Object.freeze({ ...option })));
|
|
242
|
+
|
|
243
|
+
return Object.freeze({
|
|
244
|
+
schema_version: "1",
|
|
245
|
+
run_id: runId,
|
|
246
|
+
revision_id: String(revisionId ?? "").trim(),
|
|
247
|
+
current_gate: gate,
|
|
248
|
+
presentation_language: locale,
|
|
249
|
+
sequence: APPROVAL_SEQUENCE,
|
|
250
|
+
compact_status_card: Object.freeze({ title: pack.statusCard.title, fields: statusFields }),
|
|
251
|
+
gate_transition_card: Object.freeze({
|
|
252
|
+
title: `${currentGateTitle} · ${runTitle} · ${runId}`,
|
|
253
|
+
artefact_refs: artefactRefs,
|
|
254
|
+
ready: pack.interaction.ready,
|
|
255
|
+
approve_heading: pack.interaction.approveHeading,
|
|
256
|
+
exact_approval: expectedApproval,
|
|
257
|
+
approval_effect: pack.primary.afterApproval[gate] ?? pack.primary.actions[gate] ?? "",
|
|
258
|
+
next_heading: pack.interaction.nextHeading,
|
|
259
|
+
next_gate: String(statusCard.next_gate_after_approval ?? "none"),
|
|
260
|
+
}),
|
|
261
|
+
approval_interaction: Object.freeze({ expected_approval: expectedApproval, options, authorizes: false }),
|
|
262
|
+
authorizes: false,
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
export function attachApprovalOrientationSnapshot(statusCard, options = {}) {
|
|
267
|
+
if (!plainObject(statusCard)) throw new Error("approval orientation status card missing");
|
|
268
|
+
const snapshot = buildApprovalOrientationSnapshot({ ...options, statusCard });
|
|
269
|
+
Object.defineProperty(statusCard, "approvalOrientation", {
|
|
270
|
+
value: snapshot,
|
|
271
|
+
enumerable: false,
|
|
272
|
+
});
|
|
273
|
+
return snapshot;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
function qualityStatus(value) {
|
|
277
|
+
const normalized = String(value ?? "").trim().toLowerCase();
|
|
278
|
+
return Object.hasOwn(QUALITY_STATUS_RANK, normalized) ? normalized : "unknown";
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
export function buildQualityReadiness({
|
|
282
|
+
planCoverage,
|
|
283
|
+
solutionIntegrity,
|
|
284
|
+
codeQuality,
|
|
285
|
+
qaDecision,
|
|
286
|
+
decisiveReason = "",
|
|
287
|
+
nextAction = "",
|
|
288
|
+
} = {}) {
|
|
289
|
+
const values = [planCoverage, solutionIntegrity, codeQuality, qaDecision];
|
|
290
|
+
const rows = QUALITY_DIMENSIONS.map((dimension, index) => Object.freeze({
|
|
291
|
+
...dimension,
|
|
292
|
+
status: qualityStatus(values[index]),
|
|
293
|
+
}));
|
|
294
|
+
const known = rows.filter((row) => row.status !== "unknown");
|
|
295
|
+
if (known.length === 0) return null;
|
|
296
|
+
const status = rows.some((row) => row.status === "unknown")
|
|
297
|
+
? "revise"
|
|
298
|
+
: known.reduce((current, row) =>
|
|
299
|
+
QUALITY_STATUS_RANK[row.status] > QUALITY_STATUS_RANK[current] ? row.status : current,
|
|
300
|
+
"pass");
|
|
301
|
+
const decisiveRow = rows.find((row) => row.status === status && status !== "pass")
|
|
302
|
+
?? rows.find((row) => row.id === "qa_decision")
|
|
303
|
+
?? rows[0];
|
|
304
|
+
return Object.freeze({
|
|
305
|
+
status,
|
|
306
|
+
rows: Object.freeze(rows),
|
|
307
|
+
decisive_reason: String(decisiveReason ?? "").trim(),
|
|
308
|
+
decisive_dimension: decisiveRow.id,
|
|
309
|
+
next_action: String(nextAction ?? "").trim(),
|
|
310
|
+
decision_owner: "qa-gate",
|
|
311
|
+
authorizes: false,
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
|
|
206
315
|
export const interactionPresentationConstants = Object.freeze({
|
|
207
316
|
artefactOrder: Object.freeze([...ARTEFACT_ORDER]),
|
|
208
317
|
outcomes: Object.freeze([...OUTCOMES]),
|
|
209
318
|
attemptOutcomes: Object.freeze([...ATTEMPT_OUTCOMES]),
|
|
319
|
+
approvalSequence: APPROVAL_SEQUENCE,
|
|
320
|
+
qualityDimensions: QUALITY_DIMENSIONS,
|
|
210
321
|
});
|
package/package.json
CHANGED