Orchestrata Ultimate › Plans › kimi-continuation-2026-07-13

Kimi continuation plan — 2026-07-13 evening → 2026-07-14 18:00

Source: plans/kimi-continuation-2026-07-13.md at 8a2cb42ad · last changed 2026-07-27 · first committed 2026-07-13 · 141 lines.

Prose pending.

Plan text

Kimi continuation plan — 2026-07-13 evening → 2026-07-14 18:00

Claude weekly limit is nearly exhausted; kimi carries the work until tomorrow 18:00. Everything below runs on OpenRouter/Moonshot + local infra — zero Claude tokens. Work the tasks IN ORDER; one at a time; land each fully (tests + review + commit + push) before starting the next.

Ground rules (non-negotiable — from CLAUDE.md / AGENTS.md)

Context (what just landed — read before coding)

T1 — Wire the skeleton flow into the volk pipeline (flag-gated)

The three-seam change, all seams exist. Gate the whole flow behind env ORCHESTRATA_SKELETON_FLOW=1 (read via os.environ.get through the env seam) so default behavior is UNCHANGED.

  1. U:Ar emits the contract (agents/volks/architect/volk.py): when the flag is on, the design prompt additionally requires a ```mermaid classDiagram block following the analyst conventions (stereotypes <<class>>/<<dataclass>>/<<enum>>/<<Protocol>>, %% traces spec=NNN ... reqs=REQ-NNN-NNN numeric ids, bracket decorators {classmethod} etc., tilde generics allowed). Validate by PARSING it with the real generator (import seam or subprocess gen-skeleton --no-smoke to a temp file); a contract that fails Gate 1 → log WARNING and fall back to the freehand path (do NOT crash the pipeline).
  2. Skeleton stage between Ar and Junior: run gen-skeleton (with Gate 0) into the run workspace. Gate-0 failure → freehand fallback + WARNING. Keep the .leafmap.json next to the skeleton.
  3. Junior leaf-fill brief: when a skeleton exists, the codegen task becomes "fill ONLY the # IMPLEMENT: leaves; change no signature, base, decorator, or non-leaf code; keep every import; output the COMPLETE file". After Junior goes green, run python scripts/serialize_codebase_ast.py skeleton-diff <skeleton> <final> --leafmap <leafmap>; STRUCTURAL result → record it via session work (this is the Gate-3 escalation signal) and accept the build anyway for now (observation mode — no auto-revert).

Tests: one per seam, real infra, no mocks — mirror the patterns in tests/orchestrator/test_pipeline_runner_*.py and tests/agents/volks/architect/. Full targeted suite green before commit.

T2 — Loosened-intent demo run (observation, cheap)

Run the deliberately vague intent through the normal (non-skeleton) pipeline:

uv run python scripts/e2e_run.py \
  --intent "Build a reusable in-memory cache module for a Python 3.14 free-threaded service. It should evict old entries, support expiry, be safe under concurrent threads, and report usage stats." \
  --slug lru-loose-1 --profile openrouter-minimax \
  --answer "Your judgment on all open questions; favor correctness and stdlib-only. Proceed." \
  --answer "Your judgment; proceed." --answer "Your judgment; proceed."

Score honestly: does the API converge on get/put/invalidate/stats semantics? Write a behavioral test against THEIR chosen API (do not force the oracle's names), run it, and record pass/fail + observations (clarification quality, misroutes, cost from conversation.jsonl usage fields) via session work. Repeat once if the run crashes for an infra reason; a model-behavior crash is itself the finding.

T3 — SPEC-025 amendment + traces (spec debt from the Claude track)

src/orchestrata_ultimate/drivers/claude_settings.py and scripts/claude_governance_gate.py carry NO @traces because SPEC-025 has no requirement rows for: --model/persona/--output-format json/--resume/ --settings on ClaudeCodeDriver, settings generation, and the PreToolUse governance gate. Add a "Phase 2 — governance gate" requirements section to specs/025-code-generation-drivers/checklists/requirements.md (follow the file's existing row format, next free REQ-025-NNN ids), then add matching @traces decorators to the two modules and the new driver methods, and run python scripts/serialize_codebase_ast.py check-traces + python scripts/generate_rtm_evidence.py to verify the rows land.

T4 — Provider-routing honesty + backoff (backlog, HIGH)

Evidence: run-4, U:PM crashed with 6 sub-second retries of "No eligible provider found" at 13:35:16 while U:BA succeeded 1s earlier — the openrouter TPM limiter (100K/min default) was exhausted by a 180K-char runaway.

  1. providers/router.py / provider_manager.py: the "No eligible provider found" error must NAME the cause per candidate — breaker open / RPM exhausted / TPM exhausted / unknown model (no weasel words).
  2. llm/client.py _execute_with_retry: when the failure is rate-window exhaustion, back off past the window remainder instead of burning all retries inside the same second.
  3. Consider a max_tokens guard on volk calls (the 8-minute 180K-char runaway also poisoned TPM) — if this needs a per-volk config decision, record BLOCKED and skip.

Tests for 1+2 with the real RateLimiter/CircuitBreaker classes.

T5 — diagram_to_code retirement REPORT (no deletion)

gen-skeleton has now absorbed relations/decorators/defaults/namespaces. Produce plans/diagram-to-code-parity.md: feature-by-feature parity table (cite file:line both sides), what still ONLY exists in diagram_to_code, which tests would migrate, and a recommendation. DO NOT delete or deprecate anything — the decision is Mohamed's.

Reporting protocol