@yahyahammad/venastine 0.1.0 → 0.3.8

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 (130) hide show
  1. package/.env.example +19 -14
  2. package/CONFIG_ARCHITECTURE.md +2002 -0
  3. package/NOTICE +1 -1
  4. package/README.md +249 -93
  5. package/agents/builtin/build.md +73 -0
  6. package/agents/builtin/general.md +80 -0
  7. package/agents/builtin/plan.md +23 -5
  8. package/agents/builtin/test.md +65 -0
  9. package/agents/builtin/writer.md +67 -0
  10. package/agents/manager.py +261 -195
  11. package/agents/subagent_tool.py +280 -23
  12. package/agents/tui_commands.py +31 -21
  13. package/bin/venastine.mjs +528 -382
  14. package/bin/venastine.py +71 -0
  15. package/cli_commands.py +835 -0
  16. package/config.py +95 -1198
  17. package/config.yaml +1090 -0
  18. package/config_edit.py +1301 -0
  19. package/config_schema.py +966 -0
  20. package/config_update.py +749 -0
  21. package/core/agent_activity.py +256 -0
  22. package/core/ansi.py +452 -0
  23. package/core/approval.py +27 -5
  24. package/core/call_view.py +364 -0
  25. package/core/cancel.py +121 -0
  26. package/core/chatgpt_auth.py +747 -0
  27. package/core/claims_view.py +107 -0
  28. package/core/client.py +1249 -82
  29. package/core/commands.py +454 -0
  30. package/core/compaction.py +1735 -959
  31. package/core/config_loader.py +516 -97
  32. package/core/connect.py +686 -0
  33. package/core/events.py +68 -6
  34. package/core/file_mentions.py +280 -0
  35. package/core/interaction.py +87 -4
  36. package/core/line_pattern.py +128 -0
  37. package/core/loop.py +2566 -1353
  38. package/core/memory.py +482 -370
  39. package/core/pipeline_models.py +23 -9
  40. package/core/provider_errors.py +234 -0
  41. package/core/reasoning/confidence_scoring.py +70 -54
  42. package/core/reasoning/json_retry.py +19 -1
  43. package/core/reasoning/orchestrator.py +232 -53
  44. package/core/reasoning/output_writer.py +90 -31
  45. package/core/reasoning/payload_validation.py +133 -7
  46. package/core/reasoning/pipeline_storage.py +427 -361
  47. package/core/reasoning/review.py +659 -615
  48. package/core/reasoning/scholar.py +38 -14
  49. package/core/reasoning/source_corpus.py +110 -4
  50. package/core/replay.py +315 -167
  51. package/core/session.py +36 -12
  52. package/core/session_view.py +259 -0
  53. package/core/session_wake.py +259 -0
  54. package/core/shell_sessions.py +1553 -0
  55. package/core/workspace_trust.py +1 -1
  56. package/credentials.py +308 -180
  57. package/database.py +82 -1
  58. package/{PRIVACY.md → docs/PRIVACY.md} +19 -7
  59. package/docs/SECURITY.md +108 -0
  60. package/docs/THIRD_PARTY_NOTICES.md +148 -0
  61. package/env_secrets.py +118 -77
  62. package/json_store.py +236 -16
  63. package/logging_setup.py +121 -11
  64. package/main.py +1672 -198
  65. package/mcp_client/client.py +257 -23
  66. package/mcp_client/config.py +484 -379
  67. package/mcp_client/registration.py +163 -2
  68. package/memories/manager.py +15 -0
  69. package/memories/tui_commands.py +21 -14
  70. package/package.json +303 -73
  71. package/project_init/config_files.py +4 -0
  72. package/project_init/generator.py +201 -37
  73. package/project_init/manifest.py +418 -406
  74. package/project_init/tui_commands.py +7 -4
  75. package/prompts/revalidate.md +1 -1
  76. package/prompts/revise.md +17 -15
  77. package/prompts/system_prompts.py +64 -10
  78. package/providers.json.example +94 -92
  79. package/pyproject.toml +149 -100
  80. package/requirements.txt +252 -29
  81. package/safety/policy_enforcement.py +1082 -682
  82. package/security/askpass.py +419 -0
  83. package/security/capability.py +37 -7
  84. package/security/confine.py +484 -0
  85. package/security/hosted.py +182 -0
  86. package/security/permissions.py +54 -7
  87. package/security/posture.py +124 -12
  88. package/security/protected_paths.py +198 -6
  89. package/security/sandbox.py +3262 -139
  90. package/security/secrets.py +855 -0
  91. package/skills/tui_commands.py +3 -4
  92. package/storage.py +1338 -1005
  93. package/tools/base.py +465 -305
  94. package/tools/builtin/_math_common.py +306 -16
  95. package/tools/builtin/_net_common.py +267 -61
  96. package/tools/builtin/arxiv.py +681 -223
  97. package/tools/builtin/ask_user.py +231 -213
  98. package/tools/builtin/discrete_math.py +35 -4
  99. package/tools/builtin/fetch_url.py +239 -21
  100. package/tools/builtin/file_ops.py +341 -33
  101. package/tools/builtin/geometry.py +184 -148
  102. package/tools/builtin/get_time.py +2 -2
  103. package/tools/builtin/linear_algebra.py +66 -23
  104. package/tools/builtin/load_skill.py +10 -0
  105. package/tools/builtin/logic.py +171 -12
  106. package/tools/builtin/pin.py +46 -12
  107. package/tools/builtin/probability_stats.py +224 -228
  108. package/tools/builtin/project_docs.py +80 -21
  109. package/tools/builtin/remember.py +21 -4
  110. package/tools/builtin/shell.py +586 -67
  111. package/tools/builtin/shell_sessions.py +613 -0
  112. package/tools/builtin/symbolic_math.py +80 -10
  113. package/tools/builtin/todo.py +5 -3
  114. package/tools/builtin/web_search.py +329 -151
  115. package/tools/context.py +23 -0
  116. package/tools/isolation.py +387 -314
  117. package/tools/registry.py +374 -29
  118. package/tui/app.py +5281 -397
  119. package/tui/app.tcss +290 -9
  120. package/tui/commands.py +26 -61
  121. package/tui/diffs.py +286 -265
  122. package/tui/history.py +128 -0
  123. package/tui/hosted_driver.py +102 -0
  124. package/tui/markdown.py +1329 -0
  125. package/tui/meters.py +364 -0
  126. package/tui/screens.py +346 -92
  127. package/tui/themes.py +599 -366
  128. package/tui/widgets.py +2673 -116
  129. package/SECURITY.md +0 -88
  130. package/THIRD_PARTY_NOTICES.md +0 -100
package/SECURITY.md DELETED
@@ -1,88 +0,0 @@
1
- # Security Policy
2
-
3
- ## Supported Versions
4
-
5
- | Version | Supported |
6
- |---|---|
7
- | `main` (0.1.x) | Yes — security fixes ship on `main` first |
8
-
9
- No long-term support branches yet. If you are on a fork, rebase on `main` before reporting.
10
-
11
- ## Reporting a Vulnerability
12
-
13
- **Do not open a public issue, discussion, or pull request for a security vulnerability.**
14
-
15
- **Email the maintainer at YahyaHammad@proton.me**, with the subject `[SECURITY] Venastine — <title>`.
16
-
17
- Send a high-level summary first. Do not include full exploit code in plaintext until a secure transfer method has been agreed.
18
-
19
- **Or use GitHub Private Vulnerability Reporting, where it is enabled:** *Security* tab → *Report a vulnerability*. It is the better channel when available, because the report, the fix and the advisory stay in one place — but it is a public-repository feature, so email is the channel that always works. Use email if you do not see the button.
20
-
21
-
22
- ### What to include
23
-
24
- * Affected file(s) and line(s) — e.g. `security/sandbox.py:134`, `tools/registry.py:187`
25
- * The concrete trigger — not "could be a problem" — the exact call, config (`ToolPermissions.shell=True`, `providers.json` entry), and filesystem/network/model state that reaches it
26
- * Whether you can reproduce it offline (`python -m pytest -q` or a minimal script) and the commit you tested against
27
- * Impact — what an attacker gains (exfiltration, code execution, bypass of approval, etc.) and whether it needs a local `shell` opt-in or is reachable on a default install
28
-
29
- A minimal reproduction is not required, but it makes triage much faster.
30
-
31
- ## What to expect
32
-
33
- * **Acknowledgment** within **2 business days**.
34
- * **Triage and initial assessment** within **7 days** — we will confirm severity (`S1`–`S4` per `#15` tracker), whether it is in scope, and whether we need more info.
35
- * **Fix and disclosure** under **coordinated disclosure with a 90-day window**:
36
- * We will develop and test a fix on a private branch.
37
- * We will ship the fix to `main` and tag a release as soon as it is ready — often well before day 90.
38
- * Public disclosure (advisory + `DEVLOG.md` entry + `tests/BREAKING_CHANGES.md` row) happens **7 days after a fix ships to main** (to allow users time to update), or **90 days after your initial report**, whichever comes first, unless extended by mutual agreement.
39
- * If you prefer, you will be credited in the advisory and `DEVLOG.md`; if not, you will remain anonymous.
40
-
41
- We will keep the private thread updated at least every 14 days until resolution.
42
-
43
- ## Scope
44
-
45
- In scope (examples):
46
-
47
- * Bypass of `security/permissions.py` / `safety/policy_enforcement.py` (approval, `is_tool_allowed`, `requires_approval`, `check_output_policy`, blocked domains, secret redaction)
48
- * Sandbox escape or network egress from a tier that should not have it (`security/sandbox.py`, `security/capability.py`)
49
- * Workspace trust boundary bypass (`core/workspace_trust.py`, `core/config_loader.py` tier precedence)
50
- * Credential exfiltration via tool arguments/results, logs, or `param_digest` display
51
- * MCP `autoApprove` / `mcp.json` trust bypass
52
-
53
- Out of scope: social engineering, physical access, compromise of a provider's own API, vulnerabilities in upstream dependencies without a harness-specific trigger, or issues that require `ToolPermissions.shell=True` together with `config.SHELL_APPROVAL_MODE = "never"` *and* are already documented as deliberate. `README.md` § *"`shell` is classified, not just approved"* records that `never` "is the old unbounded behaviour, kept on purpose" — in that mode `cat ~/.aws/credentials` runs on the host unprompted, and reaching it takes writing the word `never` in `config.py`. We still want such a report, but it will be closed as documented risk.
54
-
55
- The same applies to `ALLOW_INSECURE_SANDBOX_FALLBACK = True` **together with** `AUTO_APPROVE_SANDBOX_FALLBACK = True`. That pair is unprompted arbitrary code on the host, with your own file access, including writes into the harness's own source tree — and the harness ships as a folder of Python, so a run can edit the code the next run executes. It is not defended against, and the reason is that it cannot be: an uncontained host shell cannot be bounded from inside the same process. A path check stops `echo x > ../config.py` and a `python -c` payload walks straight past it, which is a control that reads as safety without being it. Docker is the boundary. `README.md` § *"`shell` is classified, not just approved"* states the same thing at the point of use.
56
-
57
- **Since batch 40 these settings are read ONCE, at startup, into a frozen posture
58
- (`security/posture.py`).** Before that they were read live at every decision, so
59
- `config.SHELL_APPROVAL_MODE = "never"` -- a single attribute assignment -- turned the shell gate off
60
- for the rest of the process from anywhere in it, and `os.environ["VENASTINE_REDACT_OFF"] = "1"` did
61
- the same for credential redaction. The posture now cannot be changed by a tool call, a settings
62
- file, an environment variable, model output, or a TUI command; each of those is pinned by a test in
63
- `tests/test_posture.py`.
64
-
65
- It **can** be changed by arbitrary in-process Python, which can also rebind the accessor itself. A
66
- frozen dataclass raises where a bare assignment succeeded, which raises the bar without closing the
67
- class. In scope: any route from model output or repository content to a changed posture. Out of
68
- scope: "I achieved arbitrary code execution and then changed it", which is a report about the
69
- execution.
70
-
71
- Note that all of these settings live in `config.py` (`SHELL_APPROVAL_MODE` at `config.py:245`, `ToolPermissions` at `config.py:640`, the two fallback flags at `config.py:221-222`) — none has a `settings.json` key or an environment override, by design. What IS in scope, and was fixed rather than documented: a sandboxed command reaching the harness's install tree or `~/.config/venastine/` through the workspace mount (`security/protected_paths.py`), and any argument spelling that makes the classifier and the executor disagree about where a token ends.
72
-
73
- **The project's `.venastine/` directory is guarded by `PROTECTED_SEGMENTS` (`security/protected_paths.py`), one list with three consumers.** The `read`/`write`/`edit` tools hard-refuse any path resolving into the segment — pre-approval via `refusal_check` and again in the handlers, whatever the approval booleans and the workspace boundary say. A shell command whose tokens name the segment always requires approval under `tiered` mode, before the fallback opt-in and the capability rule can answer for it; when approved it still runs contained, where the read-only bind of `.venastine/` (§28 G6) is the write backstop. What remains documented risk: the shell check is a token check and does not parse (G2), so a spelling carrying no literal segment — a glob prefix like `.ven*/settings.json`, or a variable assigned outside the checked tokens — is not caught by it; on the auto-approved INERT tier that cannot matter, because EP5 executes argv with no shell and the tokens are the arguments, and every tier that could expand one is asked about anyway. `SHELL_APPROVAL_MODE = "never"` remains the opt-out it always was, and MCP servers exposing their own file tools are a separate surface this list does not reach.
74
-
75
- ## No bounty
76
-
77
- This is an independent research project with no funding — **we cannot offer monetary rewards, bounties, or swag.** We will credit you publicly if you want, and we will prioritize a fix. If you need a bounty, please use a third-party program that covers this repo, or treat the report as a voluntary disclosure.
78
-
79
- ## Disclosure and credit
80
-
81
- * We will publish a GitHub Security Advisory (GHSA) 7 days after the fix ships to main (or at the 90-day mark), requesting a CVE if the severity warrants it.
82
- * We will not disclose your identity without permission.
83
- * Please do not disclose the issue publicly (including in a fork, gist, or write-up) before public disclosure or advisory publication — this protects users who have not yet updated.
84
-
85
- ## Questions
86
-
87
- For non-sensitive questions about this policy, open a regular issue. For sensitive details, use the private channel above.
88
-
@@ -1,100 +0,0 @@
1
- # Third-Party Notices
2
-
3
- This project is licensed under the **Apache License 2.0** — see [LICENSE](./LICENSE) and [NOTICE](./NOTICE) (Copyright 2026 Yahya Hammad).
4
-
5
- The dependencies listed below are **not** part of the project's own source but are required at install/runtime. All are permissive and **Apache-2.0 compatible**; the assessment was made on 2026-08-27. This file records it so a scanner or reviewer does not have to re-derive it.
6
-
7
- > **Scope.** Two things are covered here: the project's **declared direct** dependencies — the pins in `requirements.txt` and the extras in `pyproject.toml` — and, under *Non-code third-party material* below, the third-party **text** the repository reproduces.
8
- >
9
- > The transitive dependency closure is *not* enumerated: `matplotlib` alone pulls numpy, pillow, kiwisolver and fonttools, and `mcp==2.0.0` brings `httpx2` (see the note at `requirements.txt:47`). For the full closure, run `pip-licenses` against a resolved environment — see *How to regenerate* below.
10
-
11
- > Versions shown are the pins from `requirements.txt` / `pyproject.toml` at the time this file was created. Where a range is used (e.g. `textual>=1.0,<2.0`) the exact resolved version will vary.
12
-
13
- ## Runtime / core dependencies
14
-
15
- | Package | Version (as pinned) | Primary License | Apache 2.0 Compatible | Source |
16
- |---|---|---|---|---|
17
- | anthropic | `==0.116.0` | MIT | Yes | https://pypi.org/project/anthropic/ |
18
- | ddgs | `==9.14.4` | MIT | Yes | https://pypi.org/project/ddgs/ |
19
- | httpx | `==0.28.1` | BSD-3-Clause | Yes | https://pypi.org/project/httpx/ |
20
- | openai | `==2.45.0` | Apache-2.0 | Yes | https://pypi.org/project/openai/ |
21
- | google-genai | `==1.0.0` | Apache-2.0 | Yes | https://pypi.org/project/google-genai/ |
22
- | pydantic | `==2.13.4` | MIT | Yes | https://pypi.org/project/pydantic/ |
23
- | sympy | `==1.13.3` | BSD-3-Clause | Yes | https://pypi.org/project/sympy/ |
24
- | sqlmodel | `==0.0.39` | MIT | Yes | https://pypi.org/project/sqlmodel/ |
25
- | python-dotenv | `==1.0.1` | BSD-3-Clause | Yes | https://pypi.org/project/python-dotenv/ |
26
- | matplotlib | `==3.10.3` | PSF / BSD-Compatible | Yes | https://pypi.org/project/matplotlib/ |
27
- | pyyaml | `==6.0.3` | MIT | Yes | https://pypi.org/project/PyYAML/ |
28
- | textual | `>=1.0,<2.0` | MIT | Yes | https://pypi.org/project/textual/ |
29
- | rich | `>=13,<16` | MIT | Yes | https://pypi.org/project/rich/ |
30
- | mcp | `==2.0.0` | MIT | Yes | https://pypi.org/project/mcp/ |
31
-
32
- ## Test dependencies (not used by end users during runtime, only for CI and developer testing)
33
-
34
- | Package | Version (as pinned) | Primary License | Apache 2.0 Compatible |
35
- |---|---|---|---|
36
- | pytest | `>=8.0` | MIT | Yes |
37
- | pytest-mock | `>=3.14` | MIT | Yes |
38
- | pytest-asyncio | `>=1.0` | Apache-2.0 | Yes |
39
-
40
- ## Optional dependencies (`pyproject.toml` extras)
41
-
42
- | Package | Version (as pinned) | Primary License | Apache 2.0 Compatible | Notes |
43
- |---|---|---|---|---|
44
- | markitdown | `==0.1.6` (extra `documents`) | MIT | Yes | Permissive; only reachable behind `read`/`write`/`edit` (globally denied). |
45
- | protobuf | `==7.35.1` (extra `documents`) | BSD-3-Clause / Apache-2.0 | Yes | Permissive; transitive via `markitdown`→`onnxruntime`. |
46
- | markdown | unpinned (extra `pdf`) | BSD-3-Clause | Yes | Permissive |
47
- | weasyprint | unpinned (extra `pdf`) | BSD-3-Clause (package) | Yes (with caveats) | Package itself BSD-3-Clause; transitive deps include LGPL (e.g. `pango`/`cairo` via system libs). See weasyprint docs. |
48
-
49
- `weasyprint` is BSD-3-Clause itself; the caveat is its **system** dependencies (`pango`, `cairo`, `harfbuzz`), which are LGPL and are linked at runtime rather than vendored into this project. If `markdown` or `weasyprint` is later pinned, update the version column above.
50
-
51
- ## Non-code third-party material
52
-
53
- **No third-party source code is included in this repository.** Measured, not assumed: 166 tracked
54
- Python files carry no foreign copyright header and no `SPDX-License-Identifier`; a sweep for
55
- copied or adapted code ("adapted from", "copied from", "taken from", "vendored", "borrowed from")
56
- returns only this project's own design prose; and the only tracked files that are neither `.py`
57
- nor `.md` are `LICENSE`, `prompts/universal_system_prompt`, `prompts/untrusted_content`,
58
- `research-mode-birds-eye.mermaid` and `tui/app.tcss` — all first-party. There are no bundled
59
- fonts, images or data files.
60
-
61
- What the repository *does* reproduce is third-party **text**:
62
-
63
- | Material | Where it lives | Origin | Licensing |
64
- |---|---|---|---|
65
- | **Contributor Covenant, v2.1** | `CODE_OF_CONDUCT.md` (adapted — contact details and enforcement channel are ours) | Authored 2014 by Coraline Ada Ehmke, with later collaborative contributions. https://www.contributor-covenant.org/version/2/1/code_of_conduct.html | **Not stated by upstream** for the document text — see the note below |
66
- | **Mozilla's CoC enforcement ladder** | Inspiration for the *Enforcement Guidelines* section of `CODE_OF_CONDUCT.md`, credited there per the Covenant's own boilerplate | https://github.com/mozilla/diversity | GitHub reports the repository as **MPL-2.0** |
67
- | **Apache License 2.0 text** | `LICENSE` | https://www.apache.org/licenses/LICENSE-2.0 | Reproduced verbatim, which is what the licence itself directs; the appendix boilerplate is filled in with this project's copyright |
68
-
69
- > **On the Covenant's licence.** Upstream does not publish an explicit licence for the Code of
70
- > Conduct *text*. Three sources were checked on 2026-08-27: the project's `LICENSE.md`
71
- > (`EthicalSource/contributor_covenant`) states the **Hippocratic License 3.0**, which covers the
72
- > site and its code; the contributor-covenant.org footer carries a copyright line and no licence
73
- > statement; and the raw `content/version/2/1/code_of_conduct.md` carries none either.
74
- >
75
- > **No licence identifier is asserted here on the Covenant's behalf.** The attribution block kept
76
- > in `CODE_OF_CONDUCT.md` — naming the work, its version, its source URL, and the fact that it is
77
- > *adapted* — is verbatim the attribution upstream prescribes in its own boilerplate, and is the
78
- > best available evidence of what they ask adopters to provide. If you need certainty for a
79
- > compliance review, ask upstream rather than inferring from this file.
80
-
81
- ## What this means
82
-
83
- * All licenses **listed above** are **permissive** (MIT / BSD-3-Clause / PSF / Apache-2.0). None are copyleft (GPL/AGPL) and none impose source-disclosure on this Apache-2.0 work. This is a statement about the direct dependencies in the tables, not about the full transitive closure — see *Scope* at the top.
84
- * This project does not redistribute any of them. It is distributed as **source** — a `git` checkout or the npm package `@yahyahammad/venastine`, which is the same folder of first-party files — and `pip` fetches each dependency from PyPI, onto the user's machine, under its own license. **No inbound `NOTICE` obligation therefore arises** — nothing here carries an upstream NOTICE that this project must propagate. The trigger is **redistribution**, not source-vs-binary, and not which channel delivered the source; if a build that vendors these packages is ever distributed, ship their `LICENSE` and `NOTICE` files as received (Apache-2.0 §4(d) applies to `openai`, `google-genai` and `pytest-asyncio`). **The npm tarball must therefore never carry wheels** — that is the one change that would turn this paragraph false, and `CONTRIBUTING.md` records it as a rule.
85
- * **The npm channel adds no third-party licence surface at all.** Its launcher (`bin/venastine.mjs`) is Node standard library only, with an empty `dependencies` block, so an install of this package fetches no JavaScript code from anyone. What the tarball contains is the first-party source listed under `files` in `package.json`, plus `LICENSE`, `NOTICE` and this file. Publishing *is* distribution of the Work under Apache-2.0 §4 where running from a checkout was not, which is why those three are in the allowlist rather than left to chance: npm auto-includes `LICENSE` and does **not** auto-include `NOTICE`.
86
- * The [NOTICE](./NOTICE) file this project publishes is therefore **voluntary**, not required. Apache-2.0 §4(d) obliges you to propagate a NOTICE you *received*; it does not oblige a licensor to author one. It exists because scanners and reviewers look for it and because it gives the copyright assertion a canonical home — and it is kept minimal on purpose, since anyone who redistributes this work must carry its contents forward.
87
- * Full license texts: `pip show <package>` or `pip-licenses --format plain --with-urls`, or the PyPI links above.
88
-
89
- ## How to regenerate
90
-
91
- ```bash
92
- pip-licenses --format markdown --with-urls --with-license-file
93
- # or
94
- pip install pip-licenses && pip-licenses --format plain
95
- ```
96
-
97
- When a dependency is added or re-pinned, add a row here with its SPDX identifier and re-check the `Apache 2.0 Compatible` column. CI does not enforce this file today — it is documentation for reviewers.
98
-
99
- ---
100
- *Last updated: 2026-08-27. If any row's upstream re-licenses, this file must be updated.*