The Multi-Project kernel extends Multi-Collaboration to operations that span multiple projects — for example, moving a task from one project to another. The key insight is that the action itself declares which projects it touches. The kernel lifts all single-project effect state machine guarantees to the multi-project setting while adding per-project version tracking and atomic cross-project transitions.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/metareflection/dafny-replay/llms.txt
Use this file to discover all available pages before exploring further.
Key insight: actions declare their scope
TouchedProjects is the anchor of the entire architecture. The server loads only the projects listed by this function, verifies membership for each, and writes back only the changed projects — atomically. Cross-project operations are all-or-nothing: if any project’s version check fails, the entire transaction rolls back.
Data structures
MultiModel
MultiModel is a map from project IDs to individual project models. Each project model is independently verified against the single-project domain invariant.
MultiAction
Single wraps any single-project action, allowing the same state machine to handle both cases uniformly. MoveTaskTo removes the task from the source project and inserts it into the destination. CopyTaskTo duplicates the task.
MultiClientState
ClientState which has a single baseVersion, MultiClientState tracks a separate version per project. A cross-project action carries both versions in the SendDispatch command.
MultiInv
Domain obligation
Each concrete multi-project domain must prove one lemma:StepPreservesInv to the multi-project setting. For Single actions, it delegates to the single-project proof. For MoveTaskTo and CopyTaskTo, the concrete domain proves that the source and destination models both satisfy Inv after the operation.
Core functions
AllProjectsLoaded
MultiStep. If a touched project is missing, TryMultiStep returns MissingProject without attempting the transition.
MultiStep and TryMultiStep
MultiStep is the verified core function used in proofs. TryMultiStep is the runtime-safe variant used by edge functions — it checks AllProjectsLoaded internally and returns a structured error instead of failing a precondition.
ChangedProjects
MultiRebase
Single actions, this delegates to the single-project RebaseThroughSuffix. For cross-project actions, the concrete domain defines rebase semantics.
Effect state machine events
The multi-project effect state machine uses the same event structure as the single-project version, extended with per-project versions:Kernel theorems
MultiProjectEffectStateMachine.dfy proves the following properties, lifting all single-project guarantees to the multi-project setting:
MPK1 — StepPreservesInv
MPK1 — StepPreservesInv
All effect state transitions preserve the multi-project effect state invariant.
MPK2 — Pending preservation
MPK2 — Pending preservation
PendingNeverLost— pending actions are never arbitrarily lostPendingSequencePreserved— on accept/reject:pending' == pending[1..]ConflictPreservesPendingExactly— conflicts preservependingexactlyRealtimeUpdatePreservesPendingExactly— realtime updates preservependingexactlyUserActionAppendsExact— user actions append exactly the action topending
MPK3 — Bounded retries and mode consistency
MPK3 — Bounded retries and mode consistency
RetriesAreBounded— retries never exceedMaxRetriesModeConsistent— dispatching mode always implies pending actions exist
Module hierarchy
Trust boundaries
| Component | Trust level |
|---|---|
MultiStep, TryMultiStep | Verified in Dafny |
TouchedProjects | Verified in Dafny |
ChangedProjects | Verified in Dafny |
| Effect state machine | Verified in Dafny |
| JSON conversion (dafny2js output) | Generated, tested |
| Edge function orchestration | Unverified I/O glue |
save_multi_update SQL function | Tested, not formally verified |
Integration boundary (trusted)
- Atomic application of verified multi-project transitions to storage
- Realtime skew (partial arrival of multi-project updates)
- Edge function orchestration around verified transitions
- Semantics of
TouchedProjectsbeyond what the concrete domain proves
Related pages
Multi-Collaboration kernel
The single-project foundation that Multi-Project extends.
Effect State Machine
The single-project effect orchestration kernel.
CollabTodo app
Full example of the Multi-Project kernel with MoveTaskTo and CopyTaskTo.
Guarantees reference
Precise trust boundaries for the Multi-Project kernel.