Session Resolution
Definition
Session resolution is the multi-turn inference protocol in which a sequence of RelationQuery evaluations shares a common Context. Each resolved query appends a Binding to a BindingAccumulator, monotonically reducing the aggregate free site space for subsequent queries.
A Session is the bounded collection of query/response pairs that share this accumulator. Sessions are the unit of coherent multi-turn reasoning in Prism deployments.
Monotonicity Invariant
The binding monotonicity invariant (GR_1) guarantees:
freeRank(B_{i+1}) ≤ freeRank(B_i) for all i in a Session S.
The aggregateSiteDeficit on the BindingAccumulator tracks the total remaining free sites across all accumulated bindings. This value can only decrease as the session progresses — accumulated knowledge cannot increase uncertainty.
SessionResolver
A SessionResolver is the top-level resolver for multi-turn Prism deployments. It maintains the BindingAccumulator across evaluations via the sessionAccumulator property.
SessionQuery
A SessionQuery extends RelationQuery by explicitly declaring session membership via the sessionMembership property. This allows the conformance suite to validate session-scoped site reduction.
Session Boundaries
A SessionBoundary marks a context-reset event within a session stream. The SessionBoundaryType vocabulary enum classifies the reason:
| Individual | Meaning |
|---|---|
state:ExplicitReset | Caller requested context reset |
state:ConvergenceBoundary | No further queries can reduce the aggregate site deficit |
state:ContradictionBoundary | New query produced a type contradiction with an accumulated binding |
Each boundary records the priorContext (the state before reset) and the freshContext (the clean state for subsequent queries).
Session Identity Algebra (GR_ series)
Amendment 27 adds five GR_ identity individuals formalizing the session resolution algebra:
| Identity | Statement |
|---|---|
| GR_1 | Binding monotonicity: freeRank(B_{i+1}) ≤ freeRank(B_i) |
| GR_2 | Empty session is identity: freeRank(B_0) = total site space |
| GR_3 | Convergence: session terminates iff freeRank reaches minimum |
| GR_4 | Disjoint bindings compose without site conflict |
| GR_5 | ContradictionBoundary fires iff ∃ conflicting bindings at same address |
Amendment 44 adds two more GR_ identities for session-level coherence:
| Identity | Statement |
|---|---|
| GR_6 | Session join monotonicity: freeRank(join(S_A, S_B)) ≤ freeRank(S_A) + freeRank(S_B) |
| GR_7 | Session inclusion: S_A ⊆ S_B implies freeRank(S_A) ≥ freeRank(S_B) |
Amendment 48 adds three axiomatic and eight derivational identities for multi-session coordination:
| Identity | Statement |
|---|---|
| GR_8 | Composition validity: compose(S_A, S_B) valid at Q_k iff datum agreement holds at every tower level Q_0…Q_k |
| GR_9 | ContextLease disjointness: leasedSites(L_A) ∩ leasedSites(L_B) = ∅ for distinct leases on the same SharedContext |
| GR_10 | ExecutionPolicy confluence: different policies produce the same final resolved state (Church–Rosser) |
| MC_1 | Lease partition conserves budget: Σᵢ freeRank(L_i) = freeRank(C) |
| MC_2 | Per-lease binding monotonicity: GR_1 holds within each leased sub-domain |
| MC_3 | Composition freeRank via inclusion-exclusion |
| MC_4 | Disjoint-lease additivity: freeRank(compose(S_A, S_B)) = freeRank(S_A) + freeRank(S_B) when GR_9 holds |
| MC_5 | Policy-invariant final binding set |
| MC_6 | Full lease coverage implies composed grounding (σ = 1) |
| MC_7 | Distributed O(1) resolution: stepCount = 0 on a fully grounded composed context |
| MC_8 | Parallelism bound: per-session work ≤ ⌈n/k⌉ for k uniform-partition leases |
Multi-Session Coordination (Amendment 48)
SharedContext and ContextLease
A SharedContext is a Context visible to more than one Session simultaneously. Concurrent write conflicts are prevented by partitioning its sites across ContextLease instances.
Each ContextLease holds:
- leasedSites — exclusive site sub-domain (a FreeRank)
- leaseHolder — the owning Session
The SharedContext links active leases via leaseSet. Lease disjointness (GR_9) is enforced structurally: each lease claims a non-overlapping FreeRank.
SessionComposition
A SessionComposition records that a Session was formed by merging the binding sets of two or more predecessor sessions:
- composedFrom — predecessor sessions (non-functional, multiple allowed)
- compositionCompatible —
trueiff datum agreement holds at all tower levels (GR_8) - compositionResult — the merged Context produced on success
- towerConsistencyVerified —
trueiff tower check was run for Q_1+ sessions
An invalid composition (compositionCompatible = false) triggers a ContradictionBoundary on the target session.
ExecutionPolicy
A ExecutionPolicy defines how a SessionResolver orders pending RelationQuery instances, linked via executionPolicy.
The ExecutionPolicyKind enum provides four scheduling strategies:
| Individual | Strategy |
|---|---|
resolver:FifoPolicy | Arrival order (pre-Amendment 48 implicit default) |
resolver:MinFreeRankFirst | Cheapest resolutions first — favours early grounding gain |
resolver:MaxFreeRankFirst | Hardest resolutions first — maximises information gain per step |
resolver:DisjointFirst | Site-disjoint queries first — minimises SharedContext contention |
All four strategies are policy-confluent (GR_10): they converge to identical final binding sets.