Demo Script¶
Use this script to demo the local FakeStore checkout flow, Action Card decisions, Teach Mode lessons, seeded rules, and Run Story viewer.
Setup¶
Install dependencies and browser support once:
Run the interactive demo:
The browser opens a local FakeStore page and remains open until Enter is pressed in the terminal. Each run records local JSONL events under:
Opening Narrative¶
Say this before running the demo:
AgentClutch sits at the moment before an agent performs a consequential action. The agent can plan and navigate, but before checkout it must produce an Action Proposal. AgentClutch turns that into an Action Card, lets the human decide, records the intervention, and returns Resume Context so the loop knows what happened.
Reset Local State¶
Clear rules through the demo command when starting manual decision demos:
Clear lessons when you want to show Teach Mode from a clean slate:
Clear rules without launching the demo:
Demo 1: Approve Once¶
- Run:
- Wait for FakeStore to open and the Action Card to appear.
- Point out:
- Target selector:
#checkout - Product:
Wireless Headphones Pro - Quantity:
1 - Total:
$249.00 - Consequence: payment or purchase
- Evidence rows
- Click Approve once.
- Expected terminal result:
- Explain that the browser click executed only after the user approved it once.
Demo 2: Edit Quantity¶
- Run:
- In the Action Card, change the editable quantity field from
1to3. - Click Approve once or Edit fields.
- Expected terminal result:
- Point out the recorded patch:
[
{
"op": "replace",
"path": "/changed_fields/quantity/after",
"from": 1,
"value": 3,
"reason": "User edited quantity."
}
]
- Explain that edits become structured Resume Context, not a new prompt.
Demo 3: Create Lesson¶
Teach Mode captures corrections from edit decisions.
- Clear existing lessons:
- Run:
- Change quantity from
1to3. - Click Approve once or Edit fields.
- Show the local lesson file:
- Expected lesson shape:
{
"action_kind": "browser.checkout",
"target_app": "FakeStore",
"field": "quantity",
"original_value": 1,
"corrected_value": 3
}
- Explain that the lesson remembers the corrected value. It does not create an allow rule and does not silently approve checkout.
Demo 4: Rerun And Verify Lesson Appears¶
- Run again without clearing lessons:
- Wait for the Action Card.
- Verify that it shows an Applied Lesson row for quantity
1->3. - Explain that the Action Card still appears because a lesson is correction memory, not approval policy.
- Click one of the lesson buttons:
- Accept lesson approves with the learned quantity and reinforces the lesson.
- Reject lesson approves using the original proposed value.
- Disable lesson disables that lesson for future matching proposals.
Expected Run Story events can include lesson.applied, lesson.reinforced, lesson.rejected, or lesson.disabled, depending on the selected path.
Demo 5: Block¶
- Run:
- Click Block.
- Expected terminal result:
- Explain that the host loop receives an instruction to re-plan without repeating the same side effect.
Demo 6: Create Rule¶
- Run:
- Click Create rule.
- Expected terminal result:
- Show the local rules file:
- Expected rule shape:
{
"match": {
"action_kind": "browser.checkout",
"target_surface": "browser",
"target_app": "FakeStore",
"consequence_class": "payment_or_purchase"
},
"decision": "require_clutch"
}
- Explain that
create_rulecreates a localrequire_clutchrule for similar actions. A rule is explicit policy; it is separate from lessons.
Demo 7: Seeded Rule Decisions¶
Rules control whether a matching action is allowed, blocked, or forced through the Action Card. They are local demo policy, not preference memory.
Seed allow¶
Expected behavior:
- No Action Card appears.
- The rule approves the matching checkout once.
- Terminal output includes:
Seed block¶
Expected behavior:
- No Action Card appears.
- The rule blocks the matching checkout.
- Terminal output includes:
Seed require_clutch¶
Expected behavior:
- The Action Card appears.
- The user must approve, edit, block, take the wheel, or create a rule.
- The final terminal decision matches the selected path.
Rules Vs Teach Mode / Lessons¶
Rules are explicit control policy:
allow: permit matching actions without showing the overlay.block: prevent matching actions without showing the overlay.require_clutch: require the Action Card for matching actions.
Lessons are correction memory:
- Lessons remember edited values such as quantity
1->3. - Lessons can appear in future Action Cards as Applied Lesson.
- Lessons do not silently approve actions.
- The Action Card still appears unless an explicit
allowrule exists.
Run Story Viewer¶
- Start the viewer:
- Open the Vite URL printed in the terminal, usually:
- Open a recorded run file:
ls -td .agentclutch/runs/run_checkout_* | head -1
sed -n '1,200p' .agentclutch/runs/<run_id>/events.jsonl
- Paste the JSONL into the viewer and click Render input.
- Show:
- Rendered Action Card
- Decision callbacks
- Lesson events, if the run captured or applied lessons
- Run Story timeline
Expected Run Story language should describe the proposed checkout, the pause before the consequential action, the human decision, any lesson events, and the resume context.
CLI Run Inspection¶
After any demo run, summarize the latest local recorder events:
Expected output includes the run id, event count, latest Action Card, consequence, risk, and final decision.
Close¶
End with: