Commit Graph

2 Commits

Author SHA1 Message Date
John Dvorak 30fc7e5017 js-rigor: TTU reverse+tuplesetDirection-in now honors direction
The reverse branch of TupleToUsersetRule ignored tuplesetDirection: it
looked up the tupleset relation as outgoing-from-user even when 'in' was
set, while the join honored 'in' by using t.src as the intermediate —
the documented shape (intermediates hold the relation TO the user) never
matched, and only a degenerate join-on-user shape produced results. The
same gap existed in the compiled direct_join optimization.

Fixed the fallback tupleset lookup (including the graph-neighbor path and
the computed-join tupleEdge direction) and the optimized direct_join to
honor tuplesetDirection in reverse mode. Matrix pins reverse-in (both
evaluation paths, persistent + partial), multi_hop reverse, chain-in,
union-with-chain-child, defeasible split legs, TTU value flow, and
challenge-via-binary.
2026-07-31 18:54:57 -07:00
John Dvorak 0149926344 js-rigor: fix TTU computed-join possibility loss and logical cache staleness
Two real bugs found by the new rule-kind x partial-graph parity campaign:

- TupleToUsersetRule 'computed' join mode (computed side has fewer
  intermediates than the tupleset side) pushed path objects carrying
  combinedPossibility, but _buildFinalResult reads path.possibility —
  every valid TTU grant in that mode silently returned 0, in persistent
  and partial contexts alike.

- _collectRelationUsages only registered explicit type:'direct' children,
  so shorthand logical operands ({ relation: 'owner' } inside union/
  intersection/exclusion) left the dependency index empty: writes to a
  base relation never invalidated cached logical decisions, and a check
  performed before an add kept serving its stale result forever.

New campaign rule-kind-partial-parity.test.js pins the full kind x
persistent/partial matrix (direct, chain, multi_hop, TTU out/in/reverse,
parent, computed, defeasible, union, exclusion, comparator, challenge,
binary) plus seeded differential properties for TTU, comparator, and
exclusion; artifact persistence disabled to avoid disk bloat.
2026-07-31 17:09:46 -07:00