Skip to content

Commit 9e4de82

Browse files
feat: address PR review comments on validation framework
- Add data collection disclosure to README.md with opt-out instructions - Remove `load_dotenv` and dead path resolution from `batch_validate.py` - Remove duplicate `ALTIMATE_CLI_*` build constants from `build.ts` - Extract `resolvePrompt` helper in `session.ts` covering both `prompt` and `prompt_async` routes with deterministic `/validate` prefix check - Remove double `.trimStart()` in `resolvePrompt` - Remove Langfuse reference from `SKILL.md` comment - Replace `uv run --with python-dotenv` with `uv run --with requests` in all `SKILL.md` invocation examples Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 9372bee commit 9e4de82

File tree

5 files changed

+39
-38
lines changed

5 files changed

+39
-38
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,20 @@ Full docs at **[altimate-code.sh](https://altimate-code.sh)**.
157157
- [Agent Modes](https://altimate-code.sh/data-engineering/agent-modes/)
158158
- [Configuration](https://altimate-code.sh/configure/model-providers/)
159159
160+
## Data Collection
161+
162+
Altimate Code logs conversation turns (prompt, tool calls, and assistant response) to improve validation quality and agent behavior. Logs are sent to Altimate's backend and are not shared with third parties.
163+
164+
**To opt out:**
165+
166+
```bash
167+
export ALTIMATE_LOGGER_DISABLED=true
168+
```
169+
170+
Add it to your shell profile (`~/.zshrc`, `~/.bashrc`) to make it permanent.
171+
172+
See [`docs/docs/configure/logging.md`](docs/docs/configure/logging.md) for details on what is collected.
173+
160174
## Community & Contributing
161175
162176
- **Issues**: [GitHub Issues](https://github.com/AltimateAI/altimate-code/issues)

packages/opencode/script/build.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,11 +223,8 @@ for (const item of targets) {
223223
OPENCODE_CHANNEL: `'${Script.channel}'`,
224224
ALTIMATE_ENGINE_VERSION: `'${engineVersion}'`,
225225
OPENCODE_LIBC: item.os === "linux" ? `'${item.abi ?? "glibc"}'` : "undefined",
226-
ALTIMATE_CLI_LIBC: item.os === "linux" ? `'${item.abi ?? "glibc"}'` : "undefined",
227226
OPENCODE_MIGRATIONS: JSON.stringify(migrations),
228-
ALTIMATE_CLI_MIGRATIONS: JSON.stringify(migrations),
229227
OPENCODE_CHANGELOG: JSON.stringify(changelog),
230-
ALTIMATE_CLI_CHANGELOG: JSON.stringify(changelog),
231228
ALTIMATE_VALIDATE_SKILL_MD: JSON.stringify(validateSkillMd),
232229
ALTIMATE_VALIDATE_BATCH_PY: JSON.stringify(validateBatchPy),
233230
OTUI_TREE_SITTER_WORKER_PATH: bunfsRoot + workerRelativePath,

packages/opencode/src/server/routes/session.ts

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,25 @@ import { lazy } from "../../util/lazy"
1919

2020
const log = Log.create({ service: "server" })
2121

22+
function resolvePrompt(sessionID: string, body: Omit<SessionPrompt.PromptInput, "sessionID">) {
23+
const textPart = body.parts?.find((p: { type: string }) => p.type === "text")
24+
const text = (textPart && "text" in textPart ? (textPart.text as string) : "").trimStart()
25+
26+
if (text.startsWith("/validate")) {
27+
return SessionPrompt.command({
28+
sessionID,
29+
command: "validate",
30+
arguments: text.slice("/validate".length).trim(),
31+
model: body.model ? `${body.model.providerID}/${body.model.modelID}` : undefined,
32+
agent: body.agent,
33+
variant: body.variant,
34+
messageID: body.messageID,
35+
})
36+
}
37+
38+
return SessionPrompt.prompt({ ...body, sessionID })
39+
}
40+
2241
export const SessionRoutes = lazy(() =>
2342
new Hono()
2443
.get(
@@ -764,21 +783,7 @@ export const SessionRoutes = lazy(() =>
764783
const sessionID = c.req.valid("param").sessionID
765784
const body = c.req.valid("json")
766785

767-
const textPart = body.parts?.find((p: { type: string }) => p.type === "text")
768-
const textContent = textPart && "text" in textPart ? (textPart.text as string) : ""
769-
const isValidate = textContent.trimStart().startsWith("/validate")
770-
771-
const msg = isValidate
772-
? await SessionPrompt.command({
773-
sessionID,
774-
command: "validate",
775-
arguments: textContent.trimStart().slice("/validate".length).trim(),
776-
model: body.model ? `${body.model.providerID}/${body.model.modelID}` : undefined,
777-
agent: body.agent,
778-
variant: body.variant,
779-
messageID: body.messageID,
780-
})
781-
: await SessionPrompt.prompt({ ...body, sessionID })
786+
const msg = await resolvePrompt(sessionID, body)
782787

783788
stream.write(JSON.stringify(msg))
784789
})
@@ -811,7 +816,7 @@ export const SessionRoutes = lazy(() =>
811816
return stream(c, async () => {
812817
const sessionID = c.req.valid("param").sessionID
813818
const body = c.req.valid("json")
814-
SessionPrompt.prompt({ ...body, sessionID })
819+
resolvePrompt(sessionID, body)
815820
})
816821
},
817822
)

packages/opencode/src/skill/validate/SKILL.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@ VALIDATE_SCRIPT="$(find "$PROJECT_ROOT/.altimate-code/skills/validate" "$HOME/.a
4343
```
4444

4545
Parse `$ARGUMENTS` to determine the mode and construct the command:
46-
- If it contains `--session-id` → session mode: `uv run --with python-dotenv --with requests python "$VALIDATE_SCRIPT" --project-root "$PROJECT_ROOT" --session-id "<session_id>"`
47-
- If it contains `--from` → date range mode: `uv run --with python-dotenv --with requests python "$VALIDATE_SCRIPT" --project-root "$PROJECT_ROOT" --from-time "<from>" --to-time "<to>" --user-id "<user_id>"`
48-
- Otherwise → single trace ID: `uv run --with python-dotenv --with requests python "$VALIDATE_SCRIPT" --project-root "$PROJECT_ROOT" --trace-ids "$ARGUMENTS"`
46+
- If it contains `--session-id` → session mode: `uv run --with requests python "$VALIDATE_SCRIPT" --project-root "$PROJECT_ROOT" --session-id "<session_id>"`
47+
- If it contains `--from` → date range mode: `uv run --with requests python "$VALIDATE_SCRIPT" --project-root "$PROJECT_ROOT" --from-time "<from>" --to-time "<to>" --user-id "<user_id>"`
48+
- Otherwise → single trace ID: `uv run --with requests python "$VALIDATE_SCRIPT" --project-root "$PROJECT_ROOT" --trace-ids "$ARGUMENTS"`
4949

5050
Run the command using the Bash tool with `timeout: 3600000` (milliseconds) to allow up to ~60 minutes for long-running validations:
5151

5252
```bash
53-
uv run --with python-dotenv --with requests python "$VALIDATE_SCRIPT" --project-root "$PROJECT_ROOT" <appropriate_args>
53+
uv run --with requests python "$VALIDATE_SCRIPT" --project-root "$PROJECT_ROOT" <appropriate_args>
5454
```
5555

5656
**IMPORTANT**: Always pass `timeout: 3600000` to the Bash tool when running this command. The default 2-minute bash timeout is too short for validation jobs.

packages/opencode/src/skill/validate/batch_validate.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,17 @@
1616

1717
import argparse
1818
import json
19-
import os
2019
import sys
2120
from datetime import datetime, timezone
2221
from pathlib import Path
2322

2423
import requests
2524
from requests.adapters import HTTPAdapter
2625
from urllib3.util.retry import Retry
27-
from dotenv import load_dotenv
2826

2927
# ---------------------------------------------------------------------------
3028
# Path resolution
3129
# ---------------------------------------------------------------------------
32-
_script_dir = Path(__file__).resolve().parent
33-
34-
3530
def _find_altimate_dir():
3631
"""Find the .altimate-code directory.
3732
@@ -61,16 +56,6 @@ def _find_project_root(override=None):
6156

6257
_project_root = _find_project_root()
6358

64-
# ---------------------------------------------------------------------------
65-
# Environment loading
66-
# ---------------------------------------------------------------------------
67-
_altimate_dir = _find_altimate_dir()
68-
69-
if _altimate_dir:
70-
_env_path = _altimate_dir / ".env"
71-
if _env_path.exists():
72-
load_dotenv(_env_path)
73-
7459
# ---------------------------------------------------------------------------
7560
# Configuration
7661
# ---------------------------------------------------------------------------

0 commit comments

Comments
 (0)