opentine 0.1.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.
- opentine-0.1.0/.claude/settings.local.json +24 -0
- opentine-0.1.0/.env.example +25 -0
- opentine-0.1.0/.github/workflows/ci.yml +37 -0
- opentine-0.1.0/.gitignore +45 -0
- opentine-0.1.0/AUDIT_REPORT.md +306 -0
- opentine-0.1.0/LICENSE +190 -0
- opentine-0.1.0/PKG-INFO +271 -0
- opentine-0.1.0/README.md +232 -0
- opentine-0.1.0/examples/cross_model.py +55 -0
- opentine-0.1.0/examples/demo_research.py +128 -0
- opentine-0.1.0/examples/forked_debug.py +121 -0
- opentine-0.1.0/examples/live_demo.py +112 -0
- opentine-0.1.0/opentine/__init__.py +8 -0
- opentine-0.1.0/opentine/cli.py +361 -0
- opentine-0.1.0/opentine/core.py +250 -0
- opentine-0.1.0/opentine/models/__init__.py +1 -0
- opentine-0.1.0/opentine/models/anthropic.py +137 -0
- opentine-0.1.0/opentine/models/compat.py +173 -0
- opentine-0.1.0/opentine/models/google.py +180 -0
- opentine-0.1.0/opentine/models/ollama.py +149 -0
- opentine-0.1.0/opentine/models/openai.py +177 -0
- opentine-0.1.0/opentine/tools/__init__.py +24 -0
- opentine-0.1.0/opentine/tools/fs.py +49 -0
- opentine-0.1.0/opentine/tools/python.py +42 -0
- opentine-0.1.0/opentine/tools/search.py +89 -0
- opentine-0.1.0/opentine/tools/shell.py +53 -0
- opentine-0.1.0/opentine/tools/web.py +37 -0
- opentine-0.1.0/pyproject.toml +64 -0
- opentine-0.1.0/tests/__init__.py +0 -0
- opentine-0.1.0/tests/conftest.py +5 -0
- opentine-0.1.0/tests/test_core.py +283 -0
- opentine-0.1.0/tests/test_live.py +175 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"permissions": {
|
|
3
|
+
"allow": [
|
|
4
|
+
"Bash(gh auth:*)",
|
|
5
|
+
"Bash(uv --version)",
|
|
6
|
+
"Bash(gh repo:*)",
|
|
7
|
+
"Bash(uv sync:*)",
|
|
8
|
+
"Bash(uv pip:*)",
|
|
9
|
+
"Bash(uv run:*)",
|
|
10
|
+
"Bash(grep -n '\\\\\\\\\\\\\\\\u25' opentine/cli.py)",
|
|
11
|
+
"Bash(grep -n '\\\\\\\\\\\\\\\\u271' opentine/cli.py)",
|
|
12
|
+
"Bash(grep -c '^$' opentine/core.py)",
|
|
13
|
+
"WebFetch(domain:howborisusesclaudecode.com)",
|
|
14
|
+
"WebSearch",
|
|
15
|
+
"WebFetch(domain:venturebeat.com)",
|
|
16
|
+
"WebFetch(domain:www.infoq.com)",
|
|
17
|
+
"Bash(.venv/Scripts/python.exe:*)",
|
|
18
|
+
"Bash(gh api:*)",
|
|
19
|
+
"Bash(gh run:*)",
|
|
20
|
+
"Bash(KIMI_API_KEY=\"sk-kimi-eU8szENNO6uPV0bsRtRChS8Iz5l6jOUoleYItznTGD369wAFiYLArKo2C5Eu9lnK\" uv run python test_kimi.py)",
|
|
21
|
+
"Bash(uv build:*)"
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Model provider API keys (set the ones you want to use)
|
|
2
|
+
ANTHROPIC_API_KEY=
|
|
3
|
+
OPENAI_API_KEY=
|
|
4
|
+
GOOGLE_API_KEY=
|
|
5
|
+
OLLAMA_HOST=http://localhost:11434
|
|
6
|
+
|
|
7
|
+
# OpenAI-compatible providers (use any one)
|
|
8
|
+
KIMI_API_KEY=
|
|
9
|
+
DEEPSEEK_API_KEY=
|
|
10
|
+
QWEN_API_KEY=
|
|
11
|
+
GLM_API_KEY=
|
|
12
|
+
GROQ_API_KEY=
|
|
13
|
+
TOGETHER_API_KEY=
|
|
14
|
+
MISTRAL_API_KEY=
|
|
15
|
+
|
|
16
|
+
# Or point the OpenAI adapter at any compatible endpoint
|
|
17
|
+
OPENAI_BASE_URL=
|
|
18
|
+
|
|
19
|
+
# Search provider (optional — pick one)
|
|
20
|
+
TAVILY_API_KEY=
|
|
21
|
+
EXA_API_KEY=
|
|
22
|
+
BRAVE_API_KEY=
|
|
23
|
+
|
|
24
|
+
# Proxy for web tools (optional)
|
|
25
|
+
HTTP_PROXY=
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
runs-on: ${{ matrix.os }}
|
|
12
|
+
strategy:
|
|
13
|
+
matrix:
|
|
14
|
+
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
15
|
+
python-version: ["3.11", "3.12", "3.13"]
|
|
16
|
+
fail-fast: false
|
|
17
|
+
|
|
18
|
+
steps:
|
|
19
|
+
- uses: actions/checkout@v4
|
|
20
|
+
|
|
21
|
+
- name: Install uv
|
|
22
|
+
uses: astral-sh/setup-uv@v4
|
|
23
|
+
|
|
24
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
25
|
+
run: uv python install ${{ matrix.python-version }}
|
|
26
|
+
|
|
27
|
+
- name: Install dependencies
|
|
28
|
+
run: uv sync --extra dev
|
|
29
|
+
|
|
30
|
+
- name: Lint with ruff
|
|
31
|
+
run: uv run ruff check .
|
|
32
|
+
|
|
33
|
+
- name: Format check with ruff
|
|
34
|
+
run: uv run ruff format --check .
|
|
35
|
+
|
|
36
|
+
- name: Run tests
|
|
37
|
+
run: uv run pytest tests/test_core.py -v
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
*.egg-info/
|
|
7
|
+
*.egg
|
|
8
|
+
dist/
|
|
9
|
+
build/
|
|
10
|
+
|
|
11
|
+
# Virtual environments
|
|
12
|
+
.venv/
|
|
13
|
+
venv/
|
|
14
|
+
env/
|
|
15
|
+
|
|
16
|
+
# uv
|
|
17
|
+
uv.lock
|
|
18
|
+
|
|
19
|
+
# Environment
|
|
20
|
+
.env
|
|
21
|
+
.env.*
|
|
22
|
+
!.env.example
|
|
23
|
+
|
|
24
|
+
# IDE
|
|
25
|
+
.vscode/
|
|
26
|
+
.idea/
|
|
27
|
+
*.swp
|
|
28
|
+
*.swo
|
|
29
|
+
*~
|
|
30
|
+
|
|
31
|
+
# Ruff
|
|
32
|
+
.ruff_cache/
|
|
33
|
+
|
|
34
|
+
# opentine run files
|
|
35
|
+
*.tine
|
|
36
|
+
.tine_runs/
|
|
37
|
+
|
|
38
|
+
# OS
|
|
39
|
+
.DS_Store
|
|
40
|
+
Thumbs.db
|
|
41
|
+
|
|
42
|
+
# Testing
|
|
43
|
+
.pytest_cache/
|
|
44
|
+
.coverage
|
|
45
|
+
htmlcov/
|
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
# opentine Unified Audit Report
|
|
2
|
+
|
|
3
|
+
**Date:** 2026-04-09
|
|
4
|
+
**Version:** 0.1.0
|
|
5
|
+
**Methodology:** Boris Cherny's parallel specialized agent workflow
|
|
6
|
+
**Audit Teams:** 6 independent agents, each focused on one concern
|
|
7
|
+
**Scope:** Full codebase at `C:/Users/Atlas/Documents/Github/opentine/`
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Executive Summary
|
|
12
|
+
|
|
13
|
+
| Audit Team | Score | Critical | High | Medium | Low |
|
|
14
|
+
|---|---|---|---|---|---|
|
|
15
|
+
| 1. Core Architecture | 6.5/10 | 1 | 4 | 10 | 9 |
|
|
16
|
+
| 2. Security | -- | 3 | 5 | 7 | 5 |
|
|
17
|
+
| 3. Model Adapters | 5.8/10 | 0 | 0 | 0 | 0 |
|
|
18
|
+
| 4. CLI & UX | 5.5/10 | 0 | 3 | 9 | 12 |
|
|
19
|
+
| 5. Test Coverage | ~11% | 2 | 4 | 4 | 0 |
|
|
20
|
+
| 6. Packaging | 64% ready | 0 | 2 | 4 | 7 |
|
|
21
|
+
| **TOTAL** | | **6** | **18** | **34** | **33** |
|
|
22
|
+
|
|
23
|
+
**Overall Assessment: The core design is elegant and the codebase is impressively compact, but opentine has fundamental issues that would prevent real-world use.** The tool-use round-trip is broken across all model adapters, security vulnerabilities exist in all tool modules, test coverage is ~11%, and the CLI has rendering bugs that contradict the README.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## CRITICAL Findings (6)
|
|
28
|
+
|
|
29
|
+
### C1. Tool-Use Round-Trip is Fundamentally Broken
|
|
30
|
+
**Source:** Architecture Audit, Model Adapter Audit
|
|
31
|
+
**Files:** `core.py:253-261`, all model adapters
|
|
32
|
+
**Impact:** Agent tool calling will fail with API errors for Anthropic, OpenAI, and Google
|
|
33
|
+
|
|
34
|
+
The Agent runtime does not propagate `tool_call_id` / `tool_use_id` from model responses into tool result messages. It sends `{"role": "tool", "content": result_str, "name": tname}` without the provider-specific ID. Additionally, the assistant message containing `tool_use` / `tool_calls` blocks is never appended to the conversation — only the text content is. Both Anthropic and OpenAI APIs require these for multi-turn tool conversations. **This means any agent workflow involving tool calls will fail.**
|
|
35
|
+
|
|
36
|
+
### C2. Unrestricted Shell Execution with Bypassable Allowlist
|
|
37
|
+
**Source:** Security Audit
|
|
38
|
+
**File:** `tools/shell.py:8-33`
|
|
39
|
+
**Impact:** Full host compromise
|
|
40
|
+
|
|
41
|
+
`shell=True` with a first-token allowlist check that is trivially bypassable via `;`, `&&`, `|`, `$()`, backticks. The subprocess inherits all env vars (including API keys), filesystem, and network access. An agent (or prompt injection via tool output) can execute arbitrary OS commands.
|
|
42
|
+
|
|
43
|
+
### C3. Arbitrary Python Code Execution Without Isolation
|
|
44
|
+
**Source:** Security Audit
|
|
45
|
+
**File:** `tools/python.py:11-32`
|
|
46
|
+
**Impact:** Full host compromise
|
|
47
|
+
|
|
48
|
+
Despite the docstring claiming "real isolation," the subprocess runs with the same user, filesystem, network, and environment variables (including all API keys). No sandboxing exists.
|
|
49
|
+
|
|
50
|
+
### C4. Indirect Prompt Injection via Tool Outputs
|
|
51
|
+
**Source:** Security Audit
|
|
52
|
+
**File:** `core.py:253-261`
|
|
53
|
+
**Impact:** Full host compromise (via chaining with C2/C3)
|
|
54
|
+
|
|
55
|
+
Tool outputs (from web.fetch, search, etc.) are passed directly into the conversation as tool messages. If a fetched page contains adversarial instructions, the model may follow them, leading to shell execution or API key exfiltration. This is the primary attack vector that chains all other vulnerabilities together.
|
|
56
|
+
|
|
57
|
+
### C5. OpenAI Adapter Fails on Tool Result Messages
|
|
58
|
+
**Source:** Architecture Audit
|
|
59
|
+
**File:** `models/openai.py:64-69`
|
|
60
|
+
**Impact:** Complete OpenAI tool-use failure
|
|
61
|
+
|
|
62
|
+
The OpenAI adapter uses `m.get("name", "")` as `tool_call_id`, which won't match the ID from the assistant's `tool_calls` response. OpenAI's API will return 400 errors on every tool-result round-trip.
|
|
63
|
+
|
|
64
|
+
### C6. Tool Results Not Stored in Step Outputs
|
|
65
|
+
**Source:** Architecture Audit
|
|
66
|
+
**File:** `core.py:253-261`
|
|
67
|
+
**Impact:** Defeats core value proposition
|
|
68
|
+
|
|
69
|
+
When a tool is called, the result is appended to `messages` but never stored in the step's `outputs` dict. The run tree captures *what was called* but not *what was returned*. For replay and debugging — the core value proposition — this is a fundamental omission. The `outputs` field on Step exists but is always empty for tool steps.
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## HIGH Findings (18)
|
|
74
|
+
|
|
75
|
+
### H1. Duplicate Run IDs Cause Silent Overwrites
|
|
76
|
+
**Source:** Architecture Audit
|
|
77
|
+
**File:** `core.py:224`, `cli.py:124`
|
|
78
|
+
|
|
79
|
+
Two runs with the same prompt generate the same deterministic run ID. The CLI saves to `{run.id}.tine`, silently overwriting previous runs. For "git for agent runs," this is a significant gap.
|
|
80
|
+
|
|
81
|
+
### H2. The "Tree" is Actually a Linear Chain
|
|
82
|
+
**Source:** Architecture Audit
|
|
83
|
+
**File:** `core.py:65-87`
|
|
84
|
+
|
|
85
|
+
`add_step()` defaults to chaining each step to the previous one. There is no API to branch within a single run. The data structure supports trees but the runtime produces chains.
|
|
86
|
+
|
|
87
|
+
### H3. Unrestricted SSRF via web.fetch()
|
|
88
|
+
**Source:** Security Audit
|
|
89
|
+
**File:** `tools/web.py:12-37`
|
|
90
|
+
|
|
91
|
+
No URL validation. An agent can access cloud metadata endpoints (169.254.169.254), scan internal networks, or hit localhost services. `follow_redirects=True` bypasses any future URL filtering.
|
|
92
|
+
|
|
93
|
+
### H4. API Keys Accessible to Agent-Executed Code
|
|
94
|
+
**Source:** Security Audit
|
|
95
|
+
**Files:** All model adapters, `tools/python.py`, `tools/shell.py`
|
|
96
|
+
|
|
97
|
+
All API keys from environment variables are inherited by `python.execute()` and `shell.run()` subprocesses. Agent-generated code can trivially exfiltrate them.
|
|
98
|
+
|
|
99
|
+
### H5. Filesystem Sandbox `startswith` Bypass
|
|
100
|
+
**Source:** Security Audit, Architecture Audit
|
|
101
|
+
**File:** `tools/fs.py:9-15`
|
|
102
|
+
|
|
103
|
+
`str(resolved).startswith(str(base))` can be bypassed: a path resolving to `/home/user/project_evil/` passes the check for base `/home/user/project`. On Windows, case differences (`C:\` vs `c:\`) can also bypass it.
|
|
104
|
+
|
|
105
|
+
### H6. Agent Can Manipulate Its Own Run Tree
|
|
106
|
+
**Source:** Security Audit
|
|
107
|
+
**File:** `core.py:200-268`
|
|
108
|
+
|
|
109
|
+
The agent's tools have full filesystem access, so it can overwrite its own `.tine` file, read other runs' histories, or modify files that affect subsequent operations.
|
|
110
|
+
|
|
111
|
+
### H7. CLI `tine run` Has No Exception Handling
|
|
112
|
+
**Source:** CLI Audit
|
|
113
|
+
**File:** `cli.py:106`
|
|
114
|
+
|
|
115
|
+
`spec.loader.exec_module(mod)` has no try/except. Script errors dump raw Python tracebacks with no branded error message. This is the most common failure mode.
|
|
116
|
+
|
|
117
|
+
### H8. Zero Error Handling in All Model Adapters
|
|
118
|
+
**Source:** Model Adapter Audit
|
|
119
|
+
**Files:** All model adapters
|
|
120
|
+
|
|
121
|
+
No try/except, no retry logic, no handling of rate limits (429), auth errors, or timeouts in any adapter. A single transient network error crashes the entire run with an unhandled exception.
|
|
122
|
+
|
|
123
|
+
### H9. Streaming is Text-Only Across All Adapters
|
|
124
|
+
**Source:** Model Adapter Audit
|
|
125
|
+
**Files:** All model adapters
|
|
126
|
+
|
|
127
|
+
Tool calls, thinking blocks, usage data, and stop reasons are invisible during streaming. Google and Ollama don't even pass tool definitions in stream requests. Streaming is unusable for agentic workflows.
|
|
128
|
+
|
|
129
|
+
### H10. `supports_thinking` Declared but Never Activated
|
|
130
|
+
**Source:** Model Adapter Audit
|
|
131
|
+
**Files:** All model adapters
|
|
132
|
+
|
|
133
|
+
All adapters expose the property but none actually enable thinking/reasoning in API calls (Anthropic's `thinking` parameter, OpenAI's `reasoning_effort`, etc.). The property is decorative.
|
|
134
|
+
|
|
135
|
+
### H11. No Tests for Security-Critical fs.py Sandbox
|
|
136
|
+
**Source:** Test Coverage Audit
|
|
137
|
+
**File:** `tools/fs.py`
|
|
138
|
+
|
|
139
|
+
The path traversal sandbox (`_resolve()`) has zero tests. This is a security boundary with known bypass vectors and no coverage.
|
|
140
|
+
|
|
141
|
+
### H12. No Tests for shell.py Allowlist
|
|
142
|
+
**Source:** Test Coverage Audit
|
|
143
|
+
**File:** `tools/shell.py`
|
|
144
|
+
|
|
145
|
+
The allowlist check (`command.split()[0]`) is trivially bypassable and has zero tests.
|
|
146
|
+
|
|
147
|
+
### H13. No Tests for Any Model Adapter
|
|
148
|
+
**Source:** Test Coverage Audit
|
|
149
|
+
**Files:** `models/*.py`
|
|
150
|
+
|
|
151
|
+
All four adapters have complex message conversion, tool schema translation, and response parsing with zero test coverage. These are testable with mocked SDK clients.
|
|
152
|
+
|
|
153
|
+
### H14. `tine run` Can't Handle Async Scripts
|
|
154
|
+
**Source:** CLI Audit
|
|
155
|
+
**File:** `cli.py:109-115`
|
|
156
|
+
|
|
157
|
+
The CLI scans `dir(mod)` for `isinstance(obj, Run)`, but `agent.run()` returns a coroutine, not a Run. Only `agent.run_sync()` works. This is undocumented and the README quickstart uses the broken `agent.run()` form.
|
|
158
|
+
|
|
159
|
+
### H15. README Quickstart is Broken
|
|
160
|
+
**Source:** CLI Audit
|
|
161
|
+
**File:** `README.md`
|
|
162
|
+
|
|
163
|
+
The quickstart uses `run = agent.run("...")` which returns a coroutine, not a Run. Should be `agent.run_sync()`. The README also shows Unicode icons the CLI cannot produce, a duration field the code doesn't render, and `--from N` instead of the actual `--from-step N`.
|
|
164
|
+
|
|
165
|
+
### H16. Cost Tracking is Incomplete and Misleading
|
|
166
|
+
**Source:** Model Adapter Audit
|
|
167
|
+
|
|
168
|
+
Anthropic/OpenAI have single hardcoded price points ignoring model tiers, cached tokens, and thinking tokens. Google returns 0.0. Costs will be silently wrong when switching between models.
|
|
169
|
+
|
|
170
|
+
### H17. No PyPI Publish Workflow
|
|
171
|
+
**Source:** Packaging Audit
|
|
172
|
+
**File:** `.github/workflows/ci.yml`
|
|
173
|
+
|
|
174
|
+
CI only tests. No workflow for building wheels or publishing to PyPI. No trusted publisher setup. Blocks automated releases.
|
|
175
|
+
|
|
176
|
+
### H18. `<5 MB` Install Claim is Inaccurate
|
|
177
|
+
**Source:** Packaging Audit
|
|
178
|
+
**File:** `README.md`
|
|
179
|
+
|
|
180
|
+
Rich alone (with pygments) is ~5-6 MB. With httpx's dependency tree, the realistic core install is ~8-9 MB. The README comparison table claims <5 MB.
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
## MEDIUM Findings (34)
|
|
185
|
+
|
|
186
|
+
| # | Finding | Source | File |
|
|
187
|
+
|---|---|---|---|
|
|
188
|
+
| M1 | Hash truncation to 12 hex chars (48 bits) — collision risk at ~16M steps | Architecture | `core.py:39-42` |
|
|
189
|
+
| M2 | No protection against duplicate step IDs in a run | Architecture | `core.py:65-87` |
|
|
190
|
+
| M3 | No validation on `from_step_id` in `fork()` — empty runs silently created | Architecture | `core.py:115-127` |
|
|
191
|
+
| M4 | `dict[str, Any]` in inputs/outputs — unserialized types fail at save time only | Architecture | `core.py:31-32` |
|
|
192
|
+
| M5 | No schema versioning in serialized `.tine` format | Architecture | `core.py:55-63` |
|
|
193
|
+
| M6 | Large runs (10k+) — O(n^2) ancestors(), single-blob serialization | Architecture | `core.py` |
|
|
194
|
+
| M7 | Multiple tool calls create broken parent chain (siblings become chain) | Architecture | `core.py:253-261` |
|
|
195
|
+
| M8 | `run_sync()` fails inside existing event loops (Jupyter, async frameworks) | Architecture | `core.py:267-268` |
|
|
196
|
+
| M9 | No error handling contract in Model Protocol | Architecture | `core.py:152-174` |
|
|
197
|
+
| M10 | Protocol lacks `max_tokens` / `max_output_tokens` parameter | Architecture | `core.py:152-174` |
|
|
198
|
+
| M11 | Tavily API key sent in request body (logged by proxies) | Security | `tools/search.py:26-28` |
|
|
199
|
+
| M12 | API keys stored as plain instance attributes | Security | All model adapters |
|
|
200
|
+
| M13 | No `.tine` file integrity verification (no HMAC/signature) | Security | `core.py:134-136` |
|
|
201
|
+
| M14 | System prompt exposed in `.tine` files | Security | `core.py:60` |
|
|
202
|
+
| M15 | Error messages leak internal state to model | Security | `core.py:259` |
|
|
203
|
+
| M16 | No tool output size limits | Security | `core.py:257` |
|
|
204
|
+
| M17 | Ollama host SSRF via configurable `OLLAMA_HOST` | Security | `models/ollama.py:17` |
|
|
205
|
+
| M18 | Google adapter: `resp.text` can raise if response has only function calls | Model Adapters | `models/google.py` |
|
|
206
|
+
| M19 | Google adapter: tools not passed in streaming request | Model Adapters | `models/google.py` |
|
|
207
|
+
| M20 | Google adapter: tool results sent as plain text, not function_response | Model Adapters | `models/google.py` |
|
|
208
|
+
| M21 | OpenAI: `temperature=0.0` causes API error for o-series models | Model Adapters | `models/openai.py` |
|
|
209
|
+
| M22 | Ollama: `supports_tools=True` unconditionally (not all models support it) | Model Adapters | `models/ollama.py` |
|
|
210
|
+
| M23 | Ollama: new httpx client per request (no connection reuse) | Model Adapters | `models/ollama.py` |
|
|
211
|
+
| M24 | CLI `str(label)` bug strips all icon colors from tree rendering | CLI | `cli.py:158` |
|
|
212
|
+
| M25 | No handling for corrupt `.tine` files in show/fork/replay/diff/resume | CLI | `cli.py` |
|
|
213
|
+
| M26 | `_find_run` creates `.tine_runs` dir as side effect on read operations | CLI | `cli.py` |
|
|
214
|
+
| M27 | `tine diff` uses naive positional comparison, no alignment algorithm | CLI | `cli.py` |
|
|
215
|
+
| M28 | `tine fork --save` silently overwrites existing files | CLI | `cli.py` |
|
|
216
|
+
| M29 | Blaze Orange on light terminals is low contrast | CLI | `cli.py` |
|
|
217
|
+
| M30 | `force_terminal=True` produces ANSI codes when piping to files | CLI | `cli.py:37` |
|
|
218
|
+
| M31 | No dev/test dependency group in pyproject.toml | Packaging | `pyproject.toml` |
|
|
219
|
+
| M32 | `[ollama]` extra installs unused package (adapter uses httpx directly) | Packaging | `pyproject.toml`, `models/ollama.py` |
|
|
220
|
+
| M33 | Mermaid diagrams won't render on PyPI page | Packaging | `README.md` |
|
|
221
|
+
| M34 | fs.py startswith check: Windows case sensitivity issue | Packaging | `tools/fs.py:14` |
|
|
222
|
+
|
|
223
|
+
---
|
|
224
|
+
|
|
225
|
+
## Test Coverage Summary
|
|
226
|
+
|
|
227
|
+
**Estimated Overall Coverage: ~11%**
|
|
228
|
+
|
|
229
|
+
| Module | Lines | Coverage |
|
|
230
|
+
|---|---|---|
|
|
231
|
+
| `core.py` | 269 | ~56% |
|
|
232
|
+
| `cli.py` | 362 | 0% |
|
|
233
|
+
| `models/anthropic.py` | 124 | 0% |
|
|
234
|
+
| `models/openai.py` | 142 | 0% |
|
|
235
|
+
| `models/google.py` | 131 | 0% |
|
|
236
|
+
| `models/ollama.py` | 112 | 0% |
|
|
237
|
+
| `tools/fs.py` | 50 | 0% |
|
|
238
|
+
| `tools/shell.py` | 34 | 0% |
|
|
239
|
+
| `tools/python.py` | 33 | 0% |
|
|
240
|
+
| `tools/search.py` | 90 | 0% |
|
|
241
|
+
| `tools/web.py` | 38 | 0% |
|
|
242
|
+
| **TOTAL** | **~1,385** | **~11%** |
|
|
243
|
+
|
|
244
|
+
---
|
|
245
|
+
|
|
246
|
+
## Model Adapter Parity Matrix
|
|
247
|
+
|
|
248
|
+
| Feature | Anthropic | OpenAI | Google | Ollama |
|
|
249
|
+
|---|---|---|---|---|
|
|
250
|
+
| Basic completion | Yes | Yes | Yes | Yes |
|
|
251
|
+
| Basic streaming | Yes | Yes | Yes | Yes |
|
|
252
|
+
| Tool definitions | Yes | Yes | Yes | Yes |
|
|
253
|
+
| Tool call parsing | Yes | Yes | Yes | Yes |
|
|
254
|
+
| Tool result format | BROKEN | BROKEN | BROKEN | Partial |
|
|
255
|
+
| Streaming tool calls | No | No | No | No |
|
|
256
|
+
| Cost tracking | Partial | Partial | None | N/A |
|
|
257
|
+
| Error handling | None | None | None | Minimal |
|
|
258
|
+
| max_tokens config | Hardcoded | None | None | None |
|
|
259
|
+
| Thinking activation | No | No | No | N/A |
|
|
260
|
+
|
|
261
|
+
---
|
|
262
|
+
|
|
263
|
+
## PyPI Readiness
|
|
264
|
+
|
|
265
|
+
**Score: 64% — NOT READY**
|
|
266
|
+
|
|
267
|
+
**Pass:** 18/28 checks
|
|
268
|
+
**Fail:** 8/28 (no publish workflow, test deps not declared, install size claim inaccurate, unused ollama dep, no `__main__.py`, Mermaid won't render, `[all]` extras copy-pasted, no trusted publisher)
|
|
269
|
+
**Unknown:** 2/28 (PyPI name availability, test passing confirmation)
|
|
270
|
+
|
|
271
|
+
---
|
|
272
|
+
|
|
273
|
+
## Priority Ranking: Top 10 Actions
|
|
274
|
+
|
|
275
|
+
| # | Action | Severity | Effort | Impact |
|
|
276
|
+
|---|---|---|---|---|
|
|
277
|
+
| 1 | Fix tool_call_id/tool_use_id threading in Agent runtime | CRITICAL | Medium | Unblocks all tool-use functionality |
|
|
278
|
+
| 2 | Store tool results in step outputs | CRITICAL | Low | Enables replay/diff of what actually happened |
|
|
279
|
+
| 3 | Fix assistant message propagation (include tool_calls blocks) | CRITICAL | Medium | Required for multi-turn tool conversations |
|
|
280
|
+
| 4 | Add sandbox to shell.py (shell=False, proper allowlist) | CRITICAL | Medium | Prevents host compromise |
|
|
281
|
+
| 5 | Add isolation to python.py (clear env vars at minimum) | CRITICAL | Low | Prevents API key exfiltration |
|
|
282
|
+
| 6 | Fix `_resolve()` sandbox (use `relative_to()` not `startswith`) | HIGH | Low | Prevents path traversal |
|
|
283
|
+
| 7 | Add URL validation to web.fetch (block private IPs) | HIGH | Low | Prevents SSRF |
|
|
284
|
+
| 8 | Fix CLI `str(label)` rendering bug | MEDIUM | Low | Icons render in color as designed |
|
|
285
|
+
| 9 | Fix README to match actual CLI output | MEDIUM | Low | Prevents user confusion |
|
|
286
|
+
| 10 | Add model adapter tests with mocked SDK clients | HIGH | Medium | Catches message conversion bugs |
|
|
287
|
+
|
|
288
|
+
---
|
|
289
|
+
|
|
290
|
+
## Methodology Notes
|
|
291
|
+
|
|
292
|
+
This audit followed Boris Cherny's (creator of Claude Code) workflow patterns:
|
|
293
|
+
|
|
294
|
+
- **6 parallel specialized agents** — each focused on a single concern with no overlap
|
|
295
|
+
- **Verification-first** — each agent read actual source code with line numbers, no assumptions
|
|
296
|
+
- **Grilling, not accepting** — agents challenged every design decision
|
|
297
|
+
- **Assessment only** — no fixes applied, findings documented for prioritized remediation
|
|
298
|
+
- **Structured findings** — severity-rated, actionable, with exact file:line references
|
|
299
|
+
|
|
300
|
+
Sources:
|
|
301
|
+
- [howborisusesclaudecode.com](https://howborisusesclaudecode.com)
|
|
302
|
+
- [Boris Cherny on X](https://x.com/bcherny/status/2007179832300581177)
|
|
303
|
+
|
|
304
|
+
---
|
|
305
|
+
|
|
306
|
+
*Generated by 6 parallel audit agents on 2026-04-09*
|
opentine-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to the Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by the Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding any notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
Copyright 2025 opentine contributors
|
|
179
|
+
|
|
180
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
181
|
+
you may not use this file except in compliance with the License.
|
|
182
|
+
You may obtain a copy of the License at
|
|
183
|
+
|
|
184
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
185
|
+
|
|
186
|
+
Unless required by applicable law or agreed to in writing, software
|
|
187
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
188
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
189
|
+
See the License for the specific language governing permissions and
|
|
190
|
+
limitations under the License.
|