Skip to content

Rejections that teach

A compiler error is usually where an agent starts guessing. In Stigi, every rejection is built to end the guessing in one turn.

rejected {Demo.Table.peek}: index-unproved at Demo.Table.peek.body[0]
need: below(index, count)
fix1 (checked): add entry fact <below(index, count)>
lesson: index-unproved (see cached prefix)
  • A code and a place. index-unproved, at an exact path inside the unit.
  • The missing fact. Not “something is wrong”, but the one fact that would make it right.
  • A counterexample, when a property is false: concrete values that break it.
  • Checked fixes. Each fixN already passed the door. Accepting one costs two tokens.
  • A lesson pointer. Each code has an example in the image’s own NegTests. The table of lessons sits in the cached prefix, so the reply only points at it.

When one missing fact breaks ten call sites, you get one root cause and a count of the sites it collapses. Fix the root and the rest go away.

The door applies only cleanups that change nothing about behavior, like removing unused binders. It never slips a runtime guard into your code. A guard, an invariant or an entry fact is always something you accept on purpose.

Next, the human side: the proved theory sheet.

ContributeCommunitySponsor