Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
test(goldens): the --tools-json golden carries capture's three full-surface provenance fields (#6524)
garrytaned6dbb44233e
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 18d470923c..dfea9b68ae 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -16,7 +16,7 @@ identifiers and attribution are available in the pre-removal Git revision### Itemized changes-- **The capture op declares the CLI's provenance fields.** `source_kind`, `source_uri` and `ingested_via` are optional strings on `capture` (`CAPTURE_CLI_PROVENANCE_PARAMS` in `src/core/persistence/params.ts`), `fullSurfaceOnly` like `content_origin`: dispatch admits them on every transport, the full surface advertises them, and the starter tool list does not carry them, so its size budget is unchanged (`test/mcp-schema-budget.test.ts`). The operation manifest is regenerated.+- **The capture op declares the CLI's provenance fields.** `source_kind`, `source_uri` and `ingested_via` are optional strings on `capture` (`CAPTURE_CLI_PROVENANCE_PARAMS` in `src/core/persistence/params.ts`), `fullSurfaceOnly` like `content_origin`: dispatch admits them on every transport, the full surface advertises them, and the starter tool list does not carry them, so its size budget is unchanged (`test/mcp-schema-budget.test.ts`). The operation manifest and the `--tools-json` golden (`test/fixtures/goldens/cli/tools-json.json`, the three new full-surface fields) are regenerated.- **A thin client sends no provenance.** `gbrain capture` builds its parameters in one place (`captureParams`) and attaches the trio only on a local install; a thin client never claimed trusted provenance that the owner would replace anyway, and an older host that predates this release no longer rejects its captures for sending it.- Tests, each failing on the previous release with the exact refusal above: `test/capture-dispatch-provenance-6524.test.ts` dispatches the CLI's shape as a trusted local caller (row keeps `capture-cli` / `cli-positional`) and as a remote caller (row is `mcp:capture`), on PGLite and Postgres; `test/capture-cli-params-contract-6524.test.ts` checks every CLI shape (positional, `--stdin`, `--file` local, `--file` and positional on a thin client) against the server's own unknown-parameter check and pins the full-surface-only declaration; `test/capture-live-transports-6524.test.ts` runs the real `gbrain capture` subprocess against a running stdio `gbrain serve` (resident PGLite owner, delegated over IPC) and from a thin-client home against a running `gbrain serve --http`.diff --git a/test/fixtures/goldens/cli/tools-json.json b/test/fixtures/goldens/cli/tools-json.jsonindex c516012960..5180c3c803 100644--- a/test/fixtures/goldens/cli/tools-json.json+++ b/test/fixtures/goldens/cli/tools-json.json@@ -2,8 +2,8 @@"golden": {"exitCode": 0,"stderr": "",- "stdoutBytes": 231140,- "stdoutSha256": "bb979a78c5e89bb88016cc8af97c2215136976a11b8fdba6de37d572d83dc54d",+ "stdoutBytes": 231864,+ "stdoutSha256": "7c78c1bc5229533a82e47b508d6208d0d9e993b8e1129664b363a3656b0a193f","toolNames": ["remember","entity",@@ -758,11 +758,14 @@"depth": "string?","expected_revision": "string?","force": "boolean?",+ "ingested_via": "string?","kind": "string?","local_file": "string?","request_id": "string?","slug": "string?","source_id": "string?",+ "source_kind": "string?",+ "source_uri": "string?","type": "string?","what": "string?","where": "string?",@@ -796,6 +799,10 @@"description": "Ignore the revision.","type": "boolean"},+ "ingested_via": {+ "description": "Trusted local CLI provenance (capture-cli); a remote caller's value is replaced by the server-stamped mcp:capture.",+ "type": "string"+ },"kind": {"description": "Event kind.","type": "string"@@ -816,6 +823,14 @@"description": "Write source.","type": "string"},+ "source_kind": {+ "description": "Trusted local CLI provenance (capture-cli); a remote caller's value is replaced by the server-stamped mcp:capture.",+ "type": "string"+ },+ "source_uri": {+ "description": "Trusted local CLI provenance (stdin, cli-positional); a remote caller's value is replaced by the server-stamped mcp:capture.",+ "type": "string"+ },"type": {"description": "Schema-pack page type (default note).","type": "string"