@synapsor/runner 1.6.1 → 1.6.3
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 +98 -3
- package/README.md +33 -19
- package/SECURITY.md +10 -2
- package/THREAT_MODEL.md +27 -4
- package/dist/authoring.mjs +53 -3
- package/dist/cli.d.ts +19 -2
- package/dist/cli.d.ts.map +1 -1
- package/dist/local-ui.d.ts +85 -1
- package/dist/local-ui.d.ts.map +1 -1
- package/dist/runner.mjs +33542 -20382
- package/dist/runtime.mjs +3581 -237
- package/dist/shadow.mjs +2423 -65
- package/docs/README.md +22 -2
- package/docs/agent-guided-setup.md +239 -0
- package/docs/approval-roles-and-operator-identity.md +353 -0
- package/docs/auto-boundary-and-scoped-explore.md +32 -6
- package/docs/capability-authoring.md +19 -0
- package/docs/current-scope.md +20 -1
- package/docs/cursor-plugin.md +2 -2
- package/docs/dsl-json-parity.md +75 -0
- package/docs/dsl-reference.md +10 -0
- package/docs/fresh-developer-usability.md +155 -80
- package/docs/getting-started-own-database.md +5 -4
- package/docs/guarded-crud-writeback.md +19 -0
- package/docs/guided-onboarding.md +331 -0
- package/docs/human-attention-notifications.md +367 -0
- package/docs/limitations.md +19 -3
- package/docs/local-mode.md +16 -2
- package/docs/migrating-to-synapsor-spec.md +38 -0
- package/docs/production.md +39 -0
- package/docs/release-notes.md +87 -4
- package/docs/runner-config-reference.md +132 -0
- package/docs/running-a-runner-fleet.md +16 -1
- package/docs/security-boundary.md +24 -0
- package/docs/store-lifecycle.md +20 -1
- package/docs/supervised-automatic-apply.md +267 -0
- package/docs/troubleshooting-first-run.md +35 -0
- package/examples/app-owned-writeback/command-handler.mjs +0 -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/mcp-postgres-billing-app-handler/scripts/run-demo.sh +0 -0
- package/examples/operator-oidc/issuer.mjs +188 -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/examples/support-plan-credit/README.md +6 -2
- package/package.json +11 -9
- package/schemas/schema-candidate-review.schema.json +42 -0
- package/schemas/synapsor.runner.schema.json +227 -4
package/docs/limitations.md
CHANGED
|
@@ -5,7 +5,10 @@ whole-application boundary drafting and a local authoring-only Explore ->
|
|
|
5
5
|
Protect path on top of guarded writes. Version 1.6.1 also adds opt-in
|
|
6
6
|
proposal/evidence freshness for exact same-source direct-SQL proposals. It does
|
|
7
7
|
not turn Runner into a generic database query tool, claim Synapsor Cloud scale,
|
|
8
|
-
or claim an enterprise SLA.
|
|
8
|
+
or claim an enterprise SLA. Version 1.6.3 adds guided onboarding, verified
|
|
9
|
+
approval-role evidence, default-off exact-digest supervised execution for a
|
|
10
|
+
narrow write subset, and quiet human-attention delivery without changing
|
|
11
|
+
existing manual behavior.
|
|
9
12
|
|
|
10
13
|
## Supported
|
|
11
14
|
|
|
@@ -15,8 +18,9 @@ or claim an enterprise SLA.
|
|
|
15
18
|
- Optional shared Postgres proposal/evidence/replay runtime store for MCP serving.
|
|
16
19
|
- Asymmetric claim-bound Streamable HTTP sessions and explicit readiness.
|
|
17
20
|
- Native Postgres/MySQL source pools and operational/fleet-wide rate limits.
|
|
18
|
-
- Verified operator approval through CLI
|
|
19
|
-
|
|
21
|
+
- Verified operator approval through CLI or the secured local Workbench,
|
|
22
|
+
optional distinct-reviewer quorum, separate apply authority, and
|
|
23
|
+
proposal-centered lifecycle inspection.
|
|
20
24
|
- Optional live target and explicitly declared supporting-row freshness checks
|
|
21
25
|
before every approval, with immutable proof binding and final transactional
|
|
22
26
|
revalidation for PostgreSQL/MySQL direct SQL writeback.
|
|
@@ -75,6 +79,13 @@ or claim an enterprise SLA.
|
|
|
75
79
|
and scoped tamper-evident JSON/Markdown/PDF ledger reports.
|
|
76
80
|
- Off-by-default graduated-trust recommendations that require verified operator
|
|
77
81
|
review and explicit artifact export without activation.
|
|
82
|
+
- Default-off operator-supervised apply for eligible exact-row direct
|
|
83
|
+
`INSERT`/`UPDATE`, requiring both public contract permission and an
|
|
84
|
+
independent deployment allowlist for the exact active digest. It reuses
|
|
85
|
+
guarded apply and preserves legacy `AUTO APPROVE` as manual-apply.
|
|
86
|
+
- Durable redacted human-attention events, a coalesced Workbench inbox,
|
|
87
|
+
no-ID CLI inspection, optional JSONL output, and signed generic HTTPS
|
|
88
|
+
webhooks with quiet routing, budgets, digests, and safe delivery replay.
|
|
78
89
|
|
|
79
90
|
## Runtime Contract
|
|
80
91
|
|
|
@@ -105,11 +116,16 @@ truth for the model-facing tools.
|
|
|
105
116
|
- Inferred compensation for app-owned handlers or external effects.
|
|
106
117
|
- General restoration of hard-deleted rows, cascades, or trigger side effects.
|
|
107
118
|
- Model-callable approval or commit tools.
|
|
119
|
+
- Model-callable worker, notification-routing, acknowledgement, recovery, or
|
|
120
|
+
reconciliation controls.
|
|
108
121
|
- Generic MCP firewall behavior.
|
|
109
122
|
- Prompt-injection prevention.
|
|
110
123
|
- Unbounded/high-throughput or multi-region ledger scale.
|
|
111
124
|
- Managed fleet, SLA, compliance certification, or production support guarantee.
|
|
112
125
|
- Production, shared HTTP, remote, or non-loopback Scoped Explore.
|
|
126
|
+
- Automatic supervised execution for hard DELETE, reversible changes, bounded
|
|
127
|
+
sets, app-owned/external effects, or writes without deterministic conflict,
|
|
128
|
+
deduplication, freshness, and receipt authority.
|
|
113
129
|
- Arbitrary aggregate expressions, dynamic identifiers, unrestricted joins,
|
|
114
130
|
many-to-many joins, formulas, window functions, subqueries, `HAVING`,
|
|
115
131
|
user-defined functions, or a statistical privacy guarantee. Version 1.6
|
package/docs/local-mode.md
CHANGED
|
@@ -158,6 +158,12 @@ npx -y -p @synapsor/runner synapsor-runner proposals approve wrp_123 \
|
|
|
158
158
|
--yes
|
|
159
159
|
```
|
|
160
160
|
|
|
161
|
+
The `--actor` example is the unverified local-development path. Shared and
|
|
162
|
+
production operation should require `signed_key` or `jwt_oidc`, resolve the
|
|
163
|
+
contract's exact role from verified identity, and authorize apply separately.
|
|
164
|
+
See [Approval Roles And Verified Operator
|
|
165
|
+
Identity](approval-roles-and-operator-identity.md).
|
|
166
|
+
|
|
161
167
|
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`.
|
|
162
168
|
|
|
163
169
|
When `proposal_freshness` is configured for that capability, approval also
|
|
@@ -301,6 +307,8 @@ or prune it without touching your source Postgres/MySQL database:
|
|
|
301
307
|
```bash
|
|
302
308
|
synapsor-runner store stats --store ./.synapsor/local.db
|
|
303
309
|
synapsor-runner events tail --store ./.synapsor/local.db
|
|
310
|
+
synapsor-runner attention show --store ./.synapsor/local.db
|
|
311
|
+
synapsor-runner notifications status --store ./.synapsor/local.db
|
|
304
312
|
synapsor-runner events webhook --url http://127.0.0.1:8788/synapsor/events --kind proposal_created --store ./.synapsor/local.db
|
|
305
313
|
synapsor-runner store vacuum --store ./.synapsor/local.db
|
|
306
314
|
synapsor-runner store prune --store ./.synapsor/local.db --older-than 30d --dry-run
|
|
@@ -316,8 +324,14 @@ running local store.
|
|
|
316
324
|
|
|
317
325
|
`events webhook` pushes the same local lifecycle events to a local/dev/staging
|
|
318
326
|
HTTP endpoint, one event envelope per POST. Use it for a review UI, Slack bridge,
|
|
319
|
-
or app-local
|
|
320
|
-
|
|
327
|
+
or app-local compatibility path when polling is awkward. It is not the
|
|
328
|
+
production human-attention dispatcher.
|
|
329
|
+
|
|
330
|
+
For durable coalesced incidents, quiet defaults, budgets/digests, signed HTTPS
|
|
331
|
+
delivery, replay protection, sink health, and the no-ID Workbench inbox, use
|
|
332
|
+
`attention` and `notifications`. See [Human Attention And
|
|
333
|
+
Notifications](human-attention-notifications.md). Neither notification path
|
|
334
|
+
becomes approval or apply authority.
|
|
321
335
|
|
|
322
336
|
`store prune` defaults to dry-run. `store reset` requires `--yes` and removes
|
|
323
337
|
only the local SQLite ledger files. MCP server modes write a small active-store
|
|
@@ -148,6 +148,44 @@ The equivalent DSL is `REQUIRE 2 APPROVALS` after `APPROVAL ROLE
|
|
|
148
148
|
billing_lead`. Runner 1.0 does not understand this new optional semantic field;
|
|
149
149
|
use Runner/spec/DSL 1.1 together. Omitted fields preserve 1.0 behavior.
|
|
150
150
|
|
|
151
|
+
## 1.6 Generated Authority And Supervised Execution
|
|
152
|
+
|
|
153
|
+
Runner 1.6.3, Spec 1.6.0, and DSL 1.6.0 are additive. Existing hand-authored
|
|
154
|
+
DSL/JSON/config projects do not need Auto Boundary, Workbench, a generation
|
|
155
|
+
lock, schema rescanning, or supervised execution. Contracts that omit the new
|
|
156
|
+
fields retain their previous canonical normalization and digest.
|
|
157
|
+
|
|
158
|
+
Auto Boundary writes a generation lock only for authority it generated.
|
|
159
|
+
Drift enforcement applies only when `synapsor.runner.json` explicitly
|
|
160
|
+
references that lock under `generated_authority`; manually authored projects
|
|
161
|
+
continue to start without metadata inspection.
|
|
162
|
+
|
|
163
|
+
The optional proposal permission:
|
|
164
|
+
|
|
165
|
+
```json
|
|
166
|
+
{
|
|
167
|
+
"execution": {
|
|
168
|
+
"supervised_worker": "allowed"
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
compiles from:
|
|
174
|
+
|
|
175
|
+
```sql
|
|
176
|
+
ALLOW SUPERVISED WORKER APPLY
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
It applies nothing by itself. Automatic execution also requires a separate
|
|
180
|
+
deployment policy for the exact capability and active digest. Existing
|
|
181
|
+
`AUTO APPROVE` contracts continue to wait for manual apply, and no worker
|
|
182
|
+
starts because Runner was upgraded. See
|
|
183
|
+
[Operator-Supervised Automatic Apply](supervised-automatic-apply.md).
|
|
184
|
+
|
|
185
|
+
Human-attention events and external notification sinks require no contract
|
|
186
|
+
migration. Notifications are absent/disabled by default and emit no outbound
|
|
187
|
+
traffic until an operator configures and explicitly runs the dispatcher.
|
|
188
|
+
|
|
151
189
|
## Validate
|
|
152
190
|
|
|
153
191
|
```bash
|
package/docs/production.md
CHANGED
|
@@ -400,6 +400,45 @@ every skipped item includes a safe reason. Re-running is idempotent through
|
|
|
400
400
|
durable receipts. Do not schedule batch apply for a policy that has no reviewed
|
|
401
401
|
aggregate limits.
|
|
402
402
|
|
|
403
|
+
For continuous execution, use the stricter default-off supervised mode rather
|
|
404
|
+
than scheduling broad batch apply. `AUTO APPROVE` by itself remains
|
|
405
|
+
manual-apply. A worker may consume approved work only when the active contract
|
|
406
|
+
contains `execution.supervised_worker = "allowed"` and
|
|
407
|
+
`supervised_worker.capabilities` independently names the exact same capability
|
|
408
|
+
and digest. Production additionally requires verified operator controls and a
|
|
409
|
+
live least-privilege writer-posture fingerprint.
|
|
410
|
+
|
|
411
|
+
```bash
|
|
412
|
+
synapsor-runner worker run --supervised --yes \
|
|
413
|
+
--worker-id billing_worker \
|
|
414
|
+
--config ./synapsor.runner.json
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
The worker accepts only eligible single-row direct INSERT/UPDATE shapes and
|
|
418
|
+
reuses the manual guarded-apply implementation. Before execution it repeats
|
|
419
|
+
approval, policy, limit, expiry, digest/lock, tenant/principal, target and
|
|
420
|
+
supporting-evidence freshness, conflict/deduplication, receipt, writer-posture,
|
|
421
|
+
and lease checks. Source or evidence drift produces zero mutation. DELETE,
|
|
422
|
+
reversible changes, set writes, and app-owned/external effects are not eligible
|
|
423
|
+
for this first automatic path. See [Operator-Supervised Automatic
|
|
424
|
+
Apply](supervised-automatic-apply.md).
|
|
425
|
+
|
|
426
|
+
Production operators can inspect the same queue and Human Attention Inbox in
|
|
427
|
+
the secured Workbench or CLI:
|
|
428
|
+
|
|
429
|
+
```bash
|
|
430
|
+
synapsor-runner worker status --config ./synapsor.runner.json
|
|
431
|
+
synapsor-runner attention show --config ./synapsor.runner.json
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
External delivery is disabled and quiet by default. When explicitly enabled,
|
|
435
|
+
one signed generic webhook can route timely review, UNKNOWN, reconciliation,
|
|
436
|
+
dead-letter, sustained-health, drift, posture, and critical-limit incidents.
|
|
437
|
+
Successful applies remain in the ledger/Workbench unless a sink opts into an
|
|
438
|
+
all-events route or digest. A webhook informs and cannot approve or mutate
|
|
439
|
+
Runner state. See [Human Attention And
|
|
440
|
+
Notifications](human-attention-notifications.md).
|
|
441
|
+
|
|
403
442
|
Runner writes newline-delimited JSON events to stderr for model-facing tool
|
|
404
443
|
rejections, operator decisions, and terminal writeback outcomes. These events
|
|
405
444
|
contain safe codes and identifiers, never tool arguments, row values, database
|
package/docs/release-notes.md
CHANGED
|
@@ -10,7 +10,89 @@ npx -y -p @synapsor/runner synapsor-runner demo --quick
|
|
|
10
10
|
The OSS runner command is `synapsor-runner`. The `synapsor` command is reserved
|
|
11
11
|
for the Synapsor Cloud CLI.
|
|
12
12
|
|
|
13
|
-
## 1.6.
|
|
13
|
+
## 1.6.3 (prepared, not published)
|
|
14
|
+
|
|
15
|
+
### Guided adoption without weaker authority
|
|
16
|
+
|
|
17
|
+
- A fresh interactive
|
|
18
|
+
`npx -y @synapsor/runner@latest start --from-env DATABASE_URL` now drives one
|
|
19
|
+
resumable metadata-inspection, review-by-exception, exact-digest activation,
|
|
20
|
+
first safe read, and MCP setup journey. It requires no account, model key,
|
|
21
|
+
Cloud control plane, global install, or manual project files.
|
|
22
|
+
- Workbench explains the boundary before exposing advanced details, highlights
|
|
23
|
+
only unresolved security decisions, and keeps one primary next action visible.
|
|
24
|
+
Generated read, aggregate, protected, and write authorities remain disabled
|
|
25
|
+
until the human activates the exact reviewed digest.
|
|
26
|
+
- Project-aware `try call`, `try explore`, `try protect`, and guided action
|
|
27
|
+
paths remove repeated config/store flags and copied handles while preserving
|
|
28
|
+
the canonical DSL/Spec/runtime boundary and existing manual/headless paths.
|
|
29
|
+
- The packaged FitFlow journey proves a real named read, privacy-suppressed
|
|
30
|
+
PM-style aggregate, Protect This Query, proposal-only model call, bounded
|
|
31
|
+
approval policy, guarded source write, receipt/replay, compensation, and
|
|
32
|
+
equivalent authority across Workbench, CLI, Cursor, Claude, Codex, and
|
|
33
|
+
generic stdio setup.
|
|
34
|
+
- The packaged approval-role guide and simulated external OIDC/JWKS flow show
|
|
35
|
+
how `APPROVAL ROLE` maps to verified IdP claims and immutable decisions.
|
|
36
|
+
Reviewer and applier authority remain separate; invalid signatures, token
|
|
37
|
+
time/issuer/audience failures, missing or similar roles, key rotation errors,
|
|
38
|
+
proof tampering, and proof replay fail closed.
|
|
39
|
+
- Operator-supervised automatic apply is a new default-off execution axis.
|
|
40
|
+
Contract permission and an independent deployment allowlist must match one
|
|
41
|
+
exact active digest. Existing `AUTO APPROVE` behavior remains manual-apply;
|
|
42
|
+
eligible single-row INSERT/UPDATE work uses the same guarded apply after
|
|
43
|
+
current policy, limit, scope, target/supporting-evidence freshness,
|
|
44
|
+
writer-posture, receipt, and fenced-lease revalidation.
|
|
45
|
+
- The ledger and Workbench now project durable redacted human-attention events
|
|
46
|
+
for proposal, worker, boundary, schema, credential, policy, and sensitive
|
|
47
|
+
override states. External delivery is disabled and quiet by default. A
|
|
48
|
+
separate dispatcher supports coalescing, budgets, digests, JSONL development
|
|
49
|
+
output, and signed generic HTTPS webhooks that inform but never authorize.
|
|
50
|
+
- Replaying a failed notification requires a fresh verified signed-key or OIDC
|
|
51
|
+
operator decision bound to the exact delivery revision and a recorded
|
|
52
|
+
reason. It requeues only the redacted event. Packed tests prove competing
|
|
53
|
+
dispatcher deduplication, zero immediate success noise under the default
|
|
54
|
+
preset, metadata-endpoint SSRF refusal, and an unchanged source database
|
|
55
|
+
across notification replay.
|
|
56
|
+
- Workbench and CLI expose queue status, pause/drain, exact-digest
|
|
57
|
+
enable/disable/revoke, cancellation, dead-letter, UNKNOWN/reconciliation,
|
|
58
|
+
notification status/replay, and no-ID attention inspection outside MCP.
|
|
59
|
+
- Supported JSON failure paths emit one parseable result with a stable error
|
|
60
|
+
code, preserved-state and source-change status, one recovery action, and
|
|
61
|
+
redacted diagnostics on stderr.
|
|
62
|
+
- An explicit empty `capabilities` array is now valid zero-authority review
|
|
63
|
+
state. The optional canonical `execution.supervised_worker` permission and
|
|
64
|
+
public `ALLOW SUPERVISED WORKER APPLY` clause are additive. Spec and DSL
|
|
65
|
+
advance to `1.6.0` while preserving old contract normalization, digests, and
|
|
66
|
+
generated-lock support.
|
|
67
|
+
|
|
68
|
+
Prepared package versions: `@synapsor/runner@1.6.3`,
|
|
69
|
+
`@synapsor/spec@1.6.0`, and `@synapsor/dsl@1.6.0`.
|
|
70
|
+
No package is published by this change.
|
|
71
|
+
|
|
72
|
+
The pre-release clean-install gate uses the locally packed public Spec until
|
|
73
|
+
Spec 1.6.0 is on npm. After publishing Spec first, force the registry-only
|
|
74
|
+
Runner dependency check with
|
|
75
|
+
`VERIFY_PACKED_RUNNER_USE_LOCAL_SPEC=0 ./scripts/verify-packed-runner.sh`.
|
|
76
|
+
|
|
77
|
+
## 1.6.2 (published 2026-07-23)
|
|
78
|
+
|
|
79
|
+
### Registry-installable packaging hotfix
|
|
80
|
+
|
|
81
|
+
- Runner remains linked to the local Spec workspace during development, while
|
|
82
|
+
pnpm must transform that link to the public `@synapsor/spec@^1.5.0` range in
|
|
83
|
+
the release tarball.
|
|
84
|
+
- A publish lifecycle guard rejects `npm publish`, requires
|
|
85
|
+
`corepack pnpm publish`, and rejects unexpected local dependency protocols or
|
|
86
|
+
incorrect Spec ranges.
|
|
87
|
+
- The release gate inspects pnpm's transformed tarball manifest and installs
|
|
88
|
+
the Runner tarball alone in a clean project before invoking its CLI. The test
|
|
89
|
+
therefore exercises the dependency-resolution path used by public `npx`.
|
|
90
|
+
- Runtime behavior is unchanged from the proposal/evidence freshness release.
|
|
91
|
+
|
|
92
|
+
Published package version: `@synapsor/runner@1.6.2`.
|
|
93
|
+
`@synapsor/spec@1.5.0` and `@synapsor/dsl@1.5.0` remain unchanged.
|
|
94
|
+
|
|
95
|
+
## 1.6.1 (published 2026-07-23; install-broken)
|
|
14
96
|
|
|
15
97
|
### Fail-closed proposal and evidence freshness
|
|
16
98
|
|
|
@@ -33,9 +115,10 @@ for the Synapsor Cloud CLI.
|
|
|
33
115
|
- Existing contracts, exact digests, DSL, model-facing tool lists, and
|
|
34
116
|
non-freshness deployments keep their prior behavior.
|
|
35
117
|
|
|
36
|
-
|
|
37
|
-
`@synapsor/spec
|
|
38
|
-
|
|
118
|
+
The `1.6.1` registry manifest accidentally retained
|
|
119
|
+
`@synapsor/spec: "workspace:^"`. Clean npm and npx installs reject that local
|
|
120
|
+
workspace protocol with `EUNSUPPORTEDPROTOCOL`. The version should remain
|
|
121
|
+
deprecated and is superseded by `1.6.2`. Spec and DSL were unaffected.
|
|
39
122
|
|
|
40
123
|
## 1.6.0 (published 2026-07-23)
|
|
41
124
|
|
|
@@ -40,6 +40,9 @@ Unknown keys fail when `strict` is true (the default).
|
|
|
40
40
|
| `rate_limits` | No | Operational fixed-window limits; fleet-wide only with shared `runtime_store`. |
|
|
41
41
|
| `metrics` | No | Separately authorized scrapeable HTTP metrics. Disabled by default. |
|
|
42
42
|
| `graduated_trust` | No | Off-by-default, operator-only policy recommendation criteria and kill switch. |
|
|
43
|
+
| `generated_authority` | Generated projects | Generation-lock path and required drift enforcement for generated authority only. |
|
|
44
|
+
| `supervised_worker` | No | Default-off exact-digest allowlist for trusted automatic execution of approved proposals. |
|
|
45
|
+
| `notifications` | No | Default-off quiet attention routing to JSONL or signed HTTPS webhooks. |
|
|
43
46
|
| `executors` | No | App-owned writeback wiring. |
|
|
44
47
|
| `cloud` | Cloud mode | Scoped Cloud adapter configuration. |
|
|
45
48
|
|
|
@@ -499,6 +502,129 @@ synapsor-runner doctor --check-writeback --config ./synapsor.runner.json
|
|
|
499
502
|
The complete validation, privilege, lifecycle, and error-code contract is in
|
|
500
503
|
[Proposal And Evidence Freshness](proposal-evidence-freshness.md).
|
|
501
504
|
|
|
505
|
+
## Supervised worker
|
|
506
|
+
|
|
507
|
+
`supervised_worker` is a separate deployment opt-in for automatic execution of
|
|
508
|
+
already-approved proposals. It does not change `AUTO APPROVE`; old and new
|
|
509
|
+
auto-approved proposals still wait for manual apply unless both the contract
|
|
510
|
+
and this exact-digest allowlist permit worker execution.
|
|
511
|
+
|
|
512
|
+
```json
|
|
513
|
+
{
|
|
514
|
+
"supervised_worker": {
|
|
515
|
+
"enabled": true,
|
|
516
|
+
"profile": "production",
|
|
517
|
+
"capabilities": [
|
|
518
|
+
{
|
|
519
|
+
"capability": "billing.propose_small_credit",
|
|
520
|
+
"contract_digest": "sha256:EXACT_ACTIVE_DIGEST",
|
|
521
|
+
"mode": "supervised_worker",
|
|
522
|
+
"concurrency": 1,
|
|
523
|
+
"queue_limit": 100,
|
|
524
|
+
"lease_seconds": 60,
|
|
525
|
+
"max_attempts": 5,
|
|
526
|
+
"proposal_ttl_seconds": 3600,
|
|
527
|
+
"rate_limit": {
|
|
528
|
+
"executions": 20,
|
|
529
|
+
"window_seconds": 60
|
|
530
|
+
},
|
|
531
|
+
"write_url_env": "BILLING_POSTGRES_WRITE_URL",
|
|
532
|
+
"worker_identity": "billing_worker",
|
|
533
|
+
"control_role": "runner_operator",
|
|
534
|
+
"require_least_privilege_writer": true,
|
|
535
|
+
"writer_posture_fingerprint": "sha256:REVIEWED_POSTURE_DIGEST",
|
|
536
|
+
"required_attention_sinks": ["operations"]
|
|
537
|
+
}
|
|
538
|
+
]
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
```
|
|
542
|
+
|
|
543
|
+
`profile` is `development`, `staging`, or `production`. Production requires
|
|
544
|
+
verified operator identity and hardened writer posture. Every entry binds
|
|
545
|
+
capability name, active contract digest, worker mode, queue/concurrency/rate
|
|
546
|
+
bounds, proposal TTL, writer credential reference, and optional fixed worker
|
|
547
|
+
identity/control role.
|
|
548
|
+
|
|
549
|
+
`required_attention_sinks` is optional and default-off. When present, an
|
|
550
|
+
otherwise eligible job remains queued until every named enabled notification
|
|
551
|
+
sink has a healthy delivery record. Sink health never grants approval or
|
|
552
|
+
execution authority.
|
|
553
|
+
|
|
554
|
+
The active capability must itself contain
|
|
555
|
+
`execution.supervised_worker = "allowed"`, compile from `ALLOW SUPERVISED
|
|
556
|
+
WORKER APPLY`, use direct single-row guarded INSERT/UPDATE, and satisfy the
|
|
557
|
+
receipt, trusted-scope, conflict/deduplication, and eligibility checks. See
|
|
558
|
+
[Operator-Supervised Automatic Apply](supervised-automatic-apply.md).
|
|
559
|
+
|
|
560
|
+
## Notifications
|
|
561
|
+
|
|
562
|
+
`notifications` routes immutable redacted attention events. It is absent or
|
|
563
|
+
`enabled: false` by default and starts no background dispatcher.
|
|
564
|
+
|
|
565
|
+
```json
|
|
566
|
+
{
|
|
567
|
+
"notifications": {
|
|
568
|
+
"enabled": true,
|
|
569
|
+
"workbench_url_env": "SYNAPSOR_WORKBENCH_URL",
|
|
570
|
+
"sinks": [
|
|
571
|
+
{
|
|
572
|
+
"id": "operations",
|
|
573
|
+
"type": "webhook",
|
|
574
|
+
"url_env": "SYNAPSOR_NOTIFY_WEBHOOK_URL",
|
|
575
|
+
"signing_secret_env": "SYNAPSOR_NOTIFY_SIGNING_SECRET",
|
|
576
|
+
"minimum_severity": "warning",
|
|
577
|
+
"events": [
|
|
578
|
+
"proposal.review_required",
|
|
579
|
+
"worker.dead_lettered",
|
|
580
|
+
"worker.unknown_outcome"
|
|
581
|
+
],
|
|
582
|
+
"environments": ["production"],
|
|
583
|
+
"delivery": "immediate",
|
|
584
|
+
"max_attempts": 5,
|
|
585
|
+
"timeout_ms": 3000,
|
|
586
|
+
"max_response_bytes": 1024,
|
|
587
|
+
"replay_window_seconds": 300,
|
|
588
|
+
"allow_private_destinations": false,
|
|
589
|
+
"recovery_notifications": false,
|
|
590
|
+
"budgets": {
|
|
591
|
+
"per_minute": 10,
|
|
592
|
+
"per_hour": 100,
|
|
593
|
+
"cooldown_seconds": 600,
|
|
594
|
+
"retry_attempt_threshold": 3,
|
|
595
|
+
"degraded_duration_seconds": 120,
|
|
596
|
+
"queue_depth_threshold": 100,
|
|
597
|
+
"queue_age_seconds": 300
|
|
598
|
+
},
|
|
599
|
+
"quiet_hours": {
|
|
600
|
+
"start_utc_hour": 22,
|
|
601
|
+
"end_utc_hour": 7
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
]
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
```
|
|
608
|
+
|
|
609
|
+
Sink `type` is `webhook` or `jsonl`. JSONL requires
|
|
610
|
+
`destination: "stdout"` and accepts no URL/signing fields. Webhook URLs and
|
|
611
|
+
32-byte-or-longer signing secrets come only from the named environment
|
|
612
|
+
variables.
|
|
613
|
+
|
|
614
|
+
`delivery` is `immediate`, `digest`, or `all`. Each sink can filter fixed event
|
|
615
|
+
names, qualified capability names, environments, and minimum severity.
|
|
616
|
+
Per-minute/hour budgets, informational budgets, aggregation windows, cooldown,
|
|
617
|
+
unresolved reminders, digest cadence, escalation delay, retry/degraded
|
|
618
|
+
thresholds, queue thresholds, UTC quiet hours, and opt-in recovery messages
|
|
619
|
+
control interruption volume. Critical events bypass ordinary quiet hours and
|
|
620
|
+
budgets but still coalesce.
|
|
621
|
+
|
|
622
|
+
Private webhook destinations require both
|
|
623
|
+
`allow_private_destinations: true` and an exact
|
|
624
|
+
`private_host_allowlist`. See [Human Attention And
|
|
625
|
+
Notifications](human-attention-notifications.md) for event classes, commands,
|
|
626
|
+
signature verification, SSRF protections, and quiet-default behavior.
|
|
627
|
+
|
|
502
628
|
## Rate limits
|
|
503
629
|
|
|
504
630
|
```json
|
|
@@ -554,6 +680,12 @@ it. See [Graduated Trust Recommendations](graduated-trust.md).
|
|
|
554
680
|
|
|
555
681
|
## Operator identity
|
|
556
682
|
|
|
683
|
+
For the complete lifecycle from public DSL `APPROVAL ROLE`, through IdP group
|
|
684
|
+
mapping and JWT verification, to the immutable approval record and independent
|
|
685
|
+
apply decision, use [Approval Roles And Verified Operator
|
|
686
|
+
Identity](approval-roles-and-operator-identity.md). The examples below are the
|
|
687
|
+
configuration summary; that guide contains the tested local OIDC/JWKS flow.
|
|
688
|
+
|
|
557
689
|
Local development compatibility uses an explicitly unverified environment
|
|
558
690
|
identity:
|
|
559
691
|
|
|
@@ -287,9 +287,17 @@ Use the shared queue explicitly:
|
|
|
287
287
|
synapsor-runner proposals list --config ./synapsor.runner.json
|
|
288
288
|
synapsor-runner proposals show latest --config ./synapsor.runner.json
|
|
289
289
|
synapsor-runner ui --config ./synapsor.runner.json
|
|
290
|
-
synapsor-runner worker run --
|
|
290
|
+
synapsor-runner worker run --supervised --yes \
|
|
291
|
+
--worker-id billing_worker --config ./synapsor.runner.json
|
|
291
292
|
```
|
|
292
293
|
|
|
294
|
+
The supervised path is disabled by default and requires contract permission
|
|
295
|
+
plus a deployment allowlist for the exact digest. Existing `AUTO APPROVE`
|
|
296
|
+
contracts remain manual-apply after upgrade. Worker leases, policy reservations,
|
|
297
|
+
writer posture, source/evidence freshness, idempotency receipts, and UNKNOWN
|
|
298
|
+
outcome recovery are covered in [Operator-Supervised Automatic
|
|
299
|
+
Apply](supervised-automatic-apply.md).
|
|
300
|
+
|
|
293
301
|
Dead-letter operations require verified operator identity:
|
|
294
302
|
|
|
295
303
|
```bash
|
|
@@ -305,6 +313,13 @@ Requeue preserves history and refuses if a durable applied/already-applied
|
|
|
305
313
|
receipt already proves the effect. Discard closes the queue item without
|
|
306
314
|
deleting proposals, receipts, or events.
|
|
307
315
|
|
|
316
|
+
Use `attention show` and the Workbench Human Attention Inbox to inspect
|
|
317
|
+
review-required, stale, limit, dead-letter, UNKNOWN, and reconciliation states
|
|
318
|
+
without copying proposal IDs. Optional external notifications are disabled and
|
|
319
|
+
quiet by default. A signed generic webhook can route selected coalesced
|
|
320
|
+
incidents; it cannot approve or mutate state. See [Human Attention And
|
|
321
|
+
Notifications](human-attention-notifications.md).
|
|
322
|
+
|
|
308
323
|
## Backup, Restore, And Retention
|
|
309
324
|
|
|
310
325
|
```bash
|
|
@@ -169,6 +169,20 @@ outside the model-facing MCP server and verifies:
|
|
|
169
169
|
|
|
170
170
|
If any authority check cannot be verified, the write fails closed.
|
|
171
171
|
|
|
172
|
+
Manual apply remains the default, including after policy auto-approval. An
|
|
173
|
+
eligible single-row direct INSERT or UPDATE may instead use operator-supervised
|
|
174
|
+
automatic apply, but only when the activated contract explicitly permits the
|
|
175
|
+
trusted worker and the deployment independently allowlists the exact
|
|
176
|
+
capability/digest. The model controls neither opt-in. The separately operated
|
|
177
|
+
worker leases approved work and invokes the same guarded-apply implementation
|
|
178
|
+
as manual apply; it repeats current approval, policy, limit, scope, freshness,
|
|
179
|
+
generation-lock, writer-posture, idempotency, and receipt checks immediately
|
|
180
|
+
before execution. Source or supporting-evidence drift causes zero mutation.
|
|
181
|
+
Ambiguous transaction outcomes require reconciliation and are never blindly
|
|
182
|
+
retried. Hard DELETE, reversible changes, set writes, and app-owned/external
|
|
183
|
+
effects are excluded from this first automatic path. See
|
|
184
|
+
[Operator-Supervised Automatic Apply](supervised-automatic-apply.md).
|
|
185
|
+
|
|
172
186
|
Strict freshness is intentionally limited to same-database direct SQL
|
|
173
187
|
writeback. Runner rejects app-owned or cross-source strict freshness because it
|
|
174
188
|
cannot claim one atomic transaction around those effects. Cloud can govern an
|
|
@@ -218,6 +232,16 @@ controls are not MCP tools. The UI does not expose raw SQL, database URLs, or
|
|
|
218
232
|
write credentials, and it does not let a model widen reviewed tables, columns,
|
|
219
233
|
scope, policy, or executor authority.
|
|
220
234
|
|
|
235
|
+
The authoritative store also records redacted human-attention events and
|
|
236
|
+
projects related events into a secured Workbench inbox. External delivery is
|
|
237
|
+
disabled and quiet by default. When an operator enables it, a separate
|
|
238
|
+
dispatcher can route selected coalesced incidents to a JSONL development sink
|
|
239
|
+
or signed HTTPS webhook. Delivery is at least once, redacted, budgeted, and
|
|
240
|
+
observable. A notification, webhook response, inbox acknowledgement, delivery
|
|
241
|
+
replay, or MCP update hint never activates, approves, applies, cancels,
|
|
242
|
+
recovers, or mutates anything. The ledger and Workbench remain the source of
|
|
243
|
+
truth. See [Human Attention And Notifications](human-attention-notifications.md).
|
|
244
|
+
|
|
221
245
|
Contract lint and tests are review aids rather than a proof of complete
|
|
222
246
|
security. Capability breadth can still drift as narrow tools accumulate;
|
|
223
247
|
surface-fitness lint makes high-signal generic, dense, poorly named, and
|
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:
|