euron-code 0.6.0__tar.gz → 0.8.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 (109) hide show
  1. {euron_code-0.6.0 → euron_code-0.8.0}/CHANGELOG.md +35 -0
  2. {euron_code-0.6.0 → euron_code-0.8.0}/PKG-INFO +45 -10
  3. {euron_code-0.6.0 → euron_code-0.8.0}/README.md +44 -9
  4. {euron_code-0.6.0 → euron_code-0.8.0}/pyproject.toml +1 -1
  5. {euron_code-0.6.0 → euron_code-0.8.0}/src/euron_code/__init__.py +1 -1
  6. {euron_code-0.6.0 → euron_code-0.8.0}/src/euron_code/agent.py +47 -2
  7. {euron_code-0.6.0 → euron_code-0.8.0}/src/euron_code/cli.py +21 -12
  8. euron_code-0.8.0/src/euron_code/knowledge.py +534 -0
  9. euron_code-0.8.0/src/euron_code/markdown_view.py +331 -0
  10. {euron_code-0.6.0 → euron_code-0.8.0}/src/euron_code/project_setup.py +15 -10
  11. {euron_code-0.6.0 → euron_code-0.8.0}/src/euron_code/prompts.py +1 -0
  12. {euron_code-0.6.0 → euron_code-0.8.0}/src/euron_code/repl.py +37 -0
  13. euron_code-0.8.0/src/euron_code/security_scan.py +494 -0
  14. {euron_code-0.6.0 → euron_code-0.8.0}/src/euron_code/ui.py +40 -35
  15. euron_code-0.8.0/tests/test_knowledge_security.py +215 -0
  16. euron_code-0.8.0/tests/test_markdown_view.py +94 -0
  17. {euron_code-0.6.0 → euron_code-0.8.0}/.gitignore +0 -0
  18. {euron_code-0.6.0 → euron_code-0.8.0}/LICENSE +0 -0
  19. {euron_code-0.6.0 → euron_code-0.8.0}/src/euron_code/__main__.py +0 -0
  20. {euron_code-0.6.0 → euron_code-0.8.0}/src/euron_code/activity.py +0 -0
  21. {euron_code-0.6.0 → euron_code-0.8.0}/src/euron_code/api.py +0 -0
  22. {euron_code-0.6.0 → euron_code-0.8.0}/src/euron_code/attachments.py +0 -0
  23. {euron_code-0.6.0 → euron_code-0.8.0}/src/euron_code/auth.py +0 -0
  24. {euron_code-0.6.0 → euron_code-0.8.0}/src/euron_code/builtin_skills/build-from-reference/SKILL.md +0 -0
  25. {euron_code-0.6.0 → euron_code-0.8.0}/src/euron_code/builtin_skills/explain-codebase/SKILL.md +0 -0
  26. {euron_code-0.6.0 → euron_code-0.8.0}/src/euron_code/builtin_skills/review/SKILL.md +0 -0
  27. {euron_code-0.6.0 → euron_code-0.8.0}/src/euron_code/builtin_skills/test-writer/SKILL.md +0 -0
  28. {euron_code-0.6.0 → euron_code-0.8.0}/src/euron_code/cache.py +0 -0
  29. {euron_code-0.6.0 → euron_code-0.8.0}/src/euron_code/checkpoints.py +0 -0
  30. {euron_code-0.6.0 → euron_code-0.8.0}/src/euron_code/config.py +0 -0
  31. {euron_code-0.6.0 → euron_code-0.8.0}/src/euron_code/context.py +0 -0
  32. {euron_code-0.6.0 → euron_code-0.8.0}/src/euron_code/contextforge/LICENSE +0 -0
  33. {euron_code-0.6.0 → euron_code-0.8.0}/src/euron_code/contextforge/__init__.py +0 -0
  34. {euron_code-0.6.0 → euron_code-0.8.0}/src/euron_code/contextforge/text.py +0 -0
  35. {euron_code-0.6.0 → euron_code-0.8.0}/src/euron_code/contextforge/toolout.py +0 -0
  36. {euron_code-0.6.0 → euron_code-0.8.0}/src/euron_code/credentials.py +0 -0
  37. {euron_code-0.6.0 → euron_code-0.8.0}/src/euron_code/doctor.py +0 -0
  38. {euron_code-0.6.0 → euron_code-0.8.0}/src/euron_code/documents.py +0 -0
  39. {euron_code-0.6.0 → euron_code-0.8.0}/src/euron_code/error_hints.py +0 -0
  40. {euron_code-0.6.0 → euron_code-0.8.0}/src/euron_code/errorlog.py +0 -0
  41. {euron_code-0.6.0 → euron_code-0.8.0}/src/euron_code/frontmatter.py +0 -0
  42. {euron_code-0.6.0 → euron_code-0.8.0}/src/euron_code/hooks.py +0 -0
  43. {euron_code-0.6.0 → euron_code-0.8.0}/src/euron_code/keys.py +0 -0
  44. {euron_code-0.6.0 → euron_code-0.8.0}/src/euron_code/licensing.py +0 -0
  45. {euron_code-0.6.0 → euron_code-0.8.0}/src/euron_code/memory.py +0 -0
  46. {euron_code-0.6.0 → euron_code-0.8.0}/src/euron_code/osscache.py +0 -0
  47. {euron_code-0.6.0 → euron_code-0.8.0}/src/euron_code/ossgithub.py +0 -0
  48. {euron_code-0.6.0 → euron_code-0.8.0}/src/euron_code/permissions.py +0 -0
  49. {euron_code-0.6.0 → euron_code-0.8.0}/src/euron_code/repomap.py +0 -0
  50. {euron_code-0.6.0 → euron_code-0.8.0}/src/euron_code/rules.py +0 -0
  51. {euron_code-0.6.0 → euron_code-0.8.0}/src/euron_code/sessions.py +0 -0
  52. {euron_code-0.6.0 → euron_code-0.8.0}/src/euron_code/skills.py +0 -0
  53. {euron_code-0.6.0 → euron_code-0.8.0}/src/euron_code/textsafe.py +0 -0
  54. {euron_code-0.6.0 → euron_code-0.8.0}/src/euron_code/tools/__init__.py +0 -0
  55. {euron_code-0.6.0 → euron_code-0.8.0}/src/euron_code/tools/background.py +0 -0
  56. {euron_code-0.6.0 → euron_code-0.8.0}/src/euron_code/tools/base.py +0 -0
  57. {euron_code-0.6.0 → euron_code-0.8.0}/src/euron_code/tools/db.py +0 -0
  58. {euron_code-0.6.0 → euron_code-0.8.0}/src/euron_code/tools/document.py +0 -0
  59. {euron_code-0.6.0 → euron_code-0.8.0}/src/euron_code/tools/erie.py +0 -0
  60. {euron_code-0.6.0 → euron_code-0.8.0}/src/euron_code/tools/fs.py +0 -0
  61. {euron_code-0.6.0 → euron_code-0.8.0}/src/euron_code/tools/ignore.py +0 -0
  62. {euron_code-0.6.0 → euron_code-0.8.0}/src/euron_code/tools/oss.py +0 -0
  63. {euron_code-0.6.0 → euron_code-0.8.0}/src/euron_code/tools/reuse.py +0 -0
  64. {euron_code-0.6.0 → euron_code-0.8.0}/src/euron_code/tools/search.py +0 -0
  65. {euron_code-0.6.0 → euron_code-0.8.0}/src/euron_code/tools/shell.py +0 -0
  66. {euron_code-0.6.0 → euron_code-0.8.0}/src/euron_code/tools/skill.py +0 -0
  67. {euron_code-0.6.0 → euron_code-0.8.0}/src/euron_code/tools/symbols.py +0 -0
  68. {euron_code-0.6.0 → euron_code-0.8.0}/src/euron_code/tools/task.py +0 -0
  69. {euron_code-0.6.0 → euron_code-0.8.0}/src/euron_code/tools/todo.py +0 -0
  70. {euron_code-0.6.0 → euron_code-0.8.0}/src/euron_code/tools/web.py +0 -0
  71. {euron_code-0.6.0 → euron_code-0.8.0}/src/euron_code/transcript.py +0 -0
  72. {euron_code-0.6.0 → euron_code-0.8.0}/src/euron_code/trust.py +0 -0
  73. {euron_code-0.6.0 → euron_code-0.8.0}/src/euron_code/usage_view.py +0 -0
  74. {euron_code-0.6.0 → euron_code-0.8.0}/tests/conftest.py +0 -0
  75. {euron_code-0.6.0 → euron_code-0.8.0}/tests/helpers.py +0 -0
  76. {euron_code-0.6.0 → euron_code-0.8.0}/tests/mock_gateway.py +0 -0
  77. {euron_code-0.6.0 → euron_code-0.8.0}/tests/serve_helper.py +0 -0
  78. {euron_code-0.6.0 → euron_code-0.8.0}/tests/test_agent_mock.py +0 -0
  79. {euron_code-0.6.0 → euron_code-0.8.0}/tests/test_api_shell.py +0 -0
  80. {euron_code-0.6.0 → euron_code-0.8.0}/tests/test_bench.py +0 -0
  81. {euron_code-0.6.0 → euron_code-0.8.0}/tests/test_cli_e2e.py +0 -0
  82. {euron_code-0.6.0 → euron_code-0.8.0}/tests/test_context_memory_sessions.py +0 -0
  83. {euron_code-0.6.0 → euron_code-0.8.0}/tests/test_db.py +0 -0
  84. {euron_code-0.6.0 → euron_code-0.8.0}/tests/test_erie.py +0 -0
  85. {euron_code-0.6.0 → euron_code-0.8.0}/tests/test_oss_local.py +0 -0
  86. {euron_code-0.6.0 → euron_code-0.8.0}/tests/test_permissions.py +0 -0
  87. {euron_code-0.6.0 → euron_code-0.8.0}/tests/test_powershell_exit_codes.py +0 -0
  88. {euron_code-0.6.0 → euron_code-0.8.0}/tests/test_qa_attach_secrets.py +0 -0
  89. {euron_code-0.6.0 → euron_code-0.8.0}/tests/test_qa_long_task.py +0 -0
  90. {euron_code-0.6.0 → euron_code-0.8.0}/tests/test_qa_print_output.py +0 -0
  91. {euron_code-0.6.0 → euron_code-0.8.0}/tests/test_qa_reuse_unrelated.py +0 -0
  92. {euron_code-0.6.0 → euron_code-0.8.0}/tests/test_qa_yolo_outside.py +0 -0
  93. {euron_code-0.6.0 → euron_code-0.8.0}/tests/test_repl.py +0 -0
  94. {euron_code-0.6.0 → euron_code-0.8.0}/tests/test_search.py +0 -0
  95. {euron_code-0.6.0 → euron_code-0.8.0}/tests/test_textsafe.py +0 -0
  96. {euron_code-0.6.0 → euron_code-0.8.0}/tests/test_tools_fs.py +0 -0
  97. {euron_code-0.6.0 → euron_code-0.8.0}/tests/test_transcript_ui.py +0 -0
  98. {euron_code-0.6.0 → euron_code-0.8.0}/tests/test_v2_rules_skills_hooks.py +0 -0
  99. {euron_code-0.6.0 → euron_code-0.8.0}/tests/test_v2_tokens_shortcuts.py +0 -0
  100. {euron_code-0.6.0 → euron_code-0.8.0}/tests/test_v2_usage_headers.py +0 -0
  101. {euron_code-0.6.0 → euron_code-0.8.0}/tests/test_v31_security.py +0 -0
  102. {euron_code-0.6.0 → euron_code-0.8.0}/tests/test_v3_accounts_value_setup.py +0 -0
  103. {euron_code-0.6.0 → euron_code-0.8.0}/tests/test_v3_activity.py +0 -0
  104. {euron_code-0.6.0 → euron_code-0.8.0}/tests/test_v3_attachments.py +0 -0
  105. {euron_code-0.6.0 → euron_code-0.8.0}/tests/test_v3_context.py +0 -0
  106. {euron_code-0.6.0 → euron_code-0.8.0}/tests/test_v3_live_repl.py +0 -0
  107. {euron_code-0.6.0 → euron_code-0.8.0}/tests/test_v3_single_login.py +0 -0
  108. {euron_code-0.6.0 → euron_code-0.8.0}/tests/test_v4.py +0 -0
  109. {euron_code-0.6.0 → euron_code-0.8.0}/tests/test_v5.py +0 -0
@@ -1,5 +1,40 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.8.0 (2026-11-06)
4
+
5
+ Euron Code learns each project and keeps a security assessment, on your computer.
6
+
7
+ - First run in a folder or a fresh clone: the project is set up automatically (no question), the code
8
+ is analysed into `.euron/knowledge/codemap.md`, and a day-zero security scan writes
9
+ `.euron/security/assessment.md`. Locally, no tokens.
10
+ - After every task: a journal entry (`.euron/knowledge/journal.md`), the files it built
11
+ (`built.json`), learned rules (`.euron/rules/learned.md`: test, lint and build commands that work,
12
+ commands that keep failing, security lessons) and a rescan of the changed files. New findings are
13
+ shown right away; resolved ones are marked resolved.
14
+ - Every session starts with a compact summary of all this in the context (about 1.5k tokens), so the
15
+ AI stops re-exploring the repository.
16
+ - 23 security checks: secrets and API keys, SQL built from strings, eval / new Function, shell injection,
17
+ unsafe deserialisation, yaml.load, TLS verification off, unverified JWTs, CORS `*`, debug mode,
18
+ insecure cookies, XSS sinks, open redirects, path traversal, weak hashes, insecure randomness, and
19
+ secrets files that git would commit. Secrets are never written to the report. Accept a line with
20
+ `euron: ignore-security`.
21
+ - A `.gitignore` for the stack when there is none; an existing one only gets the missing essentials.
22
+ - New: `/security`, `/security-review`, `/knowledge`. `EURON_NO_AUTOSETUP=1` and `EURON_NO_KNOWLEDGE=1`
23
+ opt out.
24
+
25
+ ## 0.7.0 (2026-11-06)
26
+
27
+ Answers are formatted, not raw Markdown.
28
+
29
+ - Tables are drawn as boxed grids that fit the terminal: columns sized to their content, long cells
30
+ wrapped, `:---:` alignment honoured, header in bold. Too narrow for a grid, each row is shown as
31
+ `header: value` lines.
32
+ - **Bold**, *italic*, `code`, ~~strike~~ and links show as styles instead of their markers.
33
+ - Headings, bullet and numbered lists (nested, wrapped under their text), task lists, block quotes and
34
+ horizontal rules are laid out for the terminal.
35
+ - Fenced code is syntax-highlighted and keeps its indentation.
36
+ - Works with `NO_COLOR` and ASCII terminals (`+-|` borders). `euron -p` output is unchanged.
37
+
3
38
  ## 0.6.0 (2026-11-06)
