Skip to content

An agent session

Agents talk to a live Stigi image over a local socket or MCP. No shell, no file reads, no grep. Here is a whole task, start to finish.

The session begins with a prefix that never changes between turns: a short agent reference, the table of lessons and a zoomed-out view of the code. Because it is byte-stable, the model’s prompt cache keeps it cheap.

Terminal window
$ stigi zoom Billing L0
# about 110 tokens: capabilities, protocols, laws, invariants, envelopes
Terminal window
$ stigi slice Billing.Invoice.applyDiscount --depth 1

This returns the function, plus only the signatures and facts of its direct callees, callers, enums and the laws that touch it. Always in the same order.

Terminal window
$ stigi batch
alias Inv = Billing.Invoice
edit Inv.applyDiscount.arm[Percentage(rate)] :=
case Percentage(rate) if rate <= 100 => Inv.scaleDown(total, rate)

The edit names a path inside the unit, so the agent writes only what changes. The alias lives only on the wire; the stored code keeps full names.

rejected {Billing.Invoice.applyDiscount}: precondition-unproved (1 root, 3 downstream collapsed)
need: below(rate, 101) at Billing.Invoice.applyDiscount.arm[Percentage]
counterexample: total=500, rate=101 -> violates Inv.scaleDown entry fact
fix1 (checked): refine Percentage field with <lessOrEqual(rate, 100)>
lesson: precondition-unproved (see cached prefix)
Terminal window
$ stigi accept fix1
admitted Billing.Invoice.applyDiscount laws ok tests 42/42 shaken: 0

Next: why tokens matter.

ContributeCommunitySponsor