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 · memory · seed 0
Memory of this project (the product context the code does not carry):
Honor explicit product intent over stale wording and propagate changes through affected artifacts, including installed executor guidance. Preserve material guarantees while preferring simple structural fixes. Keep deployment and live-behavior claims open until observed; mechanism tests are not outcomes. Use deterministic default gates and narrow, same-set model comparisons: test the requested candidate against the incumbent, choose the cheapest measured gain, and stop pursuing losers. Learn from visible executor calls on completed work, with human decisions and corrections weighted more. Continue reversible live experiments after thin, inconclusive replay negatives only under controls and kill rules. Prefer deliberate, product-specific triggers tied to finished

Heuristics you can open with open_heuristic: intent-over-literal-wording, keep-real-world-measurements-open, prefer-simple-rules-and-low-ceremony, protect-contracts-with-explicit-addition, measure-before-judging-and-iterate, deterministic-gates-for-deterministic, automate-routine-judgment-but-protect, live-experiments-need-controls

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, so they can use provider-native structured output without the forced-function mode that can prevent reasoning or be rejected by some models. Keep the current production model choices and prompts, while making the calls configurable for other providers and retaining cost tracking.

Constraints:
- Scope this change to the StructuredLLM calls in backend/app/services/ambiguity.py, backend/app/services/classification.py, backend/app/services/correction_review.py, backend/app/services/learn.py, backend/app/services/live_memory.py, backend/app/services/review.py, and backend/app/services/shaping.py, plus the research scripts backend/app/measure_memory_replay.py, backend/app/replay_live_dreams.py, and backend/app/replay_live_predictions.py. In files that use both providers, migrate only the structured-call path.
- Keep Jev separate and unchanged; in particular, do not change the Jev provider or its call paths in backend/app/providers/jev.py.
- Preserve the existing model choices, prompts, structured result shapes, and clean failure behavior. Use provider-native structured output rather than forcing a function by name.
- Carry through reasoning configuration for calls that use it, including the live-memory reasoning setting. Do not imply that configuration alone proves a model actually produced reasoning.
- Keep project-attributed successful calls represented in llm_cost_log with provider, model, purpose, token counts, latency_ms, and cost_usd when the provider supplies it. Preserve the existing nullable cost behavior and do not silently drop attribution.

Discretion:
- Choose how to express the existing structured-call interface and schemas in pydantic-ai, provided the callers' result and failure contracts remain intact.
- Choose the simplest provider configuration and client lifecycle that supports the agreed provider targets and works with the existing service factories and research scripts.
- Update tests and dependency/configuration documentation affected by the migration; avoid unrelated model, prompt, or service behavior changes.

Acceptance criteria:
- The backend dependency and provider integration use pydantic-ai for every scoped structured-call path, and tests verify structured results and clean failures without outbound model calls.
- Tests verify that existing model selections, prompts, and reasoning settings are carried through, and that the scoped calls use native structured output rather than forced-function mode.
- Tests verify project-attributed successful calls are logged to llm_cost_log with the correct provider, model, purpose, token counts, and latency; cost is retained when supplied and remains nullable when not supplied.
- Jev behavior remains unchanged. Tests of request construction and cost logging count as mechanism checks only; any claim that the deployed production model actually reasons remains open until confirmed by a live observation.

Open questions:
- Which additional providers must be supported now, and should custom OpenAI-compatible endpoints remain supported alongside pydantic-ai's provider integrations?
- Is a credentialed live check of the current production model expected as part of this work, or should confirmation that reasoning occurs remain pending until after deployment?
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: other. The draft explicitly raises how structured output should be implemented and recommends provider-native structured output through pydantic-ai. But it scopes that migration to specified StructuredLLM paths and explicitly keeps Jev unchanged, rather than moving every model call to pydantic-ai as 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 the structured-call migration, provider support, reasoning, and cost tracking. It does not raise how live executor memory should be evaluated or whether memory should be rewarded for predicting individual choices versus enriching 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 explicitly requires using provider-native structured output rather than forced-function mode for the scoped structured calls, and commits to migrating those calls to pydantic-ai, 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 LLM calls to pydantic-ai, preserving models, prompts, cost logging, and Jev behavior. It does not take up how live executor memory should be evaluated or whether to reward predicting single choices versus contributing to a more complete 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.