mdkg 0.1.3 → 0.1.5
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/CHANGELOG.md +45 -1
- package/README.md +34 -10
- package/dist/cli.js +354 -87
- package/dist/commands/bundle.js +7 -7
- package/dist/commands/capability.js +118 -4
- package/dist/commands/doctor.js +15 -15
- package/dist/commands/goal.js +548 -0
- package/dist/commands/index.js +1 -1
- package/dist/commands/init.js +1 -0
- package/dist/commands/list.js +1 -1
- package/dist/commands/new.js +7 -1
- package/dist/commands/next.js +1 -1
- package/dist/commands/node_card.js +1 -1
- package/dist/commands/pack.js +1 -1
- package/dist/commands/search.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/subgraph.js +312 -0
- package/dist/commands/task.js +1 -1
- package/dist/commands/upgrade.js +54 -7
- package/dist/commands/validate.js +39 -7
- package/dist/commands/work.js +1 -1
- package/dist/core/config.js +95 -39
- package/dist/graph/frontmatter.js +8 -0
- package/dist/graph/goal_scope.js +127 -0
- package/dist/graph/index_cache.js +12 -12
- package/dist/graph/indexer.js +1 -1
- package/dist/graph/node.js +80 -1
- package/dist/graph/reindex.js +6 -6
- package/dist/graph/sqlite_index.js +6 -6
- package/dist/graph/{bundle_imports.js → subgraphs.js} +214 -140
- package/dist/graph/validate_graph.js +41 -0
- package/dist/graph/visibility.js +3 -3
- package/dist/init/AGENT_START.md +17 -1
- package/dist/init/CLI_COMMAND_MATRIX.md +43 -7
- package/dist/init/README.md +9 -8
- package/dist/init/config.json +1 -1
- package/dist/init/core/rule-3-cli-contract.md +56 -23
- package/dist/init/core/rule-4-repo-safety-and-ignores.md +7 -2
- package/dist/init/core/rule-6-templates-and-schemas.md +10 -1
- package/dist/init/init-manifest.json +20 -10
- package/dist/init/skills/default/pursue-mdkg-goal/SKILL.md +68 -0
- package/dist/init/skills/default/select-work-and-ground-context/SKILL.md +9 -7
- package/dist/init/skills/default/verify-close-and-checkpoint/SKILL.md +11 -10
- package/dist/init/templates/default/goal.md +91 -0
- package/dist/pack/order.js +2 -1
- package/dist/pack/pack.js +17 -0
- package/dist/util/argparse.js +2 -0
- package/package.json +8 -6
- package/dist/commands/bundle_import.js +0 -255
|
@@ -19,6 +19,7 @@ Primary commands:
|
|
|
19
19
|
- `mdkg archive`
|
|
20
20
|
- `mdkg bundle`
|
|
21
21
|
- `mdkg work`
|
|
22
|
+
- `mdkg goal`
|
|
22
23
|
- `mdkg task`
|
|
23
24
|
- `mdkg validate`
|
|
24
25
|
|
|
@@ -32,6 +33,7 @@ Validation commands:
|
|
|
32
33
|
|
|
33
34
|
Node creation commands:
|
|
34
35
|
- `mdkg new <type> "<title>" [options] [--json]`
|
|
36
|
+
- `mdkg new goal "<title>" [options] [--json]`
|
|
35
37
|
|
|
36
38
|
Agent workflow file type creation:
|
|
37
39
|
- `mdkg new spec "<title>" [options] [--json]`
|
|
@@ -48,6 +50,7 @@ Agent workflow notes:
|
|
|
48
50
|
- `--id <portable-id>` is only for agent workflow file types.
|
|
49
51
|
- `spec` and `work` scaffold as validation-clean standalone docs.
|
|
50
52
|
- `work_order`, `receipt`, `feedback`, `dispute`, and `proposal` need real refs before strict `mdkg validate` passes.
|
|
53
|
+
- `goal` nodes capture recursive objective state and required checks, but normal `mdkg next` does not select them.
|
|
51
54
|
|
|
52
55
|
Workspace registry commands:
|
|
53
56
|
- `mdkg workspace ls [--json]`
|
|
@@ -92,6 +95,7 @@ Capability discovery:
|
|
|
92
95
|
- `mdkg capability list [--kind <skill|spec|work|core|design>] [--visibility <private|internal|public>] [--json]`
|
|
93
96
|
- `mdkg capability search "<query>" [--kind <kind>] [--visibility <level>] [--json]`
|
|
94
97
|
- `mdkg capability show <id-or-qid-or-slug> [--json]`
|
|
98
|
+
- `mdkg capability resolve [query] [--requires <capability>] [--fresh-only] [--json]`
|
|
95
99
|
- capability records are deterministic cache projections from Markdown
|
|
96
100
|
- records include source hash, headings, refs, and `indexed_at`
|
|
97
101
|
- normal task, epic, feat, bug, test, and checkpoint nodes are intentionally excluded
|
|
@@ -114,16 +118,24 @@ Graph snapshot bundles:
|
|
|
114
118
|
- `mdkg bundle verify [bundle-path] [--json]`
|
|
115
119
|
- `mdkg bundle show <bundle-path> [--json]`
|
|
116
120
|
- `mdkg bundle list [--json]`
|
|
117
|
-
- `mdkg bundle import add/list/rm/enable/disable/verify ...`
|
|
118
|
-
- `mdkg bundle import add <alias> <bundle-path> [--visibility private|internal|public] [--profile private|public] [--source-path <path>] [--json]`
|
|
119
|
-
- `mdkg bundle import verify [alias|--all] [--json]`
|
|
120
121
|
- default output is `.mdkg/bundles/<profile>/<workspace-or-all>.mdkg.zip`
|
|
121
122
|
- private bundles are explicit local graph transport artifacts
|
|
122
|
-
- bundle imports are read-only planning views and use import-alias qids such as `child_repo:task-1`
|
|
123
123
|
- repos that track archive caches or bundles should run `mdkg archive compress --all`, `mdkg archive verify --json`, `mdkg bundle create --profile private`, and `mdkg bundle verify .mdkg/bundles/private/all.mdkg.zip` before commit
|
|
124
124
|
- public bundles include only public workspace content and public archive sidecars
|
|
125
|
-
- public bundle creation fails when public records reference private graph, archive, or
|
|
126
|
-
|
|
125
|
+
- public bundle creation fails when public records reference private graph, archive, or subgraph records
|
|
126
|
+
|
|
127
|
+
Subgraph orchestration:
|
|
128
|
+
- `mdkg subgraph add <alias> <bundle-path> [--visibility private|internal|public] [--profile private|public] [--source-path <path>] [--json]`
|
|
129
|
+
- `mdkg subgraph list [--json]`
|
|
130
|
+
- `mdkg subgraph show <alias> [--json]`
|
|
131
|
+
- `mdkg subgraph rm <alias> [--json]`
|
|
132
|
+
- `mdkg subgraph enable <alias> [--json]`
|
|
133
|
+
- `mdkg subgraph disable <alias> [--json]`
|
|
134
|
+
- `mdkg subgraph verify [alias|--all] [--json]`
|
|
135
|
+
- `mdkg subgraph refresh [alias|--all] [--json]`
|
|
136
|
+
- subgraphs are read-only planning views and use subgraph-alias qids such as `child_repo:task-1`
|
|
137
|
+
- subgraph refresh reloads configured bundle sources only and never mutates child repos
|
|
138
|
+
- public/internal subgraphs require public bundle profiles
|
|
127
139
|
|
|
128
140
|
Work semantic mirrors:
|
|
129
141
|
- `mdkg work contract new "<title>" --id <work.id> --agent-id <agent.id> --kind <kind> --inputs <...> --outputs <...> [--required-capabilities <...>] [--pricing-model <...>] [--json]`
|
|
@@ -135,7 +147,31 @@ Work semantic mirrors:
|
|
|
135
147
|
- work commands mutate mdkg semantic mirror files only; production order, receipt, feedback, dispute, payment, ledger, marketplace inventory, fulfillment, and execution state remains canonical outside mdkg
|
|
136
148
|
- do not store raw secrets, credentials, live payment state, ledger mutations, or canonical marketplace state in work mirrors
|
|
137
149
|
- `artifact://...` refs identify external/runtime-managed artifacts; `archive://...` refs identify committed mdkg archive sidecars
|
|
138
|
-
- work update and artifact commands accept local ids or local qids;
|
|
150
|
+
- work update and artifact commands accept local ids or local qids; subgraph qids are read-only and must be changed in their source workspace
|
|
151
|
+
|
|
152
|
+
Goal nodes:
|
|
153
|
+
- `mdkg goal show <goal-id-or-qid> [--json]`
|
|
154
|
+
- `mdkg goal select <goal-id-or-qid> [--json]`
|
|
155
|
+
- `mdkg goal current [--json]`
|
|
156
|
+
- `mdkg goal clear [--json]`
|
|
157
|
+
- `mdkg goal next [goal-id-or-qid] [--json]`
|
|
158
|
+
- `mdkg goal claim [goal-id-or-qid] <work-id-or-qid> [--json]`
|
|
159
|
+
- `mdkg goal evaluate <goal-id-or-qid> [--json]`
|
|
160
|
+
- `mdkg goal pause|resume|done <goal-id-or-qid> [--json]`
|
|
161
|
+
- `mdkg goal show <goal-id-or-qid> [--ws <alias>] [--json]`
|
|
162
|
+
- `mdkg goal select <goal-id-or-qid> [--ws <alias>] [--json]`
|
|
163
|
+
- `mdkg goal current [--ws <alias>] [--json]`
|
|
164
|
+
- `mdkg goal next [goal-id-or-qid] [--ws <alias>] [--json]`
|
|
165
|
+
- `mdkg goal claim <work-id-or-qid> [--ws <alias>] [--json]`
|
|
166
|
+
- `mdkg goal claim <goal-id-or-qid> <work-id-or-qid> [--ws <alias>] [--json]`
|
|
167
|
+
- `mdkg goal evaluate <goal-id-or-qid> [--ws <alias>] [--json]`
|
|
168
|
+
- `mdkg goal pause <goal-id-or-qid> [--ws <alias>] [--json]`
|
|
169
|
+
- `mdkg goal resume <goal-id-or-qid> [--ws <alias>] [--json]`
|
|
170
|
+
- `mdkg goal done <goal-id-or-qid> [--ws <alias>] [--json]`
|
|
171
|
+
- goals orchestrate recursive progress through explicit `scope_refs`; tasks, bugs, tests, and features remain concrete executable units
|
|
172
|
+
- `goal next` is read-only; use `goal claim` to set `active_node`
|
|
173
|
+
- `mdkg goal evaluate` is report-only and never runs commands from `required_checks`
|
|
174
|
+
- skill improvements discovered during normal goal execution should be recorded as candidates or proposals unless the active node is skill-maintenance
|
|
139
175
|
|
|
140
176
|
Discovery/show export flags:
|
|
141
177
|
- `--json`
|
package/dist/init/README.md
CHANGED
|
@@ -26,11 +26,11 @@ mdkg pack <id>
|
|
|
26
26
|
mdkg capability search "..."
|
|
27
27
|
mdkg archive list
|
|
28
28
|
mdkg bundle create --profile private
|
|
29
|
-
mdkg
|
|
29
|
+
mdkg subgraph list --json
|
|
30
30
|
mdkg validate
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
This repo is already initialized. Use `mdkg upgrade` to preview safe scaffold updates, `mdkg new` to create work, `mdkg search`/`mdkg show` to inspect graph state, `mdkg capability ...` to inspect cached skill/spec/work/core/design capabilities, `mdkg archive ...` to register source/artifact sidecars, `mdkg work ...` to create work contract/order/receipt semantic mirrors, `mdkg bundle ...` to create full graph snapshot bundles
|
|
33
|
+
This repo is already initialized. Use `mdkg upgrade` to preview safe scaffold updates, `mdkg new` to create work, `mdkg new goal "..."` plus `mdkg goal select/current/next/claim/evaluate` for recursive long-running objectives, `mdkg search`/`mdkg show` to inspect graph state, `mdkg capability ...` to inspect cached skill/spec/work/core/design capabilities, `mdkg capability resolve ...` to rank local and subgraph capabilities, `mdkg archive ...` to register source/artifact sidecars, `mdkg work ...` to create work contract/order/receipt semantic mirrors, `mdkg bundle ...` to create full graph snapshot bundles, `mdkg subgraph ...` to register read-only child graph planning views, `mdkg pack <id>` to build deterministic context, and `mdkg validate` before closeout.
|
|
34
34
|
|
|
35
35
|
Agent workflow docs can use semantic ids:
|
|
36
36
|
|
|
@@ -87,16 +87,17 @@ mdkg bundle create --profile private
|
|
|
87
87
|
mdkg bundle verify .mdkg/bundles/private/all.mdkg.zip
|
|
88
88
|
```
|
|
89
89
|
|
|
90
|
-
Use this as a pre-commit recommendation only when the repo tracks archive caches or `.mdkg/bundles/`. Private bundles are local graph transport artifacts and may be tracked in private repos when configured. Public bundles require selected workspaces with `visibility: public` and fail closed when public records reference private graph, archive, or
|
|
90
|
+
Use this as a pre-commit recommendation only when the repo tracks archive caches or `.mdkg/bundles/`. Private bundles are local graph transport artifacts and may be tracked in private repos when configured. Public bundles require selected workspaces with `visibility: public` and fail closed when public records reference private graph, archive, or subgraph records.
|
|
91
91
|
|
|
92
|
-
Register child bundle snapshots as read-only
|
|
92
|
+
Register child bundle snapshots as read-only subgraphs with:
|
|
93
93
|
|
|
94
94
|
```bash
|
|
95
|
-
mdkg
|
|
96
|
-
mdkg
|
|
95
|
+
mdkg subgraph add child_repo child-repo/.mdkg/bundles/private/all.mdkg.zip --source-path child-repo
|
|
96
|
+
mdkg capability resolve "child capability" --json
|
|
97
|
+
mdkg subgraph verify child_repo --json
|
|
97
98
|
```
|
|
98
99
|
|
|
99
|
-
|
|
100
|
+
Subgraph nodes use the subgraph alias as their qid prefix and can be inspected or packed, but mutations must happen in the owning child repo.
|
|
100
101
|
|
|
101
102
|
## Archive and Work Mirrors
|
|
102
103
|
|
|
@@ -118,7 +119,7 @@ mdkg work receipt new "example receipt" --id receipt.example-1 --work-order-id o
|
|
|
118
119
|
```
|
|
119
120
|
|
|
120
121
|
Receipt statuses are `recorded`, `verified`, `rejected`, and `superseded`.
|
|
121
|
-
Update and artifact commands accept local ids or local qids;
|
|
122
|
+
Update and artifact commands accept local ids or local qids; subgraph qids are read-only and must be changed in their source workspace.
|
|
122
123
|
|
|
123
124
|
Production orders, receipts, feedback, disputes, payments, ledgers, marketplace inventory, fulfillment records, and execution state remain canonical outside mdkg. mdkg stores committed semantic mirrors and reviewable evidence. Do not store raw secrets, credentials, live payment state, ledger mutations, canonical marketplace state, or bulky raw payloads in these mirrors.
|
|
124
125
|
|
package/dist/init/config.json
CHANGED
|
@@ -69,9 +69,9 @@ Workspaces are registered in `.mdkg/config.json`.
|
|
|
69
69
|
|
|
70
70
|
Qualified IDs may be used as input:
|
|
71
71
|
- `<ws>:<id>` (example: `e2e:task-12`)
|
|
72
|
-
-
|
|
73
|
-
- `<
|
|
74
|
-
-
|
|
72
|
+
- Subgraph nodes use the same qualified form with the subgraph alias:
|
|
73
|
+
- `<subgraph-alias>:<id>` (example: `agent_image:work.generate-image`)
|
|
74
|
+
- subgraph nodes are read-only planning context and MUST NOT be selected by local mutation commands
|
|
75
75
|
|
|
76
76
|
If a user provides an unqualified ID and it is ambiguous globally:
|
|
77
77
|
- mdkg MUST error and suggest qualified IDs.
|
|
@@ -145,7 +145,7 @@ If a user provides an unqualified ID and it is ambiguous globally:
|
|
|
145
145
|
- rebuild global cache `.mdkg/index/global.json`
|
|
146
146
|
- rebuild skills cache `.mdkg/index/skills.json` from `.mdkg/skills/<slug>/SKILL.md`
|
|
147
147
|
- rebuild capability cache `.mdkg/index/capabilities.json` from skills, `SPEC.md`, `WORK.md`, core docs, and design docs
|
|
148
|
-
- rebuild
|
|
148
|
+
- rebuild subgraph projection cache `.mdkg/index/subgraphs.json` when subgraphs are configured
|
|
149
149
|
- rebuild SQLite access cache `.mdkg/index/mdkg.sqlite` when `index.backend` is `sqlite`
|
|
150
150
|
- tolerate `.mdkg/skills/<slug>/SKILLS.md` on read with warning
|
|
151
151
|
- fail validation if both `SKILL.md` and `SKILLS.md` exist in one skill directory
|
|
@@ -157,6 +157,7 @@ If a user provides an unqualified ID and it is ambiguous globally:
|
|
|
157
157
|
- uses global templates (root-only) via token substitution
|
|
158
158
|
- writes into the appropriate workspace-local `.mdkg/<area>/` folder
|
|
159
159
|
- updates index if necessary
|
|
160
|
+
- supports `goal` nodes for recursive objective contracts
|
|
160
161
|
|
|
161
162
|
Common flags:
|
|
162
163
|
- `--ws <alias>` (default `root`)
|
|
@@ -176,6 +177,27 @@ Common flags:
|
|
|
176
177
|
- `--skills <slug,slug,...>` (work items)
|
|
177
178
|
- `--template <set>` (default from config)
|
|
178
179
|
|
|
180
|
+
### Goal commands
|
|
181
|
+
- `mdkg goal show <goal-id-or-qid> [--ws <alias>] [--json]`
|
|
182
|
+
- reports condition, goal state, scope refs, active node, required skills, required checks, and source path
|
|
183
|
+
- `mdkg goal select <goal-id-or-qid> [--ws <alias>] [--json]`
|
|
184
|
+
- stores local ignored selected-goal state at `.mdkg/state/selected-goal.json`
|
|
185
|
+
- `mdkg goal current [--ws <alias>] [--json]`
|
|
186
|
+
- reports selected goal or a unique active goal fallback without requiring committed state
|
|
187
|
+
- `mdkg goal clear [--json]`
|
|
188
|
+
- clears local selected-goal state
|
|
189
|
+
- `mdkg goal next [goal-id-or-qid] [--ws <alias>] [--json]`
|
|
190
|
+
- read-only; resolves explicit id, then selected goal, then one unique active goal
|
|
191
|
+
- recursively expands `scope_refs` through `epic` and `parent` edges
|
|
192
|
+
- selects local `feat`, `task`, `bug`, or `test` work and never returns the goal or container-only epic itself
|
|
193
|
+
- `mdkg goal claim [goal-id-or-qid] <work-id-or-qid> [--ws <alias>] [--json]`
|
|
194
|
+
- explicit mutating path that writes goal `active_node` after the work is confirmed inside scope
|
|
195
|
+
- `mdkg goal evaluate <goal-id-or-qid> [--ws <alias>] [--json]`
|
|
196
|
+
- report-only; lists required checks and completion evidence state without executing scripts
|
|
197
|
+
- `mdkg goal pause|resume|done <goal-id-or-qid> [--ws <alias>] [--json]`
|
|
198
|
+
- updates `goal_state`, compatible work status, and `updated`
|
|
199
|
+
- subgraph goal qids are read-only and must be changed in their source workspace
|
|
200
|
+
|
|
179
201
|
### Read/search
|
|
180
202
|
- `mdkg show <id-or-qid> [--meta] [--json|--xml|--toon|--md]`
|
|
181
203
|
- default behavior shows the full node body
|
|
@@ -183,10 +205,10 @@ Common flags:
|
|
|
183
205
|
- `mdkg search "<query>" [--type <type>] [--status <status>] [--ws <alias>] [--tags <tag,tag,...>] [--tags-mode any|all] [--json|--xml|--toon|--md]`
|
|
184
206
|
- search SHOULD match on IDs, titles, tags, path tokens, and searchable frontmatter lists (`links`, `artifacts`, `refs`, `aliases`)
|
|
185
207
|
- `mdkg list [--type <type>] [--status <status>] [--ws <alias>] [--epic <id>] [--blocked] [--priority <n>] [--tags <tag,tag,...>] [--tags-mode any|all] [--json|--xml|--toon|--md]`
|
|
186
|
-
- enabled
|
|
187
|
-
-
|
|
188
|
-
- human output labels
|
|
189
|
-
- stale
|
|
208
|
+
- enabled subgraphs are included in `show`, `search`, `list`, `pack`, and `capability` reads by default:
|
|
209
|
+
- subgraph nodes surface `source.imported: true` and `source.subgraph_alias` in JSON output
|
|
210
|
+
- human output labels subgraph nodes as read-only and stale when applicable
|
|
211
|
+
- stale subgraphs warn during planning reads but remain usable
|
|
190
212
|
- skills are first-class under `mdkg skill ...` only:
|
|
191
213
|
- `mdkg skill list [--tags <tag,tag,...>] [--tags-mode any|all] [--json|--xml|--toon|--md]`
|
|
192
214
|
- `mdkg skill show <slug> [--meta] [--json|--xml|--toon|--md]`
|
|
@@ -197,7 +219,9 @@ Common flags:
|
|
|
197
219
|
- `mdkg capability list [--kind <skill|spec|work|core|design>] [--visibility <private|internal|public>] [--json]`
|
|
198
220
|
- `mdkg capability search "<query>" [--kind <kind>] [--visibility <level>] [--json]`
|
|
199
221
|
- `mdkg capability show <id-or-qid-or-slug> [--json]`
|
|
222
|
+
- `mdkg capability resolve [query] [--requires <capability>] [--fresh-only] [--json]`
|
|
200
223
|
- capability records are read-only derived cache entries, not source of truth
|
|
224
|
+
- `resolve` ranks local and subgraph capability candidates deterministically and degrades stale subgraphs unless `--fresh-only` is supplied
|
|
201
225
|
- normal task, epic, feat, bug, test, and checkpoint nodes are not capability records
|
|
202
226
|
- archives are first-class sidecar nodes under `mdkg archive ...`:
|
|
203
227
|
- `mdkg archive add <file> [--id <archive.id>] [--kind source|artifact] [--visibility private|internal|public] [--title <title>] [--refs <...>] [--relates <...>] [--json]`
|
|
@@ -215,21 +239,26 @@ Common flags:
|
|
|
215
239
|
- `mdkg bundle verify [bundle-path] [--json]`
|
|
216
240
|
- `mdkg bundle show <bundle-path> [--json]`
|
|
217
241
|
- `mdkg bundle list [--json]`
|
|
218
|
-
- `mdkg bundle import add <alias> <bundle-path> [--visibility private|internal|public] [--profile private|public] [--source-path <path>] [--source-repo <ref>] [--max-stale-seconds <seconds>] [--json]`
|
|
219
|
-
- `mdkg bundle import list [--json]`
|
|
220
|
-
- `mdkg bundle import rm <alias> [--json]`
|
|
221
|
-
- `mdkg bundle import enable <alias> [--json]`
|
|
222
|
-
- `mdkg bundle import disable <alias> [--json]`
|
|
223
|
-
- `mdkg bundle import verify [alias|--all] [--json]`
|
|
224
242
|
- bundles are explicit transport artifacts and are not rewritten by `mdkg index`
|
|
225
243
|
- default output is `.mdkg/bundles/<profile>/<workspace-or-all>.mdkg.zip`
|
|
226
244
|
- public bundles must fail closed when public records reference private graph or archive records
|
|
227
|
-
- public bundles must fail closed when public records reference private/internal
|
|
228
|
-
- bundle
|
|
229
|
-
- `bundle import verify` exits nonzero for stale, missing, corrupt, profile-mismatched, or duplicate-id imports
|
|
230
|
-
- public bundle creation must not re-export imported child graph content and must fail if public local nodes reference private/internal imports
|
|
231
|
-
- public/internal imports require `expected_profile: public`; private bundle profiles cannot be promoted through import visibility
|
|
245
|
+
- public bundles must fail closed when public records reference private/internal subgraph records
|
|
246
|
+
- public bundle creation must not re-export subgraph content and must fail if public local nodes reference private/internal subgraphs
|
|
232
247
|
- `mdkg pack --visibility public|internal|private` records explicit pack visibility and filters public/internal packs through the same fail-closed policy
|
|
248
|
+
- subgraph orchestration lives under `mdkg subgraph ...`:
|
|
249
|
+
- `mdkg subgraph add <alias> <bundle-path> [--visibility private|internal|public] [--profile private|public] [--source-path <path>] [--source-repo <ref>] [--max-stale-seconds <seconds>] [--json]`
|
|
250
|
+
- `mdkg subgraph list [--json]`
|
|
251
|
+
- `mdkg subgraph show <alias> [--json]`
|
|
252
|
+
- `mdkg subgraph rm <alias> [--json]`
|
|
253
|
+
- `mdkg subgraph enable <alias> [--json]`
|
|
254
|
+
- `mdkg subgraph disable <alias> [--json]`
|
|
255
|
+
- `mdkg subgraph verify [alias|--all] [--json]`
|
|
256
|
+
- `mdkg subgraph refresh [alias|--all] [--json]`
|
|
257
|
+
- subgraphs are read-only projected graph views; child repos remain owners of real mutations and commits
|
|
258
|
+
- `subgraph refresh` reloads configured bundle sources only and never builds or mutates child repos
|
|
259
|
+
- `subgraph verify` exits nonzero for stale, missing, corrupt, profile-mismatched, or duplicate-id subgraphs
|
|
260
|
+
- public/internal subgraphs require `expected_profile: public`; private bundle profiles cannot be promoted through subgraph visibility
|
|
261
|
+
- legacy `mdkg bundle import ...` exits with guidance to run `mdkg upgrade --apply` and use `mdkg subgraph ...`
|
|
233
262
|
- work lifecycle helpers live under `mdkg work ...`:
|
|
234
263
|
- `mdkg work contract new "<title>" --id <work.id> --agent-id <agent.id> --kind <kind> --inputs <...> --outputs <...> [--required-capabilities <...>] [--pricing-model <...>] [--json]`
|
|
235
264
|
- `mdkg work order new "<title>" --id <order.id> --work-id <work.id> --requester <ref> [--request-ref <ref>] [--input-refs <...>] [--requested-outputs <...>] [--json]`
|
|
@@ -240,7 +269,7 @@ Common flags:
|
|
|
240
269
|
- these commands mutate mdkg semantic mirror files only; production order, receipt, feedback, dispute, payment, ledger, marketplace inventory, fulfillment, and execution state remains canonical outside mdkg
|
|
241
270
|
- work mirrors must not store raw secrets, credentials, live payment state, ledger mutations, or canonical marketplace state
|
|
242
271
|
- `artifact://...` refs identify external/runtime-managed artifacts; `archive://...` refs identify committed mdkg archive sidecars
|
|
243
|
-
- update and artifact commands accept local ids or local qids;
|
|
272
|
+
- update and artifact commands accept local ids or local qids; subgraph qids are read-only and must be changed in their source workspace
|
|
244
273
|
- discovery/show output flags are mutually exclusive; text mode remains the default when none are supplied
|
|
245
274
|
|
|
246
275
|
### Task lifecycle mutation
|
|
@@ -251,7 +280,7 @@ Common flags:
|
|
|
251
280
|
- supports additive list mutation for `artifacts`, `links`, `refs`, `skills`, `tags`, and `blocked_by`
|
|
252
281
|
- supports scalar replacement for `status` and `priority`
|
|
253
282
|
- `--clear-blocked-by` resets blockers before optional re-add
|
|
254
|
-
-
|
|
283
|
+
- subgraph qids fail with an explicit read-only subgraph error
|
|
255
284
|
- `mdkg task done <id-or-qid> [--checkpoint "<title>"] [...]`
|
|
256
285
|
- supports `task`, `bug`, and `test` nodes only
|
|
257
286
|
- sets `status: done`
|
|
@@ -283,6 +312,7 @@ Common flags:
|
|
|
283
312
|
- `mdkg next [<id-or-qid>] [--ws <alias>]`
|
|
284
313
|
- If `<id>` provided: follow `next` if present; otherwise fall back to priority-based selection.
|
|
285
314
|
- If no `<id>` provided: use priority-based selection (and optionally an epic filter in future).
|
|
315
|
+
- Does not select `goal` nodes; use `mdkg goal select <goal-id>` plus `mdkg goal next`, or explicit `mdkg goal next <goal-id>`, for goal-scoped selection.
|
|
286
316
|
|
|
287
317
|
### Checkpoints
|
|
288
318
|
- `mdkg checkpoint new "<title>" [--ws <alias>] [--relates <id,...>] [--scope <id,...>]`
|
|
@@ -303,13 +333,16 @@ Common flags:
|
|
|
303
333
|
- `TASK_STARTED`
|
|
304
334
|
- `TASK_UPDATED`
|
|
305
335
|
- `TASK_DONE`
|
|
336
|
+
- `GOAL_PAUSE`
|
|
337
|
+
- `GOAL_RESUME`
|
|
338
|
+
- `GOAL_DONE`
|
|
306
339
|
|
|
307
340
|
### Validation and formatting
|
|
308
341
|
- `mdkg validate`
|
|
309
342
|
- strict frontmatter + graph integrity checks (exit code 2 on failure)
|
|
310
343
|
- validates optional node->skill references
|
|
311
|
-
- validates configured
|
|
312
|
-
- warns, but does not fail, on stale
|
|
344
|
+
- validates configured subgraphs and fails on missing/corrupt enabled bundles, malformed subgraph config, duplicate projected ids, and invalid subgraph refs
|
|
345
|
+
- warns, but does not fail, on stale subgraphs
|
|
313
346
|
- validates optional `.mdkg/work/events/events.jsonl` record shape when file exists
|
|
314
347
|
- warns when `.agents/skills/` or `.claude/skills/` drift from canonical `.mdkg/skills/`
|
|
315
348
|
- `mdkg format`
|
|
@@ -23,6 +23,7 @@ mdkg content may contain sensitive notes and internal project planning. This rul
|
|
|
23
23
|
- `.mdkg/` must not be published to npm.
|
|
24
24
|
- Generated JSON index, temp, lock, WAL, SHM, and journal files under `.mdkg/index/` must not be committed.
|
|
25
25
|
- `.mdkg/index/mdkg.sqlite` is a rebuildable access cache and may be committed when the repo intentionally tracks it and it stays reasonably small.
|
|
26
|
+
- `.mdkg/state/` stores local workflow convenience state and must not be committed.
|
|
26
27
|
- `.mdkg/bundles/` may be committed only when the repo intentionally tracks private or public snapshot bundles.
|
|
27
28
|
|
|
28
29
|
## Git ignore requirements
|
|
@@ -37,6 +38,7 @@ The repo MUST ignore at minimum:
|
|
|
37
38
|
- `.mdkg/index/*.sqlite-wal`
|
|
38
39
|
- `.mdkg/index/*.sqlite-shm`
|
|
39
40
|
- `.mdkg/index/*.sqlite-journal`
|
|
41
|
+
- `.mdkg/state/`
|
|
40
42
|
- `.mdkg/pack/`
|
|
41
43
|
- `.mdkg/archive/**/source/`
|
|
42
44
|
|
|
@@ -47,6 +49,7 @@ Recommended `.gitignore` entries:
|
|
|
47
49
|
- `.mdkg/index/*.sqlite-wal`
|
|
48
50
|
- `.mdkg/index/*.sqlite-shm`
|
|
49
51
|
- `.mdkg/index/*.sqlite-journal`
|
|
52
|
+
- `.mdkg/state/`
|
|
50
53
|
- `.mdkg/pack/`
|
|
51
54
|
- `.mdkg/archive/**/source/`
|
|
52
55
|
|
|
@@ -87,7 +90,7 @@ For application builds:
|
|
|
87
90
|
|
|
88
91
|
`mdkg init` updates ignore files by default for safety:
|
|
89
92
|
|
|
90
|
-
- `.gitignore` appends generated index cache/temp/lock patterns, `.mdkg/pack/`, and raw archive source ignores.
|
|
93
|
+
- `.gitignore` appends generated index cache/temp/lock patterns, `.mdkg/state/`, `.mdkg/pack/`, and raw archive source ignores.
|
|
91
94
|
- `.npmignore` appends `.mdkg/`, generated index cache/temp/lock patterns, and `.mdkg/pack/`.
|
|
92
95
|
- `--no-update-ignores` disables these default writes
|
|
93
96
|
|
|
@@ -102,13 +105,14 @@ Explicit flags remain available and take precedence:
|
|
|
102
105
|
- `.mdkg/index/` contains generated caches.
|
|
103
106
|
- JSON index files may contain extracted metadata and could expose sensitive strings; they MUST be ignored from git.
|
|
104
107
|
- `.mdkg/index/mdkg.sqlite` contains the same rebuildable access data and may be committed only by explicit repo policy; `mdkg doctor` warns when it exceeds `index.sqlite_commit_warning_bytes`.
|
|
108
|
+
- `.mdkg/state/` contains local workflow convenience state such as selected goals and MUST stay ignored.
|
|
105
109
|
- Index rebuild should be deterministic and safe to regenerate at any time.
|
|
106
110
|
|
|
107
111
|
## Bundle safety
|
|
108
112
|
|
|
109
113
|
- `.mdkg/bundles/` stores explicit snapshot artifacts and is not ignored by default.
|
|
110
114
|
- Private bundles may include sensitive authored mdkg content and should stay in private repos.
|
|
111
|
-
- Public bundles must be created with `mdkg bundle create --profile public` so private graph, archive, and
|
|
115
|
+
- Public bundles must be created with `mdkg bundle create --profile public` so private graph, archive, and subgraph refs fail closed.
|
|
112
116
|
- Public-safe packs must be created with `mdkg pack <id> --visibility public`; internal-safe packs use `--visibility internal`. These filters do not redact Markdown body text.
|
|
113
117
|
- Bundle ZIPs must exclude `.mdkg/pack/`, existing `.mdkg/index/`, nested `.mdkg/bundles/`, and raw `.mdkg/archive/**/source/` files.
|
|
114
118
|
- Repos that track archive caches or bundles should refresh in this order before commit: `mdkg archive compress --all`, `mdkg archive verify --json`, `mdkg bundle create --profile private`, then bundle verify.
|
|
@@ -131,6 +135,7 @@ Workspace-local `.mdkg/` directories (near code) should follow the same rules:
|
|
|
131
135
|
## Summary checklist
|
|
132
136
|
|
|
133
137
|
- ✅ generated JSON index/temp/lock files ignored
|
|
138
|
+
- ✅ local `.mdkg/state/` ignored
|
|
134
139
|
- ✅ `.mdkg/index/mdkg.sqlite` committed only by explicit repo policy
|
|
135
140
|
- ✅ event logs are committed by default unless a repo chooses to ignore them manually
|
|
136
141
|
- ✅ npm publishes only `dist/`, `README.md`, `LICENSE`
|
|
@@ -91,12 +91,21 @@ All nodes MAY include the following searchable frontmatter lists:
|
|
|
91
91
|
List fields SHOULD be written as `[]` when empty.
|
|
92
92
|
Optional scalar graph fields (like `epic`, `parent`, `prev`, `next`) should be omitted when empty.
|
|
93
93
|
|
|
94
|
-
Work items (`epic/feat/task/bug/checkpoint/test`):
|
|
94
|
+
Work items (`goal/epic/feat/task/bug/checkpoint/test`):
|
|
95
95
|
- `status` (enum)
|
|
96
96
|
- optional `priority` (0..9)
|
|
97
97
|
- optional `skills: [slug, ...]` (kebab-case skill slugs)
|
|
98
98
|
- optional graph edges: `epic`, `parent`, `relates`, `blocked_by`, `blocks`, `prev`, `next`
|
|
99
99
|
|
|
100
|
+
Goal nodes (`goal-*`):
|
|
101
|
+
- required `goal_state`: `active`, `paused`, `achieved`, `blocked`, or `budget_limited`
|
|
102
|
+
- required `goal_condition` up to 4000 characters for external slash-command compatibility
|
|
103
|
+
- optional `scope_refs: [id-or-qid, ...]` naming explicit goal ownership roots; allowed targets are `epic`, `feat`, `task`, `bug`, and `test`
|
|
104
|
+
- optional `active_node`
|
|
105
|
+
- optional `required_skills: [slug, ...]`
|
|
106
|
+
- optional `required_checks: [command, ...]` as report-only guidance; mdkg does not execute these scripts
|
|
107
|
+
- optional positive integer strings `max_iterations` and `blocked_after_attempts`
|
|
108
|
+
|
|
100
109
|
Decision records (`dec-*`):
|
|
101
110
|
- `status` (enum: `proposed`, `accepted`, `rejected`, `superseded`)
|
|
102
111
|
- optional `supersedes: dec-#`
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema_version": 1,
|
|
3
3
|
"tool": "mdkg",
|
|
4
|
-
"mdkg_version": "0.1.
|
|
4
|
+
"mdkg_version": "0.1.5",
|
|
5
5
|
"files": [
|
|
6
6
|
{
|
|
7
7
|
"path": ".mdkg/config.json",
|
|
8
8
|
"category": "config",
|
|
9
|
-
"sha256": "
|
|
9
|
+
"sha256": "5d2cf5e773353a59178fe86f8528413a00a73e2879fb1e020d01b49c0715a9ce"
|
|
10
10
|
},
|
|
11
11
|
{
|
|
12
12
|
"path": ".mdkg/core/core.md",
|
|
@@ -36,12 +36,12 @@
|
|
|
36
36
|
{
|
|
37
37
|
"path": ".mdkg/core/rule-3-cli-contract.md",
|
|
38
38
|
"category": "core",
|
|
39
|
-
"sha256": "
|
|
39
|
+
"sha256": "0b72a2448cc91779278fed6e011c3936c31c5b11a7365a4145941dcc90f805a3"
|
|
40
40
|
},
|
|
41
41
|
{
|
|
42
42
|
"path": ".mdkg/core/rule-4-repo-safety-and-ignores.md",
|
|
43
43
|
"category": "core",
|
|
44
|
-
"sha256": "
|
|
44
|
+
"sha256": "d8aff39af7a00e63db51831d4324856bbf49d3e3434141416903bad42c7d5380"
|
|
45
45
|
},
|
|
46
46
|
{
|
|
47
47
|
"path": ".mdkg/core/rule-5-release-and-versioning.md",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
{
|
|
52
52
|
"path": ".mdkg/core/rule-6-templates-and-schemas.md",
|
|
53
53
|
"category": "core",
|
|
54
|
-
"sha256": "
|
|
54
|
+
"sha256": "3ae20e1a925154ddc69bfc79495b169500aa5158db2134336890b00e64750c2f"
|
|
55
55
|
},
|
|
56
56
|
{
|
|
57
57
|
"path": ".mdkg/core/SOUL.md",
|
|
@@ -61,22 +61,27 @@
|
|
|
61
61
|
{
|
|
62
62
|
"path": ".mdkg/README.md",
|
|
63
63
|
"category": "mdkg_doc",
|
|
64
|
-
"sha256": "
|
|
64
|
+
"sha256": "f733792daa2b0f3318fd7b39fa2f812c61b8a3f5f630dba2f271cdcb10af9927"
|
|
65
65
|
},
|
|
66
66
|
{
|
|
67
67
|
"path": ".mdkg/skills/build-pack-and-execute-task/SKILL.md",
|
|
68
68
|
"category": "default_skill",
|
|
69
69
|
"sha256": "3e240cb844b22e5e4c0046a4f839ac3c0d771a62d00a72719fc449477564b1ae"
|
|
70
70
|
},
|
|
71
|
+
{
|
|
72
|
+
"path": ".mdkg/skills/pursue-mdkg-goal/SKILL.md",
|
|
73
|
+
"category": "default_skill",
|
|
74
|
+
"sha256": "fd64f666fb1329c392ff0979ed9999b71ad948cbca6a191502eb2cdfd76ec825"
|
|
75
|
+
},
|
|
71
76
|
{
|
|
72
77
|
"path": ".mdkg/skills/select-work-and-ground-context/SKILL.md",
|
|
73
78
|
"category": "default_skill",
|
|
74
|
-
"sha256": "
|
|
79
|
+
"sha256": "e50fc3b1a2c79a9a3544ca9df1bf4ca9c312e7c3a51d5e4c6f3314341eca268b"
|
|
75
80
|
},
|
|
76
81
|
{
|
|
77
82
|
"path": ".mdkg/skills/verify-close-and-checkpoint/SKILL.md",
|
|
78
83
|
"category": "default_skill",
|
|
79
|
-
"sha256": "
|
|
84
|
+
"sha256": "f85ffa4a139db10c3bc3203cde0e4f41603fbc7f3925e6fdaba821346ffa28b8"
|
|
80
85
|
},
|
|
81
86
|
{
|
|
82
87
|
"path": ".mdkg/templates/default/archive.md",
|
|
@@ -123,6 +128,11 @@
|
|
|
123
128
|
"category": "template",
|
|
124
129
|
"sha256": "61ad7b8b717d17736ba505f814fa6e4f9ec61f7fe4ae6622359304620a99d649"
|
|
125
130
|
},
|
|
131
|
+
{
|
|
132
|
+
"path": ".mdkg/templates/default/goal.md",
|
|
133
|
+
"category": "template",
|
|
134
|
+
"sha256": "710252d8a2dc35be71661d6988007af127052fa8ad24b1fb00374c975ae117a2"
|
|
135
|
+
},
|
|
126
136
|
{
|
|
127
137
|
"path": ".mdkg/templates/default/prd.md",
|
|
128
138
|
"category": "template",
|
|
@@ -176,7 +186,7 @@
|
|
|
176
186
|
{
|
|
177
187
|
"path": "AGENT_START.md",
|
|
178
188
|
"category": "startup_doc",
|
|
179
|
-
"sha256": "
|
|
189
|
+
"sha256": "bb8654d11adb2ed6cb45f3514bbf7fad8fe6cda8a2e0e1676462542563df0df9"
|
|
180
190
|
},
|
|
181
191
|
{
|
|
182
192
|
"path": "AGENTS.md",
|
|
@@ -191,7 +201,7 @@
|
|
|
191
201
|
{
|
|
192
202
|
"path": "CLI_COMMAND_MATRIX.md",
|
|
193
203
|
"category": "startup_doc",
|
|
194
|
-
"sha256": "
|
|
204
|
+
"sha256": "a2f59afae403fff7335b0cf0109ee550c7a864b9ef6744b39a645096432e5206"
|
|
195
205
|
},
|
|
196
206
|
{
|
|
197
207
|
"path": "llms.txt",
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pursue-mdkg-goal
|
|
3
|
+
description: Pursue a selected mdkg goal by repeatedly selecting one scoped work item, executing it with evidence, and evaluating the goal until done, blocked, paused, or budget-limited.
|
|
4
|
+
tags: [stage:execute, writer:orchestrator, mdkg, goal, recursive]
|
|
5
|
+
version: 0.1.0
|
|
6
|
+
authors: [mdkg]
|
|
7
|
+
links: [AGENT_START.md, CLI_COMMAND_MATRIX.md, .mdkg/design/prd-3-mdkg-goal-node-ux-and-agent-harness-contract.md, .mdkg/design/edd-10-mdkg-goal-node-architecture-and-recursive-agent-loop.md]
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Goal
|
|
11
|
+
|
|
12
|
+
Move one durable mdkg goal forward without losing scope, evidence, or user intent.
|
|
13
|
+
|
|
14
|
+
## When To Use
|
|
15
|
+
|
|
16
|
+
- A user has selected or named an mdkg goal.
|
|
17
|
+
- A long-running objective needs one concrete next work item at a time.
|
|
18
|
+
- Goal progress should improve the graph while keeping skill changes controlled.
|
|
19
|
+
|
|
20
|
+
## Inputs
|
|
21
|
+
|
|
22
|
+
- Optional goal id or qid.
|
|
23
|
+
- Current selected goal state from `mdkg goal current`.
|
|
24
|
+
- The goal node, scoped work nodes, required skills, and required checks.
|
|
25
|
+
- User constraints, budget, and stop conditions.
|
|
26
|
+
|
|
27
|
+
## Steps
|
|
28
|
+
|
|
29
|
+
1. Resolve the goal:
|
|
30
|
+
- If a goal id is provided, run `mdkg goal select <goal-id>`.
|
|
31
|
+
- Otherwise run `mdkg goal current`.
|
|
32
|
+
- If the result is missing or ambiguous, ask the user to select a goal.
|
|
33
|
+
2. Inspect the goal with `mdkg goal show <goal-id>` and build context with `mdkg pack <goal-id>`.
|
|
34
|
+
3. Run `mdkg goal next` to surface exactly one scoped feature, task, bug, or test.
|
|
35
|
+
4. If `goal next` returns no node, evaluate the goal with `mdkg goal evaluate <goal-id>` and report whether completion, blocker, or new-node creation is needed.
|
|
36
|
+
5. Before coding, run `mdkg goal claim <work-id>` to set `active_node` when the surfaced node is accepted.
|
|
37
|
+
6. Work only the claimed node to completion. Do not expand into unrelated urgent work.
|
|
38
|
+
7. Run the required technical checks yourself. mdkg goal required checks are report-only; mdkg does not execute them.
|
|
39
|
+
8. Record evidence on the active work node, then evaluate the goal with `mdkg goal evaluate <goal-id>`.
|
|
40
|
+
9. Repeat steps 3-8 until the goal condition is achieved, blocked, paused, budget-limited, or the user stops the run.
|
|
41
|
+
|
|
42
|
+
## Skill Improvement Candidates
|
|
43
|
+
|
|
44
|
+
- During normal goal execution, record skill improvement ideas in the goal body or a proposal node.
|
|
45
|
+
- Edit `SKILL.md` files only when the active node is explicitly skill-maintenance work.
|
|
46
|
+
- After intentional skill edits, run `mdkg skill sync`, `mdkg skill validate`, `mdkg index`, and `mdkg validate`.
|
|
47
|
+
|
|
48
|
+
## Outputs
|
|
49
|
+
|
|
50
|
+
- One active scoped work item at a time.
|
|
51
|
+
- Evidence recorded on the active node and summarized on the goal when useful.
|
|
52
|
+
- Required checks reported with pass/fail status.
|
|
53
|
+
- A clear stop reason: continue, achieved, blocked, paused, or budget-limited.
|
|
54
|
+
|
|
55
|
+
## Safety
|
|
56
|
+
|
|
57
|
+
- `mdkg goal next` is read-only; do not treat it as a claim.
|
|
58
|
+
- `mdkg goal claim` is the durable `active_node` mutation.
|
|
59
|
+
- Do not mutate subgraph/imported qids; update the owning source workspace.
|
|
60
|
+
- Do not create missing nodes without evidence that the current goal scope needs them.
|
|
61
|
+
- Do not edit skills opportunistically while pursuing product or code work.
|
|
62
|
+
|
|
63
|
+
## Failure Handling
|
|
64
|
+
|
|
65
|
+
- If selection is ambiguous, ask for a goal instead of guessing.
|
|
66
|
+
- If scoped work is missing, create a proposal or task only after explaining the gap.
|
|
67
|
+
- If checks fail, keep the active node open and record the failure evidence.
|
|
68
|
+
- If repeated attempts hit the same blocker, mark the goal blocked or ask for direction.
|
|
@@ -26,13 +26,15 @@ Choose the correct work item and load the smallest deterministic context needed
|
|
|
26
26
|
## Steps
|
|
27
27
|
|
|
28
28
|
1. If a task id is already known, inspect it with `mdkg show <id>`.
|
|
29
|
-
2. If
|
|
30
|
-
3.
|
|
31
|
-
4.
|
|
32
|
-
5.
|
|
33
|
-
6.
|
|
34
|
-
7. If
|
|
35
|
-
8.
|
|
29
|
+
2. If a goal may be active, run `mdkg goal current`.
|
|
30
|
+
3. If a selected or unique active goal exists, use `mdkg goal next` to surface one scoped feature, task, bug, or test before falling back to global work discovery.
|
|
31
|
+
4. If the task is not known and no goal is active, read `AGENT_START.md` and use `mdkg next` or `mdkg search "<query>"` to narrow candidates.
|
|
32
|
+
5. Use `mdkg show <id> --meta` when you only need the card and link metadata.
|
|
33
|
+
6. Confirm the selected node has the right constraints, related design docs, and current status.
|
|
34
|
+
7. If the task is ambiguous, resolve that before building a pack.
|
|
35
|
+
8. If the chosen task is ready to be claimed in a goal, hand off to `mdkg goal claim <id>` in the writer stage; otherwise hand off to `mdkg task start <id>` for task-like status changes.
|
|
36
|
+
9. If resuming closeout work for a feat or epic, inspect the latest relevant checkpoint before deciding what remains open.
|
|
37
|
+
10. Treat this stage as read-only: inspect and decide, but do not mutate mdkg state or commit.
|
|
36
38
|
|
|
37
39
|
## Outputs
|
|
38
40
|
|
|
@@ -30,15 +30,16 @@ Finish work with evidence, validation, and minimal memory drift.
|
|
|
30
30
|
2. Run `mdkg validate` before closing the task.
|
|
31
31
|
3. For mdkg scaffold or release work, include `mdkg upgrade` dry-run/apply evidence and any package smoke that exercises upgrade behavior.
|
|
32
32
|
4. Use `mdkg task update <id> ...` for additive evidence and structured metadata changes; keep narrative/body edits in markdown.
|
|
33
|
-
5.
|
|
34
|
-
6.
|
|
35
|
-
7.
|
|
36
|
-
8.
|
|
37
|
-
9.
|
|
38
|
-
10.
|
|
39
|
-
11.
|
|
40
|
-
12.
|
|
41
|
-
13. If
|
|
33
|
+
5. When pursuing a goal, record evidence on the active node and summarize goal evidence before running `mdkg goal evaluate <goal-id>`.
|
|
34
|
+
6. Use `mdkg task done <id> --checkpoint "<title>"` when the task should close with milestone compression.
|
|
35
|
+
7. Batch durable mdkg writes at one boundary: task status, artifact refs, optional checkpoint, goal evidence, and commit.
|
|
36
|
+
8. Mark tasks done only after evidence exists.
|
|
37
|
+
9. Create a checkpoint only for milestone-level transitions, not every small step.
|
|
38
|
+
10. For feat or epic closeout, prefer a checkpoint body as the durable narrative summary of what changed and what is next.
|
|
39
|
+
11. Use feat closeout scope as direct children with `parent: <feat-id>` and epic closeout scope as descendant work with `epic: <epic-id>`.
|
|
40
|
+
12. Parent status edits remain manual; do not invent a hidden parent-closeout workflow.
|
|
41
|
+
13. If the latest checkpoint is relevant, use it as durable recall; treat raw events as provenance/debugging, not primary execution context.
|
|
42
|
+
14. If `events.jsonl` is missing, recreate it with `mdkg event enable` before expecting automatic JSONL provenance.
|
|
42
43
|
|
|
43
44
|
## Pre-Publish Release Gate
|
|
44
45
|
|
|
@@ -46,7 +47,7 @@ Use this local repo-only checklist before publishing mdkg:
|
|
|
46
47
|
|
|
47
48
|
1. Confirm package intent and version in `package.json`, `package-lock.json`, `README.md`, `CLI_COMMAND_MATRIX.md`, and `CHANGELOG.md`.
|
|
48
49
|
2. Use a clean npm cache: `export NPM_CONFIG_CACHE=/private/tmp/mdkg-npm-cache`.
|
|
49
|
-
3. Run `npm ci`, `npm run build`, `node scripts/assert-publish-ready.js`, `npm run test`, `npm run cli:check`, `node dist/cli.js validate`, `npm run smoke:consumer`, `npm run smoke:matrix`, `npm run smoke:upgrade`, `npm run smoke:init`, `npm run smoke:capabilities`, `npm run smoke:archive-work`, `npm run smoke:bundle`, `npm run smoke:
|
|
50
|
+
3. Run `npm ci`, `npm run build`, `node scripts/assert-publish-ready.js`, `npm run test`, `npm run cli:check`, `node dist/cli.js validate`, `npm run smoke:consumer`, `npm run smoke:matrix`, `npm run smoke:upgrade`, `npm run smoke:init`, `npm run smoke:capabilities`, `npm run smoke:archive-work`, `npm run smoke:bundle`, `npm run smoke:subgraph`, and `npm run smoke:visibility`.
|
|
50
51
|
4. Run `npm pack --dry-run --json` and confirm the tarball includes `dist/cli.js`, compiled folders, `dist/init/`, release docs, and `scripts/postinstall.js`.
|
|
51
52
|
5. Confirm registry state with `npm view mdkg version --registry=https://registry.npmjs.org/`.
|
|
52
53
|
6. Publish only after the registry still shows the previous version and npm auth is known to have write access.
|