@synapsor/runner 1.6.2 → 1.6.4

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 (116) hide show
  1. package/AGENTS.md +2 -2
  2. package/CHANGELOG.md +141 -2
  3. package/CONTRIBUTING.md +10 -3
  4. package/README.md +65 -83
  5. package/SECURITY.md +14 -2
  6. package/THREAT_MODEL.md +64 -4
  7. package/dist/authoring.mjs +151 -16
  8. package/dist/cli.d.ts +31 -3
  9. package/dist/cli.d.ts.map +1 -1
  10. package/dist/local-ui.d.ts +145 -1
  11. package/dist/local-ui.d.ts.map +1 -1
  12. package/dist/runner.mjs +37488 -19009
  13. package/dist/runtime.mjs +4056 -235
  14. package/dist/shadow.mjs +2423 -65
  15. package/docs/README.md +36 -2
  16. package/docs/agent-guided-setup.md +239 -0
  17. package/docs/aggregate-reads.md +14 -5
  18. package/docs/app-owned-executors.md +5 -6
  19. package/docs/approval-roles-and-operator-identity.md +353 -0
  20. package/docs/auto-boundary-and-scoped-explore.md +89 -11
  21. package/docs/capability-authoring.md +21 -2
  22. package/docs/client-recipes.md +1 -1
  23. package/docs/cloud-mode.md +7 -7
  24. package/docs/conformance.md +6 -3
  25. package/docs/current-scope.md +32 -2
  26. package/docs/cursor-plugin.md +3 -3
  27. package/docs/database-enforced-scope.md +6 -0
  28. package/docs/dsl-json-parity.md +75 -0
  29. package/docs/dsl-reference.md +22 -1
  30. package/docs/fresh-developer-usability.md +155 -80
  31. package/docs/getting-started-own-database.md +45 -44
  32. package/docs/guarded-crud-writeback.md +19 -0
  33. package/docs/guided-onboarding.md +399 -0
  34. package/docs/human-attention-notifications.md +367 -0
  35. package/docs/limitations.md +49 -13
  36. package/docs/local-mode.md +36 -22
  37. package/docs/mcp-audit.md +14 -14
  38. package/docs/mcp-client-setup.md +11 -14
  39. package/docs/mcp-clients.md +1 -1
  40. package/docs/migrating-to-synapsor-spec.md +42 -0
  41. package/docs/openai-agents-sdk.md +2 -2
  42. package/docs/production.md +39 -0
  43. package/docs/proposal-evidence-freshness.md +7 -7
  44. package/docs/recipes.md +6 -6
  45. package/docs/release-notes.md +144 -4
  46. package/docs/release-policy.md +20 -7
  47. package/docs/reversible-change-sets.md +1 -1
  48. package/docs/reviewed-database-views.md +132 -0
  49. package/docs/reviewed-relationships.md +245 -0
  50. package/docs/rfcs/006-reviewed-reversible-change-sets.md +1 -1
  51. package/docs/runner-bundles.md +7 -7
  52. package/docs/runner-config-reference.md +132 -0
  53. package/docs/running-a-runner-fleet.md +16 -1
  54. package/docs/schema-api-candidates.md +1 -1
  55. package/docs/security-boundary.md +54 -0
  56. package/docs/store-lifecycle.md +20 -1
  57. package/docs/supervised-automatic-apply.md +267 -0
  58. package/docs/troubleshooting-first-run.md +85 -10
  59. package/docs/use-your-own-database.md +6 -4
  60. package/docs/workbench-ask.md +279 -0
  61. package/docs/writeback-executors.md +7 -7
  62. package/examples/auto-boundary-churn/README.md +1 -1
  63. package/examples/community-solar-clean-room/README.md +7 -0
  64. package/examples/community-solar-clean-room/docker-compose.yml +16 -0
  65. package/examples/community-solar-clean-room/package.json +15 -0
  66. package/examples/community-solar-clean-room/prisma/schema.prisma +171 -0
  67. package/examples/community-solar-clean-room/seed/postgres.sql +571 -0
  68. package/examples/fitflow-guided-onboarding/README.md +43 -0
  69. package/examples/fitflow-guided-onboarding/app/page.tsx +8 -0
  70. package/examples/fitflow-guided-onboarding/docker-compose.yml +16 -0
  71. package/examples/fitflow-guided-onboarding/package.json +18 -0
  72. package/examples/fitflow-guided-onboarding/prisma/schema.prisma +98 -0
  73. package/examples/fitflow-guided-onboarding/seed/postgres.sql +401 -0
  74. package/examples/openai-agents-http/Makefile +1 -1
  75. package/examples/openai-agents-http/README.md +1 -1
  76. package/examples/openai-agents-stdio/Makefile +1 -1
  77. package/examples/openai-agents-stdio/README.md +2 -2
  78. package/examples/openai-agents-stdio/agent.py +1 -4
  79. package/examples/operator-oidc/issuer.mjs +188 -0
  80. package/examples/reference-support-billing-app/README.md +16 -16
  81. package/examples/retail-clean-room/README.md +7 -0
  82. package/examples/retail-clean-room/docker-compose.yml +16 -0
  83. package/examples/retail-clean-room/package.json +9 -0
  84. package/examples/retail-clean-room/prisma/schema.prisma +239 -0
  85. package/examples/retail-clean-room/seed/postgres.sql +781 -0
  86. package/examples/retail-clean-room/view-recipe/average-retained-revenue.synapsor.sql +21 -0
  87. package/examples/retail-clean-room/view-recipe/synapsor.runner.json +25 -0
  88. package/examples/support-plan-credit/README.md +6 -2
  89. package/examples/support-plan-credit/mcp-client-examples/claude-code.sh +1 -4
  90. package/examples/support-plan-credit/mcp-client-examples/claude-desktop.json +1 -4
  91. package/examples/support-plan-credit/mcp-client-examples/codex.config.toml +1 -4
  92. package/examples/support-plan-credit/mcp-client-examples/cursor-global.mcp.json +1 -4
  93. package/examples/support-plan-credit/mcp-client-examples/cursor-project.mcp.json +1 -4
  94. package/examples/support-plan-credit/mcp-client-examples/generic-stdio.json +1 -4
  95. package/examples/support-plan-credit/mcp-client-examples/generic-stdio.mjs +1 -1
  96. package/examples/support-plan-credit/mcp-client-examples/google-adk.py +1 -1
  97. package/examples/support-plan-credit/mcp-client-examples/langchain.mjs +1 -1
  98. package/examples/support-plan-credit/mcp-client-examples/llamaindex.py +1 -1
  99. package/examples/support-plan-credit/mcp-client-examples/openai-agents-stdio.ts +1 -1
  100. package/examples/support-plan-credit/mcp-client-examples/vscode.mcp.json +1 -4
  101. package/fixtures/compatibility/published-1.6.3/manifest.json +76 -0
  102. package/fixtures/compatibility/published-1.6.3/sources/packages/dsl/examples/aggregate-read.synapsor.sql +21 -0
  103. package/fixtures/compatibility/published-1.6.3/sources/packages/dsl/examples/billing-late-fee.synapsor.sql +56 -0
  104. package/fixtures/compatibility/published-1.6.3/sources/packages/dsl/examples/bounded-set-multi-term.synapsor.sql +30 -0
  105. package/fixtures/compatibility/published-1.6.3/sources/packages/dsl/examples/principal-row-scope.synapsor.sql +23 -0
  106. package/fixtures/compatibility/published-1.6.3/sources/packages/spec/fixtures/conformance/aggregate-read/contract.json +119 -0
  107. package/fixtures/compatibility/published-1.6.3/sources/packages/spec/fixtures/conformance/approval-quorum/contract.json +44 -0
  108. package/fixtures/compatibility/published-1.6.3/sources/packages/spec/fixtures/conformance/bounded-set-threats/contract.json +115 -0
  109. package/fixtures/compatibility/published-1.6.3/sources/packages/spec/fixtures/conformance/principal-row-scope/contract.json +78 -0
  110. package/fixtures/compatibility/published-1.6.3/sources/packages/spec/fixtures/conformance/proposal-capability/contract.json +101 -0
  111. package/fixtures/compatibility/published-1.6.3/sources/packages/spec/fixtures/conformance/reversible-change-sets/contract.json +98 -0
  112. package/fixtures/compatibility/published-1.6.3/sources/packages/spec/fixtures/valid/basic-read.contract.json +60 -0
  113. package/llms.txt +10 -5
  114. package/package.json +11 -3
  115. package/schemas/schema-candidate-review.schema.json +42 -0
  116. package/schemas/synapsor.runner.schema.json +227 -4
package/AGENTS.md CHANGED
@@ -10,8 +10,8 @@ writeback, and local evidence/replay.
10
10
  Use the stable package for public/user-facing examples:
11
11
 
12
12
  ```bash
13
- npx -y -p @synapsor/runner synapsor-runner demo --quick
14
- npx -y -p @synapsor/runner synapsor-runner audit --example dangerous-db-mcp
13
+ npx -y @synapsor/runner demo --quick
14
+ npx -y @synapsor/runner audit --example dangerous-db-mcp
15
15
  ```
16
16
 
17
17
  Use the local checkout while editing this repo:
package/CHANGELOG.md CHANGED
@@ -1,6 +1,145 @@
1
1
  # Changelog
2
2
 
3
- ## 1.6.2 (prepared, not published)
3
+ ## 1.6.4 (prepared, not published)
4
+
5
+ ### Review-correct onboarding and reviewed relationship paths
6
+
7
+ - Repairs generated-boundary review state so edits invalidate only dependent
8
+ confirmations, stale browser revisions fail compare-and-swap checks, and
9
+ unrelated reviewed decisions survive. Secure headless activation now uses the
10
+ same exact-digest/operator boundary as Workbench.
11
+ - Reworks the first Workbench experience around a small starter resource pack,
12
+ clearer plain-language authority and source-change status, stable
13
+ progressive disclosure, managed identity/scope decisions, and one primary
14
+ next action. Nested-project config discovery and resume behavior no longer
15
+ force a developer to rediscover paths or restart review.
16
+ - Adds a no-argument first-run path that accepts the database URL through a
17
+ hidden terminal prompt or explicitly confirmed, key-specific environment-file
18
+ discovery. A conservative local-development fast lane reaches a real safe
19
+ read with at most two plain questions and one recorded exact-digest human
20
+ gesture, without exporting the URL or editing generated files.
21
+ - Tightens deterministic sensitive-field classification across unfamiliar
22
+ schemas and combines database, Prisma, Drizzle, OpenAPI, and existing
23
+ Synapsor evidence without an LLM. Ambiguous identity/scope and high-risk
24
+ fields stay blocked or kept out for human review.
25
+ - Adds public, additive reviewed relationship paths for protected aggregate
26
+ reads: up to three activated paths, each containing one or two
27
+ catalog-proven many-to-one links with fan-out one. The model may reference an
28
+ active path by name but cannot supply identifiers, join semantics, or
29
+ activation.
30
+ - Adds demand-driven relationship review. A plan requiring an inactive proven
31
+ path fails closed, Workbench stages that exact proof for an operator, nullable
32
+ links require an explicit `EXCLUDE` or `KEEP NULL` choice, and a new digest is
33
+ required before retry.
34
+ - Enforces trusted tenant/principal scope on every participating relation,
35
+ suppression after final grouping, generation-lock/catalog-proof drift, and
36
+ permanent rejection of one-to-many, many-to-many, ambiguous-cardinality,
37
+ over-depth, and model-improvised joins. Complex formulas and relationship
38
+ graphs remain on reviewed database views.
39
+ - Adds clean-room Community Solar and Retail onboarding/PM-analysis journeys,
40
+ plus live PostgreSQL/MySQL star/depth-two, nullable-link, drift, privacy, and
41
+ deliberately wrong fan-out tests. Published `1.6.3` contracts, digests,
42
+ startup routes, and tool surfaces remain byte-compatible unless the new
43
+ feature is explicitly adopted.
44
+ - Adds optional local Workbench Ask over the exact reviewed MCP/runtime tool
45
+ surface. OpenAI, Anthropic, and custom OpenAI-compatible adapters use
46
+ digest-bound direct-egress consent, in-memory credentials/history, fixed
47
+ size/time/tool/token bounds, escaped model output, and proposal-only writes;
48
+ the no-model composer remains complete and enabled by default.
49
+ - Hardens provider endpoints with fixed official origins, remote HTTPS,
50
+ loopback-only plaintext, redirect refusal, per-connection DNS validation and
51
+ address pinning, private/special destination refusal, and redacted failures.
52
+ The pinned lookup supports Node 22's multi-address callback shape.
53
+ - Extends both packed clean-room labs through the actual Ask UI. Retail visibly
54
+ refuses a kept-out customer-note aggregate, and Community Solar proves a
55
+ proposal cannot commit. An owner-authorized live OpenAI `gpt-5-mini` run
56
+ matched official MCP results and passed exact-key artifact/browser scans;
57
+ Anthropic and generic compatible claims remain protocol-scoped.
58
+ - Uses direct `npx` only for first acquisition and the installed
59
+ `synapsor-runner` binary afterward. The optional unscoped command package is a
60
+ version-locked delegate with no independent runtime or authority logic;
61
+ explicit pinned and automation invocations remain compatible.
62
+ - Adds one local, escaped, copy-exact DSL syntax highlighter for every
63
+ Workbench DSL preview, with no CDN or unsafe HTML path, and gives activity,
64
+ review, and apply detail the full available width on desktop and mobile.
65
+ - Prepares `@synapsor/runner@1.6.4`, `@synapsor/spec@1.7.0`,
66
+ `@synapsor/dsl@1.7.0`, and the optional `synapsor-runner@1.6.4` command
67
+ alias. No package is published by this change.
68
+
69
+ ## 1.6.3 (published 2026-07-24)
70
+
71
+ ### Guided adoption without weaker authority
72
+
73
+ - Turns a fresh interactive
74
+ `npx -y @synapsor/runner@latest start --from-env DATABASE_URL` into one
75
+ resumable journey: metadata-only inspection, conservative classification,
76
+ disabled project generation, review-by-exception in the loopback Workbench,
77
+ exact-digest activation, a real bounded read, and host-neutral MCP setup.
78
+ - Generates the complete local project without requiring hand-edited DSL, JSON,
79
+ config, store paths, DDL, or grants for the reference development journey.
80
+ Existing selectors, automation, headless startup, hand-authored projects,
81
+ active contracts, and tool lists retain their prior behavior.
82
+ - Adds no-ID, project-aware CLI paths for trying active named tools, bounded
83
+ row/aggregate exploration, protecting a successful analysis, guided action
84
+ authoring, proposal review, apply, receipt, replay, and compensation.
85
+ - Reworks Workbench onboarding around one plain-language boundary summary,
86
+ conservative defaults, unresolved exceptions, one primary next action, and
87
+ progressive disclosure of DSL, canonical JSON, digests, role posture, and
88
+ generated tests.
89
+ - Adds a guided write-action flow that drafts public DSL, canonical JSON,
90
+ tests, policy limits, conflict guards, receipt mode, and optional reviewed
91
+ compensation. It never derives business write authority from schema and
92
+ never activates, approves, or applies for the human.
93
+ - Adds the FitFlow 30-50-table packed-artifact acceptance journey, including
94
+ first read, PM-style aggregate Explore, Protect, proposal, bounded policy
95
+ approval, guarded writeback, receipts/replay, compensation, host parity,
96
+ privacy gates, and source-unchanged assertions before commit.
97
+ - Documents the full `APPROVAL ROLE` lifecycle from contract requirement
98
+ through external IdP claims and a verified immutable decision. A separate
99
+ local OIDC/JWKS issuer proves accepted reviewer/applier roles, role
100
+ separation, key rotation, and rejection of missing/similar roles, bad or
101
+ unknown signatures, expired/not-yet-valid tokens, wrong issuer/audience,
102
+ malformed claims, proof tampering, and cross-proposal replay.
103
+ - Adds default-off operator-supervised automatic apply as a separate execution
104
+ axis. Contract permission plus an independent deployment allowlist must match
105
+ one exact digest; old `AUTO APPROVE` remains manual-apply. Eligible
106
+ single-row INSERT/UPDATE work reuses guarded apply and repeats policy, limit,
107
+ scope, target/supporting-evidence freshness, writer-posture, receipt, and
108
+ lease checks before every execution.
109
+ - Adds durable redacted human-attention events and a coalesced Workbench inbox
110
+ for proposal, worker, boundary, schema, credential, policy, and sensitive
111
+ override lifecycle. A separately operated dispatcher supports quiet
112
+ per-sink routing, budgets, cooldowns, digests, JSONL development output, and
113
+ signed HTTPS webhooks. Notifications are disabled by default and never
114
+ authorize approval or mutation.
115
+ - Binds dead-letter notification replay to a fresh verified signed-key or OIDC
116
+ operator decision over the exact delivery revision and reason. Replay
117
+ requeues only the immutable redacted event, records `notification.replayed`,
118
+ and cannot replay approval or source mutation. The packed gate exercises two
119
+ competing dispatchers, zero default success noise, duplicate suppression,
120
+ metadata-endpoint SSRF refusal, and event-only replay with an unchanged
121
+ source snapshot.
122
+ - Adds pause/drain, exact-digest enable/disable/revoke, queue cancellation,
123
+ dead-letter, UNKNOWN/reconciliation, writer-posture, and optional required
124
+ attention-sink controls outside MCP. Fenced leases, limit reservations,
125
+ duplicate-consumption, process-death, known-commit, and ambiguous-outcome
126
+ paths retain the established fail-closed behavior.
127
+ - Makes CLI failure output recovery-oriented and keeps supported `--json`
128
+ failure paths to one parseable document with redacted diagnostics on stderr,
129
+ preserved-state information, source-change status, and one next action.
130
+ - Allows an explicit empty canonical `capabilities` array to represent a
131
+ validated zero-authority review draft and adds the optional canonical
132
+ `execution.supervised_worker` permission plus its public DSL clause. This
133
+ additive behavior is staged as `@synapsor/spec@1.6.0` and
134
+ `@synapsor/dsl@1.6.0`; legacy contracts retain their exact normalization and
135
+ digests.
136
+ - Published `@synapsor/runner@1.6.3`, `@synapsor/spec@1.6.0`, and
137
+ `@synapsor/dsl@1.6.0`.
138
+ - The clean Runner tarball gate used the locally packed public Spec before the
139
+ coordinated release, then returned to the stronger registry-only
140
+ dependency-resolution proof once npm had that exact Spec.
141
+
142
+ ## 1.6.2 (published 2026-07-23)
4
143
 
5
144
  ### Registry-installable packaging hotfix
6
145
 
@@ -16,7 +155,7 @@
16
155
  masking it with a simultaneously packed local Spec.
17
156
  - Contains the same proposal/evidence freshness runtime behavior prepared in
18
157
  `1.6.1`; this patch changes packaging and version surfaces only.
19
- - Prepares only `@synapsor/runner@1.6.2`. `@synapsor/spec@1.5.0` and
158
+ - Published only `@synapsor/runner@1.6.2`. `@synapsor/spec@1.5.0` and
20
159
  `@synapsor/dsl@1.5.0` remain unchanged.
21
160
 
22
161
  ## 1.6.1 (published 2026-07-23; install-broken)
package/CONTRIBUTING.md CHANGED
@@ -15,8 +15,10 @@ Please do not submit pull requests or code patches unless the maintainers have
15
15
  explicitly requested them under an approved contribution process.
16
16
 
17
17
  For maintainers, use small changes with tests. Do not add support for arbitrary
18
- SQL, multi-row updates, DDL, stored procedures, or model-generated write
19
- statements.
18
+ SQL, model-generated or unbounded multi-row predicates, DDL, stored procedures,
19
+ or model-generated write statements. Existing bounded-set support must retain
20
+ its reviewer-fixed predicate, hard row/value caps, atomic execution, frozen
21
+ members, and exact receipts.
20
22
 
21
23
  Before opening a change:
22
24
 
@@ -36,10 +38,15 @@ idempotency, replay, MCP tool exposure, or app-owned handlers must prove:
36
38
 
37
39
  - no model-facing `execute_sql`, raw SQL, approval, commit, apply, or writeback
38
40
  tool was added;
39
- - tenant/scope values come from trusted context, not model-controlled args;
41
+ - tenant/principal values come from trusted context, not model-controlled args;
40
42
  - direct writeback still checks primary key, tenant key, allowed columns,
41
43
  expected version/conflict guard, affected-row count, idempotency, and receipt
42
44
  recording;
45
+ - generated authority remains disabled until exact-digest human activation,
46
+ Scoped Explore remains local authoring-only, and reviewed relationship paths
47
+ cannot be supplied or activated by the model;
48
+ - proposal/evidence freshness and supervised worker apply continue to fail
49
+ closed on source, digest, scope, policy, limit, or role-posture drift;
43
50
  - app-owned handler templates tell developers to re-check tenant/scope,
44
51
  expected version, idempotency, allowed action, transaction/rollback, and
45
52
  receipt shape.
package/README.md CHANGED
@@ -21,9 +21,8 @@ No database, Docker, config, MCP client, LLM, or account is required:
21
21
  npx -y @synapsor/runner try --prove
22
22
  ```
23
23
 
24
- Timing begins after package resolution; cold `npx` download time varies.
25
-
26
- The embedded synthetic source requests a $55 waiver and proves:
24
+ Cold `npx` download time is excluded. The embedded source requests a $55
25
+ waiver and proves:
27
26
 
28
27
  ```text
29
28
  Proposed effect: late_fee_cents: 5500 -> 0
@@ -33,9 +32,8 @@ Restart-safe retry: yes; duplicate mutations: 0
33
32
  Stale apply refused: yes
34
33
  ```
35
34
 
36
- Review happens outside model-facing tools. State is stored under
37
- `./.synapsor/try/`; this proves the boundary, not your database connection.
38
- `demo --quick` remains a noninteractive compatibility alias.
35
+ State stays under `./.synapsor/try/`. This proves the boundary, not your
36
+ database connection; `demo --quick` remains a noninteractive compatibility alias.
39
37
 
40
38
  ## Audit An Existing MCP Server
41
39
 
@@ -45,41 +43,38 @@ Audit a typical raw-SQL MCP server without launching or calling one:
45
43
  npx -y @synapsor/runner audit --example dangerous-db-mcp
46
44
  ```
47
45
 
48
- Audit your own tool manifest, remote `tools/list`, or stdio server:
46
+ Or audit your own manifest, remote `tools/list`, or stdio server:
49
47
 
50
48
  ```bash
51
49
  npx -y @synapsor/runner audit ./tools-list.json
52
50
  ```
53
51
 
54
52
  It flags raw SQL, arbitrary identifiers, model-controlled authority, and
55
- model-facing writeback without calling business tools. See [MCP Database Risk
56
- Review](docs/mcp-audit.md) and the [alternatives
57
- guide](docs/alternatives.md).
53
+ model-facing writeback without calling business tools. See [MCP Audit](docs/mcp-audit.md).
58
54
 
59
55
  ## Connect Your Staging Application
60
56
 
61
- Use a dedicated SELECT-only, non-owner staging credential. Runner combines the
62
- whole database schema with statically parsed Prisma, Drizzle, OpenAPI, and
63
- existing Synapsor definitions. It does not execute adopter code, sample source
64
- rows, or use an LLM:
57
+ Use a SELECT-only, non-owner development or staging credential. Runner combines
58
+ database metadata with statically parsed Prisma, Drizzle, OpenAPI, and existing
59
+ Synapsor definitions without executing adopter code, sampling rows, or using an
60
+ LLM:
65
61
 
66
62
  ```bash
67
- npm install -g @synapsor/runner
68
- export DATABASE_URL="postgresql://runner_reader:REPLACE_ME@db.example.com:5432/app?sslmode=require"
69
- export SYNAPSOR_TENANT_ID="acme"
70
- export SYNAPSOR_PRINCIPAL="developer-1"
71
- synapsor-runner start --from-env DATABASE_URL --schema public
63
+ npx -y @synapsor/runner start
72
64
  ```
73
65
 
74
- A fresh project opens the secured localhost Workbench and emits disabled DSL,
75
- canonical JSON, tests, review evidence, and a generation lock. Review scope,
76
- fields, aggregate members, relationships, privacy budgets, profile, and exact
77
- role/RLS posture, then activate the exact digest. Existing tools stay unchanged.
66
+ Paste the URL into the hidden prompt, approve a regular project `.env` for this
67
+ process, or export `DATABASE_URL`. Runner creates a validated zero-authority
68
+ project and opens secured localhost Workbench. A personal-development fast lane
69
+ offers one conservative resource with sensitive fields, relationships, and
70
+ writes off; broader paths require full review.
71
+
72
+ [Database To First Safe Tool](docs/guided-onboarding.md) covers the complete
73
+ path.
78
74
 
79
75
  ## Ask Your First Real Question In Cursor
80
76
 
81
- After activation, let Runner add only the local authoring entry to this Cursor
82
- project:
77
+ After activation, install only the local authoring entry in this Cursor project:
83
78
 
84
79
  ```bash
85
80
  synapsor-runner mcp install cursor \
@@ -103,21 +98,25 @@ Which reviewed regions and reason categories contributed most to the increase
103
98
  in churned accounts by week?
104
99
  ```
105
100
 
106
- Runner accepts a typed plan, not SQL. It validates every member against the
107
- activated digest, injects trusted scope, and runs a read-only transaction.
108
- Small cohorts are suppressed and durable budgets limit repeated differencing.
109
- This is descriptive analysis, not proof of causation.
101
+ Runner validates a typed plan against the active digest, injects trusted scope,
102
+ and runs read-only. Suppression and durable budgets limit extraction. Up to
103
+ three activated one- or two-link many-to-one paths are supported; inactive or
104
+ unsafe joins fail closed. This is descriptive analysis, not causation. See
105
+ [Reviewed Relationships](docs/reviewed-relationships.md).
106
+
107
+ ### Optional: Ask In Workbench With Your Model
110
108
 
111
- Scoped Explore is local authoring only. Missing/unknown/production profiles,
112
- write-capable or owner credentials, stale generation locks, remote/shared HTTP,
113
- and non-loopback runtimes never advertise these tools.
109
+ The no-model composer remains the default. Optional local Workbench Ask can use
110
+ OpenAI, Anthropic, or a tested OpenAI-compatible endpoint after explicit
111
+ digest-bound egress consent. It can call only displayed reviewed tools; keys
112
+ and history remain in memory, and writes remain proposals. See [Workbench
113
+ Ask](docs/workbench-ask.md).
114
114
 
115
115
  ## Protect This Query
116
116
 
117
- Choose the useful result in Workbench. No opaque ID needs to be copied. Runner
118
- freezes the reviewed shape into public DSL, canonical JSON, and tests under
119
- `synapsor/protected/drafts/`. The named capability starts disabled and requires
120
- exact-digest human activation outside MCP.
117
+ Choose a useful result without copying an ID. Runner freezes public DSL,
118
+ canonical JSON, and tests under `synapsor/protected/drafts/`; the named
119
+ capability starts disabled.
121
120
 
122
121
  After activation, Scoped Explore is disabled. Update Cursor to the production
123
122
  config:
@@ -130,9 +129,8 @@ synapsor-runner mcp install cursor \
130
129
  --yes
131
130
  ```
132
131
 
133
- Production exposes the protected named capability, not `app.explore_data`.
134
- Read the complete [Auto Boundary, Scoped Explore, And Protect
135
- guide](docs/auto-boundary-and-scoped-explore.md).
132
+ Production exposes the activated named capability, never `app.explore_data`.
133
+ See [Explore And Protect](docs/auto-boundary-and-scoped-explore.md).
136
134
 
137
135
  ## Create An Exact Data PR
138
136
 
@@ -156,24 +154,17 @@ Effect plan_credit_cents: 0 -> 2500
156
154
  Source unchanged before approval: Yes
157
155
  ```
158
156
 
159
- Approve in Workbench outside MCP; a trusted operator or worker commits. Runner
160
- supports guarded single-row INSERT/UPDATE/DELETE, fixed-predicate bounded
161
- UPDATE/DELETE, and exact-review batch INSERT. Rich transactions and external
162
- effects use app-owned executors.
163
-
164
- Runner rechecks scope, policy, row version, bounds, idempotency, and affected
165
- rows before returning a receipt. A retry cannot duplicate the mutation and a
166
- stale proposal conflicts. Inspect the latest lifecycle without copying an ID:
157
+ Approval stays outside MCP. A trusted operator or worker rechecks scope,
158
+ freshness, policy, version, bounds, idempotency, and affected rows before a
159
+ receipt. Runner supports guarded single-row CRUD and bounded reviewed sets;
160
+ rich transactions use app-owned executors. Inspect without copying an ID:
167
161
 
168
162
  ```bash
169
163
  synapsor-runner lifecycle --details --store ./.synapsor/local.db
170
164
  ```
171
165
 
172
- For proposals whose review depends on other source rows, Runner 1.6.1 can also
173
- require a live target/supporting-evidence check immediately before every local
174
- approval. Apply rechecks those declared same-database dependencies again inside
175
- the write transaction; stale evidence produces zero mutation and requires a new
176
- proposal:
166
+ Optional same-database evidence freshness is checked before approval and again
167
+ inside direct-SQL apply; drift produces zero mutation:
177
168
 
178
169
  ```bash
179
170
  synapsor-runner proposals check-freshness latest \
@@ -181,10 +172,8 @@ synapsor-runner proposals check-freshness latest \
181
172
  --store ./.synapsor/local.db
182
173
  ```
183
174
 
184
- See the [own-database guide](docs/getting-started-own-database.md),
185
- [Cursor plugin guide](docs/cursor-plugin.md), and
186
- [proposal freshness](docs/proposal-evidence-freshness.md) and
187
- [store lifecycle](docs/store-lifecycle.md) guides for the complete paths.
175
+ See [Proposal Freshness](docs/proposal-evidence-freshness.md) and [Verified
176
+ Operator Identity](docs/approval-roles-and-operator-identity.md).
188
177
 
189
178
  ## Safety Model
190
179
 
@@ -192,7 +181,8 @@ Contracts fix trusted context, fields, bounds, transitions, and approval.
192
181
  Model-facing tools can inspect scoped data and propose exact changes, but cannot
193
182
  approve, apply, or revert. A trusted operator/worker performs guarded writeback;
194
183
  the ledger links evidence, proposal, decision, receipt, and replay. Runner does
195
- not make raw SQL or prompt-injection-prone clients safe.
184
+ not make raw SQL or prompt-injection-prone clients safe. Compare the boundary
185
+ with [prompt and application guardrails](docs/why-synapsor-vs-app-guardrails.md).
196
186
 
197
187
  ## Choose An Isolation Mode
198
188
 
@@ -203,13 +193,10 @@ not make raw SQL or prompt-injection-prone clients safe.
203
193
  | `postgres_rls` | PostgreSQL also checks transaction-bound tenant/principal scope. Arbitrary trusted-context or credential control remains outside this guarantee. |
204
194
  | `tenant_bound` | Authenticated context selects a restricted per-tenant credential or process. |
205
195
 
206
- Use stdio; no socket opens. HTTP requires authentication; non-loopback
207
- listeners require TLS or an explicit trusted TLS proxy. Shared services require
208
- signed claims. Model-controlled input and MCP session IDs never establish
209
- identity. See [HTTP MCP].
210
- MySQL has no native RLS; use restricted views or tenant credentials. See
211
- [Database scope] and the
212
- [build-vs-adopt guide](docs/why-synapsor-vs-app-guardrails.md).
196
+ Stdio opens no socket. HTTP requires authentication; remote listeners require
197
+ TLS or a trusted TLS proxy, and shared services require signed claims. MySQL has
198
+ no native RLS; use restricted views or tenant credentials. See [HTTP MCP] and
199
+ [Database scope].
213
200
 
214
201
  ## Review And Prove Your Contract
215
202
 
@@ -220,37 +207,30 @@ and the [own-database guide](docs/getting-started-own-database.md).
220
207
 
221
208
  ## Trust And Verification
222
209
 
223
- Start with the **[Threat Model](THREAT_MODEL.md)**. It defines protected assets,
224
- trust boundaries, covered threats, non-goals, and required operator controls.
225
-
226
- [Conformance fixtures](docs/conformance.md) and `contract test` cover trusted
227
- scope, kept-out fields, proposals, approval, receipts, and replay. Resource
228
- handles re-check tenant/principal rather than acting as bearer authority. Live
229
- gates cover principal denial, no pre-approval mutation, idempotency, conflict,
230
- bounded sets, compensation, and proposal/evidence freshness on disposable
231
- databases.
232
-
233
- Runner is a narrow agent/database safety boundary, not a replacement for
234
- least-privilege database access, host security, or application authorization.
235
- See [Security Boundary](docs/security-boundary.md) and
236
- [Current Limitations](docs/limitations.md).
210
+ Start with the **[Threat Model](THREAT_MODEL.md)** and [Security
211
+ Boundary](docs/security-boundary.md). Conformance and live disposable-database
212
+ gates cover scope, hidden fields, no pre-approval mutation, idempotency,
213
+ conflicts, bounded sets, freshness, receipts, and replay. Runner does not
214
+ replace least-privilege roles, host security, or application authorization.
237
215
 
238
216
  [Database scope]: docs/database-enforced-scope.md
239
217
  [HTTP MCP]: docs/http-mcp.md
240
218
 
241
219
  ## Operate The Approval Loop
242
220
 
243
- Policies can combine per-proposal and aggregate ceilings; exceeding one routes
244
- to human review. Local SQLite is the default, while bounded fleets can use
245
- verified HTTP claims and a shared Postgres runtime store. See
246
- [Production](docs/production.md), [Runner Config](docs/runner-config-reference.md),
247
- and [Small Runner Fleets](docs/running-a-runner-fleet.md).
221
+ Auto-approval does not mean auto-apply. Manual apply remains default unless the
222
+ exact contract digest and deployment both opt into a trusted supervised worker
223
+ that repeats all guards. External notifications are disabled and quiet by default.
224
+ A webhook response cannot approve or apply. See [Supervised
225
+ Apply](docs/supervised-automatic-apply.md) and
226
+ [Notifications](docs/human-attention-notifications.md).
248
227
 
