Doenexecutor memory research
Prompts
1. Title: A new initiative starts with the executor's questionnaire What the person wrote: The new initiative prompt should take the user thro2. Memory of this project (the product context the code does not carry): Honor explicit product intent over stale wording, but preserve the pur3. Title: A new initiative starts with the executor's questionnaire What the person wrote: The new initiative prompt should take the user thro4. Memory of this project (the product context the code does not carry): Honor explicit product intent over stale wording, but preserve the pur5. Title: A new initiative starts with the executor's questionnaire What the person wrote: The new initiative prompt should take the user thro6. Memory of this project (the product context the code does not carry): Honor explicit product intent over stale wording, but preserve the pur7. Title: Live memory learns from the first initiative Intent: The executor's memory waits for five calls by a person before it dreams, and it8. Memory of this project (the product context the code does not carry): Honor explicit product intent over stale wording, but preserve the pur9. Title: Live memory learns from the first initiative Intent: The executor's memory waits for five calls by a person before it dreams, and it10. Memory of this project (the product context the code does not carry): Honor explicit product intent over stale wording, but preserve the pur11. Title: Live memory learns from the first initiative Intent: The executor's memory waits for five calls by a person before it dreams, and it12. Memory of this project (the product context the code does not carry): Honor explicit product intent over stale wording, but preserve the pur13. Title: Move Structured Calls to pydantic-ai Intent: Structured model calls still rely on a custom OpenAI-compatible client whose forced-fun14. Memory of this project (the product context the code does not carry): Honor explicit product intent over stale wording and propagate changes15. Title: Move Structured Calls to pydantic-ai Intent: Structured model calls still rely on a custom OpenAI-compatible client whose forced-fun16. Memory of this project (the product context the code does not carry): Honor explicit product intent over stale wording and propagate changes17. Title: Move Structured Calls to pydantic-ai Intent: Structured model calls still rely on a custom OpenAI-compatible client whose forced-fun18. Memory of this project (the product context the code does not carry): Honor explicit product intent over stale wording and propagate changes
BD-125 · stateless · seed 2
Title: Move Structured Calls to pydantic-ai

Intent: Structured model calls still rely on a custom OpenAI-compatible client whose forced-function output mode can disable reasoning and is rejected by some models. Move the scoped calls to pydantic-ai so they use provider-native structured output, preserve current production models and prompts, and can be configured for other providers without losing reasoning or cost tracking. This initiative covers the listed services and research scripts; Jev remains separate, and any remaining follow-up outside that scope is not included.
Claude
Intent: Move the scoped structured model calls from the custom OpenAI-compatible client to pydantic-ai, using provider-native structured output so structured responses do not depend on forcing a named function call. Preserve the production models and prompts, keep reasoning and cost tracking, and make the calls configurable for other providers.

Constraints:
- Do not rewrite the existing prompts or change the production model defaults. Keep the current model and endpoint configuration working, including SHAPING_MODEL and LLM_BASE_URL.
- For each migrated call, preserve its expected structured fields and the caller-visible success and failure behavior; a failed or invalid response must not be treated as a successful result.
- Keep reasoning configurable and preserve the live-memory reasoning-effort setting rather than disabling reasoning as a side effect of structured output.
- Continue recording attributable calls in llm_cost_log, including the project_id, provider, model, purpose, prompt_tokens, completion_tokens, total_tokens, latency_ms, and cost_usd where available. Logging failures should not turn a successful model response into a failed call.
- Keep the existing LLM_PROMPT_CACHE configuration and preserve its behavior where the selected provider supports it.
- Keep Jev and its provider-native judgment calls separate. Do not include unrelated follow-up work outside the agreed scope.

Discretion:
- Choose how to represent the existing response shapes as pydantic-ai output types and how to adapt results back to the interfaces the services and scripts already use.
- Choose the shared provider configuration and client lifecycle implementation, provided existing environment configuration remains compatible and alternate providers can be configured.
- Add or adjust tests for provider configuration, structured validation, reasoning settings, error handling, and cost logging.

Acceptance criteria:
- Every agreed scoped structured call uses pydantic-ai structured output rather than the custom client's forced named-function output path.
- Tests show that each migrated call returns the response shape its callers expect, and handles invalid output and provider errors without persisting or returning a misleading success.
- The production model and prompt behavior is unchanged, and reasoning remains configurable without being suppressed by the structured-output mechanism.
- Tests verify that tracked calls still produce the expected llm_cost_log data, including usage, model, purpose, latency, and cost when supplied by the provider.
- A non-default provider can be configured without changing prompts or service call sites; supported reasoning and cost metadata are retained.
- Jev behavior and unrelated follow-up work remain unchanged.

Open questions:
- The initiative refers to listed services and research scripts but does not enumerate them. Should the scope be all structured-call sites in backend/app/services/ambiguity.py, classification.py, correction_review.py, learn.py, live_memory.py, review.py, and shaping.py, plus backend/app/measure_memory_replay.py, replay_live_dreams.py, and replay_live_predictions.py? Should the evaluation harness in backend/tests/evals/test_shaping_classification_eval.py also be migrated?
- Which alternate providers should be explicitly supported or tested in this initiative, beyond making provider configuration possible?
Claude
- How should model calls get structured output, now that the forced-tool-call trick in our own client disabled luna's reasoning and is rejected by Opus 5.5? → raised: True, leaned: chosen. The draft explicitly requires migrating the scoped structured calls to pydantic-ai with provider-native structured output instead of forced function calls. That matches the chosen approach, though the draft limits scope rather than saying every model call.
- How should live executor memory be evaluated, given that a person's single choice on a call is noisy (context limits, misreadings, ambiguous questions)? → raised: False, leaned: neither. The draft concerns migrating structured model calls and explicitly leaves scope and provider support open. It does not raise how to evaluate live executor memory or whether to reward prediction of individual choices versus improving specs from recorded history.
Claude
- How should model calls get structured output, now that the forced-tool-call trick in our own client disabled luna's reasoning and is rejected by Opus 5.5? → raised: True, leaned: chosen. The draft's intent and acceptance criteria explicitly commit to moving scoped structured calls to pydantic-ai with provider-native structured output instead of the custom client's forced named-function path, matching the chosen option.
- How should live executor memory be evaluated, given that a person's single choice on a call is noisy (context limits, misreadings, ambiguous questions)? → raised: False, leaned: neither. The draft concerns migrating structured model calls to pydantic-ai and preserving behavior; it does not take up how live executor memory should be evaluated or whether to reward predicting single choices versus enriching the spec. The evaluation harness is mentioned only as a possible migration site, not the evaluation methodology question.
Every decision is recorded with what was ruled out and why. That record is the evidence.