1414
1515<p align =" center " >
1616 <img alt =" Python " src =" https://img.shields.io/badge/Python-3.11%2B-3776AB?style=flat-square&logo=python&logoColor=white " >
17- <img alt =" Tests " src =" https://img.shields.io/badge/tests-738 %20passed-brightgreen?style=flat-square " >
17+ <img alt =" Tests " src =" https://img.shields.io/badge/tests-1027 %20passed-brightgreen?style=flat-square " >
1818 <img alt =" Package " src =" https://img.shields.io/badge/package-minicode--py-555?style=flat-square " >
1919</p >
2020
2121MiniCode Python is the Python implementation in the MiniCode family. The main
2222project is [ LiuMengxuan04/MiniCode] ( https://github.com/LiuMengxuan04/MiniCode ) ;
23- this repository explores a Python-first agent runtime with cybernetic control,
24- adaptive memory, and a testable local tool loop.
23+ this repository now focuses on a Python-first agent runtime with cybernetic
24+ control, adaptive memory, durable sessions, rewindable local edits, and
25+ testable product surfaces for real local use.
2526
2627Instead of treating context pressure, tool failures, memory noise, and cost
2728drift as prompt-only problems, MiniCode Python measures them during execution
@@ -46,40 +47,46 @@ That makes this repository useful as:
4647
4748| Area | What MiniCode Python Adds |
4849| --- | --- |
49- | Runtime control | ` CyberneticOrchestrator ` coordinates context, cost, feedback, progress, memory, and recovery controllers. |
50- | Context management | PID-style context pressure handling, compaction, budget adjustment, and predictive guards. |
51- | Memory | Domain-aware retrieval, optional LLM reranking, prompt injection, reflection write-back, and maintenance. |
52- | Tool loop | Local file/search/edit/command tools with scheduler-aware execution and error nudges. |
53- | Recovery | Self-healing paths for context overflow, tool failures, oscillation, and resource pressure. |
54- | Verification | Focused unit, integration, stress, and cybernetics tests across the active root package. |
50+ | Runtime control | ` TurnKernel ` , ` CyberneticOrchestrator ` , and runtime profiles (` single ` , ` single-deep ` ) coordinate phase-aware execution, widening, verification gates, and recovery. |
51+ | Context management | PID-style context pressure handling, compaction, budget adjustment, predictive guards, and runtime timelines. |
52+ | Memory | Domain-aware retrieval, optional reranking, prompt injection, reflection write-back, maintenance, and working-memory importance tracking. |
53+ | Tool loop | Local file/search/edit/command tools with scheduler-aware execution, structured progress, and local slash-command surfaces. |
54+ | Recovery | Self-healing paths for context overflow, tool failures, oscillation, provider outages, rewind safety, and bounded fallback chains. |
55+ | Product surfaces | Session inspect/replay, checkpoint preview/rewind, readiness reporting, hook and instruction summaries, and benchmark artifacts. |
56+ | Verification | Focused unit, integration, stress, cybernetics, runtime-profile, and release-readiness tests across the active root package. |
5557
5658## Architecture
5759
5860``` mermaid
5961flowchart LR
6062 User["User task"] --> Loop["agent_loop.py"]
61- Loop --> Tools["Local tools<br/>files, search, edit, shell"]
63+ Loop --> Kernel["turn_kernel.py<br/>phase policy, widening,<br/>verification gate"]
64+ Kernel --> Tools["Local tools<br/>files, search, edit, shell"]
6265 Tools --> Loop
6366
64- Loop --> Sensors["Sensors<br/>context, cost, errors, progress"]
67+ Loop --> Sensors["Sensors<br/>context, cost, errors,<br/> progress, provider state "]
6568 Sensors --> Orchestrator["CyberneticOrchestrator"]
66- Orchestrator --> Control["Controllers<br/>PID, Kalman, prediction,<br/>memory, model, progress"]
67- Control --> Actions["Runtime actions<br/>compact, cap concurrency,<br/>adjust budget, inject memory,<br/>recover, reflect "]
69+ Orchestrator --> Control["Controllers<br/>PID, prediction,<br/>memory, model, progress"]
70+ Control --> Actions["Runtime actions<br/>compact, cap concurrency,<br/>adjust budget, inject memory,<br/>recover, checkpoint, rewind "]
6871 Actions --> Loop
6972```
7073
71- The main loop now drives the orchestrator lifecycle directly:
74+ The main loop now drives the orchestrator lifecycle directly and layers it with
75+ the turn kernel, runtime profiles, and product surfaces:
7276
7377- ` wire_memory() `
7478- ` wire_healing() `
7579- ` inject_memories() `
7680- ` step_start() `
7781- ` step_end() `
7882- ` reflect_on_task() `
83+ - ` derive_turn_step_policy() `
84+ - ` activate_widening() `
85+ - ` record_runtime_event() `
7986
8087This keeps controller initialization, memory injection, per-step observation,
81- feedback, self-healing, and post-task reflection tied to the same runtime
82- surface.
88+ feedback, self-healing, checkpointing, verification, and post-task reflection
89+ tied to the same runtime surface.
8390
8491## Repository Status
8592
@@ -90,6 +97,8 @@ The active package is the root package configured in `pyproject.toml`.
9097| ` minicode/ ` | Canonical Python package used by install and tests. |
9198| ` tests/ ` | Active test suite. |
9299| ` py-src/minicode/ ` | Compatibility/staging mirror kept aligned for migration work. |
100+ | ` benchmarks/ ` | Runtime profile and release-readiness benchmark entrypoints plus generated reports. |
101+ | ` openspec/ ` | Productization specs, archived changes, and implementation checklists. |
93102| ` docs/OPTIMIZATION_SUMMARY.md ` | Full optimization and integration record. |
94103| ` docs/memory_theory.md ` | Memory/control theory notes. |
95104
@@ -117,6 +126,12 @@ Or run the module directly:
117126python -m minicode.main
118127```
119128
129+ Useful local product surfaces now available from the CLI and TUI include:
130+
131+ - ` /session ` , ` /sessions ` , ` /session-replay `
132+ - ` /checkpoints ` , ` /rewind ` , ` /rewind-preview `
133+ - ` /readiness `
134+
120135## Verification
121136
122137The current root package was verified with:
@@ -129,46 +144,59 @@ pytest -q
129144Latest local result:
130145
131146``` text
132- 738 passed, 2 skipped, 3 warnings
147+ 1027 passed, 2 skipped, 3 warnings
133148```
134149
135150The warnings are unregistered ` pytest.mark.benchmark ` markers in benchmark
136151tests. They do not indicate failing behavior.
137152
153+ Additional product-level checks now live in:
154+
155+ - ` benchmarks/runtime_profile_eval.py `
156+ - ` benchmarks/release_readiness.py `
157+
138158## Core Modules
139159
140160| Module | Purpose |
141161| --- | --- |
142- | ` minicode/agent_loop.py ` | Main model/tool loop and runtime control integration. |
162+ | ` minicode/agent_loop.py ` | Main model/tool loop, runtime event flow, and product-surface integration. |
163+ | ` minicode/turn_kernel.py ` | Step-policy kernel for phases, widening, verification gates, and typed turn decisions. |
164+ | ` minicode/runtime_profiles.py ` | Runtime profile definitions such as ` single ` and ` single-deep ` . |
143165| ` minicode/cybernetic_orchestrator.py ` | Facade for controller lifecycle hooks. |
144166| ` minicode/context_cybernetics.py ` | Context sensing, PID control, and compaction loop. |
145167| ` minicode/feedback_controller.py ` | Outer-loop system-state to control-signal mapping. |
146168| ` minicode/self_healing_engine.py ` | Fault detection and recovery delegation. |
147169| ` minicode/memory_pipeline.py ` | Unified memory read/inject/write/maintain facade. |
148- | ` minicode/memory_reranker.py ` | LLM-backed memory curation. |
149- | ` minicode/domain_classifier.py ` | Task and file-domain inference. |
150- | ` minicode/model_registry.py ` | Model selection controller. |
170+ | ` minicode/session.py ` | Durable session storage, inspect/replay views, checkpoint trails, and rewind helpers. |
171+ | ` minicode/product_surfaces.py ` | Readiness, hook, instruction, delegation, and extension-facing summaries. |
172+ | ` minicode/release_readiness.py ` | Release-oriented runtime smoke and provider-readiness reporting. |
173+ | ` minicode/model_switcher.py ` | Bounded model/provider fallback selection and failover wiring. |
174+ | ` minicode/model_registry.py ` | Model selection controller and availability metadata. |
151175| ` minicode/progress_controller.py ` | Task health and stall detection. |
152176
153177## MiniCode Family
154178
155179| Version | Repository | Focus |
156180| --- | --- | --- |
157181| TypeScript | [ LiuMengxuan04/MiniCode] ( https://github.com/LiuMengxuan04/MiniCode ) | Mainline terminal agent, TUI, MCP, skills, sessions, context controls. |
158- | Python | [ QUSETIONS/MiniCode-Python] ( https://github.com/QUSETIONS/MiniCode-Python ) | Cybernetic Python runtime, memory pipeline, verification-oriented experiments. |
182+ | Python | [ QUSETIONS/MiniCode-Python] ( https://github.com/QUSETIONS/MiniCode-Python ) | Cybernetic Python runtime, session/rewind product surfaces, readiness reporting, and verification-oriented experiments. |
159183| Rust | [ harkerhand/MiniCode-rs] ( https://github.com/harkerhand/MiniCode-rs/tree/master ) | Rust implementation and systems-side experimentation. |
160184| Java | [ hobbescalvin414-tech/minicode4j] ( https://github.com/hobbescalvin414-tech/minicode4j/tree/feat/default-ts-ui ) | Java implementation with a TypeScript-style UI direction. |
161185
162186## Documentation
163187
164188- [ Optimization Summary] ( ./docs/OPTIMIZATION_SUMMARY.md )
165189- [ Memory Theory] ( ./docs/memory_theory.md )
190+ - [ Minicode-lite Productization Design] ( ./docs/superpowers/specs/2026-06-05-minicode-lite-productization-design.md )
191+ - [ Minicode-lite Build Plan] ( ./docs/superpowers/plans/2026-06-05-minicode-lite-productization-build.md )
192+ - [ Minicode-lite Verify Report] ( ./docs/superpowers/reports/2026-06-05-minicode-lite-productization-verify.md )
166193- [ Main MiniCode Repository] ( https://github.com/LiuMengxuan04/MiniCode )
167194
168195## Design Principles
169196
170197- Keep the agent loop inspectable.
171198- Prefer measured runtime signals over hidden prompt magic.
172- - Apply bounded actions: compact, cap, adjust, recover, reflect.
199+ - Apply bounded actions: compact, cap, adjust, recover, rewind, reflect.
173200- Treat verification and evidence as part of the agent runtime.
201+ - Make sessions, checkpoints, replay, and readiness first-class product surfaces.
174202- Keep the Python implementation useful as both software and research scaffold.
0 commit comments