@synapsor/runner 1.4.121 → 1.4.123
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 +42 -0
- package/README.md +25 -15
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/runner.mjs +2855 -347
- package/docs/README.md +1 -0
- package/docs/capability-authoring.md +59 -1
- package/docs/cloud-cli.md +248 -0
- package/docs/cloud-mode.md +88 -6
- package/docs/cloud-push.md +22 -5
- package/docs/conformance.md +6 -0
- package/docs/contract-review.md +33 -0
- package/docs/contract-testing.md +30 -1
- package/docs/dsl-reference.md +11 -0
- package/docs/hosted-cloud-linked-verification.md +97 -0
- package/docs/oss-vs-cloud.md +13 -6
- package/docs/release-notes.md +48 -0
- package/docs/rfcs/007-trusted-principal-row-scope.md +75 -0
- package/docs/runner-bundles.md +24 -0
- package/docs/running-a-runner-fleet.md +8 -0
- package/docs/security-boundary.md +19 -2
- package/examples/runner-fleet/seed/mysql.sql +5 -1
- package/examples/runner-fleet/seed/postgres.sql +5 -1
- package/examples/support-plan-credit/README.md +8 -6
- package/fixtures/contracts/capability-surface-fitness.contract.json +190 -0
- package/fixtures/dsl/principal-row-scope.synapsor.sql +23 -0
- package/fixtures/protocol/MANIFEST.json +10 -10
- package/package.json +1 -1
- package/schemas/change-set.v1.schema.json +14 -0
- package/schemas/change-set.v2.schema.json +14 -0
- package/schemas/change-set.v3.schema.json +2 -0
- package/schemas/compensation-change-set.v1.schema.json +3 -2
- package/schemas/inverse-descriptor.v1.schema.json +2 -0
- package/schemas/synapsor.contract-tests.schema.json +11 -1
- package/schemas/writeback-job.v1.schema.json +14 -0
- package/schemas/writeback-job.v2.schema.json +14 -0
- package/schemas/writeback-job.v3.schema.json +2 -0
- package/schemas/writeback-job.v4.schema.json +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema_version": "synapsor.protocol-manifest.v1",
|
|
3
3
|
"protocol_set": "database-mcp-writeback",
|
|
4
|
-
"version": "1.4.
|
|
4
|
+
"version": "1.4.1",
|
|
5
5
|
"hash_algorithm": "sha256",
|
|
6
6
|
"note": "This manifest is copied in Synapsor main protocol/MANIFEST.json and synapsor-runner fixtures/protocol/MANIFEST.json. Hashes are over the checked-in JSON artifact bytes.",
|
|
7
7
|
"artifacts": [
|
|
@@ -113,22 +113,22 @@
|
|
|
113
113
|
{
|
|
114
114
|
"kind": "schema",
|
|
115
115
|
"name": "change-set.v1.schema.json",
|
|
116
|
-
"sha256": "
|
|
116
|
+
"sha256": "18f76efd97424efab986b6fb0af87ad0eeafd4314393ed7f83f14afe09d625eb"
|
|
117
117
|
},
|
|
118
118
|
{
|
|
119
119
|
"kind": "schema",
|
|
120
120
|
"name": "change-set.v2.schema.json",
|
|
121
|
-
"sha256": "
|
|
121
|
+
"sha256": "bd9999361258c5554ffa2791d7c6469beffc5b875e775f5f0c80cea36132eaa4"
|
|
122
122
|
},
|
|
123
123
|
{
|
|
124
124
|
"kind": "schema",
|
|
125
125
|
"name": "change-set.v3.schema.json",
|
|
126
|
-
"sha256": "
|
|
126
|
+
"sha256": "24a45eb4d9f29ab4cfe408bedeb0216dc29544fe39b515918d0c0f9742bba9cb"
|
|
127
127
|
},
|
|
128
128
|
{
|
|
129
129
|
"kind": "schema",
|
|
130
130
|
"name": "compensation-change-set.v1.schema.json",
|
|
131
|
-
"sha256": "
|
|
131
|
+
"sha256": "6353ddd1a030d0cd25c1663c96794d5420bc1002f46aacdef58c346238a90450"
|
|
132
132
|
},
|
|
133
133
|
{
|
|
134
134
|
"kind": "schema",
|
|
@@ -153,7 +153,7 @@
|
|
|
153
153
|
{
|
|
154
154
|
"kind": "schema",
|
|
155
155
|
"name": "inverse-descriptor.v1.schema.json",
|
|
156
|
-
"sha256": "
|
|
156
|
+
"sha256": "6f310b11946196cf8c829bcf5be39864d5e3bd85181ae2a3a277bfa6fd72a553"
|
|
157
157
|
},
|
|
158
158
|
{
|
|
159
159
|
"kind": "schema",
|
|
@@ -163,22 +163,22 @@
|
|
|
163
163
|
{
|
|
164
164
|
"kind": "schema",
|
|
165
165
|
"name": "writeback-job.v1.schema.json",
|
|
166
|
-
"sha256": "
|
|
166
|
+
"sha256": "64238559297805e13c04cb8bf71be433e6fb1241594ca021415b1efb95214a01"
|
|
167
167
|
},
|
|
168
168
|
{
|
|
169
169
|
"kind": "schema",
|
|
170
170
|
"name": "writeback-job.v2.schema.json",
|
|
171
|
-
"sha256": "
|
|
171
|
+
"sha256": "68110a5ed5b7867522cf86db8d177d2df3f96a458a4343bb77537bdcf304279b"
|
|
172
172
|
},
|
|
173
173
|
{
|
|
174
174
|
"kind": "schema",
|
|
175
175
|
"name": "writeback-job.v3.schema.json",
|
|
176
|
-
"sha256": "
|
|
176
|
+
"sha256": "3bd46747e737e79bff90dc0496c270bc93d6a913db750ea00486be9a45714831"
|
|
177
177
|
},
|
|
178
178
|
{
|
|
179
179
|
"kind": "schema",
|
|
180
180
|
"name": "writeback-job.v4.schema.json",
|
|
181
|
-
"sha256": "
|
|
181
|
+
"sha256": "2c0d23cdf12f6a0d70c5f38fb4fcc5842f2b6c184ee1a195344ae42f58baf4ca"
|
|
182
182
|
}
|
|
183
183
|
]
|
|
184
184
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synapsor/runner",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.123",
|
|
4
4
|
"description": "Stop giving AI agents execute_sql; expose reviewed Postgres/MySQL MCP actions with proposals, approval, writeback, and replay.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -70,6 +70,7 @@
|
|
|
70
70
|
"required": ["tenant", "allowed_columns", "expected_version"],
|
|
71
71
|
"properties": {
|
|
72
72
|
"tenant": { "$ref": "#/$defs/columnValue" },
|
|
73
|
+
"principal_scope": { "$ref": "#/$defs/principalScope" },
|
|
73
74
|
"allowed_columns": {
|
|
74
75
|
"type": "array",
|
|
75
76
|
"items": { "$ref": "#/$defs/safeIdentifier" },
|
|
@@ -136,6 +137,19 @@
|
|
|
136
137
|
"column": { "$ref": "#/$defs/safeIdentifier" },
|
|
137
138
|
"value": { "$ref": "#/$defs/scalar" }
|
|
138
139
|
}
|
|
140
|
+
},
|
|
141
|
+
"principalScope": {
|
|
142
|
+
"type": "object",
|
|
143
|
+
"additionalProperties": false,
|
|
144
|
+
"required": ["schema_version", "column", "binding", "provider", "value_fingerprint"],
|
|
145
|
+
"properties": {
|
|
146
|
+
"schema_version": { "const": "synapsor.principal-scope.v1" },
|
|
147
|
+
"column": { "$ref": "#/$defs/safeIdentifier" },
|
|
148
|
+
"binding": { "$ref": "#/$defs/safeIdentifier" },
|
|
149
|
+
"provider": { "enum": ["environment", "http_claims", "cloud_session", "static_dev"] },
|
|
150
|
+
"value_fingerprint": { "type": "string", "pattern": "^sha256:.+" },
|
|
151
|
+
"value": { "$ref": "#/$defs/scalar" }
|
|
152
|
+
}
|
|
139
153
|
}
|
|
140
154
|
}
|
|
141
155
|
}
|
|
@@ -80,6 +80,7 @@
|
|
|
80
80
|
"required": ["tenant", "allowed_columns"],
|
|
81
81
|
"properties": {
|
|
82
82
|
"tenant": { "$ref": "#/$defs/columnValue" },
|
|
83
|
+
"principal_scope": { "$ref": "#/$defs/principalScope" },
|
|
83
84
|
"allowed_columns": {
|
|
84
85
|
"type": "array",
|
|
85
86
|
"items": { "$ref": "#/$defs/safeIdentifier" },
|
|
@@ -209,6 +210,19 @@
|
|
|
209
210
|
"value": { "$ref": "#/$defs/scalar" }
|
|
210
211
|
}
|
|
211
212
|
},
|
|
213
|
+
"principalScope": {
|
|
214
|
+
"type": "object",
|
|
215
|
+
"additionalProperties": false,
|
|
216
|
+
"required": ["schema_version", "column", "binding", "provider", "value_fingerprint"],
|
|
217
|
+
"properties": {
|
|
218
|
+
"schema_version": { "const": "synapsor.principal-scope.v1" },
|
|
219
|
+
"column": { "$ref": "#/$defs/safeIdentifier" },
|
|
220
|
+
"binding": { "$ref": "#/$defs/safeIdentifier" },
|
|
221
|
+
"provider": { "enum": ["environment", "http_claims", "cloud_session", "static_dev"] },
|
|
222
|
+
"value_fingerprint": { "$ref": "#/$defs/sha256" },
|
|
223
|
+
"value": { "$ref": "#/$defs/scalar" }
|
|
224
|
+
}
|
|
225
|
+
},
|
|
212
226
|
"versionAdvance": {
|
|
213
227
|
"type": "object",
|
|
214
228
|
"additionalProperties": false,
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"type": "object", "additionalProperties": false, "required": ["tenant", "allowed_columns"],
|
|
38
38
|
"properties": {
|
|
39
39
|
"tenant": { "$ref": "#/$defs/columnValue" },
|
|
40
|
+
"principal_scope": { "$ref": "#/$defs/principalScope" },
|
|
40
41
|
"allowed_columns": { "type": "array", "items": { "$ref": "#/$defs/safeIdentifier" }, "maxItems": 256, "uniqueItems": true },
|
|
41
42
|
"version_advance": { "$ref": "#/$defs/versionAdvance" }
|
|
42
43
|
}
|
|
@@ -96,6 +97,7 @@
|
|
|
96
97
|
"scalarRecord": { "type": "object", "propertyNames": { "$ref": "#/$defs/safeIdentifier" }, "additionalProperties": { "$ref": "#/$defs/scalar" }, "maxProperties": 256 },
|
|
97
98
|
"setOperation": { "enum": ["set_update", "set_delete", "batch_insert"] },
|
|
98
99
|
"columnValue": { "type": "object", "additionalProperties": false, "required": ["column", "value"], "properties": { "column": { "$ref": "#/$defs/safeIdentifier" }, "value": { "$ref": "#/$defs/scalar" } } },
|
|
100
|
+
"principalScope": { "type": "object", "additionalProperties": false, "required": ["schema_version", "column", "binding", "provider", "value_fingerprint"], "properties": { "schema_version": { "const": "synapsor.principal-scope.v1" }, "column": { "$ref": "#/$defs/safeIdentifier" }, "binding": { "$ref": "#/$defs/safeIdentifier" }, "provider": { "enum": ["environment", "http_claims", "cloud_session", "static_dev"] }, "value_fingerprint": { "$ref": "#/$defs/sha256" }, "value": { "$ref": "#/$defs/scalar" } } },
|
|
99
101
|
"versionAdvance": { "type": "object", "additionalProperties": false, "required": ["column", "strategy"], "properties": { "column": { "$ref": "#/$defs/safeIdentifier" }, "strategy": { "enum": ["integer_increment", "database_generated"] } } },
|
|
100
102
|
"deduplicationComponent": { "type": "object", "additionalProperties": false, "required": ["column", "value", "source"], "properties": { "column": { "$ref": "#/$defs/safeIdentifier" }, "value": { "$ref": "#/$defs/scalar" }, "source": { "enum": ["proposal_id", "trusted_tenant", "fixed"] } } },
|
|
101
103
|
"deduplication": { "type": "object", "additionalProperties": false, "required": ["components"], "properties": { "components": { "type": "array", "items": { "$ref": "#/$defs/deduplicationComponent" }, "minItems": 1, "maxItems": 8 } } },
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"source": { "type": "object", "additionalProperties": false, "required": ["kind", "source_id", "schema", "table", "primary_key"], "properties": { "kind": { "enum": ["external_postgres", "external_mysql"] }, "source_id": { "type": "string", "minLength": 1 }, "schema": { "$ref": "#/$defs/identifier" }, "table": { "$ref": "#/$defs/identifier" }, "primary_key": { "type": "object", "additionalProperties": false, "required": ["column"], "properties": { "column": { "$ref": "#/$defs/identifier" }, "value": { "$ref": "#/$defs/scalar" } } } } },
|
|
17
17
|
"before": { "$ref": "#/$defs/record" }, "patch": { "$ref": "#/$defs/record" }, "after": { "$ref": "#/$defs/record" },
|
|
18
18
|
"compensation": { "type": "object", "additionalProperties": false, "required": ["descriptor", "forward_receipt_hash"], "properties": { "descriptor": { "$ref": "inverse-descriptor.v1.schema.json" }, "forward_receipt_hash": { "$ref": "#/$defs/sha256" } } },
|
|
19
|
-
"guards": { "type": "object", "additionalProperties": false, "required": ["tenant", "allowed_columns"], "properties": { "tenant": { "$ref": "#/$defs/columnValue" }, "allowed_columns": { "type": "array", "items": { "$ref": "#/$defs/identifier" }, "maxItems": 256, "uniqueItems": true } } },
|
|
19
|
+
"guards": { "type": "object", "additionalProperties": false, "required": ["tenant", "allowed_columns"], "properties": { "tenant": { "$ref": "#/$defs/columnValue" }, "principal_scope": { "$ref": "#/$defs/principalScope" }, "allowed_columns": { "type": "array", "items": { "$ref": "#/$defs/identifier" }, "maxItems": 256, "uniqueItems": true } } },
|
|
20
20
|
"evidence": { "type": "object", "required": ["bundle_id", "query_fingerprint", "items"], "properties": { "bundle_id": { "type": "string", "minLength": 1 }, "query_fingerprint": { "$ref": "#/$defs/sha256" }, "items": { "type": "array", "maxItems": 100 } } },
|
|
21
21
|
"approval": { "type": "object", "required": ["status", "mode"], "properties": { "status": { "enum": ["pending", "approved", "rejected", "canceled"] }, "mode": { "enum": ["human", "operator"] }, "required_role": { "type": "string", "minLength": 1 }, "required_approvals": { "type": "integer", "minimum": 1, "maximum": 10 } } },
|
|
22
22
|
"writeback": { "type": "object", "additionalProperties": false, "required": ["status", "mode", "executor"], "properties": { "status": { "const": "not_applied" }, "mode": { "const": "trusted_worker_required" }, "executor": { "const": "sql_update" } } },
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"$defs": {
|
|
28
28
|
"identifier": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$" }, "sha256": { "type": "string", "pattern": "^sha256:.+" }, "scalar": { "type": ["string", "number", "boolean", "null"] },
|
|
29
29
|
"record": { "type": "object", "propertyNames": { "$ref": "#/$defs/identifier" }, "additionalProperties": { "$ref": "#/$defs/scalar" }, "maxProperties": 256 },
|
|
30
|
-
"columnValue": { "type": "object", "additionalProperties": false, "required": ["column", "value"], "properties": { "column": { "$ref": "#/$defs/identifier" }, "value": { "$ref": "#/$defs/scalar" } } }
|
|
30
|
+
"columnValue": { "type": "object", "additionalProperties": false, "required": ["column", "value"], "properties": { "column": { "$ref": "#/$defs/identifier" }, "value": { "$ref": "#/$defs/scalar" } } },
|
|
31
|
+
"principalScope": { "type": "object", "additionalProperties": false, "required": ["schema_version", "column", "binding", "provider", "value_fingerprint"], "properties": { "schema_version": { "const": "synapsor.principal-scope.v1" }, "column": { "$ref": "#/$defs/identifier" }, "binding": { "$ref": "#/$defs/identifier" }, "provider": { "enum": ["environment", "http_claims", "cloud_session", "static_dev"] }, "value_fingerprint": { "$ref": "#/$defs/sha256" }, "value": { "$ref": "#/$defs/scalar" } } }
|
|
31
32
|
}
|
|
32
33
|
}
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"properties": { "source_id": { "type": "string", "minLength": 1 }, "schema": { "$ref": "#/$defs/identifier" }, "table": { "$ref": "#/$defs/identifier" }, "primary_key_column": { "$ref": "#/$defs/identifier" } }
|
|
20
20
|
},
|
|
21
21
|
"tenant_guard": { "$ref": "#/$defs/columnValue" },
|
|
22
|
+
"principal_scope": { "$ref": "#/$defs/principalScope" },
|
|
22
23
|
"allowed_columns": { "type": "array", "items": { "$ref": "#/$defs/identifier" }, "maxItems": 256, "uniqueItems": true },
|
|
23
24
|
"members": { "type": "array", "minItems": 1, "maxItems": 100, "items": { "$ref": "#/$defs/member" } },
|
|
24
25
|
"max_rows": { "type": "integer", "minimum": 1, "maximum": 100 },
|
|
@@ -38,6 +39,7 @@
|
|
|
38
39
|
"scalar": { "type": ["string", "number", "boolean", "null"] },
|
|
39
40
|
"record": { "type": "object", "propertyNames": { "$ref": "#/$defs/identifier" }, "additionalProperties": { "$ref": "#/$defs/scalar" }, "maxProperties": 256 },
|
|
40
41
|
"columnValue": { "type": "object", "additionalProperties": false, "required": ["column", "value"], "properties": { "column": { "$ref": "#/$defs/identifier" }, "value": { "$ref": "#/$defs/scalar" } } },
|
|
42
|
+
"principalScope": { "type": "object", "additionalProperties": false, "required": ["schema_version", "column", "binding", "provider", "value_fingerprint"], "properties": { "schema_version": { "const": "synapsor.principal-scope.v1" }, "column": { "$ref": "#/$defs/identifier" }, "binding": { "$ref": "#/$defs/identifier" }, "provider": { "enum": ["environment", "http_claims", "cloud_session", "static_dev"] }, "value_fingerprint": { "type": "string", "pattern": "^sha256:.+" }, "value": { "$ref": "#/$defs/scalar" } } },
|
|
41
43
|
"member": { "type": "object", "additionalProperties": false, "required": ["primary_key", "expected_state"], "properties": { "primary_key": { "$ref": "#/$defs/columnValue" }, "expected_state": { "$ref": "#/$defs/record" }, "restore_values": { "$ref": "#/$defs/record" } } },
|
|
42
44
|
"versionAdvance": { "type": "object", "additionalProperties": false, "required": ["column", "strategy"], "properties": { "column": { "$ref": "#/$defs/identifier" }, "strategy": { "enum": ["integer_increment", "database_generated"] } } },
|
|
43
45
|
"aggregateBound": { "type": "object", "additionalProperties": false, "required": ["column", "measure", "maximum", "actual"], "properties": { "column": { "$ref": "#/$defs/identifier" }, "measure": { "enum": ["before", "after", "absolute_delta"] }, "maximum": { "type": "number", "minimum": 0 }, "actual": { "type": "number", "minimum": 0 } } },
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"properties": {
|
|
20
20
|
"id": { "type": "string", "minLength": 1 },
|
|
21
21
|
"kind": {
|
|
22
|
-
"enum": ["tool_allow", "tool_deny", "hide_fields", "argument_constraint", "transition_guard", "set_cap", "source_unchanged_before_approval", "operator_boundary"]
|
|
22
|
+
"enum": ["tool_allow", "tool_deny", "cross_principal_deny", "hide_fields", "argument_constraint", "transition_guard", "set_cap", "source_unchanged_before_approval", "operator_boundary"]
|
|
23
23
|
},
|
|
24
24
|
"capability": { "type": "string", "minLength": 1 },
|
|
25
25
|
"args": { "type": "object" },
|
|
@@ -33,6 +33,16 @@
|
|
|
33
33
|
"provenance": { "enum": ["environment", "static_dev", "http_claims", "cloud_session"] }
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
|
+
"other_trusted_context": {
|
|
37
|
+
"type": "object",
|
|
38
|
+
"additionalProperties": false,
|
|
39
|
+
"required": ["tenant_id", "principal"],
|
|
40
|
+
"properties": {
|
|
41
|
+
"tenant_id": { "type": "string", "minLength": 1 },
|
|
42
|
+
"principal": { "type": "string", "minLength": 1 },
|
|
43
|
+
"provenance": { "enum": ["environment", "static_dev", "http_claims", "cloud_session"] }
|
|
44
|
+
}
|
|
45
|
+
},
|
|
36
46
|
"expected_code": { "type": "string", "minLength": 1 },
|
|
37
47
|
"fields": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1 }, "uniqueItems": true },
|
|
38
48
|
"argument": { "type": "string", "minLength": 1 },
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
}
|
|
50
50
|
},
|
|
51
51
|
"tenant_guard": { "$ref": "#/$defs/columnValue" },
|
|
52
|
+
"principal_scope": { "$ref": "#/$defs/principalScope" },
|
|
52
53
|
"allowed_columns": {
|
|
53
54
|
"type": "array",
|
|
54
55
|
"items": { "$ref": "#/$defs/safeIdentifier" },
|
|
@@ -116,6 +117,19 @@
|
|
|
116
117
|
"column": { "$ref": "#/$defs/safeIdentifier" },
|
|
117
118
|
"value": { "$ref": "#/$defs/scalar" }
|
|
118
119
|
}
|
|
120
|
+
},
|
|
121
|
+
"principalScope": {
|
|
122
|
+
"type": "object",
|
|
123
|
+
"additionalProperties": false,
|
|
124
|
+
"required": ["schema_version", "column", "binding", "provider", "value_fingerprint"],
|
|
125
|
+
"properties": {
|
|
126
|
+
"schema_version": { "const": "synapsor.principal-scope.v1" },
|
|
127
|
+
"column": { "$ref": "#/$defs/safeIdentifier" },
|
|
128
|
+
"binding": { "$ref": "#/$defs/safeIdentifier" },
|
|
129
|
+
"provider": { "enum": ["environment", "http_claims", "cloud_session", "static_dev"] },
|
|
130
|
+
"value_fingerprint": { "type": "string", "pattern": "^sha256:.+" },
|
|
131
|
+
"value": { "$ref": "#/$defs/scalar" }
|
|
132
|
+
}
|
|
119
133
|
}
|
|
120
134
|
}
|
|
121
135
|
}
|
|
@@ -54,6 +54,7 @@
|
|
|
54
54
|
}
|
|
55
55
|
},
|
|
56
56
|
"tenant_guard": { "$ref": "#/$defs/columnValue" },
|
|
57
|
+
"principal_scope": { "$ref": "#/$defs/principalScope" },
|
|
57
58
|
"allowed_columns": {
|
|
58
59
|
"type": "array",
|
|
59
60
|
"items": { "$ref": "#/$defs/safeIdentifier" },
|
|
@@ -173,6 +174,19 @@
|
|
|
173
174
|
"value": { "$ref": "#/$defs/scalar" }
|
|
174
175
|
}
|
|
175
176
|
},
|
|
177
|
+
"principalScope": {
|
|
178
|
+
"type": "object",
|
|
179
|
+
"additionalProperties": false,
|
|
180
|
+
"required": ["schema_version", "column", "binding", "provider", "value_fingerprint"],
|
|
181
|
+
"properties": {
|
|
182
|
+
"schema_version": { "const": "synapsor.principal-scope.v1" },
|
|
183
|
+
"column": { "$ref": "#/$defs/safeIdentifier" },
|
|
184
|
+
"binding": { "$ref": "#/$defs/safeIdentifier" },
|
|
185
|
+
"provider": { "enum": ["environment", "http_claims", "cloud_session", "static_dev"] },
|
|
186
|
+
"value_fingerprint": { "$ref": "#/$defs/sha256" },
|
|
187
|
+
"value": { "$ref": "#/$defs/scalar" }
|
|
188
|
+
}
|
|
189
|
+
},
|
|
176
190
|
"conflictGuard": {
|
|
177
191
|
"oneOf": [
|
|
178
192
|
{
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
"operation": { "enum": ["set_update", "set_delete", "batch_insert"] },
|
|
17
17
|
"target": { "type": "object", "additionalProperties": false, "required": ["schema", "table", "primary_key"], "properties": { "schema": { "$ref": "#/$defs/safeIdentifier" }, "table": { "$ref": "#/$defs/safeIdentifier" }, "primary_key": { "type": "object", "additionalProperties": false, "required": ["column"], "properties": { "column": { "$ref": "#/$defs/safeIdentifier" } } } } },
|
|
18
18
|
"tenant_guard": { "$ref": "#/$defs/columnValue" },
|
|
19
|
+
"principal_scope": { "$ref": "#/$defs/principalScope" },
|
|
19
20
|
"allowed_columns": { "type": "array", "items": { "$ref": "#/$defs/safeIdentifier" }, "maxItems": 256, "uniqueItems": true },
|
|
20
21
|
"patch": { "$ref": "#/$defs/scalarRecord" },
|
|
21
22
|
"version_advance": { "$ref": "#/$defs/versionAdvance" },
|
|
@@ -43,6 +44,7 @@
|
|
|
43
44
|
"scalar": { "type": ["string", "number", "boolean", "null"] },
|
|
44
45
|
"scalarRecord": { "type": "object", "propertyNames": { "$ref": "#/$defs/safeIdentifier" }, "additionalProperties": { "$ref": "#/$defs/scalar" }, "maxProperties": 256 },
|
|
45
46
|
"columnValue": { "type": "object", "additionalProperties": false, "required": ["column", "value"], "properties": { "column": { "$ref": "#/$defs/safeIdentifier" }, "value": { "$ref": "#/$defs/scalar" } } },
|
|
47
|
+
"principalScope": { "type": "object", "additionalProperties": false, "required": ["schema_version", "column", "binding", "provider", "value_fingerprint"], "properties": { "schema_version": { "const": "synapsor.principal-scope.v1" }, "column": { "$ref": "#/$defs/safeIdentifier" }, "binding": { "$ref": "#/$defs/safeIdentifier" }, "provider": { "enum": ["environment", "http_claims", "cloud_session", "static_dev"] }, "value_fingerprint": { "$ref": "#/$defs/sha256" }, "value": { "$ref": "#/$defs/scalar" } } },
|
|
46
48
|
"versionAdvance": { "type": "object", "additionalProperties": false, "required": ["column", "strategy"], "properties": { "column": { "$ref": "#/$defs/safeIdentifier" }, "strategy": { "enum": ["integer_increment", "database_generated"] } } },
|
|
47
49
|
"deduplicationComponent": { "type": "object", "additionalProperties": false, "required": ["column", "value", "source"], "properties": { "column": { "$ref": "#/$defs/safeIdentifier" }, "value": { "$ref": "#/$defs/scalar" }, "source": { "enum": ["proposal_id", "trusted_tenant", "fixed"] } } },
|
|
48
50
|
"deduplication": { "type": "object", "additionalProperties": false, "required": ["components"], "properties": { "components": { "type": "array", "items": { "$ref": "#/$defs/deduplicationComponent" }, "minItems": 1, "maxItems": 8 } } },
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
"runner_scope": { "type": "object", "additionalProperties": false, "required": ["project_id", "source_id"], "properties": { "project_id": { "type": "string", "minLength": 1 }, "source_id": { "type": "string", "minLength": 1 } } },
|
|
10
10
|
"engine": { "enum": ["postgres", "mysql"] }, "operation": { "enum": ["restore_update", "remove_insert", "restore_insert"] },
|
|
11
11
|
"target": { "type": "object", "additionalProperties": false, "required": ["schema", "table", "primary_key"], "properties": { "schema": { "$ref": "#/$defs/identifier" }, "table": { "$ref": "#/$defs/identifier" }, "primary_key": { "type": "object", "additionalProperties": false, "required": ["column"], "properties": { "column": { "$ref": "#/$defs/identifier" }, "value": { "$ref": "#/$defs/scalar" } } } } },
|
|
12
|
-
"tenant_guard": { "$ref": "#/$defs/columnValue" }, "allowed_columns": { "type": "array", "items": { "$ref": "#/$defs/identifier" }, "maxItems": 256, "uniqueItems": true }, "patch": { "type": "object", "maxProperties": 0 },
|
|
12
|
+
"tenant_guard": { "$ref": "#/$defs/columnValue" }, "principal_scope": { "$ref": "#/$defs/principalScope" }, "allowed_columns": { "type": "array", "items": { "$ref": "#/$defs/identifier" }, "maxItems": 256, "uniqueItems": true }, "patch": { "type": "object", "maxProperties": 0 },
|
|
13
13
|
"compensation": { "$ref": "inverse-descriptor.v1.schema.json" }, "forward_receipt_hash": { "$ref": "#/$defs/sha256" }, "idempotency_key": { "type": "string", "minLength": 1 },
|
|
14
14
|
"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" } } }
|
|
15
15
|
},
|
|
16
|
-
"$defs": { "identifier": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$" }, "sha256": { "type": "string", "pattern": "^sha256:.+" }, "scalar": { "type": ["string", "number", "boolean", "null"] }, "columnValue": { "type": "object", "additionalProperties": false, "required": ["column", "value"], "properties": { "column": { "$ref": "#/$defs/identifier" }, "value": { "$ref": "#/$defs/scalar" } } } }
|
|
16
|
+
"$defs": { "identifier": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$" }, "sha256": { "type": "string", "pattern": "^sha256:.+" }, "scalar": { "type": ["string", "number", "boolean", "null"] }, "columnValue": { "type": "object", "additionalProperties": false, "required": ["column", "value"], "properties": { "column": { "$ref": "#/$defs/identifier" }, "value": { "$ref": "#/$defs/scalar" } } }, "principalScope": { "type": "object", "additionalProperties": false, "required": ["schema_version", "column", "binding", "provider", "value_fingerprint"], "properties": { "schema_version": { "const": "synapsor.principal-scope.v1" }, "column": { "$ref": "#/$defs/identifier" }, "binding": { "$ref": "#/$defs/identifier" }, "provider": { "enum": ["environment", "http_claims", "cloud_session", "static_dev"] }, "value_fingerprint": { "$ref": "#/$defs/sha256" }, "value": { "$ref": "#/$defs/scalar" } } } }
|
|
17
17
|
}
|