@synapsor/runner 1.4.121 → 1.4.122

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.
Files changed (36) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/README.md +23 -13
  3. package/dist/cli.d.ts +3 -0
  4. package/dist/cli.d.ts.map +1 -1
  5. package/dist/runner.mjs +2533 -323
  6. package/docs/README.md +1 -0
  7. package/docs/capability-authoring.md +43 -1
  8. package/docs/cloud-cli.md +248 -0
  9. package/docs/cloud-mode.md +88 -6
  10. package/docs/cloud-push.md +22 -5
  11. package/docs/conformance.md +6 -0
  12. package/docs/contract-testing.md +30 -1
  13. package/docs/dsl-reference.md +11 -0
  14. package/docs/hosted-cloud-linked-verification.md +97 -0
  15. package/docs/oss-vs-cloud.md +13 -6
  16. package/docs/release-notes.md +30 -0
  17. package/docs/rfcs/007-trusted-principal-row-scope.md +75 -0
  18. package/docs/runner-bundles.md +24 -0
  19. package/docs/running-a-runner-fleet.md +8 -0
  20. package/docs/security-boundary.md +15 -1
  21. package/examples/runner-fleet/seed/mysql.sql +5 -1
  22. package/examples/runner-fleet/seed/postgres.sql +5 -1
  23. package/examples/support-plan-credit/README.md +8 -6
  24. package/fixtures/dsl/principal-row-scope.synapsor.sql +23 -0
  25. package/fixtures/protocol/MANIFEST.json +10 -10
  26. package/package.json +1 -1
  27. package/schemas/change-set.v1.schema.json +14 -0
  28. package/schemas/change-set.v2.schema.json +14 -0
  29. package/schemas/change-set.v3.schema.json +2 -0
  30. package/schemas/compensation-change-set.v1.schema.json +3 -2
  31. package/schemas/inverse-descriptor.v1.schema.json +2 -0
  32. package/schemas/synapsor.contract-tests.schema.json +11 -1
  33. package/schemas/writeback-job.v1.schema.json +14 -0
  34. package/schemas/writeback-job.v2.schema.json +14 -0
  35. package/schemas/writeback-job.v3.schema.json +2 -0
  36. package/schemas/writeback-job.v4.schema.json +2 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.4.122 (prepared, not published)
4
+
5
+ ### Trusted principal row scope and Cloud-linked governance
6
+
7
+ - Adds a canonical reviewer-fixed principal row scope that is always
8
+ AND-composed with tenant scope and resolved only from a required trusted
9
+ context binding. Missing or invalid principal authority fails closed.
10
+ - Enforces the bound principal predicate in PostgreSQL and MySQL reads,
11
+ proposals, aggregates, guarded CRUD, bounded sets, executor envelopes,
12
+ receipts, replay, and reviewed compensation. Same-tenant cross-principal
13
+ access uses the same generic miss as cross-tenant or absent rows.
14
+ - Preserves the scope through DSL parse/format/compile, Spec validation and
15
+ digesting, config normalization, protocol jobs, C++/Cloud round trips,
16
+ contract explanation/testing, and scoped evidence/proposal/resource handles.
17
+ - Adds explicit `local_only` and `cloud_linked` authority behavior. Cloud-linked
18
+ proposals use a durable idempotent outbox, metadata-only evidence residency,
19
+ Cloud-governed approval/leasing, terminal-state reconciliation, and no local
20
+ approval/apply fallback while Cloud is unavailable.
21
+ - Separates contract-registry human/service credentials from Runner machine
22
+ tokens. Cloud push no longer accepts secrets through command arguments or a
23
+ Runner-token fallback.
24
+ - Introduces the separately packable `@synapsor/cli@0.1.0-beta.1` Cloud client;
25
+ `synapsor-runner` remains the local MCP/database enforcement boundary.
26
+ - Stages `@synapsor/spec@1.4.2`, `@synapsor/dsl@1.4.3`, and
27
+ `@synapsor/runner@1.4.122`. Nothing is published by this change.
28
+
3
29
  ## 1.4.121 (prepared, not published)
4
30
 
5
31
  ### Contract trust surface and bounded-set parser correctness
package/README.md CHANGED
@@ -14,9 +14,8 @@ surface.
14
14
 
15
15
  ## Prove It In 60 Seconds
16
16
 
17
- The path is: **audit** your existing MCP risk, then **demo** the safety
18
- boundary, then **connect** a staging database. The first two commands finish in
19
- seconds and touch nothing but a local fixture file.
17
+ Path: **audit** MCP risk, **demo** the boundary, then **connect** staging. The
18
+ first two commands touch only a local fixture.
20
19
 
21
20
  First, inspect the risk in a typical raw-SQL database MCP server. This works
22
21
  even if you never adopt Runner:
@@ -25,18 +24,16 @@ even if you never adopt Runner:
25
24
  npx -y @synapsor/runner audit --example dangerous-db-mcp
26
25
  ```
27
26
 
28
- Then point the same static review at your own exported tool manifest, remote
29
- `tools/list` endpoint, or stdio MCP server:
27
+ Audit your own tool manifest, remote `tools/list`, or stdio server:
30
28
 
31
29
  ```bash
32
30
  npx -y @synapsor/runner audit ./tools-list.json
33
31
  ```
34
32
 
35
- The audit flags raw SQL, arbitrary table/column inputs, model-controlled tenant
36
- or principal authority, model-facing approval/writeback tools, and missing
37
- conflict or idempotency signals. It does not call business tools, and it is a
38
- risk review rather than proof that a server is secure. See [MCP Database Risk
39
- Review](docs/mcp-audit.md) for remote, stdio, JSON, and Markdown workflows.
33
+ It flags raw SQL, arbitrary identifiers, model-controlled authority,
34
+ model-facing approval/writeback, and missing conflict or idempotency signals.
35
+ It does not call business tools. See [MCP Database Risk
36
+ Review](docs/mcp-audit.md) for supported workflows and limits.
40
37
 
41
38
  Then see the proposal, approval boundary, evidence, and replay loop. It needs no
42
39
  database, Docker, config file, MCP client, or Synapsor account:
@@ -197,6 +194,10 @@ trust boundaries, covered threats, non-goals, and required operator controls.
197
194
  - MCP proposal, evidence, and replay handles are references rather than bearer
198
195
  authority: resource reads re-check the owning tenant and principal against
199
196
  the current trusted session.
197
+ - Same-tenant owner/assignee isolation uses a reviewed
198
+ [`PRINCIPAL SCOPE KEY`](docs/capability-authoring.md#same-tenant-principal-row-scope)
199
+ composed with mandatory tenant scope; `test:principal-scope` proves generic
200
+ cross-principal denial and evidence-handle isolation on Postgres and MySQL.
200
201
  - `test:live-apply`, `test:guarded-crud`, `test:bounded-set`, and
201
202
  `test:reversible` run disposable PostgreSQL/MySQL scenarios. They prove no
202
203
  pre-approval mutation, guarded single-row CRUD, idempotent retry,
@@ -229,6 +230,7 @@ and [Small Runner Fleets](docs/running-a-runner-fleet.md).
229
230
  | `@synapsor/runner` | CLI, MCP runtime, local ledger, proposals, approval, guarded writeback, replay, and MCP audit. |
230
231
  | `@synapsor/spec` | Canonical portable contracts for contexts, capabilities, workflows, evidence, proposals, receipts, and replay. |
231
232
  | `@synapsor/dsl` | SQL-like authoring that compiles contexts, capabilities, and workflow declarations into canonical contract JSON. |
233
+ | `@synapsor/cli` | Synapsor Cloud administration, contract governance, human review, Runner connections, and shared audit records. |
232
234
 
233
235
  Runner executes locally. The spec is shared by Runner and Cloud/C++; the DSL
234
236
  is its reviewable source format. Start with [Capability
@@ -248,12 +250,20 @@ deployments: your database remains the source of truth and Runner stores review
248
250
  artifacts in the default local SQLite ledger or an opt-in shared Postgres
249
251
  runtime store.
250
252
  Synapsor Cloud adds a shared contract registry, immutable versions,
251
- downloadable Runner bundles, and team activity, evidence, and approval
252
- surfaces. See [OSS Runner vs Synapsor Cloud](docs/oss-vs-cloud.md) for the
253
- detailed boundary.
253
+ source-scoped Runner connections, downloadable bundles, a human approval
254
+ inbox, durable leased writeback jobs, and a redacted shared activity/receipt
255
+ chronology. Database credentials and guarded execution remain local. See [Cloud
256
+ Mode](docs/cloud-mode.md) for the design-partner path and [OSS Runner vs
257
+ Synapsor Cloud](docs/oss-vs-cloud.md) for the detailed boundary.
258
+
259
+ `synapsor-runner` owns the local MCP/database boundary. `synapsor` from
260
+ `@synapsor/cli` manages Cloud review and audit. Both Cloud push commands use
261
+ the same contract digest and scoped service-key API. See the [Cloud CLI
262
+ guide](https://github.com/Synapsor/Synapsor-Runner/blob/main/docs/cloud-cli.md).
254
263
 
255
264
  ## Next Steps
256
265
 
266
+ - Follow the [step-by-step Synapsor Tutorial](https://github.com/sandeshtiwari/Synapsor-Tutorial).
257
267
  - Run the [`support-plan-credit` flagship example](examples/support-plan-credit).
258
268
  - Connect [Claude, Cursor, OpenAI Agents SDK, or another MCP client](docs/mcp-clients.md).
259
269
  - Author and [push a validated contract to Cloud](docs/cloud-push.md).
package/dist/cli.d.ts CHANGED
@@ -14,6 +14,9 @@ export declare function runInitWizard(args: string[], options?: {
14
14
  stdout?: Pick<NodeJS.WriteStream, "write">;
15
15
  }): Promise<number>;
16
16
  export declare function resolveSqlWriteDatabaseUrl(job: WritebackJob, configPath: string, env: NodeJS.ProcessEnv): Promise<string>;
17
+ export declare function verifyLocalWritebackAuthority(job: WritebackJob, configPath: string, storePath?: string, options?: {
18
+ cloudApproved?: boolean;
19
+ }): Promise<void>;
17
20
  export declare function reconciliationSupportedOutcome(observation: ReconciliationObservation): "applied" | "conflict" | "failed";
18
21
  export declare function reconciliationReceipt(intent: StoredWritebackIntent, observation: ReconciliationObservation, outcome: "applied" | "conflict" | "failed", runnerId: string, reason: string): ExecutionReceiptV2 | ExecutionReceiptV3 | ExecutionReceiptV4;
19
22
  export {};
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,EAiBL,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;AA8UtC,wBAAsB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAgE1D;AA0FD,KAAK,SAAS,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;AAE9E,wBAAsB,aAAa,CACjC,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,GAAE;IACP,GAAG,CAAC,EAAE,SAAS,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC,U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