polydeukes 0.0.1 → 0.4.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.
@@ -0,0 +1,203 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "Polydeukes config",
4
+ "description": "Schema v2 (config as data) — equivalent to the runtime defineConfig() validator; the equivalence is enforced by a contract test.",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["languages"],
8
+ "properties": {
9
+ "$schema": {
10
+ "description": "IDE schema reference — accepted and ignored by the runtime validator.",
11
+ "type": "string"
12
+ },
13
+ "languages": {
14
+ "description": "Language axis, first-class. Keys are user values ('typescript', 'python', ...).",
15
+ "type": "object",
16
+ "minProperties": 1,
17
+ "additionalProperties": { "$ref": "#/$defs/languageProfile" }
18
+ },
19
+ "protectedPaths": {
20
+ "description": "Raw protected path patterns — normalization happens at resolve time.",
21
+ "type": "array",
22
+ "items": { "type": "string", "minLength": 1 }
23
+ },
24
+ "adapters": {
25
+ "description": "Adapter namespaces — keys are adapter names, values are each adapter's own settings object (contents not validated by the core schema).",
26
+ "type": "object",
27
+ "additionalProperties": { "type": "object" }
28
+ },
29
+ "telemetry": { "$ref": "#/$defs/telemetry" },
30
+ "disciplines": {
31
+ "description": "User-declared disciplines — validated data the covenant package compiles. Fully identical entries are copy-paste duplicates (by-id uniqueness is enforced by the runtime validator).",
32
+ "type": "array",
33
+ "uniqueItems": true,
34
+ "items": { "$ref": "#/$defs/discipline" }
35
+ },
36
+ "witness": { "$ref": "#/$defs/witness" }
37
+ },
38
+ "$defs": {
39
+ "languageProfile": {
40
+ "type": "object",
41
+ "additionalProperties": false,
42
+ "required": ["productionGlob", "testCmd"],
43
+ "properties": {
44
+ "productionGlob": {
45
+ "description": "What counts as production source for this language.",
46
+ "anyOf": [
47
+ { "type": "string", "minLength": 1 },
48
+ {
49
+ "type": "array",
50
+ "minItems": 1,
51
+ "items": { "type": "string", "minLength": 1 }
52
+ }
53
+ ]
54
+ },
55
+ "testCmd": {
56
+ "description": "Shell command template that verifies the given scope — every literal {scope} token is substituted at resolve time.",
57
+ "type": "string",
58
+ "minLength": 1
59
+ }
60
+ }
61
+ },
62
+ "telemetry": {
63
+ "type": "object",
64
+ "additionalProperties": false,
65
+ "properties": {
66
+ "logPath": {
67
+ "description": "Telemetry log path. Defaults to .polydeukes/roi.log when omitted. Must be non-empty after trimming.",
68
+ "type": "string",
69
+ "minLength": 1,
70
+ "pattern": "\\S"
71
+ }
72
+ }
73
+ },
74
+ "witness": {
75
+ "description": "TTL witness settings — the agreed token and validity window (minutes) consumed by the covenant valve assembly (CONFIG-05).",
76
+ "type": "object",
77
+ "additionalProperties": false,
78
+ "required": ["token", "ttlMinutes"],
79
+ "properties": {
80
+ "token": {
81
+ "description": "The agreed phrase a human types alone on a message's first line — quoting it mid-sentence is a mention, not an invocation (COVENANT-15). Must be non-empty after trimming; the value itself is free.",
82
+ "type": "string",
83
+ "minLength": 1,
84
+ "pattern": "\\S"
85
+ },
86
+ "ttlMinutes": {
87
+ "description": "Validity window in minutes from the user message's timestamp. Must be a finite number > 0.",
88
+ "type": "number",
89
+ "exclusiveMinimum": 0
90
+ }
91
+ }
92
+ },
93
+ "disciplineId": {
94
+ "description": "Unique handle — telemetry label and verdict reason prefix.",
95
+ "type": "string",
96
+ "minLength": 1
97
+ },
98
+ "disciplineWhy": {
99
+ "description": "Prose rationale, documentation only — never judged.",
100
+ "type": "string"
101
+ },
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
+ }
125
+ },
126
+ "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.",
128
+ "oneOf": [
129
+ {
130
+ "type": "object",
131
+ "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"],
158
+ "properties": {
159
+ "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.",
176
+ "type": "string",
177
+ "minLength": 1,
178
+ "format": "regex"
179
+ }
180
+ }
181
+ },
182
+ {
183
+ "type": "object",
184
+ "additionalProperties": false,
185
+ "required": ["id", "requirePrecedent"],
186
+ "properties": {
187
+ "id": { "$ref": "#/$defs/disciplineId" },
188
+ "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" }
198
+ }
199
+ }
200
+ ]
201
+ }
202
+ }
203
+ }
package/package.json CHANGED
@@ -1,13 +1,15 @@
1
1
  {
2
2
  "name": "polydeukes",
3
- "version": "0.0.1",
4
- "description": "A harness framework for developing alongside an AI coding partner — deterministic guards, verifiable work ledger, local knowledge graph, and adversarial verification. Pre-alpha; design stage.",
3
+ "version": "0.4.0",
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",
7
+ "guard",
8
+ "discipline",
9
+ "covenant",
7
10
  "ai",
8
11
  "agent",
9
12
  "dev-tool",
10
- "guard",
11
13
  "ledger",
12
14
  "verification"
13
15
  ],
@@ -22,6 +24,10 @@
22
24
  "url": "https://github.com/huskyhoochu/polydeukes/issues"
23
25
  },
24
26
  "type": "module",
27
+ "bin": {
28
+ "pdks": "./dist/bin.js",
29
+ "polydeukes": "./dist/bin.js"
30
+ },
25
31
  "main": "./dist/index.js",
26
32
  "module": "./dist/index.js",
27
33
  "types": "./dist/index.d.ts",
@@ -29,24 +35,38 @@
29
35
  ".": {
30
36
  "types": "./dist/index.d.ts",
31
37
  "import": "./dist/index.js"
32
- }
38
+ },
39
+ "./claude-code": {
40
+ "types": "./dist/claude-code-hook.d.ts",
41
+ "import": "./dist/claude-code-hook.js"
42
+ },
43
+ "./schema.json": "./dist/schema/polydeukes.schema.json"
33
44
  },
34
45
  "files": [
35
46
  "dist",
36
47
  "README.md"
37
48
  ],
38
- "scripts": {
39
- "build": "tsc -p tsconfig.json",
40
- "typecheck": "tsc --noEmit",
41
- "prepublishOnly": "pnpm run build"
42
- },
43
49
  "engines": {
44
50
  "node": ">=24"
45
51
  },
46
52
  "publishConfig": {
47
53
  "access": "public"
48
54
  },
55
+ "dependencies": {
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"
61
+ },
49
62
  "devDependencies": {
50
- "typescript": "^5.7.0"
63
+ "@types/node": "^24.0.0",
64
+ "typescript": "7.0.2",
65
+ "vitest": "^4.1.0"
66
+ },
67
+ "scripts": {
68
+ "build": "tsc -p tsconfig.build.json && node scripts/copy-docs.mjs && node scripts/copy-schema.mjs",
69
+ "typecheck": "tsc --noEmit",
70
+ "test": "vitest run"
51
71
  }
52
- }
72
+ }