@synapsor/runner 1.6.2 → 1.6.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/AGENTS.md +2 -2
  2. package/CHANGELOG.md +141 -2
  3. package/CONTRIBUTING.md +10 -3
  4. package/README.md +65 -83
  5. package/SECURITY.md +14 -2
  6. package/THREAT_MODEL.md +64 -4
  7. package/dist/authoring.mjs +151 -16
  8. package/dist/cli.d.ts +31 -3
  9. package/dist/cli.d.ts.map +1 -1
  10. package/dist/local-ui.d.ts +145 -1
  11. package/dist/local-ui.d.ts.map +1 -1
  12. package/dist/runner.mjs +37488 -19009
  13. package/dist/runtime.mjs +4056 -235
  14. package/dist/shadow.mjs +2423 -65
  15. package/docs/README.md +36 -2
  16. package/docs/agent-guided-setup.md +239 -0
  17. package/docs/aggregate-reads.md +14 -5
  18. package/docs/app-owned-executors.md +5 -6
  19. package/docs/approval-roles-and-operator-identity.md +353 -0
  20. package/docs/auto-boundary-and-scoped-explore.md +89 -11
  21. package/docs/capability-authoring.md +21 -2
  22. package/docs/client-recipes.md +1 -1
  23. package/docs/cloud-mode.md +7 -7
  24. package/docs/conformance.md +6 -3
  25. package/docs/current-scope.md +32 -2
  26. package/docs/cursor-plugin.md +3 -3
  27. package/docs/database-enforced-scope.md +6 -0
  28. package/docs/dsl-json-parity.md +75 -0
  29. package/docs/dsl-reference.md +22 -1
  30. package/docs/fresh-developer-usability.md +155 -80
  31. package/docs/getting-started-own-database.md +45 -44
  32. package/docs/guarded-crud-writeback.md +19 -0
  33. package/docs/guided-onboarding.md +399 -0
  34. package/docs/human-attention-notifications.md +367 -0
  35. package/docs/limitations.md +49 -13
  36. package/docs/local-mode.md +36 -22
  37. package/docs/mcp-audit.md +14 -14
  38. package/docs/mcp-client-setup.md +11 -14
  39. package/docs/mcp-clients.md +1 -1
  40. package/docs/migrating-to-synapsor-spec.md +42 -0
  41. package/docs/openai-agents-sdk.md +2 -2
  42. package/docs/production.md +39 -0
  43. package/docs/proposal-evidence-freshness.md +7 -7
  44. package/docs/recipes.md +6 -6
  45. package/docs/release-notes.md +144 -4
  46. package/docs/release-policy.md +20 -7
  47. package/docs/reversible-change-sets.md +1 -1
  48. package/docs/reviewed-database-views.md +132 -0
  49. package/docs/reviewed-relationships.md +245 -0
  50. package/docs/rfcs/006-reviewed-reversible-change-sets.md +1 -1
  51. package/docs/runner-bundles.md +7 -7
  52. package/docs/runner-config-reference.md +132 -0
  53. package/docs/running-a-runner-fleet.md +16 -1
  54. package/docs/schema-api-candidates.md +1 -1
  55. package/docs/security-boundary.md +54 -0
  56. package/docs/store-lifecycle.md +20 -1
  57. package/docs/supervised-automatic-apply.md +267 -0
  58. package/docs/troubleshooting-first-run.md +85 -10
  59. package/docs/use-your-own-database.md +6 -4
  60. package/docs/workbench-ask.md +279 -0
  61. package/docs/writeback-executors.md +7 -7
  62. package/examples/auto-boundary-churn/README.md +1 -1
  63. package/examples/community-solar-clean-room/README.md +7 -0
  64. package/examples/community-solar-clean-room/docker-compose.yml +16 -0
  65. package/examples/community-solar-clean-room/package.json +15 -0
  66. package/examples/community-solar-clean-room/prisma/schema.prisma +171 -0
  67. package/examples/community-solar-clean-room/seed/postgres.sql +571 -0
  68. package/examples/fitflow-guided-onboarding/README.md +43 -0
  69. package/examples/fitflow-guided-onboarding/app/page.tsx +8 -0
  70. package/examples/fitflow-guided-onboarding/docker-compose.yml +16 -0
  71. package/examples/fitflow-guided-onboarding/package.json +18 -0
  72. package/examples/fitflow-guided-onboarding/prisma/schema.prisma +98 -0
  73. package/examples/fitflow-guided-onboarding/seed/postgres.sql +401 -0
  74. package/examples/openai-agents-http/Makefile +1 -1
  75. package/examples/openai-agents-http/README.md +1 -1
  76. package/examples/openai-agents-stdio/Makefile +1 -1
  77. package/examples/openai-agents-stdio/README.md +2 -2
  78. package/examples/openai-agents-stdio/agent.py +1 -4
  79. package/examples/operator-oidc/issuer.mjs +188 -0
  80. package/examples/reference-support-billing-app/README.md +16 -16
  81. package/examples/retail-clean-room/README.md +7 -0
  82. package/examples/retail-clean-room/docker-compose.yml +16 -0
  83. package/examples/retail-clean-room/package.json +9 -0
  84. package/examples/retail-clean-room/prisma/schema.prisma +239 -0
  85. package/examples/retail-clean-room/seed/postgres.sql +781 -0
  86. package/examples/retail-clean-room/view-recipe/average-retained-revenue.synapsor.sql +21 -0
  87. package/examples/retail-clean-room/view-recipe/synapsor.runner.json +25 -0
  88. package/examples/support-plan-credit/README.md +6 -2
  89. package/examples/support-plan-credit/mcp-client-examples/claude-code.sh +1 -4
  90. package/examples/support-plan-credit/mcp-client-examples/claude-desktop.json +1 -4
  91. package/examples/support-plan-credit/mcp-client-examples/codex.config.toml +1 -4
  92. package/examples/support-plan-credit/mcp-client-examples/cursor-global.mcp.json +1 -4
  93. package/examples/support-plan-credit/mcp-client-examples/cursor-project.mcp.json +1 -4
  94. package/examples/support-plan-credit/mcp-client-examples/generic-stdio.json +1 -4
  95. package/examples/support-plan-credit/mcp-client-examples/generic-stdio.mjs +1 -1
  96. package/examples/support-plan-credit/mcp-client-examples/google-adk.py +1 -1
  97. package/examples/support-plan-credit/mcp-client-examples/langchain.mjs +1 -1
  98. package/examples/support-plan-credit/mcp-client-examples/llamaindex.py +1 -1
  99. package/examples/support-plan-credit/mcp-client-examples/openai-agents-stdio.ts +1 -1
  100. package/examples/support-plan-credit/mcp-client-examples/vscode.mcp.json +1 -4
  101. package/fixtures/compatibility/published-1.6.3/manifest.json +76 -0
  102. package/fixtures/compatibility/published-1.6.3/sources/packages/dsl/examples/aggregate-read.synapsor.sql +21 -0
  103. package/fixtures/compatibility/published-1.6.3/sources/packages/dsl/examples/billing-late-fee.synapsor.sql +56 -0
  104. package/fixtures/compatibility/published-1.6.3/sources/packages/dsl/examples/bounded-set-multi-term.synapsor.sql +30 -0
  105. package/fixtures/compatibility/published-1.6.3/sources/packages/dsl/examples/principal-row-scope.synapsor.sql +23 -0
  106. package/fixtures/compatibility/published-1.6.3/sources/packages/spec/fixtures/conformance/aggregate-read/contract.json +119 -0
  107. package/fixtures/compatibility/published-1.6.3/sources/packages/spec/fixtures/conformance/approval-quorum/contract.json +44 -0
  108. package/fixtures/compatibility/published-1.6.3/sources/packages/spec/fixtures/conformance/bounded-set-threats/contract.json +115 -0
  109. package/fixtures/compatibility/published-1.6.3/sources/packages/spec/fixtures/conformance/principal-row-scope/contract.json +78 -0
  110. package/fixtures/compatibility/published-1.6.3/sources/packages/spec/fixtures/conformance/proposal-capability/contract.json +101 -0
  111. package/fixtures/compatibility/published-1.6.3/sources/packages/spec/fixtures/conformance/reversible-change-sets/contract.json +98 -0
  112. package/fixtures/compatibility/published-1.6.3/sources/packages/spec/fixtures/valid/basic-read.contract.json +60 -0
  113. package/llms.txt +10 -5
  114. package/package.json +11 -3
  115. package/schemas/schema-candidate-review.schema.json +42 -0
  116. package/schemas/synapsor.runner.schema.json +227 -4
