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 0
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: Replace the custom forced-function client with pydantic-ai for the structured calls 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`. Keep the current models and prompt text, while allowing provider configuration that uses native structured output and does not suppress reasoning or drop cost tracking.

Constraints:
- Change only the structured-call path in the named services and scripts. In modules that also use Jev, leave Jev’s calls and behavior alone; do not change `backend/app/providers/jev.py`.
- Do not migrate embeddings or unrelated follow-up work outside this scope.
- Keep the current production model settings, prompt text, returned data shapes, and service behavior. In particular, preserve the live-memory reasoning-effort setting and its longer timeout.
- Use provider-native structured output rather than requiring the current client’s forced function-by-name mode.
- Retain cost logging for attributed production calls in `llm_cost_log`, including provider, model, purpose, token counts, latency, and cost when available. Logging failures must not fail a model call.

Discretion:
- Choose how to adapt the current schema-dictionary call interface to pydantic-ai and whether to retain that interface for existing service injection and test fakes.
- Choose the provider/model configuration details and document them, provided the existing OpenRouter defaults and model settings continue to work and another provider can be selected without changing service prompts or call sites.
- Choose how to identify provider and model in cost-log entries, and how to collect usage and latency from pydantic-ai results.
- Update dependencies, lockfile, tests, and provider documentation as needed; preserve existing prompt-cache behavior where the selected provider supports it.

Acceptance criteria:
- Every scoped structured call goes through pydantic-ai and uses native structured output; the existing prompts and expected response shapes remain unchanged.
- The existing configured OpenRouter path and model defaults continue to work, and a documented alternative provider can be selected by configuration without edits to service or prompt code.
- Reasoning-effort settings continue to reach the model where configured, including live-memory calls and research-script effort options; structured output does not silently disable reasoning.
- Attributed production calls still produce best-effort entries in `llm_cost_log` with the existing usage, latency, and provider/model information.
- Tests cover structured-result handling, provider configuration, reasoning settings, and cost logging; the existing service and research-script tests pass.
- Jev calls and embedding calls remain unchanged.

Open questions:
- The repository shows `SHAPING_MODEL` defaulting to `openai/gpt-6-luna`, `LLM_BASE_URL` defaulting to OpenRouter, and live-memory reasoning effort defaulting to `high`, but it does not show deployed environment overrides. Can you confirm the current production model and provider values that must be preserved?
- For alternate providers, should configuration remain centered on `LLM_BASE_URL` and `LLM_API_KEY`, or do you expect explicit provider selection and separate settings per call role? Are there particular providers you need supported first?
- The research scripts describe their calls as not cost-logged, unlike attributed production calls. Should that existing research behavior remain, or should this initiative add research-run cost logging?
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 pydantic-ai and provider-native structured output instead of forced function-by-name mode. It scopes that migration to named structured calls rather than every model call, but that is the option the person chose.
- 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 covers structured-call migration and provider, reasoning, and cost-logging choices. It does not raise how to evaluate live executor memory or whether to reward predicting individual choices versus improving the completeness of a spec.
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 constraints explicitly require replacing the custom forced-function client with pydantic-ai and using provider-native structured output rather than the forced function-by-name mode, which is exactly the option the person later chose.
- 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 is about migrating structured 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 contributing to a fuller spec. That question is only in the same general area (live memory) and is not raised as a constraint, discretion item, acceptance criterion, or open question.
Every decision is recorded with what was ruled out and why. That record is the evidence.