@yahyahammad/venastine 0.1.0
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.
- package/.env.example +14 -0
- package/LICENSE +201 -0
- package/NOTICE +14 -0
- package/PRIVACY.md +66 -0
- package/README.md +878 -0
- package/SECURITY.md +88 -0
- package/THIRD_PARTY_NOTICES.md +100 -0
- package/agents/builtin/compactor.md +75 -0
- package/agents/builtin/explore.md +77 -0
- package/agents/builtin/grill-me.md +27 -0
- package/agents/builtin/initializer.md +94 -0
- package/agents/builtin/pipeline-reviewer.md +100 -0
- package/agents/builtin/plan.md +88 -0
- package/agents/builtin/review.md +74 -0
- package/agents/manager.py +195 -0
- package/agents/subagent_tool.py +215 -0
- package/agents/tui_commands.py +136 -0
- package/bin/venastine.mjs +382 -0
- package/config.py +1198 -0
- package/core/__init__.py +0 -0
- package/core/approval.py +115 -0
- package/core/client.py +1548 -0
- package/core/compaction.py +959 -0
- package/core/config_loader.py +1563 -0
- package/core/events.py +61 -0
- package/core/interaction.py +328 -0
- package/core/loop.py +1353 -0
- package/core/memory.py +370 -0
- package/core/model_windows.py +175 -0
- package/core/pipeline_models.py +176 -0
- package/core/reasoning/__init__.py +0 -0
- package/core/reasoning/authorization.py +130 -0
- package/core/reasoning/base.py +219 -0
- package/core/reasoning/confidence_scoring.py +468 -0
- package/core/reasoning/events.py +149 -0
- package/core/reasoning/json_retry.py +219 -0
- package/core/reasoning/orchestrator.py +1382 -0
- package/core/reasoning/output_writer.py +286 -0
- package/core/reasoning/payload_validation.py +398 -0
- package/core/reasoning/pipeline_storage.py +361 -0
- package/core/reasoning/review.py +615 -0
- package/core/reasoning/scholar.py +434 -0
- package/core/reasoning/source_corpus.py +327 -0
- package/core/reasoning/source_scoring.py +855 -0
- package/core/replay.py +167 -0
- package/core/session.py +153 -0
- package/core/workspace_trust.py +207 -0
- package/credentials.py +180 -0
- package/database.py +252 -0
- package/env_secrets.py +77 -0
- package/json_store.py +123 -0
- package/logging_setup.py +185 -0
- package/main.py +1959 -0
- package/mcp_client/__init__.py +15 -0
- package/mcp_client/client.py +499 -0
- package/mcp_client/config.py +379 -0
- package/mcp_client/registration.py +182 -0
- package/memories/manager.py +132 -0
- package/memories/tui_commands.py +232 -0
- package/package.json +73 -0
- package/project_init/config_files.py +278 -0
- package/project_init/doc_sets.py +330 -0
- package/project_init/generator.py +564 -0
- package/project_init/manifest.py +406 -0
- package/project_init/tui_commands.py +144 -0
- package/prompts/__init__.py +0 -0
- package/prompts/annotate.md +14 -0
- package/prompts/assumption_audit.md +27 -0
- package/prompts/claim_extraction.md +34 -0
- package/prompts/completeness.md +18 -0
- package/prompts/confidence_tiers.md +23 -0
- package/prompts/critic_pass.md +24 -0
- package/prompts/final_synthesis.md +13 -0
- package/prompts/initial_generation.md +14 -0
- package/prompts/preliminary_plan.md +23 -0
- package/prompts/revalidate.md +25 -0
- package/prompts/revise.md +15 -0
- package/prompts/source_grounding.md +66 -0
- package/prompts/system_prompts.py +262 -0
- package/prompts/universal_system_prompt +7 -0
- package/prompts/untrusted_content +1 -0
- package/providers.json.example +92 -0
- package/pyproject.toml +100 -0
- package/requirements.txt +72 -0
- package/safety/__init__.py +0 -0
- package/safety/policy_enforcement.py +682 -0
- package/security/__init__.py +0 -0
- package/security/capability.py +177 -0
- package/security/permissions.py +190 -0
- package/security/posture.py +302 -0
- package/security/protected_paths.py +309 -0
- package/security/sandbox.py +985 -0
- package/skills/builtin/crypto/cryptography-verification.md +66 -0
- package/skills/builtin/math/formal-specification.md +67 -0
- package/skills/builtin/math/numerical-methods.md +66 -0
- package/skills/builtin/math/proof-writing.md +61 -0
- package/skills/builtin/research/experiment-design.md +62 -0
- package/skills/builtin/research/literature-review.md +65 -0
- package/skills/builtin/research/reproducibility.md +55 -0
- package/skills/builtin/research/source-evaluation.md +70 -0
- package/skills/builtin/research/statistical-inference.md +63 -0
- package/skills/builtin/research/technical-writing.md +59 -0
- package/skills/builtin/security/cybersecurity-research.md +63 -0
- package/skills/builtin/software/code-review.md +61 -0
- package/skills/builtin/software/debugging.md +61 -0
- package/skills/builtin/software/test-design.md +67 -0
- package/skills/manager.py +138 -0
- package/skills/tui_commands.py +111 -0
- package/storage.py +1005 -0
- package/tools/base.py +305 -0
- package/tools/builtin/__init__.py +0 -0
- package/tools/builtin/_math_common.py +377 -0
- package/tools/builtin/_net_common.py +61 -0
- package/tools/builtin/arxiv.py +223 -0
- package/tools/builtin/ask_user.py +213 -0
- package/tools/builtin/discrete_math.py +134 -0
- package/tools/builtin/fetch_url.py +153 -0
- package/tools/builtin/file_ops.py +412 -0
- package/tools/builtin/geometry.py +148 -0
- package/tools/builtin/get_time.py +20 -0
- package/tools/builtin/linear_algebra.py +155 -0
- package/tools/builtin/load_skill.py +66 -0
- package/tools/builtin/logic.py +96 -0
- package/tools/builtin/pin.py +193 -0
- package/tools/builtin/probability_stats.py +228 -0
- package/tools/builtin/project_docs.py +405 -0
- package/tools/builtin/remember.py +158 -0
- package/tools/builtin/shell.py +461 -0
- package/tools/builtin/symbolic_math.py +119 -0
- package/tools/builtin/todo.py +147 -0
- package/tools/builtin/web_search.py +151 -0
- package/tools/context.py +136 -0
- package/tools/isolation.py +314 -0
- package/tools/registry.py +897 -0
- package/tui/app.py +3423 -0
- package/tui/app.tcss +458 -0
- package/tui/commands.py +61 -0
- package/tui/diffs.py +265 -0
- package/tui/preferences.py +182 -0
- package/tui/ravens.py +146 -0
- package/tui/screens.py +943 -0
- package/tui/themes.py +366 -0
- package/tui/widgets.py +1239 -0
package/core/__init__.py
ADDED
|
File without changes
|
package/core/approval.py
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"""
|
|
2
|
+
core/approval.py
|
|
3
|
+
|
|
4
|
+
ROADMAP_v2 §25. How a run obtains human authorization for a tool call,
|
|
5
|
+
as data rather than as a mechanism baked into one shell.
|
|
6
|
+
|
|
7
|
+
There are exactly two ways an approval-gated call can proceed, and they
|
|
8
|
+
compose:
|
|
9
|
+
|
|
10
|
+
* a GRANT -- the user said yes before the run started, naming tools.
|
|
11
|
+
* a PROVIDER -- the user is present and can be asked, per call.
|
|
12
|
+
|
|
13
|
+
Neither is a policy relaxation. security/permissions.py still decides
|
|
14
|
+
whether a tool is allowed at all and whether a call needs approval (D14,
|
|
15
|
+
"stricter wins"); this module only carries the human's answer to the
|
|
16
|
+
question that policy raised. That is why a grant lives on RunInfo and not
|
|
17
|
+
in ToolContext.approval_overrides -- those OR, so they can only tighten.
|
|
18
|
+
|
|
19
|
+
§23 CARRIED OUT the generalisation this module used to anticipate.
|
|
20
|
+
`ApprovalProvider` and `ReviewConsent` both lived here and are gone: they
|
|
21
|
+
were two caller-supplied ways to ask a question and block for an answer,
|
|
22
|
+
and they are now one, `core.interaction.ResponseChannel`. What remains
|
|
23
|
+
here is authorization DATA -- what the human already decided and how much
|
|
24
|
+
of it is left to spend -- which is a different thing from the means of
|
|
25
|
+
asking, and is why the two are separate modules rather than one.
|
|
26
|
+
|
|
27
|
+
`RunAuthorization.provider` therefore holds a ResponseChannel now. The
|
|
28
|
+
field keeps its name because it plays the same role in the bundle: the
|
|
29
|
+
route by which a run can obtain an answer it does not already have.
|
|
30
|
+
|
|
31
|
+
Deliberately a leaf module with no project imports -- core/interaction.py
|
|
32
|
+
is imported for typing only, and it is itself a leaf. core/loop.py,
|
|
33
|
+
main.py, tui/app.py and core/reasoning/ all depend on both; neither
|
|
34
|
+
depends on them.
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
from dataclasses import dataclass, field
|
|
38
|
+
from typing import TYPE_CHECKING, Optional
|
|
39
|
+
|
|
40
|
+
if TYPE_CHECKING: # pragma: no cover - typing only, never imported at runtime
|
|
41
|
+
from core.interaction import ResponseChannel
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
class GrantBudget:
|
|
45
|
+
"""A ceiling on how many pre-granted calls one run may make.
|
|
46
|
+
|
|
47
|
+
Pre-flight authorization trades a per-call decision for a single
|
|
48
|
+
up-front one, so the thing it gives up is the natural bound on how
|
|
49
|
+
many times a granted tool runs. A ten-pass pipeline reading
|
|
50
|
+
attacker-controlled web pages is exactly where an injected loop would
|
|
51
|
+
spend that authority, and where nobody is watching it happen.
|
|
52
|
+
|
|
53
|
+
ONE instance per pipeline run, shared across all ten passes BY
|
|
54
|
+
REFERENCE -- a budget rebuilt per pass would multiply the ceiling by
|
|
55
|
+
ten and read as if it were enforcing one.
|
|
56
|
+
|
|
57
|
+
Exhaustion is not a failure: take() returning False means the grant
|
|
58
|
+
stops applying, so the call falls back to being ASKED. With a provider
|
|
59
|
+
present the run continues under supervision; without one it is denied,
|
|
60
|
+
which is what a headless run does with any gated tool anyway.
|
|
61
|
+
"""
|
|
62
|
+
|
|
63
|
+
def __init__(self, limit: int) -> None:
|
|
64
|
+
self.limit = limit
|
|
65
|
+
self.used = 0
|
|
66
|
+
|
|
67
|
+
def take(self) -> bool:
|
|
68
|
+
"""Consume one unit. False when the ceiling is reached."""
|
|
69
|
+
if self.used >= self.limit:
|
|
70
|
+
return False
|
|
71
|
+
self.used += 1
|
|
72
|
+
return True
|
|
73
|
+
|
|
74
|
+
@property
|
|
75
|
+
def exhausted(self) -> bool:
|
|
76
|
+
return self.used >= self.limit
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
@dataclass
|
|
80
|
+
class RunAuthorization:
|
|
81
|
+
"""Everything a run needs to answer "may this gated call proceed?".
|
|
82
|
+
|
|
83
|
+
Bundled rather than passed as three parameters because it threads
|
|
84
|
+
through four layers -- shell, orchestrator, pass entry point, loop --
|
|
85
|
+
and three of those only forward it. A bundle means adding a fourth
|
|
86
|
+
kind of authorization later touches the layers that USE it, not every
|
|
87
|
+
layer it passes through.
|
|
88
|
+
|
|
89
|
+
granted_tools: names authorised before the run. Only meaningful for
|
|
90
|
+
tools the registry reports as grantable; the loop re-checks rather
|
|
91
|
+
than trusting the set, so a stale or hand-edited name cannot widen
|
|
92
|
+
anything.
|
|
93
|
+
provider: a core.interaction.ResponseChannel, present iff someone can
|
|
94
|
+
be asked during the run. §23 replaced ApprovalProvider here; the
|
|
95
|
+
field name stays because its role in the bundle is unchanged.
|
|
96
|
+
budget: shared across every pass of one pipeline run.
|
|
97
|
+
"""
|
|
98
|
+
|
|
99
|
+
granted_tools: set = field(default_factory=set)
|
|
100
|
+
provider: Optional["ResponseChannel"] = None
|
|
101
|
+
budget: Optional[GrantBudget] = None
|
|
102
|
+
# Calls that proceeded on the grant, accumulated across every pass of
|
|
103
|
+
# one run. Lives here rather than in module state or a per-pass return
|
|
104
|
+
# value for the same reason the budget does: the bundle is already
|
|
105
|
+
# shared by reference, and what the authorization was SPENT ON is
|
|
106
|
+
# authorization state. The orchestrator points PipelineRun.granted_calls
|
|
107
|
+
# at THIS SAME LIST at the start of the run, so the trail is on the run
|
|
108
|
+
# at every §5 checkpoint and on the failure path.
|
|
109
|
+
#
|
|
110
|
+
# Not a copy taken at the end -- this comment used to say it was, which
|
|
111
|
+
# is the design §25 rejected and the opposite of what the code does
|
|
112
|
+
# (audit #83). Copying at the end would lose the trail on exactly the
|
|
113
|
+
# runs most worth auditing; unit 9 mutated the share into `list(...)`
|
|
114
|
+
# and it went red.
|
|
115
|
+
granted_calls: list = field(default_factory=list)
|