feat: add dual-domain program exit demo and production handoff - #28
feat: add dual-domain program exit demo and production handoff#28ctrl-is wants to merge 5 commits into
Conversation
AQUINTERO446
left a comment
There was a problem hiding this comment.
Review — dual-domain exit demo + production handoff
Thorough review done in an isolated worktree (ruff 0.15.8 run, demo API surface traced against source). Code is functionally sound, but the PR fails ruff check . — a gate the handoff doc itself requires — so requesting changes for a one-command fix.
🔴 Critical — ruff check . fails (4 × I001)
Despite the chore: restore repo-wide ruff compliance commit, uv run ruff check . reports 4 unsorted import blocks (inline comments below). In each file the bare import capillary_actions_sdk was moved down into the first-party group, while the from capillary_actions_sdk.… lines stayed in the third-party group; ruff wants the bare import at the top of the third-party group. docs/proposal/handoff.md lists uv run ruff check . in the Program Exit Checklist, so the PR contradicts its own gate.
Fix: uv run ruff check --fix . (auto-fixable) — this also removes the entire import-churn diff in those 4 otherwise-untouched files. ruff format --check passes.
🟡 Warnings
demos/demo_dual_domain.pyusesfrom demo_education import run_memory_roundtrip— a sibling-module import that only resolves because the script's own dir is onsys.path[0]. Works via the documenteduv run python demos/demo_dual_domain.py, but breaks underpython -m demos.demo_dual_domain.
🟢 Suggestions
demos/demo_education.pywritebackcontentchanged from{"courses": ["demo_course"]}→{}(inline note). Verified benign — an empty dict still creates a surviving entry, so the roundtrip pass/fail is unaffected — but the demo now round-trips an empty payload, which is less illustrative. Confirm intentional.
✅ Verified sound
- New demo API surface all resolves:
find_eval_case("coop-finance")→build_finance_eval_case();run_engagement_streaming(skill_name, subject_id, thread_id, input_data)signature matches;EngagementEvalCase.input_dataexists;run_eval_suite/format_reportpresent. run_memory_roundtriprefactor is clean and ruff-clean; test-file changes are formatting/quote-normalization only (no logic change).
Verdict: FAIL on the ruff gate — but it's a one-command fix. Run ruff check --fix, force-push, and this is a PASS.
| @@ -11,7 +11,6 @@ | |||
| from pathlib import Path | |||
|
|
|||
| import capillary_actions_sdk | |||
There was a problem hiding this comment.
🔴 ruff check (I001): the bare import capillary_actions_sdk belongs at the top of the third-party group, above from capillary_actions_sdk.…, not here in the first-party block. ruff check --fix corrects it.
| from capillary_actions_sdk.models.student_model import PreferenceSignal | ||
| from capillary_actions_sdk.schema.domain_schema import load | ||
|
|
||
| import capillary_actions_sdk |
There was a problem hiding this comment.
🔴 ruff check I001 fails here — same misordered import capillary_actions_sdk. Run ruff check --fix.
| from capillary_actions_sdk.schema.domain_schema import load | ||
| from pydantic_ai.models.test import TestModel | ||
|
|
||
| import capillary_actions_sdk |
There was a problem hiding this comment.
🔴 ruff check I001 fails here — same misordered import capillary_actions_sdk. Run ruff check --fix.
| ) | ||
| from capillary_actions_sdk.schema.domain_schema import load | ||
|
|
||
| import capillary_actions_sdk |
There was a problem hiding this comment.
🔴 ruff check I001 fails here — same misordered import capillary_actions_sdk. Run ruff check --fix.
| output["writeback"] = { | ||
| "dimension": case.orchestrator.schema.dimension_names[0], | ||
| "content": {"courses": ["demo_course"]}, | ||
| "content": {}, |
There was a problem hiding this comment.
🟢 Writeback content is now {} (was {"courses": ["demo_course"]}). Verified benign — an empty dict still creates a surviving entry so the roundtrip still passes — but the demo now round-trips an empty payload, which is less illustrative of real content persistence. Intentional?
|
I reran the Ruff gate directly on the current PR branch: uv run ruff check --fix .
uv run ruff format --check .
uv run ruff check .The results were:
I also previously ran the full program-exit validation on this branch, with the full test suite, eval suite, |
Summary
Completes DS-W8, the Primer Core program-exit gate, by assembling the existing Knowledge Graph, Learning Data, Didactic Skills, and evaluation work into one dual-domain demonstration and production handoff.
The new exit demo runs both
educationandcoop-financethrough the same orchestration engine, exercises the typed AG-UI streaming surface, demonstrates cross-session memory write-back, and then runs the existing swap-parity and transition-metric harness.Changes
Dual-Domain Exit Demo
Added
demos/demo_dual_domain.pyas the one-command program finale.For both
educationandcoop-finance, the demo:EngagementOrchestrator.run_engagement_streaming.AGUIEventinstances.MemoryCore.ingest -> FileMemoryStore.assemble_working_memorysurfaces the first session's persisted outcome.run_swap_parity.timeout=.Education Memory Demo
Refactored
demos/demo_education.pyso its memory round-trip path can be reused by the dual-domain demo while preserving the existing education demo entrypoint andDEMO SUCCESSoutput contract.Production Handoff
Added
docs/proposal/handoff.mdcovering:WorkflowCliRunner,PgVectorKnowledgeBase, andFileMemoryStore.KnowledgeBaseUnavailabledegradation behavior.primer-eval, eval-marked tests, and all three demos.Program Exit Results
Full Suite
uv run pytest -m 'not manual' -qEval Marker
uv run pytest -m eval -vPrimer Eval
uv run primer-evaldeclarative_orchestration✅typed_models✅port_conformance✅protocol_compliance✅stateless_agents✅run_swap_parity✅Knowledge-Base Domain Swap Demo
uv run python demos/kb_domain_swap.pyEducation Memory Demo
uv run python demos/demo_education.pyFileMemoryStoreDual-Domain Exit Demo
uv run python demos/demo_dual_domain.pyExit-Gate Checklist
run_swap_paritysummary printed.primer-evalpasses 7/7.Notes
This PR is primarily an assembly and handoff change. It reuses the existing orchestration, memory, domain-pack, parity, and evaluation machinery rather than introducing a separate demo-specific engine path.
The dual-domain demo exits with status
0only when every required program-exit leg passes.