feat(core): client-minted bulk_id + leadbay_bulk_enrich_status composite#13
Merged
feat(core): client-minted bulk_id + leadbay_bulk_enrich_status composite#13
Conversation
Adds a BulkTracker interface + file-backed LocalBulkStore so agents can poll
a bulk enrichment by handle instead of per-lead. leadbay_enrich_titles now
returns {bulk_id, launched_at, durability} and a new leadbay_bulk_enrich_status
aggregates progress + contacts across the bulk's leads.
Two-phase launch (pending → launched/failed) plus a sha256 idempotency key
guards against quota double-charge on restart or rapid re-launch. Store lives
at ~/.leadbay/bulks.json by default with atomic writes (fsync fd + dir),
in-process mutex, 30-day TTL, per-record corrupt-record isolation, symlink
rejection, and a loud-failure fallback policy (throws unless
LEADBAY_BULK_STORE_ALLOW_MEMORY=1).
OpenClaw plugin uses InMemoryBulkStore (filesystem is sandboxed per-plugin);
MCP stdio deployments get the file-backed durability.
34 new tests (23 store-layer + 11 composite-flow); full workspace suite: 123
passing.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Adds a
BulkTrackerinterface + file-backedLocalBulkStoreand a newleadbay_bulk_enrich_statuscomposite so agents can poll a bulk contact enrichment by handle instead of looping per-lead.leadbay_enrich_titlesnow returns{bulk_id, launched_at, durability}, wrapped in a two-phase launch (pending → launched/failed) + sha256 idempotency key that guards against quota double-charge on restart or rapid re-launch. Store lives at~/.leadbay/bulks.jsonwith atomic writes (fsync fd + dir), in-process mutex, 30-day TTL, per-record corrupt-record isolation, symlink rejection, and loud-failure policy (throws unlessLEADBAY_BULK_STORE_ALLOW_MEMORY=1). OpenClaw plugin usesInMemoryBulkStore(fs is sandboxed); MCP stdio gets file-backed durability.Scoped and hardened via
/autoplanwith dual-voice CEO + Eng review. Taste defaults resolved at the final gate:include_contacts: false(cheap polls) + singleBulkTrackerinterface (YAGNI on split). Status composite enforces strict UUIDv4 validation before any disk read (path-traversal/LFI defense) with a structured error taxonomy (BULK_INVALID_ID/BULK_NOT_FOUND/BULK_PENDING/BULK_LAUNCH_FAILED/BULK_STORE_UNAVAILABLE/BULK_TRACKER_UNAVAILABLE).Test plan
pnpm -w build— all three packages compilepnpm -r test— 123 tests passing (34 new: 23 store-layer + 11 composite-flow)LEADBAY_MCP_WRITE=1:leadbay_enrich_titles({titles:["CEO"]})→bulk_id→leadbay_bulk_enrich_status({bulk_id})round-trip against api-us🤖 Generated with Claude Code