order-derived-guard-control.ts 653 B

123456789101112
  1. // A guard that reads a value DERIVED from an ask. `const ok = t.escalate` issues nothing,
  2. // so phase 1's syntactic controller map — which records the steps issued while evaluating
  3. // an initializer — associates no step with `ok`, and the guard produced no `control` edge
  4. // at all. The phase-2 taint oracle carries ask#1's label through the field read into the
  5. // guard's value, so `ask#1 -control-> ask#2` appears (see docs/analysis.md,
  6. // "Control dependence").
  7. const t = await agent("triage").ask<{ escalate: boolean }>("triage");
  8. const ok = t.escalate;
  9. if (ok) {
  10. return await agent("senior").ask<string>("handle");
  11. }
  12. return "no escalation";