Repository navigation
API Reference parrot.tools.working_memory.task_memory.models
Domain models for recoverable task memory (FEAT-538, Delivery A).
This is a leaf module: it imports stdlib, pydantic and orjson
only. It must never import a concrete backend (PostgreSQL, Redis, a REPL
worker), pandas, or the working-memory toolkit — the dependency runs
the other way. Keeping it leaf-safe is what lets the store, reducer,
observer and tool layers all share one vocabulary without an import cycle.
Everything here follows the specification's §2 Data Models:
- Pydantic v2 models with
schema_version = 1andextra="forbid". - Timezone-aware UTC timestamps; naive datetimes are rejected, never silently localized.
- Runtime identities from stdlib :func:
uuid.uuid4— Python 3.11 rules out assuming a stdlibuuid7and no ULID dependency is introduced. - Bounded collections and text. Exceeding a bound raises the typed
:class:
LimitExceededbefore any mutation is attempted. - Derived state (a task's active/ready step ids) is computed, never persisted as a duplicate list.
.. warning::
Delivery A is not durable. These models describe in-process continuity; durability arrives with Delivery B's PostgreSQL store, blob write-through and crash reconciliation.
Who caused an event (spec §2).
Add a standing constraint.
Attributes:
| Attribute | Type | Description |
|---|---|---|
op |
Literal['add_constraint'] |
Discriminator. |
text |
str |
The constraint. |
Add a step to an existing plan.
Attributes:
| Attribute | Type | Description |
|---|---|---|
op |
Literal['add_step'] |
Discriminator. |
label |
Optional[str] |
Request-local label so that steps added in the same batch can depend on one another before their ids exist. |
title |
str |
Short human-readable label. |
description |
str |
Longer explanation. |
required |
bool |
Whether the task can complete without this step. |
depends_on |
Tuple[str, ...] |
Existing runtime step ids this one depends on. |
depends_on_labels |
Tuple[str, ...] |
Labels of steps added in the same batch. |
completion_policy |
CompletionPolicy |
How the step may be completed. |
Where an artifact version's bytes currently are.
missing/expired describe the payload. Invalidation and
binding_invalid are separate descriptor flags — a stale REPL
binding is not proof that durable bytes disappeared (spec §2).
Read projection of one versioned catalog entry (D1).
Shared by DataFrame (CatalogEntry) and generic (GenericEntry)
entries. Contains no data rows and no raw payload, and building
one never calls compact_summary(), describe() or an arbitrary
object's repr() — recall must stay cheap and must not leak data.
Attributes:
| Attribute | Type | Description |
|---|---|---|
ref |
EvidenceRef |
Artifact identity and version. |
alias |
Optional[str] |
Current working-memory key, when it still has one. |
scope |
TaskScope |
Owning scope. |
task_id |
Optional[str] |
Owning task, when associated. |
producer_call_id |
Optional[str] |
The physical attempt that produced it. |
attribution |
Attribution |
How that attempt was attributed. |
kind |
ArtifactKind |
Evidence type. |
availability |
ArtifactAvailability |
Where the bytes are. |
fingerprint |
Optional[str] |
Canonical content fingerprint, when computable. |
fingerprint_algorithm |
Optional[str] |
Algorithm identity and version, e.g. "blake2b-8/v1". |
evidence_verifiable |
bool |
Whether the fingerprint actually proves content integrity. False for unsupported or nested mutable values — a computable fingerprint over a nested object is not integrity proof. |
invalidated |
bool |
Whether this version's evidence has been invalidated. |
binding_invalid |
bool |
Whether its REPL binding is stale. Independent of availability: a stale binding does not mean the durable payload disappeared. |
byte_size |
Optional[int] |
Recorded payload size in bytes. |
shape |
Optional[Tuple[int, ...]] |
Captured shape, e.g. (rows, cols). |
schema_summary |
Optional[Dict[str, Any]] |
Bounded captured schema description. |
storage_ref |
Optional[str] |
Backend storage reference, when persisted. |
repl_binding |
Optional[ReplBinding] |
Current REPL binding, when one exists. |
created_at |
datetime |
When this version was registered. |
invalidated_at |
Optional[datetime] |
When it was invalidated, if it was. |
Evidence type of an artifact version.
Only DATAFRAME, JSON and TEXT are supported evidence:
they have a reproducible canonical fingerprint. BINARY and
OBJECT can be catalogued but never carry a verified fingerprint.
Attributes:
| Attribute | Type | Description |
|---|---|---|
is_supported_evidence |
bool |
Whether this kind can produce a verifiable fingerprint. |
Payload for artifact_registered / artifact_invalidated.
Attributes:
| Attribute | Type | Description |
|---|---|---|
kind |
Literal['artifact'] |
Discriminator. |
ref |
EvidenceRef |
The exact artifact version. |
alias |
Optional[str] |
The working-memory key it was published under. |
artifact_kind |
Optional[ArtifactKind] |
Evidence type. |
availability |
Optional[ArtifactAvailability] |
Where its bytes are. |
fingerprint |
Optional[str] |
Canonical content fingerprint, when computable. |
fingerprint_algorithm |
Optional[str] |
Algorithm identity and version. |
evidence_verifiable |
bool |
Whether the fingerprint actually proves content integrity. False for nested mutable or otherwise unsupported values, even when a fingerprint was computable. |
byte_size |
Optional[int] |
Recorded payload size. |
reason |
Optional[str] |
Why it was invalidated, when it was. |
How an invocation was attributed to a step (D3).
Attribution never completes a step; it only records what the runtime could truthfully say about which step a call belonged to.
Typed outcome of one physical dispatch attempt.
NOT_EXECUTED covers the manager's early returns (unknown tool,
guard denial, authorization required): the dispatch was unsuccessful
but no tool body ran. UNKNOWN covers a started call whose terminal
result could not be established — it is never automatically retried.
Attributes:
| Attribute | Type | Description |
|---|---|---|
is_resolved |
bool |
Whether this outcome settles the attempt's disposition. |
How a step is allowed to be completed.
How a step is permitted to be marked complete.
Attributes:
| Attribute | Type | Description |
|---|---|---|
mode |
CompletionMode |
validated runs every named validator and binds every expected output to an exact artifact version. agent_asserted requires at least one accessible evidence reference plus the required note, and is always labeled as the weaker source. |
validators |
Tuple[str, ...] |
Code-registered validator names. Unknown names are rejected by the service, which owns the registry. |
expected_outputs |
Tuple[str, ...] |
Aliases that must resolve to exact artifact versions at completion time. |
require_note |
bool |
Whether a completion note is mandatory. Always True per spec §2 — kept explicit rather than implied. |
How a step actually was completed.
Recall always labels AGENT_ASSERTED as the weaker source.
One standing constraint on a task.
Attributes:
| Attribute | Type | Description |
|---|---|---|
constraint_id |
str |
Runtime identity. |
text |
str |
The constraint itself. |
active |
bool |
Whether it still applies. Deactivated constraints are retained for history rather than deleted. |
revision |
int |
Task revision at which this constraint last changed. |
A pagination cursor was malformed, out of scope, or out of bounds.
Retire a constraint without deleting it.
Attributes:
| Attribute | Type | Description |
|---|---|---|
op |
Literal['deactivate_constraint'] |
Discriminator. |
constraint_id |
str |
The constraint to retire. |
reason |
Optional[str] |
Why. |
A recorded decision affecting the task.
Attributes:
| Attribute | Type | Description |
|---|---|---|
decision_id |
str |
Runtime identity. |
text |
str |
What was decided. |
reason |
str |
Why. |
actor |
Actor |
Who decided. |
affected_step_ids |
Tuple[str, ...] |
Steps the decision bears on. |
revision |
int |
Task revision at which it was recorded. |
active |
bool |
Whether it still stands. Superseded decisions are retained. |
Payload for decision_recorded.
Attributes:
| Attribute | Type | Description |
|---|---|---|
kind |
Literal['decision'] |
Discriminator. |
decision_id |
str |
Identity of the recorded decision. |
text |
str |
What was decided. |
reason |
str |
Why. |
affected_step_ids |
Tuple[str, ...] |
Steps the decision bears on. |
active |
bool |
Whether the decision stands or retires an earlier one. |
Payload for tracking_degraded.
Recorded when best-effort tracking is explicitly enabled and a write could not be persisted. It is a truthful gap marker — it never invents the events that were lost.
Attributes:
| Attribute | Type | Description |
|---|---|---|
kind |
Literal['degraded'] |
Discriminator. |
component |
str |
What degraded (journal, tee, association…). |
detail |
str |
Human-readable explanation. |
recovered |
bool |
Whether the gap was later reconciled. |
Every journal event type (spec §2).
The list carries forward the proposal's events and adds the explicit
task_blocked, step_cancelled and retention_scheduled
variants for transitions that were otherwise unrepresented.
Supersession is recorded inside plan_updated.
Attributes:
| Attribute | Type | Description |
|---|---|---|
is_reserved |
bool |
Whether this event may use the reserved journal headroom. Terminal, recovery and retention events must remain appendable even when the ordinary journal cap is exhausted (spec §2 Retention), so foreground work is refused before they are. |
An immutable reference to one exact artifact version.
Bare aliases are rejected at the journal boundary: evidence must name
artifact_id@version so that overwriting an alias later cannot
retroactively change what a completed step proved.
Attributes:
| Attribute | Type | Description |
|---|---|---|
artifact_id |
str |
Stable identity of the artifact. |
version |
int |
1-based version number within that identity. |
Parse a canonical artifact_id@version string.
parse(value: str) -> 'EvidenceRef'
| Parameter | Type | Default | Description |
|---|---|---|---|
value |
str |
The reference text. |
Returns: 'EvidenceRef' — The parsed reference.
Raises:
-
ValueError— Ifvalueis a bare alias or otherwise malformed. A bare alias is rejected deliberately — it is mutable, and mutable aliases are not evidence.
A step in an initial plan, addressed by a request-local label.
An initial plan cannot reference runtime step ids because none exist yet. Labels are resolved to runtime ids before anything is appended, so a malformed initial plan is rejected without mutating the task.
Attributes:
| Attribute | Type | Description |
|---|---|---|
label |
str |
Request-local label, unique within this request. |
title |
str |
Short human-readable label. |
description |
str |
Longer explanation. |
required |
bool |
Whether the task can complete without this step. |
depends_on_labels |
Tuple[str, ...] |
Labels of steps this one depends on. Resolved to runtime ids by the service. |
completion_policy |
CompletionPolicy |
How the step may be completed. |
One physical dispatch attempt, captured once by the observer (D5).
invocation is the existing compaction
:class:~parrot.memory.compaction.models.ToolInvocation — preserved
unchanged as the shared normalized payload. Correlation, cancellation
and unknown outcomes live here, not as new members of that model's
enum, because the same record feeds both the journal and
ConversationTurn.tool_invocations.
The dataclass is kept as an opaque object rather than re-declared as a Pydantic model, so this module stays leaf-safe and the compaction serializer keeps ownership of its own shape.
Attributes:
| Attribute | Type | Description |
|---|---|---|
call_id |
str |
Identity of this physical attempt. |
attempt |
int |
1-based attempt number. |
parent_call_id |
Optional[str] |
Parent aggregate call, when nested. A parent is distinguishable from its children and is not counted as a second execution of each child. |
tool_name |
str |
The dispatched tool. |
context |
TaskContext |
Frozen task context captured at dispatch. |
outcome |
Optional[CallOutcome] |
Typed outcome of the attempt. |
executed |
bool |
Whether a tool body actually ran. |
error |
Optional[str] |
Condensed, redacted error text. |
elapsed_ms |
Optional[int] |
Wall-clock duration. |
started_at |
datetime |
When the attempt began. |
finished_at |
Optional[datetime] |
When it terminated, if it did. |
artifact_receipts |
Tuple[EvidenceRef, ...] |
Artifact versions this attempt produced. |
invocation |
Optional[Any] |
The canonical compaction ToolInvocation, or None before the terminal result is known. |
degraded |
bool |
Whether tracking for this attempt is degraded. |
terminal_event_type |
Optional[EventType] |
The journal event type this attempt's outcome maps to. |
One immutable entry in a task's journal — the source of truth (D6).
Attributes:
| Attribute | Type | Description |
|---|---|---|
event_id |
str |
Globally unique runtime identity. The store deduplicates on this before allocating a sequence number: an identical redelivery is a no-op, and reuse with a different payload is rejected. |
task_id |
str |
The task this event belongs to. |
seq |
int |
Backend-assigned contiguous sequence. 0 means "not yet appended" — the backend, not the caller, allocates it. |
occurred_at |
datetime |
Timezone-aware UTC timestamp. |
event_type |
EventType |
What happened. |
actor |
Actor |
Who caused it. |
turn_id |
Optional[str] |
The conversation turn it happened in. |
plan_revision |
int |
Plan revision in force when it happened. |
step_id |
Optional[str] |
Step correlation, when known. |
call_id |
Optional[str] |
Physical attempt correlation, when applicable. |
parent_call_id |
Optional[str] |
Parent aggregate (e.g. a plan node) when nested. |
attribution |
Attribution |
How the step correlation was established. |
payload |
EventPayload |
The typed, bounded payload. |
A bounded field or collection exceeded its configured limit.
Raised before any mutation is attempted, so a rejected command leaves the task exactly as it was.
| Parameter | Type | Default | Description |
|---|---|---|---|
field |
str |
Name of the offending field or collection. | |
limit |
int |
The configured bound. | |
actual |
int |
The observed size. | |
detail |
str |
'' |
Optional extra explanation. |
Attributes:
| Attribute | Type | Description |
|---|---|---|
field |
Name of the offending field or collection. | |
limit |
The configured bound. | |
actual |
The observed size. |
Initial configurable limits from spec §2 Data Models.
These are the hard structural bounds enforced by the models
themselves. Operational thresholds that an operator may tune per
deployment live in :class:~parrot.tools.working_memory.task_memory. config.TaskMemoryConfig instead.
Attributes:
| Attribute | Type | Description |
|---|---|---|
MAX_OPEN_TASKS_PER_SCOPE |
int |
|
MAX_STEPS_PER_TASK |
int |
|
MAX_ACTIVE_CONSTRAINTS |
int |
|
MAX_ACTIVE_DECISIONS |
int |
|
MAX_STEP_DEPENDENCIES |
int |
|
MAX_STEP_EVIDENCE_REFS |
int |
|
MAX_IDENTIFIER |
int |
|
MAX_REASON |
int |
|
MAX_SCHEMA_SUMMARY_BYTES |
int |
|
MAX_EVENT_PAYLOAD_BYTES |
int |
|
MAX_GOAL |
int |
|
MAX_CONSTRAINT_TEXT |
int |
|
MAX_STEP_TITLE |
int |
|
MAX_STEP_DESCRIPTION |
int |
|
MAX_DECISION_TEXT |
int |
|
MAX_HINT_TEXT |
int |
|
MAX_POLICY_VALIDATORS |
int |
|
MAX_POLICY_EXPECTED_OUTPUTS |
int |
|
MAX_CURSOR |
int |
Type: Dict[EventType, str]
An ordered batch of plan changes, validated before any is applied.
Dependencies, criteria and inputs are validated across the whole batch first; a batch that would produce a cycle, a duplicate id or a missing dependency is rejected in full.
Attributes:
| Attribute | Type | Description |
|---|---|---|
changes |
Tuple[PlanChange, ...] |
The operations to apply, in order. |
is_empty |
bool |
Whether the batch contains no operations. |
A constraint as recorded in a plan_updated event.
Attributes:
| Attribute | Type | Description |
|---|---|---|
constraint_id |
str |
Runtime identity, already resolved by the service. |
text |
str |
The constraint. |
The fields a plan_updated event changes on an existing step.
None means "leave unchanged" — the patch records exactly what the
revision altered, so replay reproduces the same result without
needing the pre-image.
Attributes:
| Attribute | Type | Description |
|---|---|---|
step_id |
str |
The step to update. Identities are immutable. |
title |
Optional[str] |
New title, when it changed. |
description |
Optional[str] |
New description, when it changed. |
required |
Optional[bool] |
New required flag, when it changed. |
depends_on |
Optional[Tuple[str, ...]] |
Replacement dependency list, when it changed. |
completion_policy |
Optional[CompletionPolicy] |
Replacement policy, when it changed. |
A step as recorded in a plan_updated event.
The journal is the source of truth (D6), so a plan event must carry enough to reconstruct the step. An id-only payload would make the projection, not the journal, the real source of truth — replay could not rebuild a step it had never seen defined.
Attributes:
| Attribute | Type | Description |
|---|---|---|
step_id |
str |
Runtime identity, already resolved by the service. |
title |
str |
Short human-readable label. |
description |
str |
Longer explanation. |
required |
bool |
Whether the task can complete without this step. |
depends_on |
Tuple[str, ...] |
Runtime step ids this one depends on. |
completion_policy |
CompletionPolicy |
How the step may be completed. |
Payload for plan_updated.
Supersession is recorded here rather than as its own event type, so one plan revision is one event.
The payload carries full step and constraint definitions, not just ids, because the journal is the source of truth: a reducer replaying from an empty state must be able to rebuild the plan.
Attributes:
| Attribute | Type | Description |
|---|---|---|
kind |
Literal['plan_update'] |
Discriminator. |
added_steps |
Tuple[PlanStepSpec, ...] |
Steps introduced by this revision, in order. |
updated_steps |
Tuple[PlanStepPatch, ...] |
Patches applied to existing steps. |
superseded_step_ids |
Tuple[str, ...] |
Steps retired by this revision. They keep their evidence and history and never satisfy a dependent's readiness afterwards. |
added_constraints |
Tuple[PlanConstraintSpec, ...] |
Constraints introduced. |
updated_constraints |
Tuple[PlanConstraintSpec, ...] |
Constraints reworded. |
deactivated_constraint_ids |
Tuple[str, ...] |
Constraints retired. Retained for history rather than deleted. |
plan_complete |
Optional[bool] |
New value of the plan-complete flag, when set. |
reason |
Optional[str] |
Why the plan changed. |
added_step_ids |
Tuple[str, ...] |
Ids of the steps this revision introduced. |
updated_step_ids |
Tuple[str, ...] |
Ids of the steps this revision patched. |
added_constraint_ids |
Tuple[str, ...] |
Ids of the constraints this revision introduced. |
touched_step_ids |
Tuple[str, ...] |
Every step id this revision added, patched or superseded. |
is_empty |
bool |
Whether this revision changes nothing at all. |
A plan change was rejected: cycle, duplicate id, missing dependency, or illegal status.
An event could not be reduced: malformed, unsupported, or out of order.
A live binding of an artifact version into a REPL worker.
A PID alone is not a generation identity: a recycled worker with the same PID would be treated as the same generation, so the worker's own session/generation id is what makes a binding checkable.
Attributes:
| Attribute | Type | Description |
|---|---|---|
worker_session_id |
str |
Identity of the worker process generation. |
worker_generation |
int |
Monotonic generation counter within a session. |
variable_name |
str |
Name the artifact is bound to inside the worker. |
ref |
EvidenceRef |
The exact artifact version bound. |
The agent's own note about what to do next.
stale is derived, not authored: any later event touching the
hint's step, that step's dependencies, or its evidence marks it
stale. The reducer sets it; nothing else should.
Attributes:
| Attribute | Type | Description |
|---|---|---|
text |
str |
The next action. |
step_id |
Optional[str] |
Optional step the hint refers to. |
actor |
Actor |
Who recorded it. |
revision |
int |
Task revision at which it was recorded. |
stale |
bool |
Whether later events have invalidated it. |
Payload for resume_hint_updated.
Attributes:
| Attribute | Type | Description |
|---|---|---|
kind |
Literal['resume_hint'] |
Discriminator. |
text |
str |
The next action. |
step_id |
Optional[str] |
Optional step the hint refers to. |
Payload for retention_scheduled.
Retention appends its intent before doing destructive work, so the intent is auditable even though terminal deletion necessarily removes the journal that recorded it (spec §2 Retention).
Attributes:
| Attribute | Type | Description |
|---|---|---|
kind |
Literal['retention'] |
Discriminator. |
policy |
str |
Which retention rule fired. |
action |
str |
What it intends to do. |
due_at |
Optional[datetime] |
When the action becomes due. |
target_refs |
Tuple[EvidenceRef, ...] |
Artifact versions the action targets. |
archive_uri |
Optional[str] |
Where the archive will be written, when configured. |
An expected_revision did not match the task's current revision.
| Parameter | Type | Default | Description |
|---|---|---|---|
task_id |
str |
The task the command targeted. | |
expected |
int |
The revision the caller believed was current. | |
current |
int |
The task's actual revision. |
Attributes:
| Attribute | Type | Description |
|---|---|---|
task_id |
The task the command targeted. | |
expected |
The revision the caller believed was current. | |
current |
The task's actual revision. |
Type: int
A read or write crossed a bot/user/session boundary.
Declare the plan complete (or incomplete again).
Attributes:
| Attribute | Type | Description |
|---|---|---|
op |
Literal['set_plan_complete'] |
Discriminator. |
plan_complete |
bool |
The new flag value. |
Payload for a step-level transition.
Covers step_started/blocked/completed/failed/
reopened/cancelled.
Attributes:
| Attribute | Type | Description |
|---|---|---|
kind |
Literal['step'] |
Discriminator. |
step_id |
str |
The step that transitioned. |
status |
StepStatus |
The status it moved to. |
evidence_refs |
Tuple[EvidenceRef, ...] |
Exact artifact versions bound at completion. |
completion_source |
Optional[CompletionSource] |
How it was completed, when it was. |
note |
Optional[str] |
The completion or transition note. |
reason |
Optional[str] |
Why it blocked or failed (e.g. upstream_reopened). |
validator_results |
Tuple[Tuple[str, bool], ...] |
Recorded validator outcomes. Replay consumes these; it never re-runs a validator. |
Lifecycle state of a plan step (spec §2).
Attributes:
| Attribute | Type | Description |
|---|---|---|
is_terminal |
bool |
Whether this step will not transition again on its own. |
Retire a step without deleting it.
A removed step becomes superseded and keeps its evidence and
history. Superseded steps never satisfy a dependent's readiness.
Attributes:
| Attribute | Type | Description |
|---|---|---|
op |
Literal['supersede_step'] |
Discriminator. |
step_id |
str |
The step to retire. |
reason |
Optional[str] |
Why it was retired. |
replaced_by_label |
Optional[str] |
Label of the step replacing it, when the same batch adds one. |
Immutable per-invocation snapshot of the turn's task context (D3).
A frozen snapshot is taken at each dispatch. A later declaration does not retroactively change an earlier dispatch's snapshot — attribution is never guessed after the fact.
Attributes:
| Attribute | Type | Description |
|---|---|---|
scope |
TaskScope |
Trusted runtime scope. |
task_id |
Optional[str] |
The selected task, when one is selected. |
plan_revision |
int |
Plan revision in force at dispatch. |
turn_id |
Optional[str] |
The conversation turn. |
declared_step_ids |
Tuple[str, ...] |
Steps declared for this turn at dispatch time. Zero gives task-level none; exactly one gives declared; more than one gives task-level ambiguous. |
parent_call_id |
Optional[str] |
Parent aggregate call, when nested. |
plan_run_id |
Optional[str] |
Explicit plan-run correlation. |
plan_node_id |
Optional[str] |
Explicit plan-node correlation. A plan node id is not automatically a domain step id. |
plan_item_index |
Optional[int] |
Fan-out index within a plan node. |
plan_attempt |
Optional[int] |
Attempt number within the plan node's retry policy. |
mapped_step_id |
Optional[str] |
Step id an explicit plan-to-step mapping resolved to. Present only when such a mapping was configured. |
attribution |
Attribution |
Resolve this snapshot's attribution. An explicit plan-to-task-step mapping overrides the declaration count. Without one, an unmapped plan call stays task-level with plan provenance rather than being attributed to a guessed step. |
attributed_step_id |
Optional[str] |
The step this invocation is attributed to, if exactly one. Returns None for none, ambiguous and unmapped plan calls — all three are task-level, and attribution never completes a step regardless. |
Payload for a task-level transition.
Covers task_started/paused/resumed/blocked/
completed/failed/cancelled.
Attributes:
| Attribute | Type | Description |
|---|---|---|
kind |
Literal['task_lifecycle'] |
Discriminator. |
status |
TaskStatus |
The status the task moved to. |
goal |
Optional[str] |
The goal, recorded on task_started. |
reason |
Optional[str] |
Why the transition happened. |
Base class for every task-memory domain error.
Durable task memory could not persist a required record.
Raised before execution when a durable tool_started cannot be
written (D8). Best-effort operation requires explicit opt-in and
reports tracking_degraded instead.
Trusted runtime identity every read and write is checked against.
Supplied by the runtime, never by a tool argument — a model-authored
scope would be a cross-user read primitive. chatbot_id is the
bot's stable memory_key_id, so attribution and storage location
always agree.
Attributes:
| Attribute | Type | Description |
|---|---|---|
chatbot_id |
str |
The bot's stable memory_key_id. |
user_id |
str |
Owner of the conversation. |
session_id |
str |
The conversation session. |
Return a collision-safe encoded key for this scope.
Components are percent-encoded so that a value containing the separator cannot forge a different scope's key.
cache_key() -> str
Returns: str — An opaque, stable, collision-safe string.
Whether other is exactly this scope.
matches(other: 'TaskScope') -> bool
| Parameter | Type | Default | Description |
|---|---|---|---|
other |
'TaskScope' |
The scope to compare against. |
Returns: bool — True when every component is equal.
The pure reducer projection of a task's journal (D6).
The journal is the source of truth; this is a derived, versioned view
of it. Active and ready step ids are computed properties, never
persisted fields — a stored duplicate would be a second source of
truth that could disagree with steps.
Attributes:
| Attribute | Type | Description |
|---|---|---|
task_id |
str |
Runtime identity. |
scope |
TaskScope |
The trusted scope this task belongs to. |
goal |
str |
What the task is trying to achieve. |
constraints |
Tuple[Constraint, ...] |
Standing constraints, active and retired. |
status |
TaskStatus |
Task lifecycle state. |
plan_complete |
bool |
Whether the plan is declared complete. A task cannot complete while this is False. |
plan_revision |
int |
Advances only on a plan change. |
revision |
int |
Advances on every accepted state-changing batch. |
steps |
Tuple[TaskStep, ...] |
The plan, in insertion order. |
decisions |
Tuple[Decision, ...] |
Recorded decisions, active and retired. |
resume_hint |
Optional[ResumeHint] |
The current hint, if any. |
created_at |
datetime |
When the task was started. |
updated_at |
datetime |
When it last changed. |
terminal_at |
Optional[datetime] |
When it reached a terminal status, if it has. |
last_event_seq |
int |
Highest journal sequence folded into this state. |
reducer_version |
int |
Version of the reducer that produced it. |
steps_by_id |
Dict[str, TaskStep] |
Return the plan indexed by step id. |
active_step_ids |
Tuple[str, ...] |
Ids of steps that are still live work. Derived, never stored: a step is active while it is neither terminal nor failed. failed is included because a failed step remains actionable — failure does not retire it. |
ready_step_ids |
Tuple[str, ...] |
Ids of pending steps whose dependencies are all completed. Derived, never stored. Superseded, failed and blocked dependencies do not satisfy readiness (spec §2 Reducer Rules) — only completed does. |
active_constraints |
Tuple[Constraint, ...] |
The constraints that still apply. |
active_decisions |
Tuple[Decision, ...] |
The decisions that still stand. |
can_complete |
bool |
Whether the completion guard would currently pass. A task completes only with plan_complete=True and every required, non-superseded step completed. An exhausted partial plan stays active and reports plan_incomplete. |
Lifecycle state of a task (spec §2).
Attributes:
| Attribute | Type | Description |
|---|---|---|
is_terminal |
bool |
Whether this status accepts no further ordinary mutation. |
One step in a task's plan.
Attributes:
| Attribute | Type | Description |
|---|---|---|
step_id |
str |
Runtime identity. Immutable once created. |
title |
str |
Short human-readable label. |
description |
str |
Longer explanation of what the step must achieve. |
required |
bool |
Whether the task can complete without this step. |
depends_on |
Tuple[str, ...] |
Step ids that must be completed before this one is ready. Superseded, failed or blocked dependencies do not satisfy readiness. |
status |
StepStatus |
Current lifecycle state. |
completion_policy |
CompletionPolicy |
How this step may be completed. |
evidence_refs |
Tuple[EvidenceRef, ...] |
Exact artifact versions bound as evidence. |
attempt_count |
int |
Physical attributed attempts, counted once each on their terminal event. |
blocked_reason |
Optional[str] |
Why the step is blocked, when it is. |
created_revision |
int |
Task revision at which the step was added. |
updated_revision |
int |
Task revision at which it last changed. |
completion_source |
Optional[CompletionSource] |
How it was actually completed, when it was. |
completion_note |
Optional[str] |
The note recorded at completion. |
Payload for a tool-call lifecycle event.
Covers tool_started/succeeded/failed/cancelled/
outcome_unknown.
Attributes:
| Attribute | Type | Description |
|---|---|---|
kind |
Literal['tool_call'] |
Discriminator. |
call_id |
str |
Identity of this physical attempt. |
tool_name |
str |
The dispatched tool. |
attempt |
int |
1-based attempt number. |
executed |
bool |
Whether a tool body actually ran. False for an unknown tool, a guard denial or an authorization requirement. |
outcome |
Optional[CallOutcome] |
Typed outcome, absent on tool_started. |
error |
Optional[str] |
Condensed, redacted error text. |
elapsed_ms |
Optional[int] |
Wall-clock duration. |
artifact_refs |
Tuple[EvidenceRef, ...] |
Artifact versions produced by this attempt. |
counted |
bool |
Whether this event is the one that increments the step's attempt count. Exactly one terminal event per physical attempt sets it. |
A completion policy named a validator that is not code-registered.
Reword an existing constraint.
Attributes:
| Attribute | Type | Description |
|---|---|---|
op |
Literal['update_constraint'] |
Discriminator. |
constraint_id |
str |
The constraint to update. |
text |
str |
Its new text. |
Update an existing step's mutable fields.
Completed criteria and inputs cannot be edited in place: the service rejects such an update and requires an explicit reopen instead.
Attributes:
| Attribute | Type | Description |
|---|---|---|
op |
Literal['update_step'] |
Discriminator. |
step_id |
str |
The step to update. Immutable identity. |
title |
Optional[str] |
New title, when changing it. |
description |
Optional[str] |
New description, when changing it. |
required |
Optional[bool] |
New required flag, when changing it. |
depends_on |
Optional[Tuple[str, ...]] |
Replacement dependency list, when changing it. |
completion_policy |
Optional[CompletionPolicy] |
Replacement policy, when changing it. |
Return a fresh runtime identity.
new_id() -> str
Returns: str — A uuid4 hex string. Deliberately stdlib: Python 3.11 has no uuid7 and this feature introduces no ULID dependency.
Return the canonical serialized UTF-8 size of value in bytes.
Payload limits are byte limits, not Pydantic dictionary-item counts
(spec §2). orjson with sorted keys is the canonical serializer
used throughout the feature.
serialized_bytes(value: Any) -> int
| Parameter | Type | Default | Description |
|---|---|---|---|
value |
Any |
Any JSON-serializable value. |
Returns: int — Length in bytes of the canonical encoding.
Raises:
-
LimitExceeded— If the value cannot be serialized at all, which makes its size unbounded and therefore unacceptable.
Return the current time as a timezone-aware UTC datetime.
utc_now() -> datetime
Returns: datetime — datetime.now(timezone.utc).
- 1. MCP Server — exposing tools as a service
- 2. A2A — exposing agents and orchestrators as services
- 3. Toolkits for third party services and Cloud Security composition
- 4. Interaction surface — WebSockets, audio, integrations
- 5. Hardening — anti prompt injection, PBAC and tool gating
- 6. Cross cutting concerns and reference deployment
- 7. AgentCrew — Sequential, Parallel, Flow and Loop execution
- 8. AgentsFlow — DAG first orchestration with per node FSM
- 9. Ontologic RAG — graph first retrieval, intent routing & multi tenant knowledge
- 10. Observability — OpenLIT + OpenTelemetry
- Class Catalog by Module
- Module level Functions Catalog
- AI Parrot — Exposure, Interoperability & Hardening Architecture
- Agent Mesh
- AgentService — Standalone Runtime for Autonomous Agents
- AbstractClient: The Provider Client Family
- Anthropic client
- Bedrock Mantle Client
- TypeSafe System One Client (
JevClient) - Meta Model API Client (Muse Spark)
- OpenAI Compatible Client Base (
OpenAIBaseClient) - Per Loop LLM Client Cache
- Question Token Budgets (Bedrock Converse, Nova text, Bedrock Mantle)
- Agent Configure Lifecycle
- AgentTalk Integration Guide
- Agent Configuration via
agents.yaml - AgentFactory HTTP API
- Agent Studio — API Reference
- Agent CLI Daemon (agentd)
- FirefliesInsightsAgent
- Follow up Suggestion Chips (FEAT 752)
- Agents and Chatbots: The Bot Class Hierarchy
- Agent Studio — database storage (host guide)
- Ephemeral User Agents — Frontend Integration Handoff
parrot agent— Agent Terminal Workspace- Crew Handler
- Database Agent
- Running the CVE Experts
- Domain Experts (FEAT 778)
- FEAT 437
- Technical Voice Guide (AgentTalk Voice) for Frontend
- AgentDashboard — A2UI v1.0 Technical Reference for
navigator frontend next - Semantic UI Model → Adaptive Cards (FEAT 303)
- Exposing an AI Parrot Agent as an MCP Server
- AgentCrew User Guide
- AgentsFlow User Guide
- Crew Definition Storage
- A2UI Agent Functions Runtime — the v1.0 RPC leg (FEAT 469)
- Capabilities of an AI Parrot Analytical Agent (PandasAgent)
- Agent Security Guardrails (FEAT 761)
- SpawnSubAgentTool
- Testagent
- Agentic End to End Testing (FEAT 581)
- Uiagent
- WebAgent — Browser Interaction via Chrome DevTools
- WebNavigatorAgent — Catalogued Web Navigation on Your Chrome Profile
- ExecutionMemory Integration Guide
- Agent Brain
- Agent Memory
- Conversation History Ownership
- Conversation Memory Subsystem Overview
- Dream Cycle — episodic → wiki brain consolidation
- Durable Conversation Memory
- Memory Dynamics
- Per Turn Conversation Compaction
- Recoverable Task Memory (FEAT 538)
- Task Memory — Phase 0 Integration Map (FEAT 538 / TASK 2970)
- User Memory
- Bookstore Agentic Retrieval
- Bookstore in Codex
- Bookstore Conceptual Relations — the book graph (FEAT 533)
- Bookstore notebooks
- Contracts catalog performance (FEAT 539, AC14)
- Contracts pilot acceptance — Bob's twelve cases (FEAT 539, AC15)
- Contracts Card & Ontology (FEAT 539)
- Luau parser resource policy (FEAT 532 TASK 2896)
- Glossary of Terms (FEAT 917)
- GraphIndex core seams (FEAT 540)
- GraphIndex — Structured Knowledge Graph Indexing
- Local Knowledge Base
- Procedure Graph — Assembly Manuals (FEAT 601)
- Ontology backend programme
- Ontology vocabulary store
- PageIndex Agentic Retrieval and Citations
- PageIndex Generation Publication
- PageIndex Layout Structure Builder
- PageIndex Local MCP Toolkit
- PageIndex Segment Store
- PageIndex Tree Optimizer
- PageIndex — Tree Based RAG for Document Retrieval
- ArxivTool for AI Parrot
- Accounting metrics layer
- Tool Result Compression Pipeline (FEAT 380)
- DatasetManager Implementation Walkthrough
- FredAPITool Documentation
- EmployeesTool Employee Hierarchy Tool for AI Parrot
- HoobaToolkit
- Jira text templates (JiraToolkit)
- Expose Toolkits as Local MCP (
parrot mcp local) - MultiStoreSearch Toolkit — Multi Origin Retrieval for Agents
- Supervised Obscura Browser Integration
- OdooHelpdeskToolkit — Softhealer helpdesk on Odoo 19
- OdooToolkit Capabilities
- QuerysourceToolkit
- ReadOnlyRepoToolkit (FEAT 484)
- PythonREPLTool Sandbox: Worker Process Execution Model
- Research Tools for Agents
- gVisor Installation Guide for AI Parrot Secure Sandbox
- SDD Sandbox — OS Setup
- Governed semantic layer
- Tool optimizations for Claude Code and Codex (FEAT 543)
- AbstractTool Clone Method
- Toolbar API Documentation
- AudioNoteCaptureToolkit
- ExecutionPlanToolkit — Reference
- Host toolkits for Agent Studio
- Infographic Authoring for Data Agents (FEAT 326)
- InfographicToolkit — Reference
- Tool System Internals: Tools, Toolkits and ToolManager
- AI Parrot Tools Documentation
- What If Scenario Analysis
- Workday worker history
- DecisionFlowNode Usage Guide
- Multi Agent Orchestration: AgentCrew and AgentsFlow
- Docker Tool Executor & Execution Policy
- Generic Gate Host
- HeartbeatManager — Per Agent Autonomous Heartbeat Loop
- JobManager
- Node Types Reference
- OrchestratorAgent — Multi Party Conferencing (
confer) - Planogram compliance cycle (perceive → identify → compare)
- Planogram compliance — migrating configurations to the new cycle (FEAT 574, FEAT 612)
- Planogram perception spike — FEAT 574
- Scheduler backends in multi worker deployments
- Thales User Guide
- Per tenant skills (FEAT 707)
- Skill routing and trigger caching
- Skills system: discovery, toolkits and mixin
- Contextual Embedding Headers
- DocumentDB Usage Patterns
- DocumentDB Interface Guide
- DynamoDB Local (docker compose)
- Fully offline local agent with LanceDB (FEAT 542)
- LanceDB vector, full text and hybrid store (FEAT 542)
- Loader Metadata Standard
- Document Loaders for RAG
- Matryoshka Embedding Truncation
- Parent Child Retrieval (Small to Big)
- Storage Backends Guide
- User stores (Redis by default)
- Vector Stores and Embeddings Reference
- Vector Store Handler — API Reference
- A2A Secure Communication Demo
- Agent as a Local MCP Server (parrot toolkits install agent)
- add repository:
- GitHub MCP Installation and Usage
- MCP integration: client, server and agent tools
- Create and configure agent
- Roost — local inter agent sub protocol
- Roost carriers
- Roost performatives, protocols and obligations
- Simple Mcp Server
- SimpleMCPServer Configuration
- API Endpoints Reference
- Admin UI (FEAT 468)
- Infographic Render Endpoint — Reference
- EventBus v2 Configuration Reference (
[bus]/[bus.alerts]) - EventBus v2 Migration Notes (FEAT 310)
- EventBus v2 — Unified Event Fabric (FEAT 310)
- Session file store
- A2UI Dashboard + Widget Renderer — Frontend Build Guide
- Avatar Technical Guide (LiveAvatar Phase A) for Frontend
- Frontend Guide for SvelteKit: LiveAvatar FULL Mode and VoiceBot (FEAT 248)
- DEPRECATED: Native Voice Avatar (LiveAvatar Phase C) Technical Guide for Frontend
- Technical Guide to Structured Artifacts for Frontend
- VoiceBot · VoiceChatHandler · FEAT 245 — Frontend Guide for Realtime Conversation with Agents
- Server Layer: BotManager and HTTP Handlers
- Infographic Handler — Frontend API Contract
- Interactive Artifacts — Frontend API Contract
- Google Drive file manager
- SharePoint & OneDrive file managers
- WhatsApp Integration Implementation Summary
- WhatsApp Integration for AI Parrot
- P3 — parrot admin ui inventory (canvases / A2UI / infographic / builders)
- WhatsApp + AutonomousOrchestrator Integration
- Audio Form Voice Modes — Developer Guide
- Who owns an OAuth2 (3LO) credential
- CommCenter — Bulk Notification Sender (FEAT 417)
- FormDesigner → MS Teams: Adaptive Card renderer and bot submit path (FEAT 551)
- GitHub reviewer
- Google OAuth 2.0 — AI Parrot Integration
- Fireflies Agent Examples
- HITL Tool Call Confirmation (FEAT 235)
- Teams HITL Channel Setup Guide (FEAT 205)
- JiraSpecialist Prompt Layer Stack
- JiraSpecialist — Daily Standup Lanes
- Jira Transition Actions — Activating
TRIGGER_AGENTDispatch - Jupyter Output Mode Documentation
- Knowledge upload from chat (FEAT 647)
- LiveAvatar over your own LiveKit (Cloud or self hosted)
- Matrix Bridges for the AI Parrot Swarm (FEAT 463)
- Matrix Clients for the AI Parrot Swarm (FEAT 463)
- Migration Guide: FEAT 202 — ai parrot integrations
- Connections on Microsoft Teams
- MS Teams Toolkit for AI Parrot
- Nova Sonic Voice Protocol Reference
- Office 365 OAuth 2.0 (Delegated) — AI Parrot Integration
- PR Review Command — Setup Guide
- Queued chat commands
- Runbook — the
issuesnamespace (Jira ticket corpus) - Dev loop kick off from Slack (FEAT 555)
- Telegram Auth Open Mode (webview | browser)
- Telegram connections
- Telegram Bot Integration Guide
- FEAT 536 — VoiceBot Nova Dual Output + LiveAvatar: Real Live Operational Acceptance
- FEAT 537 — Nova VoiceBot avatar broadcast: operational acceptance
- FEAT 537 — Nova PCM → LiveAvatar LITE → LiveKit multi subscriber live gate
- speech_report TTS backends
- Nova VoiceBot avatar broadcast for multiple browsers (FEAT 537)
- 🦜 AI Parrot Voice Chat
- WhisperX Setup Guide for AI Parrot
- A2UI Linked Surfaces (FEAT 598)
- A2UI v1.0 Wire (FEAT 470)
- === D3.js ===
- Backend HTML Design System (FEAT 493)
- FEAT 488
- FormDesigner Audio Renderer
- Form Designer — Autonomous FormSchema Persistence (Standalone Forms)
- Form Designer — Conditional Sections: Pre/Post Dependencies
- FormBuilder — LLM answer plausibility enforcement
- FormDesigner — orphan upload cleanup (FEAT 731)
- FormDesigner — public response controls
- Form Designer — Relational Fields
- Serving FormDesigner forms from a Teams agent
- Form Designer — Unknown Field Capture Policy for Form Submissions
- FormDesigner — validation audit trail
- Infographic Recipes (FEAT 324)
- Inline A2UI Component Routing (FEAT 755)
- Metric Definition Registry (FEAT 756)
- Smart OutputFormatter Documentation
- N4 — navigator api backend inventory (dashboards / widgets / templates / modules / programs)
- P1 — ai parrot HTTP/WS endpoint inventory (report builder lens)
- P2 — ai parrot (Python) UI components, models, renderers, persistence — inventory for a REPORT BUILDER
- P4 — ai parrot prior art for a Report Builder (SDD inventory)
- ai parrot server — Admin / Bots / Studio / misc endpoint inventory
- P1 — ai parrot HTTP/WS endpoint inventory (report builder lens) ( core)
- parrot formdesigner — HTTP/WS endpoint inventory
- Report Builder — ai parrot inventory and analysis
- WeasyPrint 69.0 CSS Support — Empirical Findings
- Identity Capability User Guide
- Layers Reference
- Output Language (FEAT 638)
- PromptBuilder — User Modifiable Variables
- PromptBuilder User Guide
- Delegated OAuth2 connections
- Delegated OAuth2 connections on the web channel — deployment recipe and live harness
- Deterministic Groundedness Scoring
- ONNX Backend for the Prompt Injection Guardrail (FEAT 439)
- PBAC Guardrails — Policy Driven Tool Call Denial (FEAT 406)
- SecurityAdvisor — SOC2 Oriented Read Only Advisory Agent
- User Profile Management
- AI Parrot MCP Server AWS Deployment Guide
- Bot Cleanup Lifecycle
- Business Automation — Operator Runbook
parrot loginand connections- CompanyInfoToolkit
- Per component and per agent LLM defaults (FEAT 796, FEAT 882)
- Answer Accuracy Metrics for the Evaluation Harness (FEAT 652)
- Infographic CSP and Signed URLs — Operations Guide
- Global install: the parrot managed runtime (reference)
- Runbook — the Fireflies Meeting Registry
- Wiki standup briefs — runbook
parrot.finance— the finance satellite- Migration — FEAT 201: ai parrot embeddings
- Migration — FEAT 203: ai parrot server
- FEAT 223 — Structured Artifact Contract: Migration Guide
- FEAT 273 — Legacy output mode deprecations → A2UI
- Migration — FEAT 315: Unified NovaClient for all Amazon Nova models
- Migration — FEAT 421: Client declared tenant in the forms URL
- Migration — FEAT 446: SaaS Auth Hardening (S0 of Parrot Research Cloud)
- Migration — FEAT 473: A2UI v1.0 for STRUCTURED_CHART / STRUCTURED_TABLE / STRUCTURED_MAP
- Migration — FEAT 523: PEP 420 LLM Client Extraction
- Gemini 2.5 retirement (FEAT 798)
- Migration — FEAT 564: Reliable video reels with Gemini Omni and Veo 3.1
- Native Claude sandbox for SDD sessions (FEAT 768)
- Complementary (collaborative) research partner (FEAT 482)
- Dev flow per seat LLM configuration (
DevFlowModelPlan) - Dev loop
novabackend (AWS Bedrock) - sdd worker as orchestrator of parallel sdd coder seats (FEAT 549)
- SDD compaction capability record
- SDD execution optimization — operation and rollout
- Proposals to Reduce SDD Execution Time
- Dev flow / dev loop telemetry accounting
- Language Agnostic Validation Runners (FEAT 709)
- Spec Driven Development in Google Gemini / Antigravity CLI
- Guide to using the SDD slash commands
- AI Parrot Spec Driven Development (SDD) Platform
- SDD on Google Antigravity (agy)
/sdd donecloseout hooks- Decision Audit (FEAT 784)
- SDD experience memory
- SDD Expert Consult
- Ledger outbox (FEAT 758)
- FEAT 580 LSP Pilot — Live Evaluation Results
- SDD LSP research pilot (FEAT 580)
- Necessity Ladder (FEAT 908)
- Procedure Graph
- Test selection in the SDD flow — the Validation Contract (FEAT 699)
- wikitoolkit Cheatsheet
- wikitoolkit inbox
- wikitoolkit lint
- LLM Wiki — an agent maintained knowledge repository
- Schema Plane — Operator Guide (FEAT 600)
- SQLite concurrency for wiki and ledger
- wikitoolkit standup
- WikiToolkit as Claude Code infrastructure
- Authentication uses Navigator Auth
- AbstractClient base changes require a decision
- Clients are memory less
- Configuration uses NavConfig
- Graph backends — retire ArangoDB for PostgreSQL + SurrealDB
- Conversation history has one writer
- HTTP stack uses aiohttp
- LangChain is not part of the stack
- Async code remains non blocking
- Concrete tools live in ai parrot tools