Expand description
Template instantiation system for the task-graph database.
Templates are Snapshot-format JSON files that define reusable task structures. Instantiation creates fresh copies with new IDs while preserving the internal dependency graph, optionally attaching the template root to a parent task.
§Entry and Exit Points
- Entry points: Root tasks within the template (tasks that have no parent within the template itself). These are the “top” of the template hierarchy.
- Exit points: Tasks with external dependency targets (references to task IDs not present in the template). These represent integration boundaries.
§Instantiation Flow
- Load the template from a Snapshot JSON file
- Validate schema compatibility
- Detect entry/exit points from the template structure
- Remap all IDs to fresh petname-based IDs
- Record template metadata (source, original IDs, mapping)
- Optionally attach entry points to a parent task
- Import into the database via merge mode
Structs§
- Import
Stats - Simplified import stats for the instantiation result.
- Instantiate
Options - Options for controlling template instantiation.
- Instantiate
Result - Result of a template instantiation operation.
- Template
Metadata - Metadata about a template, extracted during analysis.
Functions§
- analyze_
template - Analyze a template snapshot to extract metadata without modifying it.
- list_
templates - List available templates from a directory.