create-agdf 0.5.0 → 0.6.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/README.md +5 -4
- package/bin/create-agdf.js +210 -148
- package/generated/.agdf/control/README.md +15 -3
- package/generated/.agdf/control/templates/RUN_STATE.md +48 -0
- package/generated/.github/skills/agdf-brownfield-analysis/SKILL.md +3 -3
- package/generated/.github/skills/agdf-gate-check/SKILL.md +15 -10
- package/generated/.github/skills/agdf-release-or/SKILL.md +1 -1
- package/generated/.github/skills/agdf-runtime-contract.md +18 -8
- package/generated/.opencode/agdf-runtime-contract.md +18 -8
- package/generated/.opencode/agents/agdf-brownfield-analysis.md +2 -2
- package/generated/.opencode/agents/agdf-gate-check.md +15 -10
- package/generated/.opencode/agents/agdf-release-or.md +1 -1
- package/generated/plugins/agdf/.codex-plugin/plugin.json +1 -1
- package/generated/plugins/agdf/control/README.md +15 -3
- package/generated/plugins/agdf/control/templates/RUN_STATE.md +48 -0
- package/generated/plugins/agdf/hooks/session-start.sh +2 -0
- package/generated/plugins/agdf/meta/agdf-plugin.definition.json +1 -1
- package/generated/plugins/agdf/meta/agdf-runtime-contract.md +18 -8
- package/generated/plugins/agdf/skills/brownfield-analysis/SKILL.md +3 -3
- package/generated/plugins/agdf/skills/gate-check/SKILL.md +15 -10
- package/generated/plugins/agdf/skills/release-or/SKILL.md +1 -1
- package/lib/control-state/aggregate.js +18 -0
- package/lib/control-state/index.js +6 -0
- package/lib/control-state/legacy-migration.js +94 -0
- package/lib/control-state/run-state-parser.js +196 -0
- package/lib/control-state/run-state-repository.js +68 -0
- package/lib/control-state/run-state-resolver.js +45 -0
- package/lib/control-state/run-state-writer.js +96 -0
- package/lib/delivery-path-search/state-adapter.js +94 -23
- package/package.json +3 -2
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# AGDF Run State
|
|
2
|
+
|
|
3
|
+
## Run Meta
|
|
4
|
+
|
|
5
|
+
- control_state_version: 2
|
|
6
|
+
- run_id:
|
|
7
|
+
- lifecycle: active
|
|
8
|
+
- revision: 1
|
|
9
|
+
- revision_id:
|
|
10
|
+
- mode: structured_delivery
|
|
11
|
+
- current_gate: UR
|
|
12
|
+
- decision: in_progress
|
|
13
|
+
- owner: agent
|
|
14
|
+
|
|
15
|
+
## Objective
|
|
16
|
+
|
|
17
|
+
Describe the trustworthy outcome.
|
|
18
|
+
|
|
19
|
+
## Current Control State
|
|
20
|
+
|
|
21
|
+
| Question | Answer |
|
|
22
|
+
|---|---|
|
|
23
|
+
| What is known? | |
|
|
24
|
+
| What is approved? | |
|
|
25
|
+
| What is missing? | |
|
|
26
|
+
| What is the next allowed action? | |
|
|
27
|
+
| What is explicitly forbidden right now? | |
|
|
28
|
+
|
|
29
|
+
## Approvals
|
|
30
|
+
|
|
31
|
+
| Gate | Status | Evidence |
|
|
32
|
+
|---|---|---|
|
|
33
|
+
| UR | missing | |
|
|
34
|
+
| PRD | missing | |
|
|
35
|
+
| SD | missing | |
|
|
36
|
+
| TP | missing | |
|
|
37
|
+
| QA | missing | |
|
|
38
|
+
| UAT | missing | |
|
|
39
|
+
|
|
40
|
+
## Evidence
|
|
41
|
+
|
|
42
|
+
| Evidence | Source | Covers | Strength |
|
|
43
|
+
|---|---|---|---|
|
|
44
|
+
|
|
45
|
+
## Closeout
|
|
46
|
+
|
|
47
|
+
- next_allowed_action: Draft the current allowed artefact and preserve evidence.
|
|
48
|
+
- quality_outlook: Keep one mutable authority for this run.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: agdf-brownfield-analysis
|
|
3
|
-
description: Use this skill after gate-check or live AGDF control state confirms that Brownfield Review or implementation preparation is allowed. Use it after Approval: UR as the lightweight Brownfield Review after G-00 before PRD when existing systems may be affected, and again before non-trivial implementation after TP. Do not use it as the first AGDF skill for a fresh "I want to build/change X" prompt when approval, scope, or next allowed action is unclear.
|
|
3
|
+
description: "Use this skill after gate-check or live AGDF control state confirms that Brownfield Review or implementation preparation is allowed. Use it after Approval: UR as the lightweight Brownfield Review after G-00 before PRD when existing systems may be affected, and again before non-trivial implementation after TP. Do not use it as the first AGDF skill for a fresh \"I want to build/change X\" prompt when approval, scope, or next allowed action is unclear."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# brownfield-analysis
|
|
@@ -47,8 +47,8 @@ Do not mix both modes silently. Name the active mode in the output.
|
|
|
47
47
|
13. Specification archive migrations must follow the archive index if present.
|
|
48
48
|
|
|
49
49
|
## When To Use
|
|
50
|
-
- after `agdf-gate-check` permits `Brownfield Review` or
|
|
51
|
-
- after `agdf-gate-check` permits implementation preparation or
|
|
50
|
+
- after `agdf-gate-check` permits `Brownfield Review` or the selected canonical run record names Brownfield Review as the next allowed action
|
|
51
|
+
- after `agdf-gate-check` permits implementation preparation or the selected canonical run record already names Brownfield Analysis as the next allowed action
|
|
52
52
|
- after `Approval: UR` when existing owners, SoT, contracts, policies, persistence, runtime paths, tests, UI, UX or architecture may affect PRD/SD scope
|
|
53
53
|
- before `CD+Tests`
|
|
54
54
|
- before changes to an existing repository
|
|
@@ -28,7 +28,7 @@ This skill is the primary operating path for gate judgement.
|
|
|
28
28
|
|
|
29
29
|
First inspect the durable control state directly:
|
|
30
30
|
|
|
31
|
-
- `.agdf/control/AGDF_RUN.md`
|
|
31
|
+
- selected `.agdf/control/runs/<run_id>/RUN_STATE.md` (or legacy `AGDF_RUN.md` before explicit migration)
|
|
32
32
|
- `.agdf/control/MASTER_BACKLOG.md`
|
|
33
33
|
- `.agdf/control/SOT_REGISTRY.md`
|
|
34
34
|
- `.agdf/control/CONTEXT_GRAPH.md`
|
|
@@ -47,7 +47,7 @@ npx --yes @agdf/cli@latest gate-check --json
|
|
|
47
47
|
npx --yes @agdf/cli@latest delivery-map --json
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
-
`init` creates the control scaffold. `doctor` checks whether `.agdf/control/` is actionable. `agdf-gate-check` consumes that result and
|
|
50
|
+
`init` creates the control scaffold. `doctor` checks whether `.agdf/control/` is actionable. `agdf-gate-check` consumes that result and the selected canonical run record to report the operative process decision: `open | blocked`, current gate, blocking reason, missing approval, allowed outputs, forbidden outputs, next allowed action and evidence references.
|
|
51
51
|
`delivery-map` reports the durable delivery picture: active artefacts, approvals, Artefact Chain relationships, evidence refs, missing evidence, risks, Context Graph gate effect and machine-readable findings.
|
|
52
52
|
|
|
53
53
|
The CLI reports are validators and JSON evidence, not the primary user experience, not a required ritual for normal work and not a second rule system. If a report says `blocked`, do not continue with later-gate artefacts until the reported blocker is resolved.
|
|
@@ -124,14 +124,19 @@ If a status is not explicit, do not assume it is satisfied.
|
|
|
124
124
|
12. If branch, workspace and durable artefacts disagree, do not choose a scope silently; report the ambiguity and ask for the smallest clarifying gate action.
|
|
125
125
|
|
|
126
126
|
## Output
|
|
127
|
-
Keep the result short and operational:
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
127
|
+
Keep the result short and operational. Render the Runtime Contract's compact human-facing Run Status Card rather than a surface-specific summary:
|
|
128
|
+
|
|
129
|
+
| Run status | Value |
|
|
130
|
+
|---|---|
|
|
131
|
+
| Status | `open | blocked` |
|
|
132
|
+
| Current gate | `<GateName or internal step>` |
|
|
133
|
+
| Allowed now | `<currently allowed outputs>` |
|
|
134
|
+
| Blocked by | `<blocking condition or none>` |
|
|
135
|
+
| Missing approval | `Approval: <GateName> | none` |
|
|
136
|
+
| Next step | `<single permissible next step>` |
|
|
137
|
+
| Quality outlook | `<next meaningful quality focus or none>` |
|
|
138
|
+
|
|
139
|
+
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.
|
|
135
140
|
|
|
136
141
|
If this skill creates or updates control artefacts, do not paste full file bodies into the chat.
|
|
137
142
|
List paths, summarize the decision, name the blocker or approval needed, and keep the durable content in the files.
|
|
@@ -28,7 +28,7 @@ It reports:
|
|
|
28
28
|
Use `../agdf-runtime-contract.md` for Quality Contract output, Context Graph fields, gate terms, and non-duplication rules.
|
|
29
29
|
|
|
30
30
|
OR-specific output must make gate status, delivered and intentionally not delivered content, missing approvals, missing evidence, risks, retained fallbacks, and the next permissible step visible.
|
|
31
|
-
When `.agdf/control/` is present, persist or link the OR under `.agdf/control/artefacts/<key>/OR.md` and reference it from `
|
|
31
|
+
When `.agdf/control/` is present, persist or link the OR under `.agdf/control/artefacts/<key>/OR.md` and reference it from the selected canonical `RUN_STATE.md` or `MASTER_BACKLOG.md` when it is steering-relevant.
|
|
32
32
|
Use the Runtime Contract definition of `Relevant Run` to decide whether OR is mandatory or whether a Quick Task mini-closeout is enough.
|
|
33
33
|
|
|
34
34
|
## Rules
|
|
@@ -30,7 +30,8 @@ Do not add a separate `Quality outlook` line for pure Quick Tasks unless the tas
|
|
|
30
30
|
### Non-Normative Trivial Change Boundary
|
|
31
31
|
|
|
32
32
|
A `quick_task` whose entire diff stays fully outside all of the following paths may close using only
|
|
33
|
-
the compact output shape above, and must not create, rewrite or expand any
|
|
33
|
+
the compact output shape above, and must not create, rewrite or expand any selected canonical
|
|
34
|
+
`RUN_STATE.md` core
|
|
34
35
|
sections (Run Meta, Objective, Current Control State, Source And Scope State, Run Status Card,
|
|
35
36
|
Approvals, Artefacts, Mode/Slice Decision, Artefact Chain, Evidence, Missing Evidence, Risks, Context
|
|
36
37
|
Graph Impact, Knowledge Persistence Decision, Closeout):
|
|
@@ -207,9 +208,10 @@ OR is not mandatory for a pure explanation, read-only inspection, small review,
|
|
|
207
208
|
When in doubt, use a short OR-lite only if it clarifies gate state, evidence, risk, or the next permissible step.
|
|
208
209
|
|
|
209
210
|
A `quick_task` fully inside the Non-Normative Trivial Change Boundary above stays exempt from the full
|
|
210
|
-
|
|
211
|
-
another
|
|
212
|
-
changed and that it is unrelated; do not edit any other
|
|
211
|
+
selected-run ceremony even when it is otherwise a relevant run. If a selected canonical
|
|
212
|
+
`RUN_STATE.md` currently reflects another scope, append exactly one line to that run's
|
|
213
|
+
`Prior Run Pointers` section noting what changed and that it is unrelated; do not edit any other
|
|
214
|
+
section or any other existing line.
|
|
213
215
|
|
|
214
216
|
## Gate Rules
|
|
215
217
|
|
|
@@ -225,7 +227,7 @@ changed and that it is unrelated; do not edit any other section or any other exi
|
|
|
225
227
|
- Missing control files or missing current-state fields do not forbid the agent from preparing the current allowed artefact. They forbid later-gate work and implementation. For a fresh request, the default allowed work is to draft a minimal UR in the response and request `Approval: UR`. Initialize or write `.agdf/control/` only when the user explicitly asks for durable AGDF control state, the repository already uses `.agdf/control/` as its live working state, or a deterministic CLI/CI setup path is being executed.
|
|
226
228
|
- `Approval: UR` permits Brownfield Review after G-00 first, then a Mode/Slice Decision. It never permits implementation by itself.
|
|
227
229
|
- PRD, SD and TP depth is chosen after Brownfield Review through the Mode/Slice Decision, not before existing-system impact is understood.
|
|
228
|
-
- The Mode/Slice Decision must be visible before any PRD shortcut, Quick Task execution or implementation: record the decision, required next gate, scope reason and evidence in `
|
|
230
|
+
- The Mode/Slice Decision must be visible before any PRD shortcut, Quick Task execution or implementation: record the decision, required next gate, scope reason and evidence in the selected canonical `RUN_STATE.md` or an equivalent linked control artefact.
|
|
229
231
|
- `Approval: PRD` permits Solution Design drafting, not implementation.
|
|
230
232
|
- `Approval: SD` permits Task/Test Plan drafting, not implementation.
|
|
231
233
|
- `Approval: TP` permits implementation-preparation Brownfield Analysis and then CD+Tests when Brownfield evidence supports it.
|
|
@@ -327,10 +329,18 @@ Relevant-run closeout must reconcile Context Graph impact before presenting a cl
|
|
|
327
329
|
|
|
328
330
|
## Control Scaffold
|
|
329
331
|
|
|
332
|
+
### Run-Scoped Control State
|
|
333
|
+
|
|
334
|
+
Canonical mutable run state lives at `.agdf/control/runs/<run_id>/RUN_STATE.md`, one file per run.
|
|
335
|
+
Repository-level discovery is derived; do not maintain a writable active-run dashboard. Select with
|
|
336
|
+
`--run`, then `AGDF_RUN_ID`, or automatically only when exactly one run is active. Ambiguity fails
|
|
337
|
+
closed. Legacy `AGDF_RUN.md` is migration input or an explicitly rendered non-authoritative projection,
|
|
338
|
+
never a second writable owner. Read-only commands must not migrate state.
|
|
339
|
+
|
|
330
340
|
When a repository needs durable AGDF state, use the plugin-local `control/` scaffold as the starting point.
|
|
331
341
|
|
|
332
342
|
- `config.json` stores project language preferences. Use `artifact_language` for generated AGDF artefacts and `chat_language` for user-facing responses unless the user explicitly asks otherwise. Runtime rules remain English.
|
|
333
|
-
-
|
|
343
|
+
- `.agdf/control/runs/<run_id>/RUN_STATE.md` is the canonical current-run dashboard; legacy `AGDF_RUN.md` is migration input or an explicit non-authoritative projection.
|
|
334
344
|
- `MASTER_BACKLOG.md` is the living pointer for active delivery work.
|
|
335
345
|
- `BROWNFIELD_REVIEW.md` records the post-UR existing-system view and Mode/Slice Decision before PRD depth or Quick Task execution is chosen.
|
|
336
346
|
- `SOT_REGISTRY.md` prevents parallel sources of truth.
|
|
@@ -378,8 +388,8 @@ They make the repository state checkable, but they do not replace the native ski
|
|
|
378
388
|
|
|
379
389
|
## Delivery Map
|
|
380
390
|
|
|
381
|
-
`delivery-map --json` is the machine-readable delivery picture for the
|
|
382
|
-
It derives, but does not replace, the
|
|
391
|
+
`delivery-map --json` is the machine-readable delivery picture for the selected canonical control state.
|
|
392
|
+
It derives, but does not replace, the selected `RUN_STATE.md` and `MASTER_BACKLOG.md` state.
|
|
383
393
|
|
|
384
394
|
It must expose:
|
|
385
395
|
|
|
@@ -30,7 +30,8 @@ Do not add a separate `Quality outlook` line for pure Quick Tasks unless the tas
|
|
|
30
30
|
### Non-Normative Trivial Change Boundary
|
|
31
31
|
|
|
32
32
|
A `quick_task` whose entire diff stays fully outside all of the following paths may close using only
|
|
33
|
-
the compact output shape above, and must not create, rewrite or expand any
|
|
33
|
+
the compact output shape above, and must not create, rewrite or expand any selected canonical
|
|
34
|
+
`RUN_STATE.md` core
|
|
34
35
|
sections (Run Meta, Objective, Current Control State, Source And Scope State, Run Status Card,
|
|
35
36
|
Approvals, Artefacts, Mode/Slice Decision, Artefact Chain, Evidence, Missing Evidence, Risks, Context
|
|
36
37
|
Graph Impact, Knowledge Persistence Decision, Closeout):
|
|
@@ -207,9 +208,10 @@ OR is not mandatory for a pure explanation, read-only inspection, small review,
|
|
|
207
208
|
When in doubt, use a short OR-lite only if it clarifies gate state, evidence, risk, or the next permissible step.
|
|
208
209
|
|
|
209
210
|
A `quick_task` fully inside the Non-Normative Trivial Change Boundary above stays exempt from the full
|
|
210
|
-
|
|
211
|
-
another
|
|
212
|
-
changed and that it is unrelated; do not edit any other
|
|
211
|
+
selected-run ceremony even when it is otherwise a relevant run. If a selected canonical
|
|
212
|
+
`RUN_STATE.md` currently reflects another scope, append exactly one line to that run's
|
|
213
|
+
`Prior Run Pointers` section noting what changed and that it is unrelated; do not edit any other
|
|
214
|
+
section or any other existing line.
|
|
213
215
|
|
|
214
216
|
## Gate Rules
|
|
215
217
|
|
|
@@ -225,7 +227,7 @@ changed and that it is unrelated; do not edit any other section or any other exi
|
|
|
225
227
|
- Missing control files or missing current-state fields do not forbid the agent from preparing the current allowed artefact. They forbid later-gate work and implementation. For a fresh request, the default allowed work is to draft a minimal UR in the response and request `Approval: UR`. Initialize or write `.agdf/control/` only when the user explicitly asks for durable AGDF control state, the repository already uses `.agdf/control/` as its live working state, or a deterministic CLI/CI setup path is being executed.
|
|
226
228
|
- `Approval: UR` permits Brownfield Review after G-00 first, then a Mode/Slice Decision. It never permits implementation by itself.
|
|
227
229
|
- PRD, SD and TP depth is chosen after Brownfield Review through the Mode/Slice Decision, not before existing-system impact is understood.
|
|
228
|
-
- The Mode/Slice Decision must be visible before any PRD shortcut, Quick Task execution or implementation: record the decision, required next gate, scope reason and evidence in `
|
|
230
|
+
- The Mode/Slice Decision must be visible before any PRD shortcut, Quick Task execution or implementation: record the decision, required next gate, scope reason and evidence in the selected canonical `RUN_STATE.md` or an equivalent linked control artefact.
|
|
229
231
|
- `Approval: PRD` permits Solution Design drafting, not implementation.
|
|
230
232
|
- `Approval: SD` permits Task/Test Plan drafting, not implementation.
|
|
231
233
|
- `Approval: TP` permits implementation-preparation Brownfield Analysis and then CD+Tests when Brownfield evidence supports it.
|
|
@@ -327,10 +329,18 @@ Relevant-run closeout must reconcile Context Graph impact before presenting a cl
|
|
|
327
329
|
|
|
328
330
|
## Control Scaffold
|
|
329
331
|
|
|
332
|
+
### Run-Scoped Control State
|
|
333
|
+
|
|
334
|
+
Canonical mutable run state lives at `.agdf/control/runs/<run_id>/RUN_STATE.md`, one file per run.
|
|
335
|
+
Repository-level discovery is derived; do not maintain a writable active-run dashboard. Select with
|
|
336
|
+
`--run`, then `AGDF_RUN_ID`, or automatically only when exactly one run is active. Ambiguity fails
|
|
337
|
+
closed. Legacy `AGDF_RUN.md` is migration input or an explicitly rendered non-authoritative projection,
|
|
338
|
+
never a second writable owner. Read-only commands must not migrate state.
|
|
339
|
+
|
|
330
340
|
When a repository needs durable AGDF state, use the plugin-local `control/` scaffold as the starting point.
|
|
331
341
|
|
|
332
342
|
- `config.json` stores project language preferences. Use `artifact_language` for generated AGDF artefacts and `chat_language` for user-facing responses unless the user explicitly asks otherwise. Runtime rules remain English.
|
|
333
|
-
-
|
|
343
|
+
- `.agdf/control/runs/<run_id>/RUN_STATE.md` is the canonical current-run dashboard; legacy `AGDF_RUN.md` is migration input or an explicit non-authoritative projection.
|
|
334
344
|
- `MASTER_BACKLOG.md` is the living pointer for active delivery work.
|
|
335
345
|
- `BROWNFIELD_REVIEW.md` records the post-UR existing-system view and Mode/Slice Decision before PRD depth or Quick Task execution is chosen.
|
|
336
346
|
- `SOT_REGISTRY.md` prevents parallel sources of truth.
|
|
@@ -378,8 +388,8 @@ They make the repository state checkable, but they do not replace the native ski
|
|
|
378
388
|
|
|
379
389
|
## Delivery Map
|
|
380
390
|
|
|
381
|
-
`delivery-map --json` is the machine-readable delivery picture for the
|
|
382
|
-
It derives, but does not replace, the
|
|
391
|
+
`delivery-map --json` is the machine-readable delivery picture for the selected canonical control state.
|
|
392
|
+
It derives, but does not replace, the selected `RUN_STATE.md` and `MASTER_BACKLOG.md` state.
|
|
383
393
|
|
|
384
394
|
It must expose:
|
|
385
395
|
|
|
@@ -47,8 +47,8 @@ Do not mix both modes silently. Name the active mode in the output.
|
|
|
47
47
|
13. Specification archive migrations must follow the archive index if present.
|
|
48
48
|
|
|
49
49
|
## When To Use
|
|
50
|
-
- after `agdf-gate-check` permits `Brownfield Review` or
|
|
51
|
-
- after `agdf-gate-check` permits implementation preparation or
|
|
50
|
+
- after `agdf-gate-check` permits `Brownfield Review` or the selected canonical run record names Brownfield Review as the next allowed action
|
|
51
|
+
- after `agdf-gate-check` permits implementation preparation or the selected canonical run record already names Brownfield Analysis as the next allowed action
|
|
52
52
|
- after `Approval: UR` when existing owners, SoT, contracts, policies, persistence, runtime paths, tests, UI, UX or architecture may affect PRD/SD scope
|
|
53
53
|
- before `CD+Tests`
|
|
54
54
|
- before changes to an existing repository
|
|
@@ -28,7 +28,7 @@ This skill is the primary operating path for gate judgement.
|
|
|
28
28
|
|
|
29
29
|
First inspect the durable control state directly:
|
|
30
30
|
|
|
31
|
-
- `.agdf/control/AGDF_RUN.md`
|
|
31
|
+
- selected `.agdf/control/runs/<run_id>/RUN_STATE.md` (or legacy `AGDF_RUN.md` before explicit migration)
|
|
32
32
|
- `.agdf/control/MASTER_BACKLOG.md`
|
|
33
33
|
- `.agdf/control/SOT_REGISTRY.md`
|
|
34
34
|
- `.agdf/control/CONTEXT_GRAPH.md`
|
|
@@ -47,7 +47,7 @@ npx --yes @agdf/cli@latest gate-check --json
|
|
|
47
47
|
npx --yes @agdf/cli@latest delivery-map --json
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
-
`init` creates the control scaffold. `doctor` checks whether `.agdf/control/` is actionable. `agdf-gate-check` consumes that result and
|
|
50
|
+
`init` creates the control scaffold. `doctor` checks whether `.agdf/control/` is actionable. `agdf-gate-check` consumes that result and the selected canonical run record to report the operative process decision: `open | blocked`, current gate, blocking reason, missing approval, allowed outputs, forbidden outputs, next allowed action and evidence references.
|
|
51
51
|
`delivery-map` reports the durable delivery picture: active artefacts, approvals, Artefact Chain relationships, evidence refs, missing evidence, risks, Context Graph gate effect and machine-readable findings.
|
|
52
52
|
|
|
53
53
|
The CLI reports are validators and JSON evidence, not the primary user experience, not a required ritual for normal work and not a second rule system. If a report says `blocked`, do not continue with later-gate artefacts until the reported blocker is resolved.
|
|
@@ -124,14 +124,19 @@ If a status is not explicit, do not assume it is satisfied.
|
|
|
124
124
|
12. If branch, workspace and durable artefacts disagree, do not choose a scope silently; report the ambiguity and ask for the smallest clarifying gate action.
|
|
125
125
|
|
|
126
126
|
## Output
|
|
127
|
-
Keep the result short and operational:
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
127
|
+
Keep the result short and operational. Render the Runtime Contract's compact human-facing Run Status Card rather than a surface-specific summary:
|
|
128
|
+
|
|
129
|
+
| Run status | Value |
|
|
130
|
+
|---|---|
|
|
131
|
+
| Status | `open | blocked` |
|
|
132
|
+
| Current gate | `<GateName or internal step>` |
|
|
133
|
+
| Allowed now | `<currently allowed outputs>` |
|
|
134
|
+
| Blocked by | `<blocking condition or none>` |
|
|
135
|
+
| Missing approval | `Approval: <GateName> | none` |
|
|
136
|
+
| Next step | `<single permissible next step>` |
|
|
137
|
+
| Quality outlook | `<next meaningful quality focus or none>` |
|
|
138
|
+
|
|
139
|
+
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.
|
|
135
140
|
|
|
136
141
|
If this skill creates or updates control artefacts, do not paste full file bodies into the chat.
|
|
137
142
|
List paths, summarize the decision, name the blocker or approval needed, and keep the durable content in the files.
|
|
@@ -28,7 +28,7 @@ It reports:
|
|
|
28
28
|
Use `../agdf-runtime-contract.md` for Quality Contract output, Context Graph fields, gate terms, and non-duplication rules.
|
|
29
29
|
|
|
30
30
|
OR-specific output must make gate status, delivered and intentionally not delivered content, missing approvals, missing evidence, risks, retained fallbacks, and the next permissible step visible.
|
|
31
|
-
When `.agdf/control/` is present, persist or link the OR under `.agdf/control/artefacts/<key>/OR.md` and reference it from `
|
|
31
|
+
When `.agdf/control/` is present, persist or link the OR under `.agdf/control/artefacts/<key>/OR.md` and reference it from the selected canonical `RUN_STATE.md` or `MASTER_BACKLOG.md` when it is steering-relevant.
|
|
32
32
|
Use the Runtime Contract definition of `Relevant Run` to decide whether OR is mandatory or whether a Quick Task mini-closeout is enough.
|
|
33
33
|
|
|
34
34
|
## Rules
|
|
@@ -9,7 +9,8 @@ Use this scaffold when a target repository should keep AGDF state outside chat h
|
|
|
9
9
|
| File | Purpose |
|
|
10
10
|
|---|---|
|
|
11
11
|
| `config.json` | Project language preference for generated AGDF artefacts and user-facing chat |
|
|
12
|
-
| `templates/
|
|
12
|
+
| `templates/RUN_STATE.md` | Canonical version-2 template for isolated per-run state |
|
|
13
|
+
| `templates/AGDF_RUN.md` | Legacy migration-input and compatibility-projection template |
|
|
13
14
|
| `templates/MASTER_BACKLOG.md` | Template for the living backlog pointer: active initiatives and current UR/Brownfield/PRD/SD/TP/QA/OR artefacts |
|
|
14
15
|
| `templates/artefacts/UR.md` | Template for the durable user requirement artefact of a work item |
|
|
15
16
|
| `templates/artefacts/BROWNFIELD_REVIEW.md` | Template for the durable Brownfield Review and Mode/Slice Decision |
|
|
@@ -27,6 +28,9 @@ Use this scaffold when a target repository should keep AGDF state outside chat h
|
|
|
27
28
|
```text
|
|
28
29
|
.agdf/
|
|
29
30
|
control/
|
|
31
|
+
runs/
|
|
32
|
+
<run_id>/
|
|
33
|
+
RUN_STATE.md
|
|
30
34
|
config.json
|
|
31
35
|
AGDF_RUN.md
|
|
32
36
|
MASTER_BACKLOG.md
|
|
@@ -71,7 +75,13 @@ npx --yes @agdf/cli@latest gate-check --json
|
|
|
71
75
|
|
|
72
76
|
## Operating Rules
|
|
73
77
|
|
|
74
|
-
-
|
|
78
|
+
- Canonical mutable state is isolated per run at `runs/<run_id>/RUN_STATE.md`. Run discovery is
|
|
79
|
+
derived; do not maintain a writable active-run index. Select explicitly with `--run` or
|
|
80
|
+
`AGDF_RUN_ID` when more than one run is active.
|
|
81
|
+
- Migrate legacy state explicitly with `run-migrate`; read-only commands never migrate. A retained
|
|
82
|
+
`AGDF_RUN.md` is migration input or a non-authoritative projection, not a second writable owner.
|
|
83
|
+
|
|
84
|
+
- The selected `runs/<run_id>/RUN_STATE.md` is the current run dashboard.
|
|
75
85
|
- `config.json` stores the project preference for artefact and chat language; runtime rules stay English.
|
|
76
86
|
- `MASTER_BACKLOG.md` points to active delivery work; detailed artefacts live beside the work item.
|
|
77
87
|
- Brownfield Review records the post-UR Mode/Slice Decision before PRD depth or Quick Task execution is chosen.
|
|
@@ -80,6 +90,8 @@ npx --yes @agdf/cli@latest gate-check --json
|
|
|
80
90
|
- `SOT_REGISTRY.md` decides which document owns which domain.
|
|
81
91
|
- `CONTEXT_GRAPH.md` records durable project knowledge only when it has evidence and an exit criterion.
|
|
82
92
|
- `AGENT_QUALITY_CONTRACTS.json` names reusable block, revise and warning conditions.
|
|
83
|
-
-
|
|
93
|
+
- Never assign `merge=union` to canonical `runs/<run_id>/RUN_STATE.md` records. Concurrent edits to the
|
|
94
|
+
same run must remain conflict-visible; independent runs naturally change different files. After a
|
|
95
|
+
merge or pull, rerun `doctor` and `gate-check` for the selected run.
|
|
84
96
|
|
|
85
97
|
Do not duplicate full product documentation in this scaffold. Link to the authoritative artefact instead.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# AGDF Run State
|
|
2
|
+
|
|
3
|
+
## Run Meta
|
|
4
|
+
|
|
5
|
+
- control_state_version: 2
|
|
6
|
+
- run_id:
|
|
7
|
+
- lifecycle: active
|
|
8
|
+
- revision: 1
|
|
9
|
+
- revision_id:
|
|
10
|
+
- mode: structured_delivery
|
|
11
|
+
- current_gate: UR
|
|
12
|
+
- decision: in_progress
|
|
13
|
+
- owner: agent
|
|
14
|
+
|
|
15
|
+
## Objective
|
|
16
|
+
|
|
17
|
+
Describe the trustworthy outcome.
|
|
18
|
+
|
|
19
|
+
## Current Control State
|
|
20
|
+
|
|
21
|
+
| Question | Answer |
|
|
22
|
+
|---|---|
|
|
23
|
+
| What is known? | |
|
|
24
|
+
| What is approved? | |
|
|
25
|
+
| What is missing? | |
|
|
26
|
+
| What is the next allowed action? | |
|
|
27
|
+
| What is explicitly forbidden right now? | |
|
|
28
|
+
|
|
29
|
+
## Approvals
|
|
30
|
+
|
|
31
|
+
| Gate | Status | Evidence |
|
|
32
|
+
|---|---|---|
|
|
33
|
+
| UR | missing | |
|
|
34
|
+
| PRD | missing | |
|
|
35
|
+
| SD | missing | |
|
|
36
|
+
| TP | missing | |
|
|
37
|
+
| QA | missing | |
|
|
38
|
+
| UAT | missing | |
|
|
39
|
+
|
|
40
|
+
## Evidence
|
|
41
|
+
|
|
42
|
+
| Evidence | Source | Covers | Strength |
|
|
43
|
+
|---|---|---|---|
|
|
44
|
+
|
|
45
|
+
## Closeout
|
|
46
|
+
|
|
47
|
+
- next_allowed_action: Draft the current allowed artefact and preserve evidence.
|
|
48
|
+
- quality_outlook: Keep one mutable authority for this run.
|
|
@@ -6,6 +6,7 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
|
6
6
|
META_DIR="$(cd "${SCRIPT_DIR}/../meta" && pwd)"
|
|
7
7
|
ROUTER="${META_DIR}/agdf-agent-router.md"
|
|
8
8
|
CONSTITUTION="${META_DIR}/agdf-constitution.md"
|
|
9
|
+
RUNTIME_CONTRACT="${META_DIR}/agdf-runtime-contract.md"
|
|
9
10
|
CONFIG_PATH="${PWD}/.agdf/control/config.json"
|
|
10
11
|
|
|
11
12
|
CONFIG_HINT="Project config: .agdf/control/config.json not found. Use npx --yes @agdf/cli@latest config --language de|en to persist the project language."
|
|
@@ -40,4 +41,5 @@ Do not print the full router or constitution unless the user asks for them.
|
|
|
40
41
|
Source of truth:
|
|
41
42
|
- ${ROUTER}
|
|
42
43
|
- ${CONSTITUTION}
|
|
44
|
+
- ${RUNTIME_CONTRACT}
|
|
43
45
|
EOF
|
|
@@ -30,7 +30,8 @@ Do not add a separate `Quality outlook` line for pure Quick Tasks unless the tas
|
|
|
30
30
|
### Non-Normative Trivial Change Boundary
|
|
31
31
|
|
|
32
32
|
A `quick_task` whose entire diff stays fully outside all of the following paths may close using only
|
|
33
|
-
the compact output shape above, and must not create, rewrite or expand any
|
|
33
|
+
the compact output shape above, and must not create, rewrite or expand any selected canonical
|
|
34
|
+
`RUN_STATE.md` core
|
|
34
35
|
sections (Run Meta, Objective, Current Control State, Source And Scope State, Run Status Card,
|
|
35
36
|
Approvals, Artefacts, Mode/Slice Decision, Artefact Chain, Evidence, Missing Evidence, Risks, Context
|
|
36
37
|
Graph Impact, Knowledge Persistence Decision, Closeout):
|
|
@@ -207,9 +208,10 @@ OR is not mandatory for a pure explanation, read-only inspection, small review,
|
|
|
207
208
|
When in doubt, use a short OR-lite only if it clarifies gate state, evidence, risk, or the next permissible step.
|
|
208
209
|
|
|
209
210
|
A `quick_task` fully inside the Non-Normative Trivial Change Boundary above stays exempt from the full
|
|
210
|
-
|
|
211
|
-
another
|
|
212
|
-
changed and that it is unrelated; do not edit any other
|
|
211
|
+
selected-run ceremony even when it is otherwise a relevant run. If a selected canonical
|
|
212
|
+
`RUN_STATE.md` currently reflects another scope, append exactly one line to that run's
|
|
213
|
+
`Prior Run Pointers` section noting what changed and that it is unrelated; do not edit any other
|
|
214
|
+
section or any other existing line.
|
|
213
215
|
|
|
214
216
|
## Gate Rules
|
|
215
217
|
|
|
@@ -225,7 +227,7 @@ changed and that it is unrelated; do not edit any other section or any other exi
|
|
|
225
227
|
- Missing control files or missing current-state fields do not forbid the agent from preparing the current allowed artefact. They forbid later-gate work and implementation. For a fresh request, the default allowed work is to draft a minimal UR in the response and request `Approval: UR`. Initialize or write `.agdf/control/` only when the user explicitly asks for durable AGDF control state, the repository already uses `.agdf/control/` as its live working state, or a deterministic CLI/CI setup path is being executed.
|
|
226
228
|
- `Approval: UR` permits Brownfield Review after G-00 first, then a Mode/Slice Decision. It never permits implementation by itself.
|
|
227
229
|
- PRD, SD and TP depth is chosen after Brownfield Review through the Mode/Slice Decision, not before existing-system impact is understood.
|
|
228
|
-
- The Mode/Slice Decision must be visible before any PRD shortcut, Quick Task execution or implementation: record the decision, required next gate, scope reason and evidence in `
|
|
230
|
+
- The Mode/Slice Decision must be visible before any PRD shortcut, Quick Task execution or implementation: record the decision, required next gate, scope reason and evidence in the selected canonical `RUN_STATE.md` or an equivalent linked control artefact.
|
|
229
231
|
- `Approval: PRD` permits Solution Design drafting, not implementation.
|
|
230
232
|
- `Approval: SD` permits Task/Test Plan drafting, not implementation.
|
|
231
233
|
- `Approval: TP` permits implementation-preparation Brownfield Analysis and then CD+Tests when Brownfield evidence supports it.
|
|
@@ -327,10 +329,18 @@ Relevant-run closeout must reconcile Context Graph impact before presenting a cl
|
|
|
327
329
|
|
|
328
330
|
## Control Scaffold
|
|
329
331
|
|
|
332
|
+
### Run-Scoped Control State
|
|
333
|
+
|
|
334
|
+
Canonical mutable run state lives at `.agdf/control/runs/<run_id>/RUN_STATE.md`, one file per run.
|
|
335
|
+
Repository-level discovery is derived; do not maintain a writable active-run dashboard. Select with
|
|
336
|
+
`--run`, then `AGDF_RUN_ID`, or automatically only when exactly one run is active. Ambiguity fails
|
|
337
|
+
closed. Legacy `AGDF_RUN.md` is migration input or an explicitly rendered non-authoritative projection,
|
|
338
|
+
never a second writable owner. Read-only commands must not migrate state.
|
|
339
|
+
|
|
330
340
|
When a repository needs durable AGDF state, use the plugin-local `control/` scaffold as the starting point.
|
|
331
341
|
|
|
332
342
|
- `config.json` stores project language preferences. Use `artifact_language` for generated AGDF artefacts and `chat_language` for user-facing responses unless the user explicitly asks otherwise. Runtime rules remain English.
|
|
333
|
-
-
|
|
343
|
+
- `.agdf/control/runs/<run_id>/RUN_STATE.md` is the canonical current-run dashboard; legacy `AGDF_RUN.md` is migration input or an explicit non-authoritative projection.
|
|
334
344
|
- `MASTER_BACKLOG.md` is the living pointer for active delivery work.
|
|
335
345
|
- `BROWNFIELD_REVIEW.md` records the post-UR existing-system view and Mode/Slice Decision before PRD depth or Quick Task execution is chosen.
|
|
336
346
|
- `SOT_REGISTRY.md` prevents parallel sources of truth.
|
|
@@ -378,8 +388,8 @@ They make the repository state checkable, but they do not replace the native ski
|
|
|
378
388
|
|
|
379
389
|
## Delivery Map
|
|
380
390
|
|
|
381
|
-
`delivery-map --json` is the machine-readable delivery picture for the
|
|
382
|
-
It derives, but does not replace, the
|
|
391
|
+
`delivery-map --json` is the machine-readable delivery picture for the selected canonical control state.
|
|
392
|
+
It derives, but does not replace, the selected `RUN_STATE.md` and `MASTER_BACKLOG.md` state.
|
|
383
393
|
|
|
384
394
|
It must expose:
|
|
385
395
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: brownfield-analysis
|
|
3
|
-
description: Use this skill after gate-check or live AGDF control state confirms that Brownfield Review or implementation preparation is allowed. Use it after Approval: UR as the lightweight Brownfield Review after G-00 before PRD when existing systems may be affected, and again before non-trivial implementation after TP. Do not use it as the first AGDF skill for a fresh "I want to build/change X" prompt when approval, scope, or next allowed action is unclear.
|
|
3
|
+
description: "Use this skill after gate-check or live AGDF control state confirms that Brownfield Review or implementation preparation is allowed. Use it after Approval: UR as the lightweight Brownfield Review after G-00 before PRD when existing systems may be affected, and again before non-trivial implementation after TP. Do not use it as the first AGDF skill for a fresh \"I want to build/change X\" prompt when approval, scope, or next allowed action is unclear."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# brownfield-analysis
|
|
@@ -47,8 +47,8 @@ Do not mix both modes silently. Name the active mode in the output.
|
|
|
47
47
|
13. Specification archive migrations must follow the archive index if present.
|
|
48
48
|
|
|
49
49
|
## When To Use
|
|
50
|
-
- after `gate-check` permits `Brownfield Review` or
|
|
51
|
-
- after `gate-check` permits implementation preparation or
|
|
50
|
+
- after `gate-check` permits `Brownfield Review` or the selected canonical run record names Brownfield Review as the next allowed action
|
|
51
|
+
- after `gate-check` permits implementation preparation or the selected canonical run record already names Brownfield Analysis as the next allowed action
|
|
52
52
|
- after `Approval: UR` when existing owners, SoT, contracts, policies, persistence, runtime paths, tests, UI, UX or architecture may affect PRD/SD scope
|
|
53
53
|
- before `CD+Tests`
|
|
54
54
|
- before changes to an existing repository
|
|
@@ -28,7 +28,7 @@ This skill is the primary operating path for gate judgement.
|
|
|
28
28
|
|
|
29
29
|
First inspect the durable control state directly:
|
|
30
30
|
|
|
31
|
-
- `.agdf/control/AGDF_RUN.md`
|
|
31
|
+
- selected `.agdf/control/runs/<run_id>/RUN_STATE.md` (or legacy `AGDF_RUN.md` before explicit migration)
|
|
32
32
|
- `.agdf/control/MASTER_BACKLOG.md`
|
|
33
33
|
- `.agdf/control/SOT_REGISTRY.md`
|
|
34
34
|
- `.agdf/control/CONTEXT_GRAPH.md`
|
|
@@ -47,7 +47,7 @@ npx --yes @agdf/cli@latest gate-check --json
|
|
|
47
47
|
npx --yes @agdf/cli@latest delivery-map --json
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
-
`init` creates the control scaffold. `doctor` checks whether `.agdf/control/` is actionable. `gate-check` consumes that result and
|
|
50
|
+
`init` creates the control scaffold. `doctor` checks whether `.agdf/control/` is actionable. `gate-check` consumes that result and the selected canonical run record to report the operative process decision: `open | blocked`, current gate, blocking reason, missing approval, allowed outputs, forbidden outputs, next allowed action and evidence references.
|
|
51
51
|
`delivery-map` reports the durable delivery picture: active artefacts, approvals, Artefact Chain relationships, evidence refs, missing evidence, risks, Context Graph gate effect and machine-readable findings.
|
|
52
52
|
|
|
53
53
|
The CLI reports are validators and JSON evidence, not the primary user experience, not a required ritual for normal work and not a second rule system. If a report says `blocked`, do not continue with later-gate artefacts until the reported blocker is resolved.
|
|
@@ -124,14 +124,19 @@ If a status is not explicit, do not assume it is satisfied.
|
|
|
124
124
|
12. If branch, workspace and durable artefacts disagree, do not choose a scope silently; report the ambiguity and ask for the smallest clarifying gate action.
|
|
125
125
|
|
|
126
126
|
## Output
|
|
127
|
-
Keep the result short and operational:
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
127
|
+
Keep the result short and operational. Render the Runtime Contract's compact human-facing Run Status Card rather than a surface-specific summary:
|
|
128
|
+
|
|
129
|
+
| Run status | Value |
|
|
130
|
+
|---|---|
|
|
131
|
+
| Status | `open | blocked` |
|
|
132
|
+
| Current gate | `<GateName or internal step>` |
|
|
133
|
+
| Allowed now | `<currently allowed outputs>` |
|
|
134
|
+
| Blocked by | `<blocking condition or none>` |
|
|
135
|
+
| Missing approval | `Approval: <GateName> | none` |
|
|
136
|
+
| Next step | `<single permissible next step>` |
|
|
137
|
+
| Quality outlook | `<next meaningful quality focus or none>` |
|
|
138
|
+
|
|
139
|
+
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.
|
|
135
140
|
|
|
136
141
|
If this skill creates or updates control artefacts, do not paste full file bodies into the chat.
|
|
137
142
|
List paths, summarize the decision, name the blocker or approval needed, and keep the durable content in the files.
|
|
@@ -28,7 +28,7 @@ It reports:
|
|
|
28
28
|
Use `../../meta/agdf-runtime-contract.md` for Quality Contract output, Context Graph fields, gate terms, and non-duplication rules.
|
|
29
29
|
|
|
30
30
|
OR-specific output must make gate status, delivered and intentionally not delivered content, missing approvals, missing evidence, risks, retained fallbacks, and the next permissible step visible.
|
|
31
|
-
When `.agdf/control/` is present, persist or link the OR under `.agdf/control/artefacts/<key>/OR.md` and reference it from `
|
|
31
|
+
When `.agdf/control/` is present, persist or link the OR under `.agdf/control/artefacts/<key>/OR.md` and reference it from the selected canonical `RUN_STATE.md` or `MASTER_BACKLOG.md` when it is steering-relevant.
|
|
32
32
|
Use the Runtime Contract definition of `Relevant Run` to decide whether OR is mandatory or whether a Quick Task mini-closeout is enough.
|
|
33
33
|
|
|
34
34
|
## Rules
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const STATUS_RANK = { pass: 0, warn: 1, revise: 2, block: 3 };
|
|
2
|
+
|
|
3
|
+
export function aggregate(results, { allowNoActiveRuns = false } = {}) {
|
|
4
|
+
const runs = [...results].sort((left, right) =>
|
|
5
|
+
left.run_id.localeCompare(right.run_id),
|
|
6
|
+
);
|
|
7
|
+
const status = runs.length
|
|
8
|
+
? runs.reduce(
|
|
9
|
+
(current, run) =>
|
|
10
|
+
STATUS_RANK[run.status] > STATUS_RANK[current] ? run.status : current,
|
|
11
|
+
"pass",
|
|
12
|
+
)
|
|
13
|
+
: allowNoActiveRuns
|
|
14
|
+
? "pass"
|
|
15
|
+
: "revise";
|
|
16
|
+
|
|
17
|
+
return { status, runs };
|
|
18
|
+
}
|