Skip to content

chore(deps): bump sdk/go to v0.11.0 (v0.3.0 envelope migration)#67

Merged
ojongerius merged 2 commits into
mainfrom
chore/sdk-go-v0.11.0
May 22, 2026
Merged

chore(deps): bump sdk/go to v0.11.0 (v0.3.0 envelope migration)#67
ojongerius merged 2 commits into
mainfrom
chore/sdk-go-v0.11.0

Conversation

@ojongerius
Copy link
Copy Markdown
Contributor

Summary

  • Bump github.com/agent-receipts/ar/sdk/go from v0.9.0 to the stable v0.11.0.
  • Refactor internal/store/reader_test.go so it compiles against the new envelope-shape Action.ParametersDisclosure (*receipt.DisclosureEnvelope instead of the legacy map[string]string).
  • Production code in internal/store/reader.go builds unchanged; no runtime behaviour rewrite in this PR.

Why

Phase 6 of the v0.3.0 release in agent-receipts/ar (issue #280): the SDK has graduated to v0.11.0, and per ADR-0012 parameters_disclosure switched from a flat {input, output} map to an HPKE-encrypted DisclosureEnvelope ({v, alg, recipients, ct}). Consumers must move off the alpha.

Test plan

  • go build ./... clean locally
  • go vet ./... clean locally
  • go test ./... clean locally (all four packages green)
  • CI green on the same commands
  • Lefthook pre-commit hooks (go-vet, go-fmt, go-test) ran on commit

Test refactor scope

  • TestReader_ListReceipts_ParametersDisclosurePreview → renamed to TestReader_ListReceipts_ParametersDisclosurePresence. The old test exercised the SQL json_extract(..., '.parameters_disclosure.input/.output') preview path against a map[string]string literal. Under the envelope shape those keys no longer exist on the wire, so the previews are necessarily empty; the rewritten test asserts the HasParametersDisclosure indicator still fires when an envelope is attached and that no envelope payload leaks into the preview columns. The long-string SQL-truncation sub-case and the non-primary-keys sub-case were dropped — neither has a v0.3.0 analog.
  • TestReader_ListReceipts_OutputStatusMismatch reduced from six cases to two. The legacy SQL inspected parameters_disclosure.output for an isError:true marker (issue MCP tool receipts record outcome.status=success even when output is isError:true #50). The dashboard cannot peek inside an encrypted envelope, so the flag is now always false at the list-view layer; the test asserts exactly that under both "envelope present" and "no disclosure" rows.
  • A shared testDisclosureEnvelope(kid, ct) helper builds a sentinel *receipt.DisclosureEnvelope (43-char placeholder enc, opaque ct) so the assignment sites stay one line and stay aligned with the v1 ciphersuite shape.

Follow-up

The dashboard's UI rendering of parameters_disclosure under the envelope shape is a separate piece of work. The envelope is opaque ciphertext (only the forensic-key holder can decrypt it), so:

  • The legacy "show input / output" detail view does not apply as-is.
  • The SQL preview path in reader.go (disclosurePreviewMaxLen, json_extract of .input/.output) still runs but now always yields empty strings — left in place rather than ripped out so the follow-up can decide whether to render envelope metadata (alg, recipient kid count) or wire up a decryption path.
  • OutputStatusMismatch detection (issue MCP tool receipts record outcome.status=success even when output is isError:true #50) needs to move to whatever component eventually holds the forensic key, since the list-view reader can no longer see inside the payload.

A separate issue should track the rendering UX. This PR is purely the compile/test path.

Bumps github.com/agent-receipts/ar/sdk/go from v0.9.0 to v0.11.0 (stable
v0.3.0). Per ADR-0012, Action.ParametersDisclosure changed from a flat
map[string]string to *receipt.DisclosureEnvelope (HPKE-encrypted
ciphertext), which breaks reader_test.go assignments.

Refactors the affected tests around the new envelope shape:

- TestReader_ListReceipts_ParametersDisclosurePreview becomes
  TestReader_ListReceipts_ParametersDisclosurePresence: asserts the
  HasParametersDisclosure indicator still fires on envelope presence,
  and that the input/output preview columns stay empty (the SQL paths
  target keys that no longer exist on the wire).
- TestReader_ListReceipts_OutputStatusMismatch reduces to a control:
  the dashboard cannot peek inside the encrypted payload, so the
  mismatch flag must always be false at the list-view layer.

Production code in reader.go still compiles unchanged. Rendering the
envelope-shape parameters_disclosure (detail view, mismatch detection)
is out of scope here and tracked separately.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the dashboard’s Go SDK dependency to github.com/agent-receipts/ar/sdk/go v0.11.0 and adjusts internal/store/reader_test.go to compile with the new parameters_disclosure envelope type (*receipt.DisclosureEnvelope) introduced by the v0.3.0 envelope migration. The production reader logic remains unchanged; the updates are primarily dependency + test refactors.

Changes:

  • Bump github.com/agent-receipts/ar/sdk/go from v0.9.0 to v0.11.0 (and pull in new indirect crypto deps).
  • Refactor list-view disclosure tests to use *receipt.DisclosureEnvelope and assert list previews remain empty under the opaque envelope shape.
  • Simplify OutputStatusMismatch list-view test expectations for envelope-shaped receipts.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

File Description
internal/store/reader_test.go Updates tests to construct DisclosureEnvelope instead of legacy disclosure maps; adjusts assertions accordingly.
go.mod Bumps github.com/agent-receipts/ar/sdk/go to v0.11.0 and adds new indirect requirements.
go.sum Updates module checksums for the bumped SDK and newly introduced indirect dependencies.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/store/reader_test.go
The SQL mismatch detector in reader.go is shape-agnostic — it looks at
parameters_disclosure.output regardless of whether the disclosure was
written by a v0.2.x SDK (flat map) or a v0.3.0 SDK (envelope). The
existing envelope-shape test asserts the v0.3.0 side; this test pins
the legacy v0.2.x side by inserting a raw flat-map receipt_json
directly into the store, bypassing the typed Insert path that now
forces the envelope shape.

Per Copilot review on #67.
@ojongerius ojongerius requested a review from Copilot May 22, 2026 04:36
@ojongerius ojongerius merged commit 5a92624 into main May 22, 2026
5 checks passed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

if row.OutputStatusMismatch != tc.want {
t.Errorf("%s: OutputStatusMismatch=%v, want %v", tc.id, row.OutputStatusMismatch, tc.want)
}
db.Close()
@ojongerius ojongerius deleted the chore/sdk-go-v0.11.0 branch May 22, 2026 04:46
ojongerius added a commit that referenced this pull request May 22, 2026
…est (#68)

* test(store): remove double-close on raw sqlite handle in legacy-shape test

The previous patch (#67) used both `defer db.Close()` and an explicit
`db.Close()` to release the writer before opening the reader. That
double-closes the handle and can mask the inner-Close error. Drop the
defer; the explicit close is required (and now error-checked) so the
reader sees a quiesced file.

Per Copilot review on #67 (landed after merge).

* test(store): t.Cleanup as failure-path Close safety net
@ojongerius ojongerius mentioned this pull request May 22, 2026
7 tasks
ojongerius added a commit that referenced this pull request May 22, 2026
CHANGELOG entry for the v0.3.0 cut: brings the dashboard onto sdk/go v0.11.0 (envelope-shape parameters_disclosure per ADR-0012) via #67/#68, and backfills the missing 0.2.x compare links.

After merge, push tag v0.3.0 to trigger release.yml → goreleaser → binaries + GitHub Release + homebrew-tap formula update.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants