euron-code 1.11.0__tar.gz → 1.11.2__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 (186) hide show
  1. {euron_code-1.11.0 → euron_code-1.11.2}/CHANGELOG.md +34 -0
  2. {euron_code-1.11.0 → euron_code-1.11.2}/PKG-INFO +1 -1
  3. {euron_code-1.11.0 → euron_code-1.11.2}/pyproject.toml +1 -1
  4. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/__init__.py +1 -1
  5. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/agent.py +328 -5
  6. euron_code-1.11.2/src/euron_code/datacheck.py +126 -0
  7. euron_code-1.11.2/src/euron_code/guards.py +157 -0
  8. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/prompts.py +26 -0
  9. euron_code-1.11.2/src/euron_code/toolchain.py +167 -0
  10. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/tools/__init__.py +2 -0
  11. euron_code-1.11.2/src/euron_code/tools/design.py +312 -0
  12. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/tools/fs.py +11 -0
  13. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_v1110_first_prompt.py +23 -0
  14. euron_code-1.11.2/tests/test_v1111_ceo_classes.py +185 -0
  15. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_v194_citations.py +1 -1
  16. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_v31_security.py +3 -1
  17. {euron_code-1.11.0 → euron_code-1.11.2}/.gitignore +0 -0
  18. {euron_code-1.11.0 → euron_code-1.11.2}/LICENSE +0 -0
  19. {euron_code-1.11.0 → euron_code-1.11.2}/README.md +0 -0
  20. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/__main__.py +0 -0
  21. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/activity.py +0 -0
  22. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/api.py +0 -0
  23. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/attachments.py +0 -0
  24. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/auth.py +0 -0
  25. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/autoupdate.py +0 -0
  26. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/builtin_skills/build-from-reference/SKILL.md +0 -0
  27. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/builtin_skills/explain-codebase/SKILL.md +0 -0
  28. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/builtin_skills/review/SKILL.md +0 -0
  29. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/builtin_skills/test-writer/SKILL.md +0 -0
  30. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/cache.py +0 -0
  31. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/checkpoints.py +0 -0
  32. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/cli.py +0 -0
  33. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/codeindex.py +0 -0
  34. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/config.py +0 -0
  35. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/context.py +0 -0
  36. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/contextforge/LICENSE +0 -0
  37. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/contextforge/__init__.py +0 -0
  38. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/contextforge/text.py +0 -0
  39. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/contextforge/toolout.py +0 -0
  40. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/credentials.py +0 -0
  41. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/ctxstats.py +0 -0
  42. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/doctor.py +0 -0
  43. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/documents.py +0 -0
  44. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/doi_guard.py +0 -0
  45. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/dotnet.py +0 -0
  46. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/error_hints.py +0 -0
  47. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/errorlog.py +0 -0
  48. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/failures.py +0 -0
  49. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/friendly.py +0 -0
  50. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/frontmatter.py +0 -0
  51. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/hooks.py +0 -0
  52. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/keys.py +0 -0
  53. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/knowledge.py +0 -0
  54. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/licensing.py +0 -0
  55. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/llm/__init__.py +0 -0
  56. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/llm/anthropic.py +0 -0
  57. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/llm/base.py +0 -0
  58. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/llm/openai_compat.py +0 -0
  59. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/llm/setup.py +0 -0
  60. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/logo.py +0 -0
  61. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/markdown_view.py +0 -0
  62. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/memory.py +0 -0
  63. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/migration.py +0 -0
  64. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/modes.py +0 -0
  65. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/mvc5.py +0 -0
  66. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/osscache.py +0 -0
  67. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/ossgithub.py +0 -0
  68. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/pasteinput.py +0 -0
  69. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/pathfix.py +0 -0
  70. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/permissions.py +0 -0
  71. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/progress.py +0 -0
  72. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/project_setup.py +0 -0
  73. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/repl.py +0 -0
  74. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/repomap.py +0 -0
  75. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/rules.py +0 -0
  76. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/security_scan.py +0 -0
  77. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/sessions.py +0 -0
  78. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/skills.py +0 -0
  79. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/taskstate.py +0 -0
  80. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/textsafe.py +0 -0
  81. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/tls.py +0 -0
  82. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/tools/background.py +0 -0
  83. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/tools/base.py +0 -0
  84. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/tools/citations.py +0 -0
  85. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/tools/db.py +0 -0
  86. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/tools/document.py +0 -0
  87. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/tools/erie.py +0 -0
  88. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/tools/ignore.py +0 -0
  89. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/tools/normalize.py +0 -0
  90. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/tools/oss.py +0 -0
  91. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/tools/pagecheck.py +0 -0
  92. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/tools/pathfind.py +0 -0
  93. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/tools/port.py +0 -0
  94. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/tools/reuse.py +0 -0
  95. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/tools/search.py +0 -0
  96. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/tools/shell.py +0 -0
  97. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/tools/skill.py +0 -0
  98. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/tools/symbols.py +0 -0
  99. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/tools/task.py +0 -0
  100. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/tools/template.py +0 -0
  101. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/tools/todo.py +0 -0
  102. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/tools/web.py +0 -0
  103. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/tools/websearch.py +0 -0
  104. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/transcript.py +0 -0
  105. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/trust.py +0 -0
  106. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/ui.py +0 -0
  107. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/update_check.py +0 -0
  108. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/usage_view.py +0 -0
  109. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/version_info.py +0 -0
  110. {euron_code-1.11.0 → euron_code-1.11.2}/src/euron_code/webforms.py +0 -0
  111. {euron_code-1.11.0 → euron_code-1.11.2}/tests/conftest.py +0 -0
  112. {euron_code-1.11.0 → euron_code-1.11.2}/tests/fake_providers.py +0 -0
  113. {euron_code-1.11.0 → euron_code-1.11.2}/tests/helpers.py +0 -0
  114. {euron_code-1.11.0 → euron_code-1.11.2}/tests/measure_floor.py +0 -0
  115. {euron_code-1.11.0 → euron_code-1.11.2}/tests/mock_gateway.py +0 -0
  116. {euron_code-1.11.0 → euron_code-1.11.2}/tests/serve_helper.py +0 -0
  117. {euron_code-1.11.0 → euron_code-1.11.2}/tests/sim_long_session.py +0 -0
  118. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_agent_mock.py +0 -0
  119. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_api_shell.py +0 -0
  120. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_bench.py +0 -0
  121. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_bench_harness.py +0 -0
  122. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_cli_e2e.py +0 -0
  123. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_context_memory_sessions.py +0 -0
  124. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_dashboard_fixes.py +0 -0
  125. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_dashboard_fixes_102.py +0 -0
  126. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_db.py +0 -0
  127. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_erie.py +0 -0
  128. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_knowledge_security.py +0 -0
  129. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_markdown_view.py +0 -0
  130. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_oss_local.py +0 -0
  131. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_permissions.py +0 -0
  132. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_powershell_exit_codes.py +0 -0
  133. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_qa_attach_secrets.py +0 -0
  134. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_qa_long_task.py +0 -0
  135. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_qa_print_output.py +0 -0
  136. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_qa_reuse_unrelated.py +0 -0
  137. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_qa_yolo_outside.py +0 -0
  138. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_render_ghost.py +0 -0
  139. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_repl.py +0 -0
  140. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_reuse_honesty.py +0 -0
  141. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_search.py +0 -0
  142. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_textsafe.py +0 -0
  143. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_tools_fs.py +0 -0
  144. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_transcript_ui.py +0 -0
  145. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_update_check.py +0 -0
  146. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_v1100_finish_on_time.py +0 -0
  147. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_v111_user_reports.py +0 -0
  148. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_v113_fix_path.py +0 -0
  149. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_v11_byo.py +0 -0
  150. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_v11_speed.py +0 -0
  151. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_v11_tool_fixes.py +0 -0
  152. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_v130_cut_writes.py +0 -0
  153. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_v130_reliability.py +0 -0
  154. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_v140_parity.py +0 -0
  155. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_v152_migration.py +0 -0
  156. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_v153_user_errors.py +0 -0
  157. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_v155_user_errors.py +0 -0
  158. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_v156_autoupdate.py +0 -0
  159. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_v156_paste_and_edits.py +0 -0
  160. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_v157_zero_errors.py +0 -0
  161. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_v15_hosted_models.py +0 -0
  162. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_v15_reuse_off_subagent_hooks.py +0 -0
  163. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_v160_stop_scope_atomic.py +0 -0
  164. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_v161_residual_errors.py +0 -0
  165. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_v170_v2.py +0 -0
  166. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_v180_rescue_research_permissions.py +0 -0
  167. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_v181_silent_failures_verified.py +0 -0
  168. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_v182_zero_errors.py +0 -0
  169. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_v184_selfupdate_pep668.py +0 -0
  170. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_v186_bypass_and_waits.py +0 -0
  171. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_v187_sleep_wake.py +0 -0
  172. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_v188_typed_cli_commands.py +0 -0
  173. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_v189_edit_partial.py +0 -0
  174. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_v190_refund_fixes.py +0 -0
  175. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_v191_page_assets.py +0 -0
  176. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_v2_rules_skills_hooks.py +0 -0
  177. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_v2_tokens_shortcuts.py +0 -0
  178. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_v2_usage_headers.py +0 -0
  179. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_v3_accounts_value_setup.py +0 -0
  180. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_v3_activity.py +0 -0
  181. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_v3_attachments.py +0 -0
  182. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_v3_context.py +0 -0
  183. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_v3_live_repl.py +0 -0
  184. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_v3_single_login.py +0 -0
  185. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_v4.py +0 -0
  186. {euron_code-1.11.0 → euron_code-1.11.2}/tests/test_v5.py +0 -0
