Idea

Code review from facts about the compiled program

Which inputs reach a result, which fields go unread, and what changed after an edit? Yichus answers from the compiled Bosatsu program and checks a reviewer’s claims against those answers. You can run the checks yourself.

Code & run Change a price calculation

Worked example: four facts from a pricing module

A small demos/pricing module with planted problems:

struct Order(id: Int, qty: Int, discount_code: Int)

def quote(o: Order) -> Int:
  _ = o          # the order is thrown away...
  42             # ...and the "computed" price is hard-coded

def shipping_fee(subtotal: Int, region: Int) -> Int:
  match cmp_Int(region, 0):
    case GT: add(subtotal, 5)
    case _:  add(subtotal, 5)   # both branches identical: region decides nothing

def surge_bonus(x: Int) -> Int:
  match cmp_Int(x, 1000):
    case GT: x        # looks input-dependent...
    case _:  7        # ...the sampled inputs all take this branch

What the tool says about it (the complete captured agenda):

literal-result quote: “takes arguments, none of whose data reaches the produced value; every value the result can take originates in literals” The price is fake. The tool offers no opinion; the fact is checkable.
dead-field Order.discount_code: “no compiled extraction of the field exists in the supplied Bosatsu IR (reads: []); no declared API wire consumer was established; other engine or host consumers are outside this evidence; extraction absence alone does not justify removing the field” The supplied Bosatsu never extracts the discount code. Check engine and host consumers before removing a field.
guard-only-parameter shipping_fee(region): “the parameter only selects among branches; its data never reaches the produced value” Region picks a branch, but both branches compute the same thing.
constant-despite-reach surge_bonus: “across 8 seeded runs (seed 6321458022832390279), Demo/Pricing/surge_bonus always produced 7; bounded observation, not proof; parameter(s) x statically reach the produced value and no literal-result fact applies — the constancy is not statically explained” This static analysis does not establish the constancy, so seeded runs provide additional evidence.

None of them says “bug”; you decide which ones are. The run-based fact is a bounded observation of seeded runs, not proof.

A wrong review fails like a failing test

Three claims about the module, checked (complete report):

supported for literal-result quote: “every value the result can take originates in literals”
not-provable for no-detached-read in Demo/Report: “no read sites in Demo/Report (cell reads, db_read, db_query); zero examined sites is not evidence of a property”
refuted for dead-field Order.qty: “the field IS read, by: Demo/Pricing/line_total, Demo/Pricing/order_qty”

Benchmark: fact-tool review versus source review on planted defects

On a 46,922-line codebase with 26 planted defects (round 008), the fact-using AI reviewer found 25 of 26 and the source-reading reviewer found 23 of 26, both at about 100k tokens. With the caps removed, the source reader found all 26 at 1.85× the tokens. All the benchmark data, including the losses →

Run the pricing checks

Needs Node 20+ and jq; the pricing module is served by this site:

# fetch the module and the three claims from this site
curl -O https://yich.us/demos/pricing/pricing.bosatsu
curl -O https://yich.us/demos/pricing/report.bosatsu
curl -O https://yich.us/evidence/pricing/claims.json

# up to 500 fact cards
echo '{"verb":"agenda","limit":500}' | npx yichus@0.3.9 call api_explore \
  --source pricing.bosatsu --source report.bosatsu --args -
# one fact type
echo '{"verb":"agenda","limit":500,"card_type":"dead-field"}' | npx yichus@0.3.9 call api_explore \
  --source pricing.bosatsu --source report.bosatsu --args -

# check the three claims; --expect turns a refuted claim into exit code 1
printf '{"claims": %s}' "$(cat claims.json)" > claims-args.json
npx yichus@0.3.9 call api_verify_claims --source pricing.bosatsu \
  --source report.bosatsu --args claims-args.json --expect /refuted=false

# fact-diff wants a "before": copy the module, then edit
# old/pricing.bosatsu to give quote a real computation.
# Compare that edited version with the shipped constant version:
mkdir -p old && cp pricing.bosatsu old/
jq -n --rawfile before old/pricing.bosatsu --rawfile after pricing.bosatsu \
  '{before_sources: [{fileName: "pricing.bosatsu", source: $before}],
    after_sources: [{fileName: "pricing.bosatsu", source: $after}]}' > diff-args.json
npx yichus@0.3.9 call api_fact_diff --args diff-args.json

Early UI fixtures and experiments live in the archive.

Ask your agent about anything here; it has the detail.

Where this fits