249
228
  ## Packages
250
229
 
251
230
  | Package | Purpose |
252
231
  | --- | --- |
253
232
  | `@synapsor/runner` | CLI, MCP runtime, local ledger, proposals, approval, guarded writeback, replay, and MCP audit. |
233
+ | `synapsor-runner` | Optional short command alias that delegates to the exact matching `@synapsor/runner`; no separate runtime. |
254
234
  | `@synapsor/spec` | Canonical portable contracts for contexts, capabilities, workflows, evidence, proposals, receipts, and replay. |
255
235
  | `@synapsor/dsl` | SQL-like authoring that compiles contexts, capabilities, and workflow declarations into canonical contract JSON. |
256
236
  | `@synapsor/cli` | Synapsor Cloud administration, contract governance, human review, Runner connections, and shared audit records. |
@@ -278,6 +258,8 @@ guide](https://github.com/Synapsor/Synapsor-Runner/blob/main/docs/cloud-cli.md).
278
258
  - Follow the [step-by-step Synapsor Tutorial](https://github.com/sandeshtiwari/Synapsor-Tutorial).
279
259
  - Run the [`support-billing-agent` flagship example](examples/support-billing-agent).
280
260
  - Connect [Claude, Cursor, OpenAI Agents SDK, or another MCP client](docs/mcp-clients.md).
261
+ - Use the optional local [Workbench Ask](docs/workbench-ask.md) client without
262
+ broadening the reviewed tool surface.
281
263
  - Author and [push a validated contract to Cloud](docs/cloud-push.md).
282
264
  - Browse the [task-first documentation index](docs/README.md).
283
265
  - Report bugs or request features through [GitHub Issues](https://github.com/Synapsor/Synapsor-Runner/issues).
package/SECURITY.md CHANGED
@@ -6,6 +6,18 @@ Do not include production credentials, customer data, or full source rows in bug
6
6
 
7
7
  ## Supported security scope
8
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.
9
+ Runner protects the local model/database boundary for reviewed semantic reads,
10
+ structured proposals, verified approval, guarded writeback, receipts, replay,
11
+ local authoring-only typed Explore/Protect, and optional exact-digest supervised
12
+ execution. Optional Workbench Ask calls only that same reviewed runtime surface.
13
+ Human-attention notifications are redacted interruption channels and never
14
+ authority.
10
15
 
11
- See `docs/threat-model.md` for detailed trust boundaries, covered threats, non-goals, and release blockers.
16
+ It does not make the hosted Synapsor control plane self-hosted, prevent prompt
17
+ injection, replace database roles/RLS, or provide HA, compliance certification,
18
+ or a general database proxy. Reviewed visible data sent to an
19
+ operator-selected model provider is subject to that provider's own privacy and
20
+ retention terms.
21
+
22
+ See `THREAT_MODEL.md` and `docs/security-boundary.md` for detailed trust
23
+ boundaries, covered threats, non-goals, and release blockers.
package/THREAT_MODEL.md CHANGED
@@ -12,6 +12,13 @@ It is not a general MCP security gateway, not a prompt-injection cure, not a rep
12
12
  - Proposal diffs, evidence bundles, query audit, approvals, writeback jobs, receipts, and replay records.
13
13
  - Runner/session/operator tokens, local SQLite state, and optional shared
14
14
  Postgres proposal/evidence/replay ledger.
15
+ - Exact-digest supervised-worker policy, worker leases, attention events,
16
+ notification delivery records, and webhook signing secrets.
17
+ - Generated boundary drafts, review decisions, exact activation digests,
18
+ generation locks, reviewed relationship proofs, and Scoped Explore privacy
19
+ budgets.
20
+ - Optional Workbench Ask provider credentials and direct-egress consent held
21
+ only in the local process.
15
22
 
16
23
  ## Trust Boundaries
17
24
 
@@ -21,8 +28,8 @@ MCP client/model
21
28
  -> reviewed capability config
22
29
  -> read-only database credential
23
30
  -> local proposal/evidence/replay store
24
- -> human approval outside the model
25
- -> guarded worker with write credential
31
+ -> human or reviewed deterministic policy approval outside the model
32
+ -> manual apply or separately enabled guarded worker with write credential
26
33
  -> Postgres/MySQL
27
34
  ```
28
35
 
@@ -37,7 +44,11 @@ MCP client/model
37
44
  -> Postgres/MySQL
38
45
  ```
39
46
 
40
- The model-facing MCP tool call has request/proposal authority. The trusted runner has execution authority only for already-approved, scoped writeback jobs.
47
+ The model-facing MCP tool call has bounded request/proposal authority. The
48
+ trusted runner has execution authority only for already-approved, scoped
49
+ writeback jobs. Manual apply is the default. Supervised automatic execution
50
+ requires both contract permission and a deployment allowlist for the exact
51
+ active digest; the model controls neither.
41
52
 
42
53
  In small-fleet mode, a TLS load balancer sends signed sessions to stateless
43
54
  Runner instances. Every effective capability context must bind tenant and
@@ -48,6 +59,27 @@ idempotency boundary for effects.
48
59
  ## Covered Threats
49
60
 
50
61
  - Model asks for arbitrary SQL: no generic SQL tool is exposed in the Synapsor path.
62
+ - Model tries to turn Scoped Explore into generic SQL or production authority:
63
+ Explore accepts only reviewed typed plans, is local authoring-only, and is
64
+ absent from production, unknown-profile, remote, shared HTTP, and non-loopback
65
+ tool catalogs. Protect output starts disabled and requires exact-digest human
66
+ activation.
67
+ - Model invents or widens a join: aggregate relationships must be activated,
68
+ catalog-proven many-to-one paths with fan-out one; table/key/join semantics
69
+ and activation are not plan arguments. Ambiguous, one-to-many, many-to-many,
70
+ stale, and over-depth paths fail closed.
71
+ - Generated authority widens after schema/role drift: generated capability and
72
+ exploration authority are bound to schema, compiler/Spec, role, grant,
73
+ ownership, RLS, and reviewed-proof fingerprints. Manual legacy projects are
74
+ unaffected unless they adopt a generation lock.
75
+ - Optional Workbench Ask becomes a second policy engine: Ask lists and calls the
76
+ exact active MCP/runtime tools, adds no activation/approval/apply authority,
77
+ keeps provider choice outside model control, and treats provider prose/tool
78
+ arguments as untrusted.
79
+ - Provider endpoint exfiltration or SSRF: official origins are fixed, custom
80
+ remote origins require HTTPS, plaintext is loopback-only, redirects are
81
+ refused, DNS is revalidated and pinned, and private/link-local/metadata
82
+ destinations fail closed.
51
83
  - Model supplies `tenant_id`, `principal`, source id, allowed columns, row version, or approval identity: runner rejects trusted-binding overrides.
52
84
  - Prompt injection in database content asks the model to bypass policy: the runner ignores text as authority and only accepts structured capability/job state.
53
85
  - Aggregate inference through a one-record group: reviewed aggregate tools
@@ -65,7 +97,17 @@ idempotency boundary for effects.
65
97
  - Over-broad write: direct INSERT/UPDATE/DELETE is single-row, tenant-bound,
66
98
  operation-guarded, and success requires exactly one affected row.
67
99
  - Cloud credential leakage: database URLs and write credentials stay local and are not sent to Cloud.
68
- - Model-callable approval: approval/commit tools are not exposed to MCP clients by default.
100
+ - Model-callable approval or execution: activation, approval, apply, worker,
101
+ notification-routing, and recovery controls are not exposed to MCP clients.
102
+ - Stale policy-approved work: supervised execution repeats current policy,
103
+ limit, tenant/principal, target and supporting-evidence freshness,
104
+ generation-lock, writer-posture, receipt, and lease checks before apply.
105
+ - Notification confused deputy or replay: webhook destinations and filters are
106
+ operator-owned; payloads are redacted and HMAC-signed with event ID and
107
+ timestamp; response content and delivery replay cannot authorize or mutate.
108
+ - Notification flood: the default external route is quiet; related incidents
109
+ coalesce, transient recovery stays internal, and per-sink budgets/cooldowns
110
+ bound non-critical interruption while retaining immutable events.
69
111
  - Claims/environment confusion: an `http_claims` server fails before serving
70
112
  if a capability resolves an environment/static contract context.
71
113
  - Leaked local resource handle: proposal, evidence, and replay reads resolve
@@ -88,12 +130,16 @@ idempotency boundary for effects.
88
130
  - Credential theft outside the runner process.
89
131
  - OAuth, SSRF, token-passthrough, or confused-deputy bugs in unrelated MCP systems.
90
132
  - Sensitive data already returned to a model.
133
+ - Reviewed visible data intentionally sent to an operator-selected external
134
+ model provider after Workbench egress consent; the provider's retention and
135
+ training policy remains outside Runner.
91
136
  - Prompt injection itself.
92
137
  - Business invariants not represented in the capability config, proposal, application handler, or database constraints.
93
138
  - Generic multi-row business transactions, DDL, UPSERT, model-generated
94
139
  predicates, or cross-database atomicity in the Runner direct-write path.
95
140
  - A compromised IdP/JWKS host, ledger database, source database, TLS
96
141
  terminator, or administrator-approved contract.
142
+ - A compromised operator-approved notification destination or signing secret.
97
143
  - Unbounded/high-throughput or multi-region ledger scale, compliance
98
144
  certification, or production SLA.
99
145
 
@@ -106,6 +152,12 @@ idempotency boundary for effects.
106
152
  - Prefer version/timestamp conflict guards over weak row-hash fallback.
107
153
  - Review proposal diffs and evidence before approval.
108
154
  - Monitor conflict/failed receipt rates.
155
+ - Keep automatic execution disabled unless both exact-digest opt-ins and a
156
+ separately scoped least-privilege writer are reviewed. Monitor queue,
157
+ dead-letter, UNKNOWN, reconciliation, and writer-posture state.
158
+ - Keep notifications disabled unless needed. Store webhook URL/signing secret
159
+ only in operator environment, allowlist egress, and treat Workbench/ledger as
160
+ authoritative rather than a chat or incident system.
109
161
  - Allowlist JWKS egress, keep `/metrics` separately authorized, budget source
110
162
  pools across replicas, back up/verify the shared ledger, and retain the
111
163
  configured `max_entries` safety bound.
@@ -113,6 +165,14 @@ idempotency boundary for effects.
113
165
  queues; `dev_env` is unverified.
114
166
  - Treat proposal/evidence/replay handles as identifiers, not authorization;
115
167
  preserve verified per-session context on every networked resource read.
168
+ - Keep Scoped Explore and Workbench Ask local to explicit development/staging
169
+ authoring, verify a SELECT-only non-owner role, and disable Explore before
170
+ production. Production should serve only activated named capabilities.
171
+ - Review generation-lock and relationship-proof drift instead of bypassing it,
172
+ and do not treat Prisma/Drizzle/OpenAPI names as authorization.
173
+ - For Workbench Ask, choose provider/model/origin yourself, acknowledge direct
174
+ egress, keep keys out of project files and chat, and clear in-memory sessions
175
+ when finished.
116
176
 
117
177
  ## Release Blockers
118
178