@synapsor/runner 1.5.4 → 1.6.1
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 +68 -2
- package/README.md +131 -124
- package/dist/authoring.mjs +405 -9
- package/dist/cli.d.ts.map +1 -1
- package/dist/local-ui.d.ts +6 -1
- package/dist/local-ui.d.ts.map +1 -1
- package/dist/runner.mjs +17206 -12169
- package/dist/runtime.mjs +11249 -8542
- package/dist/shadow.mjs +408 -15
- package/docs/README.md +14 -6
- package/docs/aggregate-reads.md +22 -0
- package/docs/app-owned-executors.md +8 -0
- package/docs/auto-boundary-and-scoped-explore.md +338 -0
- package/docs/capability-authoring.md +75 -0
- package/docs/conformance.md +16 -0
- package/docs/current-scope.md +60 -28
- package/docs/cursor-plugin.md +20 -3
- package/docs/dsl-reference.md +78 -0
- package/docs/getting-started-own-database.md +39 -35
- package/docs/limitations.md +37 -7
- package/docs/local-mode.md +22 -3
- package/docs/production.md +19 -0
- package/docs/proposal-evidence-freshness.md +334 -0
- package/docs/release-notes.md +63 -4
- package/docs/runner-config-reference.md +46 -0
- package/docs/schema-api-candidates.md +28 -1
- package/docs/security-boundary.md +17 -0
- package/docs/store-lifecycle.md +8 -0
- package/docs/troubleshooting-first-run.md +174 -0
- package/docs/writeback-executors.md +8 -0
- package/examples/app-owned-writeback/command-handler.mjs +0 -0
- package/examples/auto-boundary-churn/README.md +23 -0
- package/examples/auto-boundary-churn/app/page.tsx +8 -0
- package/examples/auto-boundary-churn/docker-compose.yml +16 -0
- package/examples/auto-boundary-churn/package.json +18 -0
- package/examples/auto-boundary-churn/prisma/schema.prisma +36 -0
- package/examples/auto-boundary-churn/seed/postgres.sql +126 -0
- package/examples/mcp-postgres-billing-app-handler/scripts/run-demo.sh +0 -0
- package/examples/reference-support-billing-app/scripts/run-demo.sh +0 -0
- package/examples/support-billing-agent/scripts/run-demo.sh +0 -0
- package/examples/support-billing-agent/scripts/run-evaluation.sh +0 -0
- package/fixtures/compatibility/published-1.5.4/manifest.json +76 -0
- package/fixtures/compatibility/published-1.5.4/sources/packages/dsl/examples/aggregate-read.synapsor.sql +21 -0
- package/fixtures/compatibility/published-1.5.4/sources/packages/dsl/examples/billing-late-fee.synapsor.sql +56 -0
- package/fixtures/compatibility/published-1.5.4/sources/packages/dsl/examples/bounded-set-multi-term.synapsor.sql +30 -0
- package/fixtures/compatibility/published-1.5.4/sources/packages/dsl/examples/principal-row-scope.synapsor.sql +23 -0
- package/fixtures/compatibility/published-1.5.4/sources/packages/spec/fixtures/conformance/aggregate-read/contract.json +119 -0
- package/fixtures/compatibility/published-1.5.4/sources/packages/spec/fixtures/conformance/approval-quorum/contract.json +44 -0
- package/fixtures/compatibility/published-1.5.4/sources/packages/spec/fixtures/conformance/bounded-set-threats/contract.json +115 -0
- package/fixtures/compatibility/published-1.5.4/sources/packages/spec/fixtures/conformance/principal-row-scope/contract.json +78 -0
- package/fixtures/compatibility/published-1.5.4/sources/packages/spec/fixtures/conformance/proposal-capability/contract.json +101 -0
- package/fixtures/compatibility/published-1.5.4/sources/packages/spec/fixtures/conformance/reversible-change-sets/contract.json +98 -0
- package/fixtures/compatibility/published-1.5.4/sources/packages/spec/fixtures/valid/basic-read.contract.json +60 -0
- package/fixtures/compatibility/published-1.6.0/manifest.json +76 -0
- package/fixtures/compatibility/published-1.6.0/sources/packages/dsl/examples/aggregate-read.synapsor.sql +21 -0
- package/fixtures/compatibility/published-1.6.0/sources/packages/dsl/examples/billing-late-fee.synapsor.sql +56 -0
- package/fixtures/compatibility/published-1.6.0/sources/packages/dsl/examples/bounded-set-multi-term.synapsor.sql +30 -0
- package/fixtures/compatibility/published-1.6.0/sources/packages/dsl/examples/principal-row-scope.synapsor.sql +23 -0
- package/fixtures/compatibility/published-1.6.0/sources/packages/spec/fixtures/conformance/aggregate-read/contract.json +119 -0
- package/fixtures/compatibility/published-1.6.0/sources/packages/spec/fixtures/conformance/approval-quorum/contract.json +44 -0
- package/fixtures/compatibility/published-1.6.0/sources/packages/spec/fixtures/conformance/bounded-set-threats/contract.json +115 -0
- package/fixtures/compatibility/published-1.6.0/sources/packages/spec/fixtures/conformance/principal-row-scope/contract.json +78 -0
- package/fixtures/compatibility/published-1.6.0/sources/packages/spec/fixtures/conformance/proposal-capability/contract.json +101 -0
- package/fixtures/compatibility/published-1.6.0/sources/packages/spec/fixtures/conformance/reversible-change-sets/contract.json +98 -0
- package/fixtures/compatibility/published-1.6.0/sources/packages/spec/fixtures/valid/basic-read.contract.json +60 -0
- package/fixtures/protocol/MANIFEST.json +37 -7
- package/fixtures/protocol/change-set.freshness-update.v2.json +58 -0
- package/fixtures/protocol/freshness-authority.invoice.v1.json +35 -0
- package/fixtures/protocol/freshness-proof.fresh.v1.json +38 -0
- package/fixtures/protocol/writeback-job.freshness-update.v2.json +50 -0
- package/llms.txt +38 -0
- package/package.json +12 -8
- package/schemas/change-set.v1.schema.json +1 -0
- package/schemas/change-set.v2.schema.json +1 -0
- package/schemas/change-set.v3.schema.json +1 -0
- package/schemas/freshness-authority.v1.schema.json +89 -0
- package/schemas/freshness-proof.v1.schema.json +73 -0
- package/schemas/synapsor.runner.schema.json +50 -1
- package/schemas/writeback-job.v1.schema.json +1 -0
- package/schemas/writeback-job.v2.schema.json +1 -0
- package/schemas/writeback-job.v3.schema.json +1 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schemas.synapsor.ai/synapsor.freshness-authority.v1.schema.json",
|
|
4
|
+
"title": "Synapsor Freshness Authority v1",
|
|
5
|
+
"description": "Reviewed, immutable authority for target and supporting-row freshness checks. Digests are validated by the protocol runtime.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": ["schema_version", "required", "target", "dependencies", "dependency_set_digest"],
|
|
9
|
+
"properties": {
|
|
10
|
+
"schema_version": { "const": "synapsor.freshness-authority.v1" },
|
|
11
|
+
"required": { "const": true },
|
|
12
|
+
"target": {
|
|
13
|
+
"type": "object",
|
|
14
|
+
"additionalProperties": false,
|
|
15
|
+
"required": ["mode", "member_count"],
|
|
16
|
+
"properties": {
|
|
17
|
+
"mode": { "enum": ["exact_guard", "frozen_set", "not_applicable"] },
|
|
18
|
+
"member_count": { "type": "integer", "minimum": 0, "maximum": 100 }
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"type": "array",
|
|
23
|
+
"maxItems": 16,
|
|
24
|
+
"items": { "$ref": "#/$defs/dependency" }
|
|
25
|
+
},
|
|
26
|
+
"dependency_set_digest": { "$ref": "#/$defs/sha256" }
|
|
27
|
+
},
|
|
28
|
+
"$defs": {
|
|
29
|
+
"safeIdentifier": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$" },
|
|
30
|
+
"capabilityName": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"pattern": "^[A-Za-z_][A-Za-z0-9_.-]*\\.[A-Za-z_][A-Za-z0-9_.-]*$"
|
|
33
|
+
},
|
|
34
|
+
"sha256": { "type": "string", "pattern": "^sha256:.+" },
|
|
35
|
+
"scalar": { "type": ["string", "number", "boolean", "null"] },
|
|
36
|
+
"columnValue": {
|
|
37
|
+
"type": "object",
|
|
38
|
+
"additionalProperties": false,
|
|
39
|
+
"required": ["column", "value"],
|
|
40
|
+
"properties": {
|
|
41
|
+
"column": { "$ref": "#/$defs/safeIdentifier" },
|
|
42
|
+
"value": { "$ref": "#/$defs/scalar" }
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"dependency": {
|
|
46
|
+
"type": "object",
|
|
47
|
+
"additionalProperties": false,
|
|
48
|
+
"required": [
|
|
49
|
+
"id",
|
|
50
|
+
"capability",
|
|
51
|
+
"source_id",
|
|
52
|
+
"engine",
|
|
53
|
+
"target",
|
|
54
|
+
"expected_version",
|
|
55
|
+
"evidence",
|
|
56
|
+
"descriptor_digest"
|
|
57
|
+
],
|
|
58
|
+
"properties": {
|
|
59
|
+
"id": { "$ref": "#/$defs/safeIdentifier" },
|
|
60
|
+
"capability": { "$ref": "#/$defs/capabilityName" },
|
|
61
|
+
"source_id": { "type": "string", "minLength": 1, "maxLength": 160 },
|
|
62
|
+
"engine": { "enum": ["postgres", "mysql"] },
|
|
63
|
+
"target": {
|
|
64
|
+
"type": "object",
|
|
65
|
+
"additionalProperties": false,
|
|
66
|
+
"required": ["schema", "table", "primary_key", "tenant_column"],
|
|
67
|
+
"properties": {
|
|
68
|
+
"schema": { "$ref": "#/$defs/safeIdentifier" },
|
|
69
|
+
"table": { "$ref": "#/$defs/safeIdentifier" },
|
|
70
|
+
"primary_key": { "$ref": "#/$defs/columnValue" },
|
|
71
|
+
"tenant_column": { "$ref": "#/$defs/safeIdentifier" },
|
|
72
|
+
"principal_column": { "$ref": "#/$defs/safeIdentifier" }
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
"expected_version": { "$ref": "#/$defs/columnValue" },
|
|
76
|
+
"evidence": {
|
|
77
|
+
"type": "object",
|
|
78
|
+
"additionalProperties": false,
|
|
79
|
+
"required": ["bundle_id", "query_fingerprint"],
|
|
80
|
+
"properties": {
|
|
81
|
+
"bundle_id": { "type": "string", "minLength": 1, "maxLength": 200 },
|
|
82
|
+
"query_fingerprint": { "$ref": "#/$defs/sha256" }
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
"descriptor_digest": { "$ref": "#/$defs/sha256" }
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schemas.synapsor.ai/synapsor.freshness-proof.v1.schema.json",
|
|
4
|
+
"title": "Synapsor Freshness Proof v1",
|
|
5
|
+
"description": "Bounded immutable result of a live freshness preflight. Digest and cross-field integrity are validated by the protocol runtime.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": [
|
|
9
|
+
"schema_version",
|
|
10
|
+
"proposal_id",
|
|
11
|
+
"proposal_hash",
|
|
12
|
+
"proposal_version",
|
|
13
|
+
"dependency_set_digest",
|
|
14
|
+
"checked_at",
|
|
15
|
+
"valid_until",
|
|
16
|
+
"source_adapters",
|
|
17
|
+
"result",
|
|
18
|
+
"safe_code",
|
|
19
|
+
"target_count",
|
|
20
|
+
"supporting_count",
|
|
21
|
+
"checks",
|
|
22
|
+
"proof_digest"
|
|
23
|
+
],
|
|
24
|
+
"properties": {
|
|
25
|
+
"schema_version": { "const": "synapsor.freshness-proof.v1" },
|
|
26
|
+
"proposal_id": { "type": "string", "minLength": 1 },
|
|
27
|
+
"proposal_hash": { "$ref": "#/$defs/sha256" },
|
|
28
|
+
"proposal_version": { "type": "integer", "minimum": 1 },
|
|
29
|
+
"dependency_set_digest": { "$ref": "#/$defs/sha256" },
|
|
30
|
+
"checked_at": { "type": "string", "format": "date-time" },
|
|
31
|
+
"valid_until": { "type": "string", "format": "date-time" },
|
|
32
|
+
"source_adapters": {
|
|
33
|
+
"type": "array",
|
|
34
|
+
"minItems": 1,
|
|
35
|
+
"maxItems": 8,
|
|
36
|
+
"items": {
|
|
37
|
+
"type": "object",
|
|
38
|
+
"additionalProperties": false,
|
|
39
|
+
"required": ["source_id", "engine"],
|
|
40
|
+
"properties": {
|
|
41
|
+
"source_id": { "type": "string", "minLength": 1, "maxLength": 160 },
|
|
42
|
+
"engine": { "enum": ["postgres", "mysql"] }
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"result": { "enum": ["fresh", "stale", "unavailable", "invalid", "unsupported"] },
|
|
47
|
+
"safe_code": { "$ref": "#/$defs/safeCode" },
|
|
48
|
+
"target_count": { "type": "integer", "minimum": 0, "maximum": 100 },
|
|
49
|
+
"supporting_count": { "type": "integer", "minimum": 0, "maximum": 16 },
|
|
50
|
+
"checks": {
|
|
51
|
+
"type": "array",
|
|
52
|
+
"maxItems": 116,
|
|
53
|
+
"items": {
|
|
54
|
+
"type": "object",
|
|
55
|
+
"additionalProperties": false,
|
|
56
|
+
"required": ["id", "kind", "status", "safe_code"],
|
|
57
|
+
"properties": {
|
|
58
|
+
"id": { "type": "string", "minLength": 1, "maxLength": 160 },
|
|
59
|
+
"kind": { "enum": ["target", "supporting"] },
|
|
60
|
+
"status": { "enum": ["fresh", "stale", "not_applicable", "unavailable", "invalid", "unsupported"] },
|
|
61
|
+
"safe_code": { "$ref": "#/$defs/safeCode" },
|
|
62
|
+
"expected_version_digest": { "$ref": "#/$defs/sha256" },
|
|
63
|
+
"observed_version_digest": { "$ref": "#/$defs/sha256" }
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"proof_digest": { "$ref": "#/$defs/sha256" }
|
|
68
|
+
},
|
|
69
|
+
"$defs": {
|
|
70
|
+
"sha256": { "type": "string", "pattern": "^sha256:.+" },
|
|
71
|
+
"safeCode": { "type": "string", "pattern": "^[A-Z][A-Z0-9_]*$" }
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -132,6 +132,23 @@
|
|
|
132
132
|
"minLength": 1
|
|
133
133
|
}
|
|
134
134
|
},
|
|
135
|
+
"generated_authority": {
|
|
136
|
+
"description": "Opt-in fail-closed drift enforcement for Auto Boundary and Protect This Query output. Legacy/manual projects omit this object and are not scanned.",
|
|
137
|
+
"type": "object",
|
|
138
|
+
"additionalProperties": false,
|
|
139
|
+
"required": ["generation_lock_path", "enforcement"],
|
|
140
|
+
"properties": {
|
|
141
|
+
"generation_lock_path": {
|
|
142
|
+
"description": "Local generation-lock file. Relative paths resolve from this config file's directory.",
|
|
143
|
+
"type": "string",
|
|
144
|
+
"minLength": 1,
|
|
145
|
+
"not": { "pattern": "://" }
|
|
146
|
+
},
|
|
147
|
+
"enforcement": {
|
|
148
|
+
"const": "required"
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
},
|
|
135
152
|
"capabilities": {
|
|
136
153
|
"description": "Embedded compatibility capabilities. May be empty when contracts supplies the capability catalog.",
|
|
137
154
|
"type": "array",
|
|
@@ -145,6 +162,38 @@
|
|
|
145
162
|
"type": "array",
|
|
146
163
|
"items": { "$ref": "#/$defs/policy" }
|
|
147
164
|
},
|
|
165
|
+
"proposal_freshness": {
|
|
166
|
+
"description": "Optional fail-closed live freshness policy for reviewed proposal capabilities. The model cannot configure or widen these dependencies.",
|
|
167
|
+
"type": "object",
|
|
168
|
+
"propertyNames": { "$ref": "#/$defs/qualified_name" },
|
|
169
|
+
"additionalProperties": {
|
|
170
|
+
"type": "object",
|
|
171
|
+
"additionalProperties": false,
|
|
172
|
+
"required": ["approval"],
|
|
173
|
+
"properties": {
|
|
174
|
+
"approval": {
|
|
175
|
+
"description": "Require a live source freshness proof immediately before every approval decision.",
|
|
176
|
+
"const": "required"
|
|
177
|
+
},
|
|
178
|
+
"dependencies": {
|
|
179
|
+
"description": "Reviewed same-source single-row reads whose exact versions must still match at approval and apply.",
|
|
180
|
+
"type": "array",
|
|
181
|
+
"maxItems": 16,
|
|
182
|
+
"items": {
|
|
183
|
+
"type": "object",
|
|
184
|
+
"additionalProperties": false,
|
|
185
|
+
"required": ["id", "capability", "identity_from_arg", "version_column"],
|
|
186
|
+
"properties": {
|
|
187
|
+
"id": { "$ref": "#/$defs/identifier" },
|
|
188
|
+
"capability": { "$ref": "#/$defs/qualified_name" },
|
|
189
|
+
"identity_from_arg": { "$ref": "#/$defs/identifier" },
|
|
190
|
+
"version_column": { "$ref": "#/$defs/identifier" }
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
},
|
|
148
197
|
"approvals": {
|
|
149
198
|
"description": "Local approval behavior overrides.",
|
|
150
199
|
"type": "object",
|
|
@@ -488,7 +537,7 @@
|
|
|
488
537
|
{
|
|
489
538
|
"type": "object",
|
|
490
539
|
"additionalProperties": false,
|
|
491
|
-
"required": ["mode", "tenant_setting"
|
|
540
|
+
"required": ["mode", "tenant_setting"],
|
|
492
541
|
"properties": {
|
|
493
542
|
"mode": { "const": "postgres_rls" },
|
|
494
543
|
"tenant_setting": {
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"patch": { "$ref": "#/$defs/scalarRecord" },
|
|
22
22
|
"version_advance": { "$ref": "#/$defs/versionAdvance" },
|
|
23
23
|
"frozen_set": { "$ref": "#/$defs/frozenSet" },
|
|
24
|
+
"freshness": { "$ref": "https://schemas.synapsor.ai/synapsor.freshness-authority.v1.schema.json" },
|
|
24
25
|
"idempotency_key": { "type": "string", "minLength": 1 },
|
|
25
26
|
"lease": { "type": "object", "additionalProperties": false, "required": ["lease_id", "attempt", "expires_at"], "properties": { "lease_id": { "type": "string", "minLength": 1 }, "attempt": { "type": "integer", "minimum": 1 }, "expires_at": { "type": "string", "format": "date-time" } } }
|
|
26
27
|
},
|