Skip to content

feat: add SlotSet/SlotGet/SlotClear to Storage interface#2870

Merged
steveyegge merged 2 commits into
gastownhall:mainfrom
quad341:quad341/slot-methods
Apr 3, 2026
Merged

feat: add SlotSet/SlotGet/SlotClear to Storage interface#2870
steveyegge merged 2 commits into
gastownhall:mainfrom
quad341:quad341/slot-methods

Conversation

@quad341

@quad341 quad341 commented Mar 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Add metadata slot operations to the Storage interface — key-value pairs stored in issue metadata JSON. Used by gt for delegation tracking, hook state, and other per-issue data.

  • SlotSet(ctx, issueID, key, value, actor) — set or overwrite a key
  • SlotGet(ctx, issueID, key) — read a key (error if not found)
  • SlotClear(ctx, issueID, key, actor) — remove a key (no-op if absent)

Implementation

  • Added to Storage interface in internal/storage/storage.go
  • Implemented in DoltStore (internal/storage/dolt/slots.go)
  • Implemented in EmbeddedDoltStore (internal/storage/embeddeddolt/slots.go)
  • Instrumented in InstrumentedStorage (internal/telemetry/storage.go)

All implementations use get-modify-put on the issue's Metadata JSON field via existing GetIssue/UpdateIssue methods.

Motivation

gt PR gastownhall/gastown#3166 needs these to eliminate bd CLI shell-outs for delegation and hook state management.

Test plan

  • go build ./... clean

🤖 Generated with Claude Code

Metadata slot operations for key-value pairs stored in issue metadata
JSON. Used by gt for delegation tracking, hook state, and other
per-issue data.

- SlotSet: set or overwrite a metadata key
- SlotGet: read a metadata key (error if not found)
- SlotClear: remove a metadata key (no-op if absent)

Implemented in DoltStore, EmbeddedDoltStore, and InstrumentedStorage.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@codecov-commenter

Copy link
Copy Markdown

❌ 7 Tests Failed:

Tests completed Failed Passed Skipped
5609 7 5602 583
View the top 3 failed test(s) by shortest run time
::TestMain
Stack Traces | 0s run time
FAIL	github..../beads/internal/jira [build failed]
github.com/steveyegge/beads/cmd/bd::TestCheckBeadGate_InvalidFormat
Stack Traces | 0s run time
=== RUN   TestCheckBeadGate_InvalidFormat
--- FAIL: TestCheckBeadGate_InvalidFormat (0.00s)
github.com/steveyegge/beads/cmd/bd::TestCheckBeadGate_InvalidFormat/empty
Stack Traces | 0s run time
=== RUN   TestCheckBeadGate_InvalidFormat/empty
    gate_test.go:104: reason "cross-rig bead gate \"\" cannot be checked (multi-rig routing removed)" does not contain "invalid await_id format"
--- FAIL: TestCheckBeadGate_InvalidFormat/empty (0.00s)
github.com/steveyegge/beads/cmd/bd::TestCheckBeadGate_InvalidFormat/missing_bead
Stack Traces | 0s run time
=== RUN   TestCheckBeadGate_InvalidFormat/missing_bead
    gate_test.go:104: reason "cross-rig bead gate \"my-project:\" cannot be checked (multi-rig routing removed)" does not contain "await_id missing rig name or bead ID"
--- FAIL: TestCheckBeadGate_InvalidFormat/missing_bead (0.00s)
github.com/steveyegge/beads/cmd/bd::TestCheckBeadGate_InvalidFormat/missing_rig
Stack Traces | 0s run time
=== RUN   TestCheckBeadGate_InvalidFormat/missing_rig
    gate_test.go:104: reason "cross-rig bead gate \":gt-abc\" cannot be checked (multi-rig routing removed)" does not contain "await_id missing rig name"
--- FAIL: TestCheckBeadGate_InvalidFormat/missing_rig (0.00s)
github.com/steveyegge/beads/cmd/bd::TestCheckBeadGate_InvalidFormat/no_colon
Stack Traces | 0s run time
=== RUN   TestCheckBeadGate_InvalidFormat/no_colon
    gate_test.go:104: reason "cross-rig bead gate \"my-project-mp-abc\" cannot be checked (multi-rig routing removed)" does not contain "invalid await_id format"
--- FAIL: TestCheckBeadGate_InvalidFormat/no_colon (0.00s)
github.com/steveyegge/beads/cmd/bd::TestCheckBeadGate_RigNotFound
Stack Traces | 0s run time
=== RUN   TestCheckBeadGate_RigNotFound
    gate_test.go:135: reason should mention not found: "cross-rig bead gate \"nonexistent:some-id\" cannot be checked (multi-rig routing removed)"
--- FAIL: TestCheckBeadGate_RigNotFound (0.00s)

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

The configStore mock in jira/tracker_test.go was missing the three new
Storage interface methods, causing go vet to fail.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@steveyegge steveyegge merged commit 677f7bc into gastownhall:main Apr 3, 2026
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.

3 participants