@@ -2,9 +2,12 @@
2
2
 
3
3
  The canonical scope page is [Current Limitations](limitations.md).
4
4
 
5
- Current `1.6` scope:
5
+ Current `1.6.4` scope:
6
6
 
7
7
  - local semantic MCP tools over Postgres/MySQL without raw SQL tools;
8
+ - one-command, resumable, review-by-exception onboarding from
9
+ `DATABASE_URL` to a real safe read, bounded exploration, protected named
10
+ tools, guided write proposals, and host-neutral MCP client setup;
8
11
  - deterministic whole-schema Auto Boundary drafting from database metadata,
9
12
  statically parsed Prisma/Drizzle schemas, OpenAPI documents, and existing
10
13
  Synapsor definitions;
@@ -12,9 +15,17 @@ Current `1.6` scope:
12
15
  and generation locks; no generated authority activates itself;
13
16
  - local development/staging Scoped Explore through exactly two temporary MCP
14
17
  tools, using typed row plans or a reviewed PM-style analytical cube;
18
+ - optional secured-loopback Workbench Ask over the exact same active tool
19
+ registry, with OpenAI, Anthropic, or a configured OpenAI-compatible endpoint,
20
+ digest-bound direct-egress consent, in-memory credentials/history, bounded
21
+ provider loops, and proposal-only writes;
15
22
  - aggregate `count`, reviewed `count_distinct`, `sum`, `avg`, reviewed
16
23
  dimensions and day/week/month buckets, typed filters, bounded top-N, and at
17
- most one proven many-to-one relationship;
24
+ most three activated star/depth-two relationship paths, each containing one
25
+ or two proven many-to-one links with fan-out one;
26
+ - demand-driven operator review for an exact inactive catalog-proven path,
27
+ explicit nullable-link semantics, per-relation trusted scope, and fail-closed
28
+ rejection of one-to-many, many-to-many, stale, or ambiguous paths;
18
29
  - cohort suppression plus durable extraction, differencing, rate, query,
19
30
  response, and complexity limits;
20
31
  - Protect This Query from a successful local plan to public DSL, canonical
@@ -23,6 +34,10 @@ Current `1.6` scope:
23
34
  generated authority explicitly bound to a generation lock;
24
35
  - trusted context from environment, verified HTTP claims, Cloud sessions, or
25
36
  explicit development-only static values;
37
+ - verified operator decisions through signed local keys or external OIDC/JWKS
38
+ identity, with exact contract-role matching, token-time/issuer/audience
39
+ checks, immutable decision evidence, key rotation, and independent approval
40
+ and apply authority;
26
41
  - evidence handles, normalized query audit, proposals, receipts, local replay,
27
42
  and read-only lifecycle inspection without copying proposal ids;
28
43
  - optional proposal/evidence freshness: live target and declared same-source
@@ -34,6 +49,15 @@ Current `1.6` scope:
34
49
  and protocol-v3 exact receipts;
35
50
  - opt-in reviewed compensation for supported direct SQL changes, using a
36
51
  separate operator proposal and protocol-v4 receipt;
52
+ - default-off operator-supervised automatic apply for exact-digest,
53
+ contract-permitted single-row INSERT/UPDATE capabilities, with an independent
54
+ deployment allowlist, fenced worker leases, policy/limit/freshness/source
55
+ revalidation, hardened writer-posture checks, and explicit UNKNOWN
56
+ reconciliation;
57
+ - durable redacted proposal/worker/boundary/policy attention events, a
58
+ coalesced no-ID Workbench inbox, quiet per-sink routing and digests, JSONL
59
+ development output, signed generic HTTPS webhooks, and an optional
60
+ exact-capability supervision-sink health gate;
37
61
  - safety-wrapped app-owned `http_handler` and `command_handler` executors for
38
62
  richer approved business transactions;
39
63
  - stdio MCP, authenticated Streamable HTTP MCP, and a legacy JSON-RPC bridge;
@@ -60,9 +84,15 @@ Out of scope:
60
84
 
61
85
  - raw `execute_sql`, SQL strings, model-generated SQL, or arbitrary identifiers;
62
86
  - production Scoped Explore or a general-purpose analytics/query AST;
87
+ - production/shared/remote Ask, model-selected provider configuration,
88
+ Synapsor-relayed model calls, persisted chat history, or a claim that every
89
+ OpenAI-compatible server is supported;
63
90
  - general join planning, many-to-many exploration, arbitrary formulas,
64
91
  functions, windows, `HAVING`, subqueries, or statistical privacy guarantees;
65
92
  - model-selected tenant/principal, activation, approval, or commit authority;
93
+ - automatic worker execution for DELETE, reversible changes, set writes,
94
+ app-owned/external effects, or capabilities without deterministic
95
+ single-row conflict/deduplication and receipt guarantees;
66
96
  - UPSERT, DDL, free-form predicates, unbounded writes, or cross-table direct
67
97
  transactions;
68
98
  - strict atomic freshness for app-owned handlers, APIs, or cross-source
@@ -6,7 +6,7 @@ The Synapsor Cursor plugin is an official-format Cursor plugin under
6
6
  instructions.
7
7
 
8
8
  Current implementation evidence was checked against Cursor's public plugin,
9
- plugin-reference, MCP, and deeplink documentation on 2026-07-20:
9
+ plugin-reference, MCP, and deeplink documentation on 2026-07-25:
10
10
 
11
11
  - <https://cursor.com/docs/plugins>
12
12
  - <https://cursor.com/docs/reference/plugins>
@@ -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.6.0-progress.md`. Protocol/static validation is not a
17
+ `development/runner-1.6.4-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 production stdio MCP server pinned to `@synapsor/runner@1.6.2`;
22
+ - one production stdio MCP server pinned to `@synapsor/runner@1.6.4`;
23
23
  - one `/synapsor-protect` agent command;
24
24
  - one discoverable Safe Action skill;
25
25
  - one file-scoped rule for `synapsor/actions/**/*.ts`;
@@ -106,6 +106,12 @@ attested. Required properties include:
106
106
  - `INSERT` has a suitable `WITH CHECK` expression;
107
107
  - `UPDATE` has both `USING` and `WITH CHECK`.
108
108
 
109
+ For read-only PostgreSQL views, hardened mode additionally requires
110
+ `security_invoker=true` and `security_barrier=true`, a non-owner/non-bypass
111
+ Runner role, and successful recursive attestation of every referenced base
112
+ relation. See [Reviewed Database Views](reviewed-database-views.md). Ordinary
113
+ owner-rights or unverifiable views fail closed.
114
+
109
115
  ### Example PostgreSQL policy
110
116
 
111
117
  Use a non-owner read role and a separate non-owner write role. Adapt names and
