@synapsor/runner 0.1.6 → 0.1.8
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 +52 -1
- package/README.md +39 -4
- package/dist/cli.d.ts.map +1 -1
- package/dist/runner.mjs +736 -132
- package/docs/capability-authoring.md +68 -5
- package/docs/conformance.md +11 -0
- package/docs/local-mode.md +22 -0
- package/docs/migrating-to-synapsor-spec.md +1 -1
- package/docs/release-notes.md +30 -0
- package/examples/app-owned-writeback/command-handler.mjs +0 -0
- package/examples/mcp-postgres-billing-app-handler/scripts/run-demo.sh +0 -0
- package/examples/reference-support-billing-app/scripts/run-demo.sh +0 -0
- package/examples/support-billing-agent/scripts/run-demo.sh +0 -0
- package/package.json +6 -7
package/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,58 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
### DSL / JSON Contract Parity
|
|
6
|
+
|
|
7
|
+
- Adds portable spec fields for capability `returns_hint`, proposal
|
|
8
|
+
`numeric_bounds`, and proposal `transition_guards` so reviewed safety
|
|
9
|
+
metadata can live in canonical contracts instead of runner-private config.
|
|
10
|
+
- Extends the DSL with `DESCRIPTION`, `RETURNS HINT`, arg descriptions,
|
|
11
|
+
numeric arg min/max, text `MAX LENGTH`, patch `BOUND`, and `TRANSITION`
|
|
12
|
+
clauses.
|
|
13
|
+
- Adds DSL warnings and `--strict` mode so weak proposal contracts fail CI
|
|
14
|
+
instead of silently compiling.
|
|
15
|
+
- Preserves compiled bounds through `contracts: []` into Runner propose-time
|
|
16
|
+
enforcement and accepts pure-contract configs with `capabilities: []`.
|
|
17
|
+
- Adds `docs/dsl-json-parity.md` so developers can see which fields are
|
|
18
|
+
authored in DSL, validated in JSON, enforced by Runner, and accepted by
|
|
19
|
+
C++/Cloud.
|
|
20
|
+
|
|
21
|
+
### Cloud Registry Push
|
|
22
|
+
|
|
23
|
+
- Wires non-dry-run `synapsor-runner cloud push` to the Synapsor Cloud control
|
|
24
|
+
API. The CLI validates locally, posts normalized `@synapsor/spec` JSON, and
|
|
25
|
+
reports Cloud contract/version/digest details only after the server confirms
|
|
26
|
+
storage.
|
|
27
|
+
- Keeps `--dry-run` network-free and updates error handling for invalid tokens,
|
|
28
|
+
missing workspace permissions, validation errors, conflicts, and network
|
|
29
|
+
failures without printing bearer tokens.
|
|
30
|
+
- Documents the project-scoped Cloud registry path and backend runner-bundle
|
|
31
|
+
export foundation.
|
|
32
|
+
|
|
33
|
+
### Release Verification
|
|
34
|
+
|
|
35
|
+
- Adds `corepack pnpm test:live-apply` as the documented Docker-backed live
|
|
36
|
+
apply smoke. It aliases the existing MCP local examples proof and verifies
|
|
37
|
+
proposal diffs, approval outside MCP, guarded writeback, idempotent retry,
|
|
38
|
+
stale-row conflict, receipts, and replay against disposable Postgres/MySQL
|
|
39
|
+
databases.
|
|
40
|
+
|
|
41
|
+
## 0.1.7
|
|
42
|
+
|
|
43
|
+
### Contract Writeback Resolution
|
|
44
|
+
|
|
45
|
+
- Fixes contract-authored proposal capabilities loaded through `contracts: []`
|
|
46
|
+
so `apply` resolves the same reviewed capability catalog used by serve,
|
|
47
|
+
tools, propose, and doctor.
|
|
48
|
+
- Rejects duplicate capability names across embedded runner config and
|
|
49
|
+
referenced contracts instead of silently shadowing a safety contract.
|
|
50
|
+
- Preserves canonical contract writeback modes, including direct SQL,
|
|
51
|
+
app-owned handler, cloud-worker, and proposal-only/no-local-writeback
|
|
52
|
+
semantics.
|
|
53
|
+
- Fails broken applyable writeback definitions at propose/doctor time before a
|
|
54
|
+
human approves a proposal.
|
|
55
|
+
- Creates local store parent directories automatically and trims env-derived
|
|
56
|
+
URLs, tokens, and trusted context values before use.
|
|
6
57
|
|
|
7
58
|
## 0.1.5
|
|
8
59
|
|
package/README.md
CHANGED
|
@@ -235,6 +235,8 @@ CREATE AGENT CONTEXT local_operator
|
|
|
235
235
|
END
|
|
236
236
|
|
|
237
237
|
CREATE CAPABILITY billing.inspect_invoice
|
|
238
|
+
DESCRIPTION 'Inspect one invoice in the trusted tenant before proposing a waiver.'
|
|
239
|
+
RETURNS HINT 'Returns reviewed invoice fields plus evidence/query-audit handles.'
|
|
238
240
|
USING CONTEXT local_operator
|
|
239
241
|
SOURCE local_postgres
|
|
240
242
|
ON public.invoices
|
|
@@ -242,13 +244,15 @@ CREATE CAPABILITY billing.inspect_invoice
|
|
|
242
244
|
TENANT KEY tenant_id
|
|
243
245
|
CONFLICT GUARD updated_at
|
|
244
246
|
LOOKUP invoice_id BY id
|
|
245
|
-
ARG invoice_id STRING REQUIRED MAX 128
|
|
247
|
+
ARG invoice_id STRING REQUIRED MAX LENGTH 128 DESCRIPTION 'Invoice id such as INV-3001.'
|
|
246
248
|
ALLOW READ id, tenant_id, status, late_fee_cents, updated_at
|
|
247
249
|
REQUIRE EVIDENCE
|
|
248
250
|
MAX ROWS 1
|
|
249
251
|
END
|
|
250
252
|
|
|
251
253
|
CREATE CAPABILITY billing.propose_late_fee_waiver
|
|
254
|
+
DESCRIPTION 'Propose waiving one invoice late fee after inspecting invoice and policy evidence.'
|
|
255
|
+
RETURNS HINT 'Returns a review-required proposal id, exact diff, evidence handle, and source_database_changed:false.'
|
|
252
256
|
USING CONTEXT local_operator
|
|
253
257
|
SOURCE local_postgres
|
|
254
258
|
ON public.invoices
|
|
@@ -256,8 +260,8 @@ CREATE CAPABILITY billing.propose_late_fee_waiver
|
|
|
256
260
|
TENANT KEY tenant_id
|
|
257
261
|
CONFLICT GUARD updated_at
|
|
258
262
|
LOOKUP invoice_id BY id
|
|
259
|
-
ARG invoice_id STRING REQUIRED MAX 128
|
|
260
|
-
ARG reason TEXT REQUIRED MAX 500
|
|
263
|
+
ARG invoice_id STRING REQUIRED MAX LENGTH 128 DESCRIPTION 'Invoice id such as INV-3001.'
|
|
264
|
+
ARG reason TEXT REQUIRED MAX LENGTH 500 DESCRIPTION 'Business reason for the proposed waiver.'
|
|
261
265
|
ALLOW READ id, tenant_id, status, late_fee_cents, waiver_reason, updated_at
|
|
262
266
|
REQUIRE EVIDENCE
|
|
263
267
|
MAX ROWS 1
|
|
@@ -265,6 +269,7 @@ CREATE CAPABILITY billing.propose_late_fee_waiver
|
|
|
265
269
|
ALLOW WRITE late_fee_cents, waiver_reason
|
|
266
270
|
PATCH late_fee_cents = 0
|
|
267
271
|
PATCH waiver_reason = ARG reason
|
|
272
|
+
BOUND late_fee_cents 0..10000
|
|
268
273
|
APPROVAL ROLE billing_lead
|
|
269
274
|
WRITEBACK DIRECT SQL
|
|
270
275
|
END
|
|
@@ -273,20 +278,33 @@ END
|
|
|
273
278
|
Compile, validate, and serve it:
|
|
274
279
|
|
|
275
280
|
```bash
|
|
276
|
-
synapsor-runner dsl compile ./contract.synapsor --out ./synapsor.contract.json
|
|
281
|
+
synapsor-runner dsl compile ./contract.synapsor --out ./synapsor.contract.json --strict
|
|
277
282
|
synapsor-runner contract validate ./synapsor.contract.json
|
|
278
283
|
synapsor-runner contract bundle ./synapsor.contract.json --out ./synapsor-runner-bundle
|
|
279
284
|
synapsor-runner cloud push ./synapsor.contract.json --dry-run
|
|
285
|
+
synapsor-runner cloud push ./synapsor.contract.json \
|
|
286
|
+
--api-url "$SYNAPSOR_CLOUD_BASE_URL" \
|
|
287
|
+
--token "$SYNAPSOR_CLOUD_TOKEN" \
|
|
288
|
+
--workspace "$SYNAPSOR_PROJECT_ID" \
|
|
289
|
+
--name billing-late-fee
|
|
280
290
|
cd ./synapsor-runner-bundle
|
|
281
291
|
cp .env.example .env # fill in and export your read-only database values
|
|
282
292
|
synapsor-runner mcp serve --config ./synapsor.runner.json --store ./.synapsor/local.db
|
|
283
293
|
```
|
|
284
294
|
|
|
295
|
+
`--strict` treats DSL safety warnings as errors, so CI catches proposal
|
|
296
|
+
capabilities that are missing descriptions, returns hints, or numeric patch
|
|
297
|
+
bounds.
|
|
298
|
+
|
|
285
299
|
The `contract bundle` step generates `synapsor.runner.json` (with env-var
|
|
286
300
|
placeholders) inside the bundle directory, which is why `mcp serve` runs from
|
|
287
301
|
there. The server keeps stdout clean for MCP protocol frames and prints its
|
|
288
302
|
ready line on stderr.
|
|
289
303
|
|
|
304
|
+
See [`docs/dsl-json-parity.md`](docs/dsl-json-parity.md) for the current
|
|
305
|
+
field-by-field support matrix across JSON spec, DSL, runner enforcement,
|
|
306
|
+
C++/Cloud compatibility, and Cloud push.
|
|
307
|
+
|
|
290
308
|
Your `synapsor.runner.json` supplies local wiring: database env var names,
|
|
291
309
|
SQLite store path, MCP transport settings, and local debug options. The
|
|
292
310
|
contract supplies the portable meaning: contexts, capabilities, evidence,
|
|
@@ -406,6 +424,18 @@ and proves the proposal-first write path:
|
|
|
406
424
|
npx -y -p @synapsor/runner synapsor-runner demo
|
|
407
425
|
```
|
|
408
426
|
|
|
427
|
+
For contributor/release verification from a checkout, the live apply smoke uses
|
|
428
|
+
disposable Postgres/MySQL containers and the official MCP stdio client transport:
|
|
429
|
+
|
|
430
|
+
```bash
|
|
431
|
+
corepack pnpm test:live-apply
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
It verifies semantic tool listing, proposal diffs, source rows unchanged before
|
|
435
|
+
approval, guarded writeback, idempotent retry, stale-row conflict, receipts, and
|
|
436
|
+
replay. See [`docs/local-mode.md`](docs/local-mode.md#local-mcp-smoke) for
|
|
437
|
+
prerequisites and expected output.
|
|
438
|
+
|
|
409
439
|
After the demo prints its generated config and store path, run the happy path it
|
|
410
440
|
prints. The shape is:
|
|
411
441
|
|
|
@@ -1205,6 +1235,11 @@ Portable contracts can be checked locally before Cloud import:
|
|
|
1205
1235
|
synapsor-runner contract validate ./synapsor.contract.json
|
|
1206
1236
|
synapsor-runner contract bundle ./synapsor.contract.json --out ./synapsor-runner-bundle
|
|
1207
1237
|
synapsor-runner cloud push ./synapsor.contract.json --dry-run
|
|
1238
|
+
synapsor-runner cloud push ./synapsor.contract.json \
|
|
1239
|
+
--api-url "$SYNAPSOR_CLOUD_BASE_URL" \
|
|
1240
|
+
--token "$SYNAPSOR_CLOUD_TOKEN" \
|
|
1241
|
+
--workspace "$SYNAPSOR_PROJECT_ID" \
|
|
1242
|
+
--name billing-late-fee
|
|
1208
1243
|
```
|
|
1209
1244
|
|
|
1210
1245
|
## Current Limitations
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAYA,OAAO,
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAYA,OAAO,EAAoN,KAAK,WAAW,EAA2F,MAAM,6BAA6B,CAAC;AAoB1W,OAAO,EAA6G,KAAK,YAAY,EAAwB,MAAM,2BAA2B,CAAC;AAE/L,OAAO,EAOL,KAAK,gBAAgB,EAEtB,MAAM,mCAAmC,CAAC;AA6U3C,wBAAsB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAqD1D;AA+DD,KAAK,SAAS,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;AAE9E,wBAAsB,aAAa,CACjC,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,GAAE;IACP,GAAG,CAAC,EAAE,SAAS,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACxB,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,MAAM,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;CACvC,GACL,OAAO,CAAC,MAAM,CAAC,CA2TjB;AAmsED,wBAAsB,0BAA0B,CAAC,GAAG,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAS/H"}
|