mirror of
https://github.com/anomalyco/opencode.git
synced 2026-07-24 20:25:36 -04:00
docs(v2): render context epoch diagrams
This commit is contained in:
+36
-28
@@ -43,38 +43,46 @@ V2 Sessions persist the exact privileged System Context shown to the model. A Co
|
||||
|
||||
The first complete observation initializes the epoch before any pending prompt becomes model-visible. If initial context is temporarily unavailable, execution stops while the prompt remains pending and retryable. On later provider turns, the runner promotes eligible input first, then reconciles current sources at the safe boundary. Changed context becomes one durable chronological System message, and its event commit advances the epoch snapshot atomically.
|
||||
|
||||
```mermaid
|
||||
sequenceDiagram
|
||||
participant Client
|
||||
participant Runner
|
||||
participant Registry as System Context Registry
|
||||
participant Epoch as Context Epoch Store
|
||||
participant History as Session History
|
||||
participant LLM
|
||||
|
||||
Client->>History: Admit prompt
|
||||
Runner->>Registry: Observe initial context
|
||||
Registry-->>Runner: Complete baseline or unavailable
|
||||
Runner->>Epoch: Initialize missing epoch
|
||||
Runner->>History: Promote eligible input
|
||||
Runner->>Registry: Reconcile at safe boundary
|
||||
Registry-->>Runner: Unchanged or chronological update
|
||||
Runner->>Epoch: Advance snapshot atomically with update
|
||||
Runner->>LLM: Baseline + chronological history
|
||||
```text
|
||||
Client Runner System Context Registry Context Epoch Store Session History LLM
|
||||
│ │ │ │ │ │
|
||||
├─ Admit prompt ─────────────────────────────────────────────────────────────────────────────────────────────▶ │
|
||||
│ │ │ │ │ │
|
||||
│ ├─ Observe initial context ────────────▶ │ │ │
|
||||
│ │ │ │ │ │
|
||||
│ ◀─ Complete baseline or unavailable ───┤ │ │ │
|
||||
│ │ │ │ │ │
|
||||
│ ├─ Initialize missing epoch ───────────────────────────────────────▶ │ │
|
||||
│ │ │ │ │ │
|
||||
│ ├─ Promote eligible input ─────────────────────────────────────────────────────────────────▶ │
|
||||
│ │ │ │ │ │
|
||||
│ ├─ Reconcile at safe boundary ─────────▶ │ │ │
|
||||
│ │ │ │ │ │
|
||||
│ ◀─ Unchanged or chronological update ──┤ │ │ │
|
||||
│ │ │ │ │ │
|
||||
│ ├─ Advance snapshot atomically with update ────────────────────────▶ │ │
|
||||
│ │ │ │ │ │
|
||||
│ ├─ Baseline + chronological history ─────────────────────────────────────────────────────────────────────────▶
|
||||
```
|
||||
|
||||
Model switches and completed compactions request lazy baseline replacement. A Session move clears the epoch so the destination Location must initialize a complete baseline before promoting more input. Epoch creation is fenced against the authoritative Session Location, preventing an old-Location runner from recreating stale privileged context after a concurrent move.
|
||||
|
||||
```mermaid
|
||||
stateDiagram-v2
|
||||
[*] --> Missing
|
||||
Missing --> Active: complete initial observation
|
||||
Missing --> Missing: initial context unavailable
|
||||
Active --> Active: reconcile change
|
||||
Active --> ReplacementPending: model switch or compaction
|
||||
ReplacementPending --> Active: complete replacement observation
|
||||
Active --> Missing: Session moves Location
|
||||
ReplacementPending --> Missing: Session moves Location
|
||||
```text
|
||||
Session Epoch
|
||||
│ │
|
||||
├─ initialize complete baseline ──▶
|
||||
│ │
|
||||
│ ├─────────────────────────────────╮
|
||||
│ │ reconcile chronological update │
|
||||
│ ◀─────────────────────────────────╯
|
||||
│ │
|
||||
├─ request replacement ───────────▶
|
||||
│ │
|
||||
│ ├─────────────────────────────────────╮
|
||||
│ │ replace after complete observation │
|
||||
│ ◀─────────────────────────────────────╯
|
||||
│ │
|
||||
├─ clear after Location move ─────▶
|
||||
```
|
||||
|
||||
Ambient project discovery canonicalizes and contains traversal within the project root and honors `OPENCODE_DISABLE_PROJECT_CONFIG`. An unavailable observation preserves the previously admitted value. A confirmed partial instruction removal emits the complete remaining aggregate with explicit supersession text; removing the final instruction emits a revocation message.
|
||||
|
||||
Reference in New Issue
Block a user