4
39
 
5
40
  A new look for the interactive session.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: euron-code
3
- Version: 0.6.0
3
+ Version: 0.8.0
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>
@@ -135,10 +135,29 @@ https://euron.one/code-agent/usage.
135
135
 
136
136
  ## What happens automatically
137
137
 
138
- - **Project setup.** The first time in a folder it writes `EURON.md` (your stack, build and test
139
- commands, layout), rules for your stack, handy commands (`/fix-tests`, `/commit`, `/pr`) and safe
140
- permission settings. Locally, in a second, no AI call. Edit the files freely; `/init` lets the AI
141
- improve `EURON.md`.
138
+ - **Project setup.** The first time in a folder (or a fresh clone) it sets the project up by itself:
139
+ `EURON.md` (your stack, build and test commands, layout), rules for your stack (testing, git,
140
+ security), handy commands (`/fix-tests`, `/commit`, `/pr`, `/security-review`), safe permission
141
+ settings and a `.gitignore` for your stack (only the missing essentials are added to an existing one).
142
+ Locally, in a second, no AI call. Edit the files freely; `/init` lets the AI improve `EURON.md`.
143
+ - **It learns the project, and keeps learning.** On the first run it analyses the code into
144
+ `.euron/knowledge/codemap.md`: what each source file is for, routes, the environment variables the
145
+ code reads, tests, config and CI. After every task it adds to `.euron/knowledge/journal.md` (what was
146
+ asked, files changed, commands and whether they passed), remembers every file it built in
147
+ `built.json`, and rewrites `.euron/rules/learned.md` with what works here (the test, lint and build
148
+ commands that pass, commands that keep failing, security lessons). A compact summary of all of it
149
+ goes into every new session, so Euron Code starts from what it already knows instead of exploring the
150
+ repository again: less time, less context, fewer tokens. The code map refreshes itself when the code
151
+ moves on (a `git pull`, many changed files).
152
+ - **Security assessment from day zero.** On the first run it checks the whole project on your computer
153
+ for common vulnerabilities (secrets and API keys in code, SQL built from strings, eval, shell
154
+ injection, unsafe deserialisation, TLS checks turned off, unverified JWTs, open CORS, XSS sinks, weak
155
+ hashes, secrets files git would commit, and more), then rescans every file it changes after each
156
+ task, and the files changed outside it when a session starts. Every finding, with what to do about
157
+ it, is kept in `.euron/security/assessment.md`, together with what was resolved and a log of every
158
+ scan. New findings are shown as soon as they appear, and the open ones are part of the context, so the
159
+ AI fixes them when it touches those files and does not add new ones. `/security` rescans,
160
+ `/security-review` fixes them. Accept a line as safe with an `euron: ignore-security` comment.
142
161
  - **Context management.** Old tool output is cleared and long conversations are summarised before