@@ -1,5 +1,39 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.11.2 (2026-11-24)
4
+
5
+ - The data check no longer reports a false problem on a field the request did not group by ("25 for each topic" is
6
+ checked on the topics, not on the answer index), so a correct file is not reworked.
7
+ - A tool call the model writes as DSML text (`<|DSML|invoke name=...>`) is run instead of being shown as the answer
8
+ (the edit was never applied and the task stopped with its tests red).
9
+ - An answer that stops mid-way ("Let me check ...", "Actually, wait ...") while the last check fails gets up to 3
10
+ more rounds instead of ending the task.
11
+
12
+ ## 1.11.1 (2026-11-24)
13
+
14
+ - **"Do NOT modify prd.md" is enforced.** A file you tell Euron Code not to modify, touch, change, edit, delete or
15
+ overwrite (or "leave X as it is", or "do not change the tests") is refused to every edit, delete, move and shell
16
+ write for the rest of the session, sub-agents included, until you ask for a change to it.
17
+ - **Designs are ported, not reinvented.** When the project has design exports (Stitch, Figma or plain HTML in a
18
+ design folder), a UI request ports them: the export's Tailwind config, fonts and markup are carried over, and the
19
+ new `compare_design` tool checks each page against its export (text, headings, buttons, fonts, colours, a
20
+ screenshot similarity) until it matches.
21
+ - **Sub-agents read the real files.** Every sub-agent brief now lists the project's specs and design files, and the
22
+ sub-agent copies values from those files, not from the brief. Summaries no longer retell facts that live in files
23
+ (colours, fonts, copy, versions); they point at the file, and keep your instructions word for word.
24
+ - **Node, npm, Python and git are found even when they are not on PATH** (for example Node in
25
+ C:\Program Files\nodejs under PowerShell). They are put on PATH for every command and sub-agent of the session,
26
+ and a project's pinned Node (.nvmrc, `engines`) is used when it is installed. "Node isn't available, verified by
27
+ reading it back" no longer counts as done: the build runs.
28
+ - **No system installs without you.** Euron Code never runs winget, choco, msiexec, apt, brew or nvm to install,
29
+ upgrade or remove software unless you asked for it, even with permissions bypassed.
30
+ - **Fresh scaffold files can be replaced** (a new Vite app's `index.css` / `App.jsx`) without being refused as
31
+ "dropping working code"; a cut whole-file write of a file this session made is saved and continued.
32
+ - **Generated data is counted, not trusted.** After writing a JSON list of records or a CSV (quiz questions, seed
33
+ data, test cases), Euron Code counts it itself: records against what you asked for, records per category ("25 for
34
+ each topic"), repeated values that should be unique and lists with a repeated entry, and has them fixed first.
35
+ Requests for 100+ generated items are split over parallel helpers.
36
+
3
37
  ## 1.11.0 (2026-11-23)
4
38
 
5
39
  - **"Run this project" means it really runs.** Euron Code is done only when the project answered after its last
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: euron-code
3
- Version: 1.11.0
3
+ Version: 1.11.2
4
4
  Summary: Euron Code: an agentic coding assistant in your terminal for Euron Plus and Super 30 students.
5
5
  Project-URL: Homepage, https://euron.one/code-agent
6
6
  Author-email: Euron <contact@euron.one>
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "euron-code"
7
- version = "1.11.0"
7
+ version = "1.11.2"
8
8
  description = "Euron Code: an agentic coding assistant in your terminal for Euron Plus and Super 30 students."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
@@ -1,3 +1,3 @@
1
1
  """Euron Code: an agentic coding assistant for the terminal."""
2
2
 
3
- __version__ = "1.11.0"
3
+ __version__ = "1.11.2"
@@ -58,7 +58,7 @@ MAX_TOOLS_PER_REQUEST = 128 # servers refuse more tool definitions than this in
58
58
  CORE_TOOLS = ("read_file", "write_file", "edit_file", "multi_edit", "list_dir", "glob", "grep", "bash", "todo_write",
59
59
  "task", "skill", "read_document", "find_symbol", "delete_file", "move_file", "start_background_process",
60
60
  "read_process_output", "stop_process", "check_app", "fix_page_assets", "web_fetch", "web_search", "db_query", "port_page",
61
- "create_mvc5_project", "audit_citations", "find_papers")
61
+ "create_mvc5_project", "audit_citations", "find_papers", "compare_design")
62
62
  SESSION_IN_USE_WAIT = 3 # a 409 right after a restart is usually this computer's own previous session
63
63
  FIT_TARGET = 0.8 # never send a prompt above 80% of the window (estimate); shrink the history first
64
64
  # Compaction (1.1.0). Thresholds are fractions of the CONVERSATION room (usable window minus the fixed floor:
@@ -148,6 +148,18 @@ def _failed_count(output: str) -> Optional[int]:
148
148
 
149
149
 
150
150
  _NODE_ENTRY_RE = re.compile(r"\b(?:node|nodemon|ts-node|tsx)\s+(?:--[\w-]+(?:=\S+)?\s+)*([\w./\\-]+\.(?:m?js|cjs|ts))\b")
151
+ #: 1.11.1 "Node isn't available in this shell", "verified it by reading it back", "could not run a build"
152
+ _EXCUSE_RE = re.compile(r"(?:node|npm|npx|python|pytest)(?:\.js)?\s+(?:is\s*n[o']t|is not|isn't|was not|not)\s+"
153
+ r"(?:available|on\s+path|installed|found|in this (?:environment|shell))|verified (?:it|them|the "
154
+ r"files?)? ?by reading (?:it|them)? ?back|(?:cannot|can't|could not|couldn't|unable to) (?:run|execute)"
155
+ r" (?:a |the )?(?:build|tests?)", re.I)
156
+ #: 1.11.1 a UI build / port request (pages, frontend, components, the design)
157
+ _UI_BUILD_RE = re.compile(r"\b(frontend|front-end|ui|ux|pages?|screens?|website|web\s*site|landing|components?|react|vue|"
158
+ r"next\.?js|angular|svelte|tailwind|design|stitch|figma|layout|replicate|port|convert|"
159
+ r"phase\s*\d)\b", re.I)
160
+ #: 1.11.1 "150 multiple-choice questions", "500 rows", "200 test cases": a bulk generation request
161
+ _BULK_RE = re.compile(r"\b(\d{3,5})\s+(?:[a-z-]+\s+){0,3}?(?:questions|records|rows|items|entries|products|mcqs?|"
162
+ r"examples|samples|test cases|flashcards|cards|quotes|users|students|customers|orders)\b", re.I)
151
163
  _HEALTH_URL_RE = re.compile(r"/(health|healthz|ping|status|ready|live)/?$", re.I)
152
164
  #: 1.11.0 a file name in words ("I'll create questions.json", "make kanban.html"): target of a cut write
153
165
  _FILE_NAME_RE = re.compile(r"(?<![\w/\\.-])((?:[\w-]+/)*[\w-]+\.(?:json|py|js|mjs|ts|tsx|jsx|html|css|md|csv|txt|sql|"
@@ -548,6 +560,45 @@ def parse_inline_tool_calls(content: str):
548
560
  return content, calls
549
561
 
550
562
 
563
+ _DSML_INVOKE = re.compile(r"<[|\uff5c]DSML[|\uff5c]invoke\s+name\s*=\s*\"([^\"]+)\"\s*>(.*?)(?:</[|\uff5c]DSML[|\uff5c]invoke>|(?=<[|\uff5c]DSML[|\uff5c]invoke\b)|$)",
564
+ re.DOTALL)
565
+ _DSML_PARAM = re.compile(r"<[|\uff5c]DSML[|\uff5c]parameter\s+name\s*=\s*\"([^\"]+)\"(?:\s+string\s*=\s*\"(true|false)\")?\s*>"
566
+ r"(.*?)</[|\uff5c]DSML[|\uff5c]parameter>", re.DOTALL)
567
+ _DSML_BLOCK = re.compile(r"(?:<tool_calls>\s*)?(?:<[|\uff5c]DSML[|\uff5c]function_calls>\s*)?<[|\uff5c]DSML[|\uff5c]invoke\b.*?"
568
+ r"(?:</[|\uff5c]DSML[|\uff5c]function_calls>|</tool_calls>|$)", re.DOTALL)
569
+
570
+
571
+ def parse_dsml_tool_calls(content: str):
572
+ """A tool call written as DSML text (`<|DSML|invoke name="edit_file"><|DSML|parameter ...>`), the format some
573
+ rescue models fall back to: it is the call the model meant, so it runs instead of ending the task as an answer
574
+ (gate 24 Nov: an edit written this way was never applied and the task stopped with its tests red)."""
575
+ calls = []
576
+ for m in _DSML_INVOKE.finditer(content):
577
+ args: Dict[str, Any] = {}
578
+ for pm in _DSML_PARAM.finditer(m.group(2)):
579
+ key, is_str, val = pm.group(1), pm.group(2), pm.group(3)
580
+ if is_str == "false":
581
+ try:
582
+ args[key] = json.loads(val)
583
+ continue
584
+ except ValueError:
585
+ pass
586
+ args[key] = val
587
+ if args or m.group(2).strip() == "":
588
+ calls.append({"id": f"call_{uuid.uuid4().hex[:12]}", "type": "function",
589
+ "function": {"name": m.group(1).strip(), "arguments": json.dumps(args)}})
590
+ if calls:
591
+ content = _DSML_BLOCK.sub("", content).strip()
592
+ return content, calls
593
+
594
+
595
+ # An answer that stops in the middle of working ("Let me check ...", "Actually, wait ...", a trailing colon): not
596
+ # a final answer, so a red check gets more rounds than MAX_DONE_NUDGES (gate 24 Nov, chain-prd-plan-build).
597
+ _UNFINISHED_RE = re.compile(r"(?:\b(?:let me|let's|i'll|i will|i need to|now i|actually,? wait|wait)\b[^\n]{0,200}"
598
+ r"|[:,\u2014-])\s*$", re.I)
599
+ MAX_UNFINISHED_EXTRA = 3
600
+
601
+
551
602
  class Agent:
552
603
  def __init__(self, client: api.Client, ui, root: Path, settings: Dict[str, Any],
553
604
  permissions: Permissions, model: str, *, session: Optional[SessionWriter] = None,
@@ -625,7 +676,15 @@ class Agent:
625
676
  self._nudged = False
626
677
  self._spec_reviewed = False # one rule-by-rule review of a detailed request before "done" (1.4.0)
627
678
  self._run_gated = 0 # 1.11.0 "run this project" notes this request
679
+ from euron_code.guards import ProtectedFiles
680
+ self.protected = ProtectedFiles() # 1.11.1 files the user said not to change (shared with sub-agents)
681
+ self._session_created: set = set() # 1.11.1 normcased paths write_file created in this session
682
+ self._design_checks: List[Tuple[int, str, bool]] = [] # 1.11.1 compare_design runs (step, reference, ok)
683
+ self._design_refs: List[str] = [] # 1.11.1 design exports this request ports (empty = not a port)
684
+ self._design_gated = 0
685
+ self._session_started_at = time.time()
628
686
  self._hand_noted = False # 1.11.0 folder made by hand before a run: noted once
687
+ self._data_gated = 0 # 1.11.1 data-file checks sent back this request
629
688
  self._ask_gated = False # 1.11.0 asked permission for requested work: sent back once
630
689
  self._todo_alone = 0 # steps whose only call was todo_write (1.4.0)
631
690
  self.guard = progress.ProgressGuard() # loops, stalls, edit-revert cycles (1.3.0)
@@ -1021,6 +1080,8 @@ class Agent:
1021
1080
  self._run_gated = 0
1022
1081
  self._ask_gated = False
1023
1082
  self._hand_noted = False
1083
+ self._excuse_noted = False
1084
+ self._data_gated = 0
1024
1085
  self._todo_alone = 0
1025
1086
  self._placeholder_nudged = False
1026
1087
  self._notice_nudged = False
@@ -1253,12 +1314,17 @@ class Agent:
1253
1314
 
1254
1315
  def _run_turn(self, user_text: str, max_turns: Optional[int]) -> TurnResult:
1255
1316
  max_turns = max_turns or self.max_turns
1317
+ self._request_started_at = time.time() # 1.11.1: data files written this request (data gate)
1318
+ if not self.is_subagent:
1319
+ self._last_user_text = user_text # 1.11.1: what the person asked (system-install guard)
1256
1320
  text = user_text
1257
1321
  if self.pending_note:
1258
1322
  text = self.pending_note + "\n\n" + text
1259
1323
  self.pending_note = None
1260
1324
  if len(self.messages) == 1 and not self.is_subagent:
1261
- text = prompts.dynamic_context(self.root, _branch(self.root), self.model_identity) + "\n\n" + text
1325
+ tc = self._toolchain_note()
1326
+ text = (prompts.dynamic_context(self.root, _branch(self.root), self.model_identity)
1327
+ + ("\n[Euron Code: " + tc + "]" if tc else "") + "\n\n" + text)
1262
1328
  # volatile additions go at the END of the message, so everything before stays cacheable
1263
1329
  if self.pending_context:
1264
1330
  text += "\n\n" + "\n\n".join(self.pending_context)
@@ -1266,8 +1332,16 @@ class Agent:
1266
1332
  if self.permissions.mode == "plan" and not self.is_subagent:
1267
1333
  text += "\n\n" + prompts.PLAN_MODE_NOTE
1268
1334
  if not self.is_subagent:
1335
+ try:
1336
+ self.protected.scan(user_text)
1337
+ except Exception:
1338
+ pass
1339
+ if self.protected.files:
1340
+ text += "\n\n" + self.protected.note()
1269
1341
  text += self._build_context(user_text)
1270
1342
  text += self._migration_context(user_text)
1343
+ text += self._bulk_generation_note(user_text)
1344
+ text += self._design_port_note(user_text)
1271
1345
  if (self._behaviour and self.permissions.mode != "plan" and not self._resumed
1272
1346
  and not SIMPLE_FOLLOWUP.match(user_text.strip())):
1273
1347
  text += "\n\n" + prompts.TEST_FIRST_NOTE
@@ -1507,6 +1581,7 @@ class Agent:
1507
1581
  self._append({"role": "user", "content": prompts.NOTICE_NUDGE.format(repos=missing)})
1508
1582
  self.ui.dim("(asking Euron Code to record the reused sources in THIRD_PARTY_NOTICES.md)")
1509
1583
  continue
1584
+ self._final_text = resp.content or ""
1510
1585
  done = self._done_nudge()
1511
1586
  if done:
1512
1587
  self._done_nudges += 1
@@ -1527,6 +1602,24 @@ class Agent:
1527
1602
  self._append({"role": "user", "content": prompts.HAND_MADE_NOTE.format(dirs=hand)})
1528
1603
  self.ui.dim("(a folder was made by hand before the run; making the code create it)")
1529
1604
  continue
1605
+ excuse = self._no_build_excuse(answer)
1606
+ if excuse:
1607
+ self._excuse_noted = True
1608
+ self._append({"role": "user", "content": excuse})
1609
+ self.ui.dim("(the build was not run; the tools are installed, so running it now)")
1610
+ continue
1611
+ design_note = self._design_gate()
1612
+ if design_note:
1613
+ self._design_gated += 1
1614
+ self._append({"role": "user", "content": design_note})
1615
+ self.ui.dim("(comparing the pages with your design files before calling it done)")
1616
+ continue
1617
+ data_note = self._data_gate(user_text)
1618
+ if data_note:
1619
+ self._data_gated += 1
1620
+ self._append({"role": "user", "content": data_note})
1621
+ self.ui.dim("(Euron Code counted the generated data itself and found problems; fixing them)")
1622
+ continue
1530
1623
  run_note = self._run_gate(user_text)
1531
1624
  if run_note:
1532
1625
  self._run_gated += 1
@@ -2291,6 +2384,8 @@ class Agent:
2291
2384
  r.tool_calls.append(c)
2292
2385
  if not r.tool_calls and "<tool_call>" in r.content:
2293
2386
  r.content, r.tool_calls = parse_inline_tool_calls(r.content)
2387
+ if not r.tool_calls and "DSML" in r.content:
2388
+ r.content, r.tool_calls = parse_dsml_tool_calls(r.content)
2294
2389
  recover_reasoning_only(r)
2295
2390
  return r
2296
2391
 
@@ -2640,6 +2735,11 @@ class Agent:
2640
2735
  self.ledger["commands"].append((self.steps, req.command or "", int(m.group(1))))
2641
2736
  return
2642
2737
  step = self.steps
2738
+ if name == "write_file" and str(content).startswith("Created "):
2739
+ # 1.11.1: files this session created (a cut whole-file rewrite of one may be saved; a scaffold or an
2740
+ # earlier part of the same job may be replaced)
2741
+ for p in req.paths:
2742
+ self._session_created.add(os.path.normcase(str(p)))
2643
2743
  if req.category == "Edit":
2644
2744
  for p in req.paths:
2645
2745
  rel = self.ctx.rel(p)
@@ -2710,6 +2810,146 @@ class Agent:
2710
2810
  return
2711
2811
 
2712
2812
  # ---------------------------------------------------------- calls cut by the output limit
2813
+ def reference_files(self, limit: int = 12) -> List[str]:
2814
+ """The project's own sources of truth: specs (prd/requirements/spec/plan .md), DESIGN.md and design exports
2815
+ (folders named design/stitch/figma/mockup with .html/.css). Shallow walk, never node_modules/build output."""
2816
+ out: List[str] = []
2817
+ skip = {"node_modules", ".git", "dist", "build", ".next", ".venv", "venv", "__pycache__", ".euron", "coverage"}
2818
+ spec = re.compile(r"(^|[-_ ])(prd|requirements?|spec|specification|implementation[-_ ]plan|design|brief)"
2819
+ r"([-_ .]|$)", re.I)
2820
+ try:
2821
+ for dirpath, dirnames, filenames in os.walk(self.root):
2822
+ rel_dir = os.path.relpath(dirpath, self.root)
2823
+ depth = 0 if rel_dir == "." else rel_dir.count(os.sep) + 1
2824
+ dirnames[:] = [d for d in dirnames if d not in skip and not d.startswith(".")] if depth < 3 else []
2825
+ design_dir = bool(re.search(r"design|stitch|figma|mock-?up|wireframe|screens?$", rel_dir, re.I))
2826
+ for f in sorted(filenames):
2827
+ rel = f if rel_dir == "." else os.path.join(rel_dir, f).replace(os.sep, "/")
2828
+ low = f.lower()
2829
+ if (low.endswith((".md", ".docx", ".pdf", ".txt")) and spec.search(os.path.splitext(f)[0])) or \
2830
+ (design_dir and low.endswith((".html", ".htm", ".css", ".md"))):
2831
+ out.append(rel)
2832
+ if len(out) >= limit:
2833
+ return out
2834
+ except OSError:
2835
+ pass
2836
+ return out
2837
+
2838
+ def _no_build_excuse(self, answer: str) -> Optional[str]:
2839
+ """1.11.1: "Node isn't available, I verified it by reading it back" is not done. When the code changed, the
2840
+ project has a build / test command and the tool it needs is installed (toolchain), the model runs it.
2841
+ Once per request."""
2842
+ if (self.is_subagent or getattr(self, "_excuse_noted", False) or self.permissions.mode == "plan"
2843
+ or not self._real_edits() or not _EXCUSE_RE.search(answer or "")):
2844
+ return None
2845
+ if self._verified():
2846
+ return None
2847
+ cmd = self._check_command() or ""
2848
+ try:
2849
+ from euron_code import toolchain
2850
+ found = toolchain.detect()
2851
+ except Exception:
2852
+ found = {}
2853
+ need = "node" if re.search(r"\b(npm|npx|node|yarn|pnpm|vite|next)\b", cmd) or (self.root / "package.json").exists() \
2854
+ else ("python" if re.search(r"\b(python|pytest|py)\b", cmd) else "")
2855
+ if not need or need not in found:
2856
+ return None # nothing known to run, or the tool really is missing: the model's report stands
2857
+ where = found.get(need, "")
2858
+ return prompts.NO_BUILD_EXCUSE_NOTE.format(cmd=cmd or "the project's build / test command",
2859
+ where=(f" ({need} is at {where})" if where else ""))
2860
+
2861
+ def _toolchain_note(self) -> str:
2862
+ """1.11.1: node / npm / npx / python / git found once (also outside PATH) and put on PATH for every shell
2863
+ and sub-agent; the model is told where they are instead of searching for them."""
2864
+ if self.settings.get("toolchainDetect", True) is False:
2865
+ return ""
2866
+ try:
2867
+ from euron_code import toolchain
2868
+ found = toolchain.detect()
2869
+ if self.ctx.shell is not None and found.get("_added"):
2870
+ try: # a shell started before detection: give it the new PATH too
2871
+ self.ctx.shell.close()
2872
+ self.ctx.shell = None
2873
+ except Exception:
2874
+ pass
2875
+ pinned = toolchain.pin_node(self.root, found) # .nvmrc / engines: a matching installed Node first
2876
+ return toolchain.note(found) + (". " + pinned if pinned else "")
2877
+ except Exception:
2878
+ return ""
2879
+
2880
+ def design_exports(self) -> List[str]:
2881
+ """Design exports in the project: .html files in a design / stitch / figma / mockup folder."""
2882
+ return [r for r in self.reference_files(limit=24) if r.lower().endswith((".html", ".htm"))
2883
+ and re.search(r"design|stitch|figma|mock-?up|wireframe|screens?/", r, re.I)][:12]
2884
+
2885
+ def _design_port_note(self, user_text: str) -> str:
2886
+ """1.11.1: a UI request in a project that holds design exports is a PORT of those exports, checked with
2887
+ compare_design, not a fresh design (prod 24 Nov: four Stitch exports ignored, a generic UI built)."""
2888
+ self._design_refs = []
2889
+ if self.permissions.mode == "plan" or SIMPLE_FOLLOWUP.match((user_text or "").strip()):
2890
+ return ""
2891
+ typed = re.sub(r'<attached-file path="[^"]*">.*?</attached-file>', " ", user_text or "", flags=re.S)
2892
+ if not _UI_BUILD_RE.search(typed) or _QUESTION_START_RE.match(typed):
2893
+ return ""
2894
+ try:
2895
+ refs = self.design_exports()
2896
+ except Exception:
2897
+ refs = []
2898
+ if not refs:
2899
+ return ""
2900
+ self._design_refs = refs
2901
+ self._design_gated = 0
2902
+ return "\n\n" + prompts.DESIGN_PORT_NOTE.format(files=", ".join(refs))
2903
+
2904
+ def _design_gate(self) -> Optional[str]:
2905
+ if not self._design_refs or self.is_subagent or self._design_gated >= 2 or self.permissions.mode == "plan":
2906
+ return None
2907
+ ui = [r for r in self.files_changed() if re.search(r"\.(jsx|tsx|vue|svelte|html|css)$", r, re.I)]
2908
+ if not ui:
2909
+ return None
2910
+ last = self._last_edit_step() or 0
2911
+ after = [(ref, ok) for st, ref, ok in self._design_checks if st >= last]
2912
+ checked = {os.path.normcase(ref.replace("\\", "/")) for ref, _ in after}
2913
+ failing = [ref for ref, ok in after if not ok]
2914
+ unchecked = [r for r in self._design_refs if os.path.normcase(r) not in checked
2915
+ and not any(os.path.normcase(r).endswith(c) or c.endswith(os.path.normcase(r)) for c in checked)]
2916
+ if not failing and not unchecked:
2917
+ return None
2918
+ return prompts.DESIGN_CHECK_NOTE.format(
2919
+ failing=", ".join(failing) or "none", unchecked=", ".join(unchecked[:6]) or "none")
2920
+
2921
+ def _subagent_sources(self, brief: str) -> str:
2922
+ """1.11.1: a sub-agent reads the project's sources itself instead of trusting facts retold in its brief.
2923
+ Prod 24 Nov: three sub-agents were handed design tokens the main agent remembered wrongly after several
2924
+ summaries (Poppins/Inter, #D4AF37) while the Stitch files said Playfair Display/Montserrat, #F5C518, and built
2925
+ a generic UI."""
2926
+ try:
2927
+ refs = self.reference_files()
2928
+ named = [n for n in dict.fromkeys(_FILE_NAME_RE.findall(brief or "")) if (self.root / n).is_file()]
2929
+ except Exception:
2930
+ return ""
2931
+ files = list(dict.fromkeys(refs + named))[:14]
2932
+ if not files:
2933
+ return ""
2934
+ return ("\n\n[Euron Code: SOURCES. Before writing, read the ones your part needs yourself: "
2935
+ + ", ".join(files) + ". Facts in this brief (colours, fonts, copy, field names, versions, rules) were "
2936
+ "written from memory and may be wrong: where the brief and a file disagree, the FILE wins. Copy values "
2937
+ "from the files, never from the brief.]")
2938
+
2939
+ def _made_this_session(self, path: Path) -> bool:
2940
+ """The file came into being during this session: written by write_file, or created by a command (a
2941
+ scaffold generator such as `npm create vite`), so it holds no work of the user's from before."""
2942
+ if os.path.normcase(str(path)) in self._session_created:
2943
+ return True
2944
+ try:
2945
+ st = path.stat()
2946
+ except OSError:
2947
+ return False
2948
+ born = getattr(st, "st_birthtime", None)
2949
+ if born is None and os.name == "nt":
2950
+ born = st.st_ctime # creation time on Windows
2951
+ return bool(born and born >= self._session_started_at - 2)
2952
+
2713
2953
  def _cut_target(self, words: str) -> Optional[str]:
2714
2954
  """The file a cut write_file without its path was meant for: the last new file named in this step's words,
2715
2955
  else the only new file the request names. None when unsure."""
@@ -2759,7 +2999,11 @@ class Agent:
2759
2999
  if not keep and len(content) > 2000:
2760
3000
  keep = progress.complete_items(content) # one long line (minified JSON / CSV row data)
2761
3001
  target = self.ctx.resolve(path) if path else None
2762
- fresh = target is not None and (append or not target.exists())
3002
+ # 1.11.1: a whole-file rewrite of a file THIS session created (prod 24 Nov: implementation-plan.md
3003
+ # was cut twice at 8,192 tokens; the second whole write of the file the first cut had saved was
3004
+ # thrown away) is saved too, and continued with append
3005
+ fresh = target is not None and (append or not target.exists()
3006
+ or os.path.normcase(str(target)) in self._session_created)
2763
3007
  if fresh and keep.strip():
2764
3008
  fn["arguments"] = json.dumps({"path": path, "content": keep, "append": append})
2765
3009
  lines = keep.count("\n")
@@ -2781,6 +3025,9 @@ class Agent:
2781
3025
  """Feed one tool result to the guard; returns the content with any note for the model. Sets
2782
3026
  self._stuck when the request should stop and report (the loop then asks for a summary)."""
2783
3027
  command = (req.command if req is not None else "") or ""
3028
+ if name == "compare_design" and not is_error:
3029
+ self._design_checks.append((self.steps, str(args.get("reference") or ""),
3030
+ str(content).startswith("MATCHES")))
2784
3031
  is_check = name == "check_app" or (name == "bash" and progress.is_check_command(command))
2785
3032
  failed = is_error or progress.failed_result(content)
2786
3033
  if is_check:
@@ -2791,7 +3038,7 @@ class Agent:
2791
3038
  self._checks.append((self.steps, command or name, code, cls))
2792
3039
  if name == "check_app":
2793
3040
  self._app_checks.append((self.steps, str(args.get("url") or args.get("path") or ""), code))
2794
- nfail = _failed_count(content) if code else 0
3041
+ nfail = _failed_count(content) if code and name == "bash" else (0 if name == "bash" else None)
2795
3042
  if nfail is not None:
2796
3043
  self._fail_counts.append((self.steps, nfail))
2797
3044
  self._last_check_out = content if code else ""
@@ -2945,7 +3192,10 @@ class Agent:
2945
3192
  def _done_nudge(self) -> Optional[str]:
2946
3193
  """Definition of done: after the last change a real check (build / tests / running it) must pass. Up
2947
3194
  to MAX_DONE_NUDGES times the model is sent back: to run one, or to fix the one that fails."""
2948
- if (self.is_subagent or self._done_nudges >= self.policy.done_nudges or not self._real_edits()
3195
+ limit = self.policy.done_nudges
3196
+ if _UNFINISHED_RE.search((getattr(self, "_final_text", "") or "").strip()[-300:]):
3197
+ limit += MAX_UNFINISHED_EXTRA # it stopped mid-way ("Let me check ..."): not an answer, keep it going
3198
+ if (self.is_subagent or self._done_nudges >= limit or not self._real_edits()
2949
3199
  or self.permissions.mode == "plan" or self.settings.get("verifyNudge", True) is False):
2950
3200
  return None
2951
3201
  if all(_DOC_RE.search(rel) or _NO_BUILD_RE.search(rel) for rel in self.files_changed()):
@@ -3758,6 +4008,63 @@ class Agent:
3758
4008
  return None # a script / CLI project: it ran cleanly after the last change
3759
4009
  return prompts.RUN_CHECK_NOTE
3760
4010
 
4011
+ def _bulk_generation_note(self, user_text: str) -> str:
4012
+ """1.11.1: a request for 100+ generated items (questions, records, test cases) is split across parallel write
4013
+ sub-agents from the start. Suite large-mcq: one stream wrote 150 quiz items in 15-25 min (about 20K tokens
4014
+ at one GPU stream's speed), over the 15 min a large task gets."""
4015
+ if (self.permissions.mode == "plan" or self.settings.get("parallelSubagents", True) is False
4016
+ or self.settings.get("bulkSplit", True) is False or SIMPLE_FOLLOWUP.match((user_text or "").strip())):
4017
+ return ""
4018
+ m = _BULK_RE.search(user_text or "")
4019
+ if not m or int(m.group(1)) < 100:
4020
+ return ""
4021
+ n = int(m.group(1))
4022
+ return "\n\n" + prompts.BULK_SPLIT_NOTE.format(n=n, share=(n + 2) // 3)
4023
+
4024
+ def _data_gate(self, user_text: str) -> Optional[str]:
4025
+ """1.11.1: generated data files (JSON record lists, CSV) changed this request are counted by Euron Code
4026
+ itself (datacheck): wrong totals, uneven groups the request fixed, repeated values, lists with a repeated
4027
+ entry. Up to two reports per request; the model fixes them before it finishes."""
4028
+ if (self.is_subagent or self._data_gated >= 2 or self.permissions.mode == "plan"
4029
+ or self.settings.get("dataCheck", True) is False):
4030
+ return None
4031
+ from euron_code import datacheck
4032
+ typed = re.sub(r'<attached-file path="[^"]*">.*?</attached-file>', " ", user_text or "", flags=re.S)
4033
+ found = []
4034
+ # 1.11.1: also files a script or a sub-agent wrote this request (suite: questions.json merged by a python
4035
+ # script from 3 sub-agents' parts was never in the edit ledger, so a repeated option slipped through)
4036
+ cands = list(self.files_changed())
4037
+ started = getattr(self, "_request_started_at", 0) or 0
4038
+ if started:
4039
+ skip = {"node_modules", ".git", "dist", "build", ".next", ".venv", "venv", "__pycache__", ".euron"}
4040
+ try:
4041
+ for dirpath, dirnames, filenames in os.walk(self.root):
4042
+ rel_dir = os.path.relpath(dirpath, self.root)
4043
+ depth = 0 if rel_dir == "." else rel_dir.count(os.sep) + 1
4044
+ dirnames[:] = [d for d in dirnames if d not in skip] if depth < 3 else []
4045
+ for f in filenames:
4046
+ if f.lower().endswith((".json", ".csv")):
4047
+ p = os.path.join(dirpath, f)
4048
+ if os.path.getmtime(p) >= started - 1:
4049
+ rel = os.path.relpath(p, self.root).replace(os.sep, "/")
4050
+ if rel not in cands:
4051
+ cands.append(rel)
4052
+ except OSError:
4053
+ pass
4054
+ for rel in cands[:20]:
4055
+ if not re.search(r"\.(json|csv)$", rel, re.I) or re.search(r"(^|/)(package(-lock)?|tsconfig|"
4056
+ r"composer)\.json$", rel):
4057
+ continue
4058
+ try:
4059
+ r = datacheck.check(self.root / rel, typed)
4060
+ except Exception:
4061
+ r = None
4062
+ if r and r["problems"]:
4063
+ found.append(r)
4064
+ if not found:
4065
+ return None
4066
+ return prompts.DATA_CHECK_NOTE.format(report=datacheck.report(found[:4], lambda p: self.ctx.rel(p)))
4067
+
3761
4068
  def _broken_start_script(self) -> str:
3762
4069
  """1.11.0: the project's own start command points at a file that does not exist (package.json "start":
3763
4070
  "node server.js" while the server is src/server.js). Suite run-node: the model ran `node src/server.js`
@@ -3966,6 +4273,19 @@ class Agent:
3966
4273
  "owns it: do not edit it; mention it in your report.")
3967
4274
  self.ui.tool_result(msg, is_error=True)
3968
4275
  return "Error: " + msg, None
4276
+ guard_msg = None
4277
+ if req.category == "Edit" and req.paths:
4278
+ guard_msg = self.protected.check_paths([self.ctx.rel(p) for p in req.paths],
4279
+ exists=lambda rel: (self.root / rel).exists())
4280
+ elif req.category == "Bash" and req.command:
4281
+ guard_msg = self.protected.check_command(req.command)
4282
+ if not guard_msg and self.settings.get("allowSystemInstalls") is not True:
4283
+ from euron_code.guards import system_install_refusal
4284
+ top = self.parent if getattr(self, "parent", None) is not None else self
4285
+ guard_msg = system_install_refusal(req.command, getattr(top, "_last_user_text", ""))
4286
+ if guard_msg:
4287
+ self.ui.tool_result("refused: " + guard_msg.split(":")[0][:60], is_error=True)
4288
+ return "Error: " + guard_msg, None
3969
4289
  if (self.permissions.mode == "plan" and req.category in PLAN_BLOCKED
3970
4290
  and not (req.category == "Bash" and name == "bash"
3971
4291
  and is_read_only_command(req.command or ""))):
@@ -4899,11 +5219,14 @@ class Agent:
4899
5219
  sub.window, sub.max_output = self.window, self.max_output
4900
5220
  sub.cancel = self.cancel
4901
5221
  sub.parent = self
5222
+ sub.protected = self.protected # 1.11.1: the user's "do not change X" binds sub-agents too
5223
+ sub._session_created, sub._session_started_at = self._session_created, self._session_started_at
4902
5224
  sub.on_session_in_use = self.on_session_in_use
4903
5225
  if mode == "write":
4904
5226
  sub.checkpoints = self.checkpoints # /rewind undoes the sub-agent's edits too
4905
5227
  if mode == "write":
4906
5228
  prompt = self._migration_subagent_note() + prompt
5229
+ prompt = prompt + self._subagent_sources(prompt)
4907
5230
  if mode == "write":
4908
5231
  try:
4909
5232
  from euron_code import migration