@synapsor/runner 1.4.0 → 1.4.12
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 +50 -0
- package/README.md +39 -33
- package/SECURITY.md +11 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/runner.mjs +172 -72
- package/docs/README.md +4 -0
- package/docs/benchmarks/bounded-set-local.md +27 -0
- package/docs/bounded-set-writeback.md +298 -0
- package/docs/capability-authoring.md +6 -0
- package/docs/getting-started-own-database.md +8 -1
- package/docs/production.md +10 -0
- package/docs/release-notes.md +41 -0
- package/docs/result-envelope-v3.md +43 -0
- package/docs/security-boundary.md +7 -0
- package/docs/troubleshooting-first-run.md +20 -0
- package/docs/why-synapsor-vs-app-guardrails.md +169 -0
- package/examples/runner-fleet/seed/postgres.sql +1 -0
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,55 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.4.12 (prepared, not published)
|
|
4
|
+
|
|
5
|
+
### Runtime-store smoke-call consistency
|
|
6
|
+
|
|
7
|
+
- Fixes BUG-017: `smoke call` now lets the MCP runtime resolve storage from the
|
|
8
|
+
complete config instead of injecting a local SQLite `ProposalStore`.
|
|
9
|
+
- In `runtime_store` mode, proposal, evidence, query-audit, event, and replay
|
|
10
|
+
records land in the authoritative shared Postgres ledger and are visible to
|
|
11
|
+
other Runner processes and normal approve/apply commands.
|
|
12
|
+
- Shared-ledger failures return a redacted, retryable availability result with
|
|
13
|
+
a nonzero CLI status and never create a local fallback proposal.
|
|
14
|
+
- Keeps local SQLite and mirror modes unchanged. The source database still
|
|
15
|
+
remains untouched until external approval and guarded apply.
|
|
16
|
+
- Adds focused no-fallback coverage and a disposable two-process fleet proof
|
|
17
|
+
covering ownership, approval/apply, one source receipt, replay, and safe
|
|
18
|
+
ledger unavailability.
|
|
19
|
+
- Stages only `@synapsor/runner@1.4.12`; `@synapsor/dsl` remains `1.4.1` and
|
|
20
|
+
`@synapsor/spec` remains `1.4.0`. Nothing is published by this change.
|
|
21
|
+
|
|
22
|
+
## 1.4.1 (prepared, not published)
|
|
23
|
+
|
|
24
|
+
### Canonical Bounded-Set Digest Verification
|
|
25
|
+
|
|
26
|
+
- Fixes contract-authored bounded-set proposals that could fail unchanged
|
|
27
|
+
apply with `SET_DIGEST_MISMATCH` after protocol parsing reordered aggregate
|
|
28
|
+
object fields.
|
|
29
|
+
- Uses recursive canonical JSON key ordering for new member and set digests,
|
|
30
|
+
while narrowly accepting the deterministic raw representations emitted by
|
|
31
|
+
`1.4.0` so valid stored proposals remain applyable.
|
|
32
|
+
- Keeps every frozen member, expected version, reviewed value, aggregate,
|
|
33
|
+
tenant guard, and atomic source check intact; malformed digests and genuine
|
|
34
|
+
source drift still fail closed.
|
|
35
|
+
- Adds PostgreSQL/MySQL regression coverage for the exact DSL-to-contract path
|
|
36
|
+
under source-database and Runner-ledger receipt authority, plus independent
|
|
37
|
+
version, predicate, aggregate, writable-value, missing-member, and tenant
|
|
38
|
+
drift checks.
|
|
39
|
+
- Ships the bounded-set guide and other linked public docs in the Runner
|
|
40
|
+
tarball, and fails package assembly when a shipped local Markdown link cannot
|
|
41
|
+
resolve.
|
|
42
|
+
- Removes obsolete `0.1 preview` wording from the DSL package without changing
|
|
43
|
+
canonical Spec `spec_version: "0.1"`.
|
|
44
|
+
- Adds a build-vs-adopt guide for teams already using prompts and custom
|
|
45
|
+
parameterized tools. It distinguishes behavioral instructions from
|
|
46
|
+
structural authorization, explains where SQL authority lives, and documents
|
|
47
|
+
the approval, receipt, replay, and compensation layer without claiming
|
|
48
|
+
prompt-injection prevention or compliance certification.
|
|
49
|
+
- Stages `@synapsor/runner@1.4.1` and `@synapsor/dsl@1.4.1`;
|
|
50
|
+
`@synapsor/spec` remains `1.4.0` because the public contract schema did not
|
|
51
|
+
change. Nothing is published by this change.
|
|
52
|
+
|
|
3
53
|
## 1.4.0 (prepared, not published)
|
|
4
54
|
|
|
5
55
|
### Reviewed Reversible Change Sets
|
package/README.md
CHANGED
|
@@ -88,10 +88,26 @@ approve/reject prompt:
|
|
|
88
88
|
- evidence, query audit, idempotency receipts, and replay preserve what was
|
|
89
89
|
inspected, requested, approved, and applied.
|
|
90
90
|
|
|
91
|
-
Runner supports bounded
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
91
|
+
Runner supports bounded deployments when its documented database, identity,
|
|
92
|
+
ledger, backup, and operational controls are satisfied. It does not make raw
|
|
93
|
+
SQL tools, host infrastructure, or prompt-injection-prone clients safe.
|
|
94
|
+
|
|
95
|
+
## Why Not Just Use A Prompt And App Code?
|
|
96
|
+
|
|
97
|
+
Prompt instructions can guide behavior, but prompt-only enforcement is not an
|
|
98
|
+
authorization boundary. First ask who produces the SQL:
|
|
99
|
+
|
|
100
|
+
- **The model produces SQL:** your validator must safely understand arbitrary
|
|
101
|
+
queries, scope, and side effects. That is `execute_sql` with an extra parser.
|
|
102
|
+
- **Trusted app code produces fixed, parameterized SQL:** good. You have built
|
|
103
|
+
a semantic tool, and that may be enough for a small read-only application.
|
|
104
|
+
|
|
105
|
+
Runner becomes useful when those tools also need one reviewed contract for
|
|
106
|
+
trusted tenant scope, field controls, evidence, approval outside MCP, guarded
|
|
107
|
+
and idempotent writeback, receipts, replay, and reviewed compensation. Use your
|
|
108
|
+
own code when you do not need that lifecycle. Read the [full build-vs-adopt
|
|
109
|
+
guide](docs/why-synapsor-vs-app-guardrails.md) for the decision table, public
|
|
110
|
+
incident evidence, and regulated-data boundaries.
|
|
95
111
|
|
|
96
112
|
## Connect A Staging Database
|
|
97
113
|
|
|
@@ -109,11 +125,9 @@ creates trusted context, generates reviewed capabilities, previews the MCP tool
|
|
|
109
125
|
surface, and prints the next smoke and serve commands. It stores environment
|
|
110
126
|
variable names, not connection strings.
|
|
111
127
|
|
|
112
|
-
The
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
statement timeouts) is generated for you; the full file is in the
|
|
116
|
-
[own-database guide](docs/getting-started-own-database.md).
|
|
128
|
+
The generated capability is a tenant-scoped read with an explicit column
|
|
129
|
+
allowlist and required evidence. See the [own-database
|
|
130
|
+
guide](docs/getting-started-own-database.md) for the full configuration.
|
|
117
131
|
|
|
118
132
|
```json
|
|
119
133
|
{
|
|
@@ -174,19 +188,11 @@ trust boundaries, covered threats, non-goals, and required operator controls.
|
|
|
174
188
|
- MCP proposal, evidence, and replay handles are references rather than bearer
|
|
175
189
|
authority: resource reads re-check the owning tenant and principal against
|
|
176
190
|
the current trusted session.
|
|
177
|
-
- `
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
and DELETE across both databases and all receipt modes, including the
|
|
183
|
-
zero-source-schema Runner-ledger path and fail-closed reconciliation.
|
|
184
|
-
- `corepack pnpm test:bounded-set` proves proposal-time cap and aggregate
|
|
185
|
-
rejection, frozen-set drift checks, all-or-nothing set UPDATE/DELETE and
|
|
186
|
-
batch INSERT, delete-side-effect refusal, exact receipts, and 1/10/100-row
|
|
187
|
-
bounds on disposable PostgreSQL and MySQL.
|
|
188
|
-
- `corepack pnpm test:reversible` proves approval, conflict guards, redaction,
|
|
189
|
-
receipts, and replay on PostgreSQL and MySQL.
|
|
191
|
+
- `test:live-apply`, `test:guarded-crud`, `test:bounded-set`, and
|
|
192
|
+
`test:reversible` run disposable PostgreSQL/MySQL scenarios. They prove no
|
|
193
|
+
pre-approval mutation, guarded single-row CRUD, idempotent retry,
|
|
194
|
+
fail-closed conflicts, bounded atomic sets, exact receipts, and reviewed
|
|
195
|
+
compensation.
|
|
190
196
|
- The C++/Cloud round-trip verifier exports normalized contracts, validates
|
|
191
197
|
them with `@synapsor/spec`, and loads them in Runner. The shared contract and
|
|
192
198
|
verification commands are documented in [Conformance](docs/conformance.md).
|
|
@@ -198,12 +204,9 @@ See [Security Boundary](docs/security-boundary.md) and
|
|
|
198
204
|
|
|
199
205
|
## Operate The Approval Loop
|
|
200
206
|
|
|
201
|
-
Reviewed policies
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
with `apply --all-approved --yes`, inspect Prometheus counters with `metrics
|
|
205
|
-
show`, and consume safe newline-delimited JSON outcome logs from stderr. Signed
|
|
206
|
-
operator keys can enforce contract reviewer roles and separate apply roles.
|
|
207
|
+
Reviewed policies combine per-proposal and daily ceilings; exceeding one routes
|
|
208
|
+
the proposal to human review. Operators use `apply --all-approved --yes`,
|
|
209
|
+
Prometheus metrics, structured logs, and optional signed reviewer/apply roles.
|
|
207
210
|
Shared Postgres ledger mirror mode is available for bounded operator handoffs,
|
|
208
211
|
and `storage.shared_postgres.mode = "runtime_store"` lets MCP serving use
|
|
209
212
|
Postgres as the primary proposal/evidence/replay store with bounded CLI
|
|
@@ -212,6 +215,10 @@ remains the default. See
|
|
|
212
215
|
[Production](docs/production.md) and the
|
|
213
216
|
[Runner Config Reference](docs/runner-config-reference.md).
|
|
214
217
|
|
|
218
|
+
`smoke call` honors `runtime_store`: artifacts go to shared Postgres; failures
|
|
219
|
+
never fall back to SQLite. `--store` is compatibility plumbing. Requires
|
|
220
|
+
`1.4.12`+.
|
|
221
|
+
|
|
215
222
|
For a small multi-tenant fleet, bind every capability context to verified HTTP
|
|
216
223
|
claims, use `jwt_asymmetric` session auth, and share a bounded Postgres
|
|
217
224
|
`runtime_store`. Never assume a global `http_claims` setting overrides an
|
|
@@ -230,11 +237,10 @@ dead-letter, and rolling-upgrade rules are in
|
|
|
230
237
|
| `@synapsor/spec` | Canonical portable contracts for contexts, capabilities, workflows, evidence, proposals, receipts, and replay. |
|
|
231
238
|
| `@synapsor/dsl` | SQL-like authoring that compiles contexts, capabilities, and workflow declarations into canonical contract JSON. |
|
|
232
239
|
|
|
233
|
-
Runner executes locally. The spec is
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
legacy `.synapsor` files remain supported and produce the same contract JSON.
|
|
240
|
+
Runner executes locally. The spec is shared by Runner and Cloud/C++; the DSL
|
|
241
|
+
is its reviewable source format. Start with [Capability
|
|
242
|
+
Authoring](docs/capability-authoring.md). Use `.synapsor.sql` for generic SQL
|
|
243
|
+
highlighting; legacy `.synapsor` files produce the same contract JSON.
|
|
238
244
|
|
|
239
245
|
Use the [DSL Reference](docs/dsl-reference.md) for exact authoring grammar and
|
|
240
246
|
the [Runner Config Reference](docs/runner-config-reference.md) for every wiring
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
Report security issues privately to security@synapsor.ai.
|
|
4
|
+
|
|
5
|
+
Do not include production credentials, customer data, or full source rows in bug reports. Include runner version, job id, proposal id, source id, engine, safe error code, and redacted logs where possible.
|
|
6
|
+
|
|
7
|
+
## Supported security scope
|
|
8
|
+
|
|
9
|
+
The v0.1 runner protects the local writeback boundary for approved structured jobs. It does not make the hosted Synapsor control plane self-hosted, and it does not provide HA, compliance certification, or a general database proxy.
|
|
10
|
+
|
|
11
|
+
See `docs/threat-model.md` for detailed trust boundaries, covered threats, non-goals, and release blockers.
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAYA,OAAO,EAAoP,KAAK,WAAW,EAA0H,MAAM,6BAA6B,CAAC;AAIza,OAAO,EAgBL,KAAK,qBAAqB,EAK3B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAgI,KAAK,kBAAkB,EAAE,KAAK,kBAAkB,EAAE,KAAK,kBAAkB,EAAuD,KAAK,YAAY,EAAwB,MAAM,2BAA2B,CAAC;AAElV,OAAO,EAQL,KAAK,gBAAgB,EAEtB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAUL,KAAK,yBAAyB,EAE/B,MAAM,8BAA8B,CAAC;AAyUtC,wBAAsB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM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