{"title": "R12: Frontiers name what they await",
 "producer":
 ["GENERATED by tools/Drivers/Semantics.lean (make gen-semantics); do not edit",
  "format: effect4-semantics-report v8",
  "command: make gen-semantics",
  "inputs: tools/ProofGraph/Registry.lean, tools/Tools/Semantics.lean, tools/Drivers/Semantics.lean, tools/Tools/SemanticsDisplay.lean, tools/Tools/SemanticsDocument.lean, tools/Tools/Document.lean, tools/Tools/Document/Json.lean, src/Effect4/Laws/Auto/Semantics.lean, Test/Counterexamples/REGISTER.md, docs/core/decisions.md, lean-toolchain"],
 "format": "effect4-document/1",
 "body":
 [{"lines":
   [[{"text":
      "Open, worded as a proposed claim: pool-wake-selection (proposed claim; reactive-scheduling): the helper selects the first count waiters of the state that it finds, and it notifies exactly those, in order; the model's fact is select_takes_first, and one selection is one store step (select_attempt); the helper is a library program, one selection step and then each selected hint in order; the selection is by count, so the law takes the withdrawal as a premise: every entry of the waiters belongs to a request that still waits; finite controls: a selection at the post serves a waiter that left, and with no withdrawal the wake is lost (Test/Program/PoolPublic.lean, PP4; Test/Program/PoolTraces.lean, trace 2) (decisions rows 221, 267)"}],
    [{"text":
      "Open, waits on a ruling (a ruling on infinite tapes): R12-c: liveness on infinite tapes under FairTape (waits on a ruling on infinite tapes)"}],
    [{"text":
      "Open, not triaged: stability over the allowed internal decisions, with a named progress observation (not stated)"}],
    [{"text":
      "Open, not triaged: divergence by compatible prefixes (DB-03; not stated)"}],
    [{"text":
      "Open, worded as a proposed claim: driver-continuation-split and driver-suspension-keeps-typed (proposed claims; reactive-scheduling, extending drivestate-lift): a retained driver suspension keeps the commands, the remaining dispatcher tasks, the enclosing flush or clock phase and any atomic owner, and continuing it with budgets n and k equals one run with n + k; until then an owned operation runs under a proved embedded budget (decisions rows 84, 226); a finite control: at a reply application the command loop's leftover commands are not kept, and one run then stands at rest with no exit of the root (the run dropped of Test/Dogfood/Scenario/QueueWorkers.lean; one script at seven budgets)"}],
    [{"text":
      "Open, worded as a proposed claim: embedded-budget-sufficient (proposed claim; reactive-scheduling, serving R10 and R12): the embedded budget of an owned operation covers its registration, its cleanup and its selected delivery, so no cut falls inside the operation; a cut inside is excluded and is no resumption (decisions rows 84, 226); no theorem states a sufficient budget; a finite control measures the least fuel of one helper's task at eight lengths of the receiver's continuation, and at one unit less the remaining work is lost and five later flushes do not end the root (Test/Program/QueueTraces.lean, Test/Program/SemaphoreTraces.lean and Test/Program/PoolTraces.lean, trace 7 of each; Pool's measures seven lengths); no bound is claimed; at a run the premise has one name, funded (src/Effect4/Run/Tape.lean), and funded_replays says what it gives; a journal's verdicts do not decide it"}],
    [{"text":
      "Open, worded as a proposed claim: wait-registration-no-gap (proposed claim; reactive-scheduling): the decision to wait and the registration are one transition, so each eligible waiter is retrying or owns a notification (decisions rows 221, 223; finite controls in docs/research/2026-10-05-claude-lead/tx-probes/TxModel.lean); the Queue model's half is proved on the first profile (queue-first-step-invariant, queue-first-run-flags), and the wrapper's run stays open; an instance at rest on one program is the planned goal queue_settled (Test/Dogfood/Scenario/QueueWorkers.lean)"}],
    [{"text":
      "Open, worded as a proposed claim: posted-task-decision-preserves (proposed claim; reactive-scheduling): a posted task keeps the typed state, with its execution identity, its owner, its receiver's token and a stale delivery (decisions row 225)"}],
    [{"text":
      "Open, not triaged: posted-wake-debt-progress and a module's request progress: separate claims under named fairness, body-progress and budget premises; dispatcher service (flush_fair) does not give them (decisions rows 220, 225, 230)"}]],
   "kind": "items"},
  {"title": "Requirement R12: Frontiers name what they await",
   "kind": "part",
   "key": "about:req:R12",
   "body":
   [{"line":
     [{"text":
       "This page explains requirement R12 in Effect4. It covers what the requirement asks for live frontiers, why distinguishing waiting from deadlocks matters, and how the property is checked."}],
     "kind": "para"},
    {"title": "What the requirement asks",
     "kind": "part",
     "key": "about:req:R12:what-it-asks",
     "body":
     [{"line":
       [{"text":
         "Requirement R12 demands that non-terminal machine states explicitly name what they await rather than conflating pauses with failures ("},
        {"code": "docs/core/system-map.md"},
        {"text": " §8, DB-03):"}],
       "kind": "para"},
      {"lines":
       [[{"text":
          "Live frontiers: a frontier state represents a live pause waiting for fuel, host replies, or scheduling decisions."}],
        [{"text":
          "Frontier characterization: when execution runs out of decisions, the frontier is empty if and only if the machine is deadlocked ("},
         {"code": "frontier_empty_iff_deadlocked"},
         {"text": ")."}],
        [{"text": "Deadlock definition: "},
         {"code": "Deadlocked"},
         {"text":
          " requires no runnable fiber, no armed listener, no pending host request, no active timer, and no compile budget."}],
        [{"text":
          "Fairness draining: a fair decision tape leaves no armed listener at its live end ("},
         {"code": "fairTape_unarmed"},
         {"text": ")."}]],
       "kind": "items"},
      {"line":
       [{"text":
         "A pause caused by resource exhaustion or external silence must never be reported as an error."}],
       "kind": "para"}]},
    {"title": "Why it matters",
     "kind": "part",
     "key": "about:req:R12:why-it-matters",
     "body":
     [{"line":
       [{"text":
         "Asynchronous and concurrent systems pause frequently when waiting for external responses or when running out of budgeted time."}],
       "kind": "para"},
      {"line":
       [{"text":
         "If a runtime treated pauses as deadlocks or exceptions, programs would fail prematurely during legitimate long-running tasks."}],
       "kind": "para"},
      {"line":
       [{"text":
         "Naming frontier causes allows external drivers to supply appropriate budget, deliver host replies, and resume paused fibers cleanly."}],
       "kind": "para"}]},
    {"title": "How it is checked",
     "kind": "part",
     "key": "about:req:R12:how-it-is-checked",
     "body":
     [{"line":
       [{"text":
         "The requirement is checked by proving frontier characterization, deadlock criteria, and fair tape draining theorems:"}],
       "kind": "para"},
      {"lines":
       [[{"text": "Deadlock characterization is stated by "},
         {"code": "frontier_empty_iff_deadlocked"},
         {"text": " in "},
         {"code": "src/Effect4/Laws/Api/Frontier.lean"},
         {"text": "."}],
        [{"text": "Fair tape draining of armed listeners is stated by "},
         {"code": "fairTape_unarmed"},
         {"text": " ("},
         {"code": "src/Effect4/Laws/Machine/Scheduling.lean"},
         {"text": ")."}],
        [{"text":
          "Loop frontier characterization under host reply tapes is stated by "},
         {"code": "rows_loop_frontier"},
         {"text": " ("},
         {"code": "src/Effect4/Laws/Api/SessionMeaningLoop.lean"},
         {"text": ")."}],
        [{"text": "Meaning frontiers under silent hosts are stated by "},
         {"code": "rows_loop_frontier_host"},
         {"text": " in the same file."}]],
       "kind": "items"},
      {"line":
       [{"text":
         "The plan on this page gives each theorem's status and the goals it rests on."}],
       "kind": "para"}]}]},
  {"nodes":
   [{"status": "modulo",
     "label": "fed_accounted",
     "key": "Test.Dogfood.Scenario.QueueWorkers.fed_accounted",
     "detail": ""},
    {"status": "modulo",
     "label": "queue_settled",
     "key": "Test.Dogfood.Scenario.QueueWorkers.queue_settled",
     "detail": ""},
    {"status": "goal",
     "ref": "open:Test.Dogfood.Scenario.QueueWorkers.Assertions.rest_step",
     "label": "rest_step",
     "key": "Test.Dogfood.Scenario.QueueWorkers.Assertions.rest_step",
     "detail": ""},
    {"status": "goal",
     "ref": "open:Test.Dogfood.Scenario.QueueWorkers.Assertions.jobs_step",
     "label": "jobs_step",
     "key": "Test.Dogfood.Scenario.QueueWorkers.Assertions.jobs_step",
     "detail": ""}],
   "kind": "graph",
   "key": "fig:open:R12",
   "edges":
   [["Test.Dogfood.Scenario.QueueWorkers.fed_accounted",
     "Test.Dogfood.Scenario.QueueWorkers.Assertions.rest_step"],
    ["Test.Dogfood.Scenario.QueueWorkers.fed_accounted",
     "Test.Dogfood.Scenario.QueueWorkers.Assertions.jobs_step"],
    ["Test.Dogfood.Scenario.QueueWorkers.queue_settled",
     "Test.Dogfood.Scenario.QueueWorkers.Assertions.rest_step"],
    ["Test.Dogfood.Scenario.QueueWorkers.queue_settled",
     "Test.Dogfood.Scenario.QueueWorkers.Assertions.jobs_step"]],
   "caption":
   "The open part of R12: its planned goals and the theorems proved modulo them. An arrow goes from a node to a node its proof reaches first."},
  {"nodes":
   [{"status": "open",
     "ref": "concept:reactive-scheduling",
     "label": "Reactive Scheduling",
     "key": "reactive-scheduling",
     "detail": "24 nodes, 3 open"},
    {"status": "proved",
     "ref": "concept:host-session-protocol",
     "label": "Host Session Protocol",
     "key": "host-session-protocol",
     "detail": "3 nodes"},
    {"status": "proved",
     "ref": "concept:scope-lifetime-finalization",
     "label": "Scope Lifetime & Finalization",
     "key": "scope-lifetime-finalization",
     "detail": "3 nodes"},
    {"status": "open",
     "ref": "concept:translation-simulation",
     "label": "Translation & Simulation",
     "key": "translation-simulation",
     "detail": "31 nodes, 1 open"},
    {"status": "proved",
     "label": "No concept",
     "key": "none",
     "detail": "3 nodes"},
    {"status": "proved",
     "ref": "concept:initial-algebras-folds",
     "label": "Initial Algebras & Folds",
     "key": "initial-algebras-folds",
     "detail": "1 nodes"}],
   "kind": "graph",
   "key": "fig:concepts:R12",
   "edges":
   [["host-session-protocol", "translation-simulation"],
    ["reactive-scheduling", "none"],
    ["reactive-scheduling", "translation-simulation"],
    ["reactive-scheduling", "host-session-protocol"],
    ["reactive-scheduling", "scope-lifetime-finalization"],
    ["translation-simulation", "none"],
    ["scope-lifetime-finalization", "translation-simulation"],
    ["scope-lifetime-finalization", "none"],
    ["translation-simulation", "initial-algebras-folds"]],
   "caption":
   "R12 by concept: each concept its nodes are placed at, by tag or by module. An arrow goes where a node's proof reaches a node of another concept."},
  {"rows":
   [[[{"code": "fairTape_unarmed"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"text": "—"}]],
    [[{"code": "frontier_empty_iff_deadlocked"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"text": "—"}]],
    [[{"code": "rows_loop_frontier"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"code": "localWaitC_to_rowsB"},
      {"text": ", "},
      {"code": "funded_replays"}]],
    [[{"code": "rows_loop_frontier_host"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"code": "localWaitC_to_rowsB"},
      {"text": ", "},
      {"code": "funded_replays"}]],
    [[{"code": "driveState_loop"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"code": "loop_of_iteration"}]],
    [[{"code": "iteration_below_budget"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"text": "—"}]],
    [[{"code": "loop_of_iteration"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"text": "—"}]],
    [[{"code": "bounded"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"text": "—"}]],
    [[{"code": "complete_unique"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"text": "—"}]],
    [[{"code": "select_takes_first"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"text": "—"}]],
    [[{"code": "first_run_flags"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"code": "first_run_inv"}]],
    [[{"code": "first_run_inv"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"code": "first_step_inv"}]],
    [[{"code": "first_step_inv"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"code": "positive_suspend_step_capacity"},
      {"text": ", "},
      {"code": "first_profile_closed"}]],
    [[{"code": "visit_selects_earliest"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"text": "—"}]],
    [[{"code": "visit_stops_iff"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"text": "—"}]],
    [[{"code": "quiet_nil"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"text": "—"}]],
    [[{"code": "settled_of_ledger"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"code": "within_one"},
      {"text": ", "},
      {"code": "spent_one"},
      {"text": ", "},
      {"code": "quiet_nil"},
      {"text": ", "},
      {"code": "settled_of_view"}]],
    [[{"code": "settled_of_view"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"text": "—"}]],
    [[{"code": "spent_one"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"text": "—"}]],
    [[{"code": "within_one"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"text": "—"}]],
    [[{"code": "rest_step"}],
     [{"status": "goal"}],
     [{"code": "rest_step"}],
     [{"code": "checkInput_eq_none_iff"}]],
    [[{"code": "fed_accounted"}],
     [{"status": "modulo"}],
     [{"code": "jobs_step"}, {"text": ", "}, {"code": "rest_step"}],
     [{"code": "accounted_of_ledger"},
      {"text": ", "},
      {"code": "rest_step"},
      {"text": ", "},
      {"code": "exit_eq"},
      {"text": ", "},
      {"code": "jobs_step"},
      {"text": ", "},
      {"code": "checkInput_eq_none_iff"},
      {"text": ", "},
      {"code": "reached_history"},
      {"text": ", "},
      {"code": "ledger_opened"},
      {"text": ", "},
      {"code": "queueCrew_acquire_once_placed"},
      {"text": ", "},
      {"code": "queue_acquisition_sites"},
      {"text": ", "},
      {"code": "queue_built_program"}]],
    [[{"code": "queue_settled"}],
     [{"status": "modulo"}],
     [{"code": "jobs_step"}, {"text": ", "}, {"code": "rest_step"}],
     [{"code": "settled_of_ledger"},
      {"text": ", "},
      {"code": "rest_step"},
      {"text": ", "},
      {"code": "exit_eq"},
      {"text": ", "},
      {"code": "jobs_step"},
      {"text": ", "},
      {"code": "checkInput_eq_none_iff"},
      {"text": ", "},
      {"code": "reached_history"},
      {"text": ", "},
      {"code": "ledger_opened"},
      {"text": ", "},
      {"code": "queueCrew_acquire_once_placed"},
      {"text": ", "},
      {"code": "queue_acquisition_sites"},
      {"text": ", "},
      {"code": "queue_built_program"}]],
    [[{"code": "localWaitC_to_rowsB"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"code": "localRunC_compileBO"}]],
    [[{"code": "funded_replays"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"code": "journal_replays"}, {"text": ", "}, {"code": "tape_replays"}]],
    [[{"code": "positive_suspend_step_capacity"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"code": "acceptLoop_length_le"}]],
    [[{"code": "first_profile_closed"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"text": "—"}]],
    [[{"code": "checkInput_eq_none_iff"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"text": "—"}]],
    [[{"code": "accounted_of_ledger"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"code": "held_of_shows"}]],
    [[{"code": "exit_eq"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"text": "—"}]],
    [[{"code": "jobs_step"}],
     [{"status": "goal"}],
     [{"code": "jobs_step"}],
     [{"code": "checkInput_eq_none_iff"}]],
    [[{"code": "reached_history"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"text": "—"}]],
    [[{"code": "ledger_opened"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"code": "opened_exit"}]],
    [[{"code": "queueCrew_acquire_once_placed"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"code": "queue_placement"},
      {"text": ", "},
      {"code": "queue_built_program"},
      {"text": ", "},
      {"code": "checkInput_eq_none_iff"}]],
    [[{"code": "queue_acquisition_sites"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"text": "—"}]],
    [[{"code": "queue_built_program"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"code": "queue_elaborates"},
      {"text": ", "},
      {"code": "build_retains"},
      {"text": ", "},
      {"code": "checkInput_eq_none_iff"}]],
    [[{"code": "localRunC_compileBO"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"code": "compilesBO_onExit"},
      {"text": ", "},
      {"code": "compilesBO_matchCause"},
      {"text": ", "},
      {"code": "compilesBO_catchIf"},
      {"text": ", "},
      {"code": "compilesBO_catchCause"},
      {"text": ", "},
      {"code": "compilesBO_select"},
      {"text": ", "},
      {"code": "compilesBO_bind"},
      {"text": ", "},
      {"code": "compilesBO_iterate"},
      {"text": ", "},
      {"code": "compilesBO_exit"},
      {"text": ", "},
      {"code": "compilesBO_suspend"},
      {"text": ", "},
      {"code": "denoteRowsB_straight"},
      {"text": ", "},
      {"code": "denoteRows_straight"}]],
    [[{"code": "journal_replays"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"text": "—"}]],
    [[{"code": "tape_replays"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"text": "—"}]],
    [[{"code": "acceptLoop_length_le"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"text": "—"}]],
    [[{"code": "held_of_shows"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"code": "flatMap_offers"}, {"text": ", "}, {"code": "filterMap_gave"}]],
    [[{"code": "opened_exit"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"code": "exit_eq"}]],
    [[{"code": "queue_placement"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"text": "—"}]],
    [[{"code": "queue_elaborates"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"code": "queue_refs_nil"},
      {"text": ", "},
      {"code": "queue_main_eq"},
      {"text": ", "},
      {"code": "elaborateModule_no_declarations"}]],
    [[{"code": "build_retains"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"code": "finishBuild_retains"},
      {"text": ", "},
      {"code": "checkInput_eq_none_iff"}]],
    [[{"code": "compilesBO_onExit"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"code": "at_append"}]],
    [[{"code": "compilesBO_matchCause"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"code": "at_append"}]],
    [[{"code": "compilesBO_catchIf"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"code": "at_append"}]],
    [[{"code": "compilesBO_catchCause"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"code": "at_append"}]],
    [[{"code": "compilesBO_select"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"code": "at_append"}]],
    [[{"code": "compilesBO_bind"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"code": "at_append"}]],
    [[{"code": "compilesBO_iterate"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"code": "at_append"}]],
    [[{"code": "compilesBO_exit"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"code": "denoteRowsB_straight"}, {"text": ", "}, {"code": "at_append"}]],
    [[{"code": "compilesBO_suspend"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"code": "at_append"}]],
    [[{"code": "denoteRowsB_straight"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"text": "—"}]],
    [[{"code": "denoteRows_straight"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"text": "—"}]],
    [[{"code": "flatMap_offers"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"text": "—"}]],
    [[{"code": "filterMap_gave"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"text": "—"}]],
    [[{"code": "queue_refs_nil"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"text": "—"}]],
    [[{"code": "queue_main_eq"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"code": "queue_main_some"},
      {"text": ", "},
      {"code": "elaboration_eq_getD"}]],
    [[{"code": "elaborateModule_no_declarations"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"text": "—"}]],
    [[{"code": "finishBuild_retains"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"code": "checkInput_eq_none_iff"}]],
    [[{"code": "at_append"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"text": "—"}]],
    [[{"code": "queue_main_some"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"text": "—"}]],
    [[{"code": "elaboration_eq_getD"}],
     [{"status": "proved"}],
     [{"text": "—"}],
     [{"text": "—"}]]],
   "kind": "table",
   "headers": ["Node", "Status", "Rests on", "Nearest nodes"]}]}
