coderio 0.4.2__tar.gz → 0.4.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {coderio-0.4.2 → coderio-0.4.4}/.github/workflows/ci.yml +7 -5
- {coderio-0.4.2 → coderio-0.4.4}/CHANGELOG.md +61 -0
- coderio-0.4.4/PKG-INFO +152 -0
- coderio-0.4.4/README.md +107 -0
- coderio-0.4.4/README_en.md +107 -0
- {coderio-0.4.2 → coderio-0.4.4}/docs/coderio-architecture.md +16 -11
- {coderio-0.4.2 → coderio-0.4.4}/pyproject.toml +10 -9
- coderio-0.4.4/src/coderio/agent/custom_agents.py +94 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/agent/deep_loop.py +144 -28
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/agent/harness.py +7 -5
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/agent/harness_middleware.py +16 -2
- coderio-0.4.4/src/coderio/agent/plan_artifact.py +130 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/agent/prompts.py +2 -1
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/cli/commands.py +35 -4
- coderio-0.4.4/src/coderio/cli/custom_commands.py +150 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/cli/repl.py +9 -3
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/cli/tui.py +37 -291
- coderio-0.4.4/src/coderio/cli/tui_runtime.py +375 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/config/loader.py +5 -6
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/config/trust.py +55 -6
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/session/message.py +3 -1
- coderio-0.4.4/src/coderio/skills/parser.py +77 -0
- coderio-0.4.4/src/coderio/tools/checkpoint.py +105 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/tools/command_policy.py +95 -25
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/tools/edit_file.py +5 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/tools/multi_edit.py +4 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/tools/win_sandbox.py +0 -4
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/tools/write_file.py +6 -1
- coderio-0.4.4/tests/agent/test_custom_agents.py +190 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/agent/test_deepagents_compat.py +12 -2
- coderio-0.4.4/tests/agent/test_plan_artifact.py +180 -0
- coderio-0.4.4/tests/cli/test_custom_commands.py +327 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/cli/test_tui_picker.py +1 -1
- coderio-0.4.4/tests/cli/test_tui_runtime.py +138 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/cli/test_ux_features.py +2 -1
- {coderio-0.4.2 → coderio-0.4.4}/tests/config/test_trust.py +144 -2
- coderio-0.4.4/tests/test_seams.py +1563 -0
- coderio-0.4.4/tests/tools/test_checkpoint.py +318 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/tools/test_command_policy.py +36 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/tools/test_sandbox.py +99 -0
- coderio-0.4.2/PKG-INFO +0 -535
- coderio-0.4.2/README.md +0 -487
- coderio-0.4.2/README_en.md +0 -490
- coderio-0.4.2/src/coderio/skills/parser.py +0 -50
- {coderio-0.4.2 → coderio-0.4.4}/.github/dependabot.yml +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/.github/workflows/release.yml +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/.gitignore +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/CONTRIBUTING.md +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/LICENSE +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/THIRD_PARTY_LICENSES.md +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/scripts/verify_deepagent_live.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/scripts/verify_harness_live.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/__init__.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/agent/__init__.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/agent/_deepagents_compat.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/agent/command_review.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/agent/hooks.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/agent/permission_middleware.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/agent/skill_tool.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/agent/state.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/agent/stream.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/cli/__init__.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/cli/app.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/cli/credentials.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/cli/mcp_cmd.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/cli/multimodal.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/cli/onboarding.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/cli/providers.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/cli/render.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/cli/run_cmd.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/cli/skills_cmd.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/cli/stream.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/cli/tui_onboarding.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/cli/tui_screens.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/cli/tui_widgets.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/config/__init__.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/config/bootstrap.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/config/models.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/llm/__init__.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/llm/factory.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/llm/probe.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/mcp_loader.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/session/__init__.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/session/store.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/skills/__init__.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/skills/bundled/executing-plans/SKILL.md +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/skills/lion-skills/LICENSE +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/skills/lion-skills/README.md +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/skills/lion-skills/skills/clarifying-questions/SKILL.md +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/skills/lion-skills/skills/clarifying-questions/evals/evals.json +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/skills/lion-skills/skills/code-review/SKILL.md +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/skills/lion-skills/skills/code-review/evals/evals.json +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/skills/lion-skills/skills/commit-message/SKILL.md +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/skills/lion-skills/skills/commit-message/evals/evals.json +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/skills/lion-skills/skills/debugging/SKILL.md +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/skills/lion-skills/skills/debugging/evals/evals.json +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/skills/lion-skills/skills/error-handling/SKILL.md +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/skills/lion-skills/skills/error-handling/evals/evals.json +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/skills/lion-skills/skills/lion-writing-skills/SKILL.md +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/skills/lion-skills/skills/lion-writing-skills/evals/evals.json +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/skills/lion-skills/skills/naming/SKILL.md +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/skills/lion-skills/skills/naming/evals/evals.json +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/skills/lion-skills/skills/onboarding-unknown-codebase/SKILL.md +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/skills/lion-skills/skills/onboarding-unknown-codebase/evals/evals.json +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/skills/lion-skills/skills/spec-writing/SKILL.md +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/skills/lion-skills/skills/spec-writing/evals/evals.json +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/skills/lion-skills/skills/task-breakdown/SKILL.md +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/skills/lion-skills/skills/task-breakdown/evals/evals.json +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/skills/lion-skills/skills/testing/SKILL.md +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/skills/lion-skills/skills/testing/evals/evals.json +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/skills/lion-skills/skills/verify-and-fix/SKILL.md +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/skills/lion-skills/skills/verify-and-fix/evals/evals.json +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/skills/models.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/skills/store.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/tools/__init__.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/tools/base.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/tools/bash.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/tools/glob_tool.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/tools/grep_tool.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/tools/linux_sandbox.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/tools/list_dir.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/tools/note.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/tools/permission.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/tools/read_file.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/tools/sandbox_runner.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/tools/todo.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/tools/web_fetch.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/tools/web_search.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/src/coderio/tools/win_job.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/__init__.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/agent/__init__.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/agent/conftest.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/agent/test_command_review.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/agent/test_deep_integration.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/agent/test_deep_loop.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/agent/test_deep_loop_unit.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/agent/test_harness.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/agent/test_harness_middleware.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/agent/test_hooks.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/agent/test_perf_baseline.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/agent/test_prompts.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/agent/test_skill_tool.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/agent/test_state.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/agent/test_stream.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/cli/__init__.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/cli/test_app.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/cli/test_command_menu.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/cli/test_commands.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/cli/test_credentials.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/cli/test_input_isolation.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/cli/test_live_thinking.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/cli/test_mcp_cmd.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/cli/test_multimodal.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/cli/test_onboarding.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/cli/test_onboarding_logic.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/cli/test_providers.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/cli/test_render.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/cli/test_repl_loop.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/cli/test_repl_reset.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/cli/test_run_cmd.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/cli/test_skills_cmd.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/cli/test_status_bar.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/cli/test_stream.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/cli/test_truncation.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/cli/test_tui_onboarding.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/cli/test_tui_screens.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/cli/test_tui_startup.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/cli/test_tui_widgets.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/config/__init__.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/config/test_bootstrap.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/config/test_loader.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/config/test_models.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/conftest.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/e2e/__init__.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/llm/__init__.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/llm/test_factory.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/llm/test_probe.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/session/__init__.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/session/test_message.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/session/test_store.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/skills/__init__.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/skills/test_bundled.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/skills/test_parser.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/skills/test_skill_tools.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/skills/test_store.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/test_mcp_loader.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/test_p0_stability.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/test_repl.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/test_version.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/tools/__init__.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/tools/test_bash.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/tools/test_concrete_gates.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/tools/test_edit_prefix.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/tools/test_file_tools.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/tools/test_glob_tool.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/tools/test_grep_tool.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/tools/test_list_dir.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/tools/test_multi_edit.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/tools/test_note.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/tools/test_permission.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/tools/test_registry.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/tools/test_search_tools.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/tools/test_todo.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/tools/test_web.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/tools/test_web_fetch.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/tests/tools/test_win_job.py +0 -0
- {coderio-0.4.2 → coderio-0.4.4}/uv.lock +0 -0
|
@@ -76,13 +76,15 @@ jobs:
|
|
|
76
76
|
|
|
77
77
|
- name: Run tests with coverage
|
|
78
78
|
# Enforces a coverage floor so coverage can't silently regress.
|
|
79
|
-
#
|
|
80
|
-
#
|
|
81
|
-
#
|
|
82
|
-
#
|
|
79
|
+
# Measured baseline 2026-08-24: 82% total (weakest: sandbox_runner 43%
|
|
80
|
+
# — POSIX-only branches skip on Windows). The 75% floor keeps real
|
|
81
|
+
# headroom for platform variance while catching gross regressions
|
|
82
|
+
# (a module losing its tests). pyproject.toml's
|
|
83
|
+
# [tool.coverage.report] fail_under=60 is the local-dev default;
|
|
84
|
+
# CI enforces the stricter 75%.
|
|
83
85
|
shell: bash
|
|
84
86
|
run: |
|
|
85
|
-
uv run python -m pytest -q --cov=coderio --cov-report=term-missing --cov-fail-under=
|
|
87
|
+
uv run python -m pytest -q --cov=coderio --cov-report=term-missing --cov-fail-under=75
|
|
86
88
|
|
|
87
89
|
- name: Type check (mypy)
|
|
88
90
|
# HARD GATE for clean modules. pyproject.toml's [[tool.mypy.overrides]]
|
|
@@ -6,6 +6,67 @@ All notable changes to coderio are documented here. The format follows
|
|
|
6
6
|
`pyproject.toml`'s `[project].version` — `coderio.__version__` reads it via
|
|
7
7
|
`importlib.metadata`.
|
|
8
8
|
|
|
9
|
+
## [0.4.4] — 2026-08-24
|
|
10
|
+
|
|
11
|
+
### Added — extensibility & safety-of-agency features (each adversarially reviewed, mutation-verified)
|
|
12
|
+
- **Custom slash commands**: `.coderio/commands/*.md` (project layer overrides user layer)
|
|
13
|
+
turn prompt templates into `/commands` with `$ARGUMENTS` substitution and optional
|
|
14
|
+
frontmatter descriptions. Built-ins can never be shadowed — exact matches refused at
|
|
15
|
+
expansion, case variants dropped at discovery (Windows case-insensitive-FS spoof
|
|
16
|
+
surface). Bodies route straight to the engine, never re-enter built-in dispatch: a
|
|
17
|
+
repo file with body `/mode full` cannot flip the permission gate.
|
|
18
|
+
- **Custom subagents**: `.coderio/agents/*.md` define personas invokable via
|
|
19
|
+
`task(subagent_type=...)`. Persona-only customization — every assembled spec rides
|
|
20
|
+
the same PLAN-gated read-only middleware stack as the built-in research agent;
|
|
21
|
+
reserved names dropped at discovery AND re-filtered at wiring time. Adversarially
|
|
22
|
+
verified end-to-end: write tools physically unbound, nested task() blocked on three
|
|
23
|
+
independent layers.
|
|
24
|
+
- **File checkpoints + `/undo`**: every structured write (write_file/edit_file/
|
|
25
|
+
multi_edit) snapshots the target's pre-write state; `/undo` reverts step by step.
|
|
26
|
+
multi_edit is one undo step; error paths consume no depth; failed restores re-push
|
|
27
|
+
for retry; bounded at 50 entries / 64MB; deliberately survives /clear. Shell-side
|
|
28
|
+
writes (redirects) bypass it — OS sandboxing is the layer for that class.
|
|
29
|
+
- **Plan artifact**: the todo list mirrors to `<project>/.coderio/plan.md` after every
|
|
30
|
+
successful write_todos; user edits between messages are adopted at next turn start
|
|
31
|
+
(human override wins) with an injected note so the model doesn't execute a stale plan.
|
|
32
|
+
|
|
33
|
+
### Fixed
|
|
34
|
+
- Three prompt surfaces (PlanGate nudge, CompletionGate force-continue, CODE-workflow)
|
|
35
|
+
directed the model to coderio's legacy `todo()` tool whose store is an orphan the
|
|
36
|
+
gates never check — completion instructions could loop forever. All now point at
|
|
37
|
+
`write_todos`, the canonical surface.
|
|
38
|
+
- Custom-command discovery anchor joined at the caller after a runtime audit caught
|
|
39
|
+
production loading zero commands while globbing root-level *.md files as agents.
|
|
40
|
+
- Subagent discovery anchors walk up to the project root like skills/config/trust
|
|
41
|
+
(launching from a repo subdirectory previously missed project-layer definitions).
|
|
42
|
+
- Frontmatter descriptions are truncated to 1024 chars and control-char-stripped —
|
|
43
|
+
a 90KB description previously reached the main model verbatim every turn.
|
|
44
|
+
|
|
45
|
+
### Changed
|
|
46
|
+
- CI coverage floor raised 70% → 75% against a measured 82% baseline (gate verified
|
|
47
|
+
to trip); stale coverage comments corrected.
|
|
48
|
+
- tui.py decomposed (1627 → 1332 lines): input dispatch + session lifecycle extracted
|
|
49
|
+
to testable TuiRuntime; behavior verified statement-equivalent by AST diff + real
|
|
50
|
+
Textual input-routing tests.
|
|
51
|
+
|
|
52
|
+
## [0.4.3] — 2026-08-21
|
|
53
|
+
|
|
54
|
+
### Security — P1/P2 hardening (audit-verified, adversarial + mutation tested)
|
|
55
|
+
- **command_policy**: replaced fragile `_RM_RECURSIVE_PREFIX` regex (failed on
|
|
56
|
+
`rm -fr /` and `--recursive --force`) with Python-level `_check_recursive_rm()`
|
|
57
|
+
that tokenizes the command and correctly detects recursive flags in any order.
|
|
58
|
+
All flag permutations now blocked: `rm -rf /`, `rm -fr /`, `rm -r -f /`,
|
|
59
|
+
`rm --recursive --force /`, `rm --RECURSIVE /`, `rm -rf ~/`, `rm -rf $HOME/`,
|
|
60
|
+
`rm -rf *`. False positives eliminated: `rm -f /etc/passwd`, `rm --Force /`,
|
|
61
|
+
`echo rm -rf /`.
|
|
62
|
+
- **win_sandbox**: reverted `_dict_to_env_block` env-forwarding plumbing that
|
|
63
|
+
broke `CreateProcessAsUserW` on Win32. `lpEnvironment=None` preserves parent
|
|
64
|
+
env inheritance (safest path). Known limitation documented for future work.
|
|
65
|
+
- **loader**: `_find_project_dir` now accepts `str | Path` (CLI may pass str).
|
|
66
|
+
- **test_seams**: new 22-test seam suite covering command_policy↔middleware,
|
|
67
|
+
loader↔repl↔skills, deep_loop↔sandbox_runner↔win_sandbox boundaries.
|
|
68
|
+
All existing tests (884 passed) + seams (22 passed) green.
|
|
69
|
+
|
|
9
70
|
## [0.4.2] — 2026-08-18
|
|
10
71
|
|
|
11
72
|
### Security — v3 audit short-term batch (#7/#8/#9/#11/#14, all runtime-verified)
|
coderio-0.4.4/PKG-INFO
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: coderio
|
|
3
|
+
Version: 0.4.4
|
|
4
|
+
Summary: A skill-driven coding agent — structural harness, foldable thinking TUI, deepagents engine.
|
|
5
|
+
Author: coderio contributors
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Keywords: agent,ai-agent,cli,coding-agent,langchain,langgraph,llm,mcp,model-context-protocol,sandbox,skills,textual,tui
|
|
9
|
+
Classifier: Development Status :: 3 - Alpha
|
|
10
|
+
Classifier: Environment :: Console
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Operating System :: MacOS
|
|
13
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
14
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Classifier: Topic :: Software Development :: Code Generators
|
|
20
|
+
Requires-Python: >=3.11
|
|
21
|
+
Requires-Dist: ddgs>=4.0
|
|
22
|
+
Requires-Dist: deepagents>=0.6
|
|
23
|
+
Requires-Dist: httpx>=0.27
|
|
24
|
+
Requires-Dist: langchain-anthropic>=0.2
|
|
25
|
+
Requires-Dist: langchain-core>=0.3
|
|
26
|
+
Requires-Dist: langchain-openai>=0.2
|
|
27
|
+
Requires-Dist: langchain>=0.3
|
|
28
|
+
Requires-Dist: langgraph-checkpoint-sqlite>=2.0
|
|
29
|
+
Requires-Dist: langgraph>=0.2
|
|
30
|
+
Requires-Dist: pydantic>=2
|
|
31
|
+
Requires-Dist: rich>=13
|
|
32
|
+
Requires-Dist: textual>=0.40
|
|
33
|
+
Requires-Dist: tomli-w>=1.0
|
|
34
|
+
Requires-Dist: typer>=0.12
|
|
35
|
+
Provides-Extra: dev
|
|
36
|
+
Requires-Dist: build>=1.2; extra == 'dev'
|
|
37
|
+
Requires-Dist: mypy>=1.10; extra == 'dev'
|
|
38
|
+
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
|
|
39
|
+
Requires-Dist: pytest-cov>=4; extra == 'dev'
|
|
40
|
+
Requires-Dist: pytest>=8; extra == 'dev'
|
|
41
|
+
Requires-Dist: ruff>=0.16; extra == 'dev'
|
|
42
|
+
Provides-Extra: mcp
|
|
43
|
+
Requires-Dist: langchain-mcp-adapters>=0.3.2; extra == 'mcp'
|
|
44
|
+
Description-Content-Type: text/markdown
|
|
45
|
+
|
|
46
|
+
# coderio
|
|
47
|
+
|
|
48
|
+
[中文](README.md) | **English**
|
|
49
|
+
|
|
50
|
+
> The agent claims "done" without running the tests? coderio's harness stops it.
|
|
51
|
+
> A local coding agent with **native Zhipu GLM & StepFun Step coding-plan support** — four-tier permissions, layered sandbox, MCP, lifecycle hooks, and an interactive TUI.
|
|
52
|
+
|
|
53
|
+

