← Back to Pull requests

docs: explain session and runtime data model #259

Open
unknown opened this pull request with 303 lines diff across 3 files
View on GitHub
unknown unknown commented on Nov 10, 2026 23:11 UTC
Author

Intent

The current docs define sessions, incarnations, and the Substrate runtime in their respective contexts, but do not provide one relationship view that answers a common modeling question: how does a durable Session relate to executions, journal records, runtime compute, Substrate actors, workers, snapshots, and fork children?

This PR adds that conceptual bridge. Its main intent is to prevent two misleading simplifications:

  • treating a Session as one database document rather than metadata beside an append-only journal and transactional projections

  • modeling Session -> Worker as a durable identity relationship, when the portable relationship is Session -> Runtime -> Incarnation, and a worker is only a transient Substrate placement
  • The page is explicitly non-normative. It describes the current reference implementation and points readers back to the protobuf API and draft specification as the authoritative contracts.

    What this documents

  • the durable Session aggregate, its three independent state axes, lineage, and metadata

  • journal records, logical executions, typed events, approval projections, and allocation attempts

  • the runtime-neutral Incarnation and SnapshotRef model

  • the Substrate mapping from session UID to actor name, immutable actor UID, worker, router, harness server, and snapshot

  • which fields are durable, journal-derived, ephemeral, or retained only in daemon configuration

  • cardinalities and current constraints, including the single configured Substrate harness and non-persisted atespace/template binding

  • the distinction between Event.actor provenance and a Substrate runtime actor
  • The document includes a short text model for quick orientation, Mermaid relationship diagrams, tables, and source links. It also labels reserved execution/compute states rather than implying that every declared enum is currently reported.

    Documentation integration

  • add the page to the repository documentation index and reading order

  • add explicit site metadata required by the docs sync guard

  • add the page to the Starlight sidebar
  • Validation

  • python3 hack/check-doc-links.py --root docs

  • go run ./hack/doccheck

  • cd site && npm run build

  • cd site && node hack/check-links.mjs

  • git diff --check
  • All checks pass. The site build successfully renders all three Mermaid diagrams and the rendered internal-link checker reports all routes resolved.

    Diff: 303 lines (+227 / -76) across 3 files Reviewer: aramase Review duration: 2049m
    All Vouch review confidence checks passed
    Residual risk 0.23 = Change Risk (0.40) × (1 − Review Confidence (0.43)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.40 · 303 lines diff across 3 files
    0.40
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    42%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.342
    Real PR Conversation Timeline
    1 comments
    "Review active on #259"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 43.0% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 40.1% (MEDIUM) · Higher = larger blast radius
    40.1%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 43.0% · Lower = rushed or shallow review
    43.0%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 22.9% · Safe to merge
    22.9%