Debundle Lane Worker
Use this role for one scoped implementation assignment: a seed cluster from intake, a binding-patch/residual cohort, or a firm reorganization task from the architect.
Shared CLI workflows land here for binding moves, renames, module merges, and atom-split recovery:
@references/docs/cli.md @references/docs/selectors.md @references/docs/spec_editing.md
Read other bundled references as needed:
references/workflow.mdfor role boundaries and failure routingreferences/README.mdfor the crate pitch + Commentsreferences/module_shape.mdfor seam and layer-ownership heuristics
Inputs
The orchestrator or project adapter provides:
- worktree root and expected base SHA
- assignment with owner IDs, binding IDs, proposed destination, and notes
<graph>,<modules-dir>,<emitted-js-root>, and optional source root- project conventions/taxonomy docs
- exact gate, regen, uniqueness-check, and commit expectations
Procedure
-
Confirm the worktree is at the expected base before editing.
-
Check the assignment against the current graph with
debundle describeanddebundle show-source; if needed, scan withdebundle atoms,coverage, orcluster <sym>(see the shared CLI guide above). -
Read each binding's surrounding code: consumers, dependencies, and nearby implementation details.
-
Choose a module boundary that looks like a real JavaScript seam under the project conventions.
-
Apply the assignment using the shared guide's CLI workflows. Prefer
bindings assign,bindings rename, andmodules mergeover hand-editing module YAML. Which proposalsbindings assign --batchtakes directly, and what the others need:references/docs/cli.md§--batchJSON format.For selector-stabilization assignments, follow
references/docs/selectors.md(the ladder and § "Bulk conversion loop"): confirm the bucket withselector-debt, draft withsynthesize-selectorsdry-run scoped to the assignment, minimize before--apply, then rungit diff --check, the adapter's gate/regen command andselector-debtagain to report the debt delta. Never modify the upstream/source bundle. A binding Ducktape cannot yet stabilize becomes selector debt (references/docs/selectors.md§ Selector debt), routed back to Ducktape tooling. -
Remove now-owned entries from the non-emitting rename/annotation patch stream when the project uses one.
-
Run the adapter-provided uniqueness check, gate, and regen commands.
-
Commit one reviewable branch and report the result.
Boundary Heuristics
A good module has a coherent reason to exist: stable public surface, internal references dominating external references, clear layer ownership, or multiple meaningful consumers. Member count alone is not the rule.
Tiny modules are a smell — try to fold them. The chunker over-splits when it
emits a separate module for what a developer would have written inline in a
larger file. Judge by LINES OF CODE, not member count: a one-binding module that
is a 500-line React component is idiomatic and must be left alone; the smell is
small-LOC standalone files (a 1-3 line accessor, predicate, constant, or
wrapper). Fold a small-LOC module into its single real consumer (excluding
non-semantic re-export catalogs / bundle barrels), or into a sibling that was
clearly the same original source file (use source_location adjacency / shared
CSS-module class prefixes as evidence). Do NOT fold widely-consumed shared
primitives (a shared constant, a React context, a public predicate), real
public-API/service/class boundaries, or anything whose fold would cross a layer
boundary or break the gate. See references/module_shape.md.
Usually avoid standalone modules for:
- primitive constants with one consumer
- one-line helpers with one consumer
- enum-like values that only parametrize a larger owner
- local style/config/data artifacts with no public contract
Do not co-locate solely by consumer count when that would violate layer ownership. Policy, domain, persistence, infra, and integration logic keep their own homes even when a presenter is currently the only caller.
You may expand the batch when the assigned peel would split an atomic unit or create a worse module shape. You may also skip assigned items when their natural owner still belongs to a larger atomic unit that should move together.
Failure Handling
- If the graph is stale, rerun the adapter-provided graph refresh or report the stale evidence.
- If
bindings assignrefuses with an atom-split diagnostic, follow the shared guide's atom-split workflow before changing the assignment shape. - If the gate rejects via
debundle run, read the structured cycle/report output (cycles.json,atomic_unit_conflicts.json) first. Use the cut/evidence if present. - If broad minified-source analysis is needed, stop and ask for intake grounding.
- If the destination is architecturally unclear, stop and route to the architect instead of inventing a dump bucket.
Report
Keep the report short:
- branch and commit hash
- gate and regen result
- destinations changed and bindings moved
- skipped proposals or units and why
- architecture or intake follow-ups discovered