@synapsor/runner 1.5.4 → 1.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +68 -2
- package/README.md +131 -124
- package/dist/authoring.mjs +405 -9
- package/dist/cli.d.ts.map +1 -1
- package/dist/local-ui.d.ts +6 -1
- package/dist/local-ui.d.ts.map +1 -1
- package/dist/runner.mjs +17206 -12169
- package/dist/runtime.mjs +11249 -8542
- package/dist/shadow.mjs +408 -15
- package/docs/README.md +14 -6
- package/docs/aggregate-reads.md +22 -0
- package/docs/app-owned-executors.md +8 -0
- package/docs/auto-boundary-and-scoped-explore.md +338 -0
- package/docs/capability-authoring.md +75 -0
- package/docs/conformance.md +16 -0
- package/docs/current-scope.md +60 -28
- package/docs/cursor-plugin.md +20 -3
- package/docs/dsl-reference.md +78 -0
- package/docs/getting-started-own-database.md +39 -35
- package/docs/limitations.md +37 -7
- package/docs/local-mode.md +22 -3
- package/docs/production.md +19 -0
- package/docs/proposal-evidence-freshness.md +334 -0
- package/docs/release-notes.md +63 -4
- package/docs/runner-config-reference.md +46 -0
- package/docs/schema-api-candidates.md +28 -1
- package/docs/security-boundary.md +17 -0
- package/docs/store-lifecycle.md +8 -0
- package/docs/troubleshooting-first-run.md +174 -0
- package/docs/writeback-executors.md +8 -0
- package/examples/app-owned-writeback/command-handler.mjs +0 -0
- package/examples/auto-boundary-churn/README.md +23 -0
- package/examples/auto-boundary-churn/app/page.tsx +8 -0
- package/examples/auto-boundary-churn/docker-compose.yml +16 -0
- package/examples/auto-boundary-churn/package.json +18 -0
- package/examples/auto-boundary-churn/prisma/schema.prisma +36 -0
- package/examples/auto-boundary-churn/seed/postgres.sql +126 -0
- package/examples/mcp-postgres-billing-app-handler/scripts/run-demo.sh +0 -0
- package/examples/reference-support-billing-app/scripts/run-demo.sh +0 -0
- package/examples/support-billing-agent/scripts/run-demo.sh +0 -0
- package/examples/support-billing-agent/scripts/run-evaluation.sh +0 -0
- package/fixtures/compatibility/published-1.5.4/manifest.json +76 -0
- package/fixtures/compatibility/published-1.5.4/sources/packages/dsl/examples/aggregate-read.synapsor.sql +21 -0
- package/fixtures/compatibility/published-1.5.4/sources/packages/dsl/examples/billing-late-fee.synapsor.sql +56 -0
- package/fixtures/compatibility/published-1.5.4/sources/packages/dsl/examples/bounded-set-multi-term.synapsor.sql +30 -0
- package/fixtures/compatibility/published-1.5.4/sources/packages/dsl/examples/principal-row-scope.synapsor.sql +23 -0
- package/fixtures/compatibility/published-1.5.4/sources/packages/spec/fixtures/conformance/aggregate-read/contract.json +119 -0
- package/fixtures/compatibility/published-1.5.4/sources/packages/spec/fixtures/conformance/approval-quorum/contract.json +44 -0
- package/fixtures/compatibility/published-1.5.4/sources/packages/spec/fixtures/conformance/bounded-set-threats/contract.json +115 -0
- package/fixtures/compatibility/published-1.5.4/sources/packages/spec/fixtures/conformance/principal-row-scope/contract.json +78 -0
- package/fixtures/compatibility/published-1.5.4/sources/packages/spec/fixtures/conformance/proposal-capability/contract.json +101 -0
- package/fixtures/compatibility/published-1.5.4/sources/packages/spec/fixtures/conformance/reversible-change-sets/contract.json +98 -0
- package/fixtures/compatibility/published-1.5.4/sources/packages/spec/fixtures/valid/basic-read.contract.json +60 -0
- package/fixtures/compatibility/published-1.6.0/manifest.json +76 -0
- package/fixtures/compatibility/published-1.6.0/sources/packages/dsl/examples/aggregate-read.synapsor.sql +21 -0
- package/fixtures/compatibility/published-1.6.0/sources/packages/dsl/examples/billing-late-fee.synapsor.sql +56 -0
- package/fixtures/compatibility/published-1.6.0/sources/packages/dsl/examples/bounded-set-multi-term.synapsor.sql +30 -0
- package/fixtures/compatibility/published-1.6.0/sources/packages/dsl/examples/principal-row-scope.synapsor.sql +23 -0
- package/fixtures/compatibility/published-1.6.0/sources/packages/spec/fixtures/conformance/aggregate-read/contract.json +119 -0
- package/fixtures/compatibility/published-1.6.0/sources/packages/spec/fixtures/conformance/approval-quorum/contract.json +44 -0
- package/fixtures/compatibility/published-1.6.0/sources/packages/spec/fixtures/conformance/bounded-set-threats/contract.json +115 -0
- package/fixtures/compatibility/published-1.6.0/sources/packages/spec/fixtures/conformance/principal-row-scope/contract.json +78 -0
- package/fixtures/compatibility/published-1.6.0/sources/packages/spec/fixtures/conformance/proposal-capability/contract.json +101 -0
- package/fixtures/compatibility/published-1.6.0/sources/packages/spec/fixtures/conformance/reversible-change-sets/contract.json +98 -0
- package/fixtures/compatibility/published-1.6.0/sources/packages/spec/fixtures/valid/basic-read.contract.json +60 -0
- package/fixtures/protocol/MANIFEST.json +37 -7
- package/fixtures/protocol/change-set.freshness-update.v2.json +58 -0
- package/fixtures/protocol/freshness-authority.invoice.v1.json +35 -0
- package/fixtures/protocol/freshness-proof.fresh.v1.json +38 -0
- package/fixtures/protocol/writeback-job.freshness-update.v2.json +50 -0
- package/llms.txt +38 -0
- package/package.json +12 -8
- package/schemas/change-set.v1.schema.json +1 -0
- package/schemas/change-set.v2.schema.json +1 -0
- package/schemas/change-set.v3.schema.json +1 -0
- package/schemas/freshness-authority.v1.schema.json +89 -0
- package/schemas/freshness-proof.v1.schema.json +73 -0
- package/schemas/synapsor.runner.schema.json +50 -1
- package/schemas/writeback-job.v1.schema.json +1 -0
- package/schemas/writeback-job.v2.schema.json +1 -0
- package/schemas/writeback-job.v3.schema.json +1 -0
package/docs/current-scope.md
CHANGED
|
@@ -2,40 +2,72 @@
|
|
|
2
2
|
|
|
3
3
|
The canonical scope page is [Current Limitations](limitations.md).
|
|
4
4
|
|
|
5
|
-
Current `1.
|
|
5
|
+
Current `1.6` scope:
|
|
6
6
|
|
|
7
|
-
- local semantic MCP tools
|
|
8
|
-
- schema
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
-
|
|
12
|
-
|
|
7
|
+
- local semantic MCP tools over Postgres/MySQL without raw SQL tools;
|
|
8
|
+
- deterministic whole-schema Auto Boundary drafting from database metadata,
|
|
9
|
+
statically parsed Prisma/Drizzle schemas, OpenAPI documents, and existing
|
|
10
|
+
Synapsor definitions;
|
|
11
|
+
- disabled generated `.synapsor.sql`, canonical JSON, tests, review evidence,
|
|
12
|
+
and generation locks; no generated authority activates itself;
|
|
13
|
+
- local development/staging Scoped Explore through exactly two temporary MCP
|
|
14
|
+
tools, using typed row plans or a reviewed PM-style analytical cube;
|
|
15
|
+
- aggregate `count`, reviewed `count_distinct`, `sum`, `avg`, reviewed
|
|
16
|
+
dimensions and day/week/month buckets, typed filters, bounded top-N, and at
|
|
17
|
+
most one proven many-to-one relationship;
|
|
18
|
+
- cohort suppression plus durable extraction, differencing, rate, query,
|
|
19
|
+
response, and complexity limits;
|
|
20
|
+
- Protect This Query from a successful local plan to public DSL, canonical
|
|
21
|
+
Spec, tests, and a disabled digest-bound named production capability;
|
|
22
|
+
- schema, grant, ownership, RLS, role, compiler, and Spec drift checks for
|
|
23
|
+
generated authority explicitly bound to a generation lock;
|
|
24
|
+
- trusted context from environment, verified HTTP claims, Cloud sessions, or
|
|
25
|
+
explicit development-only static values;
|
|
26
|
+
- evidence handles, normalized query audit, proposals, receipts, local replay,
|
|
27
|
+
and read-only lifecycle inspection without copying proposal ids;
|
|
28
|
+
- optional proposal/evidence freshness: live target and declared same-source
|
|
29
|
+
supporting-row checks before every approval, proof-bound human/quorum/policy
|
|
30
|
+
decisions, and atomic direct-SQL dependency revalidation at apply;
|
|
31
|
+
- guarded single-row `INSERT`, `UPDATE`, and `DELETE`;
|
|
13
32
|
- fixed-predicate set `UPDATE`/`DELETE` and exact-review batch `INSERT`, with
|
|
14
33
|
mandatory row/value caps, frozen members, human approval, atomic execution,
|
|
15
34
|
and protocol-v3 exact receipts;
|
|
16
|
-
- opt-in reviewed compensation for direct SQL
|
|
17
|
-
|
|
18
|
-
- app-owned `http_handler` and `command_handler` executors for
|
|
19
|
-
business transactions;
|
|
20
|
-
- stdio MCP, Streamable HTTP MCP, and a
|
|
21
|
-
-
|
|
22
|
-
Postgres review state,
|
|
23
|
-
|
|
35
|
+
- opt-in reviewed compensation for supported direct SQL changes, using a
|
|
36
|
+
separate operator proposal and protocol-v4 receipt;
|
|
37
|
+
- safety-wrapped app-owned `http_handler` and `command_handler` executors for
|
|
38
|
+
richer approved business transactions;
|
|
39
|
+
- stdio MCP, authenticated Streamable HTTP MCP, and a legacy JSON-RPC bridge;
|
|
40
|
+
- bounded small-fleet operation with signed claim-bound sessions, shared
|
|
41
|
+
Postgres review state, pools, rate limits, readiness, quorum, dead letters,
|
|
42
|
+
and backup/restore/retention.
|
|
43
|
+
|
|
44
|
+
Scoped Explore is an authoring-plane feature, not a production runtime feature.
|
|
45
|
+
It is disabled by default, requires an explicit development/staging profile and
|
|
46
|
+
a demonstrably read-only non-owner role, and is never advertised by production,
|
|
47
|
+
unknown-profile, shared HTTP, remote, or non-loopback surfaces. Production uses
|
|
48
|
+
only activated named capabilities, including capabilities created through
|
|
49
|
+
Protect.
|
|
24
50
|
|
|
25
51
|
Stable `1.x` compatibility covers the documented `synapsor-runner` binary,
|
|
26
|
-
config schema version `1`,
|
|
27
|
-
HTTP
|
|
28
|
-
inspection
|
|
52
|
+
config schema version `1`, canonical public contracts, result envelopes,
|
|
53
|
+
stdio/Streamable HTTP, established onboarding and CI routes, proposal/evidence/
|
|
54
|
+
replay inspection, guarded writeback, and app-owned executor contracts.
|
|
55
|
+
Existing hand-authored projects do not need Auto Boundary, Workbench,
|
|
56
|
+
generation locks, schema rescans, or new fields; their tool lists do not change
|
|
57
|
+
unless the feature is explicitly adopted.
|
|
29
58
|
|
|
30
59
|
Out of scope:
|
|
31
60
|
|
|
32
|
-
- raw `execute_sql
|
|
33
|
-
-
|
|
34
|
-
-
|
|
35
|
-
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
|
|
39
|
-
-
|
|
40
|
-
|
|
41
|
-
-
|
|
61
|
+
- raw `execute_sql`, SQL strings, model-generated SQL, or arbitrary identifiers;
|
|
62
|
+
- production Scoped Explore or a general-purpose analytics/query AST;
|
|
63
|
+
- general join planning, many-to-many exploration, arbitrary formulas,
|
|
64
|
+
functions, windows, `HAVING`, subqueries, or statistical privacy guarantees;
|
|
65
|
+
- model-selected tenant/principal, activation, approval, or commit authority;
|
|
66
|
+
- UPSERT, DDL, free-form predicates, unbounded writes, or cross-table direct
|
|
67
|
+
transactions;
|
|
68
|
+
- strict atomic freshness for app-owned handlers, APIs, or cross-source
|
|
69
|
+
dependencies; those executors own their transaction preconditions;
|
|
70
|
+
- physical branching of external Postgres/MySQL or automatic rollback/time
|
|
71
|
+
travel;
|
|
72
|
+
- self-hosted Synapsor Cloud, an unbounded/multi-region shared ledger, a managed
|
|
73
|
+
Runner fleet, production SLA, or compliance certification.
|
package/docs/cursor-plugin.md
CHANGED
|
@@ -14,12 +14,12 @@ plugin-reference, MCP, and deeplink documentation on 2026-07-20:
|
|
|
14
14
|
- <https://cursor.com/docs/reference/deeplinks>
|
|
15
15
|
|
|
16
16
|
The locally installed Cursor version used for validation is recorded in
|
|
17
|
-
`development/runner-1.
|
|
17
|
+
`development/runner-1.6.0-progress.md`. Protocol/static validation is not a
|
|
18
18
|
claim that Cursor Marketplace review has completed.
|
|
19
19
|
|
|
20
20
|
## What the plugin installs
|
|
21
21
|
|
|
22
|
-
- one stdio MCP server pinned to `@synapsor/runner@1.
|
|
22
|
+
- one production stdio MCP server pinned to `@synapsor/runner@1.6.1`;
|
|
23
23
|
- one `/synapsor-protect` agent command;
|
|
24
24
|
- one discoverable Safe Action skill;
|
|
25
25
|
- one file-scoped rule for `synapsor/actions/**/*.ts`;
|
|
@@ -29,6 +29,23 @@ The MCP entry uses Cursor's documented `${workspaceFolder}` interpolation for
|
|
|
29
29
|
`synapsor.runner.json` and `.synapsor/local.db`. It exposes only `mcp serve`.
|
|
30
30
|
Approval, apply, activation, commit, and revert remain outside MCP.
|
|
31
31
|
|
|
32
|
+
Auto Boundary authoring uses a separate CLI-managed project entry rather than
|
|
33
|
+
the production plugin entry:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
synapsor-runner mcp install cursor \
|
|
37
|
+
--project \
|
|
38
|
+
--authoring \
|
|
39
|
+
--project-root . \
|
|
40
|
+
--yes
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
That temporary local stdio entry is accepted only after exact boundary
|
|
44
|
+
activation and advertises exactly `app.describe_data` and `app.explore_data`.
|
|
45
|
+
After Protect activation, reinstall the normal project config; production then
|
|
46
|
+
advertises only named reviewed capabilities. The plugin never makes Scoped
|
|
47
|
+
Explore available to production, shared HTTP, remote, or non-loopback serving.
|
|
48
|
+
|
|
32
49
|
## Build and verify
|
|
33
50
|
|
|
34
51
|
```bash
|
|
@@ -63,7 +80,7 @@ Required listing media:
|
|
|
63
80
|
|
|
64
81
|
## Submission checklist
|
|
65
82
|
|
|
66
|
-
- [ ] Runner 1.
|
|
83
|
+
- [ ] Runner 1.6.1 package and plugin version agree.
|
|
67
84
|
- [ ] `corepack pnpm verify:cursor-plugin` passes from a clean checkout.
|
|
68
85
|
- [ ] Plugin is manually loaded in current stable Cursor at workspace scope.
|
|
69
86
|
- [ ] `/synapsor-protect` drafts and validates without activation.
|
package/docs/dsl-reference.md
CHANGED
|
@@ -168,6 +168,84 @@ Aggregate reads cannot declare model arguments, lookup, visible row fields,
|
|
|
168
168
|
proposal clauses, joins, grouping, or arbitrary expressions. See [Bounded
|
|
169
169
|
Aggregate Reads](aggregate-reads.md).
|
|
170
170
|
|
|
171
|
+
## Protected named reads
|
|
172
|
+
|
|
173
|
+
`PROTECTED READ` is the public DSL emitted by Protect This Query. It freezes a
|
|
174
|
+
successful local authoring plan into a named capability. It is not the
|
|
175
|
+
temporary `app.explore_data` plan grammar and it is not a generic query AST.
|
|
176
|
+
|
|
177
|
+
This aggregate example is representative:
|
|
178
|
+
|
|
179
|
+
```sql
|
|
180
|
+
CREATE CAPABILITY analytics.churn_contributors_by_week
|
|
181
|
+
DESCRIPTION 'Describe reviewed weekly churn contributors.'
|
|
182
|
+
RETURNS HINT 'Returns privacy-suppressed reviewed groups.'
|
|
183
|
+
USING CONTEXT analytics_operator
|
|
184
|
+
SOURCE local_postgres
|
|
185
|
+
ON public.account_churn
|
|
186
|
+
PRIMARY KEY id
|
|
187
|
+
TENANT KEY tenant_id
|
|
188
|
+
ARG period_start STRING REQUIRED MAX LENGTH 32
|
|
189
|
+
ARG period_end STRING REQUIRED MAX LENGTH 32
|
|
190
|
+
PROTECTED READ AGGREGATE
|
|
191
|
+
BOUNDARY DIGEST sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
|
192
|
+
GENERATION LOCK sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
|
|
193
|
+
PROTECTED FILTER status EQ FIXED 'churned'
|
|
194
|
+
PROTECTED FILTER churned_at GTE ARG period_start
|
|
195
|
+
PROTECTED FILTER churned_at LT ARG period_end
|
|
196
|
+
MEASURE churned_accounts COUNT ROWS
|
|
197
|
+
MEASURE affected_customers COUNT DISTINCT customer_id
|
|
198
|
+
GROUP DIMENSION region BY region
|
|
199
|
+
GROUP DIMENSION reason BY churn_reason
|
|
200
|
+
TIME DIMENSION churn_week BY WEEK OF churned_at
|
|
201
|
+
AGGREGATE ORDER BY MEASURE churned_accounts DESC
|
|
202
|
+
TOP 20 GROUPS
|
|
203
|
+
MIN GROUP SIZE 5
|
|
204
|
+
KEEP OUT email, private_notes
|
|
205
|
+
REQUIRE EVIDENCE
|
|
206
|
+
PROTECTED LIMITS ROWS 50 GROUPS 50 CELLS 500 BYTES 65536 TIMEOUT MS 3000 QUERIES 40 EXTRACTED CELLS 4000 DIFFERENCING 6 RATE PER MINUTE 20
|
|
207
|
+
END
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
In that example, uppercase phrases such as `PROTECTED READ AGGREGATE`,
|
|
211
|
+
`BOUNDARY DIGEST`, `MEASURE`, `GROUP DIMENSION`, and `TOP ... GROUPS` are DSL
|
|
212
|
+
keywords. Names such as `analytics.churn_contributors_by_week`,
|
|
213
|
+
`churned_accounts`, `affected_customers`, `region`, and `churn_week` are
|
|
214
|
+
user-reviewed identifiers. Table/column references such as
|
|
215
|
+
`public.account_churn`, `customer_id`, and `churned_at` come from inspected
|
|
216
|
+
schema evidence and are frozen into the capability.
|
|
217
|
+
|
|
218
|
+
The protected clauses mean:
|
|
219
|
+
|
|
220
|
+
| Clause | Reviewed meaning |
|
|
221
|
+
| --- | --- |
|
|
222
|
+
| `PROTECTED READ ROWS` / `AGGREGATE` | Selects a frozen row or aggregate protected-read shape. |
|
|
223
|
+
| `BOUNDARY DIGEST sha256:...` | Binds the capability to the exact human-activated exploration authority. |
|
|
224
|
+
| `GENERATION LOCK sha256:...` | Binds it to the reviewed schema, role/grant/RLS posture, compiler, and Spec fingerprint. |
|
|
225
|
+
| `PROTECTED RELATIONSHIP name ON local_key REFERENCES schema.table.target_key PRIMARY KEY pk TENANT KEY tenant [PRINCIPAL SCOPE KEY principal]` | Freezes at most one inspected, reviewed many-to-one path with fan-out one. |
|
|
226
|
+
| `PROTECTED FILTER field OP FIXED value` | Freezes a reviewed literal. `OP` is `EQ`, `NEQ`, `LT`, `LTE`, `GT`, `GTE`, or bounded fixed-list `IN`. |
|
|
227
|
+
| `PROTECTED FILTER field OP ARG name` | Allows only one declared typed/bounded argument at that reviewed literal position. |
|
|
228
|
+
| `ALLOW READ ...` / `ROW ORDER BY ...` | Freezes row projection and up to three fixed sort fields for row mode. |
|
|
229
|
+
| `MEASURE alias COUNT ROWS` | Counts the reviewed subject entity. |
|
|
230
|
+
| `MEASURE alias COUNT DISTINCT field` | Counts distinct values of a field approved for aggregate use; the raw values need not be visible. |
|
|
231
|
+
| `MEASURE alias SUM|AVG field` | Uses an explicitly approved aggregate-safe numeric measure. |
|
|
232
|
+
| `GROUP DIMENSION alias BY field` | Freezes a reviewed categorical grouping. |
|
|
233
|
+
| `TIME DIMENSION alias BY DAY|WEEK|MONTH OF field` | Freezes one reviewed timestamp and bucket. |
|
|
234
|
+
| `COMPARE RANGE field FROM value TO value` | Freezes at most two bounded reviewed time ranges. |
|
|
235
|
+
| `TOP n GROUPS` / `MIN GROUP SIZE n` | Fixes output breadth and cohort suppression. |
|
|
236
|
+
| `PROTECTED LIMITS ...` | Fixes row/group/response/time/query/extraction/differencing/rate budgets; MCP arguments cannot widen them. |
|
|
237
|
+
|
|
238
|
+
Protect normally generates this verbose authority block so that reviewers do
|
|
239
|
+
not have to transcribe digests or limits. The generated DSL compiles through
|
|
240
|
+
`@synapsor/dsl` into the optional default-deny `protected_read` field in the
|
|
241
|
+
canonical Spec. Existing contracts with no `protected_read` field normalize
|
|
242
|
+
and hash exactly as before.
|
|
243
|
+
|
|
244
|
+
Protected row and aggregate capabilities can be served after exact-digest
|
|
245
|
+
activation even when temporary Scoped Explore is disabled. Production never
|
|
246
|
+
needs or advertises `app.explore_data`. See [Auto Boundary, Scoped Explore, And
|
|
247
|
+
Protect](auto-boundary-and-scoped-explore.md).
|
|
248
|
+
|
|
171
249
|
## Read surface and evidence
|
|
172
250
|
|
|
173
251
|
```sql
|
|
@@ -1,62 +1,66 @@
|
|
|
1
1
|
# Connect Your Own Database
|
|
2
2
|
|
|
3
|
-
Use this path after the
|
|
4
|
-
against a staging or disposable Postgres/MySQL database.
|
|
3
|
+
Use this path after the synthetic proof passes and you want to try Synapsor
|
|
4
|
+
Runner against a staging or disposable Postgres/MySQL database.
|
|
5
5
|
|
|
6
6
|
Do not start with your most sensitive production database. Runner is a
|
|
7
|
-
|
|
8
|
-
production certification.
|
|
7
|
+
reviewed data boundary, not a production certification.
|
|
9
8
|
|
|
10
9
|
If you only ran `synapsor-runner demo --quick`, you have tested the fixture-only
|
|
11
10
|
teaching path and local ledger commands. This page is the real own-database
|
|
12
|
-
path
|
|
13
|
-
|
|
11
|
+
path. Auto Boundary inspects the whole selected schema, combines deterministic
|
|
12
|
+
database/Prisma/Drizzle/OpenAPI/Synapsor evidence, and generates disabled
|
|
13
|
+
review artifacts without sampling source rows or using an LLM.
|
|
14
14
|
|
|
15
15
|
## Fast path
|
|
16
16
|
|
|
17
|
-
Set
|
|
17
|
+
Set a dedicated SELECT-only, non-owner database URL plus trusted development
|
|
18
|
+
scope and run the public guided path:
|
|
18
19
|
|
|
19
20
|
```bash
|
|
20
21
|
export DATABASE_URL="<postgres-or-mysql-read-url>"
|
|
22
|
+
export SYNAPSOR_TENANT_ID="<staging-tenant>"
|
|
23
|
+
export SYNAPSOR_PRINCIPAL="<developer-id>"
|
|
21
24
|
npx -y -p @synapsor/runner synapsor-runner start --from-env DATABASE_URL
|
|
22
25
|
```
|
|
23
26
|
|
|
24
|
-
|
|
27
|
+
A fresh interactive project with no existing config, selector, or automation
|
|
28
|
+
input follows:
|
|
25
29
|
|
|
26
30
|
```text
|
|
27
|
-
inspect
|
|
28
|
-
->
|
|
29
|
-
->
|
|
30
|
-
->
|
|
31
|
-
->
|
|
32
|
-
->
|
|
33
|
-
->
|
|
34
|
-
->
|
|
35
|
-
->
|
|
31
|
+
inspect the whole selected schema and structured application artifacts
|
|
32
|
+
-> draft disabled public DSL, canonical JSON, tests, and generation lock
|
|
33
|
+
-> review scope, fields, analytics permissions, relationships, and budgets
|
|
34
|
+
-> activate the exact exploration-boundary digest in local Workbench
|
|
35
|
+
-> install exactly app.describe_data and app.explore_data in Cursor
|
|
36
|
+
-> ask a bounded row or PM-style aggregate question against staging
|
|
37
|
+
-> Protect This Query into a disabled named capability
|
|
38
|
+
-> activate that exact digest and remove broad Explore
|
|
39
|
+
-> serve only the named protected capability in production
|
|
36
40
|
```
|
|
37
41
|
|
|
38
42
|
It does not print your database URL, put the URL in MCP client config, expose
|
|
39
43
|
`execute_sql`, expose approval/commit tools, or give the model write
|
|
40
|
-
credentials.
|
|
44
|
+
credentials. Before boundary activation it does not read source rows.
|
|
41
45
|
|
|
42
46
|
`start --from-env` is the shortest public command for first-run onboarding.
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
The rest of this page
|
|
58
|
-
|
|
59
|
-
global binary is not linked
|
|
47
|
+
Read [Auto Boundary, Scoped Explore, And
|
|
48
|
+
Protect](auto-boundary-and-scoped-explore.md) for the complete command and
|
|
49
|
+
security reference.
|
|
50
|
+
|
|
51
|
+
Established routes remain unchanged. `--table`, `--answers`, `onboard db`,
|
|
52
|
+
explicit `init` flags, existing configs, headless startup, JSON output, and CI
|
|
53
|
+
do not enter Auto Boundary, prompt unexpectedly, open a browser, rescan an
|
|
54
|
+
existing project, or require a generation lock. For example:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
synapsor-runner start --from-env DATABASE_URL --table invoices --no-open
|
|
58
|
+
synapsor-runner onboard db --from-env DATABASE_URL --answers ./answers.json
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
The rest of this page documents those established one-object/manual routes.
|
|
62
|
+
They remain supported for existing projects and automation. From a source
|
|
63
|
+
checkout, use `./bin/synapsor-runner ...` if the global binary is not linked.
|
|
60
64
|
|
|
61
65
|
From a source checkout, `./scripts/use-your-db.sh` runs the same kind of
|
|
62
66
|
guided flow plus local repository checks.
|
package/docs/limitations.md
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
# Limitations
|
|
2
2
|
|
|
3
|
-
Synapsor Runner is intentionally narrow. Version 1.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
Synapsor Runner is intentionally narrow. Version 1.6 adds deterministic
|
|
4
|
+
whole-application boundary drafting and a local authoring-only Explore ->
|
|
5
|
+
Protect path on top of guarded writes. Version 1.6.1 also adds opt-in
|
|
6
|
+
proposal/evidence freshness for exact same-source direct-SQL proposals. It does
|
|
7
|
+
not turn Runner into a generic database query tool, claim Synapsor Cloud scale,
|
|
8
|
+
or claim an enterprise SLA.
|
|
7
9
|
|
|
8
10
|
## Supported
|
|
9
11
|
|
|
@@ -15,6 +17,9 @@ enterprise SLA.
|
|
|
15
17
|
- Native Postgres/MySQL source pools and operational/fleet-wide rate limits.
|
|
16
18
|
- Verified operator approval through CLI, optional distinct-reviewer quorum,
|
|
17
19
|
and shared local review UI reads.
|
|
20
|
+
- Optional live target and explicitly declared supporting-row freshness checks
|
|
21
|
+
before every approval, with immutable proof binding and final transactional
|
|
22
|
+
revalidation for PostgreSQL/MySQL direct SQL writeback.
|
|
18
23
|
- Separately protected scrapeable metrics and dead-letter recovery commands.
|
|
19
24
|
- Shared-ledger backup/digest verification, clean restore, and
|
|
20
25
|
archive-before-retention.
|
|
@@ -49,6 +54,19 @@ enterprise SLA.
|
|
|
49
54
|
- Capability recipes that generate reviewed starter configs.
|
|
50
55
|
- Shadow-mode proposal-vs-human-action comparison.
|
|
51
56
|
- Static MCP database risk review.
|
|
57
|
+
- Deterministic whole-schema Auto Boundary drafting from database metadata,
|
|
58
|
+
statically parsed Prisma/Drizzle schema artifacts, OpenAPI documents, and
|
|
59
|
+
existing Synapsor definitions. Generated authority starts disabled.
|
|
60
|
+
- Local development/staging Scoped Explore through exactly
|
|
61
|
+
`app.describe_data` and `app.explore_data`, with no SQL-string argument.
|
|
62
|
+
- Reviewed PM-style aggregate Explore with `count`, `count_distinct`, `sum`,
|
|
63
|
+
`avg`, categorical dimensions, fixed time buckets, typed filters, bounded
|
|
64
|
+
top-N, optional one-hop proven many-to-one relationships, cohort suppression,
|
|
65
|
+
and durable extraction/differencing budgets.
|
|
66
|
+
- Protect This Query to public DSL, canonical JSON, tests, and a disabled named
|
|
67
|
+
capability that survives Explore shutdown after exact-digest activation.
|
|
68
|
+
- Generation-lock drift detection for generated authority. Manually authored
|
|
69
|
+
projects without a lock retain their previous behavior.
|
|
52
70
|
- Local indexed search for proposals, evidence bundles, query audit, writeback
|
|
53
71
|
receipts, and proposal replay.
|
|
54
72
|
- DSL enum arguments and fixed, tenant-scoped aggregate count/sum/avg tools
|
|
@@ -77,6 +95,8 @@ truth for the model-facing tools.
|
|
|
77
95
|
- Policy auto-approval for bounded sets.
|
|
78
96
|
- Stored procedures.
|
|
79
97
|
- Cross-database transactions.
|
|
98
|
+
- Strict atomic proposal freshness across databases, app-owned handlers, or
|
|
99
|
+
external APIs. Those paths must enforce their own final preconditions.
|
|
80
100
|
- Physical branching of Postgres/MySQL.
|
|
81
101
|
- Full Synapsor workflow/DAG execution.
|
|
82
102
|
- `CREATE AGENT WORKFLOW` or hosted Synapsor SQL generation.
|
|
@@ -89,8 +109,12 @@ truth for the model-facing tools.
|
|
|
89
109
|
- Prompt-injection prevention.
|
|
90
110
|
- Unbounded/high-throughput or multi-region ledger scale.
|
|
91
111
|
- Managed fleet, SLA, compliance certification, or production support guarantee.
|
|
92
|
-
-
|
|
93
|
-
|
|
112
|
+
- Production, shared HTTP, remote, or non-loopback Scoped Explore.
|
|
113
|
+
- Arbitrary aggregate expressions, dynamic identifiers, unrestricted joins,
|
|
114
|
+
many-to-many joins, formulas, window functions, subqueries, `HAVING`,
|
|
115
|
+
user-defined functions, or a statistical privacy guarantee. Version 1.6
|
|
116
|
+
supports only the explicitly reviewed authoring cube described above and
|
|
117
|
+
fixed protected named capabilities produced from it.
|
|
94
118
|
- Automatic policy widening or activation from graduated-trust metrics.
|
|
95
119
|
- Immutable/WORM compliance storage from the local report exporter.
|
|
96
120
|
|
|
@@ -120,7 +144,7 @@ not a hosted central evidence service, organization RBAC/SSO, compliance
|
|
|
120
144
|
retention system, or unbounded search engine. Each bridge operation serializes
|
|
121
145
|
through an advisory lock and fails above configured `max_entries`.
|
|
122
146
|
|
|
123
|
-
Only homogeneous 1.
|
|
147
|
+
Only homogeneous 1.x fleet operation is claimed for protocol-v4 compensation
|
|
124
148
|
jobs. Mixed-minor v3/v4 rolling compensation is not claimed.
|
|
125
149
|
See [Running A Small Runner
|
|
126
150
|
Fleet](running-a-runner-fleet.md).
|
|
@@ -146,3 +170,9 @@ as equivalent to a durable version column.
|
|
|
146
170
|
Runner-ledger UPDATE and DELETE require an exact guard; UPDATE must advance it
|
|
147
171
|
inside the source transaction. INSERT requires a reviewed source-unique dedup
|
|
148
172
|
identity. See [Guarded Single-Row CRUD Writeback](guarded-crud-writeback.md).
|
|
173
|
+
|
|
174
|
+
Approval-time freshness also depends on a correct exact version column. It
|
|
175
|
+
does not freeze source state until apply. Direct SQL apply rechecks again;
|
|
176
|
+
app-owned/cross-source effects do not receive that Runner-owned atomic
|
|
177
|
+
guarantee. See
|
|
178
|
+
[Proposal And Evidence Freshness](proposal-evidence-freshness.md).
|
package/docs/local-mode.md
CHANGED
|
@@ -140,10 +140,19 @@ Show a proposal:
|
|
|
140
140
|
npx -y -p @synapsor/runner synapsor-runner proposals show wrp_123 --store ./.synapsor/local.db
|
|
141
141
|
```
|
|
142
142
|
|
|
143
|
+
Check a freshness-enabled proposal without copying its id:
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
npx -y -p @synapsor/runner synapsor-runner proposals check-freshness latest \
|
|
147
|
+
--config ./synapsor.runner.json \
|
|
148
|
+
--store ./.synapsor/local.db
|
|
149
|
+
```
|
|
150
|
+
|
|
143
151
|
Approve:
|
|
144
152
|
|
|
145
153
|
```bash
|
|
146
154
|
npx -y -p @synapsor/runner synapsor-runner proposals approve wrp_123 \
|
|
155
|
+
--config ./synapsor.runner.json \
|
|
147
156
|
--store ./.synapsor/local.db \
|
|
148
157
|
--actor local_reviewer \
|
|
149
158
|
--yes
|
|
@@ -151,6 +160,14 @@ npx -y -p @synapsor/runner synapsor-runner proposals approve wrp_123 \
|
|
|
151
160
|
|
|
152
161
|
Before approval, the CLI prints the reviewer-critical proposal details: trusted principal, tenant, target row, primary key, required role, proposal hash/version, allowed columns, conflict guard, evidence bundle/query fingerprint, writeback boundary, source mutation state, and exact before/after diff. Interactive approval still requires typing `yes`; noninteractive scripts must pass `--yes`.
|
|
153
162
|
|
|
163
|
+
When `proposal_freshness` is configured for that capability, approval also
|
|
164
|
+
performs a live read-only check of the target and each declared same-source
|
|
165
|
+
supporting dependency. A fresh result is bound to the approval by proof digest.
|
|
166
|
+
A stale result records no approval and terminally conflicts the proposal; an
|
|
167
|
+
unavailable source records no approval and leaves it pending. Apply always
|
|
168
|
+
revalidates again because source data can change after approval. See
|
|
169
|
+
[Proposal And Evidence Freshness](proposal-evidence-freshness.md).
|
|
170
|
+
|
|
154
171
|
Create a guarded writeback job from an approved proposal:
|
|
155
172
|
|
|
156
173
|
```bash
|
|
@@ -203,9 +220,11 @@ npx -y -p @synapsor/runner synapsor-runner ui --config synapsor.runner.json --st
|
|
|
203
220
|
```
|
|
204
221
|
|
|
205
222
|
The UI shows setup summary, semantic tools, proposal states, exact diffs,
|
|
206
|
-
evidence, approval state, receipts, and replay.
|
|
207
|
-
|
|
208
|
-
approve
|
|
223
|
+
evidence, live freshness state, approval state, receipts, and replay. A
|
|
224
|
+
freshness-required approve control stays disabled until the live result is
|
|
225
|
+
fresh; the approve request performs another live check. The UI binds to
|
|
226
|
+
`127.0.0.1` by default, uses a per-run local session token, and requires CSRF
|
|
227
|
+
protection for approve/reject actions.
|
|
209
228
|
|
|
210
229
|
The UI does not expose raw SQL, database URLs, password values, MCP approval
|
|
211
230
|
tools, MCP commit tools, or controls that widen configured tables/columns.
|
package/docs/production.md
CHANGED
|
@@ -191,6 +191,16 @@ business action, transaction boundaries, and safe errors. See
|
|
|
191
191
|
[Writeback Executors](writeback-executors.md) and
|
|
192
192
|
[Handler Helper](handler-helper.md).
|
|
193
193
|
|
|
194
|
+
For a direct SQL proposal whose approval depends on live source facts, use the
|
|
195
|
+
optional `proposal_freshness` overlay. It rechecks the target and declared
|
|
196
|
+
same-source supporting rows before approval, then locks and rechecks them again
|
|
197
|
+
inside the final PostgreSQL/MySQL transaction. Run
|
|
198
|
+
`doctor --check-writeback` to prove that the writer can perform every
|
|
199
|
+
dependency locking read. App-owned and cross-source effects must enforce their
|
|
200
|
+
own equivalent transactional preconditions; Runner rejects them from strict
|
|
201
|
+
freshness mode. See
|
|
202
|
+
[Proposal And Evidence Freshness](proposal-evidence-freshness.md).
|
|
203
|
+
|
|
194
204
|
## Local Ledger
|
|
195
205
|
|
|
196
206
|
Default local ledger path:
|
|
@@ -589,6 +599,10 @@ Doctor reports should be redacted by default before sharing. They must not
|
|
|
589
599
|
include database passwords, bearer tokens, handler secrets, or raw driver
|
|
590
600
|
connection strings.
|
|
591
601
|
|
|
602
|
+
For freshness-enabled proposals, `--check-writeback` includes rollback-only
|
|
603
|
+
dependency lock probes. A passing metadata/read check alone does not prove that
|
|
604
|
+
the writer has the locking privilege needed at apply.
|
|
605
|
+
|
|
592
606
|
## Logging And Redaction
|
|
593
607
|
|
|
594
608
|
Expected public outputs must avoid secrets in:
|
|
@@ -613,3 +627,8 @@ Before promoting a package or calling a build production-candidate:
|
|
|
613
627
|
The release gate should cover typecheck, focused tests, packed-package install,
|
|
614
628
|
quick demo, own-db fixture, MCP stdio/HTTP checks, direct writeback,
|
|
615
629
|
app-owned executor paths, package dry-run, and docs/package consistency.
|
|
630
|
+
The 1.6.1 security gate additionally runs:
|
|
631
|
+
|
|
632
|
+
```bash
|
|
633
|
+
corepack pnpm test:proposal-freshness
|
|
634
|
+
```
|