# Query and Injection Playbook Run this sequence at task start. Step 1: Determine task domain - Choose one primary domain label: memory-arch | memory-workflow | memory-ux | memory-agent | memory-reliability Step 2: Query canonical memory for that domain ```bash bd query "label=memory AND label=mem-canonical AND label= AND status=closed" --sort updated --reverse ``` Step 2b: Inspect provenance on candidate memories (required for fresh agents) ```bash bd show bd dep list ``` Step 3: Query hard constraints subset ```bash bd query "label=memory AND label=mem-canonical AND label=mem-hard AND label= AND status=closed" --sort updated --reverse ``` Step 4: Attach context to active work (soft + hard) ```bash bd dep relate ``` Step 5: Enforce hard constraints only (optional contract bead) ```bash bd create --title "[MEMORY-CONTRACT] " --type task --labels memory-contract,mem-hard, --description "Contract for active task " --acceptance "Hard rule is acknowledged and verified in task evidence." --silent bd dep relate bd dep add ``` Step 6: Record acknowledgement ```bash bd update --notes "Memory injection: related ; hard contracts ." ``` Step 7: Preserve provenance in active work notes ```bash bd update --append-notes "Memory provenance checked via bd show/dep list for ." ``` Expected response patterns: - bd query: list of IDs + labels + titles - bd dep relate: relation confirmation - bd dep add: blocker edge confirmation - bd show/dep list: attached memory visible on task graph