Skip to content

Actions model: wake-ups from the events contract; mutant: events only - #49

Closed
calvin-archastro wants to merge 4 commits into
mainfrom
feat/events-actions-sync
Closed

calvin-archastro wants to merge 4 commits into
mainfrom
feat/events-actions-sync

Conversation

@calvin-archastro

Copy link
Copy Markdown
Contributor

Merge order: #47 → this. (Base is verify/actions-model-2; once #47 merges, retarget to main.) The contract it uses is modelled in #48 (verify/events/); this PR does not import it, so it merges either side of #48.

What

The Actions orchestrator will run pail events --branch '*' --prefix actions/ --cursor <in the area> beside each replica and tick on each event. This makes verify/actions/actions.qnt say so, instead of letting a replica read at any time.

  1. A replica ticks (read) only when woken (woken).
  2. Every write to _actions, _checks or an object of the area is announced to all replicas (announced). A wake is a flag, so a repeated or reordered announcement changes nothing; lose drops one.
  3. wake is the safety poll (and the start-up diff against the cursor): it wakes a replica whatever it was told. This is the events model's contract: cursor resume plus safety poll, so a lost notification only delays a tick.
  4. Time passing announces nothing: a lease that lapses is found only by the poll.
  5. A write that conflicts sends its replica back to read.
  6. noStranded now needs some replica to tick (willTick: woken, mid-commit, or the safety poll will come).
  7. New switch SAFETY_POLL: off = "the orchestrator relies on events only". The sim finds a stranded job (noStranded); it is in mutate_actions.sh with the other 13.
  8. New scenario safetyPollSweepsRun (runner dies, announcements lost, lease lapses in silence, only the poll wakes a replica, which sweeps); witnesses neverLostWake, neverPolled.

Verification

  • npm test: 19 scenarios (18 existing, unchanged, plus the new one) pass.
  • simulate:actions (60k runs, simSafety): no violation. witness:actions: all 7 reached. mutate:actions: all 13 existing switches, CAS+FENCE, and the new SAFETY_POLL are caught.
  • No Rust or generated-artifact change (the actions model has no refinement harness yet).

🤖 Generated with Claude Code

calvin-archastro and others added 4 commits October 31, 2026 08:53
…leases, fencing

verify/actions.qnt: replicas that read, decide and write one guarded Tier 1 commit from a
stale read; runners that claim, refresh, report and crash; results, sweep, cancel,
rerun, environment gate, checks. actions_sim.qnt: random interleavings with a ghost for
the history properties; mutate_actions.sh flips each of 13 design switches.
actions_scenarios.qnt: 16 runs for UC1-4, 6-8.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…jobs); two race scenarios

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…: events only

An orchestrator replica ticks (`read`) only when woken. Every write to a branch or an
object of the area is announced to all replicas; an announcement may be lost, repeated
or reordered (a wake is a flag), and the safety poll and the start-up diff against the
cursor (verify/events/events.qnt) wake a replica whatever it was told. Time passing
announces nothing, so a lease that lapses is found only by the poll.

- State `woken`; actions `wake` (safety poll / resume) and `lose` (announcement lost).
- `noStranded` now also needs some replica to tick (`willTick`).
- New switch SAFETY_POLL: off is "the orchestrator relies on events only"; the sim finds
  a stranded job (noStranded). mutate_actions.sh runs it with the other switches.
- Scenario safetyPollSweepsRun; witnesses neverLostWake, neverPolled.
- All earlier properties, witnesses, mutants and the 18 scenarios still pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Base automatically changed from verify/actions-model-2 to main October 31, 2026 17:51
@calvin-archastro

Copy link
Copy Markdown
Contributor Author

Replaced by #51 (stacked on #50).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant