Resolution manifests¶
akms.task_context.manifest
¶
Deterministic audit manifests for task-knowledge resolution.
The fingerprint boundary is intentionally narrower than the task JSON. Only
fields consumed by :class:~akms.task_context.resolve.TaskSeeds, current
changed paths, the query role, and resolver/index/graph versions participate.
Execution state such as routing evidence, review results, and completion
metadata must not invalidate retrieval caches.
ResolutionPathSpec
¶
Bases: BaseModel
One normalized path spec exactly as consumed by the resolver.
DeclaredTaskPaths
¶
Bases: BaseModel
Task fields that declare repository paths for exact retrieval.
RetrievalTaskFields
¶
Bases: BaseModel
Non-path task fields consumed by task seed derivation.
ResolutionInputs
¶
Bases: BaseModel
All and only inputs that own a resolution fingerprint.
ResolvedSeedsManifest
¶
Bases: BaseModel
Canonical resolved seed details retained for audit.
ResolutionSelectedNode
¶
Bases: BaseModel
Manifest-safe selection metadata, excluding volatile node data.
ResolutionManifest
¶
Bases: BaseModel
Deterministic record of one task-knowledge resolution.
StaleResolutionManifestError
¶
Bases: ValueError
Raised when current retrieval inputs no longer match a manifest.
Source code in packages/akms/src/akms/task_context/manifest.py
canonicalize_resolution_inputs
¶
canonicalize_resolution_inputs(
*,
task: TaskSeeds | Mapping[str, Any],
agent_role: AgentRole | str,
graph_version: str,
route_index_hash: str,
changed_paths: Sequence[str] | None = None,
resolver_version: str = RESOLUTION_RESOLVER_VERSION,
) -> ResolutionInputs
Extract the explicit retrieval-owned subset of current task inputs.
Source code in packages/akms/src/akms/task_context/manifest.py
fingerprint_resolution_inputs
¶
Return the SHA-256 fingerprint of canonical retrieval inputs.
Source code in packages/akms/src/akms/task_context/manifest.py
compute_resolution_fingerprint
¶
compute_resolution_fingerprint(
*,
task: TaskSeeds | Mapping[str, Any],
agent_role: AgentRole | str,
graph_version: str,
route_index_hash: str,
changed_paths: Sequence[str] | None = None,
resolver_version: str = RESOLUTION_RESOLVER_VERSION,
) -> str
Canonicalize current inputs and return their stable fingerprint.
Source code in packages/akms/src/akms/task_context/manifest.py
create_resolution_manifest
¶
create_resolution_manifest(
*,
task: TaskSeeds | Mapping[str, Any],
resolved_seeds: ResolvedSeeds,
query_result: TaskKnowledgeQueryResult,
agent_role: AgentRole | str,
graph_version: str,
route_index_hash: str,
changed_paths: Sequence[str] | None = None,
resolver_version: str = RESOLUTION_RESOLVER_VERSION,
generated_at: datetime | str | None = None,
) -> ResolutionManifest
Build a validated manifest from resolver and query results.
Source code in packages/akms/src/akms/task_context/manifest.py
canonical_manifest_bytes
¶
Serialize a manifest as compact, sorted-key UTF-8 JSON.
Source code in packages/akms/src/akms/task_context/manifest.py
write_resolution_manifest
¶
write_resolution_manifest(
path: str | Path,
manifest: ResolutionManifest | Mapping[str, Any],
) -> Path
Atomically replace path with a complete canonical manifest.
The temporary file is created in the destination directory, flushed and
fsynced before :func:os.replace, and removed on every failure path. The
destination directory is fsynced after replacement where supported.
Source code in packages/akms/src/akms/task_context/manifest.py
load_resolution_manifest
¶
Read and validate one manifest from disk.
Source code in packages/akms/src/akms/task_context/manifest.py
validate_resolution_manifest
¶
validate_resolution_manifest(
manifest: ResolutionManifest | Mapping[str, Any],
*,
task: TaskSeeds | Mapping[str, Any],
agent_role: AgentRole | str,
graph_version: str,
route_index_hash: str,
changed_paths: Sequence[str] | None = None,
resolver_version: str = RESOLUTION_RESOLVER_VERSION,
) -> ResolutionManifest
Return manifest or raise when current retrieval inputs are stale.
Source code in packages/akms/src/akms/task_context/manifest.py
resolution_manifest_is_stale
¶
resolution_manifest_is_stale(
manifest: ResolutionManifest | Mapping[str, Any],
*,
task: TaskSeeds | Mapping[str, Any],
agent_role: AgentRole | str,
graph_version: str,
route_index_hash: str,
changed_paths: Sequence[str] | None = None,
resolver_version: str = RESOLUTION_RESOLVER_VERSION,
) -> bool
Return whether current retrieval inputs invalidate manifest.