feat: Implemented primitive intent pipline (closes #7)

This commit is contained in:
2026-07-06 22:43:09 +05:30
parent 72b87c40bc
commit f7177b619b
11 changed files with 388 additions and 8 deletions

View File

@@ -52,7 +52,8 @@ Since we're have such complex systems for action validation, it's possible that
Delta Generators are single-responsibility components in the Architect Layer tasked with computing discrete state updates ("deltas") from validated intents.
### How They Function
1. **Validation Prerequisite**: Delta generators execute *only* if the `LLMValidator` (or other validator layers) returns `isValid: true`.
1. **Validation Prerequisite**: Delta generators execute _only_ if the `LLMValidator` (or other validator layers) returns `isValid: true`.
2. **Specialized Responsibility**: Each generator isolates a specific aspect of state transition (e.g., advancing the clock, updating positions, modifying attributes). This keeps prompts focused and avoids single monolithic LLM calls trying to update everything.
3. **Structured Outputs**: Generators query the LLM using Zod schemas to ensure type-safe and validated change deltas.
4. **Application and Persistence**: Once generated, the delta is applied to the live `WorldState` by deterministic code, and the changes are persisted to the database.
@@ -60,14 +61,15 @@ Delta Generators are single-responsibility components in the Architect Layer tas
### Core Generators
#### Time Delta Generator
Calculates the physical time duration (in minutes) that a validated action takes to complete:
* **Inputs**: The validated action and the serialized objective `WorldState`.
* **Output (Zod Schema)**:
- **Inputs**: The validated action and the serialized objective `WorldState`.
- **Output (Zod Schema)**:
```json
{
"minutesToAdvance": 25,
"explanation": "Searching a locked desk thoroughly takes time."
}
```
* **Resolution**: The Architect advances `worldState.clock` by the returned minutes, then saves the updated world state to `SQLiteRepository`.
- **Resolution**: The Architect advances `worldState.clock` by the returned minutes, then saves the updated world state to `SQLiteRepository`.