Skip to content

API Reference parrot.knowledge.manuals.spikes

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.knowledge.manuals.spikes

View source

Spike harness for FEAT-601's validation gate (M0 / AC1).

Measures figure pairing, video alignment, tip survival and media delivery over an owner-supplied corpus and writes one JSON report per run.

Running these spikes against the real owner-supplied corpus (and signing off AC1 on the resulting numbers) is a human-in-the-loop step — this module only builds the repeatable, testable measurement harness (spec §3 Module 0).

Alias AnswerRecord

Re-exported from parrot.knowledge.manuals.catalog.AnswerRecord.

Attribute CHANNEL_SENDERS

Type: dict[str, ChannelSender]

Alias CatalogConflictError

Re-exported from parrot.knowledge.manuals.catalog.CatalogConflictError.

Attribute ChannelSender

Alias JudgementLog

Re-exported from parrot.knowledge.manuals.video.JudgementLog.

Alias ManualCard

Re-exported from parrot.knowledge.manuals.models.ManualCard.

Alias ManualCatalogStore

Re-exported from parrot.knowledge.manuals.catalog.ManualCatalogStore.

Alias ManualGraphLoader

Re-exported from parrot.knowledge.manuals.graph_loader.ManualGraphLoader.

Alias ManualLibrary

Re-exported from parrot.knowledge.manuals.library.ManualLibrary.

Alias ManualVersion

Re-exported from parrot.knowledge.manuals.models.ManualVersion.

Alias ProcedureAnswer

Re-exported from parrot.knowledge.manuals.models.ProcedureAnswer.

Alias PublicationRecord

Re-exported from parrot.knowledge.manuals.catalog.PublicationRecord.

Attribute REPORT_ROOT

Attribute REQUIRED_MEDIA_CHANNELS

Type: tuple[str, ...]

Attribute SPIKE_CORPUS_ENV

Class SpikeReport

One spike's measured numbers, thresholds and pass/fail; serialised under artifacts/logs/.

Fields:

Field Type Default Description
name Literal['figures', 'media', 'video', 'tips']
measurements dict[str, float]
thresholds dict[str, float]
passed bool
notes list[str]

Alias Step

Re-exported from parrot.knowledge.manuals.models.Step.

Attribute THRESHOLDS

Type: dict[str, dict[str, float]]

Alias UpsertResult

Re-exported from parrot.knowledge.manuals.catalog.UpsertResult.

Alias add_tip

Re-exported from parrot.knowledge.manuals.tips.add_tip.

Alias align_video

Re-exported from parrot.knowledge.manuals.video.align_video.

Function corpus_dir_from_env

Resolve MANUALS_SPIKE_CORPUS; missing/nonexistent ⇒ FileNotFoundError with a clear hint.

corpus_dir_from_env() -> Path

Returns: Path

Attribute logger

Alias manual_snapshot_payload

Re-exported from parrot.knowledge.manuals.models.manual_snapshot_payload.

Alias queue_entries_for

Re-exported from parrot.knowledge.manuals.catalog.queue_entries_for.

Function register_channel_sender

Register the live or fake sender used by spike_media for channel.

register_channel_sender(channel: str, sender: ChannelSender) -> None

Parameter Type Default Description
channel str
sender ChannelSender

Function spike_figures

Run M6 extraction + M5 pass 2 over each manual; compare against expected.json hand counts.

spike_figures(corpus_dir: Path, *, adapter: Any, expected: dict[str, Any], library: Any | None = None) -> SpikeReport

Parameter Type Default Description
corpus_dir Path
adapter Any
expected dict[str, Any]
library Any | None None

Returns: SpikeReport

Function spike_media

Deliver one presigned figure through the named channel wrappers; record render/send outcome per channel.

spike_media(answer: ProcedureAnswer, *, channels: Sequence[str]) -> SpikeReport

Parameter Type Default Description
answer ProcedureAnswer
channels Sequence[str]

Returns: SpikeReport

Function spike_tips

Add three tips, publish rev B (one renumbered, one reworded, one removed); assert relink outcomes.

revisions are only used to locate the already-ingested manual (by the sha256 of revisions[1]'s bytes): ingesting rev A, publishing it once (so the graph records rev A as the manual's last-seen revision — :meth:ManualGraphLoader.publish_all's relink step only fires when the graph's own memory of the revision differs from the catalog's current one), and then refreshing to rev B is the caller's job (e.g. via :class:~.library.ManualLibrary, exactly as :func:spike_figures already does for the same corpus). This spike only needs the resulting catalog to hold both revisions, then adds the three tips (attached to rev A's steps) and performs the publish that triggers relinking against rev B.

spike_tips(graph_store: Any, catalog: ManualCatalogStore, *, revisions: tuple[Path, Path]) -> SpikeReport

Parameter Type Default Description
graph_store Any
catalog ManualCatalogStore
revisions tuple[Path, Path]

Returns: SpikeReport

Function spike_video

Run M7 alignment; score t_start/t_end precision and coverage per step (deterministic pass reported separately).

spike_video(corpus_dir: Path, *, adapter: Any, expected: dict[str, Any]) -> SpikeReport

Parameter Type Default Description
corpus_dir Path
adapter Any
expected dict[str, Any]

Returns: SpikeReport

Function write_report

Write spike--.json (sorted keys) under root; return the path.

write_report(report: SpikeReport, *, root: Path = REPORT_ROOT) -> Path

Parameter Type Default Description
report SpikeReport
root Path REPORT_ROOT

Returns: Path

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally