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)
uvonly (pip is blocked). Absolute imports only. Python 3.14t.- No mocks, no monkeypatch, no skips, no pytest-xdist. Real infra (Redis 10.92.53.10, Neo4j 10.92.53.11 — Incus, NOT localhost).
- Tests must be OBSERVED: run via
python scripts/run_tests_streaming.py <paths> -j 8or pytest with-p orchestrata_ultimate.core.threading.pytest_live_observerbackgrounded. A full-suite run REQUIRES the kernel (never--skip kernelsilently). - Review before EVERY commit:
python scripts/code-review.py <files>+python scripts/test-review.py <test files>— fix findings, don't ship them. - No AI attribution anywhere — Mohamed is the sole author of commits.
- Never touch
~/workspace/orchestrata(frozen), never revert vendored janus/grpcio, never hand-editcontext.json(use the session CLI:session work/artifact/choice ...). - Push with:
env -u GITLAB_TOKEN git -c credential.helper='!glab auth git-credential' push - Work each task in a fresh worktree off PUSHED master; merge back fast-forward; delete the worktree after landing.
- Blocked on a genuine decision → record it via
session work --desc "BLOCKED: ..."and move to the next task. Never guess through a design fork; never expand a task's scope.
Context (what just landed — read before coding)
- The contract → gen-skeleton → leaf-fill workflow is proven end-to-end:
m3 authors the Mermaid contract,
scripts/serialize_codebase_ast.py gen-skeletonemits gated skeletons (Gate 0 construction smoke, Gate 2 leaf metrics, Gate 3skeleton-diffstructural-escape check), and both qwen3-coder-next and Claude Code filled leaves to 13/13 on the untouched oracle with zero structural escapes. Commits: 9f5dab86, a7b380b4, 32904d85, b2f542da. - Profiles:
openrouter-minimax(m3 orchestration + qwen coding) andclaude-hybridboth scored 13/13 on the LRU pipeline demo (scripts/e2e_run.py). DO NOT useclaude-hybriduntil the limit resets — it burns the Claude subscription. Useopenrouter-minimaxfor all runs. - Demo scoring harness: untouched oracle =
tests/core/test_lru_cache.pycopy + conftest shim (seelogs/e2e-runs/*/and session log, S227).
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.
- U:Ar emits the contract (
agents/volks/architect/volk.py): when the flag is on, the design prompt additionally requires a```mermaid classDiagramblock following the analyst conventions (stereotypes<<class>>/<<dataclass>>/<<enum>>/<<Protocol>>,%% traces spec=NNN ... reqs=REQ-NNN-NNNnumeric ids, bracket decorators{classmethod}etc., tilde generics allowed). Validate by PARSING it with the real generator (import seam or subprocessgen-skeleton --no-smoketo a temp file); a contract that fails Gate 1 → log WARNING and fall back to the freehand path (do NOT crash the pipeline). - 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.jsonnext to the skeleton. - 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, runpython scripts/serialize_codebase_ast.py skeleton-diff <skeleton> <final> --leafmap <leafmap>; STRUCTURAL result → record it viasession 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.
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).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.- Consider a
max_tokensguard 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
- After each task:
session work --desc "<what landed>" --details ...,session artifact --path <file>, commit, push. - Before 2026-07-14 18:00:
session handoff --alert "<state + what's parked>". - If ALL tasks land early: stop. Do not invent new work; sweep
session statusbacklog only if explicitly listed there as high priority.