Skip to content

fix: exec beads provider CRUD passthrough to bd#685

Open
quad341 wants to merge 2 commits intogastownhall:mainfrom
quad341:fix/exec-store-crud-passthrough
Open

fix: exec beads provider CRUD passthrough to bd#685
quad341 wants to merge 2 commits intogastownhall:mainfrom
quad341:fix/exec-store-crud-passthrough

Conversation

@quad341
Copy link
Copy Markdown
Contributor

@quad341 quad341 commented Apr 13, 2026

Summary

  • gc-beads-bd (exec beads provider script) only implemented lifecycle ops (start/stop/health/probe)
  • CRUD ops (get/list/create/update) exited code 2, which the exec store treated as success with empty output
  • This broke session resolution and mail delivery in all managed sessions using the exec provider

Changes

  1. gc-beads-bd — Added CRUD handlers that forward to bd with JSON transforms
  2. exec.go Get — Returns ErrNotFound on empty output (safety net)
  3. exec.go List — Passes --type/--assignee filters to script

Nightly CI impact

The Tier C nightly (TestGastown_MayorDispatchPipeline) fails intermittently with:

beads get: parsing JSON: unexpected end of JSON input
gc mail inbox: looking up session "repo/witness": exec beads get: parsing JSON: unexpected end of JSON input

These are the exec store CRUD returning empty output for Get operations — exactly what this PR fixes.

Test plan

  • Mail delivery works in managed sessions
  • Cross-rig sling test: projectwrenunity-gra dispatched and completed
  • CI
  • Nightly Tier C should stop seeing JSON parsing errors

🤖 Generated with Claude Code

The gc-beads-bd lifecycle script is set as GC_BEADS by the controller
and inherited by managed sessions. But it only implemented lifecycle
operations (start/stop/health/probe), causing all CRUD operations
(get/list/create/update/close) to silently fail with exit code 2.

This broke mail delivery, session resolution, and any store operation
running inside a managed session — including handoff mail which was
created but never delivered because gc mail check couldn't resolve
the session identity.

Three changes:

1. gc-beads-bd: Add CRUD operation handlers that forward to bd with
   JSON format transforms (bd_to_gc/bd_list_to_gc). The script now
   implements the full exec beads provider protocol. GC_DOLT=skip
   now only skips lifecycle ops, not CRUD.

2. exec store Get: Return ErrNotFound on empty output (safety net
   for scripts that don't implement all operations).

3. exec store List: Pass --type and --assignee filters to the script
   so backends that partition by type return the correct subset.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@quad341 quad341 requested a review from julianknutsen as a code owner April 13, 2026 16:12
@github-actions github-actions bot added the status/needs-triage Inbox — we haven't looked at it yet label Apr 13, 2026
*) exit 2 ;; # Unknown operation — forward compatible.

# --- CRUD operations (forwarded to bd) ---
get)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

i will say i kinda hate explicitly calling out every option.

That said

  1. this is the pattern in the k8s script
  2. there likely needs to be a gc change to update the verbs anyway, so they just need to be kept in sync

@julianknutsen julianknutsen added kind/bug Broken behavior priority/p1 High — core workflow broken dolt and removed status/needs-triage Inbox — we haven't looked at it yet labels Apr 13, 2026
@julianknutsen julianknutsen added this to the 1.0 milestone Apr 13, 2026
bd doesn't have a --from flag, so passing it as a CLI arg caused
"unknown flag" errors that silently broke mail delivery and handoff.
Store from in metadata instead, matching BdStore.Create in Go.

Add conformance tests for from-field round-trip and multiline
description round-trip to prevent regression.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dolt kind/bug Broken behavior priority/p1 High — core workflow broken

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants