3 · Context loaded D1 queries run before fan-out
name
assembly
tables
assemblies
returns
row
SELECT
id, itemid, displayname, quantityavailable
FROM assemblies
WHERE id = ?
name
current_bom
tables
assembly_bom
returns
rows
SELECT
item_code, qty, uom, estimated_cost
FROM assembly_bom
WHERE assembly_id = ?
name
on_hand
tables
inventory_balance · assembly_bom
returns
rows
SELECT
item_code, quantityavailable
FROM inventory_balance
WHERE location_id = ?
AND item_code IN (SELECT item_code
FROM assembly_bom
WHERE assembly_id = ?)
name
cost_rollup
tables
assembly_cost_rollup
returns
row
SELECT
computed_at, total_cost
FROM assembly_cost_rollup
WHERE assembly_id = ?
ORDER BY computed_at DESC
LIMIT 1
6 · Fan-out targets 10 total · 3 real · 7 stub
#1snapshot_cost d1_write STUB
table
assembly_cost_rollup
operation
insert
stub — not yet implemented in src/lib/workflow_runner.ts (kind d1_write hits the placeholder branch). Documented intent only.
INSERT INTO assembly_cost_rollup (assembly_id, total_cost, computed_at, source)
VALUES (?,?,datetime('now'),'build_request')#2draft_proposal stage_proposed_action REAL
action_type
assembly_build
entity_type
assembly
#3hitl_approve stage_proposed_action REAL
action_type
assembly_build_approval
entity_type
workflow_run
#4ns_push_build ns_push STUB
NS record_type
assemblybuild
queue
NS_PUSH_QUEUE
on_failure
retry_3_then_alert
stub — not yet implemented in src/lib/workflow_runner.ts (kind ns_push hits the placeholder branch). Documented intent only.
#5d1_inventory_decrement d1_write STUB
table
inventory_balance
operation
update
stub — not yet implemented in src/lib/workflow_runner.ts (kind d1_write hits the placeholder branch). Documented intent only.
UPDATE inventory_balance
SET quantityavailable = quantityavailable - ?
WHERE item_code = ?
AND location_id = ?
#6d1_inventory_increment d1_write STUB
table
inventory_balance
operation
update
stub — not yet implemented in src/lib/workflow_runner.ts (kind d1_write hits the placeholder branch). Documented intent only.
UPDATE inventory_balance
SET quantityavailable = quantityavailable + ?
WHERE item_code = (SELECT itemid
FROM assemblies
WHERE id=?)
AND location_id = ?
#7kv_invalidate_assembly kv_invalidate REAL
keys
assembly:?assembly_id
inventory:item:?assembly_id
#8variance_flag flag STUB
table
proposed_actions
field
action_type
value
build_cost_variance
condition (if)
abs((actual_cost - estimated_cost)/estimated_cost) > 0.05
stub — not yet implemented in src/lib/workflow_runner.ts (kind flag hits the placeholder branch). Documented intent only.
#9refresh_quotes http_call STUB
method
POST
path
/api/quotes/refresh-by-assembly
condition (if)
open_quotes_touching_assembly > 0
stub — not yet implemented in src/lib/workflow_runner.ts (kind http_call hits the placeholder branch). Documented intent only.
#10reflexion_write d1_write STUB
table
reflexion_log
operation
insert
stub — not yet implemented in src/lib/workflow_runner.ts (kind d1_write hits the placeholder branch). Documented intent only.
INSERT INTO reflexion_log (workflow_run_id, entity_type, entity_id, outcome, tags)
VALUES (?,'assembly',?,?,'assembly_build')