fix: deliver inter-step output via beads scope, not inlined into the dispatch (millworks-c30)#3
Merged
Merged
Conversation
…d (millworks-c30 pt1) run_bd_show parsed bd show --json as an object (it returns an array) and read a nonexistent 'body' field capped at 3 lines — so beads-scoped records rendered essentially empty. Split a pure, array-aware summarize_bd_record that surfaces the full STEP 'notes' (the produced output) under a step:<id> heading; the assembler's 80% budget prunes oversized notes. Foundational piece for routing inter-step output delivery through beads instead of inlining it into the typed task.
…d into the task (millworks-c30 pt2)
{step.X.output}/{previous_output} now resolve to a short REFERENCE (stepOutputRef)
instead of inlining the upstream output into the task string — the actual text is
delivered via the context bundle: the dependency steps' beads records are scoped in
and the assembler surfaces their STEP notes (pt1). So a large upstream output no
longer blows the dispatch channel's length ceiling (Claude tmux send-keys; pi
ARG_MAX), and beads is the source the data flows from. Lockstep: identical
stepOutputRef + resolveOneVar change on both surfaces; pi scopes deps in dispatchStep;
Claude threads beadsScopeIds through assembleContext -> assembleContextViaCli ->
--beads-scope (the Claude assembler never passed a scope before). Validation
(dependsOn membership, settled) is unchanged. Verified end-to-end against real bd:
--beads-scope <stepid> surfaces the STEP notes labeled by step. Tests updated to the
reference contract; pi 128 + Claude 270 green.
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.
The bug (found in real project use)
A workflow step's task template interpolates upstream outputs via
{step.X.output}/{previous_output}.substituteVariablesinlined the entire upstream output (a ~10KB requirements doc) into the task string, and the Claude dispatcher then typed that whole string into the pane viatmux send-keys -l— which blew past send-keys' length ceiling, so the dispatch failed before the subagent started. It's a ceiling on inter-step payload size: every downstream step (architecture, optimization, code-gen) embeds the same doc and fails identically. pi dodged it only via a wrapper-file argv (higher ARG_MAX ceiling, same inline smell).The output is already in beads (STEP
notes, since inc5) — so re-serializing it through a keystroke channel was both redundant and unscalable.The fix (lockstep, beads-native)
Deliver the upstream output through the beads-scoped context bundle (a file the assembler builds) instead of inlining it into the typed/argv task:
{step.X.output}/{previous_output}resolve to a short reference (stepOutputRef) — identical on both surfaces — keeping the author's intent without the payload. Validation (dependsOn membership, settled) is unchanged.dispatchStep; Claude threadsbeadsScopeIdsthroughassembleContext→assembleContextViaCli→--beads-scope, which the Claude surface never passed before).run_bd_showwas parsingbd show --jsonas an object (it returns an array) and reading a nonexistentbodyfield capped at 3 lines, so beads-scoped records rendered ~nothing. Split into a pure, array-awaresummarize_bd_recordthat surfaces the full STEPnotesunder astep:<id>heading. Large notes are budget-pruned by the assembler's existing 80% pruner — a graceful cap, vs the send-keys hard fail.Net: beads is the source the data flows from; the typed/argv task shrinks to the instruction; no payload through send-keys/ARG_MAX.
Testing
summarize_bd_record(array, full notes, step-label, fallback, none-cases).bd: the builtcontext-pack-assembler --beads-scope <stepid>surfaces the step'snoteslabeled bystep:<id>in the bundle.Notes
millworks-cn8.context-pack-assemblerbd-prime test fragility (millworks-rrp) is untouched and unrelated.