phase-provenance-fanout.ts 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // The ABSENT-DOMINATES merge rule, pinned. When several facts hold for one ordered pair
  2. // and any of them carries no phase provenance, the merged fact carries none and its edge
  3. // fans out to every ADMISSIBLE copy of the head. Without this fixture an inverted branch
  4. // stays green across the whole corpus, because nothing else has a pair carrying both a
  5. // provenanced barrier fact and an unprovenanced one.
  6. //
  7. // The shape is chosen so that temporal admission cannot be what decides the outcome. The
  8. // scout's ask is ISSUED before both `probe` calls (so both copies are admissible for the
  9. // data edge — both issue after it), but it is not AWAITED until `audit` (so the barrier it
  10. // raises is witnessed in `audit` alone). Absent-dominates is then the only rule left that
  11. // can decide whether the merged data+seq fact reaches the `survey` copy:
  12. //
  13. // ask#1 -> world-read#1~phase#1 and -> world-read#1~phase#2
  14. // data (target feeds the git args, no provenance) merged with a seq barrier witnessed
  15. // only in `audit`. Absent dominates, so BOTH copies keep the edge. THIS PAIR PROVES
  16. // THE BRANCH: let the provenance survive the merge and `~phase#1` disappears.
  17. // ask#2 -> world-read#1~phase#2 ONLY
  18. // seq alone, so provenance narrows it — the contrast that makes the first pair mean
  19. // something.
  20. //
  21. // Why narrowing data would be WRONG, not merely stricter: the barrier's witness phase
  22. // answers "where did an await order these two", and the data fact answers "whose argument
  23. // carried whose answer". Different questions about the same pair, so one's witness cannot
  24. // bound the other's reach. Admission is the rule that answers the temporal question, and
  25. // it is applied separately.
  26. //
  27. // `world-read#1~phase#1 -> ask#2` is the other half worth reading: the tail is a copy too,
  28. // and admission drops the `~phase#2` alternative because the audit copy is issued after
  29. // ask#2, so it cannot precede it.
  30. /** The shared helper: one world-read site, called from two phases. */
  31. async function probe(hint: string): Promise<string> {
  32. const log = await world.run("git", ["log", "-1", "--format=%s", "--grep", hint]);
  33. return log.stdout.trim();
  34. }
  35. phase("survey");
  36. const scout = agent("scout");
  37. const auditor = agent("auditor");
  38. // Issued here, awaited in `audit`: the promise crosses the marker, the step does not.
  39. const pending = scout.ask<string>("Name one commit subject worth auditing.");
  40. const baseline = await probe("release");
  41. phase("audit");
  42. const target = await pending;
  43. const note = await auditor.ask<string>("Anything to watch for in this repo?");
  44. const latest = await probe(target);
  45. return { baseline, latest, note };