wowbagger 0.1.0-alpha.9 → 0.5.0

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.
Files changed (46) hide show
  1. package/CHANGELOG.md +509 -0
  2. package/README.md +272 -136
  3. package/docs/adapter-contract.md +1 -1
  4. package/docs/host-contract.md +7 -1
  5. package/docs/mutation-contract.md +354 -82
  6. package/docs/work-claim-contract.md +466 -88
  7. package/package.json +2 -2
  8. package/schemas/core-capabilities-response.json +1 -1
  9. package/schemas/core-envelope.json +4 -3
  10. package/schemas/index.json +18 -0
  11. package/schemas/ledger-repair-proposal.json +170 -0
  12. package/schemas/ledger-repair-request.json +61 -0
  13. package/schemas/ledger-repair-response.json +90 -0
  14. package/schemas/report-config-v1.json +4 -0
  15. package/schemas/report-config-v2.json +5 -0
  16. package/skills/wowbagger/SKILL.md +242 -59
  17. package/src/adapter/core-probe.js +3 -4
  18. package/src/adapter/process-outcome.js +8 -1
  19. package/src/claim-capabilities.js +3 -3
  20. package/src/claim-coordinator.js +61 -12
  21. package/src/claim-journal.js +212 -7
  22. package/src/claim-prospective.js +1 -28
  23. package/src/claim-publication.js +412 -78
  24. package/src/claim-request.js +9 -0
  25. package/src/claim-store.js +9 -4
  26. package/src/cli.js +302 -56
  27. package/src/extensions.js +1 -0
  28. package/src/git-autocommit.js +106 -43
  29. package/src/git-reconciliation.js +74 -19
  30. package/src/git-worktrees.js +73 -0
  31. package/src/instrumentation.js +1 -0
  32. package/src/launch.js +2 -2
  33. package/src/ledger-repair.js +1170 -0
  34. package/src/mutation.js +73 -15
  35. package/src/reconciliation-classifier.js +117 -0
  36. package/src/report-evidence.js +158 -41
  37. package/src/report-graph.js +201 -73
  38. package/src/report-html.js +358 -155
  39. package/src/report-impact.js +106 -0
  40. package/src/report-selection.js +97 -0
  41. package/src/report-sequencing.js +4 -4
  42. package/src/report-svg.js +74 -20
  43. package/src/report-view.js +14 -1
  44. package/src/report.js +109 -23
  45. package/src/version-drift.js +98 -0
  46. package/src/worktree-identity.js +165 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wowbagger",
3
- "version": "0.1.0-alpha.9",
3
+ "version": "0.5.0",
4
4
  "description": "Git-native work ledger for coding agents: deterministic ready queues, guarded CAS mutations, claims and fencing, and self-contained HTML reports.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -30,7 +30,7 @@
30
30
  "cli"
31
31
  ],
32
32
  "engines": {
33
- "node": ">=20"
33
+ "node": ">=24"
34
34
  },
35
35
  "bin": {
36
36
  "wowbagger": "bin/wowbagger.js"
@@ -232,7 +232,7 @@
232
232
  "type": "boolean"
233
233
  },
234
234
  "api_version": {
235
- "const": 2
235
+ "const": 3
236
236
  },
237
237
  "mode": {
238
238
  "const": "advisory"
@@ -25,7 +25,8 @@
25
25
  "inspect",
26
26
  "list",
27
27
  "mint-id",
28
- "report"
28
+ "report",
29
+ "version-drift"
29
30
  ]
30
31
  },
31
32
  "contract_version": {
@@ -55,8 +56,8 @@
55
56
  "capabilities",
56
57
  "inspect",
57
58
  "list",
58
- "mint-id",
59
- "report"
59
+ "report",
60
+ "version-drift"
60
61
  ]
61
62
  },
62
63
  "contract_version": {
@@ -92,6 +92,24 @@
92
92
  "version": 1,
93
93
  "summary": "Legacy-write fence refusals in the ledger-mutation namespace."
94
94
  },
95
+ {
96
+ "file": "ledger-repair-proposal.json",
97
+ "domain": "ledger-repair",
98
+ "version": 1,
99
+ "summary": "The read-only duplicate-number repair proposal result."
100
+ },
101
+ {
102
+ "file": "ledger-repair-request.json",
103
+ "domain": "ledger-repair",
104
+ "version": 1,
105
+ "summary": "The strict number-repair request, covering the complete duplicate set."
106
+ },
107
+ {
108
+ "file": "ledger-repair-response.json",
109
+ "domain": "ledger-repair",
110
+ "version": 1,
111
+ "summary": "Every ledger-repair response: the proposal and apply envelopes at repair version 1."
112
+ },
95
113
  {
96
114
  "file": "report-config-v1.json",
97
115
  "domain": "report-config",
@@ -0,0 +1,170 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://github.com/lstutzman/wowbagger/schemas/ledger-repair-proposal.json",
4
+ "title": "number-repair-proposal result, ledger-repair version 1",
5
+ "description": "The `result` member of a successful `number-repair-proposal` response. The proposal is read-only: it reads the raw items of a ledger whose complete error set is duplicate numbers and computes the mapping that would repair it, writing nothing. The caller confirms or replaces `suggested_changes` and submits them as a `number-repair` request, which validates every witness again under the repair lock.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": [
9
+ "ledger_snapshot_revision",
10
+ "duplicate_groups",
11
+ "items",
12
+ "suggested_changes",
13
+ "preserved_items",
14
+ "validation_errors"
15
+ ],
16
+ "properties": {
17
+ "ledger_snapshot_revision": {
18
+ "$ref": "https://github.com/lstutzman/wowbagger/schemas/common.json#/$defs/revision",
19
+ "description": "The digest over the complete relevant source bytes this proposal was computed from. A repair request replays it so a changed ledger is a conflict rather than a surprise."
20
+ },
21
+ "duplicate_groups": {
22
+ "type": "array",
23
+ "minItems": 1,
24
+ "description": "One entry per duplicated number, naming every item that carries it. A repair request must resolve every group.",
25
+ "items": {
26
+ "type": "object",
27
+ "additionalProperties": false,
28
+ "required": [
29
+ "number",
30
+ "item_ids"
31
+ ],
32
+ "properties": {
33
+ "number": {
34
+ "type": "integer",
35
+ "minimum": 1
36
+ },
37
+ "item_ids": {
38
+ "type": "array",
39
+ "minItems": 2,
40
+ "uniqueItems": true,
41
+ "items": {
42
+ "$ref": "https://github.com/lstutzman/wowbagger/schemas/common.json#/$defs/itemId"
43
+ }
44
+ }
45
+ }
46
+ }
47
+ },
48
+ "items": {
49
+ "type": "array",
50
+ "minItems": 1,
51
+ "description": "Every item in a duplicate group, with the configured path and exact source revision a repair request witnesses.",
52
+ "items": {
53
+ "type": "object",
54
+ "additionalProperties": false,
55
+ "required": [
56
+ "item_id",
57
+ "path",
58
+ "revision",
59
+ "number"
60
+ ],
61
+ "properties": {
62
+ "item_id": {
63
+ "$ref": "https://github.com/lstutzman/wowbagger/schemas/common.json#/$defs/itemId"
64
+ },
65
+ "path": {
66
+ "type": "string",
67
+ "minLength": 1,
68
+ "description": "The item's configured path, relative to the ledger directory."
69
+ },
70
+ "revision": {
71
+ "$ref": "https://github.com/lstutzman/wowbagger/schemas/common.json#/$defs/revision"
72
+ },
73
+ "number": {
74
+ "type": "integer",
75
+ "minimum": 1
76
+ }
77
+ }
78
+ }
79
+ },
80
+ "suggested_changes": {
81
+ "type": "array",
82
+ "minItems": 1,
83
+ "description": "The computed mapping, in the exact shape of the `changes` member of a number-repair request. Each group keeps the number on its lexicographically smallest ULID and moves the rest above the current maximum number.",
84
+ "items": {
85
+ "type": "object",
86
+ "additionalProperties": false,
87
+ "required": [
88
+ "item_id",
89
+ "expected_revision",
90
+ "expected_number",
91
+ "replacement_number"
92
+ ],
93
+ "properties": {
94
+ "item_id": {
95
+ "$ref": "https://github.com/lstutzman/wowbagger/schemas/common.json#/$defs/itemId"
96
+ },
97
+ "expected_revision": {
98
+ "$ref": "https://github.com/lstutzman/wowbagger/schemas/common.json#/$defs/revision"
99
+ },
100
+ "expected_number": {
101
+ "type": "integer",
102
+ "minimum": 1
103
+ },
104
+ "replacement_number": {
105
+ "type": "integer",
106
+ "minimum": 1
107
+ }
108
+ }
109
+ }
110
+ },
111
+ "preserved_items": {
112
+ "type": "array",
113
+ "minItems": 1,
114
+ "description": "Item IDs the proposal keeps at their current number.",
115
+ "uniqueItems": true,
116
+ "items": {
117
+ "$ref": "https://github.com/lstutzman/wowbagger/schemas/common.json#/$defs/itemId"
118
+ }
119
+ },
120
+ "references": {
121
+ "type": "array",
122
+ "description": "The affected items' relations, exactly as the source carries them. Relations are ULIDs, so a number repair preserves them; they are reported so a caller can confirm that nothing identity-bearing is being rewritten.",
123
+ "items": {
124
+ "type": "object",
125
+ "additionalProperties": false,
126
+ "required": [
127
+ "item_id",
128
+ "depends_on",
129
+ "related",
130
+ "parent"
131
+ ],
132
+ "properties": {
133
+ "item_id": {
134
+ "$ref": "https://github.com/lstutzman/wowbagger/schemas/common.json#/$defs/itemId"
135
+ },
136
+ "depends_on": {
137
+ "type": "array",
138
+ "items": {
139
+ "$ref": "https://github.com/lstutzman/wowbagger/schemas/common.json#/$defs/itemId"
140
+ }
141
+ },
142
+ "related": {
143
+ "type": "array",
144
+ "items": {
145
+ "$ref": "https://github.com/lstutzman/wowbagger/schemas/common.json#/$defs/itemId"
146
+ }
147
+ },
148
+ "parent": {
149
+ "oneOf": [
150
+ {
151
+ "$ref": "https://github.com/lstutzman/wowbagger/schemas/common.json#/$defs/itemId"
152
+ },
153
+ {
154
+ "type": "null"
155
+ }
156
+ ]
157
+ }
158
+ }
159
+ }
160
+ },
161
+ "validation_errors": {
162
+ "type": "array",
163
+ "minItems": 1,
164
+ "description": "The complete current validation errors. A proposal is produced only when every one of them is a duplicate-number error; any other error returns ledger-repair-not-applicable instead.",
165
+ "items": {
166
+ "$ref": "https://github.com/lstutzman/wowbagger/schemas/common.json#/$defs/validationError"
167
+ }
168
+ }
169
+ }
170
+ }
@@ -0,0 +1,61 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://github.com/lstutzman/wowbagger/schemas/ledger-repair-request.json",
4
+ "title": "number-repair request, ledger-repair version 1",
5
+ "description": "The strict JSON request `number-repair` reads from stdin or a host-created request file. One request covers the complete duplicate set: a partial mapping is refused, because moving one group cannot produce a valid complete ledger while another group remains. Each change carries the witnesses the apply path compares under the repair lock. `ledger-repair` is its own contract version, separate from the core contract version and the work-claim contract version.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": [
9
+ "repair_id",
10
+ "ledger_snapshot_revision",
11
+ "date",
12
+ "changes"
13
+ ],
14
+ "properties": {
15
+ "repair_id": {
16
+ "type": "string",
17
+ "pattern": "^nr_[0-9]{8}_[0-9]{4}$",
18
+ "description": "The bounded recovery key: `nr_`, the repair date, and a four-digit sequence within that date. An interrupted apply is resumed by this ID rather than retried blindly."
19
+ },
20
+ "ledger_snapshot_revision": {
21
+ "$ref": "https://github.com/lstutzman/wowbagger/schemas/common.json#/$defs/revision",
22
+ "description": "The complete-snapshot witness the proposal was computed against. A changed snapshot is a conflict, never a repair applied to bytes the caller never read."
23
+ },
24
+ "date": {
25
+ "$ref": "https://github.com/lstutzman/wowbagger/schemas/common.json#/$defs/isoDate"
26
+ },
27
+ "changes": {
28
+ "type": "array",
29
+ "minItems": 1,
30
+ "description": "One entry per moved item. No `item_id` repeats, because an item moves once, and no `replacement_number` repeats, because two items cannot land on one number. An empty list is an invalid request rather than a no-op.",
31
+ "items": {
32
+ "type": "object",
33
+ "additionalProperties": false,
34
+ "required": [
35
+ "item_id",
36
+ "expected_revision",
37
+ "expected_number",
38
+ "replacement_number"
39
+ ],
40
+ "properties": {
41
+ "item_id": {
42
+ "$ref": "https://github.com/lstutzman/wowbagger/schemas/common.json#/$defs/itemId"
43
+ },
44
+ "expected_revision": {
45
+ "$ref": "https://github.com/lstutzman/wowbagger/schemas/common.json#/$defs/revision"
46
+ },
47
+ "expected_number": {
48
+ "type": "integer",
49
+ "minimum": 1,
50
+ "description": "The number the item carries now, compared as an integer. It is a witness, not a label."
51
+ },
52
+ "replacement_number": {
53
+ "type": "integer",
54
+ "minimum": 1,
55
+ "description": "The number the item is moved to. The apply path refuses a collision with any item that is not being moved."
56
+ }
57
+ }
58
+ }
59
+ }
60
+ }
61
+ }
@@ -0,0 +1,90 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://github.com/lstutzman/wowbagger/schemas/ledger-repair-response.json",
4
+ "title": "ledger-repair responses, contract version 1",
5
+ "description": "Every `number-repair-proposal` and `number-repair` --json response. The root carries a `namespace` member: dispatch on `namespace` before reading any version field. `contract_version` is the repair domain's own version 1 — the core contract version and the work-claim contract version are separate and unchanged by it. A future change to the request or the repaired source shape requires a new repair contract version rather than a silent reinterpretation of version 1.",
6
+ "type": "object",
7
+ "oneOf": [
8
+ {
9
+ "title": "repair success",
10
+ "type": "object",
11
+ "additionalProperties": false,
12
+ "required": [
13
+ "ok",
14
+ "namespace",
15
+ "command",
16
+ "contract_version",
17
+ "state",
18
+ "result"
19
+ ],
20
+ "properties": {
21
+ "ok": {
22
+ "const": true
23
+ },
24
+ "namespace": {
25
+ "const": "ledger-repair"
26
+ },
27
+ "command": {
28
+ "enum": [
29
+ "number-repair-proposal",
30
+ "number-repair"
31
+ ]
32
+ },
33
+ "contract_version": {
34
+ "const": 1
35
+ },
36
+ "state": {
37
+ "enum": [
38
+ "unchanged",
39
+ "committed"
40
+ ],
41
+ "description": "A proposal changes nothing, so it is always `unchanged`. An applied repair is `committed`."
42
+ },
43
+ "result": {
44
+ "type": "object",
45
+ "description": "The proposal result is the ledger-repair-proposal schema. The apply result names the repair ID, the snapshot it was applied against, the changed items, and the Git commit when one was established."
46
+ }
47
+ }
48
+ },
49
+ {
50
+ "title": "repair refusal",
51
+ "type": "object",
52
+ "additionalProperties": false,
53
+ "required": [
54
+ "ok",
55
+ "namespace",
56
+ "command",
57
+ "contract_version",
58
+ "state",
59
+ "error"
60
+ ],
61
+ "properties": {
62
+ "ok": {
63
+ "const": false
64
+ },
65
+ "namespace": {
66
+ "const": "ledger-repair"
67
+ },
68
+ "command": {
69
+ "enum": [
70
+ "number-repair-proposal",
71
+ "number-repair"
72
+ ]
73
+ },
74
+ "contract_version": {
75
+ "const": 1
76
+ },
77
+ "state": {
78
+ "enum": [
79
+ "unchanged",
80
+ "unknown"
81
+ ],
82
+ "description": "`unchanged` states that no ledger byte was written. `unknown` is reserved for an outcome this core could not resolve; it never accompanies a refusal raised before any write was attempted."
83
+ },
84
+ "error": {
85
+ "$ref": "https://github.com/lstutzman/wowbagger/schemas/common.json#/$defs/error"
86
+ }
87
+ }
88
+ }
89
+ ]
90
+ }
@@ -45,6 +45,10 @@
45
45
  "type": "string",
46
46
  "pattern": "^(/([^/~]|~[01])*)*$"
47
47
  },
48
+ "tags": {
49
+ "type": "string",
50
+ "pattern": "^(/([^/~]|~[01])*)*$"
51
+ },
48
52
  "class": {
49
53
  "type": "string",
50
54
  "pattern": "^(/([^/~]|~[01])*)*$"
@@ -45,6 +45,10 @@
45
45
  "type": "string",
46
46
  "pattern": "^(/([^/~]|~[01])*)*$"
47
47
  },
48
+ "tags": {
49
+ "type": "string",
50
+ "pattern": "^(/([^/~]|~[01])*)*$"
51
+ },
48
52
  "class": {
49
53
  "type": "string",
50
54
  "pattern": "^(/([^/~]|~[01])*)*$"
@@ -189,6 +193,7 @@
189
193
  "propertyNames": {
190
194
  "enum": [
191
195
  "area",
196
+ "tags",
192
197
  "class",
193
198
  "due",
194
199
  "rank",