Repository navigation
feat: add signal trust object backend - #36
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces an opt-in object_store backend for signal.trust_store, intended for local/object-shaped persistence in scenario and host integration tests prior to adopting a production storage adapter.
Changes:
- Added
object_storebackend support (gated byallow_object_store_backendandstorage_path) with hashed-key snapshot persistence and checksum validation. - Updated contracts/protos to include the new allow-flag and refreshed generated protobuf code.
- Added object-store backend tests and exercised the backend via the trust-reset pipeline fixture (with cleanup in pipeline test script).
Reviewed changes
Copilot reviewed 7 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| testdata/pipelines/signal-trust-reset.yaml | Switches trust store fixture to the new object_store backend with explicit opt-in flag and storage path. |
| scripts/run-pipeline-tests.sh | Cleans up the object-store directory before running pipeline fixtures to avoid cross-run contamination. |
| README.md | Documents the intended use, constraints, and safety posture of the object_store backend. |
| proto/signal.proto | Adds allow_object_store_backend to the public trust store config message. |
| proto/signal.pb.go | Regenerates protobuf output for the new config field. |
| internal/trust_store.go | Implements object_store backend load/persist logic and config validation. |
| internal/trust_store_test.go | Adds tests for unsafe config rejection, persistence/reload, tamper detection, and wrong-key detection. |
| internal/contracts/signal.proto | Adds allow_object_store_backend to the internal contracts proto. |
| internal/contracts/signal.pb.go | Regenerates internal contracts protobuf output for the new config field. |
Files not reviewed (2)
- internal/contracts/signal.pb.go: Generated file
- proto/signal.pb.go: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+522
to
+530
| if object.StoreRef != s.ref { | ||
| return nil | ||
| } | ||
| if loaded { | ||
| return fmt.Errorf("signal trust store: object store contains duplicate snapshot for %q", safeSignalTrustRefForError(s.ref)) | ||
| } | ||
| if path != s.objectStoreSnapshotPath() { | ||
| return fmt.Errorf("signal trust store: object key mismatch for %q", safeSignalTrustRefForError(s.ref)) | ||
| } |
Comment on lines
+546
to
+554
| func (s *signalTrustStore) readObjectStoreSnapshot(path string) (*signalTrustObject, error) { | ||
| raw, err := os.ReadFile(path) | ||
| if err != nil { | ||
| return nil, fmt.Errorf("signal trust store: read object %q: %w", filepath.Base(path), err) | ||
| } | ||
| var object signalTrustObject | ||
| if err := json.Unmarshal(raw, &object); err != nil { | ||
| return nil, fmt.Errorf("signal trust store: decode object %q: %w", filepath.Base(path), err) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
object_storeas an explicit opt-in local object-store emulator backend forsignal.trust_storeVerification
go test ./internal -run 'TestSignalTrustStore.*Object|TestSignalTrustPolicy' -count=1go test ./... -count=1go vet ./...make buildmake pipeline-testwfctl plugin validate-contract --for-publish --tag v0.27.0 .plan-scope-check.sh --verify-lock docs/plans/2026-07-05-signal-trust-object-batch.mdTDD invariant
With the implementation reverted but tests/proto retained:
go test ./internal -run 'TestSignalTrustStore.*Object' -count=1failed withunsupported backend "object_store"in the object persistence/tamper tests.With the implementation restored:
go test ./internal -run 'TestSignalTrustStore.*Object' -count=1passed.Plan: GoCodeAlone/workspace
docs/plans/2026-07-05-signal-trust-object-batch.md, Tasks 2-4.