@acidicsoil/portable-capabilities 0.1.0 → 0.1.2

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/package.json CHANGED
@@ -1,7 +1,12 @@
1
1
  {
2
2
  "name": "@acidicsoil/portable-capabilities",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
+ "description": "Portable analytical capability compiler, runtime package generator, and CLI",
5
+ "license": "MIT",
4
6
  "type": "module",
7
+ "bin": {
8
+ "portable-capabilities": "./dist-release/cli.js"
9
+ },
5
10
  "publishConfig": {
6
11
  "access": "public",
7
12
  "registry": "https://registry.npmjs.org/"
@@ -11,6 +16,7 @@
11
16
  "pnpm": ">=11.1.0"
12
17
  },
13
18
  "scripts": {
19
+ "prepack": "node scripts/release/build-public-package.mjs",
14
20
  "typecheck": "turbo run typecheck",
15
21
  "test:run": "turbo run test",
16
22
  "test:coverage": "vitest run --coverage",
@@ -32,7 +38,9 @@
32
38
  "verify:tool-boundary": "node scripts/verify-tool-boundary.mjs",
33
39
  "verify:generated-drift": "node scripts/verify-generated-drift.mjs",
34
40
  "verify:ci-matrix": "node scripts/verify-ci-matrix.mjs",
35
- "release:pack:verify": "node scripts/release/verify-pack.mjs",
41
+ "release:pack:verify": "node scripts/release/verify-pack.mjs && node scripts/release/verify-public-package.mjs",
42
+ "release:internal-cli-pack:verify": "node scripts/release/verify-pack.mjs",
43
+ "release:public-package:build": "node scripts/release/build-public-package.mjs",
36
44
  "changeset": "changeset",
37
45
  "changeset:status": "changeset status",
38
46
  "release:cli:build": "node scripts/release/build-cli.mjs",
@@ -41,7 +49,9 @@
41
49
  "docs:verify": "node scripts/release/verify-docs.mjs",
42
50
  "release:verify": "node scripts/release/verify-clean-checkout.mjs",
43
51
  "format:docs": "prettier --write \"README.md\" \"CHANGELOG.md\" \"phase-6.1-milestone.md\" \"docs/**/*.md\" \"packages/**/*.md\" \".planning/**/*.md\" \".changeset/**/*.md\"",
44
- "format:docs:check": "prettier --check \"README.md\" \"CHANGELOG.md\" \"phase-6.1-milestone.md\" \"docs/**/*.md\" \"packages/**/*.md\" \".planning/**/*.md\" \".changeset/**/*.md\""
52
+ "format:docs:check": "prettier --check \"README.md\" \"CHANGELOG.md\" \"phase-6.1-milestone.md\" \"docs/**/*.md\" \"packages/**/*.md\" \".planning/**/*.md\" \".changeset/**/*.md\"",
53
+ "verify:runtime": "node scripts/verify-native-runtime.mjs",
54
+ "demo": "node scripts/demo.mjs"
45
55
  },
46
56
  "dependencies": {
47
57
  "ajv": "8.20.0",
@@ -0,0 +1,14 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://portable-capabilities.dev/schemas/capability-system/1.0",
4
+ "type": "object",
5
+ "additionalProperties": false,
6
+ "required": ["schemaVersion", "id", "roles", "runtimes"],
7
+ "properties": {
8
+ "schemaVersion": { "const": "1.0" },
9
+ "id": { "type": "string", "minLength": 1 },
10
+ "roles": { "type": "array", "minItems": 1, "items": { "type": "string" } },
11
+ "runtimes": { "type": "array", "minItems": 1, "items": { "type": "string" } },
12
+ "exceptions": { "type": "array", "items": { "type": "string" } }
13
+ }
14
+ }
@@ -0,0 +1,29 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://portable-capabilities.dev/schemas/evidence-ledger/1.0",
4
+ "type": "object",
5
+ "additionalProperties": false,
6
+ "required": ["schemaVersion", "id", "class", "statement", "evidence", "derivationIds"],
7
+ "properties": {
8
+ "schemaVersion": { "const": "1.0" },
9
+ "id": { "type": "string", "minLength": 1 },
10
+ "class": { "enum": ["observed", "derived", "inferred", "recommended", "unresolved"] },
11
+ "statement": { "type": "string", "minLength": 1 },
12
+ "evidence": {
13
+ "type": "array",
14
+ "items": {
15
+ "type": "object",
16
+ "additionalProperties": false,
17
+ "required": ["sourceId", "artifactDigest", "mediaType", "byteLength"],
18
+ "properties": {
19
+ "sourceId": { "type": "string" },
20
+ "artifactDigest": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
21
+ "mediaType": { "type": "string" },
22
+ "byteLength": { "type": "integer", "minimum": 0 }
23
+ }
24
+ }
25
+ },
26
+ "derivationIds": { "type": "array", "items": { "type": "string" } },
27
+ "confidence": { "type": "number", "minimum": 0, "maximum": 1 }
28
+ }
29
+ }
@@ -0,0 +1,109 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://portable-capabilities.dev/schemas/evidence-ledger/1.1",
4
+ "oneOf": [{ "$ref": "#/$defs/legacyClaim" }, { "$ref": "#/$defs/traceableClaim" }],
5
+ "$defs": {
6
+ "claimClass": {
7
+ "enum": ["observed", "derived", "inferred", "recommended", "unresolved"]
8
+ },
9
+ "locator": {
10
+ "type": "object",
11
+ "additionalProperties": false,
12
+ "required": ["kind", "sourceId", "start", "end", "excerpt", "digest"],
13
+ "properties": {
14
+ "kind": {
15
+ "enum": [
16
+ "file",
17
+ "conversation",
18
+ "requirement",
19
+ "test",
20
+ "artifact",
21
+ "approved-external-source"
22
+ ]
23
+ },
24
+ "sourceId": { "type": "string", "minLength": 1 },
25
+ "start": { "type": "integer", "minimum": 0 },
26
+ "end": { "type": "integer", "minimum": 0 },
27
+ "excerpt": { "type": "string" },
28
+ "digest": { "type": "string", "pattern": "^[a-f0-9]{64}$" }
29
+ }
30
+ },
31
+ "claimEvidence": {
32
+ "type": "object",
33
+ "additionalProperties": false,
34
+ "required": ["locator", "counterevidence", "transformationChain", "outputFields"],
35
+ "properties": {
36
+ "locator": { "$ref": "#/$defs/locator" },
37
+ "counterevidence": {
38
+ "type": "array",
39
+ "items": { "type": "string", "minLength": 1 }
40
+ },
41
+ "transformationChain": {
42
+ "type": "array",
43
+ "items": { "type": "string", "minLength": 1 }
44
+ },
45
+ "outputFields": {
46
+ "type": "array",
47
+ "minItems": 1,
48
+ "uniqueItems": true,
49
+ "items": { "type": "string", "minLength": 1 }
50
+ },
51
+ "decisionRule": { "type": "string", "minLength": 1 }
52
+ }
53
+ },
54
+ "legacyClaim": {
55
+ "type": "object",
56
+ "additionalProperties": false,
57
+ "required": ["schemaVersion", "id", "class", "statement", "evidence", "derivationIds"],
58
+ "properties": {
59
+ "schemaVersion": { "const": "1.0" },
60
+ "id": { "type": "string", "minLength": 1 },
61
+ "class": { "$ref": "#/$defs/claimClass" },
62
+ "statement": { "type": "string", "minLength": 1 },
63
+ "evidence": {
64
+ "type": "array",
65
+ "items": {
66
+ "type": "object",
67
+ "additionalProperties": false,
68
+ "required": ["sourceId", "artifactDigest", "mediaType", "byteLength"],
69
+ "properties": {
70
+ "sourceId": { "type": "string" },
71
+ "artifactDigest": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
72
+ "mediaType": { "type": "string" },
73
+ "byteLength": { "type": "integer", "minimum": 0 }
74
+ }
75
+ }
76
+ },
77
+ "derivationIds": { "type": "array", "items": { "type": "string" } },
78
+ "confidence": { "type": "number", "minimum": 0, "maximum": 1 }
79
+ }
80
+ },
81
+ "traceableClaim": {
82
+ "type": "object",
83
+ "additionalProperties": false,
84
+ "required": [
85
+ "schemaVersion",
86
+ "id",
87
+ "class",
88
+ "statement",
89
+ "evidence",
90
+ "derivationIds",
91
+ "confidence"
92
+ ],
93
+ "properties": {
94
+ "schemaVersion": { "const": "1.1" },
95
+ "id": { "type": "string", "minLength": 1 },
96
+ "class": { "$ref": "#/$defs/claimClass" },
97
+ "statement": { "type": "string", "minLength": 1 },
98
+ "evidence": {
99
+ "type": "array",
100
+ "minItems": 1,
101
+ "items": { "$ref": "#/$defs/claimEvidence" }
102
+ },
103
+ "derivationIds": { "type": "array", "items": { "type": "string" } },
104
+ "confidence": { "type": "number", "minimum": 0, "maximum": 1 },
105
+ "decisionRule": { "type": "string", "minLength": 1 }
106
+ }
107
+ }
108
+ }
109
+ }
@@ -0,0 +1,30 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://portable-capabilities.dev/schemas/exception/1.0",
4
+ "type": "object",
5
+ "additionalProperties": false,
6
+ "required": [
7
+ "schemaVersion",
8
+ "id",
9
+ "runtime",
10
+ "scope",
11
+ "rationale",
12
+ "impact",
13
+ "fallback",
14
+ "tests",
15
+ "provenance",
16
+ "reviewDate"
17
+ ],
18
+ "properties": {
19
+ "schemaVersion": { "const": "1.0" },
20
+ "id": { "type": "string", "minLength": 1 },
21
+ "runtime": { "type": "string", "minLength": 1 },
22
+ "scope": { "type": "string", "pattern": "^(role|capability):[^*]+$" },
23
+ "rationale": { "type": "string", "minLength": 1 },
24
+ "impact": { "type": "string", "minLength": 1 },
25
+ "fallback": { "type": "string", "minLength": 1 },
26
+ "tests": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1 } },
27
+ "provenance": { "type": "string", "minLength": 1 },
28
+ "reviewDate": { "type": "string", "format": "date" }
29
+ }
30
+ }
@@ -0,0 +1,52 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://portable-capabilities.dev/schemas/family/1.0",
4
+ "type": "object",
5
+ "additionalProperties": false,
6
+ "required": [
7
+ "schemaVersion",
8
+ "id",
9
+ "version",
10
+ "purpose",
11
+ "allowedOperations",
12
+ "requiredBehavior",
13
+ "forbiddenBehavior"
14
+ ],
15
+ "properties": {
16
+ "schemaVersion": {
17
+ "const": "1.0"
18
+ },
19
+ "id": {
20
+ "type": "string",
21
+ "minLength": 1
22
+ },
23
+ "version": {
24
+ "type": "string",
25
+ "pattern": "^\\d+\\.\\d+\\.\\d+$"
26
+ },
27
+ "purpose": {
28
+ "type": "string",
29
+ "minLength": 1
30
+ },
31
+ "allowedOperations": {
32
+ "type": "array",
33
+ "minItems": 1,
34
+ "uniqueItems": true,
35
+ "items": {
36
+ "type": "string"
37
+ }
38
+ },
39
+ "requiredBehavior": {
40
+ "type": "array",
41
+ "items": {
42
+ "type": "string"
43
+ }
44
+ },
45
+ "forbiddenBehavior": {
46
+ "type": "array",
47
+ "items": {
48
+ "type": "string"
49
+ }
50
+ }
51
+ }
52
+ }
@@ -0,0 +1,120 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://portable-capabilities.dev/schemas/operation/1.0",
4
+ "type": "object",
5
+ "additionalProperties": false,
6
+ "required": [
7
+ "schemaVersion",
8
+ "id",
9
+ "version",
10
+ "purpose",
11
+ "inputs",
12
+ "outputs",
13
+ "requiredBehavior",
14
+ "forbiddenBehavior",
15
+ "traceability",
16
+ "evaluation"
17
+ ],
18
+ "properties": {
19
+ "schemaVersion": {
20
+ "const": "1.0"
21
+ },
22
+ "id": {
23
+ "type": "string",
24
+ "pattern": "^[a-z]+(?:[.-][a-z]+)*$"
25
+ },
26
+ "version": {
27
+ "type": "string",
28
+ "pattern": "^\\d+\\.\\d+\\.\\d+$"
29
+ },
30
+ "purpose": {
31
+ "type": "string",
32
+ "minLength": 1
33
+ },
34
+ "inputs": {
35
+ "type": "array",
36
+ "items": {
37
+ "type": "object",
38
+ "additionalProperties": false,
39
+ "required": ["name", "description", "required"],
40
+ "properties": {
41
+ "name": {
42
+ "type": "string",
43
+ "minLength": 1
44
+ },
45
+ "description": {
46
+ "type": "string",
47
+ "minLength": 1
48
+ },
49
+ "required": {
50
+ "type": "boolean"
51
+ }
52
+ }
53
+ }
54
+ },
55
+ "outputs": {
56
+ "type": "array",
57
+ "minItems": 1,
58
+ "items": {
59
+ "type": "object",
60
+ "additionalProperties": false,
61
+ "required": ["schema", "description"],
62
+ "properties": {
63
+ "schema": {
64
+ "type": "string",
65
+ "minLength": 1
66
+ },
67
+ "description": {
68
+ "type": "string",
69
+ "minLength": 1
70
+ }
71
+ }
72
+ }
73
+ },
74
+ "requiredBehavior": {
75
+ "type": "array",
76
+ "minItems": 1,
77
+ "items": {
78
+ "type": "string"
79
+ }
80
+ },
81
+ "forbiddenBehavior": {
82
+ "type": "array",
83
+ "minItems": 1,
84
+ "items": {
85
+ "type": "string"
86
+ }
87
+ },
88
+ "traceability": {
89
+ "type": "object",
90
+ "additionalProperties": false,
91
+ "required": ["materialClaimsRequireSources", "ledgerFormat", "artifacts"],
92
+ "properties": {
93
+ "materialClaimsRequireSources": {
94
+ "const": true
95
+ },
96
+ "ledgerFormat": {
97
+ "const": "jsonl"
98
+ },
99
+ "artifacts": {
100
+ "const": "content-addressed"
101
+ }
102
+ }
103
+ },
104
+ "evaluation": {
105
+ "type": "object",
106
+ "additionalProperties": false,
107
+ "required": ["criteria"],
108
+ "properties": {
109
+ "criteria": {
110
+ "type": "array",
111
+ "minItems": 1,
112
+ "items": {
113
+ "type": "string",
114
+ "minLength": 1
115
+ }
116
+ }
117
+ }
118
+ }
119
+ }
120
+ }
@@ -0,0 +1,204 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://portable-capabilities.dev/schemas/role/1.0",
4
+ "type": "object",
5
+ "additionalProperties": false,
6
+ "required": [
7
+ "schemaVersion",
8
+ "id",
9
+ "purpose",
10
+ "family",
11
+ "taxonomy",
12
+ "inputs",
13
+ "precedence",
14
+ "pipeline",
15
+ "output",
16
+ "requiredBehavior",
17
+ "forbiddenBehavior",
18
+ "traceability",
19
+ "evaluation"
20
+ ],
21
+ "properties": {
22
+ "schemaVersion": {
23
+ "const": "1.0"
24
+ },
25
+ "id": {
26
+ "type": "string",
27
+ "minLength": 1
28
+ },
29
+ "purpose": {
30
+ "type": "string",
31
+ "minLength": 1
32
+ },
33
+ "effects": {
34
+ "type": "object",
35
+ "additionalProperties": false,
36
+ "properties": {
37
+ "filesystem": {
38
+ "const": "read-only"
39
+ },
40
+ "shell": {
41
+ "const": "denied"
42
+ },
43
+ "network": {
44
+ "const": "inherited"
45
+ },
46
+ "repositoryWrites": {
47
+ "const": "denied"
48
+ }
49
+ }
50
+ },
51
+ "family": {
52
+ "type": "object",
53
+ "additionalProperties": false,
54
+ "required": ["id", "version"],
55
+ "properties": {
56
+ "id": {
57
+ "type": "string"
58
+ },
59
+ "version": {
60
+ "type": "string",
61
+ "pattern": "^\\d+\\.\\d+\\.\\d+$"
62
+ }
63
+ }
64
+ },
65
+ "taxonomy": {
66
+ "type": "object",
67
+ "additionalProperties": false,
68
+ "required": ["id", "displayName", "transformation", "intendedOutput"],
69
+ "properties": {
70
+ "id": {
71
+ "type": "string",
72
+ "minLength": 1
73
+ },
74
+ "displayName": {
75
+ "type": "string",
76
+ "minLength": 1
77
+ },
78
+ "transformation": {
79
+ "type": "string",
80
+ "minLength": 1
81
+ },
82
+ "intendedOutput": {
83
+ "type": "string",
84
+ "minLength": 1
85
+ }
86
+ }
87
+ },
88
+ "inputs": {
89
+ "type": "array",
90
+ "items": {
91
+ "type": "object",
92
+ "additionalProperties": false,
93
+ "required": ["name", "description", "required"],
94
+ "properties": {
95
+ "name": {
96
+ "type": "string",
97
+ "minLength": 1
98
+ },
99
+ "description": {
100
+ "type": "string",
101
+ "minLength": 1
102
+ },
103
+ "required": {
104
+ "type": "boolean"
105
+ }
106
+ }
107
+ }
108
+ },
109
+ "precedence": {
110
+ "type": "array",
111
+ "minItems": 1,
112
+ "items": {
113
+ "type": "object",
114
+ "additionalProperties": false,
115
+ "required": ["sourceClass", "rank"],
116
+ "properties": {
117
+ "sourceClass": {
118
+ "type": "string"
119
+ },
120
+ "rank": {
121
+ "type": "integer",
122
+ "minimum": 0
123
+ }
124
+ }
125
+ }
126
+ },
127
+ "pipeline": {
128
+ "type": "array",
129
+ "minItems": 1,
130
+ "items": {
131
+ "type": "object",
132
+ "additionalProperties": false,
133
+ "required": ["id", "version"],
134
+ "properties": {
135
+ "id": {
136
+ "type": "string"
137
+ },
138
+ "version": {
139
+ "type": "string",
140
+ "pattern": "^\\d+\\.\\d+\\.\\d+$"
141
+ }
142
+ }
143
+ }
144
+ },
145
+ "output": {
146
+ "type": "object",
147
+ "additionalProperties": false,
148
+ "required": ["schema", "description"],
149
+ "properties": {
150
+ "schema": {
151
+ "type": "string",
152
+ "minLength": 1
153
+ },
154
+ "description": {
155
+ "type": "string",
156
+ "minLength": 1
157
+ }
158
+ }
159
+ },
160
+ "requiredBehavior": {
161
+ "type": "array",
162
+ "items": {
163
+ "type": "string"
164
+ }
165
+ },
166
+ "forbiddenBehavior": {
167
+ "type": "array",
168
+ "items": {
169
+ "type": "string"
170
+ }
171
+ },
172
+ "traceability": {
173
+ "type": "object",
174
+ "additionalProperties": false,
175
+ "required": ["materialClaimsRequireSources", "ledgerFormat", "artifacts"],
176
+ "properties": {
177
+ "materialClaimsRequireSources": {
178
+ "const": true
179
+ },
180
+ "ledgerFormat": {
181
+ "const": "jsonl"
182
+ },
183
+ "artifacts": {
184
+ "const": "content-addressed"
185
+ }
186
+ }
187
+ },
188
+ "evaluation": {
189
+ "type": "object",
190
+ "additionalProperties": false,
191
+ "required": ["criteria"],
192
+ "properties": {
193
+ "criteria": {
194
+ "type": "array",
195
+ "minItems": 1,
196
+ "items": {
197
+ "type": "string",
198
+ "minLength": 1
199
+ }
200
+ }
201
+ }
202
+ }
203
+ }
204
+ }