@@ -0,0 +1,75 @@
1
+ # DSL / JSON Parity Matrix
2
+
3
+ Status: Synapsor contract `0.1`.
4
+
5
+ `@synapsor/spec` is the canonical contract. `@synapsor/dsl` is an authoring
6
+ layer that compiles into that JSON. `@synapsor/runner` and Synapsor Cloud should
7
+ consume the same contract shape instead of inventing separate semantics.
8
+
9
+ Author DSL files as `contract.synapsor.sql` when possible so editors provide
10
+ generic SQL highlighting. The legacy `contract.synapsor` suffix remains
11
+ supported, and both filenames compile to the same canonical JSON.
12
+
13
+ Legend:
14
+
15
+ - Supported: validated and preserved.
16
+ - Enforced: runtime checks the field before exposing or applying behavior.
17
+ - Preview: accepted as a contract declaration, but not a full local runtime
18
+ engine.
19
+ - Not supported: fails clearly or is documented as intentionally absent.
20
+
21
+ | Field / semantic | JSON spec | DSL syntax | Compile output | Runner load | Runner enforcement | C++/Cloud import/export | Cloud push | Tests / notes |
22
+ | --- | --- | --- | --- | --- | --- | --- | --- | --- |
23
+ | Context names | Supported | `CREATE AGENT CONTEXT` | Supported | Supported | Referenced by capabilities/workflows | Supported | Supported | Spec, DSL, runner, C++ fixtures |
24
+ | Capability names | Supported | `CREATE CAPABILITY` | Supported | Supported | Exposed as semantic MCP tools | Supported | Supported | Raw SQL/approval/commit tools remain absent |
25
+ | Workflow names | Supported | `CREATE AGENT WORKFLOW` | Supported | Loaded as declaration | Preview only; runner does not execute full DAGs | Supported as declaration | Supported | Do not claim workflow DAG execution |
26
+ | Policy names | Supported | Approval policy emitted by `AUTO APPROVE WHEN` | Preserved where represented | Loaded | Limited/local | Supported/preserved or rejected clearly | Supported | Rich policy packs are Cloud/paid surface |
27
+ | Contract description | Supported in `metadata.description` | Via metadata/examples | Preserved | Preserved | Not behavior-affecting | Supported | Supported | Useful for registry display |
28
+ | Context description | Supported | Preview/partial | Preserved when present | Preserved | Not behavior-affecting | Supported | Supported | Unknown fields fail unless extension-prefixed |
29
+ | Capability description | Supported | `DESCRIPTION '...'` | Supported | Tool metadata | Model-facing description | Supported | Supported | CLI tests inspect generated metadata |
30
+ | Argument description | Supported | `ARG ... DESCRIPTION '...'` | Supported | Input schema | Model-facing schema | Supported | Supported | Required args validated |
31
+ | Returns hint | Supported as `returns_hint` | `RETURNS HINT '...'` | Supported | Tool metadata | Model-facing output guidance | Supported | Supported | Strict DSL warns when missing on proposals |
32
+ | Arg name/type/required | Supported | `ARG name TYPE REQUIRED` | Supported | Input schema | Required/type validation | Supported | Supported | Model trust args rejected |
33
+ | Primary-key lookup | Supported as `lookup.id_from_arg` | `LOOKUP arg BY primary_key` | Supported; non-primary columns fail | Loaded | One fixed primary-key row | Supported | Supported | Compiler rejects `LOOKUP_COLUMN_UNSUPPORTED` rather than rewriting intent |
34
+ | Arg max length | Supported | `MAX LENGTH n` | Supported | Input schema | Enforced where runtime has input schema checks | Supported | Supported | String patterns are not yet supported |
35
+ | Arg numeric bounds | Supported | `ARG amount NUMBER MIN n MAX m` and `BOUND field n..m` | Supported | Input schema/proposal metadata | Enforced before proposal/apply where patch binding is known | Supported | Supported | Numeric-bounds fixture |
36
+ | Arg enum | Supported in JSON | Not expressible in DSL 0.1 | Preserved if in JSON | Loaded into schema | Enforced by schema validation where present | Supported/rejected clearly by validator | Supported | Use canonical JSON when an enum is required |
37
+ | Defaults / nullable | Not stable in 0.1 | Not supported | Fails as unknown core fields | Not supported | Not supported | Rejected unless extension-prefixed | Rejected | Avoid implying defaulted args |
38
+ | Visible fields | Supported | `ALLOW READ ...` | Supported | Read/proposal field map | Only visible fields can be returned | Supported | Supported | Kept-out overlap rejected |
39
+ | Kept-out fields | Supported | `KEEP OUT ...` | Supported | Hidden from tool schemas/results | Must not leak into evidence/replay/proposal surfaces | Supported | Supported | Kept-out conformance fixture |
40
+ | Hidden/model-forbidden fields | Represented by kept-out/trusted bindings | `KEEP OUT`, trusted context bindings | Supported | Supported | Raw table/column args rejected | Supported | Supported | No raw table/column model args |
41
+ | Session/tenant/principal bindings | Canonical `SESSION` plus `ENVIRONMENT`, `HTTP_CLAIM`, `CLOUD_SESSION`, and `STATIC_DEV` | `BIND ... FROM source`, `TENANT BINDING`, `PRINCIPAL BINDING` | Preserved; `--target runner` rejects `SESSION` | Runner rejects `SESSION`; implemented providers load normally | Model cannot supply tenant/principal authority; verified HTTP/Cloud claims remain distinct from process environment | C++/Cloud implements typed `SESSION` | Supported as canonical content | Runner commands fail `SESSION_BINDING_UNSUPPORTED`; no environment fallback |
42
+ | Evidence required | Supported | `REQUIRE EVIDENCE` | Supported | Loaded | Evidence/query audit recorded by runner flows | Supported | Supported | Read/proposal fixtures |
43
+ | Evidence options | Supported as `sources`, `query_audit`, `handle_prefix` | Partial | Preserved when present | Loaded | Query audit/evidence handles where supported | Supported/preserved | Supported | More DSL clauses may be added later |
44
+ | Proposal action | Supported | `PROPOSE ACTION ...` | Supported | Loaded | Proposal created instead of commit | Supported | Supported | Proposal conformance fixture |
45
+ | Allowed write fields | Supported | `ALLOW WRITE ...` | Supported | Loaded | Apply rejects widening beyond reviewed fields | Supported | Supported | Contract-authored apply regression |
46
+ | Patch bindings | Supported | `PATCH field = value/ARG arg` | Supported | Loaded | Direct SQL/app handler payload generation | Supported | Supported | Direct/app-handler tests |
47
+ | Numeric proposal bounds | Supported | `BOUND field min..max` | Supported | Loaded | Out-of-bounds proposals rejected | Supported | Supported | Numeric-bounds rejection test |
48
+ | Transition guards | Supported in JSON | `TRANSITION ...` preview | Preserved | Loaded | Enforced only where runner has enough current-row state | Supported/preserved | Supported | Metadata preservation test |
49
+ | Approval requirement | Supported | `APPROVAL ROLE ...` | Supported | Loaded | Approval remains outside MCP | Supported | Supported | No model-facing approve tool |
50
+ | Approval policy | Supported | `AUTO APPROVE WHEN field <= integer` after `APPROVAL ROLE` | Emits `approval.mode=policy`, `approval.policy`, and `policies[]` approval rules | Loaded | Runner may auto-approve; manual apply remains the default. A separate trusted worker may apply only under the exact-digest dual opt-in below. | Must preserve `approval.policy` and `policies[]` | Supported | Auto-approval conformance fixture |
51
+ | Supervised-worker permission | Optional, default-deny `proposal.execution.supervised_worker = "allowed"` | `ALLOW SUPERVISED WORKER APPLY` | Emits only the contract-side permission | Loaded | Applies nothing by itself. Eligible single-row INSERT/UPDATE may be consumed only when a separate deployment allowlist matches the exact active digest; all guarded checks run again. | Canonical field must be preserved; Cloud/C++ execution is not implied | Registry may preserve; execution support is local Runner-specific | Existing contracts without the field retain their normalization, digest, and manual-apply behavior |
52
+ | Writeback direct SQL | Supported | `WRITEBACK DIRECT SQL` | Supported | Loaded | Guarded single-row INSERT/UPDATE/DELETE | New operation fields require independent Cloud/C++ adoption | New operation fields require independent Cloud/C++ adoption | `test:guarded-crud` on Postgres/MySQL |
53
+ | Bounded set writeback | Supported as operation cardinality, typed selection/batch, row/value caps | `UPDATE|DELETE SET`, fixed `SELECT WHERE`, `INSERT SET`, typed `ITEM FIELD`, `MAX ROWS`, `MAX TOTAL` | Supported | Supported | Fixed/frozen/atomic Postgres/MySQL execution; human approval only; hard cap 100 | Not claimed until independently implemented and verified | Registry may preserve; execution support not claimed | R1-R7 conformance plus `test:bounded-set` |
54
+ | Reviewed reversibility | Supported as `proposal.reversibility.mode = reviewed_inverse` | `REVERSIBLE` | Supported | Supported | Direct SQL only; bounded inverse after unambiguous apply; operator revert creates a new proposal; no model-facing rollback | Canonical field must be preserved; Cloud/C++ execution not claimed until independently verified | Registry may preserve; execution support not claimed | Reversible-change-set conformance plus `test:reversible` |
55
+ | Writeback handler | Supported | `WRITEBACK APP HANDLER EXECUTOR name` | Supported | Loaded | Runner POSTs approved proposal to configured executor | Supported as contract intent | Supported | Handler URL/token stay in runner config, not contract |
56
+ | Idempotency metadata | Supported where represented | Limited | Preserved if present | Loaded | Receipts/idempotency guard local writes | Supported/preserved | Supported | Do not store credentials |
57
+ | x-cloud-* extensions | Supported in documented object locations | Not first-class syntax; JSON preserved | Preserved if present | Loaded/preserved | Not behavior unless known | Preserved or rejected clearly | Supported | Unknown unprefixed fields fail |
58
+ | x-runner-* extensions | Supported | Not first-class syntax; JSON preserved | Preserved if present | Loaded/preserved | Runner-specific where documented | Preserved | Supported | Keep separate from core semantics |
59
+ | x-experimental-* extensions | Supported | Not first-class syntax; JSON preserved | Preserved if present | Loaded/preserved | Experimental only | Preserved | Supported | Do not market as stable |
60
+ | Generated pseudo-syntax | Not supported | `ROOT EXTERNAL`, `JOIN EXTERNAL`, `RETURN ANSWER WITH CITATIONS`, `AUTO MERGE` fail | Fails clearly | Not loaded | Not applicable | Rejected unless promoted to spec | Rejected | These are not public 0.1 DSL |
61
+ | Cloud push dry-run | N/A | N/A | Normalized payload | N/A | No network call | N/A | Supported | `cloud push --dry-run --json` |
62
+ | Cloud push upload | N/A | N/A | Normalized payload POST | N/A | N/A | Cloud validates server-side | Supported | `/v1/control/projects/:project_id/agent-contracts` |
63
+ | Cloud registry versioning | N/A | N/A | N/A | N/A | N/A | Project-scoped registry | Supported | Identical digest is idempotent; changed digest creates new version |
64
+ | Runner bundle export | N/A | N/A | N/A | N/A | N/A | Backend bundle endpoint | Supported as backend foundation | Includes placeholders only, no secrets |
65
+
66
+ ## Current Intentional Limits
67
+
68
+ The runner can declare workflows in contracts, but it does not execute full
69
+ workflow DAGs, settlement policies, native Synapsor branches, or auto-merge
70
+ logic locally. Those remain Cloud/C++ platform features unless separately
71
+ implemented in the OSS runtime.
72
+
73
+ Contracts must not contain database URLs, API tokens, private keys, passwords,
74
+ or row data. Local runner config stores environment variable names. Cloud push
75
+ stores normalized contract JSON and audit metadata only.
@@ -222,7 +222,8 @@ The protected clauses mean:
222
222
  | `PROTECTED READ ROWS` / `AGGREGATE` | Selects a frozen row or aggregate protected-read shape. |
223
223
  | `BOUNDARY DIGEST sha256:...` | Binds the capability to the exact human-activated exploration authority. |
224
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. |
225
+ | `PROTECTED RELATIONSHIP name ON local_key REFERENCES schema.table.target_key PRIMARY KEY pk TENANT KEY tenant [PRINCIPAL SCOPE KEY principal]` | Legacy one-hop form. It freezes one inspected, reviewed many-to-one path with fan-out one and cannot be mixed with `LINK` declarations. |
226
+ | `PROTECTED RELATIONSHIP name LINK 1|2 ON local_key REFERENCES schema.table.target_key PRIMARY KEY pk TENANT KEY tenant [PRINCIPAL SCOPE KEY principal] UNMATCHED EXCLUDE|KEEP NULL` | Additive path form. Up to three user-named paths may contain one or two contiguous, ordered many-to-one links. Missing-row semantics are explicit and digest-bound. |
226
227
  | `PROTECTED FILTER field OP FIXED value` | Freezes a reviewed literal. `OP` is `EQ`, `NEQ`, `LT`, `LTE`, `GT`, `GTE`, or bounded fixed-list `IN`. |
227
228
  | `PROTECTED FILTER field OP ARG name` | Allows only one declared typed/bounded argument at that reviewed literal position. |