143
162
  they fill the context, so it never runs out mid-task. Long answers continue by themselves.
144
163
  - **Token saving.** Unchanged files are not re-read and big files are read in parts.
@@ -340,6 +359,8 @@ Optional extras: `pip install "euron-code[images]"` (image resizing, clipboard),
340
359
  | `/skills`, `/skills new <name>` | list skills and commands, create a skill |
341
360
  | `/hooks`, `/hooks new`, `/hooks enable` | list hooks, add an example, enable the set-up examples |
342
361
  | `/review [focus]`, `/plan` | review uncommitted changes; plan mode |
362
+ | `/security`, `/security-review` | rescan the project and list open findings; let the AI fix them |
363
+ | `/knowledge` | rebuild the code map and show what goes into the context |
343
364
  | `/permissions` | rules and mode; `/permissions mode acceptEdits`, `/permissions allow "Bash(pytest:*)"` |
344
365
  | `/config` | show settings; `/config set <key> <value> [--project]` |
345
366
  | `/thinking show\|collapse\|hide`, `/todos`, `/doctor` | reasoning display, task list, setup check |
@@ -370,19 +391,33 @@ euron --resume # choose from a list (or /resume inside a session)
370
391
 
371
392
  ### Project setup
372
393
 
373
- `euron init` (or `euron --yes`, or Enter at the first-run question) creates, without overwriting
374
- anything that exists:
394
+ The first interactive run in a new folder (or `euron init`, or `euron -p --yes`) creates, without
395
+ overwriting anything that exists:
375
396
 
