refactor: Unified prompt composition, structured log analysis, parallel validator tracing, and intent hydration fixes#34
Merged
Merged
Conversation
- Short term memory/ recent events are collectively now Cognitive Buffer (Tier 1) - Long term memory/ memory ledgers are just Memory Ledger (Tier 2) - Dossiers stay Dossiers (Tier 3)
…mponent for actor,intent and handoff
This was
linked to
issues
Jul 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request compiles all architectural improvements, refactoring, and fixes implemented in this branch to unify prompt generation, structure logs, add parallel validator checks, and fix entity/dialogue hydration.
1. Unified Prompt Composition and Generic Interfaces
Centralized LLM prompt types by relocating
PromptComponentandPromptBreakdownfrom@omnia/voiceto@omnia/llm(packages/llm/src/llm.ts).Standardized prompt construction by implementing the generic
IPromptBuilder<TArgs>interface across all prompt builders:ActorPromptBuilder(packages/actor/src/actor-prompt-builder.ts) implementsIPromptBuilder<[WorldState, Entity]>.IntentDecoderPromptBuilder(packages/intent/src/intent-prompt-builder.ts) implementsIPromptBuilder<[WorldState, string, string, Intent[]]>.HandoffPromptBuilder(packages/memory/src/handoff-prompt-builder.ts) implementsIPromptBuilder<[Entity, BufferEntry[], Date]>.LLMValidatorPromptBuilder(packages/architect/src/llm-validator-prompt-builder.ts) implementsIPromptBuilder<[WorldState, Intent]>.Decoupled prompt composition from LLM execution, providing a consistent and reusable prompt-building architecture across the codebase.
2. Structured Simulation Logging and Reusable Prompt Visualization
Replaced fragile regex-based parsing of provider
lastCalloutput inturn-executor.tsandalias-handoff.ts.Introduced structured prompt logging by storing prompt breakdowns as token-labeled JSON component arrays.
Added a reusable
PromptAnalyzercomponent (apps/gui/src/components/play/PromptAnalyzer.tsx) that:Refactored both
PromptModalandHandoffModalto delegate prompt rendering and visualization responsibilities toPromptAnalyzer, significantly simplifying modal logic.3. Parallel Intent Validation Logging and Visualization
Separated raw intent decoding from the validation pipeline.
Preserved decoded intents in
LogEntry.decodedIntents, allowing the interface to display model output before validation occurs.Redesigned
PromptSwitcherto visually represent the parallel validation architecture:Added dynamic validation tabs for each LLM validation execution.
Each validation view displays:
Added a dedicated "Bypassed LLM Validation" view to clearly explain scenarios where validation is intentionally skipped, such as dialogue and thought intents.
4. Grammar Preprocessing and Dialogue Preservation
expandContractionspreprocessor (packages/voice/src/contractions.ts).5. Hydration Alias Fallback Improvements
Updated
IntentTaginInteractView.tsxto receive simulation entities during rendering.Improved alias hydration by:
Ensures unmapped entities resolve to their canonical names (for example, "Bob" or "Bill") instead of the generic placeholder "an unfamiliar figure."