@synapsor/runner 0.1.16 → 1.1.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.
- package/CHANGELOG.md +47 -1
- package/README.md +59 -3
- package/THREAT_MODEL.md +29 -2
- package/dist/cli.d.ts.map +1 -1
- package/dist/local-ui.d.ts +3 -0
- package/dist/local-ui.d.ts.map +1 -1
- package/dist/runner.mjs +6587 -918
- package/docs/README.md +16 -3
- package/docs/capability-authoring.md +2 -1
- package/docs/conformance.md +5 -0
- package/docs/current-scope.md +6 -2
- package/docs/dsl-reference.md +25 -0
- package/docs/http-mcp.md +45 -1
- package/docs/limitations.md +22 -7
- package/docs/migrating-to-synapsor-spec.md +21 -0
- package/docs/oss-vs-cloud.md +4 -3
- package/docs/production.md +219 -7
- package/docs/release-notes.md +47 -7
- package/docs/release-policy.md +58 -6
- package/docs/runner-config-reference.md +208 -5
- package/docs/running-a-runner-fleet.md +349 -0
- package/examples/runner-fleet/Dockerfile +11 -0
- package/examples/runner-fleet/README.md +52 -0
- package/examples/runner-fleet/docker-compose.yml +76 -0
- package/examples/runner-fleet/mint-dev-token.mjs +19 -0
- package/examples/runner-fleet/seed/mysql.sql +20 -0
- package/examples/runner-fleet/seed/postgres.sql +73 -0
- package/examples/runner-fleet/synapsor.runner.json +105 -0
- package/examples/support-plan-credit/README.md +16 -1
- package/examples/support-plan-credit/contract.synapsor.sql +2 -0
- package/examples/support-plan-credit/synapsor.contract.json +15 -0
- package/fixtures/protocol/MANIFEST.json +1 -1
- package/package.json +3 -1
- package/schemas/change-set.v1.schema.json +2 -1
- package/schemas/synapsor.runner.schema.json +208 -0
|
@@ -58,6 +58,42 @@
|
|
|
58
58
|
"description": "SQLite ledger path. The file can contain visible business-data evidence and is created with owner-only permissions on POSIX.",
|
|
59
59
|
"type": "string",
|
|
60
60
|
"minLength": 1
|
|
61
|
+
},
|
|
62
|
+
"shared_postgres": {
|
|
63
|
+
"description": "Optional shared Postgres ledger. mode=mirror coordinates bounded CLI mutations with a schema-scoped advisory lock while the live runtime store remains local SQLite. mode=runtime_store makes MCP serving use Postgres as the primary proposal/evidence/replay store.",
|
|
64
|
+
"type": "object",
|
|
65
|
+
"additionalProperties": false,
|
|
66
|
+
"required": ["mode", "url_env"],
|
|
67
|
+
"properties": {
|
|
68
|
+
"mode": {
|
|
69
|
+
"type": "string",
|
|
70
|
+
"enum": ["mirror", "runtime_store", "disabled"]
|
|
71
|
+
},
|
|
72
|
+
"url_env": {
|
|
73
|
+
"description": "Environment variable containing the shared ledger Postgres URL. The URL itself must not be stored in config.",
|
|
74
|
+
"type": "string",
|
|
75
|
+
"pattern": "^[A-Z_][A-Z0-9_]*$"
|
|
76
|
+
},
|
|
77
|
+
"schema": {
|
|
78
|
+
"description": "Postgres schema for shared ledger tables.",
|
|
79
|
+
"type": "string",
|
|
80
|
+
"pattern": "^[A-Za-z_][A-Za-z0-9_]*$",
|
|
81
|
+
"default": "synapsor_runner"
|
|
82
|
+
},
|
|
83
|
+
"lock_timeout_ms": {
|
|
84
|
+
"description": "How long mirror-mode CLI commands wait for the schema-scoped advisory lock.",
|
|
85
|
+
"type": "integer",
|
|
86
|
+
"minimum": 0,
|
|
87
|
+
"default": 10000
|
|
88
|
+
},
|
|
89
|
+
"max_entries": {
|
|
90
|
+
"description": "Safety bound for the bounded runtime-store bridge. Operations fail closed rather than copying an unbounded ledger.",
|
|
91
|
+
"type": "integer",
|
|
92
|
+
"minimum": 100,
|
|
93
|
+
"maximum": 100000,
|
|
94
|
+
"default": 10000
|
|
95
|
+
}
|
|
96
|
+
}
|
|
61
97
|
}
|
|
62
98
|
}
|
|
63
99
|
},
|
|
@@ -117,6 +153,129 @@
|
|
|
117
153
|
"disable_auto_approval": { "type": "boolean" }
|
|
118
154
|
}
|
|
119
155
|
},
|
|
156
|
+
"rate_limits": {
|
|
157
|
+
"description": "Operational fixed-window request limits keyed from verified tenant context and reviewed capability. These are deployment controls, not portable contract policy.",
|
|
158
|
+
"type": "object",
|
|
159
|
+
"additionalProperties": false,
|
|
160
|
+
"properties": {
|
|
161
|
+
"enabled": { "type": "boolean", "default": true },
|
|
162
|
+
"default": { "$ref": "#/$defs/rate_limit_rule" },
|
|
163
|
+
"capabilities": {
|
|
164
|
+
"type": "object",
|
|
165
|
+
"propertyNames": { "$ref": "#/$defs/qualified_name" },
|
|
166
|
+
"additionalProperties": { "$ref": "#/$defs/rate_limit_rule" }
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
"metrics": {
|
|
171
|
+
"description": "Scrapeable HTTP metrics. Disabled by default; non-loopback exposure requires a separate bearer token.",
|
|
172
|
+
"type": "object",
|
|
173
|
+
"additionalProperties": false,
|
|
174
|
+
"properties": {
|
|
175
|
+
"enabled": { "type": "boolean" },
|
|
176
|
+
"token_env": { "$ref": "#/$defs/env_name" }
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
"operator_identity": {
|
|
180
|
+
"description": "Operator identity used by approve, reject, and apply. signed_key verifies a registered key; jwt_oidc verifies asymmetric JWT claims and Runner-attests the decision; dev_env is local-development compatibility only.",
|
|
181
|
+
"type": "object",
|
|
182
|
+
"additionalProperties": false,
|
|
183
|
+
"required": ["provider"],
|
|
184
|
+
"allOf": [
|
|
185
|
+
{
|
|
186
|
+
"if": { "properties": { "provider": { "const": "signed_key" } }, "required": ["provider"] },
|
|
187
|
+
"then": { "required": ["operators"] }
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"if": { "properties": { "provider": { "const": "jwt_oidc" } }, "required": ["provider"] },
|
|
191
|
+
"then": {
|
|
192
|
+
"required": ["algorithms"],
|
|
193
|
+
"oneOf": [
|
|
194
|
+
{ "required": ["jwks_url_env"] },
|
|
195
|
+
{ "required": ["public_key_env"] },
|
|
196
|
+
{ "required": ["public_key_path"] }
|
|
197
|
+
]
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
],
|
|
201
|
+
"properties": {
|
|
202
|
+
"provider": { "enum": ["dev_env", "signed_key", "jwt_oidc"] },
|
|
203
|
+
"actor_env": { "$ref": "#/$defs/env_name" },
|
|
204
|
+
"roles_env": { "$ref": "#/$defs/env_name" },
|
|
205
|
+
"apply_roles": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/identifier" } },
|
|
206
|
+
"operators": {
|
|
207
|
+
"type": "object",
|
|
208
|
+
"minProperties": 1,
|
|
209
|
+
"additionalProperties": {
|
|
210
|
+
"type": "object",
|
|
211
|
+
"additionalProperties": false,
|
|
212
|
+
"required": ["public_key_path", "roles"],
|
|
213
|
+
"properties": {
|
|
214
|
+
"public_key_path": { "type": "string", "minLength": 1 },
|
|
215
|
+
"roles": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/identifier" } }
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
"token_env": { "$ref": "#/$defs/env_name" },
|
|
220
|
+
"token_file_env": { "$ref": "#/$defs/env_name" },
|
|
221
|
+
"token_stdin": { "type": "boolean" },
|
|
222
|
+
"roles_claim": { "$ref": "#/$defs/identifier" },
|
|
223
|
+
"subject_claim": { "$ref": "#/$defs/identifier" },
|
|
224
|
+
"attestation_secret_env": { "$ref": "#/$defs/env_name" },
|
|
225
|
+
"algorithms": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "enum": ["RS256", "ES256"] } },
|
|
226
|
+
"jwks_url_env": { "$ref": "#/$defs/env_name" },
|
|
227
|
+
"public_key_env": { "$ref": "#/$defs/env_name" },
|
|
228
|
+
"public_key_path": { "type": "string", "minLength": 1 },
|
|
229
|
+
"issuer": { "type": "string", "minLength": 1 },
|
|
230
|
+
"audience": { "type": "string", "minLength": 1 },
|
|
231
|
+
"clock_skew_seconds": { "type": "integer", "minimum": 0, "maximum": 300 },
|
|
232
|
+
"jwks_cache_seconds": { "type": "integer", "minimum": 1, "maximum": 86400 },
|
|
233
|
+
"jwks_cooldown_seconds": { "type": "integer", "minimum": 1, "maximum": 3600 },
|
|
234
|
+
"fetch_timeout_ms": { "type": "integer", "minimum": 100, "maximum": 30000 },
|
|
235
|
+
"max_response_bytes": { "type": "integer", "minimum": 1024, "maximum": 10485760 }
|
|
236
|
+
}
|
|
237
|
+
},
|
|
238
|
+
"session_auth": {
|
|
239
|
+
"description": "Signed per-session identity for Streamable HTTP http_claims contexts. HS256 is retained for development; asymmetric verification uses only JWKS or public PEM material.",
|
|
240
|
+
"type": "object",
|
|
241
|
+
"additionalProperties": false,
|
|
242
|
+
"required": ["provider"],
|
|
243
|
+
"allOf": [
|
|
244
|
+
{
|
|
245
|
+
"if": { "properties": { "provider": { "const": "jwt_hs256" } }, "required": ["provider"] },
|
|
246
|
+
"then": { "required": ["secret_env"] }
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
"if": { "properties": { "provider": { "const": "jwt_asymmetric" } }, "required": ["provider"] },
|
|
250
|
+
"then": {
|
|
251
|
+
"required": ["algorithms"],
|
|
252
|
+
"oneOf": [
|
|
253
|
+
{ "required": ["jwks_url_env"] },
|
|
254
|
+
{ "required": ["public_key_env"] },
|
|
255
|
+
{ "required": ["public_key_path"] }
|
|
256
|
+
]
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
],
|
|
260
|
+
"properties": {
|
|
261
|
+
"provider": { "enum": ["jwt_hs256", "jwt_asymmetric"] },
|
|
262
|
+
"secret_env": { "$ref": "#/$defs/env_name" },
|
|
263
|
+
"previous_secret_env": { "$ref": "#/$defs/env_name" },
|
|
264
|
+
"algorithms": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "enum": ["HS256", "RS256", "ES256"] } },
|
|
265
|
+
"jwks_url_env": { "$ref": "#/$defs/env_name" },
|
|
266
|
+
"public_key_env": { "$ref": "#/$defs/env_name" },
|
|
267
|
+
"public_key_path": { "type": "string", "minLength": 1 },
|
|
268
|
+
"issuer": { "type": "string", "minLength": 1 },
|
|
269
|
+
"audience": { "type": "string", "minLength": 1 },
|
|
270
|
+
"tenant_claim": { "$ref": "#/$defs/identifier" },
|
|
271
|
+
"principal_claim": { "$ref": "#/$defs/identifier" },
|
|
272
|
+
"clock_skew_seconds": { "type": "integer", "minimum": 0, "maximum": 300 },
|
|
273
|
+
"jwks_cache_seconds": { "type": "integer", "minimum": 1, "maximum": 86400 },
|
|
274
|
+
"jwks_cooldown_seconds": { "type": "integer", "minimum": 1, "maximum": 3600 },
|
|
275
|
+
"fetch_timeout_ms": { "type": "integer", "minimum": 100, "maximum": 30000 },
|
|
276
|
+
"max_response_bytes": { "type": "integer", "minimum": 1024, "maximum": 10485760 }
|
|
277
|
+
}
|
|
278
|
+
},
|
|
120
279
|
"cloud": {
|
|
121
280
|
"type": "object",
|
|
122
281
|
"additionalProperties": false,
|
|
@@ -136,6 +295,15 @@
|
|
|
136
295
|
}
|
|
137
296
|
},
|
|
138
297
|
"$defs": {
|
|
298
|
+
"rate_limit_rule": {
|
|
299
|
+
"type": "object",
|
|
300
|
+
"additionalProperties": false,
|
|
301
|
+
"required": ["requests", "window_seconds"],
|
|
302
|
+
"properties": {
|
|
303
|
+
"requests": { "type": "integer", "minimum": 1, "maximum": 1000000 },
|
|
304
|
+
"window_seconds": { "type": "integer", "minimum": 1, "maximum": 86400 }
|
|
305
|
+
}
|
|
306
|
+
},
|
|
139
307
|
"env_name": {
|
|
140
308
|
"type": "string",
|
|
141
309
|
"pattern": "^[A-Z_][A-Z0-9_]*$"
|
|
@@ -176,6 +344,17 @@
|
|
|
176
344
|
"type": "integer",
|
|
177
345
|
"minimum": 1
|
|
178
346
|
},
|
|
347
|
+
"pool": {
|
|
348
|
+
"type": "object",
|
|
349
|
+
"additionalProperties": false,
|
|
350
|
+
"properties": {
|
|
351
|
+
"max_connections": { "type": "integer", "minimum": 1, "maximum": 1000 },
|
|
352
|
+
"connection_timeout_ms": { "type": "integer", "minimum": 100, "maximum": 300000 },
|
|
353
|
+
"idle_timeout_ms": { "type": "integer", "minimum": 100, "maximum": 3600000 },
|
|
354
|
+
"queue_timeout_ms": { "type": "integer", "minimum": 100, "maximum": 300000 },
|
|
355
|
+
"queue_limit": { "type": "integer", "minimum": 0, "maximum": 100000 }
|
|
356
|
+
}
|
|
357
|
+
},
|
|
179
358
|
"ssl": {
|
|
180
359
|
"type": "object",
|
|
181
360
|
"additionalProperties": true
|
|
@@ -366,6 +545,11 @@
|
|
|
366
545
|
"required_role": {
|
|
367
546
|
"type": "string"
|
|
368
547
|
},
|
|
548
|
+
"required_approvals": {
|
|
549
|
+
"type": "integer",
|
|
550
|
+
"minimum": 1,
|
|
551
|
+
"maximum": 10
|
|
552
|
+
},
|
|
369
553
|
"policy": {
|
|
370
554
|
"type": "string",
|
|
371
555
|
"minLength": 1
|
|
@@ -521,6 +705,30 @@
|
|
|
521
705
|
"max": { "type": "integer", "minimum": 0 }
|
|
522
706
|
}
|
|
523
707
|
}
|
|
708
|
+
},
|
|
709
|
+
"limits": {
|
|
710
|
+
"description": "Reviewed aggregate ceilings for policy auto-approval. Exceeding one falls back to human review.",
|
|
711
|
+
"type": "array",
|
|
712
|
+
"minItems": 1,
|
|
713
|
+
"items": {
|
|
714
|
+
"type": "object",
|
|
715
|
+
"additionalProperties": false,
|
|
716
|
+
"required": ["kind", "max", "period"],
|
|
717
|
+
"allOf": [
|
|
718
|
+
{
|
|
719
|
+
"if": { "properties": { "kind": { "const": "total" } }, "required": ["kind"] },
|
|
720
|
+
"then": { "required": ["field"] },
|
|
721
|
+
"else": { "not": { "required": ["field"] } }
|
|
722
|
+
}
|
|
723
|
+
],
|
|
724
|
+
"properties": {
|
|
725
|
+
"kind": { "enum": ["count", "total"] },
|
|
726
|
+
"max": { "type": "integer", "minimum": 0 },
|
|
727
|
+
"period": { "const": "day" },
|
|
728
|
+
"field": { "$ref": "#/$defs/identifier" },
|
|
729
|
+
"scope": { "enum": ["tenant_policy", "tenant_policy_object"] }
|
|
730
|
+
}
|
|
731
|
+
}
|
|
524
732
|
}
|
|
525
733
|
}
|
|
526
734
|
}
|