@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.
- package/AGENTS.md +2 -2
- package/CHANGELOG.md +141 -2
- package/CONTRIBUTING.md +10 -3
- package/README.md +65 -83
- package/SECURITY.md +14 -2
- package/THREAT_MODEL.md +64 -4
- package/dist/authoring.mjs +151 -16
- package/dist/cli.d.ts +31 -3
- package/dist/cli.d.ts.map +1 -1
- package/dist/local-ui.d.ts +145 -1
- package/dist/local-ui.d.ts.map +1 -1
- package/dist/runner.mjs +37488 -19009
- package/dist/runtime.mjs +4056 -235
- package/dist/shadow.mjs +2423 -65
- package/docs/README.md +36 -2
- package/docs/agent-guided-setup.md +239 -0
- package/docs/aggregate-reads.md +14 -5
- package/docs/app-owned-executors.md +5 -6
- package/docs/approval-roles-and-operator-identity.md +353 -0
- package/docs/auto-boundary-and-scoped-explore.md +89 -11
- package/docs/capability-authoring.md +21 -2
- package/docs/client-recipes.md +1 -1
- package/docs/cloud-mode.md +7 -7
- package/docs/conformance.md +6 -3
- package/docs/current-scope.md +32 -2
- package/docs/cursor-plugin.md +3 -3
- package/docs/database-enforced-scope.md +6 -0
- package/docs/dsl-json-parity.md +75 -0
- package/docs/dsl-reference.md +22 -1
- package/docs/fresh-developer-usability.md +155 -80
- package/docs/getting-started-own-database.md +45 -44
- package/docs/guarded-crud-writeback.md +19 -0
- package/docs/guided-onboarding.md +399 -0
- package/docs/human-attention-notifications.md +367 -0
- package/docs/limitations.md +49 -13
- package/docs/local-mode.md +36 -22
- package/docs/mcp-audit.md +14 -14
- package/docs/mcp-client-setup.md +11 -14
- package/docs/mcp-clients.md +1 -1
- package/docs/migrating-to-synapsor-spec.md +42 -0
- package/docs/openai-agents-sdk.md +2 -2
- package/docs/production.md +39 -0
- package/docs/proposal-evidence-freshness.md +7 -7
- package/docs/recipes.md +6 -6
- package/docs/release-notes.md +144 -4
- package/docs/release-policy.md +20 -7
- package/docs/reversible-change-sets.md +1 -1
- package/docs/reviewed-database-views.md +132 -0
- package/docs/reviewed-relationships.md +245 -0
- package/docs/rfcs/006-reviewed-reversible-change-sets.md +1 -1
- package/docs/runner-bundles.md +7 -7
- package/docs/runner-config-reference.md +132 -0
- package/docs/running-a-runner-fleet.md +16 -1
- package/docs/schema-api-candidates.md +1 -1
- package/docs/security-boundary.md +54 -0
- package/docs/store-lifecycle.md +20 -1
- package/docs/supervised-automatic-apply.md +267 -0
- package/docs/troubleshooting-first-run.md +85 -10
- package/docs/use-your-own-database.md +6 -4
- package/docs/workbench-ask.md +279 -0
- package/docs/writeback-executors.md +7 -7
- package/examples/auto-boundary-churn/README.md +1 -1
- package/examples/community-solar-clean-room/README.md +7 -0
- package/examples/community-solar-clean-room/docker-compose.yml +16 -0
- package/examples/community-solar-clean-room/package.json +15 -0
- package/examples/community-solar-clean-room/prisma/schema.prisma +171 -0
- package/examples/community-solar-clean-room/seed/postgres.sql +571 -0
- package/examples/fitflow-guided-onboarding/README.md +43 -0
- package/examples/fitflow-guided-onboarding/app/page.tsx +8 -0
- package/examples/fitflow-guided-onboarding/docker-compose.yml +16 -0
- package/examples/fitflow-guided-onboarding/package.json +18 -0
- package/examples/fitflow-guided-onboarding/prisma/schema.prisma +98 -0
- package/examples/fitflow-guided-onboarding/seed/postgres.sql +401 -0
- package/examples/openai-agents-http/Makefile +1 -1
- package/examples/openai-agents-http/README.md +1 -1
- package/examples/openai-agents-stdio/Makefile +1 -1
- package/examples/openai-agents-stdio/README.md +2 -2
- package/examples/openai-agents-stdio/agent.py +1 -4
- package/examples/operator-oidc/issuer.mjs +188 -0
- package/examples/reference-support-billing-app/README.md +16 -16
- package/examples/retail-clean-room/README.md +7 -0
- package/examples/retail-clean-room/docker-compose.yml +16 -0
- package/examples/retail-clean-room/package.json +9 -0
- package/examples/retail-clean-room/prisma/schema.prisma +239 -0
- package/examples/retail-clean-room/seed/postgres.sql +781 -0
- package/examples/retail-clean-room/view-recipe/average-retained-revenue.synapsor.sql +21 -0
- package/examples/retail-clean-room/view-recipe/synapsor.runner.json +25 -0
- package/examples/support-plan-credit/README.md +6 -2
- package/examples/support-plan-credit/mcp-client-examples/claude-code.sh +1 -4
- package/examples/support-plan-credit/mcp-client-examples/claude-desktop.json +1 -4
- package/examples/support-plan-credit/mcp-client-examples/codex.config.toml +1 -4
- package/examples/support-plan-credit/mcp-client-examples/cursor-global.mcp.json +1 -4
- package/examples/support-plan-credit/mcp-client-examples/cursor-project.mcp.json +1 -4
- package/examples/support-plan-credit/mcp-client-examples/generic-stdio.json +1 -4
- package/examples/support-plan-credit/mcp-client-examples/generic-stdio.mjs +1 -1
- package/examples/support-plan-credit/mcp-client-examples/google-adk.py +1 -1
- package/examples/support-plan-credit/mcp-client-examples/langchain.mjs +1 -1
- package/examples/support-plan-credit/mcp-client-examples/llamaindex.py +1 -1
- package/examples/support-plan-credit/mcp-client-examples/openai-agents-stdio.ts +1 -1
- package/examples/support-plan-credit/mcp-client-examples/vscode.mcp.json +1 -4
- package/fixtures/compatibility/published-1.6.3/manifest.json +76 -0
- package/fixtures/compatibility/published-1.6.3/sources/packages/dsl/examples/aggregate-read.synapsor.sql +21 -0
- package/fixtures/compatibility/published-1.6.3/sources/packages/dsl/examples/billing-late-fee.synapsor.sql +56 -0
- package/fixtures/compatibility/published-1.6.3/sources/packages/dsl/examples/bounded-set-multi-term.synapsor.sql +30 -0
- package/fixtures/compatibility/published-1.6.3/sources/packages/dsl/examples/principal-row-scope.synapsor.sql +23 -0
- package/fixtures/compatibility/published-1.6.3/sources/packages/spec/fixtures/conformance/aggregate-read/contract.json +119 -0
- package/fixtures/compatibility/published-1.6.3/sources/packages/spec/fixtures/conformance/approval-quorum/contract.json +44 -0
- package/fixtures/compatibility/published-1.6.3/sources/packages/spec/fixtures/conformance/bounded-set-threats/contract.json +115 -0
- package/fixtures/compatibility/published-1.6.3/sources/packages/spec/fixtures/conformance/principal-row-scope/contract.json +78 -0
- package/fixtures/compatibility/published-1.6.3/sources/packages/spec/fixtures/conformance/proposal-capability/contract.json +101 -0
- package/fixtures/compatibility/published-1.6.3/sources/packages/spec/fixtures/conformance/reversible-change-sets/contract.json +98 -0
- package/fixtures/compatibility/published-1.6.3/sources/packages/spec/fixtures/valid/basic-read.contract.json +60 -0
- package/llms.txt +10 -5
- package/package.json +11 -3
- package/schemas/schema-candidate-review.schema.json +42 -0
- package/schemas/synapsor.runner.schema.json +227 -4
package/docs/store-lifecycle.md
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
# Store Lifecycle
|
|
2
2
|
|
|
3
3
|
Synapsor Runner keeps local evidence, query audit, proposals, receipts, replay,
|
|
4
|
-
|
|
4
|
+
worker state, human-attention events, notification delivery state, and
|
|
5
|
+
lifecycle events in a SQLite store.
|
|
5
6
|
|
|
6
7
|
Default path:
|
|
7
8
|
|
|
@@ -143,6 +144,24 @@ event. The `lifecycle` command never does that; it only reports the most recent
|
|
|
143
144
|
stored proof and approval linkage. See
|
|
144
145
|
[Proposal And Evidence Freshness](proposal-evidence-freshness.md).
|
|
145
146
|
|
|
147
|
+
## Human Attention And Delivery State
|
|
148
|
+
|
|
149
|
+
The store records immutable attention events, coalesced incident projections,
|
|
150
|
+
and sink-specific delivery attempts. Inspect them without copying an ID:
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
synapsor-runner attention show --store ./.synapsor/local.db
|
|
154
|
+
synapsor-runner notifications status --store ./.synapsor/local.db --json
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Acknowledgement changes only the attention projection. Notification replay
|
|
158
|
+
requires a fresh verified signed-key or OIDC operator decision plus an explicit
|
|
159
|
+
reason. That decision is bound to the exact delivery revision, requeues only
|
|
160
|
+
the original redacted event, and appends an immutable
|
|
161
|
+
`notification.replayed` audit event. Neither command approves, applies,
|
|
162
|
+
reconciles, or repeats a source mutation. See
|
|
163
|
+
[Human Attention And Notifications](human-attention-notifications.md).
|
|
164
|
+
|
|
146
165
|
## Server leases
|
|
147
166
|
|
|
148
167
|
MCP server modes write a small lease file next to the store:
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
# Operator-Supervised Automatic Apply
|
|
2
|
+
|
|
3
|
+
Synapsor separates two decisions that are often incorrectly combined:
|
|
4
|
+
|
|
5
|
+
1. Who or what may approve a proposal?
|
|
6
|
+
2. Who or what may execute an approved proposal?
|
|
7
|
+
|
|
8
|
+
The model answers neither question. It supplies a bounded request through a
|
|
9
|
+
reviewed capability. Human-reviewed policy may approve that exact immutable
|
|
10
|
+
proposal, and a separately operated Runner worker may apply it only after
|
|
11
|
+
revalidating the complete guarded-write boundary.
|
|
12
|
+
|
|
13
|
+
Supervised automatic apply is additive and disabled by default. Upgrading does
|
|
14
|
+
not start a worker, change existing `AUTO APPROVE` behavior, or apply an
|
|
15
|
+
already-approved proposal.
|
|
16
|
+
|
|
17
|
+
## The Four Supported Modes
|
|
18
|
+
|
|
19
|
+
| Approval | Execution | Behavior |
|
|
20
|
+
| --- | --- | --- |
|
|
21
|
+
| Human | Manual | Default: a qualified operator approves and explicitly runs `apply`. |
|
|
22
|
+
| Human | Supervised worker | A qualified operator approves; the trusted worker may apply. |
|
|
23
|
+
| Policy auto-approval | Manual | Reviewed policy approves; an operator still runs `apply`. This is the legacy `AUTO APPROVE` behavior. |
|
|
24
|
+
| Policy auto-approval | Supervised worker | Reviewed policy approves; an independently enabled worker may guardedly apply. |
|
|
25
|
+
|
|
26
|
+
The default remains human approval plus manual apply.
|
|
27
|
+
|
|
28
|
+
## Dual Opt-In
|
|
29
|
+
|
|
30
|
+
Automatic execution requires both:
|
|
31
|
+
|
|
32
|
+
1. Contract permission, included in the canonical contract digest.
|
|
33
|
+
2. Deployment permission for the exact capability and exact active digest.
|
|
34
|
+
|
|
35
|
+
Public DSL (Domain-Specific Language):
|
|
36
|
+
|
|
37
|
+
```sql
|
|
38
|
+
CREATE CAPABILITY billing.propose_small_credit
|
|
39
|
+
...
|
|
40
|
+
AUTO APPROVE WHEN amount_cents <= 2500
|
|
41
|
+
LIMIT 20 PER DAY
|
|
42
|
+
ALLOW SUPERVISED WORKER APPLY;
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
The final clause compiles to:
|
|
46
|
+
|
|
47
|
+
```json
|
|
48
|
+
{
|
|
49
|
+
"execution": {
|
|
50
|
+
"supervised_worker": "allowed"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
That permission alone applies nothing. The operator must separately configure
|
|
56
|
+
an exact deployment allowlist:
|
|
57
|
+
|
|
58
|
+
```json
|
|
59
|
+
{
|
|
60
|
+
"supervised_worker": {
|
|
61
|
+
"enabled": true,
|
|
62
|
+
"profile": "production",
|
|
63
|
+
"capabilities": [
|
|
64
|
+
{
|
|
65
|
+
"capability": "billing.propose_small_credit",
|
|
66
|
+
"contract_digest": "sha256:REPLACE_WITH_THE_ACTIVE_DIGEST",
|
|
67
|
+
"mode": "supervised_worker",
|
|
68
|
+
"concurrency": 1,
|
|
69
|
+
"queue_limit": 100,
|
|
70
|
+
"lease_seconds": 60,
|
|
71
|
+
"max_attempts": 5,
|
|
72
|
+
"proposal_ttl_seconds": 3600,
|
|
73
|
+
"rate_limit": {
|
|
74
|
+
"executions": 20,
|
|
75
|
+
"window_seconds": 60
|
|
76
|
+
},
|
|
77
|
+
"write_url_env": "BILLING_POSTGRES_WRITE_URL",
|
|
78
|
+
"worker_identity": "billing_worker",
|
|
79
|
+
"control_role": "runner_operator",
|
|
80
|
+
"require_least_privilege_writer": true,
|
|
81
|
+
"writer_posture_fingerprint": "sha256:REPLACE_WITH_REVIEWED_POSTURE_DIGEST"
|
|
82
|
+
}
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Use environment-variable names in config, never database URLs or credentials.
|
|
89
|
+
Production also requires verified `signed_key` or `jwt_oidc` operator identity
|
|
90
|
+
for worker controls.
|
|
91
|
+
|
|
92
|
+
If either opt-in is absent, stale, revoked, or mismatched, the proposal remains
|
|
93
|
+
unapplied. Enabling the worker globally does not enable another capability or a
|
|
94
|
+
new contract version.
|
|
95
|
+
|
|
96
|
+
## Initial Eligible Write Shapes
|
|
97
|
+
|
|
98
|
+
The hardened supervised path is intentionally narrower than manual apply. It
|
|
99
|
+
accepts only direct-SQL, single-row proposal capabilities whose complete effect
|
|
100
|
+
Runner can validate:
|
|
101
|
+
|
|
102
|
+
- `UPDATE` with trusted tenant scope and an exact non-weak conflict/version
|
|
103
|
+
guard;
|
|
104
|
+
- `INSERT` with trusted tenant scope and a reviewed deterministic
|
|
105
|
+
deduplication key.
|
|
106
|
+
|
|
107
|
+
It currently refuses:
|
|
108
|
+
|
|
109
|
+
- `DELETE`;
|
|
110
|
+
- reversible actions;
|
|
111
|
+
- bounded-set and other multi-row writes;
|
|
112
|
+
- app-owned executors or external effects;
|
|
113
|
+
- arbitrary or model-generated SQL;
|
|
114
|
+
- a missing trusted tenant boundary;
|
|
115
|
+
- an unavailable receipt authority;
|
|
116
|
+
- a shared, privileged, owner, `BYPASSRLS`, or otherwise unverifiable writer
|
|
117
|
+
when hardened posture is required.
|
|
118
|
+
|
|
119
|
+
These operations remain available through their documented manual review/apply
|
|
120
|
+
or app-owned executor paths. The narrower worker eligibility does not remove
|
|
121
|
+
existing Runner write capabilities.
|
|
122
|
+
|
|
123
|
+
## What The Worker Rechecks
|
|
124
|
+
|
|
125
|
+
Immediately before leasing and applying, Runner rechecks:
|
|
126
|
+
|
|
127
|
+
- proposal state, immutable hash, version, approval, expiry, and exact active
|
|
128
|
+
contract digest;
|
|
129
|
+
- contract permission, deployment allowlist, worker identity, control state,
|
|
130
|
+
profile, generation lock, and current approval-policy snapshot;
|
|
131
|
+
- trusted tenant and principal scope;
|
|
132
|
+
- target row and required supporting-evidence freshness;
|
|
133
|
+
- current source version and exact reviewed before-state;
|
|
134
|
+
- operation, allowed columns, bounds, transitions, row count, and expected
|
|
135
|
+
effect;
|
|
136
|
+
- approval and execution count/value limits under concurrency;
|
|
137
|
+
- writer credential separation, least-privilege posture, grants, and
|
|
138
|
+
PostgreSQL RLS posture where configured;
|
|
139
|
+
- operation identity, deduplication, receipt authority, and active lease.
|
|
140
|
+
|
|
141
|
+
A policy-approved proposal does not gain permanent authority. If the target row
|
|
142
|
+
or mandatory supporting evidence changes before execution, the worker fails
|
|
143
|
+
closed with the established conflict/freshness outcome. A refreshed diff is a
|
|
144
|
+
new proposal with a new hash and needs its own approval.
|
|
145
|
+
|
|
146
|
+
Manual and supervised execution converge on the same guarded apply
|
|
147
|
+
implementation. The queue is durable work coordination, not a second mutation
|
|
148
|
+
engine.
|
|
149
|
+
|
|
150
|
+
## Run And Operate The Worker
|
|
151
|
+
|
|
152
|
+
Validate first:
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
synapsor-runner config validate --config ./synapsor.runner.json
|
|
156
|
+
synapsor-runner doctor --config ./synapsor.runner.json
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
Run one supervised claim:
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
synapsor-runner worker run --supervised --once --yes \
|
|
163
|
+
--worker-id billing_worker \
|
|
164
|
+
--config ./synapsor.runner.json
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
Run continuously:
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
synapsor-runner worker run --supervised --yes \
|
|
171
|
+
--worker-id billing_worker \
|
|
172
|
+
--config ./synapsor.runner.json
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
Inspect without copying proposal IDs:
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
synapsor-runner worker status --config ./synapsor.runner.json
|
|
179
|
+
synapsor-runner attention show --config ./synapsor.runner.json
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
Operator controls:
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
synapsor-runner worker pause --yes --config ./synapsor.runner.json
|
|
186
|
+
synapsor-runner worker resume --yes --config ./synapsor.runner.json
|
|
187
|
+
synapsor-runner worker drain --yes --config ./synapsor.runner.json
|
|
188
|
+
|
|
189
|
+
synapsor-runner worker disable billing.propose_small_credit \
|
|
190
|
+
--digest sha256:EXACT_DIGEST --yes --config ./synapsor.runner.json
|
|
191
|
+
synapsor-runner worker enable billing.propose_small_credit \
|
|
192
|
+
--digest sha256:EXACT_DIGEST --yes --config ./synapsor.runner.json
|
|
193
|
+
synapsor-runner worker revoke billing.propose_small_credit \
|
|
194
|
+
--digest sha256:EXACT_DIGEST --yes --config ./synapsor.runner.json
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
`revoke` is terminal for that digest. Pause, drain, disable, and revoke stop new
|
|
198
|
+
leasing but preserve queued proposals and durable history. They do not interrupt
|
|
199
|
+
a transaction that already committed.
|
|
200
|
+
|
|
201
|
+
Dead-letter recovery remains explicit and identity-verified:
|
|
202
|
+
|
|
203
|
+
```bash
|
|
204
|
+
synapsor-runner worker dead-letter list --config ./synapsor.runner.json
|
|
205
|
+
synapsor-runner worker dead-letter show wrp_... --config ./synapsor.runner.json
|
|
206
|
+
synapsor-runner worker dead-letter requeue wrp_... --retry-budget 3 --yes \
|
|
207
|
+
--config ./synapsor.runner.json --identity alice --identity-key ./alice.pem
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
Use the secured Workbench for the same queue, pause/drain, exact-digest,
|
|
211
|
+
dead-letter, and reconciliation controls.
|
|
212
|
+
|
|
213
|
+
## Retry And Crash Boundary
|
|
214
|
+
|
|
215
|
+
Runner may retry only a classified transient failure with a proven non-commit
|
|
216
|
+
outcome. Version conflict, stale authority, scope failure, limit failure,
|
|
217
|
+
validation failure, and receipt mismatch do not retry automatically.
|
|
218
|
+
|
|
219
|
+
Delivery may repeat; mutation must not. Worker leases are fenced, and source
|
|
220
|
+
operation identity plus receipts prevent duplicate effects.
|
|
221
|
+
|
|
222
|
+
When the database outcome is unknown, Runner does not guess:
|
|
223
|
+
|
|
224
|
+
- source-receipt mode resolves a known committed operation from the source-side
|
|
225
|
+
receipt;
|
|
226
|
+
- genuinely ambiguous runner-ledger outcomes enter
|
|
227
|
+
`reconciliation_required`;
|
|
228
|
+
- automatic retry stops until a verified operator inspects and resolves the
|
|
229
|
+
established reconciliation record.
|
|
230
|
+
|
|
231
|
+
This is safe retry and explicit ambiguity handling, not a claim of distributed
|
|
232
|
+
exactly-once execution.
|
|
233
|
+
|
|
234
|
+
## Optional Supervision-Health Gate
|
|
235
|
+
|
|
236
|
+
An exact capability policy may name `required_attention_sinks`:
|
|
237
|
+
|
|
238
|
+
```json
|
|
239
|
+
{
|
|
240
|
+
"required_attention_sinks": ["operations"]
|
|
241
|
+
}
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
When present, the worker leaves eligible work queued until every named,
|
|
245
|
+
enabled sink has a healthy delivery record. Sink health never approves a
|
|
246
|
+
proposal and never bypasses either execution opt-in. This gate is off unless a
|
|
247
|
+
capability explicitly names required sinks.
|
|
248
|
+
|
|
249
|
+
See [Human Attention And Notifications](human-attention-notifications.md) for
|
|
250
|
+
quiet defaults, signed webhooks, routing, and the Workbench inbox.
|
|
251
|
+
|
|
252
|
+
## Accurate Model-Facing Claim
|
|
253
|
+
|
|
254
|
+
Without supervised execution:
|
|
255
|
+
|
|
256
|
+
> This call creates a proposal and does not change the source database.
|
|
257
|
+
|
|
258
|
+
With exact supervised execution enabled:
|
|
259
|
+
|
|
260
|
+
> This call creates a proposal. If it satisfies the reviewed automatic-approval
|
|
261
|
+
> policy, a separately trusted Runner worker may automatically apply it without
|
|
262
|
+
> a per-request human click. The model cannot approve, apply, start the worker,
|
|
263
|
+
> or change that policy.
|
|
264
|
+
|
|
265
|
+
The model can therefore cause a bounded request to enter a pre-authorized
|
|
266
|
+
production pipeline. It still cannot choose the authority, approve the
|
|
267
|
+
proposal, control the worker, or commit a mutation directly.
|
|
@@ -3,20 +3,59 @@
|
|
|
3
3
|
Run the friendly doctor first:
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
|
-
npx -y
|
|
6
|
+
npx -y @synapsor/runner doctor --first-run
|
|
7
7
|
```
|
|
8
8
|
|
|
9
9
|
Use JSON for automation:
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
|
-
npx -y
|
|
13
|
-
```
|
|
12
|
+
npx -y @synapsor/runner doctor --first-run --json
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Guided Recovery Contract
|
|
16
|
+
|
|
17
|
+
Runner 1.6.4 failures should tell you what failed, why the boundary stopped,
|
|
18
|
+
what state remains, and one next action. Do not delete the project or add
|
|
19
|
+
`--force` merely to recover.
|
|
20
|
+
|
|
21
|
+
| Failure | State preserved | One next action |
|
|
22
|
+
| --- | --- | --- |
|
|
23
|
+
| Database connection or metadata inspection failed | Existing project/review files and source rows | Fix the URL/network without printing the credential, then rerun `npx -y @synapsor/runner start`. |
|
|
24
|
+
| Read role is writable, owner, superuser, `BYPASSRLS`, or unverifiable | Disabled metadata draft; no source-row Explore | Supply a verifiably SELECT-only non-owner staging role, then rerun the same `start` command. |
|
|
25
|
+
| Schema or project choice is ambiguous | Existing files; no authority activation | Rerun with the exact reviewed schema, for example `npx -y @synapsor/runner start --schema public`. |
|
|
26
|
+
| Tenant or principal scope is unresolved | Conservative blocked resource decisions | Open the same Workbench URL and resolve the highlighted scope exception. |
|
|
27
|
+
| Sensitive field remains unresolved | Field stays kept out; active tools unchanged | Open Workbench **Exceptions** and record one reviewed field decision. |
|
|
28
|
+
| Row identifier is missing/composite/ambiguous | Resource remains blocked | Select a source-proven single-column primary/unique identity or keep the resource blocked. |
|
|
29
|
+
| Trusted context environment is missing | Boundary and ledger remain intact; query did not run | Export the named tenant/principal variable locally, then rerun the displayed Try action. |
|
|
30
|
+
| Generated output already exists | Existing files are not overwritten | Rerun the original `start` command and choose **Resume existing review**. |
|
|
31
|
+
| Generation lock is stale | Existing active named capability and review history | Run `synapsor-runner boundary diff --json`, then choose **Rescan and review changes**. |
|
|
32
|
+
| Config JSON is malformed | Config and source database are unchanged | Correct the reported file/line/column, then run `synapsor-runner config validate --config ./synapsor.runner.json --json`. |
|
|
33
|
+
| Config mode is missing/invalid | Config and source database are unchanged | Set `mode` to `read_only`, `shadow`, `review`, or `cloud`, then rerun `synapsor-runner config validate --json`. |
|
|
34
|
+
| Config contains an unknown field | Config and source database are unchanged | Remove or correct the reported JSON path, then rerun `synapsor-runner config validate --json`. |
|
|
35
|
+
| Workbench port is occupied | Review files, ledger, and source database | Rerun `synapsor-runner ui --open`; the default selects a free loopback port. |
|
|
36
|
+
| Workbench Ask is missing | Reviewed project remains usable through no-model Workbench/CLI/MCP | Use authenticated loopback Workbench with an explicit development/staging profile and at least one active reviewed tool. |
|
|
37
|
+
| Ask provider/key fails | Boundary, no-model composer, and external MCP remain usable | Check the exported key name, provider/model access, and local DNS/TLS; then retry without changing authority. |
|
|
38
|
+
| Ask says authority changed | Previous consent is invalid; active reviewed tools remain unchanged | Inspect the new tool/digest summary and acknowledge direct egress again. |
|
|
39
|
+
| Writeback setup fails | Config and reviewed plan; transactional setup rolls back | Rerun `synapsor-runner writeback setup --profile staging --json` and review the reported prerequisite. |
|
|
40
|
+
| Writer role/setup URL is missing | No DDL or grant was applied | Rerun the preview with `--writer-role <role> --setup-url-env <ADMIN_URL_ENV>`. |
|
|
41
|
+
| No supported write candidate exists | Read boundary remains active; no write authority | Use **Add a safe action** on a writable base table with a proven identity/version field, or retain read-only mode. |
|
|
42
|
+
| MCP client installation is unavailable | Project and reviewed authority; client config unchanged | Run `synapsor-runner mcp config --absolute-paths` and use the generic stdio snippet manually. |
|
|
43
|
+
| Supervised work remains queued | Approved proposal and queue state; source unchanged | Run `synapsor-runner worker status --json`, then follow its exact digest, posture, policy, freshness, limit, pause, or required-sink finding. |
|
|
44
|
+
| Required attention sink is unhealthy | Approved proposal remains queued; no source mutation | Repair the operator-owned sink, run `synapsor-runner notifications test --sink <id>`, then dispatch and let the worker revalidate from the beginning. |
|
|
45
|
+
| Notification delivery is dead-lettered | Authoritative event and proposal state are preserved | Repair/test the sink, then run `synapsor-runner notifications replay latest --yes --reason "sink repaired"` with the configured verified operator identity; this resends only the redacted event. |
|
|
46
|
+
| Apply outcome is UNKNOWN | Intent, receipt evidence, and queue state are preserved | Open the latest critical attention item and use the verified reconciliation flow; never rerun the mutation blindly. |
|
|
47
|
+
|
|
48
|
+
For machine output, a process-level failure emits one redacted JSON object to
|
|
49
|
+
stdout and diagnostics to stderr. `recovery.source_database_changed` is `null`
|
|
50
|
+
when a generic exception cannot establish an operation-specific mutation
|
|
51
|
+
outcome; inspect the durable receipt/reconciliation state rather than guessing.
|
|
14
52
|
|
|
15
53
|
## Fresh Start Did Not Enter Auto Boundary
|
|
16
54
|
|
|
17
|
-
Auto Boundary is the default only for a fresh interactive `start
|
|
18
|
-
|
|
19
|
-
automation input.
|
|
55
|
+
Auto Boundary is the default only for a fresh interactive `start` with no
|
|
56
|
+
existing config, selector, answers file, machine-output flag, or other
|
|
57
|
+
automation input. An exported `DATABASE_URL` is implied; explicit connection
|
|
58
|
+
and schema flags still win. This preserves every established 1.x route.
|
|
20
59
|
|
|
21
60
|
Check the generated state:
|
|
22
61
|
|
|
@@ -58,6 +97,42 @@ A write-capable, owner, superuser, `BYPASSRLS`, or unverifiable credential may
|
|
|
58
97
|
still inspect metadata with a warning. It cannot enable source-row Explore.
|
|
59
98
|
Use a dedicated staging reader instead of weakening this check.
|
|
60
99
|
|
|
100
|
+
## Workbench Ask Is Missing Or Refused
|
|
101
|
+
|
|
102
|
+
Ask is optional and follows a stricter local profile boundary. It appears only
|
|
103
|
+
in authenticated loopback Workbench for explicit `development` or `staging`
|
|
104
|
+
projects with at least one reviewed tool. Production, unknown, shared, remote,
|
|
105
|
+
and non-loopback surfaces intentionally omit it.
|
|
106
|
+
|
|
107
|
+
Normal Runner and MCP execution do not automatically source `.env`. Fresh
|
|
108
|
+
interactive `start` may read a regular project `.env` only after explicit
|
|
109
|
+
consent and keeps the selected database URL in that process. For the optional
|
|
110
|
+
model provider, export the key in the same shell that launches Workbench, then
|
|
111
|
+
select **Read an environment variable** and enter only the variable name. A
|
|
112
|
+
session-only masked paste is also supported.
|
|
113
|
+
|
|
114
|
+
Provider errors are redacted and do not disable the no-model composer:
|
|
115
|
+
|
|
116
|
+
- `ASK_KEY_REQUIRED`: export the selected key or use the masked session paste;
|
|
117
|
+
- `ASK_AUTHORITY_CHANGED`: review the current tools/digest and acknowledge
|
|
118
|
+
direct egress again;
|
|
119
|
+
- `ASK_PROVIDER_UNAVAILABLE`: verify provider availability, key/model access,
|
|
120
|
+
and local DNS/TLS, then retry;
|
|
121
|
+
- `ASK_PROVIDER_REDIRECT_REFUSED`: use the final fixed endpoint; Runner never
|
|
122
|
+
forwards credentials across redirects;
|
|
123
|
+
- `ASK_PROVIDER_DESTINATION_REFUSED`: the host resolved to a private, special,
|
|
124
|
+
metadata, or otherwise disallowed remote address;
|
|
125
|
+
- `ASK_REMOTE_HTTPS_REQUIRED`: remote custom endpoints require HTTPS; HTTP is
|
|
126
|
+
accepted only on loopback;
|
|
127
|
+
- `ASK_TOOL_REQUIRED`: the provider answered from prose without using a
|
|
128
|
+
reviewed Synapsor tool;
|
|
129
|
+
- `ASK_UNKNOWN_TOOL` or `ASK_OPERATOR_TOOL_REFUSED`: the provider requested
|
|
130
|
+
authority outside the displayed tool surface.
|
|
131
|
+
|
|
132
|
+
Select **Clear** after a session to cancel active work and discard in-memory
|
|
133
|
+
provider configuration/history. See [Workbench Ask With Your
|
|
134
|
+
Model](workbench-ask.md).
|
|
135
|
+
|
|
61
136
|
## Cursor Has Production Tools Instead Of Authoring Tools
|
|
62
137
|
|
|
63
138
|
Install the managed local authoring entry only after boundary activation:
|
|
@@ -292,13 +367,13 @@ Own-database MCP setup needs a reviewed config before serving tools.
|
|
|
292
367
|
Fix:
|
|
293
368
|
|
|
294
369
|
```bash
|
|
295
|
-
npx -y
|
|
370
|
+
npx -y @synapsor/runner init --from-env DATABASE_URL --mode review --wizard
|
|
296
371
|
```
|
|
297
372
|
|
|
298
373
|
Or pass an example config:
|
|
299
374
|
|
|
300
375
|
```bash
|
|
301
|
-
npx -y
|
|
376
|
+
npx -y @synapsor/runner tools preview --config ./examples/mcp-postgres-billing/synapsor.runner.json --store ./.synapsor/local.db
|
|
302
377
|
```
|
|
303
378
|
|
|
304
379
|
## SQLite Store Missing
|
|
@@ -344,7 +419,7 @@ Fix:
|
|
|
344
419
|
|
|
345
420
|
```bash
|
|
346
421
|
export SYNAPSOR_DATABASE_READ_URL="<read-only-url>"
|
|
347
|
-
npx -y
|
|
422
|
+
npx -y @synapsor/runner doctor --config synapsor.runner.json
|
|
348
423
|
```
|
|
349
424
|
|
|
350
425
|
## Read/Write Credential Split Failed
|
|
@@ -456,7 +531,7 @@ Fix:
|
|
|
456
531
|
Regenerate the snippet:
|
|
457
532
|
|
|
458
533
|
```bash
|
|
459
|
-
npx -y
|
|
534
|
+
npx -y @synapsor/runner mcp config claude-desktop \
|
|
460
535
|
--absolute-paths \
|
|
461
536
|
--config ./synapsor.runner.json \
|
|
462
537
|
--store ./.synapsor/local.db
|
|
@@ -10,9 +10,11 @@ model.
|
|
|
10
10
|
Short path:
|
|
11
11
|
|
|
12
12
|
```bash
|
|
13
|
-
|
|
14
|
-
npx -y -p @synapsor/runner synapsor-runner start --from-env DATABASE_URL --schema public
|
|
13
|
+
npx -y @synapsor/runner start
|
|
15
14
|
```
|
|
16
15
|
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
Paste a read-only URL into the hidden prompt, explicitly approve a regular
|
|
17
|
+
project `.env` file for this process, or export `DATABASE_URL`. PostgreSQL
|
|
18
|
+
defaults to `public`; explicit `--from-env`, `--schema`, and `--project-root`
|
|
19
|
+
flags remain available and always win. Runner stores environment-variable names
|
|
20
|
+
in `synapsor.runner.json`, not database URLs.
|