Skip to content

API Reference parrot.knowledge.wiki.experience.models

github-actions[bot] edited this page Dec 2, 2026 · 1 revision

parrot.knowledge.wiki.experience.models

View source

Experience domain schemas.

Class AttestationPayload

Payload attesting to a reviewed lifecycle state for one lesson revision.

Fields:

Field Type Default Description
solution_rev str

Class CommandOutcome

One command execution result, retaining an unknown outcome when needed.

Fields:

Field Type Default Description
command str
ok bool | None
error str ''
observation_id str ''

Attribute EVENT_PAYLOADS

Type: dict[str, type[BaseModel]]

Class EvidencePayload

Payload linking validation or refutation evidence to a lesson revision.

Fields:

Field Type Default Description
solution_rev str
via Literal['trigger_family', 'fix_family', 'rediscovery']

Class ExperienceConfig

Validated runtime limits and lifecycle thresholds for experience memory.

Fields:

Field Type Default Description
enabled bool True
confirm_sessions int 2
quarantine_refutations int 2
graduate_hits int 5
graduate_sessions int 3
brief_max_entries int 5
brief_token_budget int 400
inject_min_score float 0.35
advice_cooldown_seconds int 600
max_triggers_bytes int 262144
max_transcript_tail_bytes int 262144
max_session_pending int 32
pairing_excluded_executables list[str]

Class ExperienceEvent

Canonical redacted event persisted in an append-only experience log.

Fields:

Field Type Default Description
schema_version int 1
event_id str
kind ExperienceEventKind
lesson_id str ''
session str
observation_id str ''
actor str
seat str ''
ts str
payload dict[str, Any]

Attribute ExperienceEventKind

Class FailurePayload

Payload describing the normalized command family and observed failure.

Fields:

Field Type Default Description
executable str
subcommand str
error_signature str
error_excerpt str ''

Class GraduatedPayload

Payload linking a graduated lesson revision to its owning ledger issue.

Fields:

Field Type Default Description
solution_rev str
issue_id str
ledger str

Class InjectionPayload

Payload recording that a lesson was surfaced for a matching failure.

Fields:

Field Type Default Description
solution_rev str
state_at_injection LessonState

Class Lesson

Reduced current lesson state derived from immutable experience events.

Fields:

Field Type Default Description
lesson_id str
draft LessonDraft
solution_rev str
revisions list[str]
tier LessonTier
state LessonState
hits int
validations int
refutations int
sessions int
issue_id str ''
issue_ledger str ''
recorded_by str
recorded_at str

Attribute LessonCategory

Class LessonDraft

Author-supplied candidate lesson accepted from an agent or pairing flow.

Fields:

Field Type Default Description
category LessonCategory 'pitfall'
trigger LessonTrigger
symptom str ''
solution str
fix_example str ''
scope_paths list[str]

Attribute LessonSource

Attribute LessonState

Attribute LessonTier

Class LessonTrigger

Normalized command and error pattern that identifies a reusable lesson.

Fields:

Field Type Default Description
executable str
subcommand str ''
error_signature str ''
error_excerpt str ''
command_example str ''

Alias MAX_EVENT_BYTES

Re-exported from parrot.knowledge.wiki.experience.fastpath.MAX_EVENT_BYTES.

Class RecordedPayload

Payload defining the initial revision, tier, and provenance of a lesson.

Fields:

Field Type Default Description
draft LessonDraft
solution_rev str
tier LessonTier
source LessonSource

Class RetiredPayload

Payload preserving the authored reason that a lesson was retired.

Fields:

Field Type Default Description
reason str

Alias leading_command

Re-exported from parrot.knowledge.wiki.experience.fastpath.leading_command.

Alias normalize_error

Re-exported from parrot.knowledge.wiki.experience.fastpath.normalize_error.

Alias redact

Re-exported from parrot.knowledge.wiki.experience.fastpath.redact.

Function solution_rev_for

Return the eight-character revision id for a redacted solution and fix family.

solution_rev_for(draft: LessonDraft) -> str

Parameter Type Default Description
draft LessonDraft The lesson draft whose solution revision is being identified.

Returns: str — A stable SHA-1 prefix for the normalized solution and parsed fix family.

Function validate_event

Return a canonical event or None when a log record is invalid.

Every text value is redacted before the event identity is recomputed. The private shared-attestation flag deliberately cannot be supplied by JSON.

validate_event(line: Mapping[str, Any]) -> ExperienceEvent | None

Parameter Type Default Description
line Mapping[str, Any] One decoded experience-log line.

Returns: ExperienceEvent | None — The validated event, or None when the envelope, payload, or byte budget is invalid.

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