ch18_hooks

show:
mock turns=7 · messages=0
live turns=7 · messages=0
scenario tool_pre_observe
scenario tool_pre_observe · 0.2ms · 1 tool · ended: success: ordered 2 x milk
tool place_order · 0.0ms · given: item=milk, quantity=2 · returned: ordered 2 x milk
args {"item": "milk", "quantity": 2}
hook {"when": "pre", "by": "note_if_a_write", "note": "place_order is a write", "veto": null, "replacement": null}
dispatched {"value": "ordered 2 x milk"}
result {"value": "ordered 2 x milk"}
ended {"reason": "success: ordered 2 x milk"}
scenario tool_pre_observe · 0.2ms · 1 tool · ended: success: ordered 2 x milk
tool place_order · 0.0ms · given: item=milk, quantity=2 · returned: ordered 2 x milk
args {"item": "milk", "quantity": 2}
hook {"when": "pre", "by": "note_if_a_write", "note": "place_order is a write", "veto": null, "replacement": null}
dispatched {"value": "ordered 2 x milk"}
result {"value": "ordered 2 x milk"}
ended {"reason": "success: ordered 2 x milk"}
scenario tool_pre_modify
scenario tool_pre_modify · 0.0ms · 1 tool · ended: success: ordered 2 x milk
tool place_order · 0.0ms · given: item= Milk , quantity=2 · returned: ordered 2 x milk
args {"item": " Milk ", "quantity": 2}
hook {"when": "pre", "by": "normalize_item", "note": null, "veto": null, "replacement": {"item": "milk", "quantity": 2}}
dispatched {"value": "ordered 2 x milk"}
result {"value": "ordered 2 x milk"}
ended {"reason": "success: ordered 2 x milk"}
scenario tool_pre_modify · 0.0ms · 1 tool · ended: success: ordered 2 x milk
tool place_order · 0.0ms · given: item= Milk , quantity=2 · returned: ordered 2 x milk
args {"item": " Milk ", "quantity": 2}
hook {"when": "pre", "by": "normalize_item", "note": null, "veto": null, "replacement": {"item": "milk", "quantity": 2}}
dispatched {"value": "ordered 2 x milk"}
result {"value": "ordered 2 x milk"}
ended {"reason": "success: ordered 2 x milk"}
scenario tool_pre_veto
scenario tool_pre_veto · 0.0ms · 1 tool · ended: error: ['place_order'] blocked before it ran: ['saffron'] is not in the catalog
tool place_order · 0.0ms · given: item=saffron, quantity=1
args {"item": "saffron", "quantity": 1}
hook {"when": "pre", "by": "refuse_unlisted_items", "note": null, "veto": "['saffron'] is not in the catalog", "replacement": null}
ended {"reason": "error: ['place_order'] blocked before it ran: ['saffron'] is not in the catalog"}
scenario tool_pre_veto · 0.0ms · 1 tool · ended: error: ['place_order'] blocked before it ran: ['saffron'] is not in the catalog
tool place_order · 0.0ms · given: item=saffron, quantity=1
args {"item": "saffron", "quantity": 1}
hook {"when": "pre", "by": "refuse_unlisted_items", "note": null, "veto": "['saffron'] is not in the catalog", "replacement": null}
ended {"reason": "error: ['place_order'] blocked before it ran: ['saffron'] is not in the catalog"}
scenario tool_post_observe
scenario tool_post_observe · 0.0ms · 1 tool · ended: success: 1.20 for milk [internal_ref=8821]
tool price_of · 0.0ms · given: item=milk · returned: 1.20 for milk [internal_ref=8821]
args {"item": "milk"}
dispatched {"value": "1.20 for milk [internal_ref=8821]"}
hook {"when": "post", "by": "note_the_result", "note": "result observed", "veto": null, "replacement": null}
result {"value": "1.20 for milk [internal_ref=8821]"}
ended {"reason": "success: 1.20 for milk [internal_ref=8821]"}
scenario tool_post_observe · 0.0ms · 1 tool · ended: success: 1.20 for milk [internal_ref=8821]
tool price_of · 0.0ms · given: item=milk · returned: 1.20 for milk [internal_ref=8821]
args {"item": "milk"}
dispatched {"value": "1.20 for milk [internal_ref=8821]"}
hook {"when": "post", "by": "note_the_result", "note": "result observed", "veto": null, "replacement": null}
result {"value": "1.20 for milk [internal_ref=8821]"}
ended {"reason": "success: 1.20 for milk [internal_ref=8821]"}
scenario tool_post_modify
scenario tool_post_modify · 0.0ms · 1 tool · ended: success: 1.20 for milk
tool price_of · 0.0ms · given: item=milk · returned: 1.20 for milk
args {"item": "milk"}
dispatched {"value": "1.20 for milk [internal_ref=8821]"}
hook {"when": "post", "by": "redact_internal_reference", "note": null, "veto": null, "replacement": {"value": "1.20 for milk"}}
result {"value": "1.20 for milk"}
ended {"reason": "success: 1.20 for milk"}
scenario tool_post_modify · 0.0ms · 1 tool · ended: success: 1.20 for milk
tool price_of · 0.0ms · given: item=milk · returned: 1.20 for milk
args {"item": "milk"}
dispatched {"value": "1.20 for milk [internal_ref=8821]"}
hook {"when": "post", "by": "redact_internal_reference", "note": null, "veto": null, "replacement": {"value": "1.20 for milk"}}
result {"value": "1.20 for milk"}
ended {"reason": "success: 1.20 for milk"}
scenario tool_post_veto
scenario tool_post_veto · 0.0ms · 1 tool · ended: error: ['price_of'] ran, but the result was withheld: price ['0.00 for milk'] is implausible; withheld
tool price_of · 0.0ms · given: item=milk · ran: 0.00 for milk (withheld)
args {"item": "milk"}
dispatched {"value": "0.00 for milk"}
hook {"when": "post", "by": "refuse_implausible_price", "note": null, "veto": "price ['0.00 for milk'] is implausible; withheld", "replacement": null}
ended {"reason": "error: ['price_of'] ran, but the result was withheld: price ['0.00 for milk'] is implausible; withheld"}
scenario tool_post_veto · 0.0ms · 1 tool · ended: error: ['price_of'] ran, but the result was withheld: price ['0.00 for milk'] is implausible; withheld
tool price_of · 0.0ms · given: item=milk · ran: 0.00 for milk (withheld)
args {"item": "milk"}
dispatched {"value": "0.00 for milk"}
hook {"when": "post", "by": "refuse_implausible_price", "note": null, "veto": "price ['0.00 for milk'] is implausible; withheld", "replacement": null}
ended {"reason": "error: ['price_of'] ran, but the result was withheld: price ['0.00 for milk'] is implausible; withheld"}
scenario pre_tool_hooks_compose
scenario pre_tool_hooks_compose · 0.0ms · 1 tool · ended: error: ['place_order'] blocked before it ran: ['chocolate milk'] is not in the catalog
tool place_order · 0.0ms · given: item= Chocolate Milk , quantity=1
args {"item": " Chocolate Milk ", "quantity": 1}
hook {"when": "pre", "by": "note_if_a_write", "note": "place_order is a write", "veto": null, "replacement": null}
hook {"when": "pre", "by": "normalize_item", "note": null, "veto": null, "replacement": {"item": "chocolate milk", "quantity": 1}}
hook {"when": "pre", "by": "refuse_unlisted_items", "note": null, "veto": "['chocolate milk'] is not in the catalog", "replacement": null}
ended {"reason": "error: ['place_order'] blocked before it ran: ['chocolate milk'] is not in the catalog"}
scenario pre_tool_hooks_compose · 0.0ms · 1 tool · ended: error: ['place_order'] blocked before it ran: ['chocolate milk'] is not in the catalog
tool place_order · 0.0ms · given: item= Chocolate Milk , quantity=1
args {"item": " Chocolate Milk ", "quantity": 1}
hook {"when": "pre", "by": "note_if_a_write", "note": "place_order is a write", "veto": null, "replacement": null}
hook {"when": "pre", "by": "normalize_item", "note": null, "veto": null, "replacement": {"item": "chocolate milk", "quantity": 1}}
hook {"when": "pre", "by": "refuse_unlisted_items", "note": null, "veto": "['chocolate milk'] is not in the catalog", "replacement": null}
ended {"reason": "error: ['place_order'] blocked before it ran: ['chocolate milk'] is not in the catalog"}