Skip to content

feat: add signal trust object backend - #36

Merged
intel352 merged 1 commit into
mainfrom
signal-trust-object-store
Jul 5, 2026
Merged

intel352 merged 1 commit into
mainfrom
signal-trust-object-store

Conversation

@intel352

@intel352 intel352 commented Jul 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • add object_store as an explicit opt-in local object-store emulator backend for signal.trust_store
  • persist checksum-protected trust snapshots under hash-derived store keys and fail closed on tamper/wrong-key reuse
  • exercise the object backend from the trust reset pipeline fixture

Verification

  • go test ./internal -run 'TestSignalTrustStore.*Object|TestSignalTrustPolicy' -count=1
  • go test ./... -count=1
  • go vet ./...
  • make build
  • make pipeline-test
  • wfctl plugin validate-contract --for-publish --tag v0.27.0 .
  • scope lock: plan-scope-check.sh --verify-lock docs/plans/2026-07-05-signal-trust-object-batch.md

TDD invariant

With the implementation reverted but tests/proto retained:

  • go test ./internal -run 'TestSignalTrustStore.*Object' -count=1 failed with unsupported backend "object_store" in the object persistence/tamper tests.

With the implementation restored:

  • go test ./internal -run 'TestSignalTrustStore.*Object' -count=1 passed.

Plan: GoCodeAlone/workspace docs/plans/2026-07-05-signal-trust-object-batch.md, Tasks 2-4.

Copilot AI review requested due to automatic review settings July 5, 2026 07:04
@intel352
intel352 merged commit bdb78a4 into main Jul 5, 2026
4 checks passed
@intel352
intel352 deleted the signal-trust-object-store branch July 5, 2026 07:06

Copilot AI left a comment

Copy link
Copy Markdown

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 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_store backend support (gated by allow_object_store_backend and storage_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 thread internal/trust_store.go
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 thread internal/trust_store.go
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)
}
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