mdkg 0.3.2 → 0.3.4
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 +74 -0
- package/CLI_COMMAND_MATRIX.md +28 -11
- package/README.md +10 -6
- package/dist/cli.js +87 -10
- package/dist/command-contract.json +406 -11
- package/dist/commands/fix.js +468 -16
- package/dist/commands/goal.js +148 -12
- package/dist/commands/new.js +4 -3
- package/dist/graph/node.js +4 -3
- package/dist/graph/validate_graph.js +21 -0
- package/dist/init/AGENT_START.md +2 -2
- package/dist/init/CLI_COMMAND_MATRIX.md +15 -4
- package/dist/init/README.md +8 -3
- package/dist/init/init-manifest.json +5 -5
- package/dist/init/skills/default/pursue-mdkg-goal/SKILL.md +2 -1
- package/package.json +4 -2
package/CHANGELOG.md
CHANGED
|
@@ -12,6 +12,80 @@ mdkg is pre-v1 public alpha software. Command, graph, cache, bundle, and DAL con
|
|
|
12
12
|
|
|
13
13
|
- No changes yet.
|
|
14
14
|
|
|
15
|
+
## 0.3.4 - 2026-06-17
|
|
16
|
+
|
|
17
|
+
### Added
|
|
18
|
+
|
|
19
|
+
- Added IDs-family repair apply support with `mdkg fix apply --family ids`
|
|
20
|
+
and the focused `mdkg fix ids [--apply]` convenience command.
|
|
21
|
+
- Added `--base-ref` support for duplicate-ID repair planning so mainline IDs
|
|
22
|
+
can be preserved while incoming duplicate nodes receive the next unused
|
|
23
|
+
canonical numeric ID.
|
|
24
|
+
- Added unresolved Git add/add conflict-stage repair for mdkg Markdown files:
|
|
25
|
+
stage 2 remains at the conflicted path, stage 3 is rewritten to a new
|
|
26
|
+
canonical ID/path, and the Git index conflict stages are resolved with a
|
|
27
|
+
receipt.
|
|
28
|
+
- Added packed `smoke:id-repair` coverage that installs mdkg from a tarball in
|
|
29
|
+
a temp prefix, validates clean duplicate repair, base-ref link preservation,
|
|
30
|
+
unresolved Git conflict-stage repair, and final graph validation.
|
|
31
|
+
|
|
32
|
+
### Changed
|
|
33
|
+
|
|
34
|
+
- Updated `mdkg fix plan` receipts so duplicate-ID findings advertise
|
|
35
|
+
`apply_supported: true` with an explicit `apply_kind`, while index/cache and
|
|
36
|
+
graph-reference findings remain review-only.
|
|
37
|
+
- Updated command help, README, init assets, command matrix, generated command
|
|
38
|
+
contract metadata, and publish-readiness assertions to document the new
|
|
39
|
+
IDs-only apply boundary.
|
|
40
|
+
- Updated branch-conflict and fix-plan smokes to distinguish non-mutating plan
|
|
41
|
+
behavior from the newly apply-capable duplicate-ID repair family.
|
|
42
|
+
|
|
43
|
+
### Security
|
|
44
|
+
|
|
45
|
+
- `fix apply` refuses unsupported families, blocked plans, and non-IDs repair
|
|
46
|
+
findings instead of silently applying partial graph/reference/index repairs.
|
|
47
|
+
- Duplicate-ID apply writes Markdown atomically under the mdkg mutation lock,
|
|
48
|
+
rebuilds derived indexes, and emits receipt evidence with touched paths,
|
|
49
|
+
source plan hash, and ambiguous reference notes.
|
|
50
|
+
- Base-ref link rewriting is conservative: references in files absent from the
|
|
51
|
+
base ref can be rewritten to the repaired incoming ID, while base-existing
|
|
52
|
+
references remain on the mainline ID and ambiguous references are reported.
|
|
53
|
+
|
|
54
|
+
## 0.3.3 - 2026-06-16
|
|
55
|
+
|
|
56
|
+
### Added
|
|
57
|
+
|
|
58
|
+
- Added `mdkg goal activate <goal-id>` to make one local root goal active,
|
|
59
|
+
select it for goal routing, and pause competing active local root goals in the
|
|
60
|
+
same workspace.
|
|
61
|
+
- Added goal-only archived lifecycle support with `mdkg goal archive`, allowing
|
|
62
|
+
historical roadmap goals to remain readable through show/list/search while
|
|
63
|
+
being excluded from actionable current/next routing.
|
|
64
|
+
- Added parser and graph validation support for exactly one active local root
|
|
65
|
+
goal, while imported subgraph goals keep independent active-goal state in
|
|
66
|
+
their owning graphs.
|
|
67
|
+
- Added packed `smoke:goal-lifecycle` prepublish coverage for goal activation,
|
|
68
|
+
archived-goal routing, archived discovery filters, strict doctor behavior, and
|
|
69
|
+
imported subgraph active-goal independence.
|
|
70
|
+
|
|
71
|
+
### Changed
|
|
72
|
+
|
|
73
|
+
- Updated README, init assets, agent startup guidance, command matrix, help
|
|
74
|
+
surfaces, generated command contract metadata, and publish-readiness assertions
|
|
75
|
+
to prefer `goal activate` for active goal selection.
|
|
76
|
+
- Archived superseded local roadmap goals `goal-11`, `goal-12`, and `goal-15`
|
|
77
|
+
in this repository after replacement versioned goals were created.
|
|
78
|
+
- Tightened the 0.3.3 graph hygiene path so the remaining release-candidate
|
|
79
|
+
sequence is smoke coverage followed by dry-run prepublish closeout.
|
|
80
|
+
|
|
81
|
+
### Security
|
|
82
|
+
|
|
83
|
+
- Archived goals are non-actionable historical context: they cannot be selected,
|
|
84
|
+
activated, claimed, resumed, or paused through the goal lifecycle surface.
|
|
85
|
+
- `goal activate` keeps single-writer planning safer by pausing competing local
|
|
86
|
+
root goals instead of allowing multiple active local root goals to remain
|
|
87
|
+
silently actionable.
|
|
88
|
+
|
|
15
89
|
## 0.3.2 - 2026-06-16
|
|
16
90
|
|
|
17
91
|
### Added
|
package/CLI_COMMAND_MATRIX.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# CLI Command Matrix
|
|
2
2
|
|
|
3
3
|
as_of: 2026-06-06
|
|
4
|
-
package_version_in_source: 0.3.
|
|
4
|
+
package_version_in_source: 0.3.4
|
|
5
5
|
source: live help from `src/cli.ts`, runtime command handlers, and `dec-15`..`dec-18`
|
|
6
6
|
status: canonical single-source command and flag reference for mdkg
|
|
7
7
|
|
|
@@ -61,7 +61,7 @@ Recursive long-running objective contracts are accessed through `mdkg goal ...`.
|
|
|
61
61
|
Fresh init workspaces default to the SQLite access cache backend; existing migrated configs stay on JSON until opted in.
|
|
62
62
|
Project application database foundation commands are accessed through `mdkg db ...`; `mdkg index` remains the compatibility shortcut for graph index rebuilds.
|
|
63
63
|
Operator health summaries are accessed through read-only `mdkg status ...`; deeper diagnostics remain under `mdkg doctor ...`.
|
|
64
|
-
Repair planning is accessed through read-only `mdkg fix plan ...`; apply
|
|
64
|
+
Repair planning is accessed through read-only `mdkg fix plan ...`; duplicate-ID graph repairs can be applied through `mdkg fix apply --family ids ...` or the convenience `mdkg fix ids --apply ...`. Index/cache and graph-reference findings remain plan/manual-review only.
|
|
65
65
|
|
|
66
66
|
## Global usage
|
|
67
67
|
|
|
@@ -735,14 +735,16 @@ When to use:
|
|
|
735
735
|
Usage:
|
|
736
736
|
- `mdkg goal show <goal-id-or-qid> [--json]`
|
|
737
737
|
- `mdkg goal select <goal-id-or-qid> [--json]`
|
|
738
|
+
- `mdkg goal activate <goal-id-or-qid> [--json]`
|
|
738
739
|
- `mdkg goal current [--json]`
|
|
739
740
|
- `mdkg goal clear [--json]`
|
|
740
741
|
- `mdkg goal next [goal-id-or-qid] [--json]`
|
|
741
742
|
- `mdkg goal claim [goal-id-or-qid] <work-id-or-qid> [--json]`
|
|
742
743
|
- `mdkg goal evaluate <goal-id-or-qid> [--json]`
|
|
743
|
-
- `mdkg goal pause|resume|done <goal-id-or-qid> [--json]`
|
|
744
|
+
- `mdkg goal pause|resume|done|archive <goal-id-or-qid> [--json]`
|
|
744
745
|
- `mdkg goal show <goal-id-or-qid> [--ws <alias>] [--json]`
|
|
745
746
|
- `mdkg goal select <goal-id-or-qid> [--ws <alias>] [--json]`
|
|
747
|
+
- `mdkg goal activate <goal-id-or-qid> [--ws <alias>] [--json]`
|
|
746
748
|
- `mdkg goal current [--ws <alias>] [--json]`
|
|
747
749
|
- `mdkg goal next [goal-id-or-qid] [--ws <alias>] [--json]`
|
|
748
750
|
- `mdkg goal claim <work-id-or-qid> [--ws <alias>] [--json]`
|
|
@@ -751,27 +753,31 @@ Usage:
|
|
|
751
753
|
- `mdkg goal pause <goal-id-or-qid> [--ws <alias>] [--json]`
|
|
752
754
|
- `mdkg goal resume <goal-id-or-qid> [--ws <alias>] [--json]`
|
|
753
755
|
- `mdkg goal done <goal-id-or-qid> [--ws <alias>] [--json]`
|
|
756
|
+
- `mdkg goal archive <goal-id-or-qid> [--ws <alias>] [--json]`
|
|
754
757
|
|
|
755
758
|
Behavior:
|
|
756
759
|
- `goal show` reports goal condition, goal state, scope refs, active node, required skills, required checks, and source path.
|
|
757
760
|
- `goal select` writes local ignored selected-goal state so `goal next` can omit the goal id.
|
|
761
|
+
- `goal activate` makes one local root goal active, pauses competing local active goals in the same workspace, and writes selected-goal state.
|
|
758
762
|
- `goal current` shows the selected goal or unique active goal fallback.
|
|
759
763
|
- `goal clear` removes local selected-goal state.
|
|
760
764
|
- `goal next` is read-only and selects feature, task, bug, test, or spike work inside explicit `scope_refs`; epics are recursive containers, not executable returns.
|
|
761
765
|
- `goal claim` mutates only `active_node` after the work item is confirmed inside the goal scope.
|
|
762
766
|
- `goal evaluate` is report-only and never runs commands from `required_checks`.
|
|
763
767
|
- `goal pause`, `goal resume`, and `goal done` update `goal_state`, compatible work status, and `updated`.
|
|
768
|
+
- `goal archive` marks a superseded historical goal as `status: archived` and `goal_state: archived`; archived goals remain show/search/list readable but are excluded from active routing.
|
|
764
769
|
- subgraph goal qids are read-only; update the source workspace instead.
|
|
765
770
|
|
|
766
771
|
JSON receipts:
|
|
767
772
|
- `show`: `{ action: "showed", goal }`
|
|
768
773
|
- `select`: `{ action: "selected_goal", goal, selection }`
|
|
774
|
+
- `activate`: `{ action: "activated", goal, activated_goal, paused_goals, selection, warnings }`
|
|
769
775
|
- `current`: `{ action: "current", goal, source, warnings }`
|
|
770
776
|
- `clear`: `{ action: "cleared_goal", path, cleared }`
|
|
771
777
|
- `next`: `{ action: "selected", goal, goal_source, node, warnings }`
|
|
772
778
|
- `claim`: `{ action: "claimed", goal, node }`
|
|
773
779
|
- `evaluate`: `{ action: "evaluated", goal, report_only, runs_scripts, checks, completion_evidence_present }`
|
|
774
|
-
- `pause|resume|done`: `{ action, goal }`
|
|
780
|
+
- `pause|resume|done|archive`: `{ action, goal }`
|
|
775
781
|
|
|
776
782
|
### `mdkg task`
|
|
777
783
|
|
|
@@ -1043,27 +1049,38 @@ JSON receipt shape:
|
|
|
1043
1049
|
### `mdkg fix`
|
|
1044
1050
|
|
|
1045
1051
|
When to use:
|
|
1046
|
-
- plan reviewable graph/index repairs before
|
|
1052
|
+
- plan reviewable graph/index repairs before applying supported duplicate-ID rewrites
|
|
1047
1053
|
- get a receipt-shaped JSON plan for automation and agent review
|
|
1054
|
+
- repair branch-merge duplicate IDs while preserving main/base IDs where possible
|
|
1048
1055
|
|
|
1049
1056
|
Usage:
|
|
1050
|
-
- `mdkg fix plan [--family index|refs|ids|all] [--target <id-or-qid>] [--json]`
|
|
1057
|
+
- `mdkg fix plan [--family index|refs|ids|all] [--target <id-or-qid>] [--base-ref <ref>] [--json]`
|
|
1058
|
+
- `mdkg fix apply [--family ids] [--target <id-or-qid>] [--base-ref <ref>] [--json]`
|
|
1059
|
+
- `mdkg fix ids [--target <id-or-qid>] [--base-ref <ref>] [--apply] [--json]`
|
|
1051
1060
|
|
|
1052
1061
|
Flags:
|
|
1053
1062
|
- `--family <family>`
|
|
1054
1063
|
- `--target <id-or-qid>`
|
|
1064
|
+
- `--base-ref <ref>`
|
|
1065
|
+
- `--apply`
|
|
1055
1066
|
- `--json`
|
|
1056
1067
|
|
|
1057
1068
|
Boundaries:
|
|
1058
|
-
- dry-run only and writes nothing
|
|
1059
|
-
-
|
|
1060
|
-
- `fix apply` is
|
|
1069
|
+
- `fix plan` is dry-run only and writes nothing
|
|
1070
|
+
- `fix apply` currently supports only IDs-family duplicate-ID graph rewrites
|
|
1071
|
+
- `fix ids` without `--apply` is equivalent to `fix plan --family ids`
|
|
1072
|
+
- `fix ids --apply` is equivalent to `fix apply --family ids`
|
|
1073
|
+
- apply rewrites graph Markdown atomically, rebuilds derived indexes, and emits a receipt
|
|
1074
|
+
- unresolved Git add/add conflict stages are handled by keeping stage 2 at the conflicted path and writing stage 3 to a new canonical ID/path
|
|
1075
|
+
- graph-reference and index/cache findings remain review-only guidance
|
|
1061
1076
|
- initial families are index/cache, graph refs, and duplicate ids
|
|
1062
1077
|
|
|
1063
1078
|
JSON receipt:
|
|
1064
1079
|
- `{ action: "fix.plan", ok, schema_version, plan_id, plan_hash, generated_at, root, family, target, dirty, families, risk_counts, proposed_changes, blocked_changes, summary }`
|
|
1065
|
-
- each proposed change includes family, risk, status, reason, paths, refs, optional before/after values, command hint, and `apply_supported
|
|
1066
|
-
-
|
|
1080
|
+
- each proposed change includes family, risk, status, reason, paths, refs, optional before/after values, command hint, and `apply_supported`
|
|
1081
|
+
- duplicate-ID changes include candidate ID/path details and `apply_kind`
|
|
1082
|
+
- `{ action: "fix.apply", ok, schema_version, receipt_hash, root, family, target, base_ref, plan_id, plan_hash, applied_changes, touched_paths, ambiguous_reference_rewrites, index, summary }`
|
|
1083
|
+
- `summary.apply_deferred` remains true when the selected plan includes index/cache, graph-ref, blocked, or otherwise unsupported findings
|
|
1067
1084
|
|
|
1068
1085
|
### `mdkg doctor`
|
|
1069
1086
|
|
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@ mdkg stays deliberately boring:
|
|
|
14
14
|
- first-class rebuildable SQLite cache through built-in `node:sqlite`
|
|
15
15
|
- no daemon, hosted index, or vector DB
|
|
16
16
|
|
|
17
|
-
Current package version in source: `0.3.
|
|
17
|
+
Current package version in source: `0.3.4`
|
|
18
18
|
|
|
19
19
|
mdkg is still pre-v1 public alpha software. The public package is usable, but graph, cache, bundle, and DAL contracts may continue to change quickly while the project converges on a stable v1 surface.
|
|
20
20
|
|
|
@@ -341,9 +341,13 @@ warnings unless their underlying check fails.
|
|
|
341
341
|
Use `mdkg fix plan --json` when you want repair guidance without mutation. It
|
|
342
342
|
emits a receipt-shaped plan for generated index/cache repair, missing graph
|
|
343
343
|
references, and duplicate local ids. Planned changes include affected paths,
|
|
344
|
-
risk, reason codes, command hints, and `apply_supported
|
|
345
|
-
|
|
346
|
-
|
|
344
|
+
risk, reason codes, command hints, and per-change `apply_supported` metadata.
|
|
345
|
+
Duplicate-ID graph repairs can be applied with
|
|
346
|
+
`mdkg fix apply --family ids --json` or `mdkg fix ids --apply --json`; use
|
|
347
|
+
`--base-ref main` when mainline IDs should win. Index/cache and graph-reference
|
|
348
|
+
findings remain review-only. For unresolved Git add/add conflicts, `fix ids`
|
|
349
|
+
keeps stage 2 at the conflicted path, rewrites stage 3 to the next unused
|
|
350
|
+
canonical ID/path, and records a receipt.
|
|
347
351
|
|
|
348
352
|
## Skills
|
|
349
353
|
|
|
@@ -461,9 +465,9 @@ as sealed state.
|
|
|
461
465
|
|
|
462
466
|
Goal nodes are durable recursive objective contracts. Use `mdkg new goal "<objective>"` when a human or agent needs to keep working across multiple concrete nodes until a measurable end condition is achieved.
|
|
463
467
|
|
|
464
|
-
`goal` is work-like but distinct from `task`: it can have status, priority, graph links, skills, explicit `scope_refs`, and structured goal fields, but normal `mdkg next` does not select goals. Use `mdkg goal
|
|
468
|
+
`goal` is work-like but distinct from `task`: it can have status, priority, graph links, skills, explicit `scope_refs`, and structured goal fields, but normal `mdkg next` does not select goals. Use `mdkg goal activate <goal-id>` to make one local root goal active, pause competing local active goals, and select it for future `goal next` calls. Use `mdkg goal select <goal-id>` only when you want to change the local ignored selected-goal pointer without changing lifecycle state. `mdkg goal next <goal-id>` remains available for explicit selection. Epics organize goal scope recursively but are not returned as executable work.
|
|
465
469
|
|
|
466
|
-
Use `mdkg goal claim [goal-id] <work-id>` to durably set `active_node` after choosing the next scoped item. `goal next` is read-only. Use `mdkg goal pause|resume|done` to update goal state after review.
|
|
470
|
+
Use `mdkg goal claim [goal-id] <work-id>` to durably set `active_node` after choosing the next scoped item. `goal next` is read-only. Use `mdkg goal pause|resume|done` to update goal state after review, and `mdkg goal archive` for superseded historical roadmap goals that should remain readable but non-actionable.
|
|
467
471
|
|
|
468
472
|
Required checks are stored as report-only guidance. Agents should run the checks themselves, record evidence in the goal or active work item, then use `mdkg goal evaluate` to summarize the current evidence state. During normal goal execution, skill improvements should be recorded as improvement candidates or proposal nodes; edit `SKILL.md` files only when the active node is explicit skill-maintenance work.
|
|
469
473
|
|
package/dist/cli.js
CHANGED
|
@@ -752,6 +752,21 @@ function printGoalHelp(log, subcommand) {
|
|
|
752
752
|
log(" Store a local selected goal so `mdkg goal next` can omit the goal id.");
|
|
753
753
|
printGlobalOptions(log);
|
|
754
754
|
return;
|
|
755
|
+
case "activate":
|
|
756
|
+
log("Usage:");
|
|
757
|
+
log(" mdkg goal activate <goal-id-or-qid> [--ws <alias>] [--json]");
|
|
758
|
+
log("\nWhen to use:");
|
|
759
|
+
log(" Make one local root goal active, pause competing local active goals, and select it for `goal next`.");
|
|
760
|
+
log(" Imported subgraph goals are read-only and are not mutated by activation.");
|
|
761
|
+
printGlobalOptions(log);
|
|
762
|
+
return;
|
|
763
|
+
case "archive":
|
|
764
|
+
log("Usage:");
|
|
765
|
+
log(" mdkg goal archive <goal-id-or-qid> [--ws <alias>] [--json]");
|
|
766
|
+
log("\nWhen to use:");
|
|
767
|
+
log(" Mark a superseded historical goal archived so it remains readable but is excluded from active routing.");
|
|
768
|
+
printGlobalOptions(log);
|
|
769
|
+
return;
|
|
755
770
|
case "current":
|
|
756
771
|
log("Usage:");
|
|
757
772
|
log(" mdkg goal current [--ws <alias>] [--json]");
|
|
@@ -794,15 +809,17 @@ function printGoalHelp(log, subcommand) {
|
|
|
794
809
|
log("Usage:");
|
|
795
810
|
log(" mdkg goal show <goal-id-or-qid> [--json]");
|
|
796
811
|
log(" mdkg goal select <goal-id-or-qid> [--json]");
|
|
812
|
+
log(" mdkg goal activate <goal-id-or-qid> [--json]");
|
|
797
813
|
log(" mdkg goal current [--json]");
|
|
798
814
|
log(" mdkg goal next [goal-id-or-qid] [--json]");
|
|
799
815
|
log(" mdkg goal claim [goal-id-or-qid] <work-id-or-qid> [--json]");
|
|
800
816
|
log(" mdkg goal evaluate <goal-id-or-qid> [--json]");
|
|
801
817
|
log(" mdkg goal clear [--json]");
|
|
802
|
-
log(" mdkg goal pause|resume|done <goal-id-or-qid> [--json]");
|
|
818
|
+
log(" mdkg goal pause|resume|done|archive <goal-id-or-qid> [--json]");
|
|
803
819
|
log("\nNotes:");
|
|
804
820
|
log(" - goals orchestrate recursive progress; features, tasks, bugs, tests, and spikes are iterable work units");
|
|
805
821
|
log(" - `mdkg goal next` is read-only; use `mdkg goal claim` to update active_node");
|
|
822
|
+
log(" - `mdkg goal activate` enforces one active local root goal and pauses competing active goals");
|
|
806
823
|
log(" - goal evaluation is report-only and never executes required_checks");
|
|
807
824
|
log(" - subgraph goal qids are read-only; update the source workspace instead");
|
|
808
825
|
printGlobalOptions(log);
|
|
@@ -869,24 +886,58 @@ function printFixHelp(log, subcommand) {
|
|
|
869
886
|
switch ((subcommand ?? "").toLowerCase()) {
|
|
870
887
|
case "plan":
|
|
871
888
|
log("Usage:");
|
|
872
|
-
log(" mdkg fix plan [--family index|refs|ids|all] [--target <id-or-qid>] [--json]");
|
|
889
|
+
log(" mdkg fix plan [--family index|refs|ids|all] [--target <id-or-qid>] [--base-ref <ref>] [--json]");
|
|
873
890
|
log("\nBoundaries:");
|
|
874
891
|
log(" - read-only repair planning; writes no files and does not rebuild indexes");
|
|
875
892
|
log(" - emits a deterministic receipt-shaped JSON plan with paths, risks, and reason codes");
|
|
876
893
|
log(" - initial families are index/cache, graph refs, and duplicate ids");
|
|
877
|
-
log(" -
|
|
894
|
+
log(" - ids-family duplicate-id repairs can be applied with `mdkg fix apply --family ids`");
|
|
895
|
+
log(" - index/cache and graph-ref findings remain review-only guidance");
|
|
878
896
|
log("\nOptions:");
|
|
879
897
|
log(" --family <family> Select index, refs, ids, or all (default all)");
|
|
880
898
|
log(" --target <id-or-qid> Optional node target for family planners");
|
|
899
|
+
log(" --base-ref <ref> Prefer IDs that already exist at a Git base ref");
|
|
900
|
+
log(" --json Emit machine-readable JSON output");
|
|
901
|
+
printGlobalOptions(log);
|
|
902
|
+
return;
|
|
903
|
+
case "apply":
|
|
904
|
+
log("Usage:");
|
|
905
|
+
log(" mdkg fix apply [--family ids] [--target <id-or-qid>] [--base-ref <ref>] [--json]");
|
|
906
|
+
log("\nBoundaries:");
|
|
907
|
+
log(" - applies only supported ids-family duplicate-ID rewrites");
|
|
908
|
+
log(" - refuses index/cache, graph-ref, all-family, blocked, and unsupported repairs");
|
|
909
|
+
log(" - writes graph Markdown atomically and rebuilds derived indexes");
|
|
910
|
+
log(" - emits a receipt with plan hash, touched paths, and manual-review reference notes");
|
|
911
|
+
log("\nOptions:");
|
|
912
|
+
log(" --family ids Explicit apply family; ids is the only supported apply family");
|
|
913
|
+
log(" --target <id-or-qid> Optional duplicate ID target");
|
|
914
|
+
log(" --base-ref <ref> Prefer IDs that already exist at a Git base ref");
|
|
915
|
+
log(" --json Emit machine-readable JSON output");
|
|
916
|
+
printGlobalOptions(log);
|
|
917
|
+
return;
|
|
918
|
+
case "ids":
|
|
919
|
+
log("Usage:");
|
|
920
|
+
log(" mdkg fix ids [--target <id-or-qid>] [--base-ref <ref>] [--apply] [--json]");
|
|
921
|
+
log("\nBoundaries:");
|
|
922
|
+
log(" - convenience command for duplicate-ID planning and application");
|
|
923
|
+
log(" - without --apply it is equivalent to `mdkg fix plan --family ids`");
|
|
924
|
+
log(" - with --apply it is equivalent to `mdkg fix apply --family ids`");
|
|
925
|
+
log("\nOptions:");
|
|
926
|
+
log(" --target <id-or-qid> Optional duplicate ID target");
|
|
927
|
+
log(" --base-ref <ref> Prefer IDs that already exist at a Git base ref");
|
|
928
|
+
log(" --apply Apply supported duplicate-ID rewrites");
|
|
881
929
|
log(" --json Emit machine-readable JSON output");
|
|
882
930
|
printGlobalOptions(log);
|
|
883
931
|
return;
|
|
884
932
|
default:
|
|
885
933
|
log("Usage:");
|
|
886
|
-
log(" mdkg fix plan [--family index|refs|ids|all] [--target <id-or-qid>] [--json]");
|
|
934
|
+
log(" mdkg fix plan [--family index|refs|ids|all] [--target <id-or-qid>] [--base-ref <ref>] [--json]");
|
|
935
|
+
log(" mdkg fix apply [--family ids] [--target <id-or-qid>] [--base-ref <ref>] [--json]");
|
|
936
|
+
log(" mdkg fix ids [--target <id-or-qid>] [--base-ref <ref>] [--apply] [--json]");
|
|
887
937
|
log("\nNotes:");
|
|
888
|
-
log(" - fix
|
|
889
|
-
log(" - apply
|
|
938
|
+
log(" - fix plan is dry-run only and writes nothing");
|
|
939
|
+
log(" - fix apply is limited to duplicate-ID graph repairs with receipt evidence");
|
|
940
|
+
log(" - index/cache and graph-ref repairs remain plan/manual-review only");
|
|
890
941
|
printGlobalOptions(log);
|
|
891
942
|
}
|
|
892
943
|
}
|
|
@@ -2090,6 +2141,14 @@ function runGoalSubcommand(parsed, root) {
|
|
|
2090
2141
|
(0, goal_1.runGoalSelectCommand)({ root, id, ws, json });
|
|
2091
2142
|
return 0;
|
|
2092
2143
|
}
|
|
2144
|
+
case "activate": {
|
|
2145
|
+
const id = parsed.positionals[2];
|
|
2146
|
+
if (!id || parsed.positionals.length > 3) {
|
|
2147
|
+
throw new errors_1.UsageError("goal activate requires <goal-id-or-qid>");
|
|
2148
|
+
}
|
|
2149
|
+
(0, goal_1.runGoalActivateCommand)({ root, id, ws, json });
|
|
2150
|
+
return 0;
|
|
2151
|
+
}
|
|
2093
2152
|
case "current":
|
|
2094
2153
|
if (parsed.positionals.length > 2) {
|
|
2095
2154
|
throw new errors_1.UsageError("goal current does not accept positional arguments");
|
|
@@ -2151,8 +2210,16 @@ function runGoalSubcommand(parsed, root) {
|
|
|
2151
2210
|
(0, goal_1.runGoalDoneCommand)({ root, id, ws, json });
|
|
2152
2211
|
return 0;
|
|
2153
2212
|
}
|
|
2213
|
+
case "archive": {
|
|
2214
|
+
const id = parsed.positionals[2];
|
|
2215
|
+
if (!id || parsed.positionals.length > 3) {
|
|
2216
|
+
throw new errors_1.UsageError("goal archive requires <goal-id-or-qid>");
|
|
2217
|
+
}
|
|
2218
|
+
(0, goal_1.runGoalArchiveCommand)({ root, id, ws, json });
|
|
2219
|
+
return 0;
|
|
2220
|
+
}
|
|
2154
2221
|
default:
|
|
2155
|
-
throw new errors_1.UsageError("goal requires show/select/current/clear/next/claim/evaluate/pause/resume/done");
|
|
2222
|
+
throw new errors_1.UsageError("goal requires show/select/activate/current/clear/next/claim/evaluate/pause/resume/done/archive");
|
|
2156
2223
|
}
|
|
2157
2224
|
}
|
|
2158
2225
|
function runTaskSubcommand(parsed, root) {
|
|
@@ -2637,16 +2704,26 @@ function runCommand(parsed, root, runtime) {
|
|
|
2637
2704
|
if (!sub) {
|
|
2638
2705
|
throw new errors_1.UsageError("fix requires a subcommand");
|
|
2639
2706
|
}
|
|
2640
|
-
if (
|
|
2707
|
+
if (!["plan", "apply", "ids"].includes(sub)) {
|
|
2641
2708
|
throw new errors_1.UsageError(`unknown fix subcommand: ${sub}`);
|
|
2642
2709
|
}
|
|
2643
2710
|
if (parsed.positionals.length > 2) {
|
|
2644
|
-
throw new errors_1.UsageError(
|
|
2711
|
+
throw new errors_1.UsageError(`fix ${sub} does not accept positional arguments`);
|
|
2645
2712
|
}
|
|
2646
2713
|
const family = requireFlagValue("--family", parsed.flags["--family"]);
|
|
2647
2714
|
const target = requireFlagValue("--target", parsed.flags["--target"]);
|
|
2715
|
+
const baseRef = requireFlagValue("--base-ref", parsed.flags["--base-ref"]);
|
|
2648
2716
|
const json = parseBooleanFlag("--json", parsed.flags["--json"]);
|
|
2649
|
-
|
|
2717
|
+
if (sub === "plan") {
|
|
2718
|
+
(0, fix_1.runFixPlanCommand)({ root, family, target, baseRef, json });
|
|
2719
|
+
return 0;
|
|
2720
|
+
}
|
|
2721
|
+
if (sub === "apply") {
|
|
2722
|
+
(0, fix_1.runFixApplyCommand)({ root, family, target, baseRef, json });
|
|
2723
|
+
return 0;
|
|
2724
|
+
}
|
|
2725
|
+
const apply = parseBooleanFlag("--apply", parsed.flags["--apply"]);
|
|
2726
|
+
(0, fix_1.runFixIdsCommand)({ root, target, baseRef, json, apply });
|
|
2650
2727
|
return 0;
|
|
2651
2728
|
}
|
|
2652
2729
|
case "format":
|