|
|
54
|
+
|
|
55
|
+
## Install
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
pip install coderio
|
|
59
|
+
coderio # onboarding wizard on first launch (pick provider, paste API key, auto context-window probe)
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Requires Python 3.11+; Git Bash on Windows. Linux / macOS supported.
|
|
63
|
+
|
|
64
|
+
## Why coderio
|
|
65
|
+
|
|
66
|
+
The shared weakness of coding agents: **the model says "I'm done" and you just have to trust it**. coderio turns that sentence into a structural constraint—
|
|
67
|
+
|
|
68
|
+
### The Four Gates: the agent can't lie to you
|
|
69
|
+
|
|
70
|
+
| Gate | Behavior |
|
|
71
|
+
|---|---|
|
|
72
|
+
| **VerifyGate** | Wrote code, never ran it, wants to finish → intercepted, forced to continue. Parses real exit codes — **a failing test run does NOT count as verified** |
|
|
73
|
+
| **CompletionGate** | Declares done with pending todos → intercepted |
|
|
74
|
+
| **GroundingGate** | Cites files it never read → intercepted |
|
|
75
|
+
| **PlanGate** | Writes code without a todo list → soft nudge |
|
|
76
|
+
|
|
77
|
+
Not a prompt-level soft rule — a system-level control based on tool-call ground truth. Claude Code and Codex don't have this.
|
|
78
|
+
|
|
79
|
+
### Native Chinese coding-plan support
|
|
80
|
+
|
|
81
|
+
Zhipu **GLM Coding Plan** and StepFun **Step Plan** work out of the box (direct Anthropic-protocol connection) — your subscription quota runs a local agent, no proxies, no middle layer. Also supports OpenAI / Anthropic / Ollama / any OpenAI-compatible endpoint, with multi-profile switching.
|
|
82
|
+
|
|
83
|
+
### Layered security, honestly stated
|
|
84
|
+
|
|
85
|
+
- Four permission tiers (plan read-only / confirm per-action / auto_edit / full)
|
|
86
|
+
- Command blacklist + whitelist (accident prevention); Linux bubblewrap OS sandbox (boundary enforcement)
|
|
87
|
+
- First-use repo-config trust confirmation (hostile-repo protection); web_fetch SSRF protection
|
|
88
|
+
- The blacklist/whitelist are **accident prevention, not adversarial defense** — adversarial protection comes from the sandbox + permissions; use a VM for hostile code
|
|
89
|
+
|
|
90
|
+
## Feature highlights
|
|
91
|
+
|
|
92
|
+
- **Interactive TUI**: streaming output, foldable thinking (Ctrl+O), collapsible TODO panel, vertical permission menu, task interruption (Esc), slash-command autocomplete, session management
|
|
93
|
+
- **Custom slash commands**: `.coderio/commands/*.md` (project/user layers) turn prompt templates into `/commands` with `$ARGUMENTS` substitution; built-ins can never be shadowed
|
|
94
|
+
- **Custom subagents**: `.coderio/agents/*.md` define personas invokable via `task(subagent_type=...)` — you customize WHO the agent is, its capabilities stay on the read-only stack
|
|
95
|
+
- **File rollback**: every structured agent write is auto-checkpointed; `/undo` reverts step by step (a bad edit is one command from gone)
|
|
96
|
+
- **Plan artifact**: the task list auto-mirrors to `.coderio/plan.md`; edit it by hand and the agent adopts your version at the next turn
|
|
97
|
+
- **Headless mode**: `coderio run "task"` one-shot execution (CI / scripts / benchmarks) with graded exit codes
|
|
98
|
+
- **MCP support**: connect external tools via `.mcp.json` (Claude Code-compatible format), managed with `coderio mcp`
|
|
99
|
+
- **Lifecycle hooks**: `[[hooks]]` run your commands at PreToolUse / PostToolUse / UserPromptSubmit (exit 2 = block) — IO contract compatible with Claude Code
|
|
100
|
+
- **Three-layer skills**: bundled + user + project, progressive disclosure saves context
|
|
101
|
+
- **Context governance**: auto-compaction (60% window trigger), large-block offload, sqlite checkpoints across turns
|
|
102
|
+
- **Subagents**: research (read-only, double-enforced) + general-purpose (inherits the main agent's full security stack)
|
|
103
|
+
- **Engineering discipline**: 950+ tests, 82% coverage (CI floor 75%), mypy hard gate, uv.lock, 3 OS × 2 Python CI matrix
|
|
104
|
+
|
|
105
|
+
<details>
|
|
106
|
+
<summary><b>Config example</b> (click to expand)</summary>
|
|
107
|
+
|
|
108
|
+
```toml
|
|
109
|
+
# ~/.coderio/config.toml
|
|
110
|
+
[model]
|
|
111
|
+
provider_id = "bigmodel_coding_plan" # Zhipu/StepFun coding plan, or openai/anthropic/ollama/custom
|
|
112
|
+
default = "glm-5.2"
|
|
113
|
+
|
|
114
|
+
[tools]
|
|
115
|
+
permission_mode = "confirm" # plan | confirm | auto_edit | full
|
|
116
|
+
sandbox_mode = "off" # off | job (resource limits) | write (Linux file-write isolation)
|
|
117
|
+
|
|
118
|
+
# Lifecycle hooks (Claude Code-compatible contract)
|
|
119
|
+
[[hooks]]
|
|
120
|
+
event = "PreToolUse"
|
|
121
|
+
matcher = "write_file|edit_file"
|
|
122
|
+
command = "python .hooks/protect.py" # JSON on stdin; exit 2 = block
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
MCP, the sandbox 4-tuple, and more: [docs/coderio-architecture.md](docs/coderio-architecture.md).
|
|
126
|
+
|
|
127
|
+
</details>
|
|
128
|
+
|
|
129
|
+
## Common commands
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
coderio # interactive TUI
|
|
133
|
+
coderio run "fix the failing test" --quiet # headless one-shot
|
|
134
|
+
coderio run "task" --dangerously-skip-permissions # full access (explicit opt-in)
|
|
135
|
+
coderio mcp add github --type http --url ... # manage MCP
|
|
136
|
+
coderio skills install # install skill suites
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Type `/` inside the TUI for all commands (/resume sessions, /mode permissions, /undo file writes, /think unfold reasoning).
|
|
140
|
+
|
|
141
|
+
## Known limitations
|
|
142
|
+
|
|
143
|
+
- The Windows write-sandbox currently equals job mode (true isolation awaits the ACL work — documented honestly)
|
|
144
|
+
- Blacklist/whitelist are accident-prevention by design (regex can be bypassed by obfuscation); use the sandbox / a VM for adversarial scenarios
|
|
145
|
+
|
|
146
|
+
## Origin
|
|
147
|
+
|
|
148
|
+
A spare-time project, open-sourced as a working reference for developers building their own coding agents. The name is **code + rio** (the author's English name is Lion; "codelion" sounded odd).
|
|
149
|
+
|
|
150
|
+
## Contributing & License
|
|
151
|
+
|
|
152
|
+
Issues and PRs welcome — see [CONTRIBUTING.md](CONTRIBUTING.md). MIT License.
|
coderio-0.4.4/README.md
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# coderio
|
|
2
|
+
|
|
3
|
+
**中文** | [English](README_en.md)
|
|
4
|
+
|
|
5
|
+
> 写了代码没跑过测试就说"完成"?coderio 的 harness 会拦住它。
|
|
6
|
+
> 一个**原生支持智谱 GLM / 阶跃 StepFun Coding Plan** 的本地 coding agent——四级权限、多层沙箱、MCP、生命周期 hooks、交互式 TUI。
|
|
7
|
+
|
|
8
|
+

|
|
9
|
+
|
|
10
|
+
## 安装
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
pip install coderio
|
|
14
|
+
coderio # 首次启动进入 onboarding 向导(选 provider、填 API key、自动探测上下文窗口)
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
要求:Python 3.11+;Windows 需 Git Bash。支持 Linux / macOS。
|
|
18
|
+
|
|
19
|
+
## 为什么是 coderio
|
|
20
|
+
|
|
21
|
+
市面上 coding agent 的共同软肋:**模型说"我做完了",你就得信**。coderio 把这句话变成了结构约束——
|
|
22
|
+
|
|
23
|
+
### 四道门:agent 骗不了你
|
|
24
|
+
|
|
25
|
+
| 门 | 行为 |
|
|
26
|
+
|---|---|
|
|
27
|
+
| **VerifyGate** | 写了代码没跑验证就想结束 → 拦截、强制续跑。解析真实 exit code,**测试失败不算验证通过** |
|
|
28
|
+
| **CompletionGate** | TODO 没清完就宣布完成 → 拦截 |
|
|
29
|
+
| **GroundingGate** | 引用从未读过的文件下结论 → 拦截 |
|
|
30
|
+
| **PlanGate** | 没 TODO 就动手写码 → 软提醒 |
|
|
31
|
+
|
|
32
|
+
不是提示词软规则,是基于工具调用 ground truth 的系统级控制。Claude Code / Codex 都没有这个。
|
|
33
|
+
|
|
34
|
+
### 原生支持中文 Coding Plan
|
|
35
|
+
|
|
36
|
+
智谱 **GLM Coding Plan** 和阶跃 **StepFun Step Plan** 开箱即用(Anthropic 协议直连)——你的订阅额度跑本地 agent,不需要转发、不需要中间层。同时支持 OpenAI / Anthropic / Ollama / 任意 OpenAI 兼容端点,多 profile 一键切换。
|
|
37
|
+
|
|
38
|
+
### 多层安全,诚实声明
|
|
39
|
+
|
|
40
|
+
- 四级权限(plan 只读 / confirm 逐项确认 / auto_edit / full)
|
|
41
|
+
- 命令黑名单 + 白名单(防手滑);Linux bubblewrap OS 级沙箱(防越界写)
|
|
42
|
+
- 仓库配置首次信任确认(防克隆恶意仓库);web_fetch SSRF 防护
|
|
43
|
+
- 黑白名单是**防手滑不是防对抗**——对抗性防护靠沙箱 + 权限,恶意代码请用 VM
|
|
44
|
+
|
|
45
|
+
## 特性一览
|
|
46
|
+
|
|
47
|
+
- **交互式 TUI**:流式输出、思考折叠(Ctrl+O)、可折叠 TODO 面板、纵向权限菜单、任务中断(Esc)、slash 命令补全、会话管理
|
|
48
|
+
- **自定义 slash 命令**:`.coderio/commands/*.md`(项目级/用户级)把提示词模板变成 `/命令`,`$ARGUMENTS` 占位符替换,内置命令不可被遮蔽
|
|
49
|
+
- **自定义子代理**:`.coderio/agents/*.md` 定义 `task(subagent_type=...)` 可调的专属人格——只定制"是谁",能力恒为只读栈
|
|
50
|
+
- **文件回滚**:agent 的每次结构化写盘自动快照,`/undo` 一键逐级恢复(改坏文件不再可怕)
|
|
51
|
+
- **计划产物**:任务清单自动镜像到 `.coderio/plan.md`,你手动编辑它,下一轮 agent 自动采纳你的版本
|
|
52
|
+
- **headless 模式**:`coderio run "任务"` 单次运行(CI / 脚本 / benchmark),退出码分级
|
|
53
|
+
- **MCP 支持**:`.mcp.json`(Claude Code 兼容格式)接入外部工具,`coderio mcp` 命令行管理
|
|
54
|
+
- **生命周期 hooks**:`[[hooks]]` 在 PreToolUse / PostToolUse / UserPromptSubmit 等事件执行你的命令(exit 2 = 阻断),IO 契约与 Claude Code 兼容
|
|
55
|
+
- **skills 三层加载**:bundled + 用户 + 项目层,渐进披露省上下文
|
|
56
|
+
- **上下文治理**:自动压缩(60% 窗口触发)、大块 offload、sqlite 检查点跨轮持久化
|
|
57
|
+
- **子 agent**:research(只读,双重强制)+ general-purpose(继承主 agent 全部安全层)
|
|
58
|
+
- **工程纪律**:950+ 测试、82% 覆盖率(CI 卡 75% 下限)、mypy 硬门、uv.lock 锁定、3 OS × 2 Python CI 矩阵
|
|
59
|
+
|
|
60
|
+
<details>
|
|
61
|
+
<summary><b>配置示例</b>(点击展开)</summary>
|
|
62
|
+
|
|
63
|
+
```toml
|
|
64
|
+
# ~/.coderio/config.toml
|
|
65
|
+
[model]
|
|
66
|
+
provider_id = "bigmodel_coding_plan" # 智谱/阶跃 coding plan,或 openai/anthropic/ollama/自定义
|
|
67
|
+
default = "glm-5.2"
|
|
68
|
+
|
|
69
|
+
[tools]
|
|
70
|
+
permission_mode = "confirm" # plan | confirm | auto_edit | full
|
|
71
|
+
sandbox_mode = "off" # off | job(资源限制)| write(Linux 文件写隔离)
|
|
72
|
+
|
|
73
|
+
# 生命周期 hooks(Claude Code 兼容契约)
|
|
74
|
+
[[hooks]]
|
|
75
|
+
event = "PreToolUse"
|
|
76
|
+
matcher = "write_file|edit_file"
|
|
77
|
+
command = "python .hooks/protect.py" # stdin 收 JSON;exit 2 = 阻断
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
MCP、沙箱四元组、更多配置见 [docs/coderio-architecture.md](docs/coderio-architecture.md)。
|
|
81
|
+
|
|
82
|
+
</details>
|
|
83
|
+
|
|
84
|
+
## 常用命令
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
coderio # 交互式 TUI
|
|
88
|
+
coderio run "修复失败的测试" --quiet # headless 单次
|
|
89
|
+
coderio run "任务" --dangerously-skip-permissions # full 权限(显式选择)
|
|
90
|
+
coderio mcp add github --type http --url ... # 管理 MCP
|
|
91
|
+
coderio skills install # 安装 skill 套件
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
TUI 内输入 `/` 查看全部命令(/resume 恢复会话、/mode 切权限、/undo 回滚文件写入、/think 展开思考)。
|
|
95
|
+
|
|
96
|
+
## 已知限制
|
|
97
|
+
|
|
98
|
+
- Windows 写沙箱当前等价于 job 档(真隔离待 ACL,文档如实标注)
|
|
99
|
+
- 黑白名单为防手滑设计(正则可被混淆绕过),对抗性场景用沙箱 / VM
|
|
100
|
+
|
|
101
|
+
## 起源
|
|
102
|
+
|
|
103
|
+
业余项目,开源目的:给想自己搭 coding agent 的开发者一份能跑的参考。名字是 **code + rio**(作者英文名 Lion,本想叫 codelion)。
|
|
104
|
+
|
|
105
|
+
## 贡献与 License
|
|
106
|
+
|
|
107
|
+
欢迎 issue / PR,见 [CONTRIBUTING.md](CONTRIBUTING.md)。MIT License。
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# coderio
|
|
2
|
+
|
|
3
|
+
[中文](README.md) | **English**
|
|
4
|
+
|
|
5
|
+
> The agent claims "done" without running the tests? coderio's harness stops it.
|
|
6
|
+
> A local coding agent with **native Zhipu GLM & StepFun Step coding-plan support** — four-tier permissions, layered sandbox, MCP, lifecycle hooks, and an interactive TUI.
|
|
7
|
+
|
|
8
|
+

|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
pip install coderio
|
|
14
|
+
coderio # onboarding wizard on first launch (pick provider, paste API key, auto context-window probe)
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Requires Python 3.11+; Git Bash on Windows. Linux / macOS supported.
|
|
18
|
+
|
|
19
|
+
## Why coderio
|
|
20
|
+
|
|
21
|
+
The shared weakness of coding agents: **the model says "I'm done" and you just have to trust it**. coderio turns that sentence into a structural constraint—
|
|
22
|
+
|
|
23
|
+
### The Four Gates: the agent can't lie to you
|
|
24
|
+
|
|
25
|
+
| Gate | Behavior |
|
|
26
|
+
|---|---|
|
|
27
|
+
| **VerifyGate** | Wrote code, never ran it, wants to finish → intercepted, forced to continue. Parses real exit codes — **a failing test run does NOT count as verified** |
|
|
28
|
+
| **CompletionGate** | Declares done with pending todos → intercepted |
|
|
29
|
+
| **GroundingGate** | Cites files it never read → intercepted |
|
|
30
|
+
| **PlanGate** | Writes code without a todo list → soft nudge |
|
|
31
|
+
|
|
32
|
+
Not a prompt-level soft rule — a system-level control based on tool-call ground truth. Claude Code and Codex don't have this.
|
|
33
|
+
|
|
34
|
+
### Native Chinese coding-plan support
|
|
35
|
+
|
|
36
|
+
Zhipu **GLM Coding Plan** and StepFun **Step Plan** work out of the box (direct Anthropic-protocol connection) — your subscription quota runs a local agent, no proxies, no middle layer. Also supports OpenAI / Anthropic / Ollama / any OpenAI-compatible endpoint, with multi-profile switching.
|
|
37
|
+
|
|
38
|
+
### Layered security, honestly stated
|
|
39
|
+
|
|
40
|
+
- Four permission tiers (plan read-only / confirm per-action / auto_edit / full)
|
|
41
|
+
- Command blacklist + whitelist (accident prevention); Linux bubblewrap OS sandbox (boundary enforcement)
|
|
42
|
+
- First-use repo-config trust confirmation (hostile-repo protection); web_fetch SSRF protection
|
|
43
|
+
- The blacklist/whitelist are **accident prevention, not adversarial defense** — adversarial protection comes from the sandbox + permissions; use a VM for hostile code
|
|
44
|
+
|
|
45
|
+
## Feature highlights
|
|
46
|
+
|
|
47
|
+
- **Interactive TUI**: streaming output, foldable thinking (Ctrl+O), collapsible TODO panel, vertical permission menu, task interruption (Esc), slash-command autocomplete, session management
|
|
48
|
+
- **Custom slash commands**: `.coderio/commands/*.md` (project/user layers) turn prompt templates into `/commands` with `$ARGUMENTS` substitution; built-ins can never be shadowed
|
|
49
|
+
- **Custom subagents**: `.coderio/agents/*.md` define personas invokable via `task(subagent_type=...)` — you customize WHO the agent is, its capabilities stay on the read-only stack
|
|
50
|
+
- **File rollback**: every structured agent write is auto-checkpointed; `/undo` reverts step by step (a bad edit is one command from gone)
|
|
51
|
+
- **Plan artifact**: the task list auto-mirrors to `.coderio/plan.md`; edit it by hand and the agent adopts your version at the next turn
|
|
52
|
+
- **Headless mode**: `coderio run "task"` one-shot execution (CI / scripts / benchmarks) with graded exit codes
|
|
53
|
+
- **MCP support**: connect external tools via `.mcp.json` (Claude Code-compatible format), managed with `coderio mcp`
|
|
54
|
+
- **Lifecycle hooks**: `[[hooks]]` run your commands at PreToolUse / PostToolUse / UserPromptSubmit (exit 2 = block) — IO contract compatible with Claude Code
|
|
55
|
+
- **Three-layer skills**: bundled + user + project, progressive disclosure saves context
|
|
56
|
+
- **Context governance**: auto-compaction (60% window trigger), large-block offload, sqlite checkpoints across turns
|
|
57
|
+
- **Subagents**: research (read-only, double-enforced) + general-purpose (inherits the main agent's full security stack)
|
|
58
|
+
- **Engineering discipline**: 950+ tests, 82% coverage (CI floor 75%), mypy hard gate, uv.lock, 3 OS × 2 Python CI matrix
|
|
59
|
+
|
|
60
|
+
<details>
|
|
61
|
+
<summary><b>Config example</b> (click to expand)</summary>
|
|
62
|
+
|
|
63
|
+
```toml
|
|
64
|
+
# ~/.coderio/config.toml
|
|
65
|
+
[model]
|
|
66
|
+
provider_id = "bigmodel_coding_plan" # Zhipu/StepFun coding plan, or openai/anthropic/ollama/custom
|
|
67
|
+
default = "glm-5.2"
|
|
68
|
+
|
|
69
|
+
[tools]
|
|
70
|
+
permission_mode = "confirm" # plan | confirm | auto_edit | full
|
|
71
|
+
sandbox_mode = "off" # off | job (resource limits) | write (Linux file-write isolation)
|
|
72
|
+
|
|
73
|
+
# Lifecycle hooks (Claude Code-compatible contract)
|
|
74
|
+
[[hooks]]
|
|
75
|
+
event = "PreToolUse"
|
|
76
|
+
matcher = "write_file|edit_file"
|
|
77
|
+
command = "python .hooks/protect.py" # JSON on stdin; exit 2 = block
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
MCP, the sandbox 4-tuple, and more: [docs/coderio-architecture.md](docs/coderio-architecture.md).
|
|
81
|
+
|
|
82
|
+
</details>
|
|
83
|
+
|
|
84
|
+
## Common commands
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
coderio # interactive TUI
|
|
88
|
+
coderio run "fix the failing test" --quiet # headless one-shot
|
|
89
|
+
coderio run "task" --dangerously-skip-permissions # full access (explicit opt-in)
|
|
90
|
+
coderio mcp add github --type http --url ... # manage MCP
|
|
91
|
+
coderio skills install # install skill suites
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Type `/` inside the TUI for all commands (/resume sessions, /mode permissions, /undo file writes, /think unfold reasoning).
|
|
95
|
+
|
|
96
|
+
## Known limitations
|
|
97
|
+
|
|
98
|
+
- The Windows write-sandbox currently equals job mode (true isolation awaits the ACL work — documented honestly)
|
|
99
|
+
- Blacklist/whitelist are accident-prevention by design (regex can be bypassed by obfuscation); use the sandbox / a VM for adversarial scenarios
|
|
100
|
+
|
|
101
|
+
## Origin
|
|
102
|
+
|
|
103
|
+
A spare-time project, open-sourced as a working reference for developers building their own coding agents. The name is **code + rio** (the author's English name is Lion; "codelion" sounded odd).
|
|
104
|
+
|
|
105
|
+
## Contributing & License
|
|
106
|
+
|
|
107
|
+
Issues and PRs welcome — see [CONTRIBUTING.md](CONTRIBUTING.md). MIT License.
|
|
@@ -39,12 +39,12 @@ coderio 是一个**技能驱动的编程 agent**:它的"骨架"是 Lion-Skills
|
|
|
39
39
|
|
|
40
40
|
| 模块 | 行数 | 职责 | 关键文件 |
|
|
41
41
|
|------|------|------|----------|
|
|
42
|
-
| `agent/` | ~
|
|
43
|
-
| `cli/` | ~
|
|
44
|
-
| `tools/` | ~
|
|
45
|
-
| `config/` | ~
|
|
46
|
-
| `skills/` | ~
|
|
47
|
-
| `session/` |
|
|
42
|
+
| `agent/` | ~3600 | deepagents 引擎、harness/permission middleware、计划产物、自定义子代理、提示词构建、流式协议 | deep_loop.py, harness_middleware.py, permission_middleware.py, harness.py, plan_artifact.py, custom_agents.py, prompts.py |
|
|
43
|
+
| `cli/` | ~5300 | Typer 应用、Textual TUI(渲染)+ TuiRuntime(输入分发/会话生命周期)、自定义 slash 命令、Rich 流式 UI、凭证/onboarding | tui.py, tui_runtime.py, repl.py, stream.py, app.py, commands.py, custom_commands.py, tui_onboarding.py |
|
|
44
|
+
| `tools/` | ~3000 | 工具集 + 文件写入 checkpoint + 权限门 + 命令黑名单 + OS 沙箱 + langchain 适配 | bash.py, permission.py, command_policy.py, checkpoint.py, base.py |
|
|
45
|
+
| `config/` | ~900 | 三层 TOML 配置合并 + 仓库信任门 + 用户目录 bootstrap | loader.py, models.py, trust.py |
|
|
46
|
+
| `skills/` | ~255 | SkillStore 三层加载(bundled < user < project)+ 共享 frontmatter 解析 | store.py, parser.py, models.py |
|
|
47
|
+
| `session/` | ~330 | jsonl 追加式会话存储 + resume + 压缩截断 | store.py, message.py |
|
|
48
48
|
| `llm/` | 320 | 模型工厂 + provider context window 探测 | factory.py, probe.py |
|
|
49
49
|
|
|
50
50
|
### 依赖方向(关键约束)
|
|
@@ -268,12 +268,13 @@ is_interrupted()(用户中断检查,agent 线程在每轮开头调用)
|
|
|
268
268
|
|
|
269
269
|
`NullStream` 全空实现,用于测试/headless。
|
|
270
270
|
|
|
271
|
-
### 6.5 TUI 交互(`cli/tui.py`)
|
|
271
|
+
### 6.5 TUI 交互(`cli/tui.py` + `cli/tui_runtime.py`)
|
|
272
272
|
|
|
273
273
|
Textual 8.x App,核心设计:
|
|
274
274
|
|
|
275
|
-
-
|
|
276
|
-
-
|
|
275
|
+
- **渲染与分发分离**(S3 拆分):`CoderioTUI` 只管 widget 树与流式渲染;输入路由、slash 处理、会话生命周期在 `TuiRuntime`(两阶段构造:先建 runtime,`bind()` 时把带 TUI 引用的 gate 接上——confirm 模式否则会在 Textual 接管终端后死于 input() 死锁)
|
|
276
|
+
- **线程模型**:agent 在后台线程跑,UI 更新通过 `_render_q`(thread-safe deque)+ 定时器排空
|
|
277
|
+
- **流式渲染**:dict 分派表映射 action → handler,每个 handler 返回 streaming/final/none 决定滚动策略
|
|
277
278
|
- **中断**:`Esc` / `⏹ 中断` 按钮 → `_interrupted` 标志位,agent 流循环检查 `is_interrupted()` → `InterruptedError` → 黄色"已中断"面板
|
|
278
279
|
- **confirm 模式**:`TuiPermissionGate` 用 `ConfirmMenu`(纵向选择菜单)+ `threading.Event` 跨线程同步,↑↓ 选择 + Enter 确认
|
|
279
280
|
- **可视化选择器**:`/mode`(ModePickerScreen)、`/profile`(ProfilePickerScreen)、`/resume`(SessionPickerScreen)
|
|
@@ -290,14 +291,18 @@ Textual 8.x App,核心设计:
|
|
|
290
291
|
| 类别 | 工具 |
|
|
291
292
|
|------|------|
|
|
292
293
|
| 读 | read_file, list_dir, glob, grep |
|
|
293
|
-
| 写 | write_file, edit_file, multi_edit
|
|
294
|
+
| 写 | write_file, edit_file, multi_edit(写前自动 checkpoint,`/undo` 可回滚)|
|
|
294
295
|
| 执行 | bash(Git Bash,Windows 自动探测,.venv 自动激活,进程树超时杀)|
|
|
295
|
-
| 计划 |
|
|
296
|
+
| 计划 | write_todos(deepagents 原生,镜像到 `.coderio/plan.md` 供用户编辑)|
|
|
296
297
|
| 外部 | web_search, web_fetch |
|
|
297
298
|
| 记忆 | note(跨会话长期记忆)|
|
|
298
299
|
|
|
299
300
|
**权限门**(`permission.py`):plan / confirm / auto_edit / full 四模式。`DESTRUCTIVE_TOOLS`(write_file/edit_file/multi_edit/execute/web_fetch/note)在 plan 模式全挡、confirm 模式逐个问、auto_edit 自动放行文件编辑但仍问高危工具、full 全放。
|
|
300
301
|
|
|
302
|
+
**文件 checkpoint**(`checkpoint.py`,S4):三个结构化写工具落盘前快照进内存栈(50 条 / 64MB 上限),`/undo` 逐级回滚;bash 重定向等 shell 路径不覆盖——OS 级沙箱才是那一层的答案。
|
|
303
|
+
|
|
304
|
+
**计划产物**(`plan_artifact.py`,S5):write_todos 成功后任务清单镜像到 `<project>/.coderio/plan.md`;用户在两轮之间手改它,下一轮开始自动采纳其版本并注入提示。
|
|
305
|
+
|
|
301
306
|
**命令审查层**(`command_review.py` + `command_policy.py`):权限门只管"哪个工具能执行",不管"命令内容是什么"。shell(execute)不受 virtual_mode 约束,所以额外加了一层 `CommandReviewMiddleware`——内置黑名单挡住 `rm -rf /`、`mkfs`、fork bomb、`dd of=/dev/`、`shutdown` 等破坏性命令。即使 FULL 模式也挡(安全优先于"full=全放行"字面语义)。用户可在 config.toml `[tools].blocked_commands` 追加正则黑名单。`network_allowed=false` 可禁用 web_fetch/web_search(离线模式)。
|
|
302
307
|
|
|
303
308
|
**这不是真 OS 沙箱**:混淆命令(base64 解码、变量展开)可绕过正则。目标是挡住意外/粗心的破坏(占真实事故绝大多数),不是对抗性模型。真隔离需要容器/seccomp(未来工作)。
|
|
@@ -5,7 +5,7 @@ build-backend = "hatchling.build"
|
|
|
5
5
|
|
|
6
6
|
[project]
|
|
7
7
|
name = "coderio"
|
|
8
|
-
version = "0.4.
|
|
8
|
+
version = "0.4.4"
|
|
9
9
|
description = "A skill-driven coding agent — structural harness, foldable thinking TUI, deepagents engine."
|
|
10
10
|
readme = "README_en.md"
|
|
11
11
|
license = "MIT"
|
|
@@ -190,10 +190,11 @@ asyncio_mode = "auto"
|
|
|
190
190
|
source = ["coderio"]
|
|
191
191
|
|
|
192
192
|
[tool.coverage.report]
|
|
193
|
-
# Local-dev coverage floor. CI enforces a stricter
|
|
193
|
+
# Local-dev coverage floor. CI enforces a stricter 75% via --cov-fail-under
|
|
194
194
|
# (see .github/workflows/ci.yml). This 60% is the "running tests in your
|
|
195
195
|
# editor" safety net — lower than CI so local runs don't fail on partial
|
|
196
|
-
# test selection.
|
|
196
|
+
# test selection. Measured baseline 2026-08-24: 82% total; known weakest
|
|
197
|
+
# sandbox_runner 43% (POSIX-only branches skip on Windows).
|
|
197
198
|
fail_under = 60
|
|
198
199
|
|
|
199
200
|
[tool.mypy]
|
|
@@ -201,10 +202,9 @@ fail_under = 60
|
|
|
201
202
|
# real type errors (wrong arg counts, None where a value is expected) without
|
|
202
203
|
# blocking on the many untyped third-party deps (langchain, deepagents, textual).
|
|
203
204
|
#
|
|
204
|
-
# CI runs mypy as a HARD GATE
|
|
205
|
-
#
|
|
206
|
-
#
|
|
207
|
-
# TODO, not a permanent pass. Remove entries as the files are fixed.
|
|
205
|
+
# CI runs mypy as a HARD GATE for all modules except the override list below.
|
|
206
|
+
# Modules with `ignore_errors = true` have known type issues — each entry is a
|
|
207
|
+
# tracked TODO. Modules are removed from this list when they pass cleanly.
|
|
208
208
|
python_version = "3.11"
|
|
209
209
|
ignore_missing_imports = true
|
|
210
210
|
warn_redundant_casts = true
|
|
@@ -218,6 +218,9 @@ exclude = ["tests/", "build/", "dist/", "\\.venv/"]
|
|
|
218
218
|
# Per-module overrides: lenient modules (tracked cleanup TODOs).
|
|
219
219
|
# Each entry here is a file with known type issues that would block CI if
|
|
220
220
|
# enforced strictly. Remove entries as the files are cleaned up.
|
|
221
|
+
#
|
|
222
|
+
# Cleaned up 2026-08-21: removed coderio.agent.deep_loop and
|
|
223
|
+
# coderio.mcp_loader (verified mypy clean — 0 errors, only notes).
|
|
221
224
|
[[tool.mypy.overrides]]
|
|
222
225
|
module = [
|
|
223
226
|
"coderio.cli.tui",
|
|
@@ -227,10 +230,8 @@ module = [
|
|
|
227
230
|
"coderio.cli.onboarding",
|
|
228
231
|
"coderio.cli.stream",
|
|
229
232
|
"coderio.cli.repl",
|
|
230
|
-
"coderio.agent.deep_loop",
|
|
231
233
|
"coderio.tools.win_job",
|
|
232
234
|
"coderio.tools.win_sandbox",
|
|
233
|
-
"coderio.mcp_loader",
|
|
234
235
|
"coderio.session.store",
|
|
235
236
|
"coderio.session.message",
|
|
236
237
|
"coderio.llm.probe",
|