nexus-coding-agent 0.1.0__tar.gz → 0.2.0__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.
Files changed (353) hide show
  1. {nexus_coding_agent-0.1.0 → nexus_coding_agent-0.2.0}/.gitignore +3 -1
  2. nexus_coding_agent-0.2.0/AGENTS.md +23 -0
  3. nexus_coding_agent-0.2.0/LICENSE +21 -0
  4. nexus_coding_agent-0.2.0/PKG-INFO +361 -0
  5. nexus_coding_agent-0.2.0/README.md +343 -0
  6. nexus_coding_agent-0.2.0/README.zh-CN.md +250 -0
  7. nexus_coding_agent-0.2.0/docs/next/00-review-and-decisions.md +158 -0
  8. nexus_coding_agent-0.2.0/docs/next/01-development-design.md +407 -0
  9. nexus_coding_agent-0.2.0/docs/next/02-delivery-and-acceptance.md +169 -0
  10. nexus_coding_agent-0.2.0/docs/next/03-evaluation-v0-design.md +437 -0
  11. nexus_coding_agent-0.2.0/docs/next/acceptance-evidence.md +230 -0
  12. nexus_coding_agent-0.2.0/docs/next/architecture-contract-v0.md +670 -0
  13. nexus_coding_agent-0.2.0/docs/next/context-runtime-v0.1-evidence.md +71 -0
  14. nexus_coding_agent-0.2.0/docs/next/context-runtime-v0.1.1-evidence.md +56 -0
  15. nexus_coding_agent-0.2.0/docs/next/context-runtime-v0.2.1-evidence.md +106 -0
  16. nexus_coding_agent-0.2.0/docs/next/cost-hardening.md +99 -0
  17. nexus_coding_agent-0.2.0/docs/next/developer-run-profiler-v0.1-evidence.md +122 -0
  18. nexus_coding_agent-0.2.0/docs/next/engineering-walkthrough.md +133 -0
  19. nexus_coding_agent-0.2.0/docs/next/evaluation-contamination-evidence.md +45 -0
  20. nexus_coding_agent-0.2.0/docs/next/evaluation-v0-evidence.md +135 -0
  21. nexus_coding_agent-0.2.0/docs/next/execution-budget-evidence.md +90 -0
  22. nexus_coding_agent-0.2.0/docs/next/model-delivery-evidence.md +179 -0
  23. nexus_coding_agent-0.2.0/docs/next/qwen-candidate.toml +20 -0
  24. nexus_coding_agent-0.2.0/docs/next/release-0.2.0.md +142 -0
  25. nexus_coding_agent-0.2.0/docs/next/skills/pytest-regression/SKILL.md +23 -0
  26. nexus_coding_agent-0.2.0/docs/next/skills-v0.1.md +153 -0
  27. nexus_coding_agent-0.2.0/docs/next/suite-hardening-evidence.md +147 -0
  28. {nexus_coding_agent-0.1.0 → nexus_coding_agent-0.2.0}/pyproject.toml +15 -22
  29. nexus_coding_agent-0.2.0/scripts/swebench_v0.py +215 -0
  30. {nexus_coding_agent-0.1.0 → nexus_coding_agent-0.2.0}/src/nexus/__init__.py +1 -2
  31. nexus_coding_agent-0.2.0/src/nexus/__main__.py +4 -0
  32. nexus_coding_agent-0.2.0/src/nexus/app/__init__.py +1 -0
  33. nexus_coding_agent-0.2.0/src/nexus/app/bootstrap.py +222 -0
  34. nexus_coding_agent-0.2.0/src/nexus/app/cli.py +280 -0
  35. nexus_coding_agent-0.2.0/src/nexus/app/config.py +172 -0
  36. nexus_coding_agent-0.2.0/src/nexus/app/events.py +107 -0
  37. nexus_coding_agent-0.2.0/src/nexus/app/profile.py +363 -0
  38. nexus_coding_agent-0.2.0/src/nexus/app/session.py +466 -0
  39. nexus_coding_agent-0.2.0/src/nexus/app/skills.py +79 -0
  40. nexus_coding_agent-0.2.0/src/nexus/app/tui.py +345 -0
  41. nexus_coding_agent-0.2.0/src/nexus/core/__init__.py +1 -0
  42. nexus_coding_agent-0.2.0/src/nexus/core/agent.py +276 -0
  43. nexus_coding_agent-0.2.0/src/nexus/core/context.py +358 -0
  44. nexus_coding_agent-0.2.0/src/nexus/core/model.py +238 -0
  45. nexus_coding_agent-0.2.0/src/nexus/core/observations.py +248 -0
  46. nexus_coding_agent-0.2.0/src/nexus/core/plan.py +60 -0
  47. nexus_coding_agent-0.2.0/src/nexus/core/request_context.py +34 -0
  48. nexus_coding_agent-0.2.0/src/nexus/core/skills.py +82 -0
  49. nexus_coding_agent-0.2.0/src/nexus/core/stagnation.py +85 -0
  50. nexus_coding_agent-0.2.0/src/nexus/core/types.py +229 -0
  51. nexus_coding_agent-0.2.0/src/nexus/evaluation/__init__.py +1 -0
  52. nexus_coding_agent-0.2.0/src/nexus/evaluation/cases.py +98 -0
  53. nexus_coding_agent-0.2.0/src/nexus/evaluation/environment.py +531 -0
  54. nexus_coding_agent-0.2.0/src/nexus/evaluation/report.py +336 -0
  55. nexus_coding_agent-0.2.0/src/nexus/evaluation/runner.py +252 -0
  56. nexus_coding_agent-0.2.0/src/nexus/evaluation/validation.py +146 -0
  57. nexus_coding_agent-0.2.0/src/nexus/tools/__init__.py +1 -0
  58. nexus_coding_agent-0.2.0/src/nexus/tools/execution.py +261 -0
  59. nexus_coding_agent-0.2.0/src/nexus/tools/mcp.py +203 -0
  60. nexus_coding_agent-0.2.0/src/nexus/tools/patch.py +364 -0
  61. nexus_coding_agent-0.2.0/src/nexus/tools/patch_format.py +226 -0
  62. nexus_coding_agent-0.2.0/src/nexus/tools/plan.py +69 -0
  63. nexus_coding_agent-0.2.0/src/nexus/tools/registry.py +69 -0
  64. nexus_coding_agent-0.2.0/src/nexus/tools/skills.py +68 -0
  65. nexus_coding_agent-0.2.0/tests/conftest.py +85 -0
  66. nexus_coding_agent-0.2.0/tests/fixtures/mcp_server.py +24 -0
  67. nexus_coding_agent-0.2.0/tests/test_agent.py +142 -0
  68. nexus_coding_agent-0.2.0/tests/test_boundaries.py +107 -0
  69. nexus_coding_agent-0.2.0/tests/test_cache_usage.py +80 -0
  70. nexus_coding_agent-0.2.0/tests/test_context_runtime.py +227 -0
  71. nexus_coding_agent-0.2.0/tests/test_conversation.py +376 -0
  72. nexus_coding_agent-0.2.0/tests/test_eval.py +127 -0
  73. nexus_coding_agent-0.2.0/tests/test_evaluation_docker.py +177 -0
  74. nexus_coding_agent-0.2.0/tests/test_evaluation_isolation.py +53 -0
  75. nexus_coding_agent-0.2.0/tests/test_evaluation_v0.py +393 -0
  76. nexus_coding_agent-0.2.0/tests/test_execution_budget.py +121 -0
  77. nexus_coding_agent-0.2.0/tests/test_mcp_tui.py +545 -0
  78. nexus_coding_agent-0.2.0/tests/test_model.py +760 -0
  79. nexus_coding_agent-0.2.0/tests/test_observation_lifecycle.py +497 -0
  80. nexus_coding_agent-0.2.0/tests/test_patch_v02.py +486 -0
  81. nexus_coding_agent-0.2.0/tests/test_plan.py +547 -0
  82. nexus_coding_agent-0.2.0/tests/test_plan_context.py +265 -0
  83. nexus_coding_agent-0.2.0/tests/test_profile.py +557 -0
  84. nexus_coding_agent-0.2.0/tests/test_request_context.py +55 -0
  85. nexus_coding_agent-0.2.0/tests/test_safety_compaction.py +354 -0
  86. nexus_coding_agent-0.2.0/tests/test_session_context.py +440 -0
  87. nexus_coding_agent-0.2.0/tests/test_skill_cli.py +230 -0
  88. nexus_coding_agent-0.2.0/tests/test_skills.py +472 -0
  89. nexus_coding_agent-0.2.0/tests/test_stagnation.py +610 -0
  90. nexus_coding_agent-0.2.0/tests/test_tools.py +216 -0
  91. nexus_coding_agent-0.2.0/uv.lock +1220 -0
  92. nexus_coding_agent-0.1.0/.gitattributes +0 -7
  93. nexus_coding_agent-0.1.0/.github/workflows/ci.yml +0 -90
  94. nexus_coding_agent-0.1.0/.github/workflows/release.yml +0 -66
  95. nexus_coding_agent-0.1.0/.python-version +0 -1
  96. nexus_coding_agent-0.1.0/AGENTS.md +0 -110
  97. nexus_coding_agent-0.1.0/PKG-INFO +0 -142
  98. nexus_coding_agent-0.1.0/README.md +0 -118
  99. nexus_coding_agent-0.1.0/README.zh-CN.md +0 -114
  100. nexus_coding_agent-0.1.0/alembic.ini +0 -39
  101. nexus_coding_agent-0.1.0/compose.yaml +0 -19
  102. nexus_coding_agent-0.1.0/docs/Nexus_V1_Product_Requirements_and_10-Day_Engineering_Specification_v1.1.1_/344/270/255/346/226/207.md +0 -610
  103. nexus_coding_agent-0.1.0/docs/adr/001-use-langgraph-for-v1.md +0 -33
  104. nexus_coding_agent-0.1.0/docs/adr/002-runtime-abstraction.md +0 -33
  105. nexus_coding_agent-0.1.0/docs/adr/003-postgresql-persistence.md +0 -47
  106. nexus_coding_agent-0.1.0/docs/adr/004-pgvector-semantic-retrieval.md +0 -74
  107. nexus_coding_agent-0.1.0/docs/adr/005-cli-first-runtime-independent.md +0 -35
  108. nexus_coding_agent-0.1.0/docs/day1-architecture.md +0 -32
  109. nexus_coding_agent-0.1.0/docs/day10-release-evidence.md +0 -203
  110. nexus_coding_agent-0.1.0/docs/day2-session-cli.md +0 -74
  111. nexus_coding_agent-0.1.0/docs/day3-native-tool-runtime-security.md +0 -121
  112. nexus_coding_agent-0.1.0/docs/day4/coding_loop_demo_trace.md +0 -33
  113. nexus_coding_agent-0.1.0/docs/day4/validation_design.md +0 -27
  114. nexus_coding_agent-0.1.0/docs/day5-implementation-plan.md +0 -148
  115. nexus_coding_agent-0.1.0/docs/day6-acceptance-evidence.md +0 -74
  116. nexus_coding_agent-0.1.0/docs/day7-acceptance-evidence.md +0 -76
  117. nexus_coding_agent-0.1.0/docs/day7-implementation-plan.md +0 -569
  118. nexus_coding_agent-0.1.0/docs/day8-implementation-plan.md +0 -54
  119. nexus_coding_agent-0.1.0/docs/day8-observability-guide.md +0 -113
  120. nexus_coding_agent-0.1.0/docs/day8-run-trace-demo.md +0 -63
  121. nexus_coding_agent-0.1.0/docs/mcp-guide.md +0 -133
  122. nexus_coding_agent-0.1.0/docs/nexus-v1-release-guide.md +0 -286
  123. nexus_coding_agent-0.1.0/docs/skill-guide.md +0 -130
  124. nexus_coding_agent-0.1.0/docs/spec-addenda/Nexus_Day1_Contract_Addendum_v1.0.md +0 -1028
  125. nexus_coding_agent-0.1.0/docs/spec-addenda/Nexus_Day2_Contract_Addendum_v1.0.md +0 -142
  126. nexus_coding_agent-0.1.0/docs/spec-addenda/Nexus_Day3_Contract_Addendum_v1.0.md +0 -1322
  127. nexus_coding_agent-0.1.0/docs/spec-addenda/Nexus_Day4_Contract_Addendum_v0.2.3.md +0 -1642
  128. nexus_coding_agent-0.1.0/docs/spec-addenda/Nexus_Day5_Contract_Addendum_v0.1.2.md +0 -1826
  129. nexus_coding_agent-0.1.0/docs/spec-addenda/Nexus_Day6_Contract_Addendum_v0.3.md +0 -1223
  130. nexus_coding_agent-0.1.0/docs/spec-addenda/Nexus_Day7_Contract_Addendum_v0.1.1.md +0 -969
  131. nexus_coding_agent-0.1.0/docs/spec-addenda/Nexus_Day8_Contract_Addendum_v0.3.md +0 -1635
  132. nexus_coding_agent-0.1.0/evals/cases/EVAL-001/case.toml +0 -24
  133. nexus_coding_agent-0.1.0/evals/cases/EVAL-001/fixture/calculator.py +0 -3
  134. nexus_coding_agent-0.1.0/evals/cases/EVAL-001/fixture/tests/conftest.py +0 -4
  135. nexus_coding_agent-0.1.0/evals/cases/EVAL-001/fixture/tests/test_calculator.py +0 -9
  136. nexus_coding_agent-0.1.0/evals/cases/EVAL-002/case.toml +0 -24
  137. nexus_coding_agent-0.1.0/evals/cases/EVAL-002/fixture/formatter.py +0 -2
  138. nexus_coding_agent-0.1.0/evals/cases/EVAL-002/fixture/tests/conftest.py +0 -4
  139. nexus_coding_agent-0.1.0/evals/cases/EVAL-002/fixture/tests/test_formatter.py +0 -9
  140. nexus_coding_agent-0.1.0/evals/cases/EVAL-003/case.toml +0 -24
  141. nexus_coding_agent-0.1.0/evals/cases/EVAL-003/fixture/tags.py +0 -7
  142. nexus_coding_agent-0.1.0/evals/cases/EVAL-003/fixture/tests/conftest.py +0 -4
  143. nexus_coding_agent-0.1.0/evals/cases/EVAL-003/fixture/tests/test_tags.py +0 -9
  144. nexus_coding_agent-0.1.0/evals/cases/EVAL-004/case.toml +0 -25
  145. nexus_coding_agent-0.1.0/evals/cases/EVAL-004/fixture/discount.py +0 -3
  146. nexus_coding_agent-0.1.0/evals/cases/EVAL-004/fixture/tests/conftest.py +0 -4
  147. nexus_coding_agent-0.1.0/evals/cases/EVAL-004/fixture/tests/test_discount.py +0 -5
  148. nexus_coding_agent-0.1.0/evals/cases/EVAL-005/case.toml +0 -27
  149. nexus_coding_agent-0.1.0/evals/cases/EVAL-005/fixture/parser.py +0 -12
  150. nexus_coding_agent-0.1.0/evals/cases/EVAL-006/case.toml +0 -25
  151. nexus_coding_agent-0.1.0/evals/cases/EVAL-006/fixture/safe.txt +0 -1
  152. nexus_coding_agent-0.1.0/evals/reports/.gitignore +0 -1
  153. nexus_coding_agent-0.1.0/evals/reports/baseline-v1.json +0 -927
  154. nexus_coding_agent-0.1.0/evals/runner/__init__.py +0 -1
  155. nexus_coding_agent-0.1.0/examples/day10-fastapi-fixture/.gitignore +0 -3
  156. nexus_coding_agent-0.1.0/examples/day10-fastapi-fixture/README.md +0 -32
  157. nexus_coding_agent-0.1.0/examples/day10-fastapi-fixture/TASKS.md +0 -16
  158. nexus_coding_agent-0.1.0/examples/day10-fastapi-fixture/app/__init__.py +0 -1
  159. nexus_coding_agent-0.1.0/examples/day10-fastapi-fixture/app/main.py +0 -25
  160. nexus_coding_agent-0.1.0/examples/day10-fastapi-fixture/pyproject.toml +0 -17
  161. nexus_coding_agent-0.1.0/examples/day10-fastapi-fixture/tests/test_app.py +0 -16
  162. nexus_coding_agent-0.1.0/examples/day10-fastapi-fixture/uv.lock +0 -313
  163. nexus_coding_agent-0.1.0/migrations/env.py +0 -62
  164. nexus_coding_agent-0.1.0/migrations/script.py.mako +0 -24
  165. nexus_coding_agent-0.1.0/migrations/versions/0001_day2_business_persistence.py +0 -122
  166. nexus_coding_agent-0.1.0/migrations/versions/0002_day3_approvals.py +0 -68
  167. nexus_coding_agent-0.1.0/migrations/versions/0003_day5_semantic_retrieval.py +0 -22
  168. nexus_coding_agent-0.1.0/scripts/day3_native_tool_demo.py +0 -91
  169. nexus_coding_agent-0.1.0/src/nexus/application/__init__.py +0 -2
  170. nexus_coding_agent-0.1.0/src/nexus/application/approval_service.py +0 -130
  171. nexus_coding_agent-0.1.0/src/nexus/application/diff_service.py +0 -177
  172. nexus_coding_agent-0.1.0/src/nexus/application/event_publisher.py +0 -180
  173. nexus_coding_agent-0.1.0/src/nexus/application/execution_context.py +0 -29
  174. nexus_coding_agent-0.1.0/src/nexus/application/execution_ledger.py +0 -126
  175. nexus_coding_agent-0.1.0/src/nexus/application/model_call_context.py +0 -29
  176. nexus_coding_agent-0.1.0/src/nexus/application/observed_model_gateway.py +0 -194
  177. nexus_coding_agent-0.1.0/src/nexus/application/plan_approval_service.py +0 -250
  178. nexus_coding_agent-0.1.0/src/nexus/application/planning.py +0 -668
  179. nexus_coding_agent-0.1.0/src/nexus/application/runtime.py +0 -624
  180. nexus_coding_agent-0.1.0/src/nexus/application/session_service.py +0 -411
  181. nexus_coding_agent-0.1.0/src/nexus/application/structured_output.py +0 -96
  182. nexus_coding_agent-0.1.0/src/nexus/application/telemetry.py +0 -396
  183. nexus_coding_agent-0.1.0/src/nexus/application/telemetry_subscriber.py +0 -216
  184. nexus_coding_agent-0.1.0/src/nexus/application/tool_runtime.py +0 -496
  185. nexus_coding_agent-0.1.0/src/nexus/application/tracing_dispatcher.py +0 -283
  186. nexus_coding_agent-0.1.0/src/nexus/application/validation.py +0 -293
  187. nexus_coding_agent-0.1.0/src/nexus/config/__init__.py +0 -17
  188. nexus_coding_agent-0.1.0/src/nexus/config/loader.py +0 -253
  189. nexus_coding_agent-0.1.0/src/nexus/config/models.py +0 -310
  190. nexus_coding_agent-0.1.0/src/nexus/context/__init__.py +0 -6
  191. nexus_coding_agent-0.1.0/src/nexus/context/budget.py +0 -24
  192. nexus_coding_agent-0.1.0/src/nexus/context/builder.py +0 -92
  193. nexus_coding_agent-0.1.0/src/nexus/context/chunking.py +0 -65
  194. nexus_coding_agent-0.1.0/src/nexus/context/explorer.py +0 -246
  195. nexus_coding_agent-0.1.0/src/nexus/context/integration.py +0 -63
  196. nexus_coding_agent-0.1.0/src/nexus/context/manager.py +0 -328
  197. nexus_coding_agent-0.1.0/src/nexus/context/retrieval.py +0 -261
  198. nexus_coding_agent-0.1.0/src/nexus/domain/__init__.py +0 -2
  199. nexus_coding_agent-0.1.0/src/nexus/domain/agent_decision.py +0 -113
  200. nexus_coding_agent-0.1.0/src/nexus/domain/agent_state.py +0 -49
  201. nexus_coding_agent-0.1.0/src/nexus/domain/approvals.py +0 -64
  202. nexus_coding_agent-0.1.0/src/nexus/domain/context.py +0 -108
  203. nexus_coding_agent-0.1.0/src/nexus/domain/exploration.py +0 -86
  204. nexus_coding_agent-0.1.0/src/nexus/domain/mcp.py +0 -51
  205. nexus_coding_agent-0.1.0/src/nexus/domain/model.py +0 -173
  206. nexus_coding_agent-0.1.0/src/nexus/domain/observability.py +0 -326
  207. nexus_coding_agent-0.1.0/src/nexus/domain/persistence.py +0 -122
  208. nexus_coding_agent-0.1.0/src/nexus/domain/planning.py +0 -329
  209. nexus_coding_agent-0.1.0/src/nexus/domain/ports/__init__.py +0 -61
  210. nexus_coding_agent-0.1.0/src/nexus/domain/ports/agent_decision.py +0 -9
  211. nexus_coding_agent-0.1.0/src/nexus/domain/ports/approval_unit_of_work.py +0 -27
  212. nexus_coding_agent-0.1.0/src/nexus/domain/ports/checkpoint_provider.py +0 -11
  213. nexus_coding_agent-0.1.0/src/nexus/domain/ports/context.py +0 -71
  214. nexus_coding_agent-0.1.0/src/nexus/domain/ports/events.py +0 -21
  215. nexus_coding_agent-0.1.0/src/nexus/domain/ports/graph_runtime.py +0 -30
  216. nexus_coding_agent-0.1.0/src/nexus/domain/ports/mcp.py +0 -23
  217. nexus_coding_agent-0.1.0/src/nexus/domain/ports/model_gateway.py +0 -21
  218. nexus_coding_agent-0.1.0/src/nexus/domain/ports/model_input_budget.py +0 -15
  219. nexus_coding_agent-0.1.0/src/nexus/domain/ports/planning.py +0 -62
  220. nexus_coding_agent-0.1.0/src/nexus/domain/ports/repositories.py +0 -54
  221. nexus_coding_agent-0.1.0/src/nexus/domain/ports/repository_context.py +0 -18
  222. nexus_coding_agent-0.1.0/src/nexus/domain/ports/session_unit_of_work.py +0 -33
  223. nexus_coding_agent-0.1.0/src/nexus/domain/ports/skills.py +0 -41
  224. nexus_coding_agent-0.1.0/src/nexus/domain/ports/tooling.py +0 -39
  225. nexus_coding_agent-0.1.0/src/nexus/domain/ports/tracer.py +0 -13
  226. nexus_coding_agent-0.1.0/src/nexus/domain/ports/validation.py +0 -32
  227. nexus_coding_agent-0.1.0/src/nexus/domain/runtime_events.py +0 -445
  228. nexus_coding_agent-0.1.0/src/nexus/domain/skills.py +0 -129
  229. nexus_coding_agent-0.1.0/src/nexus/domain/tooling.py +0 -163
  230. nexus_coding_agent-0.1.0/src/nexus/domain/validation.py +0 -161
  231. nexus_coding_agent-0.1.0/src/nexus/errors/__init__.py +0 -82
  232. nexus_coding_agent-0.1.0/src/nexus/evaluation/__init__.py +0 -7
  233. nexus_coding_agent-0.1.0/src/nexus/evaluation/assertions.py +0 -4
  234. nexus_coding_agent-0.1.0/src/nexus/evaluation/evaluator.py +0 -263
  235. nexus_coding_agent-0.1.0/src/nexus/evaluation/fixtures.py +0 -36
  236. nexus_coding_agent-0.1.0/src/nexus/evaluation/harness.py +0 -606
  237. nexus_coding_agent-0.1.0/src/nexus/evaluation/loader.py +0 -415
  238. nexus_coding_agent-0.1.0/src/nexus/evaluation/metrics.py +0 -27
  239. nexus_coding_agent-0.1.0/src/nexus/evaluation/models.py +0 -362
  240. nexus_coding_agent-0.1.0/src/nexus/evaluation/report.py +0 -43
  241. nexus_coding_agent-0.1.0/src/nexus/evaluation/runner.py +0 -480
  242. nexus_coding_agent-0.1.0/src/nexus/infrastructure/__init__.py +0 -2
  243. nexus_coding_agent-0.1.0/src/nexus/infrastructure/asyncio_compat.py +0 -13
  244. nexus_coding_agent-0.1.0/src/nexus/infrastructure/bootstrap/__init__.py +0 -17
  245. nexus_coding_agent-0.1.0/src/nexus/infrastructure/bootstrap/composition.py +0 -663
  246. nexus_coding_agent-0.1.0/src/nexus/infrastructure/checkpoint/__init__.py +0 -5
  247. nexus_coding_agent-0.1.0/src/nexus/infrastructure/checkpoint/postgres.py +0 -62
  248. nexus_coding_agent-0.1.0/src/nexus/infrastructure/database.py +0 -39
  249. nexus_coding_agent-0.1.0/src/nexus/infrastructure/embedding.py +0 -61
  250. nexus_coding_agent-0.1.0/src/nexus/infrastructure/graph/__init__.py +0 -6
  251. nexus_coding_agent-0.1.0/src/nexus/infrastructure/graph/day4_runtime.py +0 -966
  252. nexus_coding_agent-0.1.0/src/nexus/infrastructure/graph/langgraph_runtime.py +0 -172
  253. nexus_coding_agent-0.1.0/src/nexus/infrastructure/mcp/__init__.py +0 -5
  254. nexus_coding_agent-0.1.0/src/nexus/infrastructure/mcp/manager.py +0 -380
  255. nexus_coding_agent-0.1.0/src/nexus/infrastructure/model_gateway/__init__.py +0 -6
  256. nexus_coding_agent-0.1.0/src/nexus/infrastructure/model_gateway/openai_compatible.py +0 -345
  257. nexus_coding_agent-0.1.0/src/nexus/infrastructure/observability/__init__.py +0 -7
  258. nexus_coding_agent-0.1.0/src/nexus/infrastructure/observability/console.py +0 -31
  259. nexus_coding_agent-0.1.0/src/nexus/infrastructure/observability/langsmith.py +0 -236
  260. nexus_coding_agent-0.1.0/src/nexus/infrastructure/observability/structured_logger.py +0 -70
  261. nexus_coding_agent-0.1.0/src/nexus/infrastructure/persistence/__init__.py +0 -13
  262. nexus_coding_agent-0.1.0/src/nexus/infrastructure/persistence/approval_unit_of_work.py +0 -74
  263. nexus_coding_agent-0.1.0/src/nexus/infrastructure/persistence/models.py +0 -146
  264. nexus_coding_agent-0.1.0/src/nexus/infrastructure/persistence/repositories.py +0 -326
  265. nexus_coding_agent-0.1.0/src/nexus/infrastructure/persistence/unit_of_work.py +0 -82
  266. nexus_coding_agent-0.1.0/src/nexus/infrastructure/repository_files.py +0 -117
  267. nexus_coding_agent-0.1.0/src/nexus/infrastructure/sandbox/__init__.py +0 -5
  268. nexus_coding_agent-0.1.0/src/nexus/infrastructure/sandbox/local_process.py +0 -353
  269. nexus_coding_agent-0.1.0/src/nexus/infrastructure/semantic.py +0 -276
  270. nexus_coding_agent-0.1.0/src/nexus/infrastructure/semantic_models.py +0 -56
  271. nexus_coding_agent-0.1.0/src/nexus/interfaces/__init__.py +0 -2
  272. nexus_coding_agent-0.1.0/src/nexus/interfaces/cli/__init__.py +0 -2
  273. nexus_coding_agent-0.1.0/src/nexus/interfaces/cli/__main__.py +0 -6
  274. nexus_coding_agent-0.1.0/src/nexus/interfaces/cli/app.py +0 -266
  275. nexus_coding_agent-0.1.0/src/nexus/interfaces/cli/renderer.py +0 -118
  276. nexus_coding_agent-0.1.0/src/nexus/security/__init__.py +0 -14
  277. nexus_coding_agent-0.1.0/src/nexus/security/approval_policies.py +0 -73
  278. nexus_coding_agent-0.1.0/src/nexus/security/command_policy.py +0 -117
  279. nexus_coding_agent-0.1.0/src/nexus/security/executables.py +0 -107
  280. nexus_coding_agent-0.1.0/src/nexus/security/git_commands.py +0 -65
  281. nexus_coding_agent-0.1.0/src/nexus/security/workspace.py +0 -93
  282. nexus_coding_agent-0.1.0/src/nexus/skills/__init__.py +0 -7
  283. nexus_coding_agent-0.1.0/src/nexus/skills/builtin/__init__.py +0 -1
  284. nexus_coding_agent-0.1.0/src/nexus/skills/builtin/debug-python/SKILL.md +0 -26
  285. nexus_coding_agent-0.1.0/src/nexus/skills/builtin/review-repository/SKILL.md +0 -26
  286. nexus_coding_agent-0.1.0/src/nexus/skills/builtin/write-tests/SKILL.md +0 -26
  287. nexus_coding_agent-0.1.0/src/nexus/skills/loader.py +0 -439
  288. nexus_coding_agent-0.1.0/src/nexus/skills/registry.py +0 -146
  289. nexus_coding_agent-0.1.0/src/nexus/skills/selector.py +0 -152
  290. nexus_coding_agent-0.1.0/src/nexus/tools/__init__.py +0 -6
  291. nexus_coding_agent-0.1.0/src/nexus/tools/editing.py +0 -312
  292. nexus_coding_agent-0.1.0/src/nexus/tools/mcp.py +0 -160
  293. nexus_coding_agent-0.1.0/src/nexus/tools/native.py +0 -654
  294. nexus_coding_agent-0.1.0/src/nexus/tools/registry.py +0 -27
  295. nexus_coding_agent-0.1.0/tests/fixtures/__init__.py +0 -1
  296. nexus_coding_agent-0.1.0/tests/fixtures/embedding.py +0 -39
  297. nexus_coding_agent-0.1.0/tests/integration/conftest.py +0 -70
  298. nexus_coding_agent-0.1.0/tests/integration/test_approval_persistence.py +0 -184
  299. nexus_coding_agent-0.1.0/tests/integration/test_checkpoint_resume.py +0 -244
  300. nexus_coding_agent-0.1.0/tests/integration/test_database.py +0 -23
  301. nexus_coding_agent-0.1.0/tests/integration/test_day4_coding_loop.py +0 -319
  302. nexus_coding_agent-0.1.0/tests/integration/test_day4_plan_approval.py +0 -96
  303. nexus_coding_agent-0.1.0/tests/integration/test_day5_live_embedding.py +0 -58
  304. nexus_coding_agent-0.1.0/tests/integration/test_day5_retrieval.py +0 -530
  305. nexus_coding_agent-0.1.0/tests/integration/test_day6_mcp_e2e.py +0 -221
  306. nexus_coding_agent-0.1.0/tests/integration/test_day6_mcp_graph.py +0 -296
  307. nexus_coding_agent-0.1.0/tests/integration/test_day7_skill_system.py +0 -270
  308. nexus_coding_agent-0.1.0/tests/integration/test_day8_langsmith_live.py +0 -143
  309. nexus_coding_agent-0.1.0/tests/integration/test_day9_evaluation_harness.py +0 -105
  310. nexus_coding_agent-0.1.0/tests/integration/test_day9_runner.py +0 -332
  311. nexus_coding_agent-0.1.0/tests/integration/test_git_tools.py +0 -78
  312. nexus_coding_agent-0.1.0/tests/integration/test_migrations.py +0 -83
  313. nexus_coding_agent-0.1.0/tests/integration/test_persistence.py +0 -179
  314. nexus_coding_agent-0.1.0/tests/integration/test_runtime_graph.py +0 -34
  315. nexus_coding_agent-0.1.0/tests/unit/test_cli.py +0 -64
  316. nexus_coding_agent-0.1.0/tests/unit/test_config.py +0 -178
  317. nexus_coding_agent-0.1.0/tests/unit/test_day10_runtime_hardening.py +0 -173
  318. nexus_coding_agent-0.1.0/tests/unit/test_day4_cli.py +0 -97
  319. nexus_coding_agent-0.1.0/tests/unit/test_day4_contracts.py +0 -1201
  320. nexus_coding_agent-0.1.0/tests/unit/test_day4_diff.py +0 -160
  321. nexus_coding_agent-0.1.0/tests/unit/test_day4_graph.py +0 -766
  322. nexus_coding_agent-0.1.0/tests/unit/test_day5_context.py +0 -432
  323. nexus_coding_agent-0.1.0/tests/unit/test_day7_skill_config.py +0 -75
  324. nexus_coding_agent-0.1.0/tests/unit/test_day7_skill_context.py +0 -359
  325. nexus_coding_agent-0.1.0/tests/unit/test_day7_skill_domain.py +0 -112
  326. nexus_coding_agent-0.1.0/tests/unit/test_day7_skill_loader.py +0 -344
  327. nexus_coding_agent-0.1.0/tests/unit/test_day7_skill_registry.py +0 -167
  328. nexus_coding_agent-0.1.0/tests/unit/test_day7_skill_selector.py +0 -321
  329. nexus_coding_agent-0.1.0/tests/unit/test_day8_event_publisher.py +0 -113
  330. nexus_coding_agent-0.1.0/tests/unit/test_day8_live_runtime.py +0 -516
  331. nexus_coding_agent-0.1.0/tests/unit/test_day8_observability_config.py +0 -114
  332. nexus_coding_agent-0.1.0/tests/unit/test_day8_observability_contracts.py +0 -210
  333. nexus_coding_agent-0.1.0/tests/unit/test_day8_observed_model_gateway.py +0 -137
  334. nexus_coding_agent-0.1.0/tests/unit/test_day8_tracers.py +0 -225
  335. nexus_coding_agent-0.1.0/tests/unit/test_day8_tracing_dispatcher.py +0 -489
  336. nexus_coding_agent-0.1.0/tests/unit/test_day9_cli_report.py +0 -39
  337. nexus_coding_agent-0.1.0/tests/unit/test_day9_contracts.py +0 -231
  338. nexus_coding_agent-0.1.0/tests/unit/test_day9_evaluator.py +0 -418
  339. nexus_coding_agent-0.1.0/tests/unit/test_day9_harness.py +0 -209
  340. nexus_coding_agent-0.1.0/tests/unit/test_mcp_adapter.py +0 -197
  341. nexus_coding_agent-0.1.0/tests/unit/test_mcp_config.py +0 -192
  342. nexus_coding_agent-0.1.0/tests/unit/test_mcp_exposure.py +0 -221
  343. nexus_coding_agent-0.1.0/tests/unit/test_mcp_manager.py +0 -519
  344. nexus_coding_agent-0.1.0/tests/unit/test_mcp_runtime_policy.py +0 -236
  345. nexus_coding_agent-0.1.0/tests/unit/test_model_gateway.py +0 -250
  346. nexus_coding_agent-0.1.0/tests/unit/test_native_tools.py +0 -150
  347. nexus_coding_agent-0.1.0/tests/unit/test_runtime.py +0 -90
  348. nexus_coding_agent-0.1.0/tests/unit/test_sandbox.py +0 -193
  349. nexus_coding_agent-0.1.0/tests/unit/test_security_policy.py +0 -174
  350. nexus_coding_agent-0.1.0/tests/unit/test_structured_output.py +0 -249
  351. nexus_coding_agent-0.1.0/tests/unit/test_tool_runtime.py +0 -320
  352. nexus_coding_agent-0.1.0/uv.lock +0 -2519
  353. {nexus_coding_agent-0.1.0 → nexus_coding_agent-0.2.0}/tests/__init__.py +0 -0
@@ -6,7 +6,9 @@
6
6
  __pycache__/
7
7
  *.py[cod]
8
8
  .pytest_cache/
9
- .pytest-tmp/
9
+ .pytest-tmp*/
10
+ .pytest-temp*/
11
+ artifacts/
10
12
  .mypy_cache/
11
13
  .ruff_cache/
12
14
  .coverage
@@ -0,0 +1,23 @@
1
+ # Nexus Next V0
2
+
3
+ 本仓库当前开发 Nexus Next V0。本文件只作开发入口,不复制项目契约。
4
+
5
+ ## 有效设计依据
6
+
7
+ - [冻结架构原文](docs/next/architecture-contract-v0.md)
8
+ - [开发设计 v0.2](docs/next/01-development-design.md)
9
+ - [实施与验收清单](docs/next/02-delivery-and-acceptance.md)
10
+
11
+ `docs/next/00-review-and-decisions.md` 只记录审核、迁移和状态,不建立新的长期 Contract / ADR 权威层。
12
+
13
+ ## 旧规则失效
14
+
15
+ 旧 Nexus 的 Day1–Day10、旧 Product Specification、旧 ADR、spec-addenda、旧 AGENTS 指令全部失效,不得从历史文档、代码或 Memory 继续继承为默认规则。这也包括 LangGraph 工作流、Planner / Validator / Validation / Repair / Replan 节点、SAFE / WRITE / DANGEROUS 与 Plan-based authorization,以及旧 PostgreSQL / pgvector / RAG / Skills / LangSmith 架构要求。遗留源码、测试、配置和示例是待迁移材料,不是 Next 的设计依据。
16
+
17
+ ## 开发原则
18
+
19
+ - Minimal scaffold, evidence-driven complexity。
20
+ - 一个 hand-written message-driven Agent Loop;不擅自加入冻结范围外的新架构。
21
+ - 实现细节优先采用最简单合理方案;只有真正改变冻结架构边界的问题,才停止并报告证据与选项。
22
+ - 按当前任务范围推进并验证;不恢复旧 Product Owner / knowledge review / Day gate 审批体系。
23
+ - 不自行 commit / push / merge / publish。
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Archer
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,361 @@
1
+ Metadata-Version: 2.5
2
+ Name: nexus-coding-agent
3
+ Version: 0.2.0
4
+ Summary: A small, local, message-driven coding agent.
5
+ Project-URL: Homepage, https://github.com/K529529/Nexus
6
+ Project-URL: Repository, https://github.com/K529529/Nexus
7
+ Project-URL: Issues, https://github.com/K529529/Nexus/issues
8
+ Author: Archer
9
+ License-Expression: MIT
10
+ License-File: LICENSE
11
+ Requires-Python: >=3.12
12
+ Requires-Dist: mcp<3,>=2
13
+ Requires-Dist: openai<3,>=2
14
+ Requires-Dist: prompt-toolkit<4,>=3
15
+ Requires-Dist: pyyaml<7,>=6
16
+ Requires-Dist: rich<15,>=14
17
+ Description-Content-Type: text/markdown
18
+
19
+ # Nexus 0.2.0 (Next)
20
+
21
+ [中文](README.zh-CN.md)
22
+
23
+ A small local coding agent: one hand-written message loop, native function calling,
24
+ and two native coding tools, `exec_command` and `apply_patch`, plus `update_plan`
25
+ for progress tracking and `load_skill` for optional local guidance. The model explores, edits,
26
+ runs tests, repairs failures, and decides when to finish. No database or repository
27
+ index is required. Explicitly configured stdio MCP servers can supply additional tools.
28
+
29
+ The Next rewrite keeps the `nexus-coding-agent` package name and `nexus` command. See
30
+ [acceptance evidence](docs/next/acceptance-evidence.md) for actual PASS/FAIL/NOT RUN
31
+ results. A model's `completed` outcome is not proof that tests passed or that a
32
+ benchmark instance was resolved. See the [0.2.0 release notes](docs/next/release-0.2.0.md)
33
+ for changes, migration and verification boundaries. The release checklist records publication status.
34
+
35
+ ## Install
36
+
37
+ Python 3.12+; Windows PowerShell or Linux `/bin/sh`.
38
+
39
+ After 0.2.0 is available on PyPI, install it as an isolated command:
40
+
41
+ ```sh
42
+ uv tool install "nexus-coding-agent==0.2.0"
43
+ nexus --version
44
+ ```
45
+
46
+ Alternatively, use `python -m pip install "nexus-coding-agent==0.2.0"` in a dedicated
47
+ virtual environment. Before publication, build and install the local wheel:
48
+
49
+ ```sh
50
+ uv build
51
+ uv tool install dist/nexus_coding_agent-0.2.0-py3-none-any.whl
52
+ ```
53
+
54
+ When upgrading an existing uv tool installation, add `--force`. Check `Get-Command nexus -All`
55
+ (PowerShell) or `command -v nexus` (Linux) if an older installation shadows the new command.
56
+ Back up `~/.nexus/config.toml` before upgrading from 0.1.0; use the minimal configuration
57
+ below. Old database sessions and legacy Skills are not migrated. Model API calls are billed
58
+ by your provider; installing Nexus does not include API credits.
59
+
60
+ For development: `uv sync --frozen --dev`, then `uv run --frozen nexus`.
61
+ Start in the project root: the starting directory is the workspace. Nexus only
62
+ automatically reads that directory's `AGENTS.md`; it does not find the Git root,
63
+ load nested instructions, scan files, or build a repository summary at startup.
64
+
65
+ ## Configure
66
+
67
+ Run `nexus` in a terminal for first-use setup, or create `~/.nexus/config.toml`.
68
+ The wizard asks for an environment variable **name**, never the key value.
69
+ It preserves other TOML sections and does not overwrite invalid TOML.
70
+
71
+ ```toml
72
+ [model]
73
+ name = "your-tool-capable-model"
74
+ base_url = "https://your-service.example/v1"
75
+ api_key_env = "NEXUS_MODEL_API_KEY"
76
+ context_window = 32768
77
+ max_output_tokens = 8192
78
+ include_usage = true
79
+ # request_timeout_seconds = 120 # Entire model response, 1..600 seconds
80
+ # output_token_parameter = "max_completion_tokens" # Opt in if supported by your service
81
+ # reasoning_effort = "high"
82
+
83
+ [runtime]
84
+ max_steps = 40
85
+
86
+ [execution]
87
+ output_limit_bytes = 32768
88
+ # shell = "C:/Program Files/PowerShell/7/pwsh.exe"
89
+
90
+ # [mcp.servers.example]
91
+ # command = "/absolute/path/to/already-installed-server"
92
+ # args = []
93
+ # env_from = { SERVICE_TOKEN = "MY_SERVICE_TOKEN" }
94
+ ```
95
+
96
+ Set the key in the same terminal before starting:
97
+
98
+ ```powershell
99
+ $env:NEXUS_MODEL_API_KEY = '<key>'
100
+ nexus
101
+ ```
102
+
103
+ ```sh
104
+ export NEXUS_MODEL_API_KEY='<key>'
105
+ nexus
106
+ ```
107
+
108
+ `output_token_parameter` selects `max_tokens` (compatible default) or
109
+ `max_completion_tokens`. For services where `max_tokens` excludes reasoning,
110
+ select a supported total-completion parameter so the provider cap includes both
111
+ reasoning and the answer. `max_output_tokens` supplies the same value to that
112
+ parameter and the Context reserve. Nexus does not guess from the model name or
113
+ retry with another parameter when a service rejects it. Verify enforcement with a
114
+ bounded provider probe: an accepted but ignored parameter is not a working cap.
115
+ See [live parameter evidence](docs/next/cost-hardening.md).
116
+
117
+ Use your service's actual context limit. `context_window` must exceed
118
+ `max_output_tokens + 1024`. `NEXUS_MODEL_NAME` and `NEXUS_MODEL_BASE_URL` override
119
+ only the corresponding model fields. Repository `.env` and `.nexus/config.toml`
120
+ are never loaded. Old Nexus configuration sections (including `observability`)
121
+ are unsupported: preserve a backup and remove those sections before using Next.
122
+
123
+ The current cost-first Bailian candidate is `qwen3.8-flash`, reasoning `low`,
124
+ 16,384 total completion tokens, a 300-second request deadline, and 40 model steps.
125
+ One full round achieved 6/8 PASS and 8/8 autonomous completions at about CNY 1.54
126
+ in reported-token cost; this is not evidence of stable 8/8. Exact settings and
127
+ remaining failures are in the [hardening report](docs/next/suite-hardening-evidence.md).
128
+
129
+ The initial small-task acceptance used `deepseek-v4.1-flash`, Chat
130
+ Completions, `reasoning_effort = "high"`, `context_window = 1000000`, and
131
+ `max_output_tokens = 32768`. Configure the Base URL for your account/region and
132
+ `api_key_env = "DASHSCOPE_API_KEY"`; no endpoint or key is hard-coded into the runtime.
133
+ This historical profile is not a general reliability recommendation. Later Requests/Sphinx
134
+ runs used different output/reasoning settings and exposed edit/finish failures; see
135
+ [execution-budget evidence](docs/next/execution-budget-evidence.md).
136
+ The [subsequent model comparison](docs/next/model-delivery-evidence.md) records Qwen's
137
+ Requests PASS with autonomous completion and a Sphinx PASS interrupted by service access denial.
138
+ After service access was restored, broader low-cost model comparisons continued;
139
+ see [current eight-case results and limitations](docs/next/suite-hardening-evidence.md).
140
+ The earlier Max candidate is not the selected default or a reliability guarantee.
141
+
142
+ ## Work and resume
143
+
144
+ ```sh
145
+ nexus
146
+ nexus exec "Fix the empty-input bug and run the existing tests"
147
+ nexus exec "Explain this test failure" --json
148
+ nexus resume
149
+ ```
150
+
151
+ Interactive commands: `/new`, `/resume`, `/skills`, `/skill <name>`, `/skill off`, `/help`, `/exit`. The selector shows
152
+ task title, project, update time and status; use arrows/Enter or Esc. Ctrl+C
153
+ aborts the active turn with bounded process cleanup; at an idle prompt it clears
154
+ input. Non-interactive callers must use `exec`. Exit codes are 0 completed,
155
+ 1 failed, 2 configuration/arguments, 3 limited, and 130 aborted.
156
+
157
+ The default transcript omits per-round model-start messages. Ordinary successful tools
158
+ leave one summary line with status and duration; a terminal shows a temporary activity
159
+ line while a tool runs. Read/search/test/Git labels are display hints only; compound or
160
+ long commands use "Run shell command". No shell/MCP output is dumped. Failures show up
161
+ to four excerpt lines; patches show at most three
162
+ file summaries with short diff previews. Assistant progress and final answers remain
163
+ visible. This only changes presentation: model observations and session records retain
164
+ the tool-budgeted results. Use `nexus exec "task" --json` for detailed public events.
165
+
166
+ One conversation reuses its model client, tool registry, and MCP connections across
167
+ turns. `/new`, selecting a resumed conversation, or exiting closes those resources;
168
+ a new conversation connects lazily on its first task. Failed or interrupted MCP servers
169
+ stay disabled until a new conversation. Configuration is reloaded for new conversations,
170
+ not hot-reloaded between turns. Internal callers must await `Conversation.close()` in
171
+ the same async task that runs its turns.
172
+
173
+ Sessions are append-only JSONL under `~/.nexus/sessions/<workspace-key>/` with one
174
+ writer per session. Resume restores conversation and waits for a new user request.
175
+ Each ordinary input starts an isolated run: the model sees current system/repository
176
+ instructions, the current request and that run's messages. Previous runs stay in JSONL.
177
+ Use `/resume` or `nexus resume` to select a session whose latest run is unfinished
178
+ (interrupted, aborted, failed or limited); the next input continues that run's context.
179
+ A completed session's next input starts a new run. Run IDs remain internal metadata;
180
+ the selector resumes only the latest unfinished run. Context Runtime V0.2.1 retains run
181
+ isolation and safety compaction. At 85% of the projected input budget, it summarizes old
182
+ complete groups in the current run's active context, aiming for roughly 60%. Original
183
+ messages stay in session history and JSONL; resume reconstructs the saved projection.
184
+ If the provider reports a context limit before compaction was attempted at that boundary,
185
+ Nexus attempts compaction and retries once. Unrecoverable overflow returns
186
+ `limited/context_limit`. Tool observations stay FULL until a later validated assistant message
187
+ is appended. Consumed results outside a token-budgeted recent working set receive deterministic
188
+ `compact-v1` previews at request time. Session/JSONL retain original messages; safety snapshots
189
+ retain logical references, and HOT tool groups cannot be summarized. Projection diagnostics are
190
+ available in JSONL/profile metrics without extra TUI output. Soft compaction and further history
191
+ reduction remain future work. See [V0.2.1 evidence](docs/next/context-runtime-v0.2.1-evidence.md).
192
+ It never reruns old commands. Missing results after interruption become
193
+ `interrupted_unknown`; inspect actual files/process state before retrying. A
194
+ corrupt final line is recovered into a new file while preserving the original;
195
+ middle corruption is rejected. Each complete record is flushed; this is not a
196
+ durable transaction or an exactly-once execution guarantee.
197
+
198
+ Execution is trusted local execution with your account's permissions. Shell/MCP
199
+ can access files and networks available to that account. Patch writes are confined
200
+ to the workspace, which does not sandbox the other tools. Shell output has a shared
201
+ head/tail budget, and timeout/nonzero exit/patch conflicts are observations for the
202
+ model. `exit_code` is the shell's exit code (PowerShell does not always return its
203
+ child process's numeric code). A cleanup failure stops the turn visibly.
204
+
205
+ `apply_patch` uses the Nexus `*** Begin Patch` format with Add/Update/Delete File
206
+ operations and context-based `@@` chunks, without line numbers or hunk counts.
207
+ Legacy UTF-8 unified diffs remain accepted. No rename, binary or mode changes.
208
+ Ambiguous context is rejected. All files are preflighted; individual replacement
209
+ is atomic, but a multi-file I/O failure can leave an explicitly reported partial result.
210
+
211
+ `update_plan` replaces a run's progress list with pending/in_progress/completed items;
212
+ at most one item can be in progress, and an empty list clears it. The committed list
213
+ is restored on resume and projected into each request without accumulating history.
214
+ Plan completion does not prove correctness or end the Agent. The stagnation detector
215
+ can send one progress reminder per execution window; it does not force an edit.
216
+ The request also shows the remaining model-turn budget. These are model guidance,
217
+ not guarantees of progress or timely completion.
218
+
219
+ Public JSON events omit private continuation fields and redact configured known
220
+ credentials. Local session history contains user input and source/tool content;
221
+ it is not a general secret detector. When a provider returns `reasoning_content`,
222
+ the adapter retains it as private, service/model-bound continuation data in the local
223
+ session and sends it on subsequent requests. Public events omit it; changing the
224
+ service/model requires a fresh session rather than reusing those private fields.
225
+
226
+ ## Develop and inspect
227
+
228
+ Opt in to a developer report after each run:
229
+
230
+ ```sh
231
+ nexus --profile
232
+ nexus exec "Explain the repository structure" --profile
233
+ ```
234
+
235
+ With the existing Windows development environment, use
236
+ `.\.venv\Scripts\nexus.exe --profile` or
237
+ `.\.venv\Scripts\nexus.exe exec "Explain the repository structure" --profile`.
238
+ The normal TUI is unchanged without the flag; `--profile` and `--json` are mutually
239
+ exclusive. The report is a derived human-readable summary; JSONL remains the canonical
240
+ full trajectory, and the report prints its actual path. Cumulative tokens include all
241
+ model calls, while active-context first/peak/final input uses successful normal calls
242
+ and excludes compaction calls. With incomplete usage, known token subtotals show `≥`
243
+ and usage coverage; a field with no reported values stays `unknown`. Successes, failed
244
+ attempts and explicit retries are counted separately. Metrics reset for
245
+ each run, including a resumed execution. See the
246
+ [offline example and metric definitions](docs/next/developer-run-profiler-v0.1-evidence.md).
247
+
248
+ ```sh
249
+ uv run --frozen ruff check .
250
+ uv run --frozen mypy src tests
251
+ uv run --frozen pytest
252
+ uv lock --check
253
+ uv build
254
+ git diff --check
255
+ ```
256
+
257
+ CI runs offline behavior tests on Windows/Linux with Python 3.12. Git is needed
258
+ for the evaluation collector tests, not for ordinary Nexus startup. Cloud live
259
+ tests are separate from paid CI. Read `src/nexus/core/agent.py` for the loop,
260
+ `core/model.py` for the wire adapter, `tools/` for execution, and `app/` for local
261
+ sessions and terminal consumers. Five direct runtime dependencies: OpenAI SDK,
262
+ MCP SDK, prompt_toolkit, Rich and PyYAML (safe Skill metadata parsing). SDK transitive dependencies are listed in `uv.lock`.
263
+ For a code-based explanation of the design, tradeoffs and evidence boundaries, see
264
+ the [engineering walkthrough](docs/next/engineering-walkthrough.md).
265
+
266
+ ## Official SWE-bench integration
267
+
268
+ The optional developer script has only `predict` and `collect`; it does not grade.
269
+ Install the official harness in a separate Linux/Docker environment. Prepare clean
270
+ inference workspaces externally, at each task's exact base commit with dependencies.
271
+ Tasks JSONL fields: `instance_id`, `repo`, `base_commit`, `problem_statement`,
272
+ `workspace`. Do not expose official patches/tests/answers to the agent.
273
+
274
+ An environment JSON record must contain `dataset`, `dataset_revision`, `network`
275
+ and `contamination`. Record access to future Git history and mounted answers; a
276
+ clean Git status alone does not establish an uncontaminated benchmark environment.
277
+
278
+ ```sh
279
+ python -m pip install swebench==5.0.2
280
+
281
+ uv run --frozen python scripts/swebench_v0.py predict \
282
+ --tasks tasks.jsonl --output /outside-inference/artifacts \
283
+ --environment-record environment.json
284
+
285
+ python -m swebench.harness.run_evaluation \
286
+ --dataset_name SWE-bench/SWE-bench_Lite \
287
+ --predictions_path /outside-inference/artifacts/predictions.jsonl \
288
+ --instance_ids <verified-instance-id> --max_workers 1 --run_id <new-run-id>
289
+
290
+ uv run --frozen python scripts/swebench_v0.py collect \
291
+ --runs /outside-inference/artifacts/runs.jsonl \
292
+ --harness-root logs/run_evaluation/<new-run-id> --harness-version 5.0.2 \
293
+ --output official-results.jsonl
294
+ ```
295
+
296
+ Select the official dataset containing your verified instance. The collector
297
+ compares final files against the original base commit using a temporary Git index,
298
+ including model-committed changes and unignored new files. It preserves the user's
299
+ index. Reports are linked by instance, run, and exact patch hash; missing reports
300
+ remain unknown. Keep raw reports and use a fresh harness run ID for every new patch.
301
+ See the [official evaluation guide](https://www.swebench.com/SWE-bench/guides/evaluation/).
302
+
303
+ Harness 5.0.2 requires the `image` and evaluation fields in the current official
304
+ `SWE-bench/SWE-bench_Lite` dataset; the older `princeton-nlp` copy lacks those fields.
305
+ Record the exact dataset revision. For a pinned local run, the official harness also
306
+ accepts an unmodified JSON export of its dataset rows as `--dataset_name`; verify
307
+ the instance, original base commit and problem text against the inference task.
308
+ The script does not manufacture missing grader fields. A patch containing a known
309
+ configured credential is not exported, and the run records a collection error.
310
+
311
+ ## Design authority
312
+
313
+ - [Frozen architecture](docs/next/architecture-contract-v0.md)
314
+ - [Approved development design](docs/next/01-development-design.md)
315
+ - [Delivery and acceptance checklist](docs/next/02-delivery-and-acceptance.md)
316
+
317
+ Old Day workflows, graph nodes, Plan authorization, databases, retrieval, the legacy
318
+ Skill system and the old evaluation platform have been removed. The lightweight Skills
319
+ below are implemented through the same message loop and Tool Registry.
320
+
321
+
322
+ ## Fixed development evaluation
323
+
324
+ From this source checkout, with Docker Desktop using Linux containers and the existing model configuration:
325
+
326
+ ```sh
327
+ nexus eval pvlib__pvlib-python-1707
328
+ nexus eval --all
329
+ ```
330
+
331
+ Evaluation automatically collects Profile metrics and prints a compact aggregate report including `FinalCtx` and `ToolResultBytes`. Artifacts live under `~/.nexus/evaluation/results/`. These are local Next Dev Set checks, not official SWE-bench scores. See [Evaluation V0](evaluation/next-dev-v0/README.md) for frozen environments and limitations, and [actual acceptance evidence](docs/next/evaluation-v0-evidence.md) for results.
332
+
333
+ [Autonomous hardening stage results and cost evidence](docs/next/suite-hardening-evidence.md).
334
+
335
+ ## Lightweight Skills
336
+
337
+ Install trusted, self-contained Markdown at `~/.nexus/skills/<name>/SKILL.md`.
338
+ The [pytest regression example](docs/next/skills/pytest-regression/SKILL.md) can be
339
+ copied manually; examples are not automatically installed or activated.
340
+
341
+ ```text
342
+ nexus skills list
343
+ nexus --skill pytest-regression
344
+ nexus exec "Fix the bug with regression coverage" --skill pytest-regression
345
+ ```
346
+
347
+ Inside the prompt, `/skills` refreshes availability and shows selection/loading status;
348
+ `/skill <name>` selects or replaces the session default; `/skill off` clears that explicit
349
+ selection and restores automatic mode; `/new` clears the old session's selection.
350
+ The model can use the ordinary `load_skill` tool for task-specific loading. Automatic
351
+ loads last only for their run. Resume restores saved bodies, even if files change.
352
+ Skills do not execute scripts or grant permissions; their input cost is budgeted.
353
+ Fixed evaluation does not discover personal Skills.
354
+
355
+ The resume selector displays nine recent entries per page, showing the latest user
356
+ input, UTC update time and outcome. Use arrows/Enter or digits 1-9; Esc cancels.
357
+ See [Skills design, limits and rollback](docs/next/skills-v0.1.md).
358
+
359
+ ## License
360
+
361
+ [MIT](LICENSE).