Task Engine semantic contracts#
This package provides task understanding and declaration validation independently of simulation. TaskSpec owns normative identity and evaluation; shared Task Program, Atomic Skill and Motion modules own execution.
Start with Task Engine for configuration, CLI usage, artifacts, pending bindings, offline display, and runtime handoff.
Task understanding and execution-free semantic graph contracts.
Classes:
One validated, scene-independent interpretation and its audit metadata. |
|
Generate, validate, normalize, and vote on independent task drafts. |
|
One scene-independent semantic E-task contract. |
|
Small Task Engine façade for generation and optional caching. |
Exceptions:
Raised when every independently generated candidate fails validation. |
Functions:
|
Return the stable SHA-256 of one JSON-safe protocol value. |
|
Derive structural scene constraints without classifying reference text. |
|
Derive every success term exclusively from the E-task ontology. |
|
Generate or reuse a TaskSpec from a candidate or candidate set. |
|
Interpret and audit one instruction without reading or grounding a scene. |
|
Return the canonical contract or reject an unknown E-task type. |
|
Convert one validated TaskCandidate into a normative TaskSpec. |
|
Resolve explicit E3 evidence intent and E5 terminal behavior. |
|
Compatibility alias for |
|
Validate the private, non-graph instruction interpretation contract. |
|
Validate source references, scene relations and robot requirements. |
|
Validate complete ordered success terms against an optional draft. |
|
Verify a candidate, its derived declarations and canonical step hash. |
|
Validate candidate voting and source-response accounting. |
|
Validate task identity and the ordered instruction-intent steps. |
- class embodichain.gen_sim.task_engine.InstructionDraftResult[source]#
One validated, scene-independent interpretation and its audit metadata.
Methods:
__init__(intent, model, attempts, ...[, ...])- __init__(intent, model, attempts, latency_seconds, normalizations, terminal_park=())#
- class embodichain.gen_sim.task_engine.TaskAgent[source]#
Generate, validate, normalize, and vote on independent task drafts.
Methods:
__init__(*[, caller, interpreter, services])generate(task_id, instruction[, model, ...])Generate candidates concurrently and retain votes after deduplication.
generate_task_spec(task_id, instruction[, ...])Generate a candidate set and emit its reusable TaskSpec.
- __init__(*, caller=None, interpreter=<function interpret_instruction_draft>, services=None)[source]#
- generate(task_id, instruction, model=None, candidate_count=3, *, services=None)[source]#
Generate candidates concurrently and retain votes after deduplication.
- Return type:
dict[str,Any]
- generate_task_spec(task_id, instruction, model=None, candidate_count=3, *, candidate_id=None, cache=None)[source]#
Generate a candidate set and emit its reusable TaskSpec.
Task Engine remains the owner of interpretation and candidate selection. The returned template contains only normative semantics; concrete Semantic Calls and trajectories remain in the existing planner/runtime path.
- Parameters:
task_id (
str) – Stable task request identifier.instruction (
str) – Natural-language task instruction.model (
str|None) – Optional interpretation model override.candidate_count (
int) – Number of independently generated candidates.candidate_id (
str|None) – Optional candidate to materialize from the set.cache (
TaskSpecCache|None) – OptionalTaskSpecCache-compatible persistence backend.
- Return type:
TaskSpec- Returns:
A validated
embodichain.gen_sim.task_spec.TaskSpec.
- class embodichain.gen_sim.task_engine.TaskContract[source]#
One scene-independent semantic E-task contract.
Methods:
__init__(task_type, semantics, ...)- __init__(task_type, semantics, applicable_intent_fields, source_structure, required_affordances, success_type, scene_affordances, primary_role_field, resource_mode, moves_primary_object, accepts_direct_payloads, direct_payload_relations, accepts_incoming_hold, terminal_success_types)#
- exception embodichain.gen_sim.task_engine.TaskGenerationError[source]#
Raised when every independently generated candidate fails validation.
- class embodichain.gen_sim.task_engine.TaskSpecGenerator[source]#
Small Task Engine façade for generation and optional caching.
Methods:
__init__([cache])generate(candidate_or_set, *[, ...])Generate one template using this generator's cache.
- __init__(cache=None)#
- embodichain.gen_sim.task_engine.canonical_hash(value)[source]#
Return the stable SHA-256 of one JSON-safe protocol value.
- Return type:
str
- embodichain.gen_sim.task_engine.derive_scene_request(draft)[source]#
Derive structural scene constraints without classifying reference text.
- Return type:
dict[str,Any]
- embodichain.gen_sim.task_engine.derive_success_spec(draft)[source]#
Derive every success term exclusively from the E-task ontology.
- Return type:
dict[str,Any]
- embodichain.gen_sim.task_engine.generate_task_spec(candidate_or_set, *, candidate_id=None, cache=None, metadata=None)[source]#
Generate or reuse a TaskSpec from a candidate or candidate set.
- Parameters:
candidate_or_set (
Mapping[str,Any] |dict[str,Any]) – A validatedTaskCandidateor a candidate set returned byTaskAgent.candidate_id (
str|None) – Optional candidate ID when a set contains several votes.cache (
TaskSpecCache|None) – Optional content-addressed cache. A matching entry is loaded after generation and newly generated templates are stored.metadata (
Mapping[str,Any] |None) – Non-semantic generation metadata retained on the template.
- Return type:
TaskSpec- Returns:
A validated, reusable
TaskSpec.
- embodichain.gen_sim.task_engine.interpret_instruction_draft(instruction, *, model=None, caller=None, services=None, _allow_terminal_park=False)[source]#
Interpret and audit one instruction without reading or grounding a scene.
- Return type:
- embodichain.gen_sim.task_engine.task_contract(task_type)[source]#
Return the canonical contract or reject an unknown E-task type.
- Return type:
- embodichain.gen_sim.task_engine.task_spec_from_candidate(candidate, *, metadata=None)[source]#
Convert one validated TaskCandidate into a normative TaskSpec.
The adapter consumes scene references and success semantics, while leaving concrete calls, robot poses, trajectories, and planner choices in the candidate/bundle layer. Candidate IDs and the legacy step hash are kept only in metadata and therefore do not define the reusable semantic hash.
- Return type:
TaskSpec
- embodichain.gen_sim.task_engine.task_success_type(task_type, params=None)[source]#
Resolve explicit E3 evidence intent and E5 terminal behavior.
- Return type:
str
- embodichain.gen_sim.task_engine.task_template_from_candidate(candidate, *, metadata=None)[source]#
Compatibility alias for
task_spec_from_candidate().- Return type:
TaskSpec
- embodichain.gen_sim.task_engine.validate_instruction_intent(value)[source]#
Validate the private, non-graph instruction interpretation contract.
- Return type:
dict[str,Any]
- embodichain.gen_sim.task_engine.validate_scene_request(value)[source]#
Validate source references, scene relations and robot requirements.
- Parameters:
value (
Mapping[str,Any]) – Mapping using this function’s versioned declaration schema.- Return type:
dict[str,Any]- Returns:
A detached scene request retaining its declared task identity.
- Raises:
ValueError – A required field, identity, type or cross-declaration invariant is invalid.
- embodichain.gen_sim.task_engine.validate_success_spec(value, *, draft=None)[source]#
Validate complete ordered success terms against an optional draft.
- Parameters:
value (
Mapping[str,Any]) – Mapping using this function’s versioned declaration schema.draft (
Mapping[str,Any] |None) – Optional source draft whose task identity and derived terms must match.
- Return type:
dict[str,Any]- Returns:
A detached all-clause success declaration; no physical verdict.
- Raises:
ValueError – A required field, identity, type or cross-declaration invariant is invalid.
- embodichain.gen_sim.task_engine.validate_task_candidate(value)[source]#
Verify a candidate, its derived declarations and canonical step hash.
- Parameters:
value (
Mapping[str,Any]) – Mapping using this function’s versioned declaration schema.- Return type:
dict[str,Any]- Returns:
A detached candidate retaining voting and normalization provenance.
- Raises:
ValueError – A required field, identity, type or cross-declaration invariant is invalid.
- embodichain.gen_sim.task_engine.validate_task_candidate_set(value)[source]#
Validate candidate voting and source-response accounting.
- Parameters:
value (
Mapping[str,Any]) – Mapping using this function’s versioned declaration schema.- Return type:
dict[str,Any]- Returns:
A detached candidate set with consistent task and candidate identities.
- Raises:
ValueError – A required field, identity, type or cross-declaration invariant is invalid.
- embodichain.gen_sim.task_engine.validate_task_draft(value)[source]#
Validate task identity and the ordered instruction-intent steps.
- Parameters:
value (
Mapping[str,Any]) – Mapping using this function’s versioned declaration schema.- Return type:
dict[str,Any]- Returns:
A detached draft with normalized intent fields.
- Raises:
ValueError – A required field, identity, type or cross-declaration invariant is invalid.
Image semantic planning#
Interpret a photograph and the complete instruction into a catalog-constrained
Semantic Call graph. The result retains source provenance, task requirements,
visual evidence, raw attempts, and pending runtime bindings. Grounding and
planning each allow one diagnostic repair; failed generation exposes available
audit artifacts through SemanticPlanningError.artifacts.
Generate a full catalog-constrained graph, retaining unresolved bindings. |
|
Failed model attempts with serializable audit artifacts. |
- embodichain.gen_sim.task_engine.image_planning.generate_semantic_task_graph_from_image(image_path, instruction, *, task_id='image_task', model=None, instruction_caller=None, image_caller=None, planning_caller=None, services=None, max_repairs=1)[source]#
Generate a full catalog-constrained graph, retaining unresolved bindings.
- Parameters:
image_path (
str|Path) – Existing PNG/JPEG scene photograph.instruction (
str) – Complete task instruction, never truncated to supported steps.task_id (
str) – Shared task identity.model (
str|None) – Optional Python provider override; the CLI reads GenSim settings.instruction_caller (
Callable[...,Mapping[str,Any]] |None) – Optional structured TaskAgent provider.image_caller (
Callable[...,str] |None) – Optional multimodal completion provider.planning_caller (
Callable[...,str] |None) – Optional text completion provider for semantic planning.services (
GenSimServices|None) – Optional caller-owned run providing interpretation, grounding and semantic-planning roles.max_repairs (
int) – Diagnostic repairs allowed per grounding/planning stage. Each repair re-runs the complete strict validation.
- Return type:
dict[str,Any]- Returns:
JSON artifacts including a canonical graph, catalog snapshot, visual evidence, explicit pending bindings, attempts and phase-specific coverage.
- Raises:
SemanticPlanningError – Generation fails after the allowed repairs.
ValueError – Invalid input image or task request.
- class embodichain.gen_sim.task_engine.image_planning.SemanticPlanningError[source]#
Failed model attempts with serializable audit artifacts.
- Parameters:
message (
str) – The final interpretation, grounding or planning diagnostic.artifacts (
dict[str,Any]) – Available catalog, raw responses and intermediate declarations.
Methods:
__init__(message, artifacts)
|
Generate JSON declarations and an offline graph viewer from a photograph. |
- embodichain.gen_sim.task_engine.cli.main(argv=None, *, services=None, prog='embodichain task-engine')[source]#
Generate JSON declarations and an offline graph viewer from a photograph.
- Parameters:
argv (
Sequence[str] |None) – CLI arguments, excluding the executable; defaults to sys.argv.services (
GenSimServices|None) – Optional borrowed model-service run for an embedded caller.prog (
str) – Display name supplied by the unified GenSim dispatcher.
- Return type:
None
Image-plan validation#
Recompute canonical-call, topology, symbolic state, source-clause, identity, and
runtime-binding checks from explicit declarations. semantic_status and
visual_status remain separate; image plans retain
execution_ready=False and runtime evidence not_run. This semantic-only
validation does not replace grounded declaration coverage or physical checks.
|
Check calls, symbolic state and source coverage without physical evidence. |
Derive producer obligations from task affordances and call declarations. |
- embodichain.gen_sim.task_engine.semantic_plan_validation.validate_semantic_plan(graph, candidate, grounding, annotations, requirements, bindings)[source]#
Check calls, symbolic state and source coverage without physical evidence.
- Parameters:
graph (
dict[str,Any]) – Canonical graph carrying unbound logical identities.candidate (
dict[str,Any]) – Source task candidate with validated task intent.grounding (
dict[str,Any]) – Visible, instruction-declared and unresolved entity evidence.annotations (
dict[str,Any]) – Per-node semantic subject, reference, relation and intent.requirements (
list[dict[str,Any]]) – Quoted source clauses with implementing node IDs.bindings (
list[dict[str,Any]]) – Explicit runtime binding requests; not execution evidence.
- Return type:
dict[str,Any]- Returns:
Recomputable phase-specific coverage and pending-binding summary.
- Raises:
ValueError – Invalid call, topology, state, identity or missing semantics. State diagnostics may propose resource-slot edits for a repair request; these suggestions never change the input or establish validity without a complete subsequent validation.
Task understanding and candidates#
Interpret an explicit caller result into independently validated task candidates, scene requests and success declarations. Model calls occur only when requested through the caller interface.
Scene-independent semantic candidate generation for Task Engine.
Classes:
Generate, validate, normalize, and vote on independent task drafts. |
Exceptions:
Raised when every independently generated candidate fails validation. |
Functions:
|
Derive structural scene constraints without classifying reference text. |
|
Derive every success term exclusively from the E-task ontology. |
- class embodichain.gen_sim.task_engine.agent.TaskAgent[source]
Generate, validate, normalize, and vote on independent task drafts.
Methods:
__init__(*[, caller, interpreter, services])generate(task_id, instruction[, model, ...])Generate candidates concurrently and retain votes after deduplication.
generate_task_spec(task_id, instruction[, ...])Generate a candidate set and emit its reusable TaskSpec.
- __init__(*, caller=None, interpreter=<function interpret_instruction_draft>, services=None)[source]
- generate(task_id, instruction, model=None, candidate_count=3, *, services=None)[source]
Generate candidates concurrently and retain votes after deduplication.
- Return type:
dict[str,Any]
- generate_task_spec(task_id, instruction, model=None, candidate_count=3, *, candidate_id=None, cache=None)[source]
Generate a candidate set and emit its reusable TaskSpec.
Task Engine remains the owner of interpretation and candidate selection. The returned template contains only normative semantics; concrete Semantic Calls and trajectories remain in the existing planner/runtime path.
- Parameters:
task_id (
str) – Stable task request identifier.instruction (
str) – Natural-language task instruction.model (
str|None) – Optional interpretation model override.candidate_count (
int) – Number of independently generated candidates.candidate_id (
str|None) – Optional candidate to materialize from the set.cache (
TaskSpecCache|None) – OptionalTaskSpecCache-compatible persistence backend.
- Return type:
TaskSpec- Returns:
A validated
embodichain.gen_sim.task_spec.TaskSpec.
- exception embodichain.gen_sim.task_engine.agent.TaskGenerationError[source]
Raised when every independently generated candidate fails validation.
- embodichain.gen_sim.task_engine.agent.derive_scene_request(draft)[source]
Derive structural scene constraints without classifying reference text.
- Return type:
dict[str,Any]
- embodichain.gen_sim.task_engine.agent.derive_success_spec(draft)[source]
Derive every success term exclusively from the E-task ontology.
- Return type:
dict[str,Any]
Candidate data contracts#
Validate finite, detached draft/candidate mappings and their task identities. Canonical hashing belongs to the unchanged declaration format.
Strict, JSON-safe public contracts owned by Task Engine.
Functions:
|
Return the stable SHA-256 of one JSON-safe protocol value. |
|
Validate source references, scene relations and robot requirements. |
|
Validate complete ordered success terms against an optional draft. |
|
Verify a candidate, its derived declarations and canonical step hash. |
|
Validate candidate voting and source-response accounting. |
|
Validate task identity and the ordered instruction-intent steps. |
- embodichain.gen_sim.task_engine.contracts.canonical_hash(value)[source]
Return the stable SHA-256 of one JSON-safe protocol value.
- Return type:
str
- embodichain.gen_sim.task_engine.contracts.validate_scene_request(value)[source]
Validate source references, scene relations and robot requirements.
- Parameters:
value (
Mapping[str,Any]) – Mapping using this function’s versioned declaration schema.- Return type:
dict[str,Any]- Returns:
A detached scene request retaining its declared task identity.
- Raises:
ValueError – A required field, identity, type or cross-declaration invariant is invalid.
- embodichain.gen_sim.task_engine.contracts.validate_success_spec(value, *, draft=None)[source]
Validate complete ordered success terms against an optional draft.
- Parameters:
value (
Mapping[str,Any]) – Mapping using this function’s versioned declaration schema.draft (
Mapping[str,Any] |None) – Optional source draft whose task identity and derived terms must match.
- Return type:
dict[str,Any]- Returns:
A detached all-clause success declaration; no physical verdict.
- Raises:
ValueError – A required field, identity, type or cross-declaration invariant is invalid.
- embodichain.gen_sim.task_engine.contracts.validate_task_candidate(value)[source]
Verify a candidate, its derived declarations and canonical step hash.
- Parameters:
value (
Mapping[str,Any]) – Mapping using this function’s versioned declaration schema.- Return type:
dict[str,Any]- Returns:
A detached candidate retaining voting and normalization provenance.
- Raises:
ValueError – A required field, identity, type or cross-declaration invariant is invalid.
- embodichain.gen_sim.task_engine.contracts.validate_task_candidate_set(value)[source]
Validate candidate voting and source-response accounting.
- Parameters:
value (
Mapping[str,Any]) – Mapping using this function’s versioned declaration schema.- Return type:
dict[str,Any]- Returns:
A detached candidate set with consistent task and candidate identities.
- Raises:
ValueError – A required field, identity, type or cross-declaration invariant is invalid.
- embodichain.gen_sim.task_engine.contracts.validate_task_draft(value)[source]
Validate task identity and the ordered instruction-intent steps.
- Parameters:
value (
Mapping[str,Any]) – Mapping using this function’s versioned declaration schema.- Return type:
dict[str,Any]- Returns:
A detached draft with normalized intent fields.
- Raises:
ValueError – A required field, identity, type or cross-declaration invariant is invalid.
Instruction intent#
Decode supported instruction intent through an explicit model caller. Fixed intent declarations can be validated without making a model request.
Scene-independent structured interpretation for Task Engine.
Classes:
One validated, scene-independent interpretation and its audit metadata. |
Functions:
|
Interpret and audit one instruction without reading or grounding a scene. |
|
Validate the private, non-graph instruction interpretation contract. |
- class embodichain.gen_sim.task_engine.interpretation.InstructionDraftResult[source]
One validated, scene-independent interpretation and its audit metadata.
Methods:
__init__(intent, model, attempts, ...[, ...])- __init__(intent, model, attempts, latency_seconds, normalizations, terminal_park=())
- embodichain.gen_sim.task_engine.interpretation.interpret_instruction_draft(instruction, *, model=None, caller=None, services=None, _allow_terminal_park=False)[source]
Interpret and audit one instruction without reading or grounding a scene.
- Return type:
- embodichain.gen_sim.task_engine.interpretation.validate_instruction_intent(value)[source]
Validate the private, non-graph instruction interpretation contract.
- Return type:
dict[str,Any]
Task intention vocabulary#
Describe semantic intentions, supported relations and their declared success types; these descriptors provide no physical implementation.
Scene-independent semantic ontology for the canonical E1-E9 tasks.
Classes:
One scene-independent semantic E-task contract. |
Functions:
|
Return the canonical contract or reject an unknown E-task type. |
|
Resolve explicit E3 evidence intent and E5 terminal behavior. |
- class embodichain.gen_sim.task_engine.ontology.TaskContract[source]
One scene-independent semantic E-task contract.
Methods:
__init__(task_type, semantics, ...)- __init__(task_type, semantics, applicable_intent_fields, source_structure, required_affordances, success_type, scene_affordances, primary_role_field, resource_mode, moves_primary_object, accepts_direct_payloads, direct_payload_relations, accepts_incoming_hold, terminal_success_types)
- embodichain.gen_sim.task_engine.ontology.task_contract(task_type)[source]
Return the canonical contract or reject an unknown E-task type.
- Return type:
- embodichain.gen_sim.task_engine.ontology.task_success_type(task_type, params=None)[source]
Resolve explicit E3 evidence intent and E5 terminal behavior.
- Return type:
str
Normative specification generation#
Generate the independent TaskSpec protocol from validated candidates, retaining source-role semantics and stable normative identity.
Task Engine adapter that emits reusable normative TaskSpecs.
Classes:
Small Task Engine façade for generation and optional caching. |
Functions:
|
Generate or reuse a TaskSpec from a candidate or candidate set. |
|
Convert one validated TaskCandidate into a normative TaskSpec. |
|
Compatibility alias for |
- class embodichain.gen_sim.task_engine.task_spec.TaskSpecGenerator[source]
Small Task Engine façade for generation and optional caching.
Methods:
__init__([cache])generate(candidate_or_set, *[, ...])Generate one template using this generator's cache.
- __init__(cache=None)
- generate(candidate_or_set, *, candidate_id=None, metadata=None)[source]
Generate one template using this generator’s cache.
- Return type:
TaskSpec
- embodichain.gen_sim.task_engine.task_spec.generate_task_spec(candidate_or_set, *, candidate_id=None, cache=None, metadata=None)[source]
Generate or reuse a TaskSpec from a candidate or candidate set.
- Parameters:
candidate_or_set (
Mapping[str,Any] |dict[str,Any]) – A validatedTaskCandidateor a candidate set returned byTaskAgent.candidate_id (
str|None) – Optional candidate ID when a set contains several votes.cache (
TaskSpecCache|None) – Optional content-addressed cache. A matching entry is loaded after generation and newly generated templates are stored.metadata (
Mapping[str,Any] |None) – Non-semantic generation metadata retained on the template.
- Return type:
TaskSpec- Returns:
A validated, reusable
TaskSpec.
- embodichain.gen_sim.task_engine.task_spec.task_spec_from_candidate(candidate, *, metadata=None)[source]
Convert one validated TaskCandidate into a normative TaskSpec.
The adapter consumes scene references and success semantics, while leaving concrete calls, robot poses, trajectories, and planner choices in the candidate/bundle layer. Candidate IDs and the legacy step hash are kept only in metadata and therefore do not define the reusable semantic hash.
- Return type:
TaskSpec
- embodichain.gen_sim.task_engine.task_spec.task_template_from_candidate(candidate, *, metadata=None)[source]
Compatibility alias for
task_spec_from_candidate().- Return type:
TaskSpec
Semantic Call graph#
Validate graph topology, group ownership, dependencies and canonical Semantic Calls through the public Task Program language decoder. This creates no runtime or motion plan.
Immutable, execution-free task graphs built from canonical Semantic Calls.
Functions:
|
Return the deterministic content hash of a valid semantic task graph. |
|
Validate and detach one provider-free semantic task graph. |
- embodichain.gen_sim.task_engine.semantic_graph.semantic_task_graph_hash(value)[source]#
Return the deterministic content hash of a valid semantic task graph.
- Parameters:
value (
Mapping[str,Any]) – JSON-compatible semantic task graph.- Return type:
str- Returns:
Lowercase SHA-256 content digest.
- Raises:
TypeError – If the graph is not an exact JSON mapping.
ValueError – If graph topology, schema, or a Semantic Call is invalid.
- embodichain.gen_sim.task_engine.semantic_graph.validate_semantic_task_graph(value)[source]#
Validate and detach one provider-free semantic task graph.
Every node payload is decoded through the Task Program language decoder. Consequently Task Engine cannot silently grow a second Semantic Call JSON dialect while planning remains independent from grounded robot actions.
- Parameters:
value (
Mapping[str,Any]) – JSON-compatible task graph mapping.- Return type:
dict[str,Any]- Returns:
A detached, normalized graph dictionary.
- Raises:
TypeError – If the graph is not an exact JSON mapping.
ValueError – If topology, schema, or a Semantic Call is invalid.
Grounding and binding contracts#
Validate role bindings, scene manifests and binding reports as detached declarations, preserving source candidate and task identity.
Strict cross-engine contracts for scene binding and orchestration.
Functions:
|
Return the stable SHA-256 of one JSON-safe protocol value. |
|
Validate candidate selection and individual reference-binding outcomes. |
|
Validate reference UID sets and explicit resource-role bindings. |
|
Validate the semantic object inventory and robot-profile metadata. |
|
Validate source references, scene relations and robot requirements. |
|
Validate complete ordered success terms against an optional draft. |
|
Verify a candidate, its derived declarations and canonical step hash. |
|
Validate candidate voting and source-response accounting. |
|
Validate task identity and the ordered instruction-intent steps. |
- embodichain.gen_sim.task_engine.orchestration.contracts.canonical_hash(value)[source]#
Return the stable SHA-256 of one JSON-safe protocol value.
- Return type:
str
- embodichain.gen_sim.task_engine.orchestration.contracts.validate_binding_report(value)[source]#
Validate candidate selection and individual reference-binding outcomes.
- Parameters:
value (
Mapping[str,Any]) – Mapping using this function’s versioned declaration schema.- Return type:
dict[str,Any]- Returns:
A detached binding report with consistent selection and candidate states.
- Raises:
ValueError – A required field, identity, type or cross-declaration invariant is invalid.
- embodichain.gen_sim.task_engine.orchestration.contracts.validate_role_bindings(value)[source]#
Validate reference UID sets and explicit resource-role bindings.
- Parameters:
value (
Mapping[str,Any]) – Mapping using this function’s versioned declaration schema.- Return type:
dict[str,Any]- Returns:
Detached bindings retaining the exact task and candidate identities.
- Raises:
ValueError – A required field, identity, type or cross-declaration invariant is invalid.
- embodichain.gen_sim.task_engine.orchestration.contracts.validate_scene_manifest(value)[source]#
Validate the semantic object inventory and robot-profile metadata.
- Parameters:
value (
Mapping[str,Any]) – Mapping using this function’s versioned declaration schema.- Return type:
dict[str,Any]- Returns:
A detached scene manifest; geometry is supplied rather than measured.
- Raises:
ValueError – A required field, identity, type or cross-declaration invariant is invalid.
- embodichain.gen_sim.task_engine.orchestration.contracts.validate_scene_request(value)[source]#
Validate source references, scene relations and robot requirements.
- Parameters:
value (
Mapping[str,Any]) – Mapping using this function’s versioned declaration schema.- Return type:
dict[str,Any]- Returns:
A detached scene request retaining its declared task identity.
- Raises:
ValueError – A required field, identity, type or cross-declaration invariant is invalid.
- embodichain.gen_sim.task_engine.orchestration.contracts.validate_success_spec(value, *, draft=None)[source]#
Validate complete ordered success terms against an optional draft.
- Parameters:
value (
Mapping[str,Any]) – Mapping using this function’s versioned declaration schema.draft (
Mapping[str,Any] |None) – Optional source draft whose task identity and derived terms must match.
- Return type:
dict[str,Any]- Returns:
A detached all-clause success declaration; no physical verdict.
- Raises:
ValueError – A required field, identity, type or cross-declaration invariant is invalid.
- embodichain.gen_sim.task_engine.orchestration.contracts.validate_task_candidate(value)[source]#
Verify a candidate, its derived declarations and canonical step hash.
- Parameters:
value (
Mapping[str,Any]) – Mapping using this function’s versioned declaration schema.- Return type:
dict[str,Any]- Returns:
A detached candidate retaining voting and normalization provenance.
- Raises:
ValueError – A required field, identity, type or cross-declaration invariant is invalid.
- embodichain.gen_sim.task_engine.orchestration.contracts.validate_task_candidate_set(value)[source]#
Validate candidate voting and source-response accounting.
- Parameters:
value (
Mapping[str,Any]) – Mapping using this function’s versioned declaration schema.- Return type:
dict[str,Any]- Returns:
A detached candidate set with consistent task and candidate identities.
- Raises:
ValueError – A required field, identity, type or cross-declaration invariant is invalid.
- embodichain.gen_sim.task_engine.orchestration.contracts.validate_task_draft(value)[source]#
Validate task identity and the ordered instruction-intent steps.
- Parameters:
value (
Mapping[str,Any]) – Mapping using this function’s versioned declaration schema.- Return type:
dict[str,Any]- Returns:
A detached draft with normalized intent fields.
- Raises:
ValueError – A required field, identity, type or cross-declaration invariant is invalid.
Declared coverage#
Compare graph calls and lineage with the complete candidate, TaskSpec and role bindings. Covered means declaration coverage; it does not establish execution or physical success.
Normative coverage beside the unchanged v38 graph and bundle protocol.
Historical sealed declarations retain their recorded producer IDs here. New unbound image plans use semantic_plan_validation and the current Task Program call catalog; this compatibility checker does not authorize runtime calls.
Functions:
|
Check role/set, milestone order and surviving terminal-goal declarations. |
- embodichain.gen_sim.task_engine.semantic_graph_validation.validate_graph_coverage(graph, task_spec, candidate, role_bindings, lineage)[source]#
Check role/set, milestone order and surviving terminal-goal declarations.
- Parameters:
graph (
Mapping[str,Any]) – Existing v38 semantic graph, without additional graph fields.task_spec (
TaskSpec|Mapping[str,Any]) – Normative TaskSpec, not reconstructed from calls.candidate (
Mapping[str,Any]) – Source solution draft.role_bindings (
Mapping[str,Any]) – Exact Scene Adapter result.lineage (
Mapping[str,Any]) – Source-step members emitted by the same planner expansion.
- Return type:
dict[str,Any]- Returns:
Detached declaration coverage, not a physical-success certificate.
Offline semantic graph viewer#
Render an existing semantic graph into one HTML document with embedded styles, a compiled React/TypeScript interface, licensed local fonts and React Flow interactions. TaskSpec, declaration coverage, report overlays, thumbnails and translated display labels are optional. The pure renderer makes no model, network or simulator call. Display data keeps program outcomes and normative verdicts separate; unavailable evidence is never converted into success. Report and companion identities must match the graph, and supplied coverage is recomputed from its original declarations.
write_semantic_task_graph_html writes a caller-selected display outside every
sealed bundle. Original JSON/YAML reports, graph declarations and certificates
remain read-only. Missing thumbnails stay unavailable; supplied scene provenance
selects exact source UIDs rather than guessing replacement assets.
Offline, single-canvas exploration of the real semantic graph and contracts.
Functions:
|
Render self-contained HTML without altering graph or recorded evidence. |
|
Write an offline graph viewer. |
- embodichain.gen_sim.task_engine.semantic_graph_html.render_semantic_task_graph_html(graph, execution_report=None, *, task_spec=None, validation=None, presentation=None)[source]#
Render self-contained HTML without altering graph or recorded evidence.
- Parameters:
graph (
Mapping[str,Any]) – Existing v38 graph topology and call data.execution_report (
Mapping[str,Any] |None) – Optional identity-matched original execution report.task_spec (
TaskSpec|Mapping[str,Any] |None) – Optional normative companion; absent stays absent.validation (
Mapping[str,Any] |None) – Optional recomputable static coverage envelope.presentation (
Mapping[str,Any] |None) – Optional display metadata, never a success certificate.
- Return type:
str- Returns:
Standalone HTML with embedded data, styles, SVG and local interactions.
- Raises:
ValueError – A report or companion identity does not match this graph.
- embodichain.gen_sim.task_engine.semantic_graph_html.write_semantic_task_graph_html(graph, output, execution_report=None, *, task_spec=None, validation=None, bundle_root=None, run_summary=None)[source]#
Write an offline graph viewer.
- Parameters:
graph (
Mapping[str,Any]) – Canonical graph source.output (
str|Path) – New HTML destination, not a historical JSON/YAML artifact.execution_report (
Mapping[str,Any] |None) – Optional original report for separate runtime overlays.task_spec (
TaskSpec|Mapping[str,Any] |None) – Optional normative task declaration.validation (
Mapping[str,Any] |None) – Optional identity-bound static coverage.bundle_root (
str|Path|None) – Bundle owning optional scene metadata and asset-image sources. Defaults to the output directory. Missing images stay unavailable.run_summary (
Mapping[str,Any] |None) – Optional task-matched wall-clock summary, separate from evidence.
- Return type:
Path- Returns:
Absolute HTML path.
For an existing declaration file, choose a separate display directory:
import json
from pathlib import Path
from embodichain.gen_sim.task_engine.semantic_graph_html import (
write_semantic_task_graph_html,
)
graph = json.loads(Path("bundle/semantic_task_graph.json").read_text())
write_semantic_task_graph_html(graph, "run/semantic_graph.html")
Recorded report contract#
Validate and detach the original finite execution-report shape for read-only rendering. This validation does not execute a program, acquire physical evidence, or reclassify a recorded outcome.
Read-only validation of recorded Task Engine execution reports.
Functions:
|
Validate the stable Task Engine view without reclassifying runtime truth. |
- embodichain.gen_sim.task_engine.reporting.validate_execution_report(value)[source]#
Validate the stable Task Engine view without reclassifying runtime truth.
- Parameters:
value (
Mapping[str,Any]) – JSON-compatible execution-report mapping.- Return type:
dict[str,Any]- Returns:
A detached normalized report.
- Raises:
TypeError – If the report or one of its typed fields has the wrong type.
ValueError – If required fields, schema identity, or values are invalid.
Optional TaskSpec companion#
Preserve valid TaskSpec identities and the explicit closed absence marker. Absence carries no normative success or certificate.
Explicit optional normative-spec declaration for executable Task Engine bundles.
Functions:
|
Serialize a verified normative spec or its explicit absence. |
|
Decode the closed absence marker or validate a populated specification. |
- embodichain.gen_sim.task_engine.bundle_spec.bundle_task_spec_payload(value)[source]#
Serialize a verified normative spec or its explicit absence.
- Parameters:
value (
TaskSpec|Mapping[str,Any] |None) – Existing TaskSpec/data with its valid semantic identity, or None.- Return type:
dict[str,Any]- Returns:
Detached existing TaskSpec format, unchanged for valid specifications; None emits only
schema_version: task_spec.absent/v1. Absence is not an empty task, a successful specification or a physical certificate.
- embodichain.gen_sim.task_engine.bundle_spec.decode_bundle_task_spec(value)[source]#
Decode the closed absence marker or validate a populated specification.
- Parameters:
value (
Mapping[str,Any]) – Decodedtask_spec.jsondeclaration mapping.- Return type:
TaskSpec|None- Returns:
Independent validated TaskSpec, or None only for the exact versioned absence marker. Missing files and null values are errors; present values retain the existing TaskSpec decoder and validation rules.
- Raises:
ValueError – An absence marker has unsupported fields or version.
The frontend build uses the same React/TypeScript/Vite/React Flow versions as
the architecture explorer. Shared viewport controls and theme tokens live in
web/graph-ui; each app retains its own data model and layout. The Python
API embeds committed build outputs, so installed offline rendering has no Node
runtime requirement. Vector SVG export serializes the current task layout and
retains the original evidence status rather than generating a new verdict.
Pure program declarations#
Project a validated Semantic Call graph into the existing program format using explicit per-segment acceptance bindings. Calls, targets, stage identities and ordering remain tied to the graph. Optional acceptance deferral must retain every original post-policy and validator at the terminal boundary. This builder does not read a bundle, compose runtime services, plan motion or create a simulator; callers still perform complete configured deployment preflight.
Program projection from semantic nodes and explicit owner-resolved bindings.
Classes:
Transient program binding, not an additional runtime configuration store. |
Functions:
|
Build the existing program format without motion, geometry or live reads. |
- class embodichain.gen_sim.task_engine.program_declarations.ProgramSegmentBinding[source]#
Transient program binding, not an additional runtime configuration store.
The owner supplies post-policy references and validators with their already resolved tolerances. Optional terminal fields identify checks copied to the group’s final cleanup segment. Deferral removes the original segment checks only when explicitly selected; action release/effect contracts are untouched.
Methods:
__init__(node_id[, call, post, validators, ...])- __init__(node_id, call=None, post=None, validators=None, terminal_post=None, terminal_validators=None, defer_to_terminal=False)#
- embodichain.gen_sim.task_engine.program_declarations.build_program_declaration(graph, program_id, *, bindings=(), final_validators=())[source]#
Build the existing program format without motion, geometry or live reads.
Each graph node retains its execution segment identity and ordering. Call overrides must be exact graph projections, including the existing declared placement-stage selector rule. Owners choose acceptance presets/thresholds; no task ID, object name or analysis-cache index changes execution policies. The caller completes ordinary catalog preflight after integration assembly.
- Return type:
dict[str,Any]
Workflow configuration and replayable state#
Validate the existing workflow/planning/execution configuration and packaged defaults independently of runtime assembly. Requests refer to an existing source scene and a separate output directory. Typed stage transitions retain an ordered event audit that can be replayed without a simulator, planner or bundle loader.
Configuration owned by Task Engine orchestration.
Classes:
Success policy for vectorized simulator execution. |
|
Task interpretation and semantic graph generation defaults. |
|
Conservative first-version orchestration limits. |
Functions:
|
Load strict Task Engine defaults from YAML. |
- class embodichain.gen_sim.task_engine.config.TaskEngineExecutionCfg[source]#
Success policy for vectorized simulator execution.
Methods:
__init__([num_envs, success_policy, ...])copy(**kwargs)Return a new object replacing specified fields with new values.
replace(**kwargs)Return a new object replacing specified fields with new values.
to_dict()Convert an object into dictionary recursively.
validate([prefix])Check the validity of configclass object.
Attributes:
Return the number of successful replicas required for acceptance.
- __init__(num_envs=<factory>, success_policy=<factory>, min_successful_envs=<factory>, acceptance_mode=<factory>)#
- copy(**kwargs)#
Return a new object replacing specified fields with new values.
This is especially useful for frozen classes. Example usage:
@configclass(frozen=True) class C: x: int y: int c = C(1, 2) c1 = c.replace(x=3) assert c1.x == 3 and c1.y == 2
- Parameters:
obj (
object) – The object to replace.**kwargs – The fields to replace and their new values.
- Return type:
object- Returns:
The new object.
- replace(**kwargs)#
Return a new object replacing specified fields with new values.
This is especially useful for frozen classes. Example usage:
@configclass(frozen=True) class C: x: int y: int c = C(1, 2) c1 = c.replace(x=3) assert c1.x == 3 and c1.y == 2
- Parameters:
obj (
object) – The object to replace.**kwargs – The fields to replace and their new values.
- Return type:
object- Returns:
The new object.
- property required_successes: int#
Return the number of successful replicas required for acceptance.
- to_dict()#
Convert an object into dictionary recursively.
Note
Ignores string names starting with “__” (i.e. built-in methods). Non-string mapping keys retain their original type.
- Parameters:
obj (
object) – An instance of a class to convert.- Raises:
ValueError – When input argument is not an object.
- Return type:
dict[Any,Any]- Returns:
Converted dictionary mapping.
- validate(prefix='')#
Check the validity of configclass object.
This function checks if the object is a valid configclass object. A valid configclass object contains no MISSING entries.
- Parameters:
obj (
object) – The object to check.prefix (
str) – The prefix to add to the missing fields. Defaults to ‘’.
- Return type:
list[str]- Returns:
A list of missing fields.
- Raises:
TypeError – When the object is not a valid configuration object.
- class embodichain.gen_sim.task_engine.config.TaskEnginePlanningCfg[source]#
Task interpretation and semantic graph generation defaults.
Methods:
__init__([candidate_count, planning_mode, ...])copy(**kwargs)Return a new object replacing specified fields with new values.
replace(**kwargs)Return a new object replacing specified fields with new values.
to_dict()Convert an object into dictionary recursively.
validate([prefix])Check the validity of configclass object.
- __init__(candidate_count=<factory>, planning_mode=<factory>, max_episodes=<factory>, max_episode_steps=<factory>, fit_grasp_assets=<factory>, twist_mass_source=<factory>, physical_reference=<factory>, runtime_profile=<factory>, experimental_open_release=<factory>, native_pick_exploration=<factory>, press_extra_distance=<factory>)#
- copy(**kwargs)#
Return a new object replacing specified fields with new values.
This is especially useful for frozen classes. Example usage:
@configclass(frozen=True) class C: x: int y: int c = C(1, 2) c1 = c.replace(x=3) assert c1.x == 3 and c1.y == 2
- Parameters:
obj (
object) – The object to replace.**kwargs – The fields to replace and their new values.
- Return type:
object- Returns:
The new object.
- replace(**kwargs)#
Return a new object replacing specified fields with new values.
This is especially useful for frozen classes. Example usage:
@configclass(frozen=True) class C: x: int y: int c = C(1, 2) c1 = c.replace(x=3) assert c1.x == 3 and c1.y == 2
- Parameters:
obj (
object) – The object to replace.**kwargs – The fields to replace and their new values.
- Return type:
object- Returns:
The new object.
- to_dict()#
Convert an object into dictionary recursively.
Note
Ignores string names starting with “__” (i.e. built-in methods). Non-string mapping keys retain their original type.
- Parameters:
obj (
object) – An instance of a class to convert.- Raises:
ValueError – When input argument is not an object.
- Return type:
dict[Any,Any]- Returns:
Converted dictionary mapping.
- validate(prefix='')#
Check the validity of configclass object.
This function checks if the object is a valid configclass object. A valid configclass object contains no MISSING entries.
- Parameters:
obj (
object) – The object to check.prefix (
str) – The prefix to add to the missing fields. Defaults to ‘’.
- Return type:
list[str]- Returns:
A list of missing fields.
- Raises:
TypeError – When the object is not a valid configuration object.
- class embodichain.gen_sim.task_engine.config.TaskEngineWorkflowCfg[source]#
Conservative first-version orchestration limits.
The packaged YAML owns retry limits so deployment testing can tune them without changing the orchestration implementation.
Methods:
__init__([max_parallel_workers, ...])copy(**kwargs)Return a new object replacing specified fields with new values.
replace(**kwargs)Return a new object replacing specified fields with new values.
to_dict()Convert an object into dictionary recursively.
validate([prefix])Check the validity of configclass object.
- __init__(max_parallel_workers=<factory>, max_action_attempts=<factory>)#
- copy(**kwargs)#
Return a new object replacing specified fields with new values.
This is especially useful for frozen classes. Example usage:
@configclass(frozen=True) class C: x: int y: int c = C(1, 2) c1 = c.replace(x=3) assert c1.x == 3 and c1.y == 2
- Parameters:
obj (
object) – The object to replace.**kwargs – The fields to replace and their new values.
- Return type:
object- Returns:
The new object.
- replace(**kwargs)#
Return a new object replacing specified fields with new values.
This is especially useful for frozen classes. Example usage:
@configclass(frozen=True) class C: x: int y: int c = C(1, 2) c1 = c.replace(x=3) assert c1.x == 3 and c1.y == 2
- Parameters:
obj (
object) – The object to replace.**kwargs – The fields to replace and their new values.
- Return type:
object- Returns:
The new object.
- to_dict()#
Convert an object into dictionary recursively.
Note
Ignores string names starting with “__” (i.e. built-in methods). Non-string mapping keys retain their original type.
- Parameters:
obj (
object) – An instance of a class to convert.- Raises:
ValueError – When input argument is not an object.
- Return type:
dict[Any,Any]- Returns:
Converted dictionary mapping.
- validate(prefix='')#
Check the validity of configclass object.
This function checks if the object is a valid configclass object. A valid configclass object contains no MISSING entries.
- Parameters:
obj (
object) – The object to check.prefix (
str) – The prefix to add to the missing fields. Defaults to ‘’.
- Return type:
list[str]- Returns:
A list of missing fields.
- Raises:
TypeError – When the object is not a valid configuration object.
- embodichain.gen_sim.task_engine.config.load_task_engine_config(path=None)[source]#
Load strict Task Engine defaults from YAML.
- Parameters:
path (
str|Path|None) – Optional override YAML. The packaged defaults are used when omitted.- Return type:
tuple[TaskEngineWorkflowCfg,TaskEnginePlanningCfg,TaskEngineExecutionCfg]- Returns:
Validated workflow, planning, and execution configurations.
- Raises:
TypeError – If a configuration section is not a mapping.
ValueError – If the YAML schema or fields are invalid.
Strict inputs for Task Engine cross-engine workflows.
Functions:
|
Return the selected scene input kind after validating |
|
Protect a source project before reserving a history-directory child. |
Reject output paths that could replace or modify a read-only source. |
|
|
Validate and detach one Task Engine run request. |
- embodichain.gen_sim.task_engine.workflow_contracts.scene_input_kind(request)[source]#
Return the selected scene input kind after validating
request.- Return type:
Literal['gym_project']
- embodichain.gen_sim.task_engine.workflow_contracts.validate_scene_history_root(gym_project, output_root)[source]#
Protect a source project before reserving a history-directory child.
A prior run may live below the same history root because every new run is published to a distinct timestamped child. The inverse remains unsafe: creating the history root at or below the source project would write a reservation and output artifacts into the read-only source tree.
- Parameters:
gym_project (
str|Path) – Existing Gym project directory or configuration path.output_root (
str|Path) – Parent directory under which a new run will be reserved.
- Raises:
ValueError – If the history root is equal to or contained by the source project boundary.
- Return type:
None
- embodichain.gen_sim.task_engine.workflow_contracts.validate_scene_output_separation(gym_project, output_dir)[source]#
Reject output paths that could replace or modify a read-only source.
- Parameters:
gym_project (
str|Path) – Existing Gym project directory or configuration path.output_dir (
str|Path) – Transactional output directory for the Task Engine run.
- Raises:
ValueError – If either path contains the other or both paths are equal.
- Return type:
None
- embodichain.gen_sim.task_engine.workflow_contracts.validate_task_run_request(value)[source]#
Validate and detach one Task Engine run request.
Image generation and editing belong to the independent Scene Engine.
- Return type:
dict[str,Any]
Typed, replayable state transitions for cross-engine orchestration.
Classes:
Lifecycle of one independently schedulable workflow stage. |
|
Immutable state snapshot plus an append-only transition audit. |
|
Stable stages shared by all four supported input combinations. |
Functions:
|
Complete one running stage. |
|
Fail a stage, including a later retry of a previously successful stage. |
|
Create a validated state with the optional edit stage resolved. |
|
Rebuild a state by validating and applying its transition audit. |
|
Skip one optional pending stage. |
|
Start a pending stage only after every dependency has completed. |
- class embodichain.gen_sim.task_engine.state_machine.StageStatus[source]#
Lifecycle of one independently schedulable workflow stage.
Methods:
__new__(value)- __new__(value)#
- class embodichain.gen_sim.task_engine.state_machine.TaskEngineState[source]#
Immutable state snapshot plus an append-only transition audit.
Methods:
Attributes:
Return whether execution succeeded or any stage failed.
- __init__(request, stages, events=<factory>)#
- property terminal: bool#
Return whether execution succeeded or any stage failed.
- class embodichain.gen_sim.task_engine.state_machine.WorkflowStage[source]#
Stable stages shared by all four supported input combinations.
Methods:
__new__(value)- __new__(value)#
- embodichain.gen_sim.task_engine.state_machine.complete_stage(state, stage)[source]#
Complete one running stage.
- Return type:
- embodichain.gen_sim.task_engine.state_machine.fail_stage(state, stage, *, reason)[source]#
Fail a stage, including a later retry of a previously successful stage.
- Return type:
- embodichain.gen_sim.task_engine.state_machine.initial_state(request)[source]#
Create a validated state with the optional edit stage resolved.
- Return type:
- embodichain.gen_sim.task_engine.state_machine.replay_events(request, events)[source]#
Rebuild a state by validating and applying its transition audit.
- Parameters:
request (
dict[str,Any]) – Original workflow request used to create the state.events (
Sequence[Mapping[str,Any]]) – Complete ordered event audit to validate and replay.
- Return type:
- Returns:
The immutable state reconstructed from the supplied audit.
- Raises:
TypeError – If the audit is not a sequence of event mappings.
ValueError – If any event is missing, altered, or not a valid transition.
- embodichain.gen_sim.task_engine.state_machine.skip_stage(state, stage)[source]#
Skip one optional pending stage.
- Return type:
- embodichain.gen_sim.task_engine.state_machine.start_stage(state, stage)[source]#
Start a pending stage only after every dependency has completed.
- Return type:
Run-output helpers protect sealed declaration ancestors, preserve cancelled sealed histories and publish finite JSON without overwriting historical reports when requested. This file owns output persistence only; workflow scheduling, execution, report evaluation and bundle publication remain separate consumers.
Stable run-path ownership, separate from sealed declaration publication.
Functions:
Validate a run-output directory without creating or modifying it. |
|
|
Atomically refresh one run-owned audit, never a sealed declaration file. |
- embodichain.gen_sim.task_engine.orchestration.workflow_artifacts.validate_run_output_directory(path)[source]#
Validate a run-output directory without creating or modifying it.
- Parameters:
path (
str|Path) – Caller-owned execution or workflow output directory.- Return type:
Path- Returns:
Canonical absolute path after checking direct and resolved ancestors. A directory inside a sealed bundle, including through a symbolic link, rejects. Callers additionally enforce fresh-attempt and non-overwrite rules for their execution receipts and reports.
- embodichain.gen_sim.task_engine.orchestration.workflow_artifacts.write_run_json(path, value, *, overwrite=True)[source]#
Atomically refresh one run-owned audit, never a sealed declaration file.
- Parameters:
path (
str|Path) – Explicit run-owned JSON destination, outside all sealed bundles.value (
Any) – JSON-serializable audit. Non-finite values reject before writing.overwrite (
bool) – Whether an existing run-owned audit may be refreshed. False publishes a fresh receipt/report atomically and rejects an existing file.
- Return type:
None
Existing run-owned audits may be refreshed. Execution hosts retain their fresh-run and receipt/report non-overwrite checks.
Task Program bundles#
Prepare already-authored scene, embodiment, program, integration, policy,
TaskSpec and graph declarations with prepare_configured_bundle. Preparation
performs static component and program preflight, then seals a detached snapshot.
write_bundle_atomic publishes it without replacing an existing bundle.
load_configured_bundle verifies the caller’s independently acquired input
hashes and implementation revisions before returning lazy deployment factories.
The caller owns asset enumeration and supplies the current revision/input
contract; these APIs do not generate assets, plan motion or start simulation.
Static preparation and loading of shared-runtime Task Program bundles.
Classes:
Detached static declarations plus their sealed source bytes. |
Functions:
|
Check the runtime envelope first, then recompose only its verified bytes. |
|
Preflight pure owner declarations, then seal their identity without writing. |
- class embodichain.gen_sim.task_engine.bundle_deployment.LoadedTaskProgramBundle[source]#
Detached static declarations plus their sealed source bytes.
This is not a simulator, run or physical certificate. Mutable physical and configured-deployment mappings are independently owned assembly results; changing effective declarations requires preparing a new bundle identity.
Methods:
__init__(snapshot, physical, deployment, ...)Recheck current-loader inputs and implementation before runtime use.
Build and register a Gym configuration from sealed bytes, without a simulator.
- __init__(snapshot, physical, deployment, program, task_spec, root, _current_input_validator=None)#
- assert_current_inputs()[source]#
Recheck current-loader inputs and implementation before runtime use.
The current-package loader binds this check to its independently hashed source files. Explicit qualification-owned loaders retain their caller’s input contract. Sealed component files are never reopened; this reads only declared external inputs and the current implementation identity.
- Return type:
None
- configure_environment()[source]#
Build and register a Gym configuration from sealed bytes, without a simulator.
Recompose from the snapshot instead of trusting mutable assembly copies exposed by this object. The returned configuration belongs to the caller; changing effective physical declarations requires a newly prepared bundle.
- Return type:
tuple[str,EmbodiedEnvCfg]
- embodichain.gen_sim.task_engine.bundle_deployment.load_configured_bundle(root, *, external_input_digests, implementation_revisions)[source]#
Check the runtime envelope first, then recompose only its verified bytes.
Reject old versions, changed inputs, unsupported capabilities and mismatched effective identities before creating any simulator or live adapter. Runtime registration factories remain lazy. Historical certificates are not loaded.
- Return type:
- embodichain.gen_sim.task_engine.bundle_deployment.prepare_configured_bundle(files, *, base_dir, external_input_digests, implementation_revisions, source_input_provenance=None)[source]#
Preflight pure owner declarations, then seal their identity without writing.
Source files use the canonical Task Engine bundle layout. Owner-relative external resource files resolve from base_dir; callers supply independently checked input digests. This entry validates graph projection and runtime capabilities, not physical success or TaskSpec certificate readiness.
- Parameters:
files (
Mapping[str,bytes]) – Canonical source declaration bytes and optional audit artifacts.base_dir (
str|Path) – Owner directory for resolving external resource declarations.external_input_digests (
Mapping[str,str]) – Independently acquired source-owner input hashes.implementation_revisions (
Mapping[str,str]) – Explicit current owner implementation revisions.source_input_provenance (
Mapping[str,Any] |None) – Closed owner/path/SHA declaration. When omitted, application-owned inputs receive one explicit application group.
- Return type:
- Returns:
Owned version-5 snapshot with exact external-input/provenance agreement.
Static identities for the shared-runtime Task Engine bundle contract.
This module owns no runtime factories or filesystem access. The builder supplies validated owner declarations and input digests; a loader checks this envelope before importing or constructing a simulation deployment.
Classes:
Owned canonical envelope, independent of simulation and mutable inputs. |
Functions:
|
Seal a new owner-validated declaration without creating runtime objects. |
|
Require the exact sealed declaration file set and bytes before loading. |
- class embodichain.gen_sim.task_engine.bundle_identity.BundleIdentity[source]#
Owned canonical envelope, independent of simulation and mutable inputs.
Use
from_dict()to verify an existing envelope, orcreate_bundle_identity()to seal a newly preflighted declaration. Identity changes do not authorize reuse of an earlier physical certificate.Methods:
__init__()from_dict(value)Verify the version and hashes, rebuilding an independent snapshot.
to_dict()Return an independent serialized envelope without re-signing it.
Attributes:
Return the sealed bundle identity digest.
- property digest: str#
Return the sealed bundle identity digest.
- embodichain.gen_sim.task_engine.bundle_identity.create_bundle_identity(*, integration_id, integration_fingerprint, registration_declaration, program_fingerprint, task_spec_digest, implementation_revisions, component_files, external_inputs)[source]#
Seal a new owner-validated declaration without creating runtime objects.
The caller must complete static deployment preflight first and enumerate every effective component and external input. Component values are byte digests of relative bundle files; external keys identify immutable inputs. This function validates identity integrity, not scene physics or capability completeness. Implementation revisions must describe the selected owners.
- Return type:
- embodichain.gen_sim.task_engine.bundle_identity.verify_bundle_files(identity, files)[source]#
Require the exact sealed declaration file set and bytes before loading.
The envelope itself and run outputs are not declaration files. The caller reads files without resolving undeclared links or external inputs; this function performs no I/O and never starts simulation.
- Return type:
None
Pure source-input provenance; no policy, asset resolution or runtime branch.
Atomic publication and static verification of sealed declaration bundles.
Classes:
Owned declaration bytes and their verified immutable identity. |
Functions:
|
Read and verify an envelope before declaration traversal or runtime imports. |
|
Reject unsupported or changed bundles before decoding runtime components. |
|
Publish a preflighted, sealed declaration set as one fresh directory. |
- class embodichain.gen_sim.task_engine.bundle_io.BundleSnapshot[source]#
Owned declaration bytes and their verified immutable identity.
No simulator, configured adapter or historical execution evidence is stored. Recomposition must additionally check the effective runtime declarations.
Methods:
__init__(identity, files)- __init__(identity, files)#
- embodichain.gen_sim.task_engine.bundle_io.read_bundle_identity(root)[source]#
Read and verify an envelope before declaration traversal or runtime imports.
- Parameters:
root (
str|Path) – Existing published declaration directory.- Return type:
- Returns:
Independently owned runtime identity under the existing regular-file, no-links and duplicate-field checks. Unsupported old contracts reject without inspecting their components or constructing runtime resources.
- embodichain.gen_sim.task_engine.bundle_io.read_bundle_snapshot(root, *, external_input_digests, implementation_revisions)[source]#
Reject unsupported or changed bundles before decoding runtime components.
- Parameters:
root (
str|Path) – Published declaration directory, excluding run outputs.external_input_digests (
Mapping[str,str]) – Current owner-resolved input hashes, not values copied from the envelope being checked.implementation_revisions (
Mapping[str,str]) – Current selected implementation revisions.
- Return type:
- Returns:
Owned verified bytes suitable for static configured-deployment preflight.
- Raises:
ValueError – Contract, file inventory, bytes or current inputs disagree.
OSError – Required declaration files cannot be read.
- embodichain.gen_sim.task_engine.bundle_io.write_bundle_atomic(root, snapshot, *, validate_inputs=None)[source]#
Publish a preflighted, sealed declaration set as one fresh directory.
All hashes are rechecked before any directory is created. A private sibling staging directory is removed on failure; an existing destination is never replaced. A sealed ancestor rejects before staging, including symbolic-link aliases. This function does not preflight capabilities itself: callers must use the public configured deployment loader before sealing the snapshot. Runtime outputs and physical certificates belong to separate run storage. An explicit input validator runs before any writes and again immediately before publication; caller-owned qualification inputs need no filesystem interpretation by this byte-oriented writer.
- Parameters:
root (
str|Path) – Fresh destination outside existing sealed declarations.snapshot (
BundleSnapshot) – Owned preflighted declaration bytes and their identity.validate_inputs (
Callable[[],None] |None) – Explicit source-owner validation callback, when supplied.
- Return type:
Path- Returns:
Published destination after the atomic no-replace rename.