376
397
  ```
377
398
  EURON.md stack, commands, layout, entry points
378
399
  .euron/rules/ testing.md, git.md, security.md + python.md / node.md / go.md / rust.md
379
400
  .euron/settings.json allow rules for your test and lint commands and read-only git
380
401
  .euron/hooks.example.json example hooks, OFF until you run /hooks enable
381
- .euron/commands/ /fix-tests, /commit, /pr
382
- .gitignore + .euron/cache/ and .euron/settings.local.json
402
+ .euron/commands/ /fix-tests, /commit, /pr, /security-review
403
+ .gitignore for your stack (secrets, build output, Euron's local data); an existing
404
+ one only gets the missing essentials
383
405
  ```
384
406
 
385
- It is not offered in your home folder or a drive root, and a "no" is remembered.
407
+ and then, every session and after every task, keeps up to date:
408
+
409
+ ```
410
+ .euron/knowledge/codemap.md what the code is: files and their purpose, routes, env var names, tests
411
+ .euron/knowledge/journal.md every task: request, files, commands (pass/fail), result
412
+ .euron/knowledge/built.json every file Euron Code created or changed, and by which tasks
413
+ .euron/rules/learned.md what works in this project, and security lessons
414
+ .euron/security/assessment.md open and resolved findings since day zero, and the scan log
415
+ ```
416
+
417
+ `.euron/knowledge/` and `.euron/security/` stay on your computer (git-ignored): they hold your prompts
418
+ and the open findings. Rules, commands and `EURON.md` are meant to be committed. Never in your home
419
+ folder or a drive root. Set `EURON_NO_AUTOSETUP=1` to be asked with `euron init` instead, or
420
+ `EURON_NO_KNOWLEDGE=1` to turn the project memory and security checks off.
386
421
 
387
422
  ## Memory: EURON.md
388
423
 
@@ -69,10 +69,29 @@ https://euron.one/code-agent/usage.
69
69
 
70
70
  ## What happens automatically
71
71
 
72
- - **Project setup.** The first time in a folder it writes `EURON.md` (your stack, build and test
73
- commands, layout), rules for your stack, handy commands (`/fix-tests`, `/commit`, `/pr`) and safe
74
- permission settings. Locally, in a second, no AI call. Edit the files freely; `/init` lets the AI
75
- improve `EURON.md`.
72
+ - **Project setup.** The first time in a folder (or a fresh clone) it sets the project up by itself:
73
+ `EURON.md` (your stack, build and test commands, layout), rules for your stack (testing, git,
74
+ security), handy commands (`/fix-tests`, `/commit`, `/pr`, `/security-review`), safe permission
75
+ settings and a `.gitignore` for your stack (only the missing essentials are added to an existing one).
76
+ Locally, in a second, no AI call. Edit the files freely; `/init` lets the AI improve `EURON.md`.
77
+ - **It learns the project, and keeps learning.** On the first run it analyses the code into
78
+ `.euron/knowledge/codemap.md`: what each source file is for, routes, the environment variables the
79
+ code reads, tests, config and CI. After every task it adds to `.euron/knowledge/journal.md` (what was
80
+ asked, files changed, commands and whether they passed), remembers every file it built in
81
+ `built.json`, and rewrites `.euron/rules/learned.md` with what works here (the test, lint and build
82
+ commands that pass, commands that keep failing, security lessons). A compact summary of all of it
83
+ goes into every new session, so Euron Code starts from what it already knows instead of exploring the
84
+ repository again: less time, less context, fewer tokens. The code map refreshes itself when the code
85
+ moves on (a `git pull`, many changed files).
86
+ - **Security assessment from day zero.** On the first run it checks the whole project on your computer
87
+ for common vulnerabilities (secrets and API keys in code, SQL built from strings, eval, shell
88
+ injection, unsafe deserialisation, TLS checks turned off, unverified JWTs, open CORS, XSS sinks, weak
89
+ hashes, secrets files git would commit, and more), then rescans every file it changes after each
90
+ task, and the files changed outside it when a session starts. Every finding, with what to do about
91
+ it, is kept in `.euron/security/assessment.md`, together with what was resolved and a log of every
92
+ scan. New findings are shown as soon as they appear, and the open ones are part of the context, so the
93
+ AI fixes them when it touches those files and does not add new ones. `/security` rescans,
94
+ `/security-review` fixes them. Accept a line as safe with an `euron: ignore-security` comment.
76
95
  - **Context management.** Old tool output is cleared and long conversations are summarised before
77
96
  they fill the context, so it never runs out mid-task. Long answers continue by themselves.
78
97
  - **Token saving.** Unchanged files are not re-read and big files are read in parts.
@@ -274,6 +293,8 @@ Optional extras: `pip install "euron-code[images]"` (image resizing, clipboard),
274
293
  | `/skills`, `/skills new <name>` | list skills and commands, create a skill |
275
294
  | `/hooks`, `/hooks new`, `/hooks enable` | list hooks, add an example, enable the set-up examples |
276
295
  | `/review [focus]`, `/plan` | review uncommitted changes; plan mode |
296
+ | `/security`, `/security-review` | rescan the project and list open findings; let the AI fix them |
297
+ | `/knowledge` | rebuild the code map and show what goes into the context |
277
298
  | `/permissions` | rules and mode; `/permissions mode acceptEdits`, `/permissions allow "Bash(pytest:*)"` |
278
299
  | `/config` | show settings; `/config set <key> <value> [--project]` |
279
300
  | `/thinking show\|collapse\|hide`, `/todos`, `/doctor` | reasoning display, task list, setup check |
@@ -304,19 +325,33 @@ euron --resume # choose from a list (or /resume inside a session)
304
325
 
305
326
  ### Project setup
306
327
 
307
- `euron init` (or `euron --yes`, or Enter at the first-run question) creates, without overwriting
308
- anything that exists:
328
+ The first interactive run in a new folder (or `euron init`, or `euron -p --yes`) creates, without
329
+ overwriting anything that exists:
309
330
 
310
331
  ```
311
332
  EURON.md stack, commands, layout, entry points
312
333
  .euron/rules/ testing.md, git.md, security.md + python.md / node.md / go.md / rust.md
313
334
  .euron/settings.json allow rules for your test and lint commands and read-only git
314
335
  .euron/hooks.example.json example hooks, OFF until you run /hooks enable
315
- .euron/commands/ /fix-tests, /commit, /pr
316
- .gitignore + .euron/cache/ and .euron/settings.local.json
336
+ .euron/commands/ /fix-tests, /commit, /pr, /security-review
337
+ .gitignore for your stack (secrets, build output, Euron's local data); an existing
338
+ one only gets the missing essentials
317
339
  ```
318
340
 
319
- It is not offered in your home folder or a drive root, and a "no" is remembered.
341
+ and then, every session and after every task, keeps up to date:
342
+
343
+ ```
344
+ .euron/knowledge/codemap.md what the code is: files and their purpose, routes, env var names, tests
345
+ .euron/knowledge/journal.md every task: request, files, commands (pass/fail), result
346
+ .euron/knowledge/built.json every file Euron Code created or changed, and by which tasks
347
+ .euron/rules/learned.md what works in this project, and security lessons
348
+ .euron/security/assessment.md open and resolved findings since day zero, and the scan log
349
+ ```
350
+
351
+ `.euron/knowledge/` and `.euron/security/` stay on your computer (git-ignored): they hold your prompts
352
+ and the open findings. Rules, commands and `EURON.md` are meant to be committed. Never in your home
353
+ folder or a drive root. Set `EURON_NO_AUTOSETUP=1` to be asked with `euron init` instead, or
354
+ `EURON_NO_KNOWLEDGE=1` to turn the project memory and security checks off.
320
355
 
321
356
  ## Memory: EURON.md
322
357
 
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "euron-code"
7
- version = "0.6.0"
7
+ version = "0.8.0"
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__ = "0.6.0"
3
+ __version__ = "0.8.0"
@@ -220,9 +220,21 @@ class Agent:
220
220
  rules_text = rules.render_always(self.rules.rules)
221
221
  self.skills = skills.load_skills(self.root)
222
222
  skills_text = skills.render_index(self.skills)
223
- self.system_parts = {"memory": mem, "rules": rules_text, "skills": skills_text}
224
223
  from euron_code import trust
225
224
  self.project_trusted = trust.is_trusted(self.root)
225
+ # What Euron Code already knows about this project (code map, recent work, open security
226
+ # findings), so a task starts from it instead of re-exploring. Built locally; repo-provided
227
+ # content, so only for a trusted project, like EURON.md.
228
+ know = ""
229
+ if self.project_trusted:
230
+ try:
231
+ from euron_code import knowledge
232
+ know = knowledge.render(self.root)
233
+ except Exception:
234
+ know = ""
235
+ if know:
236
+ mem = (mem + "\n\n" + know) if mem else know
237
+ self.system_parts = {"memory": mem, "rules": rules_text, "skills": skills_text, "knowledge": know}
226
238
  return prompts.build_system_prompt(self.root, self.shell_kind, mem, rules_text=rules_text,
227
239
  skills_text=skills_text,
228
240
  extra_dirs=getattr(self.permissions, "extra_roots", ()),
@@ -329,10 +341,43 @@ class Agent:
329
341
  if r.code == 0 and r.stdout.strip():
330
342
  self.add_context(hook_block("UserPromptSubmit", r.stdout))
331
343
  self.checkpoints.begin(len(self.messages), user_text)
344
+ result: Optional[TurnResult] = None
332
345
  try:
333
- return self._run_turn(user_text, max_turns)
346
+ result = self._run_turn(user_text, max_turns)
347
+ return result
334
348
  finally:
335
349
  self.checkpoints.finish()
350
+ self._remember_task(user_text, result)
351
+
352
+ def _remember_task(self, user_text: str, result: Optional[TurnResult]) -> None:
353
+ """After every task: rescan the files it changed for security issues, then add it to the
354
+ project's journal, the built-files cache and the learned rules (.euron/knowledge/). Local,
355
+ quick, and never allowed to break the session."""
356
+ from euron_code import knowledge, security_scan
357
+ if not knowledge.enabled() or not knowledge.is_set_up(self.root) or not getattr(self, "project_trusted", False):
358
+ return
359
+ try:
360
+ note = ""
361
+ edits = self.files_changed()
362
+ if edits:
363
+ res = security_scan.scan_paths(self.root, edits, "after task: " + " ".join(user_text.split())[:60])
364
+ if res.new:
365
+ worst = res.new[0]
366
+ note = f"{len(res.new)} new finding(s), e.g. {worst['title']} in {worst['file']}:{worst['line']}"
367
+ self.ui.warn(f"Security: {len(res.new)} new finding(s) in the files just changed "
368
+ f"(worst: {worst['severity']} - {worst['title']} at {worst['file']}:{worst['line']}). "
369
+ "See .euron/security/assessment.md or run /security-review.")
370
+ if res.resolved:
371
+ note = (note + "; " if note else "") + f"{len(res.resolved)} finding(s) resolved"
372
+ self.ui.dim(f"Security: {len(res.resolved)} earlier finding(s) resolved by this change.")
373
+ knowledge.record_task(self.root, user_text, self.ledger,
374
+ result.text if result else "", result.stop_reason if result else "error", note)
375
+ except Exception as e:
376
+ try:
377
+ from euron_code import errorlog
378
+ errorlog.get().report("knowledge", "record_failed", str(e)[:300])
379
+ except Exception:
380
+ pass
336
381
 
337
382
  def _run_turn(self, user_text: str, max_turns: Optional[int]) -> TurnResult:
338
383
  max_turns = max_turns or self.max_turns
@@ -415,19 +415,16 @@ def _run_session(args, ui, root, settings) -> int:
415
415
  except api.EuronError as e:
416
416
  return _report(ui, e)
417
417
 
418
- # first run in a new folder: offer the local project setup (no model call)
418
+ # first run in a new folder (or a fresh clone): set the project up automatically, locally and
419
+ # without a model call. `-p` (scripts) only does it with --yes; EURON_NO_AUTOSETUP=1 opts out.
419
420
  from euron_code import project_setup
420
- if project_setup.should_offer(root) and (args.yes or (not args.print_mode and sys.stdin.isatty())):
421
- ans = "y" if args.yes else ui.ask_text(
422
- "Set up this project for Euron Code (EURON.md, rules, commands, settings)? (Y/n) ").strip().lower()
423
- if ans in ("", "y", "yes"):
424
- from euron_code import trust as _trust
425
- with _trust.keep(root):
426
- created = project_setup.setup(root)
427
- show_setup(ui, root, created)
428
- else:
429
- project_setup.remember_declined(root)
430
- ui.dim("Skipped. Run `euron init` any time to set it up.")
421
+ interactive_run = not args.print_mode and sys.stdin.isatty()
422
+ auto = os.environ.get("EURON_NO_AUTOSETUP", "").strip() in ("", "0", "false")
423
+ if project_setup.should_offer(root) and (args.yes or (interactive_run and auto)):
424
+ from euron_code import trust as _trust
425
+ with _trust.keep(root):
426
+ created = project_setup.setup(root)
427
+ show_setup(ui, root, created)
431
428
 
432
429
  # a cloned repo may not loosen anything without the user's trust (trust.py)
433
430
  from euron_code import trust
@@ -436,6 +433,18 @@ def _run_session(args, ui, root, settings) -> int:
436
433
  if settings.get("_ignoredProjectSettings") and not args.print_mode:
437
434
  ui.dim("Ignored (not trusted): " + ", ".join(settings["_ignoredProjectSettings"]))
438
435
 
436
+ # The project's memory: code map on the first run, refreshed when the code moves on, plus the
437
+ # security assessment (day-zero scan, then whatever changed). Local and quick; never blocks.
438
+ if trusted:
439
+ from euron_code import knowledge
440
+ if (not args.print_mode and knowledge.enabled() and knowledge.is_set_up(root)
441
+ and not (knowledge.kdir(root) / knowledge.CODEMAP).exists()):
442
+ ui.dim("First run here: analysing the project and checking it for security issues "
443
+ "(on this computer, no tokens)...")
444
+ for line in knowledge.bootstrap(root, ui, trusted):
445
+ if not args.print_mode:
446
+ ui.dim(line)
447
+
439
448
  model = args.model or settings.get("model") or me.get("defaultModel") or "euron-coder"
440
449
  apply_model_limits(client, settings, model)
441
450
  if getattr(args, "no_reuse", False):