polydeukes 0.4.0 → 0.6.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 (41) hide show
  1. package/README.ko.md +11 -4
  2. package/README.md +21 -5
  3. package/dist/baseline.d.ts +82 -0
  4. package/dist/baseline.js +166 -0
  5. package/dist/bin.d.ts +5 -6
  6. package/dist/bin.js +92 -38
  7. package/dist/claude-code-hook.d.ts +40 -17
  8. package/dist/claude-code-hook.js +187 -175
  9. package/dist/claude-code.d.ts +6 -0
  10. package/dist/claude-code.js +6 -0
  11. package/dist/covenant-check.d.ts +50 -36
  12. package/dist/covenant-check.js +167 -193
  13. package/dist/covenant-module.d.ts +25 -0
  14. package/dist/covenant-module.js +42 -0
  15. package/dist/docs/configuration.md +17 -9
  16. package/dist/docs/installation.md +42 -12
  17. package/dist/docs/reference/adapter-claude-code.md +6 -4
  18. package/dist/docs/reference/adapter-git.md +23 -10
  19. package/dist/docs/reference/configuration.md +265 -103
  20. package/dist/docs/reference/core.md +15 -7
  21. package/dist/docs/reference/covenant.md +32 -24
  22. package/dist/docs/reference/polydeukes.md +132 -32
  23. package/dist/docs/troubleshooting.md +37 -8
  24. package/dist/docs-query.d.ts +10 -10
  25. package/dist/docs-query.js +12 -12
  26. package/dist/explain.d.ts +25 -0
  27. package/dist/explain.js +153 -0
  28. package/dist/index.d.ts +11 -16
  29. package/dist/index.js +10 -15
  30. package/dist/init-claude-code.d.ts +31 -18
  31. package/dist/init-claude-code.js +254 -40
  32. package/dist/init-grok.d.ts +51 -0
  33. package/dist/init-grok.js +242 -0
  34. package/dist/load-config.d.ts +17 -15
  35. package/dist/load-config.js +13 -12
  36. package/dist/pre-state-reader.d.ts +22 -0
  37. package/dist/pre-state-reader.js +32 -0
  38. package/dist/scaffold-project.d.ts +23 -14
  39. package/dist/scaffold-project.js +97 -32
  40. package/dist/schema/polydeukes.schema.json +54 -81
  41. package/package.json +7 -7
@@ -91,113 +91,86 @@
91
91
  }
92
92
  },
93
93
  "disciplineId": {
94
- "description": "Unique handle — telemetry label and verdict reason prefix.",
94
+ "description": "Unique handle — telemetry label and verdict reason prefix. The three meta-covenant labels are reserved.",
95
95
  "type": "string",
96
- "minLength": 1
96
+ "minLength": 1,
97
+ "not": { "enum": ["self-mod", "shell-mod", "transcript-mod"] }
97
98
  },
98
99
  "disciplineWhy": {
99
- "description": "Prose rationale, documentation only never judged.",
100
+ "description": "Prose rationale — never judged, and carried into the break message.",
100
101
  "type": "string"
101
102
  },
102
- "globOrGlobs": {
103
- "anyOf": [
104
- { "type": "string", "minLength": 1 },
105
- {
106
- "type": "array",
107
- "minItems": 1,
108
- "items": { "type": "string", "minLength": 1 }
109
- }
110
- ]
111
- },
112
- "requirePrecedent": {
113
- "description": "Context family — the session evidence one edit requires beforehand. Exactly one evidence key. The core owns and fully validates 'command'; every other key is adapter vocabulary whose value passes through verbatim (unconstrained here, judged by that adapter).",
114
- "type": "object",
115
- "minProperties": 1,
116
- "maxProperties": 1,
117
- "properties": {
118
- "command": {
119
- "description": "Core evidence vocabulary — regex over the shell command strings observed in the session.",
120
- "type": "string",
121
- "minLength": 1,
122
- "format": "regex"
123
- }
124
- }
103
+ "enforceLevel": {
104
+ "description": "The entry's own level. 'advise' records a break without stopping it; 'block' pins the entry at block. Composes with the surface's level, the lenient side winning; absent means advise; 'block' is the promotion rung.",
105
+ "enum": ["block", "advise"]
125
106
  },
126
107
  "discipline": {
127
- "description": "One discipline entry — exactly one predicate family (forbid | immutable | forbidCommand | requirePrecedent); in/except scope the forbid and requirePrecedent families, and when scopes requirePrecedent only.",
108
+ "description": "One discipline entry — a judged entry (id + declare, optionally why and enforce), or a draft (id + why + draft: true, no declaration).",
128
109
  "oneOf": [
129
110
  {
130
111
  "type": "object",
131
112
  "additionalProperties": false,
132
- "required": ["id", "forbid"],
133
- "properties": {
134
- "id": { "$ref": "#/$defs/disciplineId" },
135
- "why": { "$ref": "#/$defs/disciplineWhy" },
136
- "in": { "$ref": "#/$defs/globOrGlobs" },
137
- "except": { "$ref": "#/$defs/globOrGlobs" },
138
- "forbid": {
139
- "description": "Delta family — string shorthand is equivalent to { added }.",
140
- "anyOf": [
141
- { "type": "string", "minLength": 1, "format": "regex" },
142
- {
143
- "type": "object",
144
- "additionalProperties": false,
145
- "required": ["added"],
146
- "properties": {
147
- "added": { "type": "string", "minLength": 1, "format": "regex" }
148
- }
149
- }
150
- ]
151
- }
152
- }
153
- },
154
- {
155
- "type": "object",
156
- "additionalProperties": false,
157
- "required": ["id", "immutable"],
113
+ "required": ["id", "why", "draft"],
158
114
  "properties": {
159
115
  "id": { "$ref": "#/$defs/disciplineId" },
160
- "why": { "$ref": "#/$defs/disciplineWhy" },
161
- "immutable": {
162
- "description": "Path family — its own glob is the scope.",
163
- "$ref": "#/$defs/globOrGlobs"
164
- }
165
- }
166
- },
167
- {
168
- "type": "object",
169
- "additionalProperties": false,
170
- "required": ["id", "forbidCommand"],
171
- "properties": {
172
- "id": { "$ref": "#/$defs/disciplineId" },
173
- "why": { "$ref": "#/$defs/disciplineWhy" },
174
- "forbidCommand": {
175
- "description": "Command family — regex over shell command strings.",
116
+ "why": {
117
+ "description": "A draft's only body is its prose, so why is required and non-empty here.",
176
118
  "type": "string",
177
- "minLength": 1,
178
- "format": "regex"
119
+ "minLength": 1
120
+ },
121
+ "draft": {
122
+ "description": "Marks an unpromoted entry — declared as prose, never judged, never recorded. Only the literal true exists; false would be dead data synonymous with absence.",
123
+ "const": true
179
124
  }
180
125
  }
181
126
  },
182
127
  {
183
128
  "type": "object",
184
129
  "additionalProperties": false,
185
- "required": ["id", "requirePrecedent"],
130
+ "required": ["id", "declare"],
186
131
  "properties": {
187
132
  "id": { "$ref": "#/$defs/disciplineId" },
188
133
  "why": { "$ref": "#/$defs/disciplineWhy" },
189
- "in": { "$ref": "#/$defs/globOrGlobs" },
190
- "except": { "$ref": "#/$defs/globOrGlobs" },
191
- "when": {
192
- "description": "Context-family trigger — added-direction delta regex. Absent means every in-scope change triggers.",
193
- "type": "string",
194
- "minLength": 1,
195
- "format": "regex"
196
- },
197
- "requirePrecedent": { "$ref": "#/$defs/requirePrecedent" }
134
+ "enforce": { "$ref": "#/$defs/enforceLevel" },
135
+ "declare": { "$ref": "#/$defs/declarationBody" }
198
136
  }
199
137
  }
200
138
  ]
139
+ },
140
+ "declarationBody": {
141
+ "description": "Declaration family — one judgment written as data, in the grammar of the algebra declaration schema published beside this one, minus its 'discipline' key: the entry id is the declaration's name. The blocks' interiors are validated against that schema by the runtime validator.",
142
+ "type": "object",
143
+ "additionalProperties": false,
144
+ "required": ["mechanism", "extract", "relate"],
145
+ "properties": {
146
+ "mechanism": {
147
+ "enum": [
148
+ "pairing",
149
+ "companion",
150
+ "monotonic-order",
151
+ "fingerprint-sync",
152
+ "producer-owned",
153
+ "self-absolution-ban",
154
+ "actor-scope",
155
+ "precedent",
156
+ "phase-order",
157
+ "turn-locality",
158
+ "stated-ground",
159
+ "controlled-vocabulary",
160
+ "naming",
161
+ "added-only",
162
+ "one-way-marker",
163
+ "scoped-valve",
164
+ "forbidden-command"
165
+ ]
166
+ },
167
+ "scope": { "type": "object" },
168
+ "sources": { "type": "object" },
169
+ "supply": { "type": "object" },
170
+ "extract": { "type": "object", "minProperties": 1 },
171
+ "relate": { "type": "array", "minItems": 1 },
172
+ "witness": { "type": "object" }
173
+ }
201
174
  }
202
175
  }
203
176
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "polydeukes",
3
- "version": "0.4.0",
3
+ "version": "0.6.0",
4
4
  "description": "A development discipline framework for building alongside an AI coding partner — deterministic covenants, a verifiable work ledger, local memory, and adversarial verification. Alpha.",
5
5
  "keywords": [
6
6
  "harness",
@@ -37,8 +37,8 @@
37
37
  "import": "./dist/index.js"
38
38
  },
39
39
  "./claude-code": {
40
- "types": "./dist/claude-code-hook.d.ts",
41
- "import": "./dist/claude-code-hook.js"
40
+ "types": "./dist/claude-code.d.ts",
41
+ "import": "./dist/claude-code.js"
42
42
  },
43
43
  "./schema.json": "./dist/schema/polydeukes.schema.json"
44
44
  },
@@ -54,10 +54,10 @@
54
54
  },
55
55
  "dependencies": {
56
56
  "yaml": "2.9.0",
57
- "@polydeukes/adapter-claude-code": "^0.4.0",
58
- "@polydeukes/adapter-git": "^0.4.0",
59
- "@polydeukes/core": "^0.4.0",
60
- "@polydeukes/covenant": "^0.4.0"
57
+ "@polydeukes/adapter-git": "^0.6.0",
58
+ "@polydeukes/covenant": "^0.6.0",
59
+ "@polydeukes/core": "^0.6.0",
60
+ "@polydeukes/adapter-claude-code": "^0.6.0"
61
61
  },
62
62
  "devDependencies": {
63
63
  "@types/node": "^24.0.0",