server.intent_replay

Page actions AI-ready formats and sharing
Open LLM text
Share with AI
Ask Claude Ask ChatGPT Ask Gemini Ask Copilot

Private, data-only Intent Timeline artifact loading and comparison.

The.chirp-replayschema implemented here is deliberately private and has no compatibility promise or public export. Version 1 is UTF-8 JSON with this exact…

Private, data-only Intent Timeline artifact loading and comparison.

The.chirp-replayschema implemented here is deliberately private and has no compatibility promise or public export. Version 1 is UTF-8 JSON with this exact envelope::

{
  "schema": "chirp.intent-timeline/1",
  "kind": "observation",
  "created_with": {"chirp": "0.x"},
  "application": {"program_fingerprint": "sha256:..." | null},
  "capture": {
    "source": "debug-test",
    "redaction": "public-safe-v1",
    "truncated": false,
    "dropped_count": 0,
    "first_retained_sequence": null
  },
  "events": []
}

Only fields represented by the frozen observation model are serialized. The allowlist contains structural request, render-intent, response, SSE lifecycle, and diagnostic facts. Bodies, HTML, headers, cookies, sessions, authorization, query strings, concrete URLs, context, arbitrary notes, environment data, DSNs, and absolute paths are forbidden. The loader never imports an application, opens a network connection, invokes a route, or mutates application state.

Semantic comparison ignores only documented nondeterminism: elapsed time, opaque capture request IDs, per-event absolute sequence values, capture source, and Chirp patch-version differences. Route/mode, return/render intent, block/target, status, compiled transitions, lifecycle facts, causal parents, ordering, truncation, and program fingerprints remain authoritative.

server.intent_replay

Name Type Default Description
type
qualified_name
element_type
description
source_file
line_number
is_autodoc
autodoc_element
_autodoc_template
_autodoc_url_path
_autodoc_page_type
title
doc_content_hash

Symbols on this page

_ReplayArtifactError
class

A replay artifact failed strict schema or redaction validation.

_ReplayArtifact
class

Validated private artifact with immutable typed observations.

_ReplayDifference
class

One bounded semantic divergence without arbitrary source payloads.

_ReplayComparison
class

Deterministic semantic comparison result.

_ParseContext
class
_dump_replay_artifact
function
def _dump_replay_artifact(snapshot: _CaptureSnapshot, *, chirp_version: str, program_fingerprint: str | None, source: str = 'debug-test') -> bytes

Serialize one allowlisted capture snapshot to canonical UTF-8 JSON.

Parameters

Name Type Default Description
snapshot _CaptureSnapshot
chirp_version str
program_fingerprint str | None
source str 'debug-test'
_load_replay_artifact
function
def _load_replay_artifact(path: Path) -> _ReplayArtifact

Read and strictly validate a private.chirp-replayartifact.

Parameters

Name Type Default Description
path Path
_parse_replay_artifact
function
def _parse_replay_artifact(data: bytes, *, source_name: str) -> _ReplayArtifact

Validate untrusted artifact bytes without importing or executing code.

Parameters

Name Type Default Description
data bytes
source_name str
_compare_replay_artifacts
function
def _compare_replay_artifacts(expected: _ReplayArtifact, actual: _ReplayArtifact) -> _ReplayComparison

Compare structural semantics while ignoring documented capture noise.

Parameters

Name Type Default Description
expected _ReplayArtifact
actual _ReplayArtifact

View source · /home/runner/work/chirp/chirp/site/../src/chirp/server/intent_replay.py:1