228
229
  | `ALLOW READ ...` / `ROW ORDER BY ...` | Freezes row projection and up to three fixed sort fields for row mode. |
@@ -241,6 +242,16 @@ not have to transcribe digests or limits. The generated DSL compiles through
241
242
  canonical Spec. Existing contracts with no `protected_read` field normalize
242
243
  and hash exactly as before.
243
244
 
245
+ In a `PROTECTED RELATIONSHIP` declaration, `name`, the keys, and the
246
+ `schema.table.target_key` reference are user-reviewed identifiers generated
247
+ from inspected database evidence. `PROTECTED RELATIONSHIP`, `LINK`, `ON`,
248
+ `REFERENCES`, `PRIMARY KEY`, `TENANT KEY`, `PRINCIPAL SCOPE KEY`, and
249
+ `UNMATCHED` are DSL keywords. `LINK 1` starts a path and optional `LINK 2`
250
+ continues that same path. `UNMATCHED EXCLUDE` removes a counted row whose
251
+ optional relationship is missing; `UNMATCHED KEEP NULL` retains it with an
252
+ empty group value. See [Reviewed Relationship
253
+ Paths](reviewed-relationships.md) for the compiled JSON and runtime guarantees.
254
+
244
255
  Protected row and aggregate capabilities can be served after exact-digest
245
256
  activation even when temporary Scoped Explore is disabled. Production never
246
257
  needs or advertises `app.explore_data`. See [Auto Boundary, Scoped Explore, And
@@ -389,6 +400,7 @@ patched column. Values may be identifiers or quoted strings.
389
400
  AUTO APPROVE WHEN amount_cents <= 2500
390
401
  LIMIT 20 PER DAY
391
402
  LIMIT TOTAL 100000 PER DAY
403
+ ALLOW SUPERVISED WORKER APPLY
392
404
  WRITEBACK DIRECT SQL
393
405
  ```
394
406
 
@@ -422,6 +434,15 @@ leaves the proposal in `pending_review` and records
422
434
  `policy_auto_approval_deferred` with observed, proposed, and projected values.
423
435
  It does not reject or auto-apply the proposal.
424
436
 
437
+ `ALLOW SUPERVISED WORKER APPLY` is an optional contract-side execution
438
+ permission. It compiles to
439
+ `execution: { "supervised_worker": "allowed" }` and changes the contract
440
+ digest. It does not start a worker or turn `AUTO APPROVE` into auto-apply.
441
+ Runner also requires a deployment allowlist for the exact capability/digest
442
+ and accepts only the narrower eligible single-row direct INSERT/UPDATE shapes.
443
+ See [Operator-Supervised Automatic
444
+ Apply](supervised-automatic-apply.md).
445
+
425
446
  Writeback forms:
426
447
 
427
448
  | Clause | Meaning |
@@ -1,110 +1,185 @@
1
1
  # Fresh-Developer Usability Protocol
2
2
 
3
- Use this protocol with five developers who have not previously used Synapsor.
4
- It is a launch gate, not an automated test. A maintainer may rehearse the
5
- protocol, but must not report a participant result unless that person actually
6
- completed the session.
3
+ This is the owner-observation script for Runner 1.6.4. Give it to a
4
+ database-familiar developer who has not used Synapsor. Automated tests prove
5
+ the mechanics; this protocol checks whether the product is understandable.
6
+
7
+ Do not report a participant result unless that person actually completed the
8
+ session.
7
9
 
8
10
  ## Goal
9
11
 
10
- Measure whether a developer can connect an existing supported staging project,
11
- draft one disabled Safe Action with a coding agent, receive an exact Data PR,
12
- approve outside the agent, and find the guarded receipt without learning the
13
- canonical JSON or SQL-like DSL first.
12
+ Starting from an empty directory and a synthetic or disposable staging
13
+ database, the participant should reach:
14
+
15
+ ```text
16
+ Connect -> Review -> Try -> Explore -> Protect -> Propose
17
+ ```
18
+
19
+ They must do so without raw SQL, hand-authored config/DSL/JSON/DDL, an account,
20
+ Cloud, Cursor, a model key, or maintainer instruction.
14
21
 
15
- Measure product time separately from the initial package download. Start the
16
- product timer only after `synapsor-runner --version` succeeds.
22
+ Measure product time separately from initial npm download. Start the timer
23
+ after this succeeds:
17
24
 
18
- ## Participant Setup
25
+ ```bash
26
+ npx -y @synapsor/runner --version
27
+ ```
28
+
29
+ ## Setup
19
30
 
20
- Provide each participant with:
31
+ Provide:
21
32
 
22
- - a fresh clone of their application or the support-plan-credit reference app;
23
33
  - Node 22.13 or newer;
24
- - a disposable Postgres staging database and least-privilege read/write roles;
25
- - exported database URLs and trusted tenant/principal values;
26
- - current stable Cursor, with no existing Synapsor configuration;
27
- - the README only. Do not give verbal product-architecture instruction.
28
-
29
- Never use production credentials or data. Record the OS, Node version, Cursor
30
- version, package-install method, database engine, and whether the package was
31
- already cached.
32
-
33
- ## Tasks
34
-
35
- Ask the participant to complete these tasks without a maintainer taking control:
36
-
37
- 1. Run the four-second synthetic proof and identify whether the model can call
38
- `approve`, `apply`, `commit`, or raw SQL.
39
- 2. Connect the staging project and confirm the trusted organization scope.
40
- 3. Tell Cursor one business action to make safe and use the generated
41
- `/synapsor-protect` path or exact fallback prompt.
42
- 4. Find the disabled action file and explain why editing it does not activate a
43
- tool.
44
- 5. Open the Workbench effect preview and confirm the source row is unchanged.
45
- 6. Explicitly activate the reviewed digest through the operator-controlled UI.
46
- 7. Reconnect Cursor if instructed and create one proposal through the semantic
47
- tool.
48
- 8. Review the exact before/after Data PR, approve outside Cursor, and apply it.
49
- 9. Locate the receipt/replay record and explain what happens on retry.
50
- 10. Draft a second disabled action without changing the active tool surface.
51
-
52
- Do not rescue a participant until they have been blocked for two minutes. Record
53
- the exact screen, command, wording, or missing prerequisite that blocked them.
34
+ - the packaged synthetic FitFlow fixture or equivalent disposable staging
35
+ Postgres;
36
+ - a SELECT-only, non-owner connection URL available for hidden paste or an
37
+ explicitly approved project `.env` file;
38
+ - the README only;
39
+ - no existing Synapsor project files.
54
40
 
55
- ## Measurements
41
+ Never use production credentials or data. Record OS, Node version, package
42
+ cache state, database engine, and whether an external document was opened.
56
43
 
57
- For each participant, record:
44
+ ## Participant Prompt
58
45
 
59
- | Measure | Target |
60
- | --- | --- |
61
- | Installed CLI to first own-data Data PR | under 5 minutes |
62
- | Installed CLI to first guarded receipt | under 8 minutes |
63
- | Second disabled action draft after setup | under 2 minutes |
64
- | Second action ready for explicit activation | under 5 minutes |
65
- | Handwritten canonical JSON or DSL | none on the happy path |
66
- | Extra CLI command after Cursor proposal call | none |
67
- | Unsafe authority exposed to Cursor | none |
46
+ Say only:
47
+
48
+ ```text
49
+ Set up Synapsor for this staging application. Reach one safe read, ask one
50
+ bounded aggregate question you have not seen before, protect that analysis as
51
+ a reusable tool, and create one safe write proposal. Explain what the model can
52
+ and cannot do as you go.
53
+ ```
68
54
 
69
- Also record every wrong turn, maintainer intervention, misunderstood trust
70
- boundary, and request for a model-provider key or Synapsor account.
55
+ Do not explain Synapsor’s architecture first.
71
56
 
72
- ## Pass Criteria
57
+ ## Starting Command
73
58
 
74
- The launch gate passes only when all five participants:
59
+ The participant should find and run:
75
60
 
76
- - complete the first Data PR without handwritten JSON or DSL;
77
- - correctly identify that activation, approval, and apply are outside the
78
- model-facing MCP surface;
79
- - observe unchanged source data before approval;
80
- - produce one guarded receipt; and
81
- - expose only the intended semantic read/proposal tools in Cursor.
61
+ ```bash
62
+ npx -y @synapsor/runner start
63
+ ```
82
64
 
83
- At least four of five must meet every timing target. Any cross-tenant result,
84
- hidden-field exposure, pre-approval mutation, automatic activation, raw SQL
85
- tool, or model-visible commit authority is a release blocker regardless of
86
- timing.
65
+ No other shell command should be required through the first proposal. The
66
+ participant may use Workbench for all human review and Try steps.
67
+
68
+ ## Observation Tasks
69
+
70
+ Record whether the participant can:
71
+
72
+ 1. identify the database, inspected resources, and current authority state;
73
+ 2. explain why no source row was read before activation;
74
+ 3. find fields Runner kept out and unresolved high-risk exceptions;
75
+ 4. confirm row identity, tenant scope, and principal scope;
76
+ 5. activate only the displayed reviewed digest;
77
+ 6. drive one real safe read and state which fields were visible;
78
+ 7. explain that the result came from a named capability or temporary
79
+ authoring-only Explore authority;
80
+ 8. ask one unfamiliar PM-style aggregate without SQL or plan JSON;
81
+ 9. understand a cohort-suppression or reviewed-boundary refusal;
82
+ 10. recover from one intentionally blocked request using the displayed single
83
+ next action;
84
+ 11. Protect the useful result without copying an opaque handle;
85
+ 12. explain why the protected capability is still disabled;
86
+ 13. activate that exact digest and confirm Explore can be disabled while the
87
+ named capability remains;
88
+ 14. choose **Add a safe action** and define one bounded single-row business
89
+ proposal;
90
+ 15. explain why schema structure did not grant business write authority;
91
+ 16. call the action and confirm the source database is unchanged;
92
+ 17. find the proposal, exact effect, required approval, receipt mode, and
93
+ conflict guard;
94
+ 18. explain who may activate, approve, and apply.
95
+
96
+ Do not rescue the participant until they have been blocked for two minutes.
97
+ Record the exact screen, wording, or prerequisite that blocked them.
98
+
99
+ ## Required Comprehension Check
100
+
101
+ Ask the participant to explain these four facts in their own words:
102
+
103
+ 1. The model does not receive raw SQL.
104
+ 2. Reads use reviewed fields and trusted tenant/principal scope.
105
+ 3. Model-facing writes create proposals instead of committing.
106
+ 4. The model cannot activate, approve, or apply.
107
+
108
+ Any incorrect answer is a usability failure even when the commands worked.
87
109
 
88
- ## Reporting Template
110
+ ## Measurements
89
111
 
90
- Record one row per real participant:
112
+ | Measure | Release target |
113
+ | --- | --- |
114
+ | First schema summary | at most 60 seconds |
115
+ | First safe read | at most 3 minutes |
116
+ | First PM-style aggregate | at most 5 minutes |
117
+ | First protected named capability | at most 8 minutes |
118
+ | First guided proposal | at most 10 minutes |
119
+ | Shell commands through first proposal | at most 3; golden target is 1 |
120
+ | Manual project-file edits | 0 |
121
+ | External documentation searches | 0 |
122
+ | Raw SQL or plan JSON composed | 0 |
123
+ | Opaque handles copied | 0 |
124
+ | Screens with multiple primary next actions | 0 |
125
+ | Unsafe authority exposed to a model | 0 |
126
+
127
+ Also record clicks, deliberate human security decisions, wrong turns,
128
+ maintainer interventions, and whether resuming the first command changed any
129
+ file or digest.
130
+
131
+ For a realistic 30–50-table schema, the first useful result must still complete
132
+ within five minutes through review by exception. A blind bulk-approval control
133
+ is an automatic failure.
134
+
135
+ ## Safety Blockers
136
+
137
+ Stop and fail the release for any:
138
+
139
+ - cross-tenant or cross-principal result;
140
+ - kept-out-field exposure;
141
+ - source-row read before activation;
142
+ - source mutation before approval;
143
+ - automatic activation;
144
+ - raw SQL/SQL-string/model-generated identifier;
145
+ - model-visible activation, approval, apply, commit, setup, or revert;
146
+ - production or remote Scoped Explore tool;
147
+ - write-capable/owner/superuser/`BYPASSRLS` Explore credential;
148
+ - discarded review state after a recoverable failure.
149
+
150
+ ## Recording Template
91
151
 
92
152
  ```text
93
153
  Participant:
94
154
  Date:
95
155
  Environment:
96
- Cold package download:
156
+ Package cached: yes | no
97
157
  Product timer start:
98
- First Data PR:
99
- First receipt:
100
- Second draft:
101
- Second activation-ready action:
158
+ Schema summary:
159
+ First safe read:
160
+ First aggregate:
161
+ Protected capability:
162
+ First proposal:
163
+ Shell commands:
164
+ Workbench primary actions:
165
+ Human authority decisions:
166
+ Manual file edits:
167
+ External docs opened:
168
+ Blocked-request recovery:
102
169
  Interventions:
103
- Tool surface observed:
104
- Safety-boundary explanation:
170
+ Four-part explanation:
105
171
  Outcome: pass | fail
106
172
  ```
107
173
 
108
- Until five real sessions are recorded, report this gate as **owner verification
109
- pending**. Do not infer usability from unit tests, protocol tests, or a
110
- maintainer-run demo.
174
+ ## Maintainer Evidence
175
+
176
+ The automated packed FitFlow run records deterministic timing and interaction
177
+ evidence in:
178
+
179
+ ```text
180
+ development/runner-1.6.4-fitflow-results.json
181
+ ```
182
+
183
+ That evidence does not substitute for a first-time participant. Until a real
184
+ session is recorded, report **owner observation pending**, not “developer
185
+ usability proven.”