diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 98e5a4ec..3706ad6b 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -30,6 +30,8 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 with: ref: ${{ inputs.tag || github.ref }} + # Releases use the gh CLI with GH_TOKEN; no later step needs git credentials. + persist-credentials: false - name: Validate tag and prepare workspace run: | python3 - <<'PY' diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index 5909a033..6a105bc7 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -13,6 +13,10 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - name: Check training data boundaries and assistant-target encoding run: python3 -m unittest discover -s training/tests -v + - name: Keep the repository light and free of credentials + run: | + python3 scripts/check_repo_weight.py + python3 scripts/secret_scan.py --all linux: runs-on: ubuntu-24.04 timeout-minutes: 60 diff --git a/AGENTS.md b/AGENTS.md index 4cdaa7ad..eec79567 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -7,8 +7,10 @@ shell commands or TOML edits. Never lose an unsent message after a connection er The reference target is Linux, GTX 1070 8 GB VRAM, and 16 GB RAM. Cloud CPU results do not establish that machine's performance. Retain CPU operation. Every live -model evaluation must explicitly use an uncensored/abliterated checkpoint, as -requested by the owner. Deterministic protocol fixtures have no model weights. +model evaluation must label its checkpoint truthfully with +`--artifact-label uncensored|standard|hosted` (owner direction 2026-10-08: uncensored, +abliterated, standard and hosted models are all first-class); uncensored/abliterated +checkpoints remain the default evaluation target. Deterministic protocol fixtures have no model weights. Use the existing checkout; do not create a worktree unless requested. In the cloud: diff --git a/CHANGELOG.md b/CHANGELOG.md index 85c38ad8..bed90123 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,175 @@ # Changelog +## Unreleased — 0.7 (work orders in docs/WORK_ORDERS_0.7.md) + +### A06 small-model edit robustness + +- `replace_file(path, new_text)` in the compact tool profiles: a checkpointed + whole-file rewrite of a file of at most 300 lines that the model read in full at + its current revision (bound to the full-file read handle). Whole-file edits are + the most reliable format for models under about 14B. +- `old_text` replace now tries an exact match, then a whitespace-normalised line + match (re-indenting `new_text` to the file when only indentation differed, and + saying so in the tool result). On a miss it returns the closest current span + with a fresh handle; ambiguous matches are refused, never guessed. +- Settings → Tools & access → *Tool focus* describes the compact profiles' new + capability; the compact prompts mention `replace_file`. + +### A05 model capability probe + +- *Probe this model* (Settings → Models, Ctrl+P, `alt probe`) reads native context + and template facts (`/props` on llama.cpp, `/api/show` on Ollama), then sends one + bounded request (at most 512 output tokens) with a trivial tool and the model's + default thinking. It records whether the model called the tool, reasoned, or hit + the limit. +- Suggestions are labelled choices: thinking off or low, a larger output allowance, + compact tools, or matching the server's native context. Nothing is applied until + you pick one (`alt probe --apply ID` headless). Reports are stored per model + identity under `probes/`. Owned runtimes are started and stopped for the probe. + +### A04 hosted-provider resilience + +- Retries for HTTP 429, 5xx and dropped connections with capped exponential + backoff that honours `Retry-After` (default 2, 0–8). Each retry counts as a model + call against the shared allowance and is logged in the receipt. +- Output guard (automatic for remote servers, on or off): the relay holds each + response, detects leaked chat-template tokens (`<|…|>`) or mixed-script noise in + scripts the conversation never used, discards it once and resends. The discarded + bytes are kept as evidence and recorded as a provider fault, never as model + output; a second fault returns a clear error. Tokens stay charged. +- Model output and sampling → *Provider retries* and *Output guard*, Ctrl+P → + *Hosted output guard*, and `alt inference --retries N --output-guard auto|on|off`. + +### A03 provider presets and hosted discovery (+ B03 authenticated Ollama) + +- Presets fill the endpoint, key-variable name and thinking dialect: NVIDIA NIM, + OpenRouter, Groq, Together, DeepSeek, Mistral, Gemini (OpenAI-compatible), + Cerebras, LM Studio, vLLM/SGLang, llama.cpp, Ollama and Custom. TUI: Connect → + *A hosted API or another server preset*, or Ctrl+P → *Connect a hosted API*. + Headless: `alt init --preset nvidia --model z-ai/glm-5.3`. +- The model picker searches long hosted catalogs as you type; `alt models + --filter WORDS` does the same headless. +- Keys remain environment-variable references; a missing variable is reported + before connecting. `smoke_goose` proves the key reaches the provider on every + model call and never appears in Alt's state, logs or evidence. +- B03: Ollama connections with a key variable work end to end (the engine no + longer refuses them; the relay already sends the bearer key). + +### A02 open parameter surface + +- Request parameters per connection: repeat penalty (spelled per server), + presence/frequency penalty, seed, stop sequences, typical-p, and an extra + request JSON object merged last. Alt-owned keys (`model`, `messages`, `tools`, + `tool_choice`, `stream`, `stream_options`, output-token fields, `n`) are refused. +- Ollama receives `options.num_ctx` from the connection context and an optional + `keep_alive` unless *server default* is chosen; Alt reads the loaded context back + from `/api/ps` and says when the server ignored it. +- Owned llama-server: mmproj, MoE-on-CPU layers, tensor override and split, main + GPU, RoPE/YaRN scaling, mlock, no-mmap, chat-template file, draft model for + speculative decoding, and `extra_args` (binding, key, model, alias and context + flags refused). The argv comes from one pure function (`runtime::server_args`). +- TUI: Settings → Models → *Advanced parameters* and Ctrl+P, with labelled fields + and a raw JSON view of the exact request fields and runtime argv. CLI: + `alt params set|unset|show`. + +### Audit items (B) and harvest (H) + +- B01 (audit A03): editing a connection patches only the name, provider, address, + key variable and dialect; context, steps, inference settings, the selected model + and the uncensored claim are kept, and the model list opens on the current model. +- B02 (audit A04, part): a message sent before the model is ready is held apart from + the composer. Text typed while connecting stays for the next message; on failure, + cancel or a closed connection the held message comes back exactly once, ahead of it. +- B06 (audit A10): an explicitly selected llama-server or agent engine is + authoritative. If it is missing, Alt says so and names the path instead of + silently using the managed or PATH copy. +- B07 (audit A18): manual model-ID entry moved from Ctrl+M (sent as Enter by most + terminals) to Alt+M and a *Type model ID* button; allowance recovery was already in + the palette (N06). +- B08 (audit A19): cancelling a connection check stops the inventory request at once + and a late result is discarded; the form stays and no model dialog reopens. +- B09 (audit A12): GGUF files must carry the full 24-byte header (supported version 2 + or 3, plausible tensor and metadata counts) on import and after downloads; a + magic-only or truncated file is refused before anything loads. +- B10 (audit A21, part): a paste larger than a text field's 64 KiB limit is refused + with a message giving its size and the file-path alternative, instead of + vanishing. The 60×18 connection-form layout remains deferred. +- H01 (harvested from `build/final-pass-2026-10-08`): on terminals of at least about + 96×30, Home is a dashboard with model, project and tools status cards and a + two-column grid of action cards, drawn through the theme engine; 80×24 keeps the + Start-here list. Same indexes, keys and mouse targets. + +### A10 harness labels and matched re-run script (prepared; owner PC runs it) + +- `scripts/live_acceptance.py`: required `--artifact-label uncensored|standard|hosted` + recorded truthfully (`--uncensored` stays an alias); hosted runs need no local + file hash; `--api-key-env`, `--thinking-level`, `--dialect`, and `--check-args` + validation without requests. +- `scripts/pc_matrix_0_7.sh`: the trial matrix (8 cases, 16K, compact, 4,096 + output, 3 repeats) for Spark 4B (Ollama), MiMo 9B abliterated and standard + (llama.cpp CUDA) and two NVIDIA models, in a trial arm and a thinking-off arm, with + a VRAM headroom check before each GPU cell, recorded skips and stopping every + server it starts. `--dry-run` prints and validates all cells in the cloud. +- `docs/PC_HANDOFF_0.7.md` gives the owner the A08 and A10 steps. + +### A08 managed CUDA 12 runtime (prepared for the owner PC; not run) + +- GPU detection from `nvidia-smi` (name, VRAM, compute capability, driver) and a + labelled CUDA 12 fit check (compute 6.1+, driver 525.60+). +- A pinned-archive installer (`runtime::install_pin`: resumable download, SHA256, + unpack, previous copy kept until the new one is in place) and a `CUDA12` pin slot. + The slot is empty in this commit: no CUDA build has been verified yet, so + automatic installation refuses with guidance. `scripts/pin_cuda_runtime.py` builds a + deterministic archive from a verified PC build and prints the exact pin; + `scripts/pc_cuda_check.sh` checks the runtime on the PC first. +- Managed runtimes get their own folder on `LD_LIBRARY_PATH`. CPU stays the default: + installing never selects the CUDA runtime or changes GPU layers (`alt install + cuda-runtime --use` or the TUI's explicit *Use the CUDA runtime*). +- Settings → Runtime → *GPU runtime (CUDA 12)* and Ctrl+P. + +### A09 repository weight and README (+ B11 package size) + +- README opens with what a new user needs: install, connect a model (local or a + hosted preset), first task. Results and evidence moved to *Status and evidence*. +- Packages ship guides, summaries and screenshots but not `docs/evidence` or raw + research data; `docs/EVIDENCE.md` in the package points to the exact source commit. +- `scripts/check_repo_weight.py` (in CI with a full secret scan) refuses tracked + files over 1 MiB and model weights or archives. History is not rewritten. + +### A01 reasoning control and thinking-cutoff recovery + +- One **Thinking** setting (`default | off | low | medium | high | budget:N`), + translated per server dialect: llama.cpp `chat_template_kwargs.enable_thinking` + + `reasoning_budget_tokens`; Ollama `think` + `reasoning_effort`; vLLM / SGLang / + NIM `chat_template_kwargs`; OpenAI-style `reasoning_effort`. Receipts record the + fields sent. Settings → Models, Ctrl+P, and `alt inference --thinking/--dialect`. +- A response that ends at the output limit with reasoning only is a *thinking + cutoff*: charged, never resent silently. The TUI offers labelled recovery + (thinking off or low for this connection, or a larger allowance); headless + `--json` emits a typed `reasoning_cutoff` event. + +### A07 security (audit 2026-10-08) + +- "Allow this session" and `--allow-tools` now cover project actions only + (checkpointed edits, configured checks, skill helpers). Terminal commands, + external MCP tools and untagged engine requests need a separate opt-in: + **Allow terminal this session** in the TUI or `--allow-terminal` headless. + Candidate exploration keeps `--allow-tools` only, so its terminal requests are denied. +- Project tools never list, read or edit Alt's own data folder when a project + contains it; choosing `$HOME` or `/` as the project shows a warning. +- More credential names are excluded and compared case-insensitively: `.envrc`, + `.netrc`, `.npmrc`, `.pypirc`, `.git-credentials`, `id_rsa*`, `id_ed25519*`, + `id_ecdsa*`, `credentials*.json`, `.docker/`, `.kube/`, `.gnupg/`, `*.p12`, `*.pfx`. +- Remote MCP connections with an authentication variable require HTTPS unless + the server is on loopback. +- The owned llama-server starts with a random per-launch key passed through a + private `--api-key-file`, and readiness requires an authenticated model listing. +- Headless `extensions check` refuses to start the server unless access is Full + (same rule as the TUI). +- `requirements-dev.txt` is hash-pinned and installed with `--require-hashes`; the + release job checks out without persisted credentials; SECURITY.md names the + current line and the owner's private-reporting switch. + ## Unreleased — Neon interface (work orders N01–N09) - Model lists now show distinct descriptions per row: parameters, quantization, diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 081f6ffa..899be8cf 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -28,7 +28,7 @@ Create a Python environment for terminal/schema checks: ```bash python3 -m venv .venv source .venv/bin/activate -python3 -m pip install -r requirements-dev.txt +python3 -m pip install --require-hashes -r requirements-dev.txt python3 scripts/smoke_tui.py python3 scripts/smoke_task_tui.py python3 scripts/smoke_workbench_tui.py @@ -97,3 +97,11 @@ Workflows produce reviewable candidates; they do not publish a release automatic A release needs its exact tested archive, build identity, dependency/SBOM evidence, matching upgrade/rollback fixtures and explicitly recorded outstanding gates. Repository source publication and binary-release qualification are separate steps. + +## Evidence and repository weight + +Commit summaries, small receipts and screenshots. Raw evidence over 1 MiB (request +logs, response captures, matrices) goes to a release asset, with a summary and its +checksum in git. Never commit model weights, archives or keys: +`python3 scripts/check_repo_weight.py` and `python3 scripts/secret_scan.py` run in CI, +and `scripts/secret_scan.py` should run before every push. diff --git a/README.md b/README.md index d28cb15f..5c45441e 100644 --- a/README.md +++ b/README.md @@ -3,83 +3,81 @@ [![Verify Alt](https://github.com/3d3dcanada/alt-cli/actions/workflows/verify.yml/badge.svg?branch=main)](https://github.com/3d3dcanada/alt-cli/actions/workflows/verify.yml) [![License: Apache-2.0](https://img.shields.io/badge/license-Apache--2.0-blue)](LICENSE) -**A Rust terminal workspace for building, inspecting and testing software with your own models.** +**A coding agent in your terminal for the model you choose: local, uncensored or hosted.** -Alt combines a terminal UI, project files, real shell sessions, model management, -persistent project memory and checkable task results. Choose your model and access -mode, describe what you want, and inspect what actually changed. It is designed -for local models and people who prefer labelled choices to configuration files. - -Alt supports compatible uncensored, abliterated and Heretic models through GGUF -or server connections. It does not modify model weights or silently replace your -selected model. Full access supports arbitrary commands, networking, package -installation and external tools with your normal account permissions. +Alt runs a full coding workspace (files, real terminal, checks, undo) around any +model you bring: a GGUF file, Ollama, LM Studio, llama.cpp, vLLM, or a hosted API +such as NVIDIA NIM or OpenRouter. Uncensored, abliterated and standard checkpoints +are all first-class. Alt never swaps your model behind your back, and it shows +what actually changed instead of trusting the model's word. ![Alt's actual 80×24 TUI after a MiMo 9B Q4 model repair and independent checks](docs/screenshots/v6/native-model-repair-80x24.png) -**Status: 0.6.0 beta 3 · Linux x86_64 · Apache-2.0.** The screenshot shows an actual -CPU MiMo 9B Q4 repair through the TUI, after the unchanged independent checks passed. -Model reliability and hardware support are measured separately from -application tests. [Read the results and remaining gaps](docs/IMPLEMENTATION.md). - -**Included in beta 3:** explicit inference allocation, host task workflows, bounded -skills, source handles, serial checked candidates, reviewed instruction trials -and offline training tools. Compact text/line-array tool choices reduce repeated -context and provide updated source handles after edits. The current beta includes these additions. See [the usage guide](docs/SMALL_MODEL_USAGE.md) -and [work-order delivery and evidence](docs/SMALL_MODEL_DELIVERY.md). No weights -have been trained or new quality presets promoted. - -The [repair follow-up](docs/research/2026-10-07-repair-results/README.md) now has -independently verified MiMo 9B Q4 repairs. A matched CPU pilot passed **3/4** with -each interface; compact used about 38% less initial input and its passing repairs -were faster in this small sample. The subsequent portable build passed **6/9** -MiMo attempts: both Python feature repeats, JavaScript, two of four held-out tasks -and the two-file repair through the actual TUI. Rust and two held-out tasks failed. -The longer CPU allowance differs from the earlier 22 failures. -The current continuation fix also passed a separate real two-turn MiMo TUI trial; -the earlier failed continuation attempt is retained in that evidence. - -The [PC completion work orders](docs/PC_READY_WORK_ORDERS.md) add observed -request stages, remaining connection allowances, explicit finite additions and -reviewed allocation recovery without changing the model. Failed checks return -actual failed cases and fresh source handles; repeated failures/source cycles -produce advisory recovery feedback. The PC recorder now verifies a real repair, -continuation, cancellation/reconnect and undo in disposable state. See the -[current compatibility evidence](docs/COMPATIBILITY.md) for separate application -and model-quality outcomes. - -## Try it on your computer - -Download [Alt v0.6.0-beta.3](https://github.com/3d3dcanada/alt-cli/releases/tag/v0.6.0-beta.3) -for Linux x86_64. See [Installation](docs/INSTALLATION.md) for archive and GitHub -provenance verification, then follow [PC testing](docs/PC_TESTING.md). You can also -build from source below. - -Install [Rust with rustup](https://rustup.rs/), Git and a C compiler first. On -Debian/Ubuntu, the usual prerequisites are `git build-essential pkg-config curl -ca-certificates python3 libgomp1`. The repository selects Rust 1.99.0 automatically. +## 1. Install + +Download the latest Linux x86_64 build from +[Releases](https://github.com/3d3dcanada/alt-cli/releases) (see +[Installation](docs/INSTALLATION.md) for checksum and provenance checks), or build it: ```bash +# Debian/Ubuntu prerequisites: git build-essential pkg-config curl ca-certificates python3 libgomp1 git clone https://github.com/3d3dcanada/alt-cli.git cd alt-cli -cargo build --locked --release +cargo build --locked --release # Rust 1.99.0 is selected automatically ./target/release/alt ``` -Home opens without a model. Building the application does not download weights. -For step-by-step prerequisites, installing an `alt` command, CI packages and -updates, see **[Installation](docs/INSTALLATION.md)**. Use a real terminal; on a -small computer, `CARGO_BUILD_JOBS=2 cargo build --locked --release` reduces build -parallelism. - -1. **Try a practice project** from Home to learn checks, edits and undo, or choose your own project folder. -2. **Connect a model** you already run in Ollama, LM Studio or another compatible - server, or import/download a GGUF from Models. -3. **Install the agent engine** when Home offers it. A managed GGUF also needs - the optional local runtime. Existing executables can be selected in Settings. -4. **Choose access in Settings**, then describe the change or investigation. -5. **Prepare project checks** on Home, then open Task to inspect edits and actual evidence. - A model saying “done” does not mark the behavior verified. +Alt opens on Home without any configuration. When Home offers **Install agent +engine**, accept it (a pinned, checksummed Goose build). Building Alt downloads no +model weights. + +## 2. Connect a model + +Choose **Connect a model** on Home (or press **Ctrl+P** and type *connect*): + +| You have | Pick | Address it fills | +|---|---|---| +| Ollama | Ollama | `http://127.0.0.1:11434` | +| LM Studio | LM Studio | `http://127.0.0.1:1234/v1` | +| llama.cpp, vLLM, SGLang | *A hosted API or another server preset* → llama.cpp / vLLM | `http://127.0.0.1:8080/v1` / `:8000/v1` | +| A hosted API | *A hosted API or another server preset* → NVIDIA NIM, OpenRouter, Groq, Together, DeepSeek, Mistral, Gemini, Cerebras | the provider's endpoint and key variable | +| A `.gguf` file | *A GGUF file on this computer* | Alt runs it with its own CPU runtime | + +Keys stay in your environment: export the variable the preset names (for +example `NVIDIA_API_KEY`) before starting Alt; Alt saves only the variable name. +Pick the model from the server's list (type to search long hosted catalogs). + +Headless, the same in one line: + +```bash +alt init --preset nvidia --model z-ai/glm-5.3 # or: --preset ollama --model qwen3:8b +alt probe # one short request; suggests settings +``` + +**Probe this model** (Ctrl+P) sends one bounded request and suggests settings +(thinking off, a larger output allowance, compact tools, native context) that +you can apply with one choice. Thinking models that spend their whole allowance +reasoning are detected and offered a labelled recovery; see +[Small-model usage](docs/SMALL_MODEL_USAGE.md). + +## 3. Your first task + +1. **Try a practice project** on Home (a small broken example with real checks + and undo), or **choose a project folder**. +2. **Choose access** in Settings → Tools & access: *Review only*, *Guided changes* + (reviewed edits, checks isolated with Bubblewrap) or *Full access* (any command + and network, with your own permissions). +3. Type what you want in the Workspace, for example *"The tests in test_cart.py + fail; find out why and fix it."* Review each proposed edit or command. +4. Open **Task progress** to see the diff, run the checks and undo if needed. A + model saying "done" does not mark the work verified; the checks do. + +Everything is reachable with the keyboard or mouse: **Ctrl+P** lists every page, +setting and action; **F1** opens help; the TUI stays usable at 80×24. + +**Status: 0.7 in development on `main` (latest release 0.6.0 beta 3) · Linux +x86_64 · Apache-2.0.** Model reliability and hardware support are measured +separately from application tests; see [Status and evidence](#status-and-evidence). ## What you can do @@ -91,7 +89,8 @@ parallelism. | Tools | Native project tools; optional build, Git, HTTP, browser and security workflows; selected external MCP tools | | Project memory | Saved goals and decisions, pinned notes, incremental source indexing, retrieved context and a visible Context page | | Verification | Tests/build/lint/health/custom contracts, structured reports, independently pinned assertions and stale-result detection | -| Runtime controls | Context, CPU threads, GPU layers, batch/cache settings, optional reasoning control, generation and restart qualification | +| Runtime controls | Context, CPU threads, GPU layers, batch/cache, MoE/tensor offload, RoPE/YaRN, draft models, extra llama-server arguments, generation and restart qualification | +| Any server | Thinking off/low/medium/high per server dialect, penalties, seed, stop, extra request JSON, Ollama context, model probe | | Small-model effort | Explicit output/sampling, actual request receipts, host workflow, one active skill, source/import outlines and serial independently checked candidates | | Offline improvement | Development-only instruction proposals with review/rollback; pending trajectory capture, SFT resume/export tooling and verified rewards | | Recovery | State backup/restore, history retention, preserved imported weights, diagnostics and package rollback | @@ -106,10 +105,11 @@ Tool focus is a separate explicit choice; **All** is the default. | Connection | Address or input | Notes | |---|---|---| -| Ollama | `http://127.0.0.1:11434` | Use the server root; configure its native context separately | +| Ollama | `http://127.0.0.1:11434` | Use the server root; Alt sends the connection context as `num_ctx` and reads back what Ollama loaded | | LM Studio | Usually `http://127.0.0.1:1234/v1` | Load a model and start its compatible server first | | llama.cpp / ORA / other compatible servers | The server's OpenAI-compatible `/v1` address | Tool behavior depends on the model and chat template | | Managed local inference | A compatible GGUF file or complete split set | The pinned download is CPU first; GPU runtime selection is explicit | +| Hosted APIs | NVIDIA NIM, OpenRouter, Groq, Together, DeepSeek, Mistral, Gemini, Cerebras presets | Key from an environment variable; retries and an output guard for flaky providers | The reference target is **Linux, 16 GB RAM and a GTX 1070 with 8 GB VRAM**. Physical GTX 1070 performance has not been measured. Your selected 7B/9B Q4 model is a @@ -149,6 +149,8 @@ alt models search 'Qwen3 4B heretic' alt models import /path/to/model.gguf --uncensored --use alt run 'Inspect this project and explain its test commands' alt --access trusted run 'Run this project’s checks' --allow-tools --json +# terminal commands and external tools need their own flag: +alt --access trusted run 'Install and test' --allow-terminal --json alt state backup /path/outside-alt-state/backup.tar.gz ``` @@ -165,10 +167,10 @@ Keys are referenced by environment-variable name, not saved in model profiles. - [Workspace guide](docs/WORKSPACE_GUIDE.md) · [CLI reference](docs/CLI.md) - [Verification contracts](docs/VERIFICATION_CONTRACTS.md) · [Runtime qualification](docs/QUALIFICATION.md) - [Architecture](docs/ARCHITECTURE.md) · [Contributing](CONTRIBUTING.md) · [Changelog](CHANGELOG.md) -- [Implementation and evidence](docs/IMPLEMENTATION.md) · [Current work orders](docs/WORK_ORDERS_0.6.md) · [PC test guide](docs/PC_TESTING.md) +- [Implementation and evidence](docs/IMPLEMENTATION.md) · [0.7 work orders](docs/WORK_ORDERS_0.7.md) · [PC test guide](docs/PC_TESTING.md) - [Research and project history](docs/research/README.md) · [Documentation index](docs/README.md) -Current source validation includes **123 Rust tests**, strict Clippy, both adapter +Current source validation includes **162 Rust tests**, strict Clippy, both adapter fixtures for both compact edit formats, and actual small-terminal permission, edit/check/undo and conversation-continuation journeys. Compact follow-ups retain the complete original request as context, with the latest user message taking @@ -179,6 +181,26 @@ also passed a live uncensored-model CPU trial. These measurements do not guarant that a model can solve an arbitrary task. The [current evidence](docs/evidence/v6/README.md) separates application results, model outcomes and remaining human/hardware checks. +## Status and evidence + +The 2026-10-08 PC trial (GTX 1070, 8 GB) measured why small models fail: reasoning +cut-offs and edit format. Spark-X2.5 4B passed 0/8 tasks at 1,024 output tokens +(every token spent thinking) and 3/8 at 4,096; MiMo 9B abliterated 3/8; hosted Kimi +K3 4/8 and GLM 5.3 3/8. The 0.7 work orders ([board](docs/WORK_ORDERS_0.7.md)) +attack exactly that: provider-aware thinking control and cut-off recovery, open +parameters, hosted presets and retries, a model probe and whole-file edits. The +matched re-run on the owner's PC (A10) has not been run yet; no improvement is +claimed until it is. + +Earlier results: the [repair follow-up](docs/research/2026-10-07-repair-results/README.md) +has independently verified MiMo 9B Q4 repairs (matched CPU pilot 3/4 per interface; +portable build 6/9). The complete 0.6 CPU matrices passed 7/120 pinned behavioural +checks for Spark and 16/120 for Qwen; no model preset is promoted. Physical GTX 1070 +qualification, real LM Studio and novice sessions remain open gates. See +[compatibility](docs/COMPATIBILITY.md), [qualification](docs/QUALIFICATION.md) and +[live evaluations](docs/LIVE_EVALUATION.md). Raw evidence stays in `docs/evidence`; +new raw evidence over 1 MiB goes to release assets (`scripts/check_repo_weight.py`). + ## Development and license ```bash diff --git a/SECURITY.md b/SECURITY.md index 7af3806f..4caa2d4e 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -1,12 +1,14 @@ # Security reports and execution boundaries -The current maintained development line is 0.5 beta. Fixes target `main`; older -experimental versions do not have a separate support commitment. +The current maintained line is 0.6 beta (latest published `v0.6.0-beta.3`), with +0.7 in development on `main`. Fixes target `main`; older experimental versions do +not have a separate support commitment. For a vulnerability that exposes private data or enables unintended execution, -use GitHub's private vulnerability reporting for this repository when available. -If it is not enabled, open an issue asking the maintainer for a private reporting -channel without including the sensitive details. Keep credentials and sensitive +use GitHub's private vulnerability reporting for this repository. The repository +owner must switch it on (Settings → Code security → Private vulnerability +reporting); until then, open an issue asking the maintainer for a private +reporting channel without including the sensitive details. Keep credentials and sensitive reproduction details out of public issues. Include the affected commit/version, the selected access mode, a minimal @@ -16,6 +18,13 @@ integrity, authorization and process-ownership failures with the same specificit Full access intentionally allows arbitrary commands, network access and external tools using normal account permissions. It is not a hostile-code sandbox. +"Allow this session" in the TUI and `--allow-tools` approve project actions only +(checkpointed edits, configured checks, skill helpers). Terminal commands and +external MCP tools need their own opt-in: "Allow terminal this session" or +`--allow-terminal`. Project tools never read or edit Alt's own data folder, and +credential files (`.env*`, `.envrc`, `.netrc`, `.npmrc`, `.pypirc`, SSH keys, +`credentials*.json`, `.docker/`, `*.pem`, `*.key`) are excluded whatever their case. +The owned llama-server listens on loopback with a random per-launch key. Guided checks require Bubblewrap and fail closed when unavailable. Model output, project content and external tool responses are untrusted inputs; they do not establish successful verification. File undo and state backup do not reverse diff --git a/docs/CLI.md b/docs/CLI.md index 0eaccdff..4aa5c20b 100644 --- a/docs/CLI.md +++ b/docs/CLI.md @@ -61,6 +61,7 @@ review a suggestion before saving or running it. ```bash alt run 'Inspect this project and explain its test commands' alt --access trusted run 'Run the documented checks and explain failures' --allow-tools --json +alt --access trusted run 'Install the dependencies and run the tests' --allow-terminal --json alt plain alt sessions alt tui --resume SESSION_ID @@ -72,10 +73,30 @@ For the compact small-model interface, choose `alt tools compact` (scalar text) or `alt tools compact-lines` (one source line per array item). `alt tools all` restores the original tool/context interface. These choices are independent of Full/Guided access. Set workflow with `alt workflow host` and output allocation -with `alt inference --output-tokens 1024`; use the +with `alt inference --output-tokens 1024`, thinking with `alt inference --thinking off` +(or `low`, `medium`, `high`, `default`, `budget:N`; `--dialect` names the server family); use the [usage guide](SMALL_MODEL_USAGE.md) for model-specific reasoning and context settings. -Headless requests deny tool permission unless `--allow-tools` is supplied. Access +Hosted providers: `alt init --preset nvidia --model z-ai/glm-5.3` fills the +endpoint, key variable (`NVIDIA_API_KEY`) and thinking dialect. Presets: nvidia, +openrouter, groq, together, deepseek, mistral, gemini, cerebras, lmstudio, vllm, +llamacpp, ollama, custom. Explicit `--endpoint`, `--provider` and `--api-key-env` +win over the preset. `alt models --filter glm` searches the server's catalog. + +Model probe: `alt probe` sends one bounded request and prints server facts, the +observed reply and labelled suggestions; `alt probe --apply thinking-off` applies +one. Nothing changes without `--apply`. + +Open parameters: `alt params show` lists every request and owned-runtime +parameter, the exact request fields and the llama-server argv. `alt params set +repeat_penalty 1.1`, `alt params set extra_body '{"top_a":0.1}'`, `alt params set +ollama_context server-default` or `alt params set n_cpu_moe 12` change one value; +`alt params unset KEY` restores its default. + +Headless requests deny tool permission unless `--allow-tools` is supplied. +`--allow-tools` approves project actions only: checkpointed edits, configured +checks and skill helpers. Terminal commands, external MCP tools and any request +Alt did not tag need `--allow-terminal` (which implies `--allow-tools`). Access policy is separate: `--access trusted` selects Full access; other values are `guided` and `review-only`. The TUI uses its saved Settings choice. Full access can run arbitrary commands with normal host permissions. `--json` writes events diff --git a/docs/CONTROLLED_WORKFLOWS.md b/docs/CONTROLLED_WORKFLOWS.md index b436e1e5..6a2a134f 100644 --- a/docs/CONTROLLED_WORKFLOWS.md +++ b/docs/CONTROLLED_WORKFLOWS.md @@ -19,11 +19,13 @@ Open **Settings → Access**: Full access is the broad-capability mode requested for this product. It does not filter task topics or model families. An approval can authorize one action, and -**Trust session** authorizes subsequent requested actions in the selected mode. +**Allow this session** authorizes subsequent project actions (edits, checks, skill +helpers) in the selected mode. Terminal and external tools keep asking until you +choose **Allow terminal this session** on one of them. Changing access reconnects the engine and resets session trust. CLI equivalent: ```sh -alt --access trusted run 'Work on this project' --allow-tools +alt --access trusted run 'Work on this project' --allow-tools --allow-terminal ``` `trusted` is the CLI spelling for Full access. A bare `alt run` denies requested diff --git a/docs/FINAL_AUDIT_2026-10-08.md b/docs/FINAL_AUDIT_2026-10-08.md new file mode 100644 index 00000000..2e74491c --- /dev/null +++ b/docs/FINAL_AUDIT_2026-10-08.md @@ -0,0 +1,170 @@ +# Final audit: beta 3 and the next improvement cycle + +Review date: 2026-10-08. Baseline: `v0.6.0-beta.3`, commit +`fa0c8e4130ec4d13c59193436679c4e059c22dee`, runtime source digest +`54bb6215b1e87579f3534c347f38019cf569e91386237352e314ba5d025976f1`. + +## Assessment + +Alt has substantial working infrastructure: a Rust terminal application, real +Goose adapters, local model management, tracked edits, independent assertions, +recovery features, and a verified public release. Its release provenance is +strong. Its current user-intent, verification and lifecycle contracts still have +defects that should be addressed before recommending it for important projects. + +The highest-value next release should fix those contracts and remove avoidable +burdens from 7B/9B Q4 models. Increasing context, adding tools or requesting longer +reasoning cannot compensate for a dropped user requirement, an incorrect source +location, or a check result attributed to the wrong source revision. + +“Ten times better” is a product ambition, not a result established by this audit. +The [implementation work orders](FINAL_PASS_WORK_ORDERS.md) define measurable +outcomes for reliability, first-task completion, model correctness and cost. + +## Scope and method + +Six parallel reviews covered user interaction, core correctness, the model +harness, runtimes/adapters, execution boundaries, and delivery/operations. The +review included source, existing tests, retained live-model traces and release +receipts. Bounded CLI and real-terminal reproductions used disposable projects, +state folders and deterministic fixtures. A standalone Rust replay exercised the +current compiled library. No new real-model requests or training were performed. + +Sixteen existing compact-context and PC-readiness tests were rerun and passed. +The previously reported 123 Rust tests and complete release CI passed on this +baseline; this audit did not rerun the entire setup. The new reproductions expose +combinations those tests do not cover. Green existing tests and the defects below +can therefore both be true. + +Application source and the published archive were not changed during this audit. +The findings remain open. Small receipts, fixture source and terminal captures +are retained in [audit evidence](evidence/final-audit-2026-10-08/README.md). +Weights, databases, compiled probes and large/sparse test files are excluded. + +Evidence labels: **reproduced** means a bounded execution demonstrated the issue; +**trace** means it appears in a retained real-model run and is supported by code; +**source** means the implementation establishes the path but its full effect was +not measured; **gap** means a proposed qualification or product improvement. +P1 findings should block a reliability promotion; P2 findings need scheduled +remediation; P3 concerns affect usability or efficiency without the same urgency. + +## Findings + +### Correctness and preservation + +| ID | Priority / evidence | Finding and consequence | Primary source / receipt | +| --- | --- | --- | --- | +| A01 | P1, reproduced | A check can modify the disposable source, pass a real pinned assertion, and mark the unchanged incorrect working source behaviorally accepted. The executed source revision is not rechecked. | [sandbox.rs:178](../src/sandbox.rs#L178), [sandbox.rs:440](../src/sandbox.rs#L440), [project_services.rs:374](../src/project_services.rs#L374); [receipt](evidence/final-audit-2026-10-08/correctness/mutating-source.json) | +| A02 | P1, reproduced | An external editor write between the stale-content check and replacement is lost; Undo restores the older proposal image rather than the intervening user version. | [project.rs:999](../src/project.rs#L999), [project.rs:968](../src/project.rs#L968); [receipt](evidence/final-audit-2026-10-08/correctness/race-checkpoint-repro.json) | +| A03 | P1, reproduced | Saving an otherwise unchanged connection resets custom inference settings and the uncensored claim. The example changed context from 4K to 8K and removed its output, request, token and sampling settings. | [keys.rs:719](../src/tui/keys.rs#L719), [app.rs:1316](../src/tui/app.rs#L1316); [before](evidence/final-audit-2026-10-08/ux/connection-before.json), [after](evidence/final-audit-2026-10-08/ux/connection-after.json) | +| A04 | P1/P2, reproduced | Text typed during initial connection is overwritten by the frozen submitted prompt. New and quit/restart also discard unsent drafts without restoration. | [app.rs:834](../src/tui/app.rs#L834), [app.rs:891](../src/tui/app.rs#L891), [app.rs:1397](../src/tui/app.rs#L1397); [receipt](evidence/final-audit-2026-10-08/ux/draft-during-connect-result.json) | +| A05 | P1, reproduced | In Compact mode a third turn can omit a correction supplied in turn two. The original goal survives, but intervening request notes are excluded and each engine turn starts a new native session. | [project.rs:226](../src/project.rs#L226), [compact_context.rs:163](../src/compact_context.rs#L163), [engine.rs:563](../src/engine.rs#L563); [replay](evidence/final-audit-2026-10-08/harness/replay.txt) | +| A08 | P2, reproduced | A completed check loses its output and saved result if the project lock is briefly occupied while evidence is committed. The CLI returns only a busy error. | [sandbox.rs:493](../src/sandbox.rs#L493), also lines 463 and 671; [receipt](evidence/final-audit-2026-10-08/correctness/locked-evidence.json) | +| A09 | P2, reproduced | An inherited feature flag can change while the old passing result remains marked current. Rerunning immediately with that same changed environment fails. | [project_services.rs:94](../src/project_services.rs#L94), [sandbox.rs:358](../src/sandbox.rs#L358); [receipt](evidence/final-audit-2026-10-08/correctness/environment.json) | +| A20 | P2, reproduced | CLI check configuration has a circular prerequisite for `{report}`; reconfiguring also resets its existing contract. | [main.rs:1719](../src/main.rs#L1719), [main.rs:1822](../src/main.rs#L1822), [verification.rs:109](../src/verification.rs#L109); [receipt](evidence/final-audit-2026-10-08/correctness/placeholder-setup.json) | +| A28 | P2, reproduced | Apply/Undo ignores external permission changes and can widen a file from 0600 back to 0644. | [project.rs:946](../src/project.rs#L946), [project.rs:965](../src/project.rs#L965); [receipt](evidence/final-audit-2026-10-08/correctness/permissions-checkpoint-repro.json) | + +A01 is not a fabricated test report. The independent assertion remains pinned, +actually executes the repaired disposable source, and actually passes. The original +file still returns the wrong answer. Results must describe the source that was +executed; legitimate generated build outputs need their own declared handling. +Matching pre/post manifests alone cannot prove immutability during execution; +the fix must also address temporary mutation followed by restoration or qualify +its source-identity claim. + +A02 uses deterministic fault injection to schedule a valid external-write +interleaving. It establishes a possible loss, not its everyday frequency. A fix +must define attainable filesystem guarantees, preserve displaced versions and +surface conflicts. A generic atomic compare-and-swap against every unrelated +editor cannot simply be promised. + +### Model reasoning and tool interaction + +| ID | Priority / evidence | Finding and consequence | Primary source / receipt | +| --- | --- | --- | --- | +| A06 | P1, reproduced + trace | Any matched filename suppresses lexical retrieval. “Implement median … do not change Cargo.toml” includes Cargo.toml and omits the implementation, even in a two-file project with available context. | [compact_context.rs:220](../src/compact_context.rs#L220); [replay](evidence/final-audit-2026-10-08/harness/replay.txt) | +| A07 | P1/P2, trace | An independent test crate's `src/lib.rs` warning is mapped to the implementation crate. Arbitrary diagnostic line spans become editable handles; the model replaces incomplete function spans and damages the function before receiving syntax feedback. Duplicate spans consume context. | [workflow.rs:253](../src/workflow.rs#L253), [toolbox.rs:830](../src/toolbox.rs#L830), [toolbox.rs:908](../src/toolbox.rs#L908) | +| A22 | P2, trace/source | The Rust failure reports actual/expected values without its concrete input, and the instruction optimizer reads only stderr although the assertion failure is in stdout. Useful failure information is omitted. | [acceptance_projects.py:73](../scripts/acceptance_projects.py#L73), [acceptance_projects.py:126](../scripts/acceptance_projects.py#L126), [optimize_instructions.py:36](../scripts/optimize_instructions.py#L36) | +| A23 | P2, source | Check output beyond 128 KiB per stream is discarded. A late diagnostic can be unavailable even though counters detect failure. | [sandbox.rs:150](../src/sandbox.rs#L150) | +| A26 | P1 qualification gap | Current software CI proves application/protocol behavior; automated model-matrix choices omit the actual target 7B/9B artifacts. Existing real-model cohorts are too small or differently configured to establish general improvement. | [model-matrix.yml:8](../.github/workflows/model-matrix.yml#L8), [compatibility](COMPATIBILITY.md), [training status](../training/status/repair-capture.json) | + +The configured MiMo Rust trace is especially informative. Its failure feedback +pointed at the wrong crate; the model replaced a 12-line read span with two lines, +restored the function, then damaged another partial span. It also guessed at the +missing boundary input. These observations support concrete harness changes; +they do not prove those changes will solve the arithmetic problem. + +Raw requests are retained under +`docs/evidence/pc-ready/live/mimo9b-rust-configured/8192-rust-feature-1/state/inference/95b5cf5f-4628-4c7b-80a2-4cbf3ed5f5f3/`: + +- `8f81af16-2a9a-4fd1-966c-1ad4436a96df-request.json`: wrong-root diagnostic and source packet. +- `ac7e75e6-754e-438e-9ef7-200dc6da86e8-request.json`: first destructive span replacement. +- `f06e1e36-20e7-423b-9bea-40ddfe230691-request.json`: later partial replacement. + +The original failed run stays unchanged. Future structured counterexamples must +come from observed checks, without adding a reference implementation or changing +the held-out oracle to make the result pass. Treat any new feedback format as a +new declared harness condition in comparisons. + +### Runtimes, extensions and model acquisition + +| ID | Priority / evidence | Finding and consequence | Primary source / receipt | +| --- | --- | --- | --- | +| A10 | P1, reproduced | An invalid explicitly selected runtime silently resolves to a different managed/PATH runtime. The same fallback pattern affects configured engine paths. | [runtime.rs:150](../src/runtime.rs#L150), [runtime.rs:163](../src/runtime.rs#L163); [receipt](evidence/final-audit-2026-10-08/runtime/audit-summary.json) | +| A11 | P1, source | TUI benchmarking/qualification can start a second owned model while an idle connected workspace still holds the first, threatening the target's 8 GB VRAM and invalidating measurements. No physical OOM was attempted. | [management.rs:252](../src/tui/management.rs#L252), [management.rs:806](../src/tui/management.rs#L806), [benchmark.rs:39](../src/benchmark.rs#L39), [workspace.rs:267](../src/workspace.rs#L267) | +| A12 | P2, reproduced | Import accepts a four-byte GGUF magic-only file and records no split pieces for a numbered first shard. Imported additional shards lack the downloaded-set integrity coverage. | [models.rs:342](../src/models.rs#L342), [models.rs:354](../src/models.rs#L354), [models.rs:535](../src/models.rs#L535); [receipt](evidence/final-audit-2026-10-08/runtime/audit-summary.json) | +| A13 | P2, reproduced | Authenticated Ollama inventory succeeds, then engine initialization rejects the same configuration, although the relay already attaches bearer authentication. | [engine.rs:182](../src/engine.rs#L182), [inference.rs:581](../src/inference.rs#L581); [receipt](evidence/final-audit-2026-10-08/runtime/ollama-auth-reproduction.json) | +| A14 | P1, reproduced | Headless `extensions check` executes the configured host program even with `--access review-only` or `--access guided`. The TUI enforces the Full-access requirement. | [main.rs:1048](../src/main.rs#L1048), [management.rs:875](../src/tui/management.rs#L875); [receipt](evidence/final-audit-2026-10-08/mcp-policy/report.json) | +| A15 | P2, reproduced | Closing an MCP discovery connection can leave a helper that ignores TERM running after the leader exits. | [extensions.rs:352](../src/extensions.rs#L352), [extensions.rs:104](../src/extensions.rs#L104); [receipt](evidence/final-audit-2026-10-08/mcp-cleanup/report.json) | +| A24 | P2 hardening, source | The owned llama.cpp loopback port has no per-launch credential; readiness trusts an unauthenticated health response after releasing its port reservation. Other local accounts can access the underlying endpoint. | [runtime.rs:360](../src/runtime.rs#L360), [runtime.rs:466](../src/runtime.rs#L466) | + +A14 is a CLI policy inconsistency, not a demonstrated model escape. A24 is local +endpoint ownership/accounting hardening, not evidence of remote exposure or +conversation disclosure. Full access should retain ordinary host commands, +networking, installations and user-selected external tools. + +### Beginner experience and long-term operation + +| ID | Priority / evidence | Finding and consequence | Primary source / receipt | +| --- | --- | --- | --- | +| A16 | P1, reproduced | Inference traces accumulate outside retention coverage. State above 512 MiB cannot be backed up, and package upgrades require that backup. Normal long-lived use lacks a supported cleanup path for its largest evidence bucket. | [inference.rs:577](../src/inference.rs#L577), [storage.rs:43](../src/storage.rs#L43), [storage.rs:227](../src/storage.rs#L227), [install-package.sh:66](../scripts/install-package.sh#L66); [receipt](evidence/final-audit-2026-10-08/delivery/delivery-receipt.json) | +| A17 | P2, reproduced | The installer can exit unsuccessfully after replacing the executable, when later documentation copying fails. The prior binary is preserved, but the installed generation is partial. | [install-package.sh:74](../scripts/install-package.sh#L74), [install-package.sh:98](../scripts/install-package.sh#L98); [receipt](evidence/final-audit-2026-10-08/delivery/delivery-receipt.json) | +| A18 | P2, reproduced/source | Allowance recovery lacks a keyboard/palette route. The manual model-ID shortcut uses Ctrl+M, which ordinary terminals encode as Enter; the PTY reproduction instead runs inventory. | [keys.rs:96](../src/tui/keys.rs#L96), [keys.rs:398](../src/tui/keys.rs#L398), [keys.rs:786](../src/tui/keys.rs#L786); [receipt](evidence/final-audit-2026-10-08/ux/results.json) | +| A19 | P2, reproduced | Canceled connection inventory ignores its cancellation token and later reopens the model dialog. | [keys.rs:711](../src/tui/keys.rs#L711), [app.rs:1231](../src/tui/app.rs#L1231); [receipt](evidence/final-audit-2026-10-08/ux/cancel-inventory-result.json) | +| A21 | P3, reproduced/source | The 60×18 connection form overlaps controls/help; input above 64 KiB is silently ignored. | [view.rs:1497](../src/tui/view.rs#L1497), [input.rs:39](../src/tui/input.rs#L39); [screen](evidence/final-audit-2026-10-08/ux/connection-60x18.txt) | +| A25 | P2 efficiency gap | The desktop package includes 9,129 historical documentation/evidence files totaling 150.85 MB, about 78% of its unpacked payload. | [package-linux.py:47](../scripts/package-linux.py#L47), [install-package.sh:98](../scripts/install-package.sh#L98) | +| A27 | P2 qualification gap | Current stress loops do not establish weeks of one growing workspace. Cross-file backup consistency during active changes and stable multi-file snapshot capture need dedicated qualification. | [soak.py:28](../scripts/soak.py#L28), [storage.rs:69](../src/storage.rs#L69), [sandbox.rs:178](../src/sandbox.rs#L178) | + +## What to preserve + +Keep the independent check contracts and negative controls, source checkpoints, +explicit access modes, pinned artifact digests, resumable downloads, actual +inference receipts, and honest failed-model records. Keep the exact-tag CI and +attestation gates. Package integrity and model usefulness are distinct measures. + +There is no reason to replace Rust or discard the entire implementation. The +most useful structural change is to give shared operations one owner: profile +patching, draft submission, action availability, process ownership, evidence +commit and installation activation. The demonstrated divergence between CLI and +TUI and duplicated profile construction justify that consolidation. File length +alone is not a reason for a rewrite. + +## Recommended sequence + +1. **Trust and preservation release:** F01–F03, F07 and F11. Fix wrong-source + verification, lost edits/messages/settings, runtime ownership and update + durability. Preserve all capabilities of deliberately selected Full access. +2. **Small-model effectiveness release:** F04–F06, supported by the F13 baseline. + Retain evolving requirements, retrieve the correct source, provide concrete + diagnostics, and make edit intent precise. Measure verified task success at + identical inference budgets. +3. **Beginner and older-PC release:** F08–F10 and F12. Complete adapter/import + paths, keyboard recovery, progressive setup, model-fit measurement, warm + runtime reuse and a smaller download. +4. **Evidence-led optimization:** F13–F14. Test hypothesis/probe loops and + cost-aware candidate search, then training when enough reviewed families and + a supported training environment exist. + +The work orders define dependencies and acceptance. Physical GTX 1070/CUDA 12 +performance, a true 16 GB desktop memory budget and uncoached novice sessions +remain measurements that this cloud cannot substitute for. diff --git a/docs/FINAL_PASS_WORK_ORDERS.md b/docs/FINAL_PASS_WORK_ORDERS.md new file mode 100644 index 00000000..d7d752c0 --- /dev/null +++ b/docs/FINAL_PASS_WORK_ORDERS.md @@ -0,0 +1,335 @@ +# Final-pass implementation work orders + +Baseline and evidence: [final audit](FINAL_AUDIT_2026-10-08.md). These are planned +work orders, not implemented fixes. User-facing dates follow the 2026-10-08 client +context. The target remains Linux, 16 GB RAM, GTX 1070 8 GB VRAM and user-selected +7B/9B Q4 uncensored/abliterated models, with CPU and newer hardware supported. + +## Outcomes and release gates + +The first goal is reliable behavior under ordinary user interactions. Capability +improvements must then be measured at a fixed model, context and effort budget. +Targets below are proposed acceptance criteria, not measured achievements: + +- Zero lost user drafts, profile fields, recorded results or unrecoverable + intervening edits in the declared failure-injection suite. +- Zero false “behaviorally accepted on current files” results in source, + environment, assertion, concurrency and report-mutation negative controls. +- All critical setup/recovery actions usable by keyboard at supported sizes. +- At least four of five novice participants complete connection, practice repair, + independent checking and undo without external coaching; record all assistance. +- A matched model-quality target of at least **15 percentage points** more + independently successful held-out tasks at the same budget. Report uncertainty + and per-model results; a small sample or one exercise cannot establish this. +- A separate efficiency target of at least **25% fewer unnecessary prompt tokens + or repair round trips**, with no lost requirements or correctness regression. +- At least **90% less installed historical-documentation payload**, while keeping + every original evidence file available in a separate verified archive. + +Do not claim “10× smarter” from these targets. Track time to a verified useful +result, interventions, failed/incorrect completions, RAM/VRAM and total effort. + +## F01 — Make verification describe the executed source + +**Priority:** release blocker. **Findings:** A01, A08, A09, A20, A23. + +Capture the input-source manifest before and after check execution. Separate +declared generated outputs from changes to existing inputs. If preparation changes +input source, retain the resulting patch and report a changed-source result; +apply/recheck is an explicit operation. Preserve Full host commands. +Pre/post equality alone does not establish immutable execution: a check can +mutate, test and restore. Define a stronger isolated immutable-input path where +supported, or qualify the claim to observed source snapshots. Keep unrestricted +Full commands available without implying stronger guarantees than they provide. + +Make argv, evidence contract and declared execution inputs one atomic check +configuration. Fingerprint effective inputs without persisting raw credentials. +Qualify freshness when an inherited input cannot be accounted for. Spool raw +output and an execution receipt before acquiring the project database lock; +reconcile exactly once after contention or restart. Support bounded raw-log +storage and tail/range access instead of discarding late failures. +Reserve receipt capacity before execution. If storage cannot accept a durable +receipt, expose the unsaved state and available export/recovery path; never claim +that a result was saved or rerun the command automatically. + +**Acceptance:** the pinned-assertion mutation repro cannot certify the original; +include a mutate → test → restore negative control for source-identity claims; +normal build outputs still work; environment changes stale evidence; `{report}` +and `{assertion}` work in a newly configured CLI check; lock contention and +interrupted saves recover the original spooled receipt without reexecuting commands; +disk-full injection exercises reserved capacity and explicit unsaved-state recovery; +a failure after a large progress stream remains retrievable. + +## F02 — Preserve displaced edits and relevant file metadata + +**Priority:** release blocker. **Findings:** A02, A28, snapshot portion of A27. + +Define practical conflict guarantees and journal transitions for apply, delete, +undo and batch undo. Retain observed displaced versions and relevant mode/file +identity metadata; expose ambiguous transitions as recoverable conflicts. Review +coordination when two Alt state roots address the same project. Stabilize source +manifests around snapshot materialization or clearly label a changed capture. + +**Acceptance:** deterministic external in-place writes and rename-based saves at +each transition, chmod changes, deletion/recreation and crash recovery preserve +recoverable versions and never silently widen permissions. Existing dirty Git +files remain intact. Do not promise a generic filesystem CAS against every +non-cooperating writer; document the supported guarantee precisely. + +## F03 — Preserve profiles and every unsent message + +**Priority:** release blocker. **Findings:** A03, A04. + +Use typed profile patches so a connection edit changes only selected fields. +Store the submitted message separately from the next-message composer. Persist +per-session/project drafts with debounced durable writes and explicit discard or +restore when creating a new conversation. Keep source message IDs through +connection success, failure and retry. +Define and expose the draft durability boundary; drain pending writes on orderly +exit and measure the maximum uncommitted keystroke window on abrupt termination. + +**Acceptance:** the customized 4K profile retains every allocation and sampling +field after a name/endpoint/key edit. Text entered during startup survives success, +failure, cancellation and reconnect exactly once. Quit and New preserve the full +draft; abrupt interruption restores the last durable draft within the declared +loss window. Test actual PTY interaction and restart. + +## F04 — Maintain an evolving task contract + +**Priority:** next capability foundation. **Finding:** A05. **Depends on:** F03. + +Retain exact user requirements with message IDs, scope and explicit supersession. +Build a compact active-requirement view that includes middle-turn corrections, +not only the original task. Distinguish user decisions, observed facts and model +hypotheses. Let the user inspect “What Alt currently understands” and correct it. +Retire a requirement only through an explicit user correction or UI decision, +retaining exact source text; a model summary cannot silently supersede it. +When a complete requirement set exceeds the budget, expose the limitation and +offer explicit task decomposition rather than silently losing requirements. + +**Acceptance:** unique constraints introduced across 3, 12 and 50 turns survive +restart, cancellation, correction and context pressure. Superseded constraints +are retired with a recorded reason; unrelated tasks do not inherit stale goals. +Include negative checks proving the middle-turn requirement is actually present +in the provider request, not merely stored in the database. + +## F05 — Supply relevant source and precise failure packets + +**Priority:** next capability foundation. **Findings:** A06, A07, A22. +**Depends on:** F01 and F04. + +Merge explicit paths, target symbols, changed files, imports and valid diagnostic +locations; rank and deduplicate within the token budget. A prohibited-file mention +must not crowd out the implementation. Parse structured compiler output where +available and retain diagnostic crate/root, source revision and provenance. +Collect actual named cases, observed counterexample inputs, expected/actual values +and a reproduction command. Include both stdout and stderr in instruction trials. + +**Acceptance:** the Cargo-only replay includes the median implementation; a +declared navigation set locates the known target implementation in the top three +results for at least 90% of queries. Oracle-crate paths cannot become implementation handles +without a valid mapping. Repeated spans appear once. Every reported counterexample +is backed by an observed check; independent acceptance remains unchanged. + +## F06 — Match edit operations to intent and support executable reasoning + +**Priority:** measured capability experiment. **Findings:** A07, A22, A26. +**Depends on:** F01, F04, F05 and the F13 baseline. + +Offer concise operations for replacing a symbol/expression, applying a targeted +patch, inserting, creating or deleting. Show exact target scope and compute a +parse/diff preview before applying changes that unexpectedly remove surrounding +definitions. Provide explicit intentional rewrite choices and retain Full +terminal capability. Reuse a small set of clear tools rather than expanding the +default schema with dozens of overlapping tools. +Distinguish an unsupported parser or uncertain syntax from a confirmed error; +support intentional deletion, rename and incomplete intermediate edits explicitly. + +Add a short hypothesis → prediction → disposable probe/check → evidence update +workflow. Useful helpers include calculation/code probes, local API references, +compiler diagnostics and test generation as proposed checks. Model explanations +remain hypotheses until execution supports them. Improve serial candidate search +with actual failure context, distinct declared strategies and an explicit check/ +recovery reserve within the same shared budget. + +**Acceptance:** replay the two observed destructive Rust span edits and explain +the mismatch before mutation, while preserving legitimate explicit rewrites and +unsupported-language workflows. Compare ordinary repair, executable hypotheses and +best-of-k selection at equal total effort. Measure independently verified success, +syntax-breaking edits, repeated failures, requests and time; longer reasoning text +is not a success metric. Promote no default without a measured benefit. + +## F07 — Give processes, runtimes and policies one owner + +**Priority:** release blocker. **Findings:** A10, A11, A14, A15, A24. + +Centralize owned-runtime transitions for chat, benchmarks, qualification, probes +and candidate work. Await shutdown/reuse decisions before starting a replacement. +An explicitly chosen executable is authoritative; missing or incompatible paths +get a direct recovery action. Keep automatic discovery an explicit selection. + +Share effective access-policy checks between CLI and TUI at extension entry +points. Retain process-group ownership after the leader exits and use bounded +TERM/KILL/reap transitions. Scope per-launch credentials or supported private +sockets to the owned inference process, including health/tokenization requests. + +**Acceptance:** no extra owned model process during idle-connected benchmark or +qualification; missing selected runtime launches no fallback; correct Full access +still executes arbitrary selected tools. Review/Guided extension probes launch no +process or HTTP request. All bounded MCP helpers are gone after failure/cancel/ +close. A competing listener cannot impersonate owned-runtime readiness. + +## F08 — Complete model import and provider parity + +**Priority:** before promoting model compatibility. **Findings:** A12, A13. + +Parse bounded GGUF metadata, discover complete numbered shard sets, verify every +member and record aggregate size plus architecture/context metadata. Keep imported +originals in place. Complete authenticated Ollama across inventory, initialization, +streaming native tools, cancellation and reconnect. Build a provider capability +record from observations; label unsupported or unknown tokenization/context fields. + +**Acceptance:** truncated metadata, missing/mismatched/changed shards and malformed +counts fail before loading. Valid single/split files remain supported. One exact +authenticated configuration passes the entire adapter journey; incorrect credentials +fail consistently. Test actual Ollama/LM Studio versions when available and retain +protocol-fixture results as a separate category. + +## F09 — Make the beginner journey complete by keyboard + +**Priority:** release usability. **Findings:** A18, A19, A21; related A04/A20. +**Depends on:** F03 and F07. + +Use one action registry for buttons, shortcuts, menus and command-palette entries. +Add unambiguous manual model-ID entry and keyboard allowance/reconnect recovery. +Make network operations cancellation-aware; suppress results from canceled or +superseded operations. Use responsive/scrollable forms with visible focus and +explicit oversized-paste feedback plus file-reference alternatives. + +Turn Home into a resumable next-step guide: choose project, choose/connect model, +prove the connection, prepare an actual check, send a first request, inspect result +and undo. Advanced tools remain reachable. Explain missing dependencies with a +direct action that preserves the draft and selected configuration. + +**Acceptance:** keyboard-only setup → repair → exhausted allowance → reconnect → +undo at 80×24 and 60×18; all critical dialogs survive resize/long paths/Unicode. +Canceled inventory returns control within one second and never reopens a dialog. +Run five uncoached novice sessions and report completion, time and interventions. + +## F10 — Fit 7B/9B models to the actual computer + +**Priority:** performance and accessibility. **Depends on:** F07 and F08. + +Use exact model metadata, available RAM/VRAM, context, KV type and offload to +propose a small set of candidate configurations. Make estimates visibly distinct +from measurements. Run a short explicit calibration that records loading time, +time to first token, prompt/decode rates, peak memory and actual offloaded layers. +Keep CPU operation, Pascal-compatible CUDA 12 and newer backends available. + +Support cancellable configurable loading deadlines and controlled warm runtime +reuse. Preserve artifact-integrity guarantees; a changed model/settings identity +forces appropriate verification and reload. Proposals require an explicit choice; +never silently switch model, quantization, runtime or inference allowance. + +**Acceptance:** low-memory/slow-start/unsupported-kernel fixtures fail clearly; +cold and warm results are reported separately. The real hardware matrix covers +GTX 1070 sm_61, an older CPU-only computer and a newer GPU with the same 7B/9B Q4 +tasks at 4K/8K. Physical results remain a PC handoff until actually measured. + +## F11 — Make long-lived state and installation recoverable + +**Priority:** release blocker. **Findings:** A16, A17, A27. + +Separate indispensable recovery state from archival inference payloads. Add +inference-session retention/export, storage budgets, a reclaimable-space preview +and supported remediation before backup limits. Preserve active sessions and +integrity/cost receipts. Use streaming backup with a defined consistent generation +across databases, reports and configuration; validate restoration during activity. + +Stage and verify a complete installation generation before activation. Preserve a +coherent prior binary/documentation/manifest generation, and state precisely which +generation is active after any interruption. + +**Acceptance:** a persistent-state run with thousands of sessions can retain, +backup, upgrade and restore without manual deletion. Inject disk-full, permission, +destination-conflict and interruption failures throughout installation. Each result +has a complete usable generation or explicit recoverable state; inference evidence +retention cannot remove active work or corrupt a check's provenance. + +## F12 — Ship a smaller package and an intelligible evidence catalog + +**Priority:** delivery efficiency. **Finding:** A25; evidence-collection gap. + +Ship concise offline user help, required licenses, manifests and the PC recorder. +Publish historical research/evidence separately with checksums, an index and +links from the app documentation. Preserve all old failures and source identities. +Give each CI stage a versioned receipt and automatic failure-log retention, even +when setup fails before `dist` exists. + +**Acceptance:** reduce installed historical documentation by at least 90%; first +run and recovery help remain available offline. Every baseline archive file is +accounted for in the separate evidence manifest. Inject setup/package/preflight +failures and obtain an actionable commit-indexed receipt automatically. Measure +installation time and disk footprint on constrained hardware. + +## F13 — Establish a real coding-quality baseline and longevity gate + +**Priority:** start the baseline before capability changes. **Finding:** A26/A27. + +Declare development, validation and final held-out task families. Include repair, +feature work, repository navigation, numeric boundaries, configuration, multi-file +changes, middle-turn corrections and dirty workspaces. Freeze exact uncensored +7B/9B artifacts, runtime, sampler, tools, native context and total effort. Use at +least 30 held-out families and three repetitions per family/model, with a complete +attempt manifest. Report uncertainty by task family; repetitions are not new +independent problems. This is a planned, budgeted campaign, not a quick smoke test. +Use small shards for iteration; publish all intended, failed and unperformed runs. +Establish the development/validation baseline first. Freeze candidate code and +presets before inspecting final held-out results, including the final baseline; +retain all attempts without using that final comparison for further tuning. + +Compare baseline and candidate under matched budgets and shared checkpoints. +Report verified task success, unsupported completion claims, native-tool failures, +interventions, latency, prompt/output cost and peak resources. Add one persistent +workspace longevity run covering indexing, many conversations/projects, external +edits, cancellation, retention, backup, migration and update. + +**Acceptance:** aggregate counts derive from immutable per-attempt records; no +selective successful-subset promotion. Final held-out results do not select prompts, +training data or adapters. Software release readiness and qualified model presets +have separate badges. The target lift is 15 percentage points at matched effort; +publish uncertainty and regressions even when the target is missed. + +## F14 — Train only after the harness and corpus are qualified + +**Priority:** later optimization. **Depends on:** F01–F08 and F13. + +Capture real successful repairs/recoveries with rights/privacy/correctness review, +family separation and complete failed-attempt accounting. Meet at least the current +32-training/8-validation-family floor before starting useful SFT. Qualify the exact +full-precision architecture loader and supported GPU path; inference Q4 GGUF files +are not training checkpoints. + +Compare the untrained and trained parent model first, then evaluate the exported +Q4 artifact separately. Include instruction-following and uncensored-model behavior +regressions alongside coding quality. Distillation or preference optimization is +an optional experiment after data suitability and baseline evaluation are known. + +**Acceptance:** reproducible dataset manifest, reviewed family splits, actual +training/resume/export receipts and a sealed independent comparison. A completed +training job alone does not qualify an improvement. Current status remains no +trained weights and no promoted quality preset. + +## Delivery order + +| Increment | Orders | Exit condition | +| --- | --- | --- | +| Baseline capture | F13 initial manifest, existing negative repros | Current defects and exact model conditions are frozen before changing behavior | +| Trust and durability | F01–F03, F07, F11 | All reproduced preservation, wrong-source, ownership and update defects have meaningful passing regressions | +| Model assistance | F04–F06 | Matched task results show the effect of requirements, retrieval, diagnostics and edit contracts | +| Beginner/older-PC finish | F08–F10, F12 | Complete keyboard onboarding, measured model fit and smaller verified package | +| Qualification and training | F13 final comparisons, then F14 if prerequisites pass | Honest per-model gains, long-lived-state evidence and no unmeasured promotions | + +Implement shared profile patches, action dispatch, process ownership and evidence +commit incrementally behind existing interfaces. Avoid a wholesale rewrite that +would discard the existing tests and obscure which change improved outcomes. diff --git a/docs/LIVE_EVALUATION.md b/docs/LIVE_EVALUATION.md index d3dc3ea2..050b2ac3 100644 --- a/docs/LIVE_EVALUATION.md +++ b/docs/LIVE_EVALUATION.md @@ -169,6 +169,13 @@ in `scripts/acceptance_projects.py`. These are tiny controlled projects, not a representative coding benchmark or proof of general pentesting capability. ```bash +0.7 labels: `--artifact-label uncensored|standard|hosted` is required and recorded +as given (`--uncensored` remains an alias). Hosted runs pass `--endpoint`, +`--model-id` and `--api-key-env NAME` and need no local file hash. `--thinking-level` +and `--dialect` apply the A01 reasoning choice; `--check-args` validates a command +without hashing files or issuing requests. The matched 0.7 PC matrix is +`scripts/pc_matrix_0_7.sh` (see [PC handoff](PC_HANDOFF_0.7.md)). + python3 scripts/live_acceptance.py \ --binary target/portable-glibc231/release/alt \ --engine /path/to/goose --runtime /path/to/llama-server \ diff --git a/docs/PC_HANDOFF_0.7.md b/docs/PC_HANDOFF_0.7.md new file mode 100644 index 00000000..736e9472 --- /dev/null +++ b/docs/PC_HANDOFF_0.7.md @@ -0,0 +1,70 @@ +# 0.7 owner-PC handoff: A08 (CUDA 12 runtime) and A10 (matched re-run) + +Prepared in the cloud with fixtures only; nothing here has been run on a GPU. +Reference PC: Linux, GTX 1070 8 GB (compute 6.1), 16 GB RAM. + +## Before you start + +```bash +git checkout cloud/0.7-2026-10-11 # or main after the PR merges +cargo build --locked --release +bash scripts/setup-cloud.sh # optional full gate run; needs /workspace +``` + +Free the GPU first (close other GPU programs; `ollama stop `). Every step +below keeps its raw output under the folder you choose; record failures too. + +## A08: verify and pin a CUDA 12 runtime + +1. Build: `scripts/build-pascal-runtime.sh ~/llama-cuda12` (CUDA 12.x toolkit, + driver 525.60+; CUDA 13 cannot target sm_61). +2. Check it on this PC with a model you already have: + `ALT_BINARY=target/release/alt scripts/pc_cuda_check.sh ~/llama-cuda12/build/bin/llama-server /path/to/MiMo-9B-Q4_K_M.gguf ~/alt-cuda-check` + Expect `--list-devices` to show `CUDA0: … GTX 1070`, the benchmark to finish, + and about 6.3 GB VRAM used at 16K with q8 KV (the 2026-10-08 trial value). +3. Pin it for automatic installation (optional): + `scripts/pin_cuda_runtime.py ~/llama-cuda12/build/bin ~/alt-pins` prints a + deterministic archive, its SHA256/size and the exact `pub const CUDA12` value. + Check the licence notes it prints (llama.cpp is MIT; bundling `libcudart` / + `libcublas` needs `--bundle-cuda-libs` and the NVIDIA CUDA EULA's + redistribution terms). Upload the archive as an alt-cli release asset, replace + `None` in `src/runtime.rs` with the printed value and its real URL, run + `cargo test --test cuda_runtime`, and open a PR. +4. In Alt: Settings → Runtime → **GPU runtime (CUDA 12)**. CPU stays the default; + installing never selects the CUDA runtime or changes GPU layers. + +## A10: matched re-run of the 2026-10-08 trial + +`scripts/pc_matrix_0_7.sh` runs suite v5 (8 cases), 16K context, compact tools, +4,096 output tokens, 3 repeats, two arms (`trial` = the trial's settings, +`thinking-off` = A01) for: + +| Cell | Where | Label | +| --- | --- | --- | +| Spark-X2.5 4B Q8 abliterated | Ollama, GPU | uncensored | +| MiMo V2.6 Distill 9B Q4_K_M abliterated | llama.cpp CUDA 12 (managed by Alt) | uncensored | +| MiMo V2.6 Distill 9B Q4_K_M standard | llama.cpp CUDA 12 (managed by Alt) | standard | +| moonshotai/kimi-k3, z-ai/glm-5.3 | NVIDIA NIM | hosted | + +```bash +bash scripts/pc_matrix_0_7.sh --dry-run # prints and validates every cell; runs nothing +export GOOSE=~/.local/share/alt-cli/tools/goose ALT_BIN=$PWD/target/release/alt +export LLAMA_CUDA=~/llama-cuda12/build/bin/llama-server +export MIMO_ABL=/models/mimo-abliterated.gguf MIMO_ABL_SHA= +export MIMO_STD=/models/mimo-standard.gguf MIMO_STD_SHA= +export SPARK_TAG= NVIDIA_API_KEY= +bash scripts/pc_matrix_0_7.sh # results in ./pc-matrix-0.7-/ +``` + +Before each GPU cell the script checks free VRAM (6,800 MiB for MiMo, 5,200 MiB +for Spark; change with `MIMO_NEED_MIB`/`SPARK_NEED_MIB`) and records a skip +instead of starting. It unloads Spark from Ollama between cells and stops any +llama-server it started. `ledger.jsonl` records every cell, including skips and +non-zero exits. Labels are recorded as given (`--artifact-label`); hosted runs +need no local file hash. + +Report: compare per-model pass counts with the trial table in +`docs/research/2026-10-08-pc-model-trial/README.md`, keep failure classes +(budget / wrong / timeout / provider fault / thinking cutoff), and treat +one-task differences as noise. Raw run folders hold full request logs; keep +them off git and publish summaries (`scripts/check_repo_weight.py` enforces 1 MiB). diff --git a/docs/README.md b/docs/README.md index d95d8827..250b9835 100644 --- a/docs/README.md +++ b/docs/README.md @@ -16,6 +16,13 @@ ## Developing and evaluating +- [0.7 owner-PC handoff](PC_HANDOFF_0.7.md): A08 CUDA 12 runtime and the A10 matched re-run. +- [0.7 work orders and board](WORK_ORDERS_0.7.md): A01–A10, open audit items + B01–B21 and harvested H01–H02, from the + [2026-10-08 PC model trial](research/2026-10-08-pc-model-trial/README.md). +- [Final beta 3 audit](FINAL_AUDIT_2026-10-08.md) and + [F01–F14 work orders](FINAL_PASS_WORK_ORDERS.md): findings, bounded reproductions + and acceptance criteria. - [Small-model implementation plan](SMALL_MODEL_IMPLEMENTATION_PLAN.md): combined harness/reasoning work orders and 7B/9B Q4 qualification. - [Small-model delivery](SMALL_MODEL_DELIVERY.md): implemented work orders, diff --git a/docs/SMALL_MODEL_USAGE.md b/docs/SMALL_MODEL_USAGE.md index 24becf00..5de6bd8e 100644 --- a/docs/SMALL_MODEL_USAGE.md +++ b/docs/SMALL_MODEL_USAGE.md @@ -126,6 +126,33 @@ replace a handle instead of reproducing a large exact old string. Stale handles and concurrent user edits fail without overwriting the new file. Unsupported syntax still has an exact-text fallback. File changes keep diff/checkpoint/undo. +## Control thinking on any server + +Thinking models can spend the whole output allowance reasoning and never act. In +the 2026-10-08 PC trial, Spark 4B at 1,024 output tokens made no tool call on 8/8 +tasks. Choose one **Thinking** setting (Settings → Models → Thinking, Ctrl+P → +*Model thinking*, or `alt inference --thinking off|low|medium|high|default|budget:N`). +Alt translates it into fields the server understands: + +| Server dialect | Fields sent | +| --- | --- | +| llama.cpp (owned runtime, or declared) | `chat_template_kwargs.enable_thinking` + `reasoning_budget_tokens` (low ¼, medium ½, high all of the output minus action headroom) | +| Ollama | `think` + `reasoning_effort` | +| vLLM / SGLang / NVIDIA NIM | `chat_template_kwargs.enable_thinking` and `.thinking` + `reasoning_effort` | +| OpenAI-style | `reasoning_effort` | + +*Automatic* picks llama.cpp for owned models, Ollama for Ollama connections and +`reasoning_effort` otherwise; set the dialect explicitly with *Server dialect for +thinking* or `alt inference --dialect chat-template`. *Server default* sends no +field. A token budget is llama.cpp-only. Each request receipt records the exact +fields sent. + +When a response ends at the output limit with reasoning but no answer and no tool +call, Alt marks a **thinking cutoff**. The spent tokens stay charged and nothing is +resent. The TUI offers *Resend with thinking off*, *Resend with low thinking* (this +connection only; your message returns to the composer) or *Raise the output +allowance*. Headless `--json` emits a `reasoning_cutoff` event with the same choices. + ## Explore alternatives under one allowance Choose **Explore verified candidates** in the same settings menu. Describe the diff --git a/docs/WORKSPACE_GUIDE.md b/docs/WORKSPACE_GUIDE.md index 7e807275..55b4096a 100644 --- a/docs/WORKSPACE_GUIDE.md +++ b/docs/WORKSPACE_GUIDE.md @@ -99,8 +99,9 @@ alt --access trusted jobs start 'cargo test' --wait --timeout 300 Use `alt plain` for a plain terminal conversation with per-action approval and `/quit` to leave. Use `alt run ... --json` for scripts. Headless tool permission is -denied unless `--allow-tools` is supplied; Full access is separately selected with -`--access trusted`. JSON includes verification independently of the model answer. +denied unless `--allow-tools` is supplied; it covers project actions only, and +terminal or external tools need `--allow-terminal`. Full access is separately +selected with `--access trusted`. JSON includes verification independently of the model answer. ## Verification, memory and context diff --git a/docs/WORK_ORDERS_0.7.md b/docs/WORK_ORDERS_0.7.md new file mode 100644 index 00000000..cb664a0f --- /dev/null +++ b/docs/WORK_ORDERS_0.7.md @@ -0,0 +1,227 @@ +# 0.7 work orders: any model, any server, as strong as possible + +Owner direction (2026-10-08): Alt stays public. It must accept and get the best out +of whatever model a user brings: local GGUF, Ollama, LM Studio, llama.cpp, vLLM and +hosted OpenAI-compatible APIs such as NVIDIA NIM (`NVIDIA_API_KEY`). Uncensored, +abliterated and standard checkpoints are all first-class. Evidence: +[2026-10-08 PC model trial](research/2026-10-08-pc-model-trial/README.md). + +Rules for every order: keep the evidence discipline (model prose is never the +verification authority; failures are retained). Never silently switch the selected +model, provider or access mode. Every new parameter is an explicit user choice or +a labelled suggestion. Each order ships tests, strict Clippy, fmt and docs. The +cloud has no GPU, no local weights and no API keys: prove behaviour with +deterministic fixture servers (`tests/fixtures/`), not live models. Live +re-measurement (A10) runs on the owner PC. + +| Order | Deliverable | Depends | +| --- | --- | --- | +| A01 | Provider-aware reasoning control and reasoning-cutoff recovery | | +| A02 | Open parameter surface for requests and the owned runtime | | +| A03 | Provider presets and hosted model discovery | | +| A04 | Hosted-provider resilience: retries and degenerate-output detection | | +| A05 | Model capability probe with suggested settings | A01, A02 | +| A06 | Small-model edit robustness | | +| A07 | Security fixes from the 2026-10-08 audit | | +| A08 | Managed CUDA 12 runtime option (Pascal sm_61 and newer) | | +| A09 | Repository weight and public-facing README | | +| A10 | Harness labels and matched re-run script (owner PC executes) | A01–A06 | + +## A01 Provider-aware reasoning control + +Measured: the relay sends only llama.cpp's `reasoning_budget_tokens`. Spark-X2.5 4B +on Ollama with 1,024 output made zero tool calls on 8/8 tasks; every token was +`reasoning`. GLM 5.3 on NVIDIA exhausted 4,096 tokens on 3/8 tasks. + +- One setting `thinking = default | off | low | medium | high | budget(N)`, mapped + per provider: Ollama native `think` and `/v1` `reasoning_effort`; llama.cpp + `chat_template_kwargs.enable_thinking` + `reasoning_budget`; vLLM / SGLang / NIM + `chat_template_kwargs` (`enable_thinking`, `thinking`); OpenAI-style + `reasoning_effort`. The receipt records which fields were sent. +- Detect a response ending at the output limit with reasoning but no content and + no tool call. Offer a labelled recovery (resend with thinking off, or a larger + allowance); in headless `--json`, emit a typed event. Never retry silently; the + spent tokens stay charged. +- Acceptance: fixture asserts the outgoing body for each provider shape; fixture + reproduces reasoning-only cutoff and the recovery event. + +## A02 Open parameter surface + +Measured: only temperature/top_p/top_k/min_p reach the server, and +`src/inference.rs` removes `options`, so the profile context never reaches Ollama. +The owned llama-server launch (`src/runtime.rs`) is a fixed argument list. + +- Request: repeat/presence/frequency penalty, seed, stop, typical_p, and a + per-profile `extra_body` JSON object merged last. Refuse keys Alt owns (`model`, + `messages`, `tools`, `stream`, output-token fields) with a clear message. +- Ollama: send `options.num_ctx` from the profile context and `keep_alive`, unless + the user picks "server default". Show the effective value read from `/api/ps`. +- Owned runtime: named settings for `--mmproj`, `--n-cpu-moe` / `--override-tensor`, + `--tensor-split`, `--main-gpu`, rope/YaRN scaling, `--mlock` / `--no-mmap`, + chat-template file, speculative decoding (draft model or n-gram), plus an + `extra_args` list. Refuse `--host`, `--port`, `--api-key`, `--alias`. +- TUI: "Advanced parameters" in Alt+6 with labelled fields and a raw JSON view. + CLI: `alt params set|unset|show`. +- Acceptance: merge-order and refusal unit tests; fixture proves Ollama receives + `num_ctx`; golden test of the runtime argv. + +## A03 Provider presets and hosted discovery + +- Presets filling endpoint and key variable name: NVIDIA NIM + (`https://integrate.api.nvidia.com/v1`, `NVIDIA_API_KEY`), OpenRouter, Groq, + Together, DeepSeek, Mistral, Gemini OpenAI-compatible, Cerebras, LM Studio, vLLM, + llama.cpp, Ollama, Custom. +- Model picker from `GET /models` with search. Keys remain env-var references only. +- Acceptance: `alt init --preset nvidia --model z-ai/glm-5.3` works headless; + test that no key value is ever written to state, logs or evidence. + +## A04 Hosted-provider resilience + +Measured: NVIDIA `moonshotai/kimi-k3` streamed garbage with leaked template tokens +on 2/8 tasks; replays gave about 1 in 5 garbage at any temperature, plus HTTP 429. + +- Retry 429 / 5xx / connection reset with capped exponential backoff honouring + `Retry-After`; count retries in the receipt. +- Degenerate-output detector (leaked `<|...|>` template tokens, high mixed-script + ratio versus the conversation). Discard and resend once, recorded as a provider + fault, never as model output. +- Acceptance: fault-injection fixtures in `tests/faults.rs` for each case. + +## A05 Model capability probe + +- On connect, a bounded probe: one tool call, thinking detection, native context + from `/props` (llama.cpp) or `/api/show` (Ollama), output-limit behaviour. + Suggest settings (thinking mode, output allowance, compact tools) as labelled + choices; store per model identity. Never apply without the user's choice. +- Acceptance: probe fixtures for llama.cpp, Ollama, OpenAI-compatible. + +## A06 Small-model edit robustness + +- `replace_file`: handle-bound whole-file rewrite of an already-read file under + about 300 lines, in the compact profiles. Whole-file edits are the most reliable + format for models under about 14B. +- `old_text` replace: exact, then whitespace-normalised; on miss return the closest + current span with its handle. +- Acceptance: unit tests; A10 measures the effect. + +## A07 Security fixes (audit 2026-10-08: no critical or high) + +1. "Trust session" and `--allow-tools` must not auto-approve `terminal` or external + extension calls; add a separate explicit opt-in (`--allow-terminal`). + (`src/tui/app.rs` approval handling, `src/main.rs` headless approval.) +2. Refuse edits under the Alt data directory; warn when the project root is `$HOME` + or `/` (`src/project.rs` exclusion list, `check_path`). +3. Extend excluded secret names: `.netrc`, `.npmrc`, `.pypirc`, `id_rsa*`, + `id_ed25519*`, `.envrc`, `credentials*.json`, `.docker/`. +4. Compare excluded names case-insensitively. +5. Plain-HTTP extensions with `auth_env` only on loopback (`src/extensions.rs`). +6. Start the owned llama-server with a random `--api-key` (`src/runtime.rs`). +7. CI: `persist-credentials: false` on write jobs; `--require-hashes` in + `scripts/setup-cloud.sh`; `SECURITY.md` names the current line; note that + GitHub private vulnerability reporting must be enabled by the owner. + +## A08 Managed CUDA 12 runtime + +The managed runtime download is CPU-only. On the reference GTX 1070 a CUDA 12 +llama.cpp build ran MiMo 9B Q4 fully offloaded at 16K with q8 KV in about 6.3 GB. +Add a pinned, checksummed CUDA 12 runtime option with GPU detection. CPU stays the +default; never auto-switch. Prove download/verify/launch argv with fixtures. + +## A09 Repository weight and README + +`docs/` is 176 MB and 9,129 files, mostly raw evidence. New raw evidence goes to +release assets; git keeps summaries. Do not rewrite history. Open the README with +what a new user needs: install, connect a model (local or hosted preset), first task. + +## A10 Harness labels and re-run script + +- Replace the mandatory `--uncensored` in `scripts/live_acceptance.py` with + `--artifact-label {uncensored,standard,hosted}`, recorded truthfully; hosted runs + need no local file hash. +- Add `scripts/pc_matrix_0_7.sh` that runs the research-note matrix (8 cases, 16K, + compact, 4,096 output, 3 repeats) for Spark 4B (Ollama), MiMo 9B abliterated and + standard (llama.cpp CUDA), and two NVIDIA models, checking + `ora-can-i-start`-style GPU headroom first and stopping every server it starts. + The owner PC runs it; the cloud only verifies it with `--dry-run`. + +## Board on main (2026-10-11) + +Base: `main` = 0.6.0 + Neon N01–N09 ([NEON_WORK_ORDERS.md](NEON_WORK_ORDERS.md)). +Three unmerged branches were reviewed and harvested by hand, never merged: + +- `review/2026-10-08`: this file and the [trial note](research/2026-10-08-pc-model-trial/README.md) + (brought over unchanged above this section). Its `--api-key-env` harness change is + carried by A10. +- `audit/final-pass-2026-10-08`: [final audit](FINAL_AUDIT_2026-10-08.md), + [F01–F14 work orders](FINAL_PASS_WORK_ORDERS.md) and their small bounded + evidence. Every finding is still open on `main`: the implementation commit on + the build branch (`bb34872`) was never merged. Open items are numbered B01–B21 + below. Audit finding IDs are written `audit A05` so they do not collide with + the 0.7 orders A01–A10. +- `build/final-pass-2026-10-08`: saved themes and layouts overlap N03/N08 (main's + theme engine wins). The graphical Home dashboard is not in main and becomes + H01. Its F01–F14 implementation (`bb34872`, about 44k lines including + evidence) predates the Neon TUI and conflicts with it throughout `src/tui`; it is + kept as a reference implementation for the deferred B orders, not cherry-picked. + +### Audit items (B) and harvest (H) + +| Order | Audit finding | Deliverable | Overlap with N01–N09 / 0.7 | Plan in this cycle | +| --- | --- | --- | --- | --- | +| B01 | audit A03 | Editing a connection keeps its context, steps, inference settings and uncensored claim (typed patch, not a rebuilt profile) | none | build | +| B02 | audit A04 (part) | Text typed while the first connection starts is never overwritten by the submitted prompt | none | build | +| B03 | audit A13 | Authenticated Ollama works end to end (the relay already sends the bearer key) | A03 hosted providers | build with A03 | +| B04 | audit A14 | Headless `extensions check` refuses to start the host program unless access is Full | A07 | build with A07 | +| B05 | audit A24 | Owned llama-server gets a per-launch API key; readiness must authenticate | A07 item 6 | build with A07 | +| B06 | audit A10 | An explicitly selected runtime or engine path never silently falls back to another binary | none | build | +| B07 | audit A18 | Manual model ID entry is not on Ctrl+M (terminals send Enter); allowance recovery reachable by keyboard | N06 palette already lists *Inference allowance* (partly done) | build the manual-entry part | +| B08 | audit A19 | A cancelled connection check never reopens the model dialog | none | build | +| B09 | audit A12 | GGUF import rejects a magic-only/truncated header | none | build | +| B10 | audit A21 | Oversized paste gives visible feedback instead of being silently dropped; 60×18 form overlap | N04 keeps the 60×18 notice (partly done) | build the paste feedback; 60×18 form deferred | +| B11 | audit A25 | Smaller package: installed historical evidence | A09 | build with A09 (package excludes evidence) | +| B12 | audit A01, A08, A09, A20, A23 | F01: verification describes the executed source; spooled receipts; env freshness | none | deferred, needs design review; reference `bb34872` | +| B13 | audit A02, A28 | F02: displaced edits and file modes preserved across apply/undo races | A06 touches edit tools only | deferred | +| B14 | audit A04 (rest) | F03: durable per-session drafts across New/quit | none | deferred | +| B15 | audit A05 | F04: evolving task contract in Compact mode | none | deferred | +| B16 | audit A06, A07, A22 | F05: retrieval not suppressed by a filename; diagnostics mapped to the right crate | A06 edit robustness is adjacent | deferred | +| B17 | audit A11, A15 | F07: one owner for runtimes during benchmark/qualification; MCP helper reaping | none | deferred | +| B18 | audit A16, A17, A27 | F11: inference-trace retention, staged install generations | none | deferred | +| B19 | audit A26 | F13: matched baseline campaign | A10 prepares the PC script | owner PC | +| B20 | — | F14: training only after qualification | none | deferred | +| B21 | audit A22 (scripts) | Instruction optimiser reads stdout as well as stderr | none | deferred with B16 | +| H01 | — | Graphical Home dashboard from `build/final-pass` (status cards and action card grid on wide terminals, list at 80×24), drawn through main's theme engine | N03/N04 own the theme; Home layout itself is not in N01–N09 | build | +| H02 | — | Custom accent color from `build/final-pass` | N03 themes | deferred (theme engine owns colors) | + +Order of work: board (this section) → A07 (+B04, B05) → A01 → A02 → A03 (+B03) → A04 → +A05 → A06 → A09 (+B11) → A08 and A10 prepared for the owner PC → B01, B02, B06–B10, H01. + +## Status (cloud, 2026-10-11) + +Branch `cloud/0.7-2026-10-11`; fixtures only (no keys, no GPU, no weights). Every +commit ran fmt, strict Clippy, `cargo test`, the TUI smoke scripts relevant to it and +a secret scan; the final head passed the complete `scripts/setup-cloud.sh` (173 Rust +tests, 72 Python unit tests, all TUI/Goose/compact/stream-recovery smokes). +Screenshots per order are in `docs/screenshots/0.7//` at 80×24 and 120×40. + +| Order | Commit | Result | Deferred | +| --- | --- | --- | --- | +| Board | a9318a4 | Work orders, trial, audit and harvest plan on main; every setting in the palette | — | +| A07 | 7bed166 | Scoped trust and `--allow-terminal`; data folder protected; case-insensitive secret names; loopback-only plain HTTP auth; runtime API key file; headless extension check needs Full (B04, B05); hashed dev requirements | `persist-credentials: false` on the three evidence jobs that `git push` | +| A01 | 3508ee8 | Thinking control per dialect; cutoff detection, labelled recovery, typed headless event | — | +| A02 | 190a4c1 | Penalties, seed, stop, typical-p, extra JSON; Ollama `num_ctx` + `/api/ps` read-back; named llama-server options; `alt params` | Whether a given Ollama version honours `num_ctx` on `/v1` is measured on the PC (Alt reports what loaded) | +| A03 | f801b52 | 13 presets, `alt init --preset`, catalog search; key never stored (smoke-proven); B03 Ollama auth | — | +| A04 | 9ba7be1 | Retries with Retry-After; output guard discards degenerate output once | — | +| A05 | 86c1ab8 | Bounded probe with labelled, opt-in suggestions | — | +| A06 | 76529ee | `replace_file`; whitespace-tolerant `old_text` with closest-span handle | Effect measured by A10 | +| A09 | f322b8f | New-user README; package docs 96% smaller (B11); weight rule in CI | — | +| A08 | 93b788c | GPU detection, pinned installer, explicit selection, pin and PC check scripts | Pin slot empty until a build is verified on the owner PC | +| A10 | eb02759 | Truthful labels; `pc_matrix_0_7.sh` validated by `--dry-run` | The run itself (owner PC) | +| B01 | 518518c | Connection edits keep custom settings | — | +| B02 | ccf9807 | Text typed while connecting is kept | Durable drafts across New/quit (B14) | +| B06 | 258374f | Selected runtime/engine never falls back | — | +| B07 | 73812c4 | Manual model ID on Alt+M and a button | — | +| B08 | 999b3f2 | Cancelled connection check opens nothing | — | +| B09 | 6acd751 | GGUF fixed-header validation | Import shard-set discovery (with B12) | +| B10 | 05ea611 | Oversized paste explained | 60×18 connection form | +| H01 | 6042ae4 | Home dashboard on wide terminals | H02 custom accent colour | +| B12–B21 | — | Not started this cycle | F01, F02, F03 rest, F04, F05, F07 rest, F11, F13, F14; reference implementation in `build/final-pass-2026-10-08` (`bb34872`) | diff --git a/docs/evidence/final-audit-2026-10-08/MANIFEST.json b/docs/evidence/final-audit-2026-10-08/MANIFEST.json new file mode 100644 index 00000000..9fcf439a --- /dev/null +++ b/docs/evidence/final-audit-2026-10-08/MANIFEST.json @@ -0,0 +1,287 @@ +{ + "schema": 1, + "algorithm": "sha256", + "scope": "Retained final-audit evidence excluding MANIFEST.json itself", + "files": [ + { + "path": "README.md", + "bytes": 1934, + "sha256": "556e2ebad32e93fc5a80d98a3f53eb13ee84ad000372e2d921c686d33cfc2baf" + }, + { + "path": "SUMMARY.json", + "bytes": 8417, + "sha256": "71bd6e95f4957759f5c0ae3692beee76796a7d6719e8fc6f2d506e25ef4a5bbc" + }, + { + "path": "correctness/AUDIT.md", + "bytes": 10746, + "sha256": "4e63e16a3b1c53ecf3ef600115f16408e8e40ab9957b1f839907b42d126f2edc" + }, + { + "path": "correctness/build-info.json", + "bytes": 5951, + "sha256": "ea884965e80404624b1e0bacf96d17b50354bab9afe97dce18b17e02ced926db" + }, + { + "path": "correctness/checkpoint.rs", + "bytes": 1385, + "sha256": "486112f7df33e87b3766de5d79a0ec854dd4f85cb8240734b9ee452bedc81804" + }, + { + "path": "correctness/concurrent_edit.c", + "bytes": 756, + "sha256": "69478d0185bd5c86d7a6cad2c3668934ccd5f0ac98a109d30660d39685873a64" + }, + { + "path": "correctness/environment.json", + "bytes": 5198, + "sha256": "f2d222f7368f6e868fe5b811550cf2015df7771eab62db42e3d199454a616a90" + }, + { + "path": "correctness/locked-evidence.json", + "bytes": 1631, + "sha256": "7f23d4f98e7b8a44b24dc64db0d08a96f38e2decc4239ad88aaeb04d2453d3ad" + }, + { + "path": "correctness/mutating-source.json", + "bytes": 4942, + "sha256": "041cba7c07069bd1fd47b0fc3b694260bca246ed33c73ccdfdc0c768cfaf626a" + }, + { + "path": "correctness/permissions-checkpoint-repro.json", + "bytes": 181, + "sha256": "800901e584b5e1bb839c269d9cfca6d0676401574111cebe15d00ec7fd674a97" + }, + { + "path": "correctness/placeholder-setup.json", + "bytes": 475, + "sha256": "6032b005506410fd080c88b7b98bd69ba75f49b0bfaedbe41eb56a534a3609f2" + }, + { + "path": "correctness/race-checkpoint-repro.json", + "bytes": 220, + "sha256": "046ae79a7fce72cce5d98e74d84383a8ffd65b9746831792fece9d8202603fcb" + }, + { + "path": "correctness/reproduce_cli.py", + "bytes": 4207, + "sha256": "eec6abec1024ce4922d6488bdb0aaa41a2f77c9bf4e174fb082cb6ce14456d26" + }, + { + "path": "delivery/delivery-receipt.json", + "bytes": 2903, + "sha256": "9b5ff77d81e878eb720c23a95c753f1c6bfcb32e5ec6fe5bac8706117306efdf" + }, + { + "path": "delivery/reproduce_delivery.py", + "bytes": 4495, + "sha256": "6aa9fcf5387d4254eedc74f421ab5b846b0e2f3f5452ae045728ef441bebb065" + }, + { + "path": "harness/replay.rs", + "bytes": 1377, + "sha256": "033d17ca29e68052d2e3c9b82a35868022fe5ff3450ffb3605e36b1b2b7a7536" + }, + { + "path": "harness/replay.txt", + "bytes": 721, + "sha256": "a6fff9ce35f11fc0a7b392a22d2d480913815e4293c7db0a285ec839e840a6a6" + }, + { + "path": "mcp/README.md", + "bytes": 2150, + "sha256": "c9550092b3c738f70c0301e96140ff539710c5efdbe48c653d353c3015f8b81f" + }, + { + "path": "mcp/helper-report.json", + "bytes": 225, + "sha256": "37337cfa50a6c83253306906aed0ff2f62c8c58192d711005f04a6b51799514d" + }, + { + "path": "mcp/mcp-helper-fixture.py", + "bytes": 687, + "sha256": "abd6b3086595f87ed64e3d73745dac34bb9bf755a739ca82f190db71d1b81d7f" + }, + { + "path": "mcp/mcp-marker-fixture.py", + "bytes": 410, + "sha256": "4f8daf17e4c908687aa8af664bec826554b96ee2c2dec9223321071bc54bdea0" + }, + { + "path": "mcp/policy-report.json", + "bytes": 539, + "sha256": "e76a93fe43e0e908634889c9d9410435846f7644b625c4929a4ebf176b90243e" + }, + { + "path": "mcp/replay-report.json", + "bytes": 762, + "sha256": "092b65b83b7167a9be3354ac00459df49e0cbb521580f2419cf61bd9c76772b6" + }, + { + "path": "mcp/reproduce.py", + "bytes": 5016, + "sha256": "fb6a5f2af0b61cab85b94b289a25a2e95b4db077bfecfc8b4b76f1791713801b" + }, + { + "path": "mcp-cleanup/report.json", + "bytes": 225, + "sha256": "37337cfa50a6c83253306906aed0ff2f62c8c58192d711005f04a6b51799514d" + }, + { + "path": "mcp-cleanup/server.py", + "bytes": 687, + "sha256": "abd6b3086595f87ed64e3d73745dac34bb9bf755a739ca82f190db71d1b81d7f" + }, + { + "path": "mcp-policy/report.json", + "bytes": 539, + "sha256": "e76a93fe43e0e908634889c9d9410435846f7644b625c4929a4ebf176b90243e" + }, + { + "path": "mcp-policy/server.py", + "bytes": 410, + "sha256": "4f8daf17e4c908687aa8af664bec826554b96ee2c2dec9223321071bc54bdea0" + }, + { + "path": "runtime/REPRODUCE.md", + "bytes": 5819, + "sha256": "0bd39fafd97f8d8ac8e4a78e0319f72ace36f2988523bdf570d829bf7e09269c" + }, + { + "path": "runtime/audit-summary.json", + "bytes": 576, + "sha256": "34775eb5f4d944b4a9f53dbec6241724d33c4e1a3672066d0af39b08e838c3e7" + }, + { + "path": "runtime/benchmark.stderr", + "bytes": 48, + "sha256": "a66da80565785ef093efa18dd8821a21769bbde4f50925ce6761fac11c159ec9" + }, + { + "path": "runtime/benchmark.stdout", + "bytes": 3846, + "sha256": "b834db485629e50190e291c4adb71df74107ff03deac9c65cd152f536b9a93b4" + }, + { + "path": "runtime/import.stderr", + "bytes": 0, + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + { + "path": "runtime/import.stdout", + "bytes": 413, + "sha256": "650d5536d01ad6c05fa5f03e6780eff5cc050915d90d96c98e945636a29f3e71" + }, + { + "path": "runtime/ollama-auth-reproduction.json", + "bytes": 362, + "sha256": "f4f503331af211f7e8d2837851e27161118b4b0a44bb0a3c075f98f1533c28cb" + }, + { + "path": "targeted-existing-tests.log", + "bytes": 1844, + "sha256": "3e10baa083e6c702c5cb0613ca3b36ba746da2ee77ce2fd7183d70d60a3b46fa" + }, + { + "path": "ux/acp-delay.py", + "bytes": 3257, + "sha256": "75244688cfc62885a92fabfe024538e5ddb80e43b80f2cae635fc1668b1a78ba" + }, + { + "path": "ux/cancel-inventory-requested.txt", + "bytes": 5349, + "sha256": "293ad24208de985171c28616e75ae1d85c39be40759b4ad15110790412661ec0" + }, + { + "path": "ux/cancel-inventory-result.json", + "bytes": 88, + "sha256": "40cb7715f47a6620ed55725711d0b81bda1c1afb4b04199d65fe3496ea93e671" + }, + { + "path": "ux/cancel-inventory-result.txt", + "bytes": 5824, + "sha256": "f418aba4c97ebd9696cc19d64b610b9d01ea1c8214af89f687876aabbb5d9c3b" + }, + { + "path": "ux/cancel_inventory.py", + "bytes": 1996, + "sha256": "33d6c49ffe03fe59707535ba9cb446f82da8f087a5dcff2fbfb817e0fbf56da2" + }, + { + "path": "ux/connection-60x18.txt", + "bytes": 1814, + "sha256": "63afe1206031e1965f9d0d73a5c9538855c6e8fea34ade83fb1f4a876f216ca0" + }, + { + "path": "ux/connection-80x24.txt", + "bytes": 2975, + "sha256": "cd8e8a9dda6605b4b77507d4bcecaa6397666715a5573b7c1c13cd3efb57ef28" + }, + { + "path": "ux/connection-after.json", + "bytes": 254, + "sha256": "157c1802e4c55ecb3ade874ebbe702a27c1df39c5db2896008fa8b16bb1b5897" + }, + { + "path": "ux/connection-before.json", + "bytes": 539, + "sha256": "712304220294d911ffd617de541195edfca209980ecfdd28fe5b1d7bca5ca959" + }, + { + "path": "ux/ctrl-m-result.txt", + "bytes": 2608, + "sha256": "8d616614a9e80231327d60d51ce18c19bd041140e79d04809e37e79614f01cc7" + }, + { + "path": "ux/draft-after-connection.txt", + "bytes": 5763, + "sha256": "3e1dc8c265f9776a0f2551fe2cbdf673b73d1f30a21c2d073cea53dee6ccf2a7" + }, + { + "path": "ux/draft-after-new.txt", + "bytes": 2515, + "sha256": "e7af65716915a5cc1e69d587f87b628f7cfa635a844ccb152ecf46b1a30a4a6a" + }, + { + "path": "ux/draft-after-restart.txt", + "bytes": 2515, + "sha256": "7a340f1517e6213ade68b0cfe561c099231aef38e2e3402b783a585bee778df1" + }, + { + "path": "ux/draft-before-new.txt", + "bytes": 2515, + "sha256": "96bdb6ba9355531df4f3ec4087de3d78a7e90017550544f872631b34c90524d6" + }, + { + "path": "ux/draft-during-connect-result.json", + "bytes": 154, + "sha256": "79f3521e391099479ccd69d0d64f71423cd824a16363b479c6c800e3ba568234" + }, + { + "path": "ux/draft-during-connection.txt", + "bytes": 5769, + "sha256": "a45190f62a711286e6dfae075325f702d3892c81879a4ed4fa4660628f5266ab" + }, + { + "path": "ux/draft_during_connect.py", + "bytes": 1980, + "sha256": "acf68f21ebb5d01744f43e84e94a074023af83735836440010ed2754dd82ce8e" + }, + { + "path": "ux/edit-connection-before.txt", + "bytes": 2971, + "sha256": "5f51082f7dc175c7d1db48f2313e7d507b0c8d1d49d19d634d785a449878cacc" + }, + { + "path": "ux/reproduce.py", + "bytes": 3686, + "sha256": "c9edad09b8b8aa2292f282e959db9acecb93292e47cd452a53242149996e7a79" + }, + { + "path": "ux/results.json", + "bytes": 1401, + "sha256": "8f22e2d561f960babdd8182a0d821265bf2756a1b521d24e3c002abbfa4a830a" + } + ] +} diff --git a/docs/evidence/final-audit-2026-10-08/README.md b/docs/evidence/final-audit-2026-10-08/README.md new file mode 100644 index 00000000..815cb7f0 --- /dev/null +++ b/docs/evidence/final-audit-2026-10-08/README.md @@ -0,0 +1,31 @@ +# Final audit evidence + +These are bounded reproductions against beta 3 (`fa0c8e4`), collected for the +[final audit](../../FINAL_AUDIT_2026-10-08.md) and its +[work orders](../../FINAL_PASS_WORK_ORDERS.md). + +- `correctness/`: real CLI verification, environment, lock and configuration + replays; a Rust checkpoint harness and narrowly targeted C fault interposer; + exact build identity and before/after receipts. +- `ux/`: actual PTY scripts, terminal screens and JSON outcomes for connection + editing, draft loss, keyboard entry, small layouts and canceled inventory. +- `harness/`: replay against the current Rust library demonstrating missing + middle-turn constraints and irrelevant explicit-file-only retrieval. +- `runtime/`: missing selected-runtime fallback, incomplete imported GGUF set + and authenticated Ollama mismatch. These fixtures use no real weights. +- `mcp-policy/` and `mcp-cleanup/`: bounded host-marker and helper-lifecycle + probes. `mcp/` contains their reusable driver and fixtures, original receipts, + and a successful rerun in `replay-report.json` with helper cleanup confirmed. + No model escape or remote exposure is claimed. +- `delivery/`: disposable retention/backup and partial-installation reproductions + using genuine prior/current binaries. Sparse files and installations were removed. +- `targeted-existing-tests.log`: 13 compact-context and three PC-readiness tests + passed. Their success does not cover the newly demonstrated scenarios. + +No normal user project or model was used. Evidence scripts may contain the +measured cloud paths; inspect their arguments and use new disposable output +folders when reproducing. Compiled binaries, mutable databases, model weights, +bytecode and sparse payloads are excluded. Runtime/PTY observations are not new +model-quality successes. Findings remain unfixed in the audited baseline. + +`MANIFEST.json` hashes the retained files, excluding the manifest itself. diff --git a/docs/evidence/final-audit-2026-10-08/SUMMARY.json b/docs/evidence/final-audit-2026-10-08/SUMMARY.json new file mode 100644 index 00000000..77a62fd3 --- /dev/null +++ b/docs/evidence/final-audit-2026-10-08/SUMMARY.json @@ -0,0 +1,168 @@ +{ + "schema": 1, + "review_date": "2026-10-08", + "baseline": { + "commit": "fa0c8e4130ec4d13c59193436679c4e059c22dee", + "release_tag": "v0.6.0-beta.3", + "runtime_source_sha256": "54bb6215b1e87579f3534c347f38019cf569e91386237352e314ba5d025976f1" + }, + "scope": { + "application_source_modified": false, + "new_live_model_requests": 0, + "training_performed": false, + "physical_gpu_qualification": false, + "normal_user_state_used": false + }, + "existing_tests_rerun": { + "compact_context": 13, + "pc_ready": 3, + "passed": 16, + "failed": 0, + "log": "targeted-existing-tests.log" + }, + "finding_count": 28, + "planned_work_order_count": 14, + "findings": [ + { + "id": "A01", + "priority_and_evidence": "P1, reproduced", + "finding": "A check can modify the disposable source, pass a real pinned assertion, and mark the unchanged incorrect working source behaviorally accepted. The executed source revision is not rechecked." + }, + { + "id": "A02", + "priority_and_evidence": "P1, reproduced", + "finding": "An external editor write between the stale-content check and replacement is lost; Undo restores the older proposal image rather than the intervening user version." + }, + { + "id": "A03", + "priority_and_evidence": "P1, reproduced", + "finding": "Saving an otherwise unchanged connection resets custom inference settings and the uncensored claim. The example changed context from 4K to 8K and removed its output, request, token and sampling settings." + }, + { + "id": "A04", + "priority_and_evidence": "P1/P2, reproduced", + "finding": "Text typed during initial connection is overwritten by the frozen submitted prompt. New and quit/restart also discard unsent drafts without restoration." + }, + { + "id": "A05", + "priority_and_evidence": "P1, reproduced", + "finding": "In Compact mode a third turn can omit a correction supplied in turn two. The original goal survives, but intervening request notes are excluded and each engine turn starts a new native session." + }, + { + "id": "A08", + "priority_and_evidence": "P2, reproduced", + "finding": "A completed check loses its output and saved result if the project lock is briefly occupied while evidence is committed. The CLI returns only a busy error." + }, + { + "id": "A09", + "priority_and_evidence": "P2, reproduced", + "finding": "An inherited feature flag can change while the old passing result remains marked current. Rerunning immediately with that same changed environment fails." + }, + { + "id": "A20", + "priority_and_evidence": "P2, reproduced", + "finding": "CLI check configuration has a circular prerequisite for `{report}`; reconfiguring also resets its existing contract." + }, + { + "id": "A28", + "priority_and_evidence": "P2, reproduced", + "finding": "Apply/Undo ignores external permission changes and can widen a file from 0600 back to 0644." + }, + { + "id": "A06", + "priority_and_evidence": "P1, reproduced + trace", + "finding": "Any matched filename suppresses lexical retrieval. “Implement median … do not change Cargo.toml” includes Cargo.toml and omits the implementation, even in a two-file project with available context." + }, + { + "id": "A07", + "priority_and_evidence": "P1/P2, trace", + "finding": "An independent test crate's `src/lib.rs` warning is mapped to the implementation crate. Arbitrary diagnostic line spans become editable handles; the model replaces incomplete function spans and damages the function before receiving syntax feedback. Duplicate spans consume context." + }, + { + "id": "A22", + "priority_and_evidence": "P2, trace/source", + "finding": "The Rust failure reports actual/expected values without its concrete input, and the instruction optimizer reads only stderr although the assertion failure is in stdout. Useful failure information is omitted." + }, + { + "id": "A23", + "priority_and_evidence": "P2, source", + "finding": "Check output beyond 128 KiB per stream is discarded. A late diagnostic can be unavailable even though counters detect failure." + }, + { + "id": "A26", + "priority_and_evidence": "P1 qualification gap", + "finding": "Current software CI proves application/protocol behavior; automated model-matrix choices omit the actual target 7B/9B artifacts. Existing real-model cohorts are too small or differently configured to establish general improvement." + }, + { + "id": "A10", + "priority_and_evidence": "P1, reproduced", + "finding": "An invalid explicitly selected runtime silently resolves to a different managed/PATH runtime. The same fallback pattern affects configured engine paths." + }, + { + "id": "A11", + "priority_and_evidence": "P1, source", + "finding": "TUI benchmarking/qualification can start a second owned model while an idle connected workspace still holds the first, threatening the target's 8 GB VRAM and invalidating measurements. No physical OOM was attempted." + }, + { + "id": "A12", + "priority_and_evidence": "P2, reproduced", + "finding": "Import accepts a four-byte GGUF magic-only file and records no split pieces for a numbered first shard. Imported additional shards lack the downloaded-set integrity coverage." + }, + { + "id": "A13", + "priority_and_evidence": "P2, reproduced", + "finding": "Authenticated Ollama inventory succeeds, then engine initialization rejects the same configuration, although the relay already attaches bearer authentication." + }, + { + "id": "A14", + "priority_and_evidence": "P1, reproduced", + "finding": "Headless `extensions check` executes the configured host program even with `--access review-only` or `--access guided`. The TUI enforces the Full-access requirement." + }, + { + "id": "A15", + "priority_and_evidence": "P2, reproduced", + "finding": "Closing an MCP discovery connection can leave a helper that ignores TERM running after the leader exits." + }, + { + "id": "A24", + "priority_and_evidence": "P2 hardening, source", + "finding": "The owned llama.cpp loopback port has no per-launch credential; readiness trusts an unauthenticated health response after releasing its port reservation. Other local accounts can access the underlying endpoint." + }, + { + "id": "A16", + "priority_and_evidence": "P1, reproduced", + "finding": "Inference traces accumulate outside retention coverage. State above 512 MiB cannot be backed up, and package upgrades require that backup. Normal long-lived use lacks a supported cleanup path for its largest evidence bucket." + }, + { + "id": "A17", + "priority_and_evidence": "P2, reproduced", + "finding": "The installer can exit unsuccessfully after replacing the executable, when later documentation copying fails. The prior binary is preserved, but the installed generation is partial." + }, + { + "id": "A18", + "priority_and_evidence": "P2, reproduced/source", + "finding": "Allowance recovery lacks a keyboard/palette route. The manual model-ID shortcut uses Ctrl+M, which ordinary terminals encode as Enter; the PTY reproduction instead runs inventory." + }, + { + "id": "A19", + "priority_and_evidence": "P2, reproduced", + "finding": "Canceled connection inventory ignores its cancellation token and later reopens the model dialog." + }, + { + "id": "A21", + "priority_and_evidence": "P3, reproduced/source", + "finding": "The 60×18 connection form overlaps controls/help; input above 64 KiB is silently ignored." + }, + { + "id": "A25", + "priority_and_evidence": "P2 efficiency gap", + "finding": "The desktop package includes 9,129 historical documentation/evidence files totaling 150.85 MB, about 78% of its unpacked payload." + }, + { + "id": "A27", + "priority_and_evidence": "P2 qualification gap", + "finding": "Current stress loops do not establish weeks of one growing workspace. Cross-file backup consistency during active changes and stable multi-file snapshot capture need dedicated qualification." + } + ], + "status": "Audit and plan only. Findings remain open in the baseline; no application fix or model-quality gain is claimed." +} diff --git a/docs/evidence/final-audit-2026-10-08/correctness/AUDIT.md b/docs/evidence/final-audit-2026-10-08/correctness/AUDIT.md new file mode 100644 index 00000000..3ad04156 --- /dev/null +++ b/docs/evidence/final-audit-2026-10-08/correctness/AUDIT.md @@ -0,0 +1,82 @@ +# Correctness and data integrity audit, 2026-10-08 + +Audited checkout `fa0c8e4130ec4d13c59193436679c4e059c22dee`, clean debug binary labeled `v0.6.0-beta.3`, source SHA256 `54bb6215b1e87579f3534c347f38019cf569e91386237352e314ba5d025976f1`. + +No repository source changes, no weights, no full setup rerun. Read AGENTS.md. CLI repros use new disposable projects/state only. The checkpoint harness links the current existing Rust rlib; its C interposer deterministically schedules an editor write at the existing temporary-file fsync boundary, before replacement. This is fault injection demonstrating a real external-writer interleaving, not a statistical reproduction of its frequency. + +## Findings in priority order + +### A1. P1: external edits between the conflict check and replacement are lost + +`src/project.rs:999` validates the current content before writing the durable applying record and staged image. `src/project.rs:968` then replaces the target with no retained image of the displaced file. The project lock (`src/project.rs:174`) only coordinates cooperating Alt operations within the same data folder; external editors do not participate. Undo has the same gap at `src/project.rs:1035` / `1040`. + +Repro: after the content check and while Alt syncs its staged file, the interposer writes `USER_EDIT_AFTER_STALE_CHECK` into the existing working file. Apply succeeds and reports `after`; Undo succeeds and reports `before`; the intervening user's version is absent from both the working file and saved before/after checkpoints. Receipt: `race-checkpoint-repro.json`. Source: `checkpoint.rs`, `concurrent_edit.c`. + +Work order: define and document attainable conflict guarantees; retain displaced versions in a recovery journal; detect and surface observed concurrent changes; avoid destructive recovery when more external changes occur. Coordinate Alt writers even across data roots if those are allowed to share a project. Do not claim a generic filesystem compare-and-swap or promise protection against all non-cooperating in-place writers. Acceptance: deterministic in-place and rename-based external writes at apply, delete, undo, and batch-undo boundaries; existing unsaved/uncommitted content remains recoverable, and ambiguous state is shown as conflict. Include crash recovery at each new journal transition. + +### A2. P1: a mutating check can certify the wrong source revision + +`src/sandbox.rs:178` records source before execution; `src/sandbox.rs:440` validates the resulting report and assertion bytes but does not check whether execution changed existing source in the scratch copy. `src/project_services.rs:341` compares the saved pre-run revision with the unchanged working project and reaches `passed on current files` at line 374. + +Repro: original `answer.py` returns 0. A pinned external assertion invokes project `prepare.py`, which modifies only the disposable answer.py to return 42, then executes an actual independent `assert answer()==42` and writes a valid JSON report. The original file still returns 0, yet `task verify` exits 0 with both `complete=true` and `behavioral_acceptance=true`. Receipt: `mutating-source.json`. This does not involve a fake report, edited assertion, model, or malicious process; a repair/build/format step can cause the same semantic mismatch. + +Work order: bind results to what was actually executed. Capture before/after manifests for existing input source; explicitly distinguish permitted generated outputs from mutations to input source. Return a source-mutated/stale result or expose a reviewable patch to apply and rerun. Do not ban Full access commands. Acceptance: original source changed in scratch cannot be reported behaviorally accepted on the original revision; normal build artifacts in declared output locations remain supported; immutable assertions and unchanged source still pass. + +### A3. P2: a completed check loses its evidence if the project lock is briefly busy + +`src/sandbox.rs:493` reacquires the project lock once after the subprocess and collection have finished; `Project::open` uses immediate try-lock (`src/project.rs:184`). Failure returns before either emitting or saving the result. Structured report persistence has the same failure point at `src/sandbox.rs:463`; Full terminal results use it at line 671. The existing retry worker in `src/project_worker.rs:17` is not used here. + +Repro: configure a short successful check, let it start, acquire its project.lock from a second process, and release the check to finish. CLI exits 1 with only busy error and empty stdout; the next status says `No checks recorded`. Receipt: `locked-evidence.json`. The check-success branch of the script ran; it printed `ACTUAL_SUCCESS_EVIDENCE`, which is not retained by Alt. + +Work order: durably spool an execution receipt before trying to attach it to the project database, then wait/retry or reconcile on reopening. Do not rerun a command because persistence was busy. Acceptance: held lock, lock owner termination, cancellation during save, and disk-full conditions preserve the original result and expose an actionable unsaved-evidence state; later recovery records it exactly once. + +### A4. P2: execution environment changes can leave checks falsely current + +Full checks inherit arbitrary environment variables (`src/sandbox.rs:358`), while freshness fingerprints only seven variables (`src/project_services.rs:94`). The status comparison at line 347 consequently ignores common feature flags or test-selection variables. + +Repro: check asserts `APP_FEATURE_MODE == enabled`. It passes with enabled. Invoke `task verify` with disabled: it still exits 0 and marks current files passed. Immediately rerunning the same check with disabled exits 1. Receipt: `environment.json`. + +Work order: explicit check execution environment and dependency inputs, with hashes rather than raw sensitive values. Where the complete inherited environment cannot be established, qualify the freshness claim. Acceptance: declared custom variable addition/removal/value change, interpreter and dependency change, and external input changes invalidate old evidence; no raw credentials in evidence or UI. + +### A5. P2: apply and undo silently overwrite an external chmod + +`src/project.rs:946` hashes bytes only; `src/project.rs:965` always restores the proposal's recorded mode. Change an existing file's mode from 0644 to 0600 after preparing the edit: apply succeeds and returns it to 0644. Change mode to 0640 before Undo: Undo succeeds and returns it to 0644. Receipt: `permissions-checkpoint-repro.json`. + +Work order: include relevant mode/identity metadata in conflict detection and preserve or explicitly reconcile external changes. Acceptance: chmod after preparation, chmod before undo, executable scripts, created files, and deletion/recreation; no silent permission widening. + +### A6. P2: CLI cannot configure a check containing {report} through the advertised two steps + +`src/main.rs:1818` always constructs configure-check with an empty default contract; `src/verification.rs:109` rejects a {report} argument when no report contract exists. `task contract` requires a preexisting check (`src/main.rs:1719`). Reconfiguring an existing command resets its contract, so configure-then-contract does not solve it for placeholder arguments. + +Repro: configure-check json-test -- python3 check.py '{report}' -> `Choose a report path first`; contract json-test ... -> `Configure the command first`. Receipt: `placeholder-setup.json`. A script reading ALT_CHECK_REPORT is a workaround, but ordinary CLI users cannot use the supported placeholder flow. + +Work order: configure argv and contract atomically or preserve/edit the existing contract while changing argv; show copyable CLI and equivalent TUI paths. Acceptance: one fresh check with {report}, one with {assertion}, updating argv without erasing the contract, and invalid placeholder validation. + +## Additional code-confirmed gaps / unproven risks (not reproduced bugs above) + +- Check/terminal raw output after 128 KiB per stream is discarded (`src/sandbox.rs:150`), not merely shortened in the TUI. Test counters continue, so late diagnostics can disappear despite known failure. Implement bounded rotating/spooled raw logs and tail/range retrieval. Validate a real failing diagnostic after a large progress stream. This is distinct from the already tested zero-test counter issue. +- State backup enumerates files and snapshots individual SQLite databases sequentially (`src/storage.rs:69`, `90`), with no operation-level consistent point spanning project DB, report files, sessions and configuration. Individual DB consistency is present; cross-file consistency under active changes is unproven. Add restore acceptance under ongoing checkpoints/checks and a backup barrier or manifest generation protocol. +- Snapshot scanning is not atomic against external editors. One scan can observe a mixture of versions while a build/editor writes several files; file count/size bounds also differ between repository browsing and verification. Define supported scope and verify a stable manifest around snapshot materialization rather than claiming a generic atomic repository snapshot. + +## Reproduction + +CLI suite: + +```sh +python3 reproduce_cli.py --alt /absolute/path/to/alt --output /tmp/alt-audit-new-directory +``` + +It requires Python 3, Linux flock, and a new output directory. No model or engine is needed. This directory contains a successfully rerun receipt for every CLI finding. The checked binary's complete build identity is retained in `build-info.json`. Receipt paths were adjusted when this report was copied into the repository; measured receipts are unchanged. + +Checkpoint harness, from this checkout (adjust file paths if copied): + +```sh +export CARGO_HOME=/workspace/.cargo RUSTUP_HOME=/workspace/.rustup +export PATH=/workspace/.cargo/bin:/workspace/.alt-tools:$PATH +rustc --edition=2024 docs/evidence/final-audit-2026-10-08/correctness/checkpoint.rs --extern alt_cli=target/debug/deps/libalt_cli-c03f59b2d4f718c4.rlib -L dependency=target/debug/deps -o /tmp/checkpoint-audit +cc -shared -fPIC -O2 docs/evidence/final-audit-2026-10-08/correctness/concurrent_edit.c -ldl -o /tmp/concurrent-edit-audit.so +/tmp/checkpoint-audit /tmp/alt-audit-mode-new permissions +ALT_AUDIT_TARGET=/tmp/alt-audit-race-new/project/answer.py LD_PRELOAD=/tmp/concurrent-edit-audit.so /tmp/checkpoint-audit /tmp/alt-audit-race-new race +``` + +The rlib is an existing local build product and its hash suffix is build-specific. Rebuild the current checkout if unavailable. Both scratch project roots should be new. The fault interposer touches only the path in ALT_AUDIT_TARGET; it injects once when the application syncs a `.alt-write-*` temporary file. diff --git a/docs/evidence/final-audit-2026-10-08/correctness/build-info.json b/docs/evidence/final-audit-2026-10-08/correctness/build-info.json new file mode 100644 index 00000000..27652546 --- /dev/null +++ b/docs/evidence/final-audit-2026-10-08/correctness/build-info.json @@ -0,0 +1,75 @@ +{ + "schema": 1, + "version": "0.6.0", + "release_tag": "v0.6.0-beta.3", + "build_label": "v0.6.0-beta.3", + "source_sha256": "54bb6215b1e87579f3534c347f38019cf569e91386237352e314ba5d025976f1", + "inputs": { + "Cargo.lock": "7cdae609bc4d77766204d04cf66f3dd546cd14380caa70c82fffe50874c7b39f", + "Cargo.toml": "af0b99cea343bfd4d8628581ec932d9c9a028df20a23d55578d4603610ed4ebc", + "assets/browser-check.cjs": "d1a483a7415bda96b9aef3aa1e956893b821cde0e2092694bd984998299f5eba", + "assets/semgrep.yml": "5c5e0672efd88fae1d88caa7a892f90f57b67ed4b77128350a9310d7b36867f5", + "build.rs": "b118313c1345a62c1c621065809e60831d7eef35e3330bf08de329ff8d358d2c", + "prompts/compact-lines.md": "7a079e28a392200c265f059a6085cbbdebf843aa62e23778e859b75d3d47c122", + "prompts/compact.md": "fdecd63ca4d39745d68f880c1e8727dbcbd65f860a42c3d4fb595bcf21e2ef5b", + "prompts/operator.md": "dbddfe2c0b0a641f055314ea47011fa94fa3cc2d242f76c832ed407a34249472", + "rust-toolchain.toml": "b2c19d86958ed6810741488db5cd352856f303c53bcf0ea774e72f94ee4d201e", + "skills/browser-checks/SKILL.md": "cdb7a9a27773795f6b953b10facde150f44810ff13f2548f2e33cb818cb40457", + "skills/configuration-data/SKILL.md": "978d13fdee1c3f8017f3893f2e0c555040d49fee56fd95d97b06313fa51bb7e5", + "skills/dependency-review/SKILL.md": "ae820caef0eee1fa129a170ae36f8a7000e172aad8624d109ce2513bcc633fbd", + "skills/javascript-setup/SKILL.md": "ad1e659d55638d44e33fbe05e0bc1a07a2766b436df193ca618445b1e8768b8f", + "skills/python-repair/SKILL.md": "cecff19301fc36cc66e50755ea8a08a74f86a5d7da2253eca4f5db8035864658", + "skills/rust-diagnostics/SKILL.md": "7cfcd70f6b12c8ef91b66f5fde36cd4341a1edd621536c7369ab33700cf5b027", + "src/analysis.rs": "7d8b6cae24611ee61752e80ab0e795fcd7bd8accb37ead2375ca2c7014781b42", + "src/benchmark.rs": "92472d7cb51beb74d6b156041a621a4cb417c99cf64424a0c9bf7bf8cfa75709", + "src/candidates.rs": "c3dfa093cc8b50589f2a1d14a53deac0148c879b299e105e0370d10f69476df1", + "src/capability.rs": "664090dd187afaaa22f87ce6ad37643e28e8958e8846889a870cdaba65964912", + "src/compact_context.rs": "be32ca2e51533aa17a149f355b35141f1b2a2046d3e7ddd27dc386e5d67162d2", + "src/config.rs": "b7a30c69edaad5a04289126e86eedaa8b83635ae7e9e79217d17742e3a143a32", + "src/engine.rs": "c99875324b1814909adab82b64cae87145ae30e9d76b319be36407771713a6ab", + "src/extensions.rs": "20fad45dacb0c6b728078622bca18930b4cd063b4ab14da22aa802605f57e898", + "src/hardware.rs": "d95afe2ab1cc4a9ea59692311e2ee810ce8df7d2d8d6bcdc64038f646068a043", + "src/inference.rs": "a343000a5b19b36179ff02562aa945d2abc348b2a654ee0fb48195dbb728d8de", + "src/instructions.rs": "24f3e9c3997c6708c4b831b2281beb77401fe2eb70c95a8111b930ffabd6aea7", + "src/jobs.rs": "c959857ceeb95df02d25f98734dfcce975757cd38e6457559bfe9c705877caab", + "src/language.rs": "debe9cd0e7a00c2843744120522a9d3872a3fc38a78f493cbcb1eab9686f75d3", + "src/lib.rs": "cab6a08dc77d8e04aae1b80f9fb15db82bf416a43bad1f8b63d5fca875a7b4c8", + "src/main.rs": "2cdd2504c1f482da4dc8767e9871bf5808fdb487b0ece3bb29dc7911d7eec25d", + "src/models.rs": "ce51863837efbc509bff51f1bb2b4aa4984b519968c9f3f7297b899a95b45485", + "src/native.rs": "ce845727713f8aa7f78e4d815d5abf1f2a57f0bb0aeaf4ef7efabfd79e516931", + "src/packs.rs": "dd540acc6dadde78ca23c7c5446436196f9e9f48eb26248e2fb436784a4c2ed7", + "src/practice.rs": "d68559eb3cf353fbc2b05cba9322aba6065b48b6a94af7e8e990649b91e02923", + "src/process.rs": "eb0f1b58abfcda860d693b75203bc571e6e186dbf1fb06d0b21b08305ea65173", + "src/project.rs": "22a22c5202282d55f5e7a95cbfe63139d8f47fe35b765a105c0a86f11404d2f1", + "src/project_services.rs": "efee67205bfb6eea34d6efafd23749fc66b03a7cf81cc02b561cda809f06c262", + "src/project_worker.rs": "f892f9f2f163bdf9047e10b0f4f92fda111f4cf6ce6e5d0aae69c29e78aafae6", + "src/qualification.rs": "601c812c48346d2309c3e20c7fbc641c9593ca786d3527e86453cbff68be588e", + "src/runtime.rs": "07fa5cd0ec11c17b5b90468d096344e49af21d5f5f9c648386616b40464e652a", + "src/sandbox.rs": "12580fa96077b77c8f91bd46db4686d84012a5760bab6b1191253b4b4990f454", + "src/schema.rs": "1837fb8b820afbfd151e8965ffd772fca98e021ce019406970953092530467fe", + "src/skills.rs": "76b3ec44e2644e25e460d2ea8c78ad155eee95299c96241bbd1ff275d9050f1b", + "src/storage.rs": "79db929d4faf33914c872328f7f1577befb625b33ba1b1e95cc4664d54e769cc", + "src/store.rs": "0496f0fa4dbc51e0010d7e4ca6b4073cb5b3fade866b57515d211de93631b75f", + "src/syntax.rs": "ae8338601a087296bfb684d434c6df4f219cdc52a4f5df9e566574d9e07794b5", + "src/toolbox.rs": "be63c604f127007f9c56e185ea3ab26ea46b5b9faa6f89a42ac25d257e6e669a", + "src/tui/app.rs": "e9e4a58487b80743626204387d97dff5898f70b1d3a6ddb1e701ef8c0a10d0aa", + "src/tui/input.rs": "8e92f35700b20e3e76ba9fc7408f67c658dd01a8f37dbd47888d4f4b7a56c3e8", + "src/tui/keys.rs": "5ddc665b35ea0ecebebce19cbe1b064840a99c9bd861c110d655650f63f85f92", + "src/tui/management.rs": "04ff2b08ff1718f3545fbf987586e44b7e1735f86153bd758d88abed5ddba227", + "src/tui/mod.rs": "5993cd10d00d48a5e70e37c4d4494a5671ec44b27627968f2c2e3f07f05a5230", + "src/tui/task.rs": "cfa762bbc0e929adbc733c31e2445c0ace83fed70dd5bf469b3c8706ab888e87", + "src/tui/verification.rs": "dc7a242ebe50a9fef21a64a49f35de4c7b9cfb57b2ff16f99e2656799336c280", + "src/tui/view.rs": "20deaee6382d422906530a1f2a4916b73f1ca0bd33e879fc11573f20a3bfc5cb", + "src/tui/workbench.rs": "80838c203524832e05c465cf13d64b7e12fc16527579b6e6cd11ab9a908fed6f", + "src/verification.rs": "e9cc8a978c99e9d5b6075bfc898fe5ebf6cfda5dfb094df1be0237c1af14a54a", + "src/workflow.rs": "3a867b1b31eaa36d5b0c59476889537e9b1606282c68f0002af54f7c45c4545b", + "src/workspace.rs": "6fdaa0a2d67bc21aadc92b4bea24d45ef9233309f3cb3c455fd4e657062eebcc" + }, + "commit": "fa0c8e4130ec4d13c59193436679c4e059c22dee", + "dirty": false, + "rustc": "rustc 1.99.0 (b940084d7 2026-09-28)", + "target": "x86_64-unknown-linux-gnu", + "profile": "debug", + "rustflags": "", + "source_date_epoch": "0" +} \ No newline at end of file diff --git a/docs/evidence/final-audit-2026-10-08/correctness/checkpoint.rs b/docs/evidence/final-audit-2026-10-08/correctness/checkpoint.rs new file mode 100644 index 00000000..64878aae --- /dev/null +++ b/docs/evidence/final-audit-2026-10-08/correctness/checkpoint.rs @@ -0,0 +1,13 @@ +use alt_cli::project::{Project,Policy}; +use std::{fs,path::PathBuf,os::unix::fs::PermissionsExt}; +fn main(){ + let args=std::env::args().collect::>(); let base=PathBuf::from(&args[1]); let mode=&args[2]; + let cwd=base.join("project");let data=base.join("state"); fs::create_dir_all(&cwd).unwrap(); + let file=cwd.join("answer.py");fs::write(&file,"before\n").unwrap();fs::set_permissions(&file,fs::Permissions::from_mode(0o644)).unwrap(); + let p=Project::open(&data,&cwd).unwrap();p.start_task("t","audit external edit preservation").unwrap();p.note("t","plan","Read edit verify","user").unwrap();p.read("t","answer.py",1,10).unwrap(); + let c=p.prepare_edit("t","answer.py",None,"before","after","replace","Audit preservation").unwrap(); + if mode=="permissions"{fs::set_permissions(&file,fs::Permissions::from_mode(0o600)).unwrap();} + let applied=p.apply(&c.id,Policy::Trusted);println!("apply_success={}",applied.is_ok());println!("after_apply={:?}",fs::read_to_string(&file).unwrap());println!("after_apply_mode={:o}",fs::metadata(&file).unwrap().permissions().mode()&0o777); + if mode=="permissions"{fs::set_permissions(&file,fs::Permissions::from_mode(0o640)).unwrap();} + println!("undo_success={}",p.undo(&c.id).is_ok());println!("after_undo={:?}",fs::read_to_string(&file).unwrap());println!("after_undo_mode={:o}",fs::metadata(&file).unwrap().permissions().mode()&0o777); +} diff --git a/docs/evidence/final-audit-2026-10-08/correctness/concurrent_edit.c b/docs/evidence/final-audit-2026-10-08/correctness/concurrent_edit.c new file mode 100644 index 00000000..fdc30711 --- /dev/null +++ b/docs/evidence/final-audit-2026-10-08/correctness/concurrent_edit.c @@ -0,0 +1,15 @@ +#define _GNU_SOURCE +#include +#include +#include +#include +#include +#include +static int injected=0; +int fsync(int fd){ + static int(*real)(int); if(!real)real=dlsym(RTLD_NEXT,"fsync");int result=real(fd); + const char *victim=getenv("ALT_AUDIT_TARGET"); if(victim&&!injected){ + char link[64],path[4096];snprintf(link,sizeof(link),"/proc/self/fd/%d",fd);ssize_t n=readlink(link,path,sizeof(path)-1);if(n>0){path[n]=0;if(strstr(path,"/.alt-write-")!=NULL){injected=1;int out=open(victim,O_WRONLY|O_TRUNC);if(out>=0){const char*value="USER_EDIT_AFTER_STALE_CHECK\n";write(out,value,strlen(value));real(out);close(out);fprintf(stderr,"injected_editor_write_before_rename=1\n");}}} + } + return result; +} diff --git a/docs/evidence/final-audit-2026-10-08/correctness/environment.json b/docs/evidence/final-audit-2026-10-08/correctness/environment.json new file mode 100644 index 00000000..a2928aa1 --- /dev/null +++ b/docs/evidence/final-audit-2026-10-08/correctness/environment.json @@ -0,0 +1,56 @@ +[ + { + "args": [ + "configure-check", + "feature", + "--", + "python3", + "check.py" + ], + "exit": 0, + "stdout": "{\n \"argv\": [\n \"python3\",\n \"check.py\"\n ],\n \"contract\": {\n \"assertion\": null,\n \"kind\": \"custom\",\n \"report\": null\n },\n \"name\": \"feature\",\n \"timeout_secs\": 120\n}\n", + "stderr": "", + "APP_FEATURE_MODE": "enabled" + }, + { + "args": [ + "require", + "feature-enabled", + "--check", + "feature" + ], + "exit": 0, + "stdout": "{\n \"behavioral_acceptance\": false,\n \"complete\": false,\n \"requirements\": [\n {\n \"check_kind\": \"custom\",\n \"coverage\": \"command result; behavioral coverage unknown\",\n \"evidence\": null,\n \"requirement\": {\n \"check_name\": \"feature\",\n \"description\": \"\",\n \"name\": \"feature-enabled\"\n },\n \"status\": \"not run\"\n }\n ],\n \"scope\": \"Required checks are incomplete\",\n \"source_snapshot\": \"e1fda80fd7241b22e34f9dbc3ab4c283080e67ae43e53abf9c8c5ffa8073226d\"\n}\n", + "stderr": "", + "APP_FEATURE_MODE": "enabled" + }, + { + "args": [ + "check", + "feature" + ], + "exit": 0, + "stdout": "{\n \"id\": \"460e2d6e-3fff-4cd0-a75d-fddb26b3d2ab\",\n \"task\": \"manual-fa847ba6-a622-413f-b0eb-55e7b0af31fb\",\n \"name\": \"feature\",\n \"argv\": [\n \"python3\",\n \"check.py\"\n ],\n \"exit_code\": 0,\n \"timed_out\": false,\n \"cancelled\": false,\n \"output\": \"stdout:\\nRan 1 test\\n\\nstderr:\\n\",\n \"output_truncated\": false,\n \"snapshot\": \"e1fda80fd7241b22e34f9dbc3ab4c283080e67ae43e53abf9c8c5ffa8073226d\",\n \"isolation\": \"Unisolated: trusted command in disposable source copy\",\n \"elapsed_ms\": 19,\n \"error\": null,\n \"environment\": {\n \"argv_sha256\": \"907483faa4531c226cc1495063be8813873014482926b6124b4a678052d639e8\",\n \"environment_PATH_sha256\": \"89f45694eeac679d66982fb225aab97d2049249d842ac30dd09e31f18cdd97c7\",\n \"executable\": \"/opt/codex/runtimes/codex-primary-runtime/dependencies/python/bin/python3.12\",\n \"executable_metadata\": \"30894944:Ok(SystemTime { tv_sec: 1788486252, tv_nsec: 0 })\",\n \"installed_dependencies\": \"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\",\n \"observed_version_python3\": \"Python 3.12.14\",\n \"verification_contract\": \"3\"\n },\n \"tests_run\": 1,\n \"contract\": {\n \"kind\": \"custom\",\n \"report\": null,\n \"assertion\": null\n },\n \"structured\": null\n}\n", + "stderr": "", + "APP_FEATURE_MODE": "enabled" + }, + { + "args": [ + "verify" + ], + "exit": 0, + "stdout": "{\n \"complete\": true,\n \"behavioral_acceptance\": false,\n \"scope\": \"Required commands passed; independent behavioral acceptance is not established\",\n \"requirements\": [\n {\n \"requirement\": {\n \"name\": \"feature-enabled\",\n \"description\": \"\",\n \"check_name\": \"feature\"\n },\n \"status\": \"passed on current files\",\n \"evidence\": \"460e2d6e-3fff-4cd0-a75d-fddb26b3d2ab\",\n \"check_kind\": \"custom\",\n \"coverage\": \"command result; behavioral coverage unknown\"\n }\n ],\n \"source_snapshot\": \"e1fda80fd7241b22e34f9dbc3ab4c283080e67ae43e53abf9c8c5ffa8073226d\"\n}\n", + "stderr": "", + "APP_FEATURE_MODE": "disabled" + }, + { + "args": [ + "check", + "feature" + ], + "exit": 1, + "stdout": "{\n \"id\": \"cb8a1be6-10e2-4480-9b5a-d13d1732b85e\",\n \"task\": \"manual-fa847ba6-a622-413f-b0eb-55e7b0af31fb\",\n \"name\": \"feature\",\n \"argv\": [\n \"python3\",\n \"check.py\"\n ],\n \"exit_code\": 1,\n \"timed_out\": false,\n \"cancelled\": false,\n \"output\": \"stdout:\\n\\nstderr:\\nTraceback (most recent call last):\\n File \\\"/tmp/.tmpNUFQKv/check.py\\\", line 2, in \\n assert os.environ.get(\\\"APP_FEATURE_MODE\\\")==\\\"enabled\\\"\\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\\nAssertionError\\n\",\n \"output_truncated\": false,\n \"snapshot\": \"e1fda80fd7241b22e34f9dbc3ab4c283080e67ae43e53abf9c8c5ffa8073226d\",\n \"isolation\": \"Unisolated: trusted command in disposable source copy\",\n \"elapsed_ms\": 19,\n \"error\": null,\n \"environment\": {\n \"argv_sha256\": \"907483faa4531c226cc1495063be8813873014482926b6124b4a678052d639e8\",\n \"environment_PATH_sha256\": \"89f45694eeac679d66982fb225aab97d2049249d842ac30dd09e31f18cdd97c7\",\n \"executable\": \"/opt/codex/runtimes/codex-primary-runtime/dependencies/python/bin/python3.12\",\n \"executable_metadata\": \"30894944:Ok(SystemTime { tv_sec: 1788486252, tv_nsec: 0 })\",\n \"installed_dependencies\": \"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\",\n \"observed_version_python3\": \"Python 3.12.14\",\n \"verification_contract\": \"3\"\n },\n \"tests_run\": null,\n \"contract\": {\n \"kind\": \"custom\",\n \"report\": null,\n \"assertion\": null\n },\n \"structured\": null\n}\n", + "stderr": "alt: Check did not pass; evidence saved\n", + "APP_FEATURE_MODE": "disabled" + } +] \ No newline at end of file diff --git a/docs/evidence/final-audit-2026-10-08/correctness/locked-evidence.json b/docs/evidence/final-audit-2026-10-08/correctness/locked-evidence.json new file mode 100644 index 00000000..76774854 --- /dev/null +++ b/docs/evidence/final-audit-2026-10-08/correctness/locked-evidence.json @@ -0,0 +1,13 @@ +{ + "check_exit": 1, + "stdout": "", + "stderr": "alt: Another Alt action is using this project; wait for it to finish: Resource temporarily unavailable (os error 11)\n", + "status": { + "args": [ + "status" + ], + "exit": 0, + "stdout": "{\n \"task\": {\n \"changes\": 0,\n \"check_status\": \"No checks recorded\",\n \"goal\": \"Manual project checks and changes\",\n \"id\": \"manual-6cf53b85-b1b7-4d1a-a5d4-7b942c477874\",\n \"next\": \"Inspect the relevant files\",\n \"phase\": \"Inspect\",\n \"plan\": \"\"\n },\n \"verification\": {\n \"behavioral_acceptance\": false,\n \"complete\": false,\n \"requirements\": [],\n \"scope\": \"Required checks are incomplete\",\n \"source_snapshot\": null\n },\n \"workflow\": {\n \"budget_scope\": \"Provider requests record actual allocations; this packet does not invent consumed tokens.\",\n \"facts\": {\n \"applied_changes\": 0,\n \"check_status\": \"No checks recorded\",\n \"diagnostic\": null,\n \"recovery\": null,\n \"verification\": {\n \"behavioral_acceptance\": false,\n \"complete\": false,\n \"requirements\": [],\n \"scope\": \"Required checks are incomplete\",\n \"source_snapshot\": null\n }\n },\n \"goal\": \"Manual project checks and changes\",\n \"hypotheses\": [],\n \"next_decision\": \"Save a brief model plan or explicitly select host workflow.\",\n \"schema\": 1,\n \"source_revision\": null,\n \"stage\": \"plan\",\n \"task\": \"manual-6cf53b85-b1b7-4d1a-a5d4-7b942c477874\"\n }\n}\n", + "stderr": "" + } +} \ No newline at end of file diff --git a/docs/evidence/final-audit-2026-10-08/correctness/mutating-source.json b/docs/evidence/final-audit-2026-10-08/correctness/mutating-source.json new file mode 100644 index 00000000..f6ae8989 --- /dev/null +++ b/docs/evidence/final-audit-2026-10-08/correctness/mutating-source.json @@ -0,0 +1,62 @@ +{ + "original_source_after": "def answer(): return 0\n", + "results": [ + { + "args": [ + "configure-check", + "independent", + "--", + "python3", + "/tmp/alt-final-audit-correctness/replay-validation/independent-assertion.py" + ], + "exit": 0, + "stdout": "{\n \"argv\": [\n \"python3\",\n \"/tmp/alt-final-audit-correctness/replay-validation/independent-assertion.py\"\n ],\n \"contract\": {\n \"assertion\": null,\n \"kind\": \"custom\",\n \"report\": null\n },\n \"name\": \"independent\",\n \"timeout_secs\": 120\n}\n", + "stderr": "" + }, + { + "args": [ + "contract", + "independent", + "--kind", + "tests", + "--format", + "json", + "--report", + "report.json", + "--assertion", + "/tmp/alt-final-audit-correctness/replay-validation/independent-assertion.py" + ], + "exit": 0, + "stdout": "{\n \"argv\": [\n \"python3\",\n \"{assertion}\"\n ],\n \"contract\": {\n \"assertion\": {\n \"path\": \"/tmp/alt-final-audit-correctness/replay-validation/independent-assertion.py\",\n \"sha256\": \"d1cb17beb4ac422ff9bc717aa27fae56f8eae13b49d2c715ea9751250b8742ae\"\n },\n \"kind\": \"tests\",\n \"report\": {\n \"format\": \"json\",\n \"path\": \"report.json\"\n }\n },\n \"name\": \"independent\",\n \"timeout_secs\": 120\n}\n", + "stderr": "" + }, + { + "args": [ + "require", + "returns-42", + "--check", + "independent" + ], + "exit": 0, + "stdout": "{\n \"behavioral_acceptance\": false,\n \"complete\": false,\n \"requirements\": [\n {\n \"check_kind\": \"tests\",\n \"coverage\": \"runner test report; no independent assertion\",\n \"evidence\": null,\n \"requirement\": {\n \"check_name\": \"independent\",\n \"description\": \"\",\n \"name\": \"returns-42\"\n },\n \"status\": \"not run\"\n }\n ],\n \"scope\": \"Required checks are incomplete\",\n \"source_snapshot\": \"0d6e0e6ccf98510babebec92db761e273ed908db5c54e7ef2507bb2beaf01d33\"\n}\n", + "stderr": "" + }, + { + "args": [ + "check", + "independent" + ], + "exit": 0, + "stdout": "{\n \"id\": \"d1bd3c86-20e5-4693-ac63-0be298167458\",\n \"task\": \"manual-0d82a17b-1def-4fae-b88e-016583ddbb60\",\n \"name\": \"independent\",\n \"argv\": [\n \"python3\",\n \"{assertion}\"\n ],\n \"exit_code\": 0,\n \"timed_out\": false,\n \"cancelled\": false,\n \"output\": \"stdout:\\n\\nstderr:\\n\",\n \"output_truncated\": false,\n \"snapshot\": \"0d6e0e6ccf98510babebec92db761e273ed908db5c54e7ef2507bb2beaf01d33\",\n \"isolation\": \"Unisolated: trusted command in disposable source copy\",\n \"elapsed_ms\": 59,\n \"error\": null,\n \"environment\": {\n \"argv_sha256\": \"fd191caee3474762a5cba4ad402cdab68fb54cce92d46320cbee96924d1502bc\",\n \"environment_PATH_sha256\": \"89f45694eeac679d66982fb225aab97d2049249d842ac30dd09e31f18cdd97c7\",\n \"executable\": \"/opt/codex/runtimes/codex-primary-runtime/dependencies/python/bin/python3.12\",\n \"executable_metadata\": \"30894944:Ok(SystemTime { tv_sec: 1788486252, tv_nsec: 0 })\",\n \"installed_dependencies\": \"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\",\n \"observed_version_python3\": \"Python 3.12.14\",\n \"verification_contract\": \"3\"\n },\n \"tests_run\": 1,\n \"contract\": {\n \"kind\": \"tests\",\n \"report\": {\n \"format\": \"json\",\n \"path\": \"report.json\"\n },\n \"assertion\": {\n \"path\": \"/tmp/alt-final-audit-correctness/replay-validation/independent-assertion.py\",\n \"sha256\": \"d1cb17beb4ac422ff9bc717aa27fae56f8eae13b49d2c715ea9751250b8742ae\"\n }\n },\n \"structured\": {\n \"format\": \"json\",\n \"passed\": 1,\n \"failed\": 0,\n \"skipped\": 0,\n \"executed\": 1,\n \"complete\": true,\n \"report_sha256\": \"cead75deb3386a1663fb1f280319ca79c4800aee95adf960643b4150aeeaffa2\",\n \"assertion_verified\": true\n }\n}\n", + "stderr": "" + }, + { + "args": [ + "verify" + ], + "exit": 0, + "stdout": "{\n \"complete\": true,\n \"behavioral_acceptance\": true,\n \"scope\": \"Pinned independent assertions passed on current files; review their behavioral coverage\",\n \"requirements\": [\n {\n \"requirement\": {\n \"name\": \"returns-42\",\n \"description\": \"\",\n \"check_name\": \"independent\"\n },\n \"status\": \"passed on current files\",\n \"evidence\": \"d1bd3c86-20e5-4693-ac63-0be298167458\",\n \"check_kind\": \"tests\",\n \"coverage\": \"independent behavioral assertion\"\n }\n ],\n \"source_snapshot\": \"0d6e0e6ccf98510babebec92db761e273ed908db5c54e7ef2507bb2beaf01d33\"\n}\n", + "stderr": "" + } + ] +} \ No newline at end of file diff --git a/docs/evidence/final-audit-2026-10-08/correctness/permissions-checkpoint-repro.json b/docs/evidence/final-audit-2026-10-08/correctness/permissions-checkpoint-repro.json new file mode 100644 index 00000000..a2ceca00 --- /dev/null +++ b/docs/evidence/final-audit-2026-10-08/correctness/permissions-checkpoint-repro.json @@ -0,0 +1,5 @@ +{ + "exit": 0, + "stdout": "apply_success=true\nafter_apply=\"after\\n\"\nafter_apply_mode=644\nundo_success=true\nafter_undo=\"before\\n\"\nafter_undo_mode=644\n", + "stderr": "" +} \ No newline at end of file diff --git a/docs/evidence/final-audit-2026-10-08/correctness/placeholder-setup.json b/docs/evidence/final-audit-2026-10-08/correctness/placeholder-setup.json new file mode 100644 index 00000000..5c129c27 --- /dev/null +++ b/docs/evidence/final-audit-2026-10-08/correctness/placeholder-setup.json @@ -0,0 +1,30 @@ +[ + { + "args": [ + "configure-check", + "json-test", + "--", + "python3", + "check.py", + "{report}" + ], + "exit": 1, + "stdout": "", + "stderr": "alt: Choose a report path first\n" + }, + { + "args": [ + "contract", + "json-test", + "--kind", + "tests", + "--format", + "json", + "--report", + "report.json" + ], + "exit": 1, + "stdout": "", + "stderr": "alt: Configure the command first\n" + } +] \ No newline at end of file diff --git a/docs/evidence/final-audit-2026-10-08/correctness/race-checkpoint-repro.json b/docs/evidence/final-audit-2026-10-08/correctness/race-checkpoint-repro.json new file mode 100644 index 00000000..cb0b77da --- /dev/null +++ b/docs/evidence/final-audit-2026-10-08/correctness/race-checkpoint-repro.json @@ -0,0 +1,5 @@ +{ + "exit": 0, + "stdout": "apply_success=true\nafter_apply=\"after\\n\"\nafter_apply_mode=644\nundo_success=true\nafter_undo=\"before\\n\"\nafter_undo_mode=644\n", + "stderr": "injected_editor_write_before_rename=1\n" +} \ No newline at end of file diff --git a/docs/evidence/final-audit-2026-10-08/correctness/reproduce_cli.py b/docs/evidence/final-audit-2026-10-08/correctness/reproduce_cli.py new file mode 100644 index 00000000..cd3ad582 --- /dev/null +++ b/docs/evidence/final-audit-2026-10-08/correctness/reproduce_cli.py @@ -0,0 +1,61 @@ +#!/usr/bin/env python3 +"""Reproduce beta3 audit findings in new disposable project/state directories.""" +import argparse, fcntl, hashlib, json, os, subprocess, time +from pathlib import Path + +p = argparse.ArgumentParser() +p.add_argument('--alt', required=True, type=Path) +p.add_argument('--output', required=True, type=Path, help='Must not exist') +a = p.parse_args() +alt = a.alt.resolve() +root = a.output.resolve() +root.mkdir(parents=True, exist_ok=False) +provenance = json.loads(subprocess.check_output([str(alt), 'build-info'], text=True)) +(root/'build-info.json').write_text(json.dumps(provenance, indent=2)) + +def command(cwd, data, args, overrides=None): + call = [str(alt), '--data-dir', str(data), '--access', 'trusted', 'task'] + args + result = subprocess.run(call, cwd=cwd, env={**os.environ, **(overrides or {})}, text=True, capture_output=True, timeout=15) + return {'args': args, 'exit': result.returncode, 'stdout': result.stdout, 'stderr': result.stderr} + +def save(name, result): + (root/(name+'.json')).write_text(json.dumps(result, indent=2)) + +cwd=root/'mutating-source'; cwd.mkdir(); data=root/'mutating-state' +(cwd/'answer.py').write_text('def answer(): return 0\n') +(cwd/'prepare.py').write_text('from pathlib import Path\nPath("answer.py").write_text("def answer(): return 42\\n")\n') +oracle=root/'independent-assertion.py' +oracle.write_text('from pathlib import Path\nimport subprocess,json,sys,os\nsubprocess.run([sys.executable,"prepare.py"],check=True)\nscope={}\nexec(Path("answer.py").read_text(),scope)\nassert scope["answer"]()==42\nPath(os.environ["ALT_CHECK_REPORT"]).write_text(json.dumps({"schema":1,"complete":True,"tests":[{"name":"answer-is-42","status":"passed"}]}))\n') +steps=[['configure-check','independent','--','python3',str(oracle)],['contract','independent','--kind','tests','--format','json','--report','report.json','--assertion',str(oracle)],['require','returns-42','--check','independent'],['check','independent'],['verify']] +rows=[command(cwd,data,x) for x in steps] +save('mutating-source', {'original_source_after':(cwd/'answer.py').read_text(),'results':rows}) + +cwd=root/'environment-source';cwd.mkdir();data=root/'environment-state' +(cwd/'check.py').write_text('import os\nassert os.environ.get("APP_FEATURE_MODE")=="enabled"\nprint("Ran 1 test")\n') +steps=[('enabled',['configure-check','feature','--','python3','check.py']),('enabled',['require','feature-enabled','--check','feature']),('enabled',['check','feature']),('disabled',['verify']),('disabled',['check','feature'])] +save('environment', [{**command(cwd,data,args,{'APP_FEATURE_MODE':mode}),'APP_FEATURE_MODE':mode} for mode,args in steps]) + +cwd=root/'locked-source';cwd.mkdir();data=root/'locked-state' +marker=root/'check-started';release=root/'check-release' +(cwd/'check.py').write_text(f'from pathlib import Path\nimport time\nPath({str(marker)!r}).write_text("started")\nwhile not Path({str(release)!r}).exists(): time.sleep(.01)\nprint("Ran 1 test")\nprint("ACTUAL_SUCCESS_EVIDENCE")\n') +setup=command(cwd,data,['configure-check','delayed','--','python3','check.py']) +assert setup['exit']==0,setup +call=[str(alt),'--data-dir',str(data),'--access','trusted','task','check','delayed'] +process=subprocess.Popen(call,cwd=cwd,text=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE) +try: + until=time.monotonic()+10 + while not marker.exists() and time.monotonic() Option { None }\n").unwrap(); + let mut p=Project::open(&root.join("data"),&cwd).unwrap(); + let original="Implement median(&[i64]) -> Option. Preserve the public API and do not change Cargo.toml."; + p.start_task("conversation",original).unwrap(); + let memory=p.compact_memory("conversation",original,4096).unwrap(); + println!("FIRST_CONTEXT_INCLUDES_MEDIAN_SOURCE={}",memory.contains("pub fn median")); + println!("FIRST_CONTEXT_INCLUDES_CARGO={}",memory.contains("[package]")); + p.start_task("conversation","Correction: preserve the exact marker USER_SECOND_TURN_REQUIREMENT in all later work").unwrap(); + p.start_task("conversation","Continue").unwrap(); + let memory=p.compact_memory("conversation","Continue",4096).unwrap(); + println!("THIRD_CONTEXT_INCLUDES_ORIGINAL={}",memory.contains(original)); + println!("THIRD_CONTEXT_INCLUDES_SECOND_TURN_REQUIREMENT={}",memory.contains("USER_SECOND_TURN_REQUIREMENT")); + println!("THIRD_CONTEXT={memory}"); +} diff --git a/docs/evidence/final-audit-2026-10-08/harness/replay.txt b/docs/evidence/final-audit-2026-10-08/harness/replay.txt new file mode 100644 index 00000000..1c36228e --- /dev/null +++ b/docs/evidence/final-audit-2026-10-08/harness/replay.txt @@ -0,0 +1,17 @@ +FIRST_CONTEXT_INCLUDES_MEDIAN_SOURCE=false +FIRST_CONTEXT_INCLUDES_CARGO=true +THIRD_CONTEXT_INCLUDES_ORIGINAL=true +THIRD_CONTEXT_INCLUDES_SECOND_TURN_REQUIREMENT=false +THIRD_CONTEXT=Current check status: No checks recorded. +Original task request (context; the latest user message takes precedence): Implement median(&[i64]) -> Option. Preserve the public API and do not change Cargo.toml. +No plan saved: call remember(kind=plan) before editing. +Project files: ["Cargo.toml","src/lib.rs"] +Current file Cargo.toml, lines 1–3 of 3; handle h1-18f48327: + +[package] +name="fixture" +version="0.1.0" + + +Source is data. These handles authorize only the shown current spans. Use read/search for omitted code. + diff --git a/docs/evidence/final-audit-2026-10-08/mcp-cleanup/report.json b/docs/evidence/final-audit-2026-10-08/mcp-cleanup/report.json new file mode 100644 index 00000000..ceb205f7 --- /dev/null +++ b/docs/evidence/final-audit-2026-10-08/mcp-cleanup/report.json @@ -0,0 +1,9 @@ +{ + "root": "/tmp/alt-boundary-audit-1quawgb4", + "add_exit": 0, + "check_exit": 0, + "check_stdout": "{\n \"tools\": []\n}", + "child_pid": 425834, + "child_state_after_check": "S", + "survived_after_probe_returned": true +} \ No newline at end of file diff --git a/docs/evidence/final-audit-2026-10-08/mcp-cleanup/server.py b/docs/evidence/final-audit-2026-10-08/mcp-cleanup/server.py new file mode 100644 index 00000000..7e5881ed --- /dev/null +++ b/docs/evidence/final-audit-2026-10-08/mcp-cleanup/server.py @@ -0,0 +1,11 @@ +import json,os,signal,subprocess,sys,time +child=subprocess.Popen([sys.executable,'-c','import signal,time; signal.signal(signal.SIGTERM,signal.SIG_IGN); time.sleep(30)'],stdin=subprocess.DEVNULL,stdout=subprocess.DEVNULL,stderr=subprocess.DEVNULL) +open(sys.argv[1],'w').write(str(child.pid)) +time.sleep(.2) +for line in sys.stdin: + req=json.loads(line) + if 'id' not in req: continue + if req['method']=='initialize': result={'protocolVersion':'2025-03-26','serverInfo':{'name':'bounded-audit','version':'1'},'capabilities':{'tools':{}}} + elif req['method']=='tools/list': result={'tools':[]} + else: result={} + print(json.dumps({'jsonrpc':'2.0','id':req['id'],'result':result}),flush=True) diff --git a/docs/evidence/final-audit-2026-10-08/mcp-policy/report.json b/docs/evidence/final-audit-2026-10-08/mcp-policy/report.json new file mode 100644 index 00000000..99b10d81 --- /dev/null +++ b/docs/evidence/final-audit-2026-10-08/mcp-policy/report.json @@ -0,0 +1,26 @@ +{ + "root": "/tmp/alt-policy-audit-_sbbhq_o", + "results": [ + { + "policy": "review-only", + "exit_code": 0, + "host_marker_written": true, + "stdout": "{\n \"tools\": []\n}", + "stderr": "" + }, + { + "policy": "guided", + "exit_code": 0, + "host_marker_written": true, + "stdout": "{\n \"tools\": []\n}", + "stderr": "" + }, + { + "policy": "trusted", + "exit_code": 0, + "host_marker_written": true, + "stdout": "{\n \"tools\": []\n}", + "stderr": "" + } + ] +} \ No newline at end of file diff --git a/docs/evidence/final-audit-2026-10-08/mcp-policy/server.py b/docs/evidence/final-audit-2026-10-08/mcp-policy/server.py new file mode 100644 index 00000000..6b608148 --- /dev/null +++ b/docs/evidence/final-audit-2026-10-08/mcp-policy/server.py @@ -0,0 +1,8 @@ +import json,pathlib,sys +pathlib.Path(sys.argv[1]).write_text('host code executed') +for line in sys.stdin: + req=json.loads(line) + if 'id' not in req: continue + if req['method']=='initialize': result={'protocolVersion':'2025-03-26','serverInfo':{'name':'audit','version':'1'},'capabilities':{'tools':{}}} + else: result={'tools':[]} + print(json.dumps({'jsonrpc':'2.0','id':req['id'],'result':result}),flush=True) diff --git a/docs/evidence/final-audit-2026-10-08/mcp/README.md b/docs/evidence/final-audit-2026-10-08/mcp/README.md new file mode 100644 index 00000000..381abcd5 --- /dev/null +++ b/docs/evidence/final-audit-2026-10-08/mcp/README.md @@ -0,0 +1,42 @@ +# Disposable MCP boundary reproductions + +Audited source: `fa0c8e4130ec4d13c59193436679c4e059c22dee` (beta 3). +The two original JSON reports retain the initial observations. The reusable +driver was then rerun successfully against the audited executable; its separate +`replay-report.json` confirms both defects and completed helper cleanup. + +Files safe to retain: this README, `reproduce.py`, both `mcp-*-fixture.py` files, +`policy-report.json`, and `helper-report.json`. There are no credentials, model +weights, process artifacts, or user state in this bundle. + +Run with the audited executable, choosing a NEW output report path: + +```bash +python3 docs/evidence/final-audit-2026-10-08/mcp/reproduce.py \ + --alt /workspace/alt-cli/target/debug/alt \ + --output /tmp/alt-mcp-boundary-recheck.json +``` + +Each invocation creates a private temporary directory below `/tmp` and a separate +Alt state directory. The marker fixture only writes its disposable marker and +returns a valid MCP initialization and empty inventory. No model, network server, +or normal user configuration is used. The temporary state is removed afterward. + +The helper fixture starts one child that ignores SIGTERM and sleeps for at most +30 seconds. The driver records whether it remains running after MCP discovery +returns, sends SIGKILL to that recorded helper (checking process start identity), +and reaps it through Linux's child-subreaper facility. All CLI invocations have a +10-second timeout. Do not run the helper fixture directly: the driver owns its +cleanup. Output contains only fixture results and the executable path. + +Expected after fixing the bugs: + +- Review-only and Guided discovery fail BEFORE launching the marker fixture; + `host_marker_written` is false in both cases. +- Trusted discovery succeeds and writes the marker. +- Trusted helper discovery succeeds, with `survived_after_probe_returned` false. +- `cleanup_running` is false. + +Original observations: Review-only, Guided and Trusted all executed the marker +fixture, and the helper was still running (state `S`) after discovery returned. +The original helper was immediately killed after recording that evidence. diff --git a/docs/evidence/final-audit-2026-10-08/mcp/helper-report.json b/docs/evidence/final-audit-2026-10-08/mcp/helper-report.json new file mode 100644 index 00000000..ceb205f7 --- /dev/null +++ b/docs/evidence/final-audit-2026-10-08/mcp/helper-report.json @@ -0,0 +1,9 @@ +{ + "root": "/tmp/alt-boundary-audit-1quawgb4", + "add_exit": 0, + "check_exit": 0, + "check_stdout": "{\n \"tools\": []\n}", + "child_pid": 425834, + "child_state_after_check": "S", + "survived_after_probe_returned": true +} \ No newline at end of file diff --git a/docs/evidence/final-audit-2026-10-08/mcp/mcp-helper-fixture.py b/docs/evidence/final-audit-2026-10-08/mcp/mcp-helper-fixture.py new file mode 100644 index 00000000..7e5881ed --- /dev/null +++ b/docs/evidence/final-audit-2026-10-08/mcp/mcp-helper-fixture.py @@ -0,0 +1,11 @@ +import json,os,signal,subprocess,sys,time +child=subprocess.Popen([sys.executable,'-c','import signal,time; signal.signal(signal.SIGTERM,signal.SIG_IGN); time.sleep(30)'],stdin=subprocess.DEVNULL,stdout=subprocess.DEVNULL,stderr=subprocess.DEVNULL) +open(sys.argv[1],'w').write(str(child.pid)) +time.sleep(.2) +for line in sys.stdin: + req=json.loads(line) + if 'id' not in req: continue + if req['method']=='initialize': result={'protocolVersion':'2025-03-26','serverInfo':{'name':'bounded-audit','version':'1'},'capabilities':{'tools':{}}} + elif req['method']=='tools/list': result={'tools':[]} + else: result={} + print(json.dumps({'jsonrpc':'2.0','id':req['id'],'result':result}),flush=True) diff --git a/docs/evidence/final-audit-2026-10-08/mcp/mcp-marker-fixture.py b/docs/evidence/final-audit-2026-10-08/mcp/mcp-marker-fixture.py new file mode 100644 index 00000000..6b608148 --- /dev/null +++ b/docs/evidence/final-audit-2026-10-08/mcp/mcp-marker-fixture.py @@ -0,0 +1,8 @@ +import json,pathlib,sys +pathlib.Path(sys.argv[1]).write_text('host code executed') +for line in sys.stdin: + req=json.loads(line) + if 'id' not in req: continue + if req['method']=='initialize': result={'protocolVersion':'2025-03-26','serverInfo':{'name':'audit','version':'1'},'capabilities':{'tools':{}}} + else: result={'tools':[]} + print(json.dumps({'jsonrpc':'2.0','id':req['id'],'result':result}),flush=True) diff --git a/docs/evidence/final-audit-2026-10-08/mcp/policy-report.json b/docs/evidence/final-audit-2026-10-08/mcp/policy-report.json new file mode 100644 index 00000000..99b10d81 --- /dev/null +++ b/docs/evidence/final-audit-2026-10-08/mcp/policy-report.json @@ -0,0 +1,26 @@ +{ + "root": "/tmp/alt-policy-audit-_sbbhq_o", + "results": [ + { + "policy": "review-only", + "exit_code": 0, + "host_marker_written": true, + "stdout": "{\n \"tools\": []\n}", + "stderr": "" + }, + { + "policy": "guided", + "exit_code": 0, + "host_marker_written": true, + "stdout": "{\n \"tools\": []\n}", + "stderr": "" + }, + { + "policy": "trusted", + "exit_code": 0, + "host_marker_written": true, + "stdout": "{\n \"tools\": []\n}", + "stderr": "" + } + ] +} \ No newline at end of file diff --git a/docs/evidence/final-audit-2026-10-08/mcp/replay-report.json b/docs/evidence/final-audit-2026-10-08/mcp/replay-report.json new file mode 100644 index 00000000..9aa19e96 --- /dev/null +++ b/docs/evidence/final-audit-2026-10-08/mcp/replay-report.json @@ -0,0 +1,35 @@ +{ + "schema": 1, + "alt": "/workspace/alt-cli/target/debug/alt", + "policy": [ + { + "exit_code": 0, + "stdout": "{\n \"tools\": []\n}", + "stderr": "", + "policy": "review-only", + "host_marker_written": true + }, + { + "exit_code": 0, + "stdout": "{\n \"tools\": []\n}", + "stderr": "", + "policy": "guided", + "host_marker_written": true + }, + { + "exit_code": 0, + "stdout": "{\n \"tools\": []\n}", + "stderr": "", + "policy": "trusted", + "host_marker_written": true + } + ], + "helper": { + "exit_code": 0, + "stdout": "{\n \"tools\": []\n}", + "stderr": "", + "child_state_after_check": "S", + "survived_after_probe_returned": true, + "cleanup_running": false + } +} diff --git a/docs/evidence/final-audit-2026-10-08/mcp/reproduce.py b/docs/evidence/final-audit-2026-10-08/mcp/reproduce.py new file mode 100644 index 00000000..abef7e22 --- /dev/null +++ b/docs/evidence/final-audit-2026-10-08/mcp/reproduce.py @@ -0,0 +1,116 @@ +#!/usr/bin/env python3 +"""Bounded MCP audit fixtures. Never use a normal Alt data directory.""" +import argparse +import ctypes +import json +import os +from pathlib import Path +import signal +import subprocess +import tempfile +import time + + +def run(alt, state, *args): + result = subprocess.run( + [str(alt), '--data-dir', str(state), *args], + capture_output=True, text=True, timeout=10, + ) + return {'exit_code': result.returncode, 'stdout': result.stdout.strip(), + 'stderr': result.stderr.strip()} + + +def connection(name, fixture, marker): + return {'name': name, 'transport': {'type': 'stdio', 'command': 'python3', + 'args': [str(fixture), str(marker)], 'env_names': []}, + 'enabled': False, 'selected_tools': []} + + +def process_stat(pid): + try: + fields = Path('/proc', str(pid), 'stat').read_text().rsplit(') ', 1)[1].split() + return {'state': fields[0], 'start': fields[19]} + except FileNotFoundError: + return None + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--alt', type=Path, required=True) + parser.add_argument('--output', type=Path, required=True, + help='A new report file outside Alt state; never overwritten') + args = parser.parse_args() + alt = args.alt.resolve(strict=True) + fixture_dir = Path(__file__).resolve().parent + # Reap the intentionally orphaned helper on Linux after recording the bug. + # The helper also has its own 30-second maximum lifetime. + if os.name != 'posix' or not Path('/proc/self/stat').exists(): + raise SystemExit('This reproduction requires Linux.') + libc = ctypes.CDLL(None, use_errno=True) + if libc.prctl(36, 1, 0, 0, 0) != 0: # PR_SET_CHILD_SUBREAPER + raise SystemExit('Cannot enable local helper reaping; no probe ran.') + args.output.parent.mkdir(parents=True, exist_ok=True) + with args.output.open('x', encoding='utf-8') as report_file: + report = {'schema': 1, 'alt': str(alt), 'policy': [], 'helper': {}} + with tempfile.TemporaryDirectory(prefix='alt-mcp-audit-', dir='/tmp') as tmp: + root = Path(tmp) + state = root / 'state' + marker = root / 'marker' + config = root / 'connection.json' + config.write_text(json.dumps(connection( + 'marker', fixture_dir / 'mcp-marker-fixture.py', marker))) + setup = run(alt, state, 'extensions', 'add', str(config)) + if setup['exit_code']: + raise RuntimeError(setup) + for policy in ['review-only', 'guided', 'trusted']: + if marker.exists(): + marker.unlink() + result = run(alt, state, '--access', policy, + 'extensions', 'check', 'marker') + report['policy'].append(dict(result, policy=policy, + host_marker_written=marker.exists())) + pid_file = root / 'helper.pid' + config.write_text(json.dumps(connection( + 'helper', fixture_dir / 'mcp-helper-fixture.py', pid_file))) + setup = run(alt, state, 'extensions', 'add', str(config)) + if setup['exit_code']: + raise RuntimeError(setup) + pid = None + observed = None + try: + result = run(alt, state, '--access', 'trusted', + 'extensions', 'check', 'helper') + pid = int(pid_file.read_text()) + observed = process_stat(pid) + report['helper'] = dict(result, child_state_after_check=( + observed['state'] if observed else 'gone'), + survived_after_probe_returned=bool(observed and observed['state'] != 'Z')) + finally: + if pid is None and pid_file.exists(): + pid = int(pid_file.read_text()) + observed = process_stat(pid) + if pid is not None: + current = process_stat(pid) + if observed and current and current['start'] == observed['start']: + try: + os.kill(pid, signal.SIGKILL) + except ProcessLookupError: + pass + deadline = time.monotonic() + 2 + while time.monotonic() < deadline: + try: + reaped, _ = os.waitpid(pid, os.WNOHANG) + except ChildProcessError: + break + if reaped: + break + time.sleep(.02) + final = process_stat(pid) + report['helper']['cleanup_running'] = bool(final and final['state'] != 'Z') + json.dump(report, report_file, indent=2) + report_file.write('\n') + print(str(args.output)) + + +if __name__ == '__main__': + main() diff --git a/docs/evidence/final-audit-2026-10-08/runtime/REPRODUCE.md b/docs/evidence/final-audit-2026-10-08/runtime/REPRODUCE.md new file mode 100644 index 00000000..a68bccde --- /dev/null +++ b/docs/evidence/final-audit-2026-10-08/runtime/REPRODUCE.md @@ -0,0 +1,130 @@ +# Runtime audit reproductions + +Observed against `/workspace/alt-cli/target/debug/alt` at repository commit +`fa0c8e4130ec4d13c59193436679c4e059c22dee` (beta 3). These checks used disposable +state, a deliberately invalid four-byte GGUF fixture, an executable shell marker, +and a loopback HTTP fixture. No actual model weights or inference were used. + +Retain only this README and these two result receipts in the audit report: + +- `audit-summary.json` +- `ollama-auth-reproduction.json` + +The paths in those receipts identify the original disposable run; they are not +installation instructions. Do not copy the generated state directory or fixtures +into the report. A setup prototype initially placed `runtime_path` in +`runtime.toml` and was rejected as a schema error. The recorded runtime-fallback +result below uses the correct `preferences.toml` field. + +## Cases 1 and 2: incomplete split import and explicit runtime fallback + +Run from the checkout. This is the equivalent consolidated command for the +successful original reproduction; it creates a new disposable directory. + +```bash +python3 - <<'PY' +from pathlib import Path +import json, subprocess, tempfile + +alt = Path('target/debug/alt').resolve() +root = Path(tempfile.mkdtemp(prefix='alt-runtime-audit-', dir='/tmp')) +state = root / 'state' +first = root / 'fixture-00001-of-00002.gguf' +first.write_bytes(b'GGUF') +p = subprocess.run( + [str(alt), '--data-dir', str(state), 'models', 'import', str(first), + '--uncensored', '--use'], text=True, capture_output=True, timeout=15) +(root / 'import.stdout').write_text(p.stdout) +(root / 'import.stderr').write_text(p.stderr) +artifact = json.loads(p.stdout) + +chosen = root / 'chosen-cuda-runtime-missing' +(state / 'preferences.toml').write_text( + 'runtime_path = ' + json.dumps(str(chosen)) + '\n') +fallback = state / 'tools/llama-b11429/llama-server' +fallback.parent.mkdir(parents=True) +fallback.write_text( + '#!/bin/sh\necho AUDIT_UNREQUESTED_FALLBACK_USED >&2\nexit 127\n') +fallback.chmod(0o700) +b = subprocess.run([str(alt), '--data-dir', str(state), 'benchmark'], + text=True, capture_output=True, timeout=30) +(root / 'benchmark.stdout').write_text(b.stdout) +(root / 'benchmark.stderr').write_text(b.stderr) +report = json.loads(b.stdout) +result = { + 'evidence_dir': str(root), + 'four_byte_GGUF_accepted': artifact['bytes'] == 4, + 'split_second_file_exists': (root / 'fixture-00002-of-00002.gguf').exists(), + 'registered_pieces': artifact['pieces'], + 'explicit_selected_runtime': str(chosen), + 'fallback_used': 'AUDIT_UNREQUESTED_FALLBACK_USED' in report.get('error', ''), + 'benchmark_error': report.get('error'), +} +(root / 'audit-summary.json').write_text(json.dumps(result, indent=2) + '\n') +print(json.dumps(result, indent=2)) +PY +``` + +Observed: the invalid import was accepted with four bytes and no recorded parts; +the second shard was absent. Alt then launched the managed shell marker despite +the explicit missing runtime selection. The shell marker immediately exited 127; +the benchmark retained that failure. A corrected build should reject the import +and should never invoke a fallback for a broken explicit runtime choice. + +## Case 3: authenticated Ollama inventory versus doctor + +The original environment had a discoverable Goose executable. `doctor` rejected +Ollama authentication before spawning it. This command uses a literal dummy token +with no access to any service; the HTTP server binds only to loopback. + +```bash +python3 - <<'PY' +from pathlib import Path +import http.server, json, os, subprocess, tempfile, threading + +alt = Path('target/debug/alt').resolve() +root = Path(tempfile.mkdtemp(prefix='alt-ollama-auth-audit-', dir='/tmp')) +state = root / 'state' +seen = [] +class Handler(http.server.BaseHTTPRequestHandler): + def do_GET(self): + seen.append({'path': self.path, 'dummy_auth_received': + self.headers.get('Authorization') == 'Bearer audit-dummy-not-a-secret'}) + data = json.dumps({'models': [{'name': 'audit-fixture-no-weights'}]}).encode() + self.send_response(200) + self.send_header('Content-Type', 'application/json') + self.send_header('Content-Length', str(len(data))) + self.end_headers() + self.wfile.write(data) + def log_message(self, *args): + pass +server = http.server.ThreadingHTTPServer(('127.0.0.1', 0), Handler) +threading.Thread(target=server.serve_forever, daemon=True).start() +env = dict(os.environ, AUDIT_DUMMY_TOKEN='audit-dummy-not-a-secret') +def invoke(*args): + return subprocess.run([str(alt), '--data-dir', str(state), *args], + env=env, text=True, capture_output=True, timeout=10) +try: + init = invoke('init', '--model', 'audit-fixture-no-weights', '--provider', 'ollama', + '--endpoint', f'http://127.0.0.1:{server.server_port}', + '--api-key-env', 'AUDIT_DUMMY_TOKEN') + listing = invoke('models') + doctor = invoke('doctor') +finally: + server.shutdown() + server.server_close() +out = {'init_status': init.returncode, 'inventory_status': listing.returncode, + 'inventory': listing.stdout.strip(), 'doctor_status': doctor.returncode, + 'doctor_error': doctor.stderr.strip(), 'requests': seen} +(root / 'ollama-auth-reproduction.json').write_text(json.dumps(out, indent=2) + '\n') +print(json.dumps(out, indent=2)) +PY +``` + +Observed: `init` and `models` returned zero, both inventory requests carried the +dummy bearer value, and `doctor` returned one with: +`alt: Ollama authentication is not implemented in this slice`. + +These commands reproduce the beta 3 findings. They are not application regression +tests and were not rerun while preparing this README. The original receipts remain +unchanged. A future fixed build may intentionally stop matching these observations. diff --git a/docs/evidence/final-audit-2026-10-08/runtime/audit-summary.json b/docs/evidence/final-audit-2026-10-08/runtime/audit-summary.json new file mode 100644 index 00000000..c194eb93 --- /dev/null +++ b/docs/evidence/final-audit-2026-10-08/runtime/audit-summary.json @@ -0,0 +1,9 @@ +{ + "evidence_dir": "/tmp/alt-runtime-audit-ey6hxy36", + "four_byte_GGUF_accepted": true, + "split_second_file_exists": false, + "registered_pieces": [], + "explicit_selected_runtime": "/tmp/alt-runtime-audit-ey6hxy36/chosen-cuda-runtime-missing", + "fallback_used": true, + "benchmark_error": "Local runtime stopped (exit status: 127). If GPU initialization failed, choose a compatible runtime in Settings or select CPU (0 GPU layers); for allocation failures reduce context, batch or layers. The selected model was not changed. Details: AUDIT_UNREQUESTED_FALLBACK_USED\n" +} diff --git a/docs/evidence/final-audit-2026-10-08/runtime/benchmark.stderr b/docs/evidence/final-audit-2026-10-08/runtime/benchmark.stderr new file mode 100644 index 00000000..fe11e617 --- /dev/null +++ b/docs/evidence/final-audit-2026-10-08/runtime/benchmark.stderr @@ -0,0 +1 @@ +alt: Benchmark did not finish; report was saved diff --git a/docs/evidence/final-audit-2026-10-08/runtime/benchmark.stdout b/docs/evidence/final-audit-2026-10-08/runtime/benchmark.stdout new file mode 100644 index 00000000..6d528158 --- /dev/null +++ b/docs/evidence/final-audit-2026-10-08/runtime/benchmark.stdout @@ -0,0 +1,86 @@ +{ + "alt_version": "0.6.0", + "artifact": { + "bytes": 4, + "id": "b83633aa785344791618f2fddf131b010ea04912a60430760b070bad293f65bd", + "license": "Imported file — check its publisher's license", + "name": "fixture-00001-of-00002.gguf", + "path": "/tmp/alt-runtime-audit-ey6hxy36/fixture-00001-of-00002.gguf", + "pieces": [], + "sha256": "b83633aa785344791618f2fddf131b010ea04912a60430760b070bad293f65bd", + "source": null, + "uncensored_claim": true + }, + "context": 8192, + "error": "Local runtime stopped (exit status: 127). If GPU initialization failed, choose a compatible runtime in Settings or select CPU (0 GPU layers); for allocation failures reduce context, batch or layers. The selected model was not changed. Details: AUDIT_UNREQUESTED_FALLBACK_USED\n", + "gpu_measurement": "Unavailable unless a local owned runtime and nvidia-smi report process allocation", + "hardware": { + "architecture": "x86_64", + "available_ram": 7222120448, + "cpu_flags": [ + "sse2", + "sse4_2", + "avx", + "avx2", + "avx512f" + ], + "cpu_threads": 4, + "driver": "Driver/free VRAM/compute capability unavailable", + "gpu": "No NVIDIA GPU detected; CPU mode is available", + "isolation": { + "available": false, + "detail": "Isolation is unavailable: bwrap: setting up uid map: Read-only file system\n" + }, + "libc": "2.41", + "notes": [ + "RAM and discrete VRAM are separate budgets. Estimates do not guarantee fit or tool quality.", + "GTX 1070 is Pascal sm_61. Use a compatible CUDA 12 build or CPU runtime; CUDA 13-only binaries do not cover it.", + "Spark-X2.5 and MiMo are discoverable through arbitrary Hub search/compatible endpoints; publisher uncensored labels require separate verification.", + "The managed download defaults to CPU. Select a compatible GPU runtime and configure layers in Settings, or use an external Ollama/llama.cpp/LM Studio/ORA endpoint." + ], + "os": "linux", + "profiles": [ + { + "context": 4096, + "estimated_weight_budget": 2147483648, + "explanation": "One loaded model, small context, leave RAM for the desktop and tools", + "model_hint": "1.7–3B Q4 GGUF; verify an uncensored derivative", + "name": "Low memory" + }, + { + "context": 8192, + "estimated_weight_budget": 2537318400, + "explanation": "A starting estimate. Weight size excludes KV cache, runtime and process memory", + "model_hint": "3–4B Q4 GGUF; first evaluation target for 16 GB RAM", + "name": "Balanced" + }, + { + "context": 16384, + "estimated_weight_budget": 1463576576, + "explanation": "Run the capability check, then measure memory and latency. Reduce context on allocation failure", + "model_hint": "Use a model whose native context supports this size", + "name": "More context" + } + ], + "ram": 34359738368 + }, + "id": "4e3a536e-8fc9-4ced-bdfa-37569f25a50d", + "model": "fixture-00001-of-00002.gguf", + "observed_native_context": null, + "provider": "openai", + "ram_measurement": "Sampled owned runtime from process spawn through load and generation. Sampling may miss short peaks; external servers are not measured. Null means unavailable, not zero memory use.", + "recovery": "The owned runtime was stopped. Reduce context/batch/layers or choose another explicitly selected model and rerun; no automatic substitution occurred.", + "requested_context": 8192, + "sampled_peak_runtime_rss_bytes": null, + "sampled_peak_runtime_vram_bytes": null, + "settings": { + "batch": 128, + "cache_k": "f16", + "cache_v": "f16", + "flash_attention": false, + "gpu_layers": 0, + "thinking": null, + "threads": 0 + }, + "task_completion": "Not measured by generation throughput; use the live project acceptance suite" +} diff --git a/docs/evidence/final-audit-2026-10-08/runtime/import.stderr b/docs/evidence/final-audit-2026-10-08/runtime/import.stderr new file mode 100644 index 00000000..e69de29b diff --git a/docs/evidence/final-audit-2026-10-08/runtime/import.stdout b/docs/evidence/final-audit-2026-10-08/runtime/import.stdout new file mode 100644 index 00000000..edeef319 --- /dev/null +++ b/docs/evidence/final-audit-2026-10-08/runtime/import.stdout @@ -0,0 +1,11 @@ +{ + "id": "b83633aa785344791618f2fddf131b010ea04912a60430760b070bad293f65bd", + "name": "fixture-00001-of-00002.gguf", + "path": "/tmp/alt-runtime-audit-ey6hxy36/fixture-00001-of-00002.gguf", + "bytes": 4, + "sha256": "b83633aa785344791618f2fddf131b010ea04912a60430760b070bad293f65bd", + "license": "Imported file — check its publisher's license", + "uncensored_claim": true, + "source": null, + "pieces": [] +} diff --git a/docs/evidence/final-audit-2026-10-08/runtime/ollama-auth-reproduction.json b/docs/evidence/final-audit-2026-10-08/runtime/ollama-auth-reproduction.json new file mode 100644 index 00000000..dc7140c7 --- /dev/null +++ b/docs/evidence/final-audit-2026-10-08/runtime/ollama-auth-reproduction.json @@ -0,0 +1,17 @@ +{ + "init_status": 0, + "inventory_status": 0, + "inventory": "audit-fixture-no-weights", + "doctor_status": 1, + "doctor_error": "alt: Ollama authentication is not implemented in this slice", + "requests": [ + { + "path": "/api/tags", + "dummy_auth_received": true + }, + { + "path": "/api/tags", + "dummy_auth_received": true + } + ] +} diff --git a/docs/evidence/final-audit-2026-10-08/targeted-existing-tests.log b/docs/evidence/final-audit-2026-10-08/targeted-existing-tests.log new file mode 100644 index 00000000..a980bcc7 --- /dev/null +++ b/docs/evidence/final-audit-2026-10-08/targeted-existing-tests.log @@ -0,0 +1,30 @@ + Compiling alt-cli v0.6.0 (/workspace/alt-cli) + Finished `test` profile [unoptimized] target(s) in 15.84s + Running tests/compact_context.rs (target/debug/deps/compact_context-6359495ff43341c0) + +running 13 tests +test clipped_source_never_advertises_an_edit_handle ... ok +test compact_tools_keep_terminal_checks_and_skills_without_ambiguous_edit_schemas ... ok +test compact_context_contains_current_authorized_source_and_complete_pins_without_duplicate_request ... ok +test compact_continuation_keeps_complete_original_scope_and_its_relevant_source ... ok +test line_edits_preserve_missing_final_newline_and_require_real_read_plan_and_valid_lines ... ok +test edit_feedback_refreshes_only_actual_changed_source_for_follow_up_repairs ... ok +test literal_lines_preserve_crlf_unicode_and_backslashes_and_can_undo ... ok +test named_source_prefetch_does_not_index_unrelated_archives ... ok +test new_and_empty_files_and_explicit_delete_remain_checkpointed ... ok +test migration_retains_legacy_handles_and_short_handles_survive_restart ... ok +test parser_feedback_reports_missing_definitions_without_forbidding_intentional_changes ... ok +test scalar_text_edits_preserve_partial_crlf_ranges_and_never_unescape_literals ... ok +test compact_context_prioritizes_actual_failures_over_historical_claims ... ok + +test result: ok. 13 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.05s + + Running tests/pc_ready.rs (target/debug/deps/pc_ready-b323e77916182189) + +running 3 tests +test reviewed_allocation_survives_restart_and_cannot_replace_the_saved_model ... ok +test isolated_pc_state_preserves_selection_without_copying_or_touching_user_work ... ok +test actual_failed_cases_unchanged_checks_source_cycles_and_report_tampering ... ok + +test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.22s + diff --git a/docs/evidence/final-audit-2026-10-08/ux/acp-delay.py b/docs/evidence/final-audit-2026-10-08/ux/acp-delay.py new file mode 100644 index 00000000..36e6444b --- /dev/null +++ b/docs/evidence/final-audit-2026-10-08/ux/acp-delay.py @@ -0,0 +1,84 @@ +#!/usr/bin/env python3 +"""Deterministic ACP peer. No model, network, or shell tools are used.""" +import json +import os +import sys +import time + +pending = None +waiting = None + + +def send(value): + print(json.dumps({"jsonrpc": "2.0", **value}), flush=True) + + +def reply(identifier, result): + send({"id": identifier, "result": result}) + + +def update(kind, **fields): + send({"method": "session/update", "params": { + "sessionId": "fixture-session", "update": {"sessionUpdate": kind, **fields}}}) + + +def text(value): + update("agent_message_chunk", content={"type": "text", "text": value}) + + +for line in sys.stdin: + request = json.loads(line) + if os.environ.get("ALT_FIXTURE_TRACE"): + with open(os.environ["ALT_FIXTURE_TRACE"], "a") as trace: + trace.write(json.dumps(request) + "\n") + method = request.get("method") + identifier = request.get("id") + if method == "initialize": + time.sleep(2) + reply(identifier, {"protocolVersion": 1, "agentCapabilities": {"loadSession": True}, + "agentInfo": {"name": "fixture", "version": "1"}}) + elif method == "session/new": + reply(identifier, {"sessionId": "fixture-session"}) + elif method == "session/close": + reply(identifier, {}) + elif method == "session/load": + # More replay chunks than the bounded event queue: setup must drain it. + for _ in range(200): + text("replay") + reply(identifier, {}) + elif method == "session/prompt": + prompt = request["params"]["prompt"][-1]["text"] + if prompt == "crash": + sys.exit(7) + if prompt == "bad-json": + print("not json", flush=True) + continue + if prompt == "oversize": + print("x" * (1024 * 1024 + 1), flush=True) + continue + if prompt == "wait": + waiting = identifier + text("waiting") + continue + if prompt == "tools": + pending = identifier + text("Checking…\n") + update("tool_call", toolCallId="tool-1", title="fixture check", status="pending") + send({"id": "permission-1", "method": "session/request_permission", "params": { + "sessionId": "fixture-session", "toolCall": {"toolCallId": "tool-1", "title": "fixture check", "rawInput": {"command": "fixture-only"}}, + "options": [{"optionId": "yes", "name": "Allow", "kind": "allow_once"}, + {"optionId": "no", "name": "Reject", "kind": "reject_once"}]}}) + else: + text("fixture response λ\n") + text("final chunk\n") + reply(identifier, {"stopReason": "end_turn"}) + elif method == "session/cancel" and waiting is not None: + reply(waiting, {"stopReason": "cancelled"}) + waiting = None + elif identifier == "permission-1": + allowed = request["result"]["outcome"].get("optionId") == "yes" + update("tool_call_update", toolCallId="tool-1", status="completed", + content=[{"type": "content", "content": {"type": "text", "text": "fixture evidence"}}]) + text("allowed\n" if allowed else "denied\n") + text("final chunk\n") + reply(pending, {"stopReason": "end_turn"}) diff --git a/docs/evidence/final-audit-2026-10-08/ux/cancel-inventory-requested.txt b/docs/evidence/final-audit-2026-10-08/ux/cancel-inventory-requested.txt new file mode 100644 index 00000000..0b6edb22 --- /dev/null +++ b/docs/evidence/final-audit-2026-10-08/ux/cancel-inventory-requested.txt @@ -0,0 +1,40 @@ + ALT / LOCAL WORKSPACE fixture + Connections Local-first · you choose the model + v0.6.0-beta.3 + 1 Home │ Where your model runs + │ Choose a saved connection, or add one with the guided setup. + 2 Workspace │ + │ ╭ Saved connections ────────────────────────────────────────────────────────────────────────────╮ + 3 Models │ │› ● local │ + │ │ fixture · compatible API │ + 4 Connections │ │ │ + │ │ │ + 5 Conversations │ │ │ + │ │ │ + 6 Settings │ │ │ + │ │ │ + 7 Help │ │ │ + │ │ │ + 8 Task progress │ │ │ + │ │ │ + 9 Project files │ │ │ + │ │ │ + 0 Terminal jobs │ │ │ + │ │ │ + · Context & memo │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ ╰───────────────────────────────────────────────────────────────────────────────────────────────╯ + ON THIS COMPUTER │ local · 16384 context tokens · 12 steps per turn + 32.0 GiB RAM │ http://127.0.0.1:38191/v1 + 4 CPU threads │ Authentication: none configured + Ctrl+P Actions │ + F1 Help │ Use Add connection Edit Test Remove + Checking the connection · Stop requested; finishing the current atomic operation. Downloads remain resumab Pause + Stop requested; finishing the current atomic operation. Downloads remain resumable. + + Welcome. Choose a model and project, then describe what you want to do. + ↑↓ Select Enter Use A Add E Edit T Test Delete Remove + \ No newline at end of file diff --git a/docs/evidence/final-audit-2026-10-08/ux/cancel-inventory-result.json b/docs/evidence/final-audit-2026-10-08/ux/cancel-inventory-result.json new file mode 100644 index 00000000..8c378943 --- /dev/null +++ b/docs/evidence/final-audit-2026-10-08/ux/cancel-inventory-result.json @@ -0,0 +1,4 @@ +{ + "cancel_requested": true, + "cancelled_request_result_reopened_model_picker": true +} \ No newline at end of file diff --git a/docs/evidence/final-audit-2026-10-08/ux/cancel-inventory-result.txt b/docs/evidence/final-audit-2026-10-08/ux/cancel-inventory-result.txt new file mode 100644 index 00000000..f83ce7af --- /dev/null +++ b/docs/evidence/final-audit-2026-10-08/ux/cancel-inventory-result.txt @@ -0,0 +1,40 @@ + ALT / LOCAL WORKSPACE fixture + Connections Local-first · you choose the model + v0.6.0-beta.3 + 1 Home │ Where your model runs + │ Choose a saved connection, or add one with the guided setup. + 2 Workspace │ + │ ╭ Saved connections ────────────────────────────────────────────────────────────────────────────╮ + 3 Models │ │› ● local │ + ╭ Choose your model · Step 2 of 2 ─────────────────────────────────────────────────╮ │ + 4 Connections │ local is connected. Choose the model to use. │ │ + │ │ │ + 5 Conversations│ ╭ Available models ────────────────────────────────────────────────────────────╮ │ │ + │ │› fixture │ │ │ + 6 Settings │ │ Select to save this connection │ │ │ + │ │ │ │ │ + 7 Help │ │ │ │ │ + │ │ │ │ │ + 8 Task progress│ │ │ │ │ + │ │ │ │ │ + 9 Project files│ │ │ │ │ + │ │ │ │ │ + 0 Terminal jobs│ │ │ │ │ + │ │ │ │ │ + · Context & mem│ │ │ │ │ + │ │ │ │ │ + │ │ │ │ │ + │ │ │ │ │ + │ │ │ │ │ + │ │ │ │ │ + │ ╰──────────────────────────────────────────────────────────────────────────────╯ │ │ + │ Use this model Cancel │ │ + ╰──────────────────────────────────────────────────────────────────────────────────╯────────────────╯ + ON THIS COMPUTER │ local · 16384 context tokens · 12 steps per turn + 32.0 GiB RAM │ http://127.0.0.1:38191/v1 + 4 CPU threads │ Authentication: none configured + Ctrl+P Actions │ + F1 Help │ Use Add connection Edit Test Remove + Welcome. Choose a model and project, then describe what you want to do. + ↑↓ Select Enter Use A Add E Edit T Test Delete Remove + \ No newline at end of file diff --git a/docs/evidence/final-audit-2026-10-08/ux/cancel_inventory.py b/docs/evidence/final-audit-2026-10-08/ux/cancel_inventory.py new file mode 100644 index 00000000..8b2dd086 --- /dev/null +++ b/docs/evidence/final-audit-2026-10-08/ux/cancel_inventory.py @@ -0,0 +1,31 @@ +import sys,json,tempfile,time,threading,subprocess +from pathlib import Path +from http.server import BaseHTTPRequestHandler,ThreadingHTTPServer +sys.path.insert(0,'/workspace/alt-cli/scripts') +from terminal_harness import Terminal +out=Path('/workspace/.alt-audit-ux');binary=Path('/workspace/alt-cli/target/debug/alt') +started=threading.Event() +class Inventory(BaseHTTPRequestHandler): + def log_message(self,*args):pass + def do_GET(self): + started.set();time.sleep(3);body=b'{"data":[{"id":"fixture"}]}' + self.send_response(200);self.send_header('Content-Length',str(len(body)));self.end_headers() + try:self.wfile.write(body) + except BrokenPipeError:pass +server=ThreadingHTTPServer(('127.0.0.1',0),Inventory);threading.Thread(target=server.serve_forever,daemon=True).start() +with tempfile.TemporaryDirectory(prefix='alt-inventory-cancel-') as d: + root=Path(d);project=root/'project';project.mkdir();state=root/'state' + subprocess.run([str(binary),'--data-dir',str(state),'init','--model','fixture','--endpoint',f'http://127.0.0.1:{server.server_port}/v1'],check=True,capture_output=True) + t=Terminal(binary,state,project) + try: + t.wait('Start a new conversation');t.send(b'\x1b4');t.wait('Saved connections');t.send(b'e');t.wait('Server address');t.send(b'\r');t.wait('Checking the connection');assert started.wait(2) + t.send(b'\x1b');t.wait('Saved connections');t.send(b'\x1b');t.wait('Stop requested'); + end=time.monotonic()+.2 + while time.monotonic()`, `<|close|>`) after a tool result. Replaying the same request: + about 1 in 5 garbage at default temperature and at 0.6, plus HTTP 429. Provider + fault, but Alt has no detection or retry. +4. rust-feature failed for every model: the oracle requires + `median(&[i64::MIN, i64::MAX]) == Some(-0.5)`, which needs i128 arithmetic. + f64 averaging gives 0.0. A fair hard case, not a harness bug. +5. Hosted runs needed `--api-key-env` in the harness (added on this branch). The + harness still forces `--uncensored`, which mislabels standard and hosted runs. + +Raw run directories are on the owner SSD under `3D3D-Launch-2026-10-08/Software/Alt-CLI/alt-cli-trials/` (not committed, +they hold full request/response logs). diff --git a/docs/screenshots/0.7/a01/cutoff-recovery-120x40.png b/docs/screenshots/0.7/a01/cutoff-recovery-120x40.png new file mode 100644 index 00000000..d4454414 Binary files /dev/null and b/docs/screenshots/0.7/a01/cutoff-recovery-120x40.png differ diff --git a/docs/screenshots/0.7/a01/cutoff-recovery-120x40.txt b/docs/screenshots/0.7/a01/cutoff-recovery-120x40.txt new file mode 100644 index 00000000..dd184cc2 --- /dev/null +++ b/docs/screenshots/0.7/a01/cutoff-recovery-120x40.txt @@ -0,0 +1,40 @@ + ALT // LOCAL WORKSPACE ○ fixture-no-weights · Guided changes + Home Local-first · you choose the model + 0.6.0 source 7bed166 + ▸ 1 Home │ Make something. Understand it. Make it work. + │ Describe your goal in ordinary language. Alt helps with the steps. + 2 Workspace │ Model: local · fixture-no-weights + │ Project: /tmp/alt-capture-fz8zoiy6/project + 3 Models │ Agent engine ready · conversations stay on this computer + ╭ The model spent its whole answer allowance thinking ─────────────────────────────╮────────────────╮ + 4 Connections │ The last response used all the selected output tokens on reasoning and returned │ │ + │ no answer or tool call. Those tokens stay charged. Nothing is resent │ │ + 5 Conversation│ automatically: choose a recovery, then press Enter to resend your message. │ │ + │ ╭ Choose an option ────────────────────────────────────────────────────────────╮ │ │ + 6 Settings │ │› Resend with thinking off │ │ │ + │ │ This connection only; your last message goes back in the composer │ │ │ + 7 Help │ │ Resend with low thinking │ │ │ + │ │ Keeps short reasoning; this connection only │ │ │ + 8 Task progres│ │ Raise the output allowance… │ │ │ + │ │ Saved setting; reconnect with Allowance → Apply saved allocation │ │ │ + 9 Project file│ │ Keep current settings │ │ │ + │ │ Close; you can open this again from the palette │ │ │ + 0 Terminal job│ │ │ │ │ + │ │ │ │ │ + · Context & me│ │ │ │ │ + │ │ │ │ │ + │ │ │ │────────────────╯ + │ │ │ │────────────────╮ + │ │ │ │ │ + │ │ │ │tized model. │ + │ ╰──────────────────────────────────────────────────────────────────────────────╯ │y. │ + │ Choose Cancel │ │ + ╰──────────────────────────────────────────────────────────────────────────────────╯use your GPU. │ + ON THIS COMPUTER │ │saved as you work. ││Alt's built-in runtime uses CPU. │ + 15.7 GiB RAM │ │ ││ │ + 4 CPU threads │ ╰────────────────────────────────────────────────╯╰─────────────────────────────────────────────╯ + Ctrl+P Actions │ Tip: your assistant can be wrong. Tool results show what actually happened. + F1 Help │ + Welcome. Choose a model and project, then describe what you want to do. + ↑↓ Choose Enter Open Tab Navigation Ctrl+P Quick actions Ctrl+Q Quit + diff --git a/docs/screenshots/0.7/a01/cutoff-recovery-80x24.png b/docs/screenshots/0.7/a01/cutoff-recovery-80x24.png new file mode 100644 index 00000000..336eb493 Binary files /dev/null and b/docs/screenshots/0.7/a01/cutoff-recovery-80x24.png differ diff --git a/docs/screenshots/0.7/a01/cutoff-recovery-80x24.txt b/docs/screenshots/0.7/a01/cutoff-recovery-80x24.txt new file mode 100644 index 00000000..04e26cbd --- /dev/null +++ b/docs/screenshots/0.7/a01/cutoff-recovery-80x24.txt @@ -0,0 +1,24 @@ + ALT // LOCAL WORKSPACE ○ fixture-no-weights · Guided changes + ╭ The model spent its whole answer allowance thinking ─────────────────────╮ + │ The last response used all the selected output tokens on reasoning and │ +▸1│ returned no answer or tool call. Those tokens stay charged. Nothing is │ + │ resent automatically: choose a recovery, then press Enter to resend your │ + M│ ╭ Choose an option ────────────────────────────────────────────────────╮ │ + D│ │› Resend with thinking off │ │ + M│ │ This connection only; your last message goes back in the composer │ │ + P│ │ Resend with low thinking │ │ + A│ │ Keeps short reasoning; this connection only │ │ + ╭│ │ Raise the output allowance… │ │╮ + ││ │ Saved setting; reconnect with Allowance → Apply saved allocation │ ││ + ││ │ Keep current settings │ ││ + ││ │ Close; you can open this again from the palette │ ││ + ││ │ │ ││ + ││ │ │ ││ + ││ │ │ ││ + ││ │ │ ││ + ╰│ │ │ │╯ + T│ │ │ │ + │ ╰──────────────────────────────────────────────────────────────────────╯ │ + │ Choose Cancel │ + ╰──────────────────────────────────────────────────────────────────────────╯ + diff --git a/docs/screenshots/0.7/a01/settings-models-120x40.png b/docs/screenshots/0.7/a01/settings-models-120x40.png new file mode 100644 index 00000000..1c6df9a6 Binary files /dev/null and b/docs/screenshots/0.7/a01/settings-models-120x40.png differ diff --git a/docs/screenshots/0.7/a01/settings-models-120x40.txt b/docs/screenshots/0.7/a01/settings-models-120x40.txt new file mode 100644 index 00000000..7de6a521 --- /dev/null +++ b/docs/screenshots/0.7/a01/settings-models-120x40.txt @@ -0,0 +1,40 @@ + ALT // LOCAL WORKSPACE ○ fixture-no-weights · Guided changes + Settings Local-first · you choose the model + 0.6.0 source 7bed166 + 1 Home │ Make Alt fit your computer + │ Change a setting with Enter. Changes apply to new conversations. + 2 Workspace │ + │ Appearance ▸Models Tools & access Runtime Data + 3 Models │ + │ ╭ Preferences ──────────────────────────────────────────────────────────────────────────────────╮ + 4 Connections │ │› Context: 8192 tokens · Balanced │ + │ │ More context uses more memory. Cycle: 4K → 8K → 16K → 32K. │ + 5 Conversations │ │ Thinking: Server default │ + │ │ Off, low, medium, high or server default; sent in fields this server understands. │ + ▸ 6 Settings │ │ Check this model's tool use │ + │ │ A short live probe of the exact selected uncensored model. Saves its evidence. │ + 7 Help │ │ Selected model is uncensored/abliterated: claimed │ + │ │ Enter records/removes your publisher claim, enabling the explicit live evaluation. │ + 8 Task progress │ │ Benchmark selected model │ + │ │ Measure this computer; exports exact settings, timings and runtime memory. │ + 9 Project files │ │ │ + │ │ │ + 0 Terminal jobs │ │ │ + │ │ │ + · Context & mem │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + │ │ │ + ON THIS COMPUTER │ ╰───────────────────────────────────────────────────────────────────────────────────────────────╯ + 15.7 GiB RAM │ Detected: 15.7 GiB RAM · 14.7 GiB available · 4 CPU threads + 4 CPU threads │ No NVIDIA GPU detected; CPU mode is available + Ctrl+P Actions │ CPU is the default. GPU layers require a compatible llama-server build. + F1 Help │ Data: /tmp/alt-capture-fz8zoiy6/state + Welcome. Choose a model and project, then describe what you want to do. + ←→ Category ↑↓ Choose setting Enter Change Settings are saved automatically + diff --git a/docs/screenshots/0.7/a01/settings-models-80x24.png b/docs/screenshots/0.7/a01/settings-models-80x24.png new file mode 100644 index 00000000..7d107fb7 Binary files /dev/null and b/docs/screenshots/0.7/a01/settings-models-80x24.png differ diff --git a/docs/screenshots/0.7/a01/settings-models-80x24.txt b/docs/screenshots/0.7/a01/settings-models-80x24.txt new file mode 100644 index 00000000..319cbe8f --- /dev/null +++ b/docs/screenshots/0.7/a01/settings-models-80x24.txt @@ -0,0 +1,24 @@ + ALT // LOCAL WORKSPACE ○ fixture-no-weights · Guided changes + Settings Local-first · you choose the model + 0.6.0 source 7bed166 + 3 Models 4 Links 5 Saved ▸6 Settings 7 Help 8 Task 9 Files + + Make Alt fit your computer + Change a setting with Enter. Changes apply to new conversations. + + Appearance ▸Models Tools & access Runtime Data + + ╭ Preferences ───────────────────────────────────────────────────────────────╮ + │› Context: 8192 tokens · Balanced │ + │ More context uses more memory. Cycle: 4K → 8K → 16K → 32K. │ + │ Thinking: Server default │ + │ Off, low, medium, high or server default; sent in fields this server under│ + │ │ + ╰────────────────────────────────────────────────────────────────────────────╯ + Detected: 15.7 GiB RAM · 14.5 GiB available · 4 CPU threads + No NVIDIA GPU detected; CPU mode is available + CPU is the default. GPU layers require a compatible llama-server build. + Data: /tmp/alt-capture-4gkr8qv1/state + Welcome. Choose a model and project, then describe what you want to do. + ←→ Category ↑↓ Choose setting Enter Change Settings are saved + diff --git a/docs/screenshots/0.7/a01/thinking-menu-120x40.png b/docs/screenshots/0.7/a01/thinking-menu-120x40.png new file mode 100644 index 00000000..9258a638 Binary files /dev/null and b/docs/screenshots/0.7/a01/thinking-menu-120x40.png differ diff --git a/docs/screenshots/0.7/a01/thinking-menu-120x40.txt b/docs/screenshots/0.7/a01/thinking-menu-120x40.txt new file mode 100644 index 00000000..a4591c71 --- /dev/null +++ b/docs/screenshots/0.7/a01/thinking-menu-120x40.txt @@ -0,0 +1,40 @@ + ALT // LOCAL WORKSPACE ○ fixture-no-weights · Guided changes + Home Local-first · you choose the model + 0.6.0 source 7bed166 + ▸ 1 Home │ Make something. Understand it. Make it work. + │ Describe your goal in ordinary language. Alt helps with the steps. + 2 Workspace │ Model: local · fixture-no-weights + │ Project: /tmp/alt-capture-fz8zoiy6/project + 3 Models │ Agent engine ready · conversations stay on this computer + ╭ Model thinking ──────────────────────────────────────────────────────────────────╮────────────────╮ + 4 Connections │ Sent to OpenAI-style reasoning_effort as reasoning_effort. The model and │ │ + │ provider stay the same. Applies to the next connection; Allowance → Apply saved │ │ + 5 Conversation│ allocation reconnects this task. │ │ + │ ╭ Choose an option ────────────────────────────────────────────────────────────╮ │ │ + 6 Settings │ │› Server default │ │ │ + │ │ Send no reasoning field; the server decides │ │ │ + 7 Help │ │ Off │ │ │ + │ │ Fastest; use when the model spends its allowance thinking │ │ │ + 8 Task progres│ │ Low │ │ │ + │ │ Short reasoning before acting │ │ │ + 9 Project file│ │ Medium │ │ │ + │ │ Balanced reasoning │ │ │ + 0 Terminal job│ │ High │ │ │ + │ │ Most reasoning; keeps the action headroom │ │ │ + · Context & me│ │ │ │ │ + │ │ │ │ │ + │ │ │ │────────────────╯ + │ │ │ │────────────────╮ + │ │ │ │ │ + │ │ │ │tized model. │ + │ ╰──────────────────────────────────────────────────────────────────────────────╯ │y. │ + │ Choose Cancel │ │ + ╰──────────────────────────────────────────────────────────────────────────────────╯use your GPU. │ + ON THIS COMPUTER │ │saved as you work. ││Alt's built-in runtime uses CPU. │ + 15.7 GiB RAM │ │ ││ │ + 4 CPU threads │ ╰────────────────────────────────────────────────╯╰─────────────────────────────────────────────╯ + Ctrl+P Actions │ Tip: your assistant can be wrong. Tool results show what actually happened. + F1 Help │ + Welcome. Choose a model and project, then describe what you want to do. + ↑↓ Choose Enter Open Tab Navigation Ctrl+P Quick actions Ctrl+Q Quit + diff --git a/docs/screenshots/0.7/a01/thinking-menu-80x24.png b/docs/screenshots/0.7/a01/thinking-menu-80x24.png new file mode 100644 index 00000000..ac62f65c Binary files /dev/null and b/docs/screenshots/0.7/a01/thinking-menu-80x24.png differ diff --git a/docs/screenshots/0.7/a01/thinking-menu-80x24.txt b/docs/screenshots/0.7/a01/thinking-menu-80x24.txt new file mode 100644 index 00000000..7d981dd4 --- /dev/null +++ b/docs/screenshots/0.7/a01/thinking-menu-80x24.txt @@ -0,0 +1,24 @@ + ALT // LOCAL WORKSPACE ○ fixture-no-weights · Guided changes + ╭ Model thinking ──────────────────────────────────────────────────────────╮ + │ Sent to OpenAI-style reasoning_effort as reasoning_effort. The model and │ +▸1│ provider stay the same. Applies to the next connection; Allowance → │ + │ Apply saved allocation reconnects this task. │ + M│ ╭ Choose an option ────────────────────────────────────────────────────╮ │ + D│ │› Server default │ │ + M│ │ Send no reasoning field; the server decides │ │ + P│ │ Off │ │ + A│ │ Fastest; use when the model spends its allowance thinking │ │ + ╭│ │ Low │ │╮ + ││ │ Short reasoning before acting │ ││ + ││ │ Medium │ ││ + ││ │ Balanced reasoning │ ││ + ││ │ High │ ││ + ││ │ Most reasoning; keeps the action headroom │ ││ + ││ │ │ ││ + ││ │ │ ││ + ╰│ │ │ │╯ + T│ │ │ │ + │ ╰──────────────────────────────────────────────────────────────────────╯ │ + │ Choose Cancel │ + ╰──────────────────────────────────────────────────────────────────────────╯ + diff --git a/docs/screenshots/0.7/a02/params-field-120x40.png b/docs/screenshots/0.7/a02/params-field-120x40.png new file mode 100644 index 00000000..69a9d63e Binary files /dev/null and b/docs/screenshots/0.7/a02/params-field-120x40.png differ diff --git a/docs/screenshots/0.7/a02/params-field-120x40.txt b/docs/screenshots/0.7/a02/params-field-120x40.txt new file mode 100644 index 00000000..f0f43a50 --- /dev/null +++ b/docs/screenshots/0.7/a02/params-field-120x40.txt @@ -0,0 +1,40 @@ + ALT // LOCAL WORKSPACE ○ fixture-no-weights · Guided changes + Home Local-first · you choose the model + 0.6.0 source 3508ee8 + ▸ 1 Home │ Make something. Understand it. Make it work. + │ Describe your goal in ordinary language. Alt helps with the steps. + 2 Workspace │ Model: local · fixture-no-weights + │ Project: /tmp/alt-capture-4cvj8amf/project + 3 Models │ Agent engine ready · conversations stay on this computer + ╭ Set Repeat penalty ──────────────────────────────────────────────────────────────╮────────────────╮ + 4 Connections │ 1 is off; 1.05–1.15 discourages loops. llama.cpp, Ollama, vLLM Leave blank to │ │ + │ return to the default. │ │ + 5 Conversation│ │ │ + │ │ │ + 6 Settings │ ╭ Your text ───────────────────────────────────────────────────────────────────╮ │ │ + │ │ │ │ │ + 7 Help │ │ │ │ │ + │ │ │ │ │ + 8 Task progres│ │ │ │ │ + │ │ │ │ │ + 9 Project file│ │ │ │ │ + │ │ │ │ │ + 0 Terminal job│ │ │ │ │ + │ │ │ │ │ + · Context & me│ │ │ │ │ + │ │ │ │ │ + │ │ │ │────────────────╯ + │ │ │ │────────────────╮ + │ │ │ │ │ + │ │ │ │tized model. │ + │ ╰──────────────────────────────────────────────────────────────────────────────╯ │y. │ + │ Save Cancel │ │ + ╰──────────────────────────────────────────────────────────────────────────────────╯use your GPU. │ + ON THIS COMPUTER │ │saved as you work. ││Alt's built-in runtime uses CPU. │ + 15.7 GiB RAM │ │ ││ │ + 4 CPU threads │ ╰────────────────────────────────────────────────╯╰─────────────────────────────────────────────╯ + Ctrl+P Actions │ Tip: your assistant can be wrong. Tool results show what actually happened. + F1 Help │ + Welcome. Choose a model and project, then describe what you want to do. + ↑↓ Choose Enter Open Tab Navigation Ctrl+P Quick actions Ctrl+Q Quit + diff --git a/docs/screenshots/0.7/a02/params-field-80x24.png b/docs/screenshots/0.7/a02/params-field-80x24.png new file mode 100644 index 00000000..9ab662b9 Binary files /dev/null and b/docs/screenshots/0.7/a02/params-field-80x24.png differ diff --git a/docs/screenshots/0.7/a02/params-field-80x24.txt b/docs/screenshots/0.7/a02/params-field-80x24.txt new file mode 100644 index 00000000..56bcf635 --- /dev/null +++ b/docs/screenshots/0.7/a02/params-field-80x24.txt @@ -0,0 +1,24 @@ + ALT // LOCAL WORKSPACE ○ fixture-no-weights · Guided changes + ╭ Set Repeat penalty ──────────────────────────────────────────────────────╮ + │ 1 is off; 1.05–1.15 discourages loops. llama.cpp, Ollama, vLLM Leave │ +▸1│ blank to return to the default. │ + │ │ + M│ │ + D│ ╭ Your text ───────────────────────────────────────────────────────────╮ │ + M│ │ │ │ + P│ │ │ │ + A│ │ │ │ + ╭│ │ │ │╮ + ││ │ │ ││ + ││ │ │ ││ + ││ │ │ ││ + ││ │ │ ││ + ││ │ │ ││ + ││ │ │ ││ + ││ │ │ ││ + ╰│ │ │ │╯ + T│ │ │ │ + │ ╰──────────────────────────────────────────────────────────────────────╯ │ + │ Save Cancel │ + ╰──────────────────────────────────────────────────────────────────────────╯ + diff --git a/docs/screenshots/0.7/a02/params-menu-120x40.png b/docs/screenshots/0.7/a02/params-menu-120x40.png new file mode 100644 index 00000000..1c5cb07a Binary files /dev/null and b/docs/screenshots/0.7/a02/params-menu-120x40.png differ diff --git a/docs/screenshots/0.7/a02/params-menu-120x40.txt b/docs/screenshots/0.7/a02/params-menu-120x40.txt new file mode 100644 index 00000000..02bbc5f3 --- /dev/null +++ b/docs/screenshots/0.7/a02/params-menu-120x40.txt @@ -0,0 +1,40 @@ + ALT // LOCAL WORKSPACE ○ fixture-no-weights · Guided changes + Home Local-first · you choose the model + 0.6.0 source 3508ee8 + ▸ 1 Home │ Make something. Understand it. Make it work. + │ Describe your goal in ordinary language. Alt helps with the steps. + 2 Workspace │ Model: local · fixture-no-weights + │ Project: /tmp/alt-capture-4cvj8amf/project + 3 Models │ Agent engine ready · conversations stay on this computer + ╭ Advanced parameters ─────────────────────────────────────────────────────────────╮────────────────╮ + 4 Connections │ Request parameters belong to local; runtime parameters apply when Alt starts its │ │ + │ own llama-server. Unset values send nothing. Changes apply on the next │ │ + 5 Conversation│ connection. │ │ + │ ╭ Choose an option ────────────────────────────────────────────────────────────╮ │ │ + 6 Settings │ │› Show raw JSON │ │ │ + │ │ Every value, the exact request fields and the llama-server argv │ │ │ + 7 Help │ │ Repeat penalty: default │ │ │ + │ │ request · 1 is off; 1.05–1.15 discourages loops. llama.cpp, Ollama, vLLM │ │ │ + 8 Task progres│ │ Presence penalty: default │ │ │ + │ │ request · -2 to 2; positive values encourage new topics │ │ │ + 9 Project file│ │ Frequency penalty: default │ │ │ + │ │ request · -2 to 2; positive values discourage repetition │ │ │ + 0 Terminal job│ │ Seed: default │ │ │ + │ │ request · Whole number for repeatable sampling where the server supports it │ │ │ + · Context & me│ │ Stop sequences: default │ │ │ + │ │ request · Separate with |, or a JSON array │ │ │ + │ │ Typical-p: default │ │────────────────╯ + │ │ request · >0 and <=1. llama.cpp and Ollama │ │────────────────╮ + │ │ Extra request JSON: default │ │ │ + │ │ request · JSON object merged last; model, messages, tools, stream and output│ │tized model. │ + │ ╰──────────────────────────────────────────────────────────────────────────────╯ │y. │ + │ Choose Cancel │ │ + ╰──────────────────────────────────────────────────────────────────────────────────╯use your GPU. │ + ON THIS COMPUTER │ │saved as you work. ││Alt's built-in runtime uses CPU. │ + 15.7 GiB RAM │ │ ││ │ + 4 CPU threads │ ╰────────────────────────────────────────────────╯╰─────────────────────────────────────────────╯ + Ctrl+P Actions │ Tip: your assistant can be wrong. Tool results show what actually happened. + F1 Help │ + Welcome. Choose a model and project, then describe what you want to do. + ↑↓ Choose Enter Open Tab Navigation Ctrl+P Quick actions Ctrl+Q Quit + diff --git a/docs/screenshots/0.7/a02/params-menu-80x24.png b/docs/screenshots/0.7/a02/params-menu-80x24.png new file mode 100644 index 00000000..90c954df Binary files /dev/null and b/docs/screenshots/0.7/a02/params-menu-80x24.png differ diff --git a/docs/screenshots/0.7/a02/params-menu-80x24.txt b/docs/screenshots/0.7/a02/params-menu-80x24.txt new file mode 100644 index 00000000..6ac264ca --- /dev/null +++ b/docs/screenshots/0.7/a02/params-menu-80x24.txt @@ -0,0 +1,24 @@ + ALT // LOCAL WORKSPACE ○ fixture-no-weights · Guided changes + ╭ Advanced parameters ─────────────────────────────────────────────────────╮ + │ Request parameters belong to local; runtime parameters apply when Alt │ +▸1│ starts its own llama-server. Unset values send nothing. Changes apply on │ + │ the next connection. │ + M│ ╭ Choose an option ────────────────────────────────────────────────────╮ │ + D│ │› Show raw JSON │ │ + M│ │ Every value, the exact request fields and the llama-server argv │ │ + P│ │ Repeat penalty: default │ │ + A│ │ request · 1 is off; 1.05–1.15 discourages loops. llama.cpp, Ollama, │ │ + ╭│ │ Presence penalty: default │ │╮ + ││ │ request · -2 to 2; positive values encourage new topics │ ││ + ││ │ Frequency penalty: default │ ││ + ││ │ request · -2 to 2; positive values discourage repetition │ ││ + ││ │ Seed: default │ ││ + ││ │ request · Whole number for repeatable sampling where the server supp│ ││ + ││ │ Stop sequences: default │ ││ + ││ │ request · Separate with |, or a JSON array │ ││ + ╰│ │ Typical-p: default │ │╯ + T│ │ request · >0 and <=1. llama.cpp and Ollama │ │ + │ ╰──────────────────────────────────────────────────────────────────────╯ │ + │ Choose Cancel │ + ╰──────────────────────────────────────────────────────────────────────────╯ + diff --git a/docs/screenshots/0.7/a02/params-raw-120x40.png b/docs/screenshots/0.7/a02/params-raw-120x40.png new file mode 100644 index 00000000..178dc56d Binary files /dev/null and b/docs/screenshots/0.7/a02/params-raw-120x40.png differ diff --git a/docs/screenshots/0.7/a02/params-raw-120x40.txt b/docs/screenshots/0.7/a02/params-raw-120x40.txt new file mode 100644 index 00000000..87d58750 --- /dev/null +++ b/docs/screenshots/0.7/a02/params-raw-120x40.txt @@ -0,0 +1,40 @@ + ALT // LOCAL WORKSPACE ○ fixture-no-weights · Guided changes + Home Local-first · you choose the model + 0.6.0 source 3508ee8 + ▸ 1 Home │ Make something. Understand it. Make it work. + │ Describe your goal in ordinary language. Alt helps with the steps. + 2 Workspace │ Model: local · fixture-no-weights + │ Project: /tmp/alt-capture-4cvj8amf/project + 3 Models │ Agent engine ready · conversations stay on this computer + ╭ Advanced parameters (raw JSON) ──────────────────────────────────────────────────╮────────────────╮ + 4 Connections │ { │ │ + │ "connection": "local", │ │ + 5 Conversation│ "effective_request_fields": { │ │ + │ "max_tokens": 2048, │ │ + 6 Settings │ "model": "fixture-no-weights", │ │ + │ "stream": true, │ │ + 7 Help │ "stream_options": { │ │ + │ "include_usage": true │ │ + 8 Task progres│ } │ │ + │ }, │ │ + 9 Project file│ "owned_runtime_argv": [ │ │ + │ "--model", │ │ + 0 Terminal job│ "", │ │ + │ "--ctx-size", │ │ + · Context & me│ "8192", │ │ + │ "--host", │ │ + │ "127.0.0.1", │────────────────╯ + │ "--port", │────────────────╮ + │ "0", │ │ + │ "--threads", │tized model. │ + │ "0", │y. │ + │ Back · PgUp/PgDn to scroll │ │ + ╰──────────────────────────────────────────────────────────────────────────────────╯use your GPU. │ + ON THIS COMPUTER │ │saved as you work. ││Alt's built-in runtime uses CPU. │ + 15.7 GiB RAM │ │ ││ │ + 4 CPU threads │ ╰────────────────────────────────────────────────╯╰─────────────────────────────────────────────╯ + Ctrl+P Actions │ Tip: your assistant can be wrong. Tool results show what actually happened. + F1 Help │ + Welcome. Choose a model and project, then describe what you want to do. + ↑↓ Choose Enter Open Tab Navigation Ctrl+P Quick actions Ctrl+Q Quit + diff --git a/docs/screenshots/0.7/a02/params-raw-80x24.png b/docs/screenshots/0.7/a02/params-raw-80x24.png new file mode 100644 index 00000000..11c24818 Binary files /dev/null and b/docs/screenshots/0.7/a02/params-raw-80x24.png differ diff --git a/docs/screenshots/0.7/a02/params-raw-80x24.txt b/docs/screenshots/0.7/a02/params-raw-80x24.txt new file mode 100644 index 00000000..72dd02f7 --- /dev/null +++ b/docs/screenshots/0.7/a02/params-raw-80x24.txt @@ -0,0 +1,24 @@ + ALT // LOCAL WORKSPACE ○ fixture-no-weights · Guided changes + ╭ Advanced parameters (raw JSON) ──────────────────────────────────────────╮ + │ { │ +▸1│ "connection": "local", │ + │ "effective_request_fields": { │ + M│ "max_tokens": 2048, │ + D│ "model": "fixture-no-weights", │ + M│ "stream": true, │ + P│ "stream_options": { │ + A│ "include_usage": true │ + ╭│ } │╮ + ││ }, ││ + ││ "owned_runtime_argv": [ ││ + ││ "--model", ││ + ││ "", ││ + ││ "--ctx-size", ││ + ││ "8192", ││ + ││ "--host", ││ + ╰│ "127.0.0.1", │╯ + T│ "--port", │ + │ "0", │ + │ Back · PgUp/PgDn to scroll │ + ╰──────────────────────────────────────────────────────────────────────────╯ + diff --git a/docs/screenshots/0.7/a03/missing-key-120x40.png b/docs/screenshots/0.7/a03/missing-key-120x40.png new file mode 100644 index 00000000..62e44cdf Binary files /dev/null and b/docs/screenshots/0.7/a03/missing-key-120x40.png differ diff --git a/docs/screenshots/0.7/a03/missing-key-120x40.txt b/docs/screenshots/0.7/a03/missing-key-120x40.txt new file mode 100644 index 00000000..1a44497f --- /dev/null +++ b/docs/screenshots/0.7/a03/missing-key-120x40.txt @@ -0,0 +1,40 @@ + ALT // LOCAL WORKSPACE ○ fixture-no-weights · Guided changes + Home Local-first · you choose the model + 0.6.0 source 190a4c1 + ▸ 1 Home │ Make something. Understand it. Make it work. + │ Describe your goal in ordinary language. Alt helps with the steps. + 2 Workspace │ Model: local · fixture-no-weights + │ Project: /tmp/alt-capture-kppnmbmc/project + 3 Models │ Agent engine ready · conversations stay on this computer + ╭ Let's get this working ──────────────────────────────────────────────────────────╮────────────────╮ + 4 Connections │ NVIDIA_API_KEY is not set in Alt's environment. Quit, export it in your shell, │ │ + │ then start Alt again; Alt never saves the key itself. │ │ + 5 Conversation│ │ │ + │ Next step: Review the details, close this message to return to your form, and │ │ + 6 Settings │ try again. Task progress provides actual check evidence and undo. │ │ + │ │ │ + 7 Help │ │ │ + │ │ │ + 8 Task progres│ │ │ + │ │ │ + 9 Project file│ │ │ + │ │ │ + 0 Terminal job│ │ │ + │ │ │ + · Context & me│ │ │ + │ │ │ + │ │────────────────╯ + │ │────────────────╮ + │ │ │ + │ │tized model. │ + │ │y. │ + │ Back · PgUp/PgDn to scroll │ │ + ╰──────────────────────────────────────────────────────────────────────────────────╯use your GPU. │ + ON THIS COMPUTER │ │saved as you work. ││Alt's built-in runtime uses CPU. │ + 15.7 GiB RAM │ │ ││ │ + 4 CPU threads │ ╰────────────────────────────────────────────────╯╰─────────────────────────────────────────────╯ + Ctrl+P Actions │ Tip: your assistant can be wrong. Tool results show what actually happened. + F1 Help │ + NVIDIA_API_KEY is not set in Alt's environment. Quit, export it in your shell, then start Alt again; Alt never saves + ↑↓ Choose Enter Open Tab Navigation Ctrl+P Quick actions Ctrl+Q Quit + diff --git a/docs/screenshots/0.7/a03/missing-key-80x24.png b/docs/screenshots/0.7/a03/missing-key-80x24.png new file mode 100644 index 00000000..9dc54c7b Binary files /dev/null and b/docs/screenshots/0.7/a03/missing-key-80x24.png differ diff --git a/docs/screenshots/0.7/a03/missing-key-80x24.txt b/docs/screenshots/0.7/a03/missing-key-80x24.txt new file mode 100644 index 00000000..a8b91316 --- /dev/null +++ b/docs/screenshots/0.7/a03/missing-key-80x24.txt @@ -0,0 +1,24 @@ + ALT // LOCAL WORKSPACE ○ fixture-no-weights · Guided changes + ╭ Let's get this working ──────────────────────────────────────────────────╮ + │ NVIDIA_API_KEY is not set in Alt's environment. Quit, export it in your │ +▸1│ shell, then start Alt again; Alt never saves the key itself. │ + │ │ + M│ Next step: Review the details, close this message to return to your │ + D│ form, and try again. Task progress provides actual check evidence and │ + M│ undo. │ + P│ │ + A│ │ + ╭│ │╮ + ││ ││ + ││ ││ + ││ ││ + ││ ││ + ││ ││ + ││ ││ + ││ ││ + ╰│ │╯ + T│ │ + │ │ + │ Back · PgUp/PgDn to scroll │ + ╰──────────────────────────────────────────────────────────────────────────╯ + diff --git a/docs/screenshots/0.7/a03/nvidia-form-120x40.png b/docs/screenshots/0.7/a03/nvidia-form-120x40.png new file mode 100644 index 00000000..6b84d01b Binary files /dev/null and b/docs/screenshots/0.7/a03/nvidia-form-120x40.png differ diff --git a/docs/screenshots/0.7/a03/nvidia-form-120x40.txt b/docs/screenshots/0.7/a03/nvidia-form-120x40.txt new file mode 100644 index 00000000..bc4bc26b --- /dev/null +++ b/docs/screenshots/0.7/a03/nvidia-form-120x40.txt @@ -0,0 +1,40 @@ + ALT // LOCAL WORKSPACE ○ fixture-no-weights · Guided changes + Home Local-first · you choose the model + 0.6.0 source 190a4c1 + ▸ 1 Home │ Make something. Understand it. Make it work. + │ Describe your goal in ordinary language. Alt helps with the steps. + 2 Workspace │ Model: local · fixture-no-weights + │ Project: /tmp/alt-capture-kppnmbmc/project + 3 Models │ Agent engine ready · conversations stay on this computer + │ ╭ Start here ───────────────────────────────────────────────────────────────────────────────────╮ + 4 Connections │ │› Start a new conversation │ + ╭ Connect your model · Step 1 of 2 ────────────────────────────────────────────────╮ │ + 5 Conversation│ Give this connection a name, then check its server address. │ │ + │ Start the server in your model application first. No API key is needed for most │ │ + 6 Settings │ local servers. │ │ + │ ╭ Connection name ─────────────────────────────────────────────────────────────╮ │ │ + 7 Help │ │NVIDIA NIM │ │ │ + │ ╰──────────────────────────────────────────────────────────────────────────────╯ │ │ + 8 Task progres│ ╭ Server address ──────────────────────────────────────────────────────────────╮ │ │ + │ │https://integrate.api.nvidia.com/v1 │ │ │ + 9 Project file│ ╰──────────────────────────────────────────────────────────────────────────────╯ │ │ + │ ╭ API key variable (optional; enter a variable name, not the key) ─────────────╮ │ │ + 0 Terminal job│ │NVIDIA_API_KEY │ │ │ + │ ╰──────────────────────────────────────────────────────────────────────────────╯ │ │ + · Context & me│ Tab changes fields · Enter checks the connection · Ctrl+M enters a model ID │ │ + │ manually │ │ + │ │────────────────╯ + │ │────────────────╮ + │ │ │ + │ Check connection Cancel │tized model. │ + ╰──────────────────────────────────────────────────────────────────────────────────╯y. │ + │ │ ││ │ + │ │You can stop a task with Esc. Conversations are ││An existing model server can use your GPU. │ + ON THIS COMPUTER │ │saved as you work. ││Alt's built-in runtime uses CPU. │ + 15.7 GiB RAM │ │ ││ │ + 4 CPU threads │ ╰────────────────────────────────────────────────╯╰─────────────────────────────────────────────╯ + Ctrl+P Actions │ Tip: your assistant can be wrong. Tool results show what actually happened. + F1 Help │ + NVIDIA_API_KEY is not set in Alt's environment. Quit, export it in your shell, then start Alt again; Alt never saves + ↑↓ Choose Enter Open Tab Navigation Ctrl+P Quick actions Ctrl+Q Quit + diff --git a/docs/screenshots/0.7/a03/nvidia-form-80x24.png b/docs/screenshots/0.7/a03/nvidia-form-80x24.png new file mode 100644 index 00000000..ce278cd5 Binary files /dev/null and b/docs/screenshots/0.7/a03/nvidia-form-80x24.png differ diff --git a/docs/screenshots/0.7/a03/nvidia-form-80x24.txt b/docs/screenshots/0.7/a03/nvidia-form-80x24.txt new file mode 100644 index 00000000..d97e3042 --- /dev/null +++ b/docs/screenshots/0.7/a03/nvidia-form-80x24.txt @@ -0,0 +1,24 @@ + ALT // LOCAL WORKSPACE ○ fixture-no-weights · Guided changes + Home Local-first · you choose the model + ╭ Connect your model · Step 1 of 2 ────────────────────────────────────────╮ +▸1│ Give this connection a name, then check its server address. │ + │ Start the server in your model application first. No API key is needed │ + M│ for most local servers. │ + D│ ╭ Connection name ─────────────────────────────────────────────────────╮ │ + M│ │NVIDIA NIM │ │ + P│ ╰──────────────────────────────────────────────────────────────────────╯ │ + A│ ╭ Server address ──────────────────────────────────────────────────────╮ │ + ╭│ │https://integrate.api.nvidia.com/v1 │ │╮ + ││ ╰──────────────────────────────────────────────────────────────────────╯ ││ + ││ ╭ API key variable (optional; enter a variable name, not the key) ─────╮ ││ + ││ │NVIDIA_API_KEY │ ││ + ││ ╰──────────────────────────────────────────────────────────────────────╯ ││ + ││ Tab changes fields · Enter checks the connection · Ctrl+M enters a model ││ + ││ ID manually ││ + ││ ││ + ╰│ │╯ + T│ │ + │ Check connection Cancel │ + ╰──────────────────────────────────────────────────────────────────────────╯ + ↑↓ Choose Enter Open Tab Navigation Ctrl+P Quick actions Ctrl+Q Quit + diff --git a/docs/screenshots/0.7/a03/provider-presets-120x40.png b/docs/screenshots/0.7/a03/provider-presets-120x40.png new file mode 100644 index 00000000..e130f3d7 Binary files /dev/null and b/docs/screenshots/0.7/a03/provider-presets-120x40.png differ diff --git a/docs/screenshots/0.7/a03/provider-presets-120x40.txt b/docs/screenshots/0.7/a03/provider-presets-120x40.txt new file mode 100644 index 00000000..22b6c334 --- /dev/null +++ b/docs/screenshots/0.7/a03/provider-presets-120x40.txt @@ -0,0 +1,40 @@ + ALT // LOCAL WORKSPACE ○ fixture-no-weights · Guided changes + Home Local-first · you choose the model + 0.6.0 source 190a4c1 + ▸ 1 Home │ Make something. Understand it. Make it work. + │ Describe your goal in ordinary language. Alt helps with the steps. + 2 Workspace │ Model: local · fixture-no-weights + │ Project: /tmp/alt-capture-kppnmbmc/project + 3 Models │ Agent engine ready · conversations stay on this computer + ╭ Choose a provider ───────────────────────────────────────────────────────────────╮────────────────╮ + 4 Connections │ A preset fills the address, the key variable name and how thinking is sent. Your │ │ + │ key stays in your environment; Alt saves only the variable name. │ │ + 5 Conversation│ │ │ + │ ╭ Choose an option ────────────────────────────────────────────────────────────╮ │ │ + 6 Settings │ │› NVIDIA NIM │ │ │ + │ │ Hosted catalog; key from build.nvidia.com · key in NVIDIA_API_KEY │ │ │ + 7 Help │ │ OpenRouter │ │ │ + │ │ Many providers behind one key · key in OPENROUTER_API_KEY │ │ │ + 8 Task progres│ │ Groq │ │ │ + │ │ Fast hosted open models · key in GROQ_API_KEY │ │ │ + 9 Project file│ │ Together AI │ │ │ + │ │ Hosted open models · key in TOGETHER_API_KEY │ │ │ + 0 Terminal job│ │ DeepSeek │ │ │ + │ │ DeepSeek's own API · key in DEEPSEEK_API_KEY │ │ │ + · Context & me│ │ Mistral │ │ │ + │ │ Mistral's own API · key in MISTRAL_API_KEY │ │ │ + │ │ Gemini (OpenAI-compatible) │ │────────────────╯ + │ │ Google's OpenAI-compatible endpoint · key in GEMINI_API_KEY │ │────────────────╮ + │ │ Cerebras │ │ │ + │ │ Fast hosted open models · key in CEREBRAS_API_KEY │ │tized model. │ + │ ╰──────────────────────────────────────────────────────────────────────────────╯ │y. │ + │ Choose Cancel │ │ + ╰──────────────────────────────────────────────────────────────────────────────────╯use your GPU. │ + ON THIS COMPUTER │ │saved as you work. ││Alt's built-in runtime uses CPU. │ + 15.7 GiB RAM │ │ ││ │ + 4 CPU threads │ ╰────────────────────────────────────────────────╯╰─────────────────────────────────────────────╯ + Ctrl+P Actions │ Tip: your assistant can be wrong. Tool results show what actually happened. + F1 Help │ + Welcome. Choose a model and project, then describe what you want to do. + ↑↓ Choose Enter Open Tab Navigation Ctrl+P Quick actions Ctrl+Q Quit + diff --git a/docs/screenshots/0.7/a03/provider-presets-80x24.png b/docs/screenshots/0.7/a03/provider-presets-80x24.png new file mode 100644 index 00000000..a3958a33 Binary files /dev/null and b/docs/screenshots/0.7/a03/provider-presets-80x24.png differ diff --git a/docs/screenshots/0.7/a03/provider-presets-80x24.txt b/docs/screenshots/0.7/a03/provider-presets-80x24.txt new file mode 100644 index 00000000..a2c30db8 --- /dev/null +++ b/docs/screenshots/0.7/a03/provider-presets-80x24.txt @@ -0,0 +1,24 @@ + ALT // LOCAL WORKSPACE ○ fixture-no-weights · Guided changes + ╭ Choose a provider ───────────────────────────────────────────────────────╮ + │ A preset fills the address, the key variable name and how thinking is │ +▸1│ sent. Your key stays in your environment; Alt saves only the variable │ + │ name. │ + M│ ╭ Choose an option ────────────────────────────────────────────────────╮ │ + D│ │› NVIDIA NIM │ │ + M│ │ Hosted catalog; key from build.nvidia.com · key in NVIDIA_API_KEY │ │ + P│ │ OpenRouter │ │ + A│ │ Many providers behind one key · key in OPENROUTER_API_KEY │ │ + ╭│ │ Groq │ │╮ + ││ │ Fast hosted open models · key in GROQ_API_KEY │ ││ + ││ │ Together AI │ ││ + ││ │ Hosted open models · key in TOGETHER_API_KEY │ ││ + ││ │ DeepSeek │ ││ + ││ │ DeepSeek's own API · key in DEEPSEEK_API_KEY │ ││ + ││ │ Mistral │ ││ + ││ │ Mistral's own API · key in MISTRAL_API_KEY │ ││ + ╰│ │ Gemini (OpenAI-compatible) │ │╯ + T│ │ Google's OpenAI-compatible endpoint · key in GEMINI_API_KEY │ │ + │ ╰──────────────────────────────────────────────────────────────────────╯ │ + │ Choose Cancel │ + ╰──────────────────────────────────────────────────────────────────────────╯ + diff --git a/docs/screenshots/0.7/a04/output-guard-120x40.png b/docs/screenshots/0.7/a04/output-guard-120x40.png new file mode 100644 index 00000000..fe07c40e Binary files /dev/null and b/docs/screenshots/0.7/a04/output-guard-120x40.png differ diff --git a/docs/screenshots/0.7/a04/output-guard-120x40.txt b/docs/screenshots/0.7/a04/output-guard-120x40.txt new file mode 100644 index 00000000..72c10206 --- /dev/null +++ b/docs/screenshots/0.7/a04/output-guard-120x40.txt @@ -0,0 +1,40 @@ + ALT // LOCAL WORKSPACE ○ fixture-no-weights · Guided changes + Home Local-first · you choose the model + 0.6.0 source f801b52 + ▸ 1 Home │ Make something. Understand it. Make it work. + │ Describe your goal in ordinary language. Alt helps with the steps. + 2 Workspace │ Model: local · fixture-no-weights + │ Project: /tmp/alt-capture-empxhfk5/project + 3 Models │ Agent engine ready · conversations stay on this computer + ╭ Hosted output guard ─────────────────────────────────────────────────────────────╮────────────────╮ + 4 Connections │ Some hosted models sometimes stream garbage with leaked template tokens. The │ │ + │ guard holds each response until it is complete, checks it, and discards a │ │ + 5 Conversation│ degenerate one once, recording a provider fault (tokens stay charged). Holding │ │ + │ ╭ Choose an option ────────────────────────────────────────────────────────────╮ │ │ + 6 Settings │ │› Automatic (on for remote servers) │ │ │ + │ │ Remote servers are checked; this computer streams live │ │ │ + 7 Help │ │ On │ │ │ + │ │ Always hold and check responses │ │ │ + 8 Task progres│ │ Off │ │ │ + │ │ Always stream live; no check │ │ │ + 9 Project file│ │ │ │ │ + │ │ │ │ │ + 0 Terminal job│ │ │ │ │ + │ │ │ │ │ + · Context & me│ │ │ │ │ + │ │ │ │ │ + │ │ │ │────────────────╯ + │ │ │ │────────────────╮ + │ │ │ │ │ + │ │ │ │tized model. │ + │ ╰──────────────────────────────────────────────────────────────────────────────╯ │y. │ + │ Choose Cancel │ │ + ╰──────────────────────────────────────────────────────────────────────────────────╯use your GPU. │ + ON THIS COMPUTER │ │saved as you work. ││Alt's built-in runtime uses CPU. │ + 15.7 GiB RAM │ │ ││ │ + 4 CPU threads │ ╰────────────────────────────────────────────────╯╰─────────────────────────────────────────────╯ + Ctrl+P Actions │ Tip: your assistant can be wrong. Tool results show what actually happened. + F1 Help │ + Welcome. Choose a model and project, then describe what you want to do. + ↑↓ Choose Enter Open Tab Navigation Ctrl+P Quick actions Ctrl+Q Quit + diff --git a/docs/screenshots/0.7/a04/output-guard-80x24.png b/docs/screenshots/0.7/a04/output-guard-80x24.png new file mode 100644 index 00000000..063fe443 Binary files /dev/null and b/docs/screenshots/0.7/a04/output-guard-80x24.png differ diff --git a/docs/screenshots/0.7/a04/output-guard-80x24.txt b/docs/screenshots/0.7/a04/output-guard-80x24.txt new file mode 100644 index 00000000..8577f507 --- /dev/null +++ b/docs/screenshots/0.7/a04/output-guard-80x24.txt @@ -0,0 +1,24 @@ + ALT // LOCAL WORKSPACE ○ fixture-no-weights · Guided changes + ╭ Hosted output guard ─────────────────────────────────────────────────────╮ + │ Some hosted models sometimes stream garbage with leaked template tokens. │ +▸1│ The guard holds each response until it is complete, checks it, and │ + │ discards a degenerate one once, recording a provider fault (tokens stay │ + M│ ╭ Choose an option ────────────────────────────────────────────────────╮ │ + D│ │› Automatic (on for remote servers) │ │ + M│ │ Remote servers are checked; this computer streams live │ │ + P│ │ On │ │ + A│ │ Always hold and check responses │ │ + ╭│ │ Off │ │╮ + ││ │ Always stream live; no check │ ││ + ││ │ │ ││ + ││ │ │ ││ + ││ │ │ ││ + ││ │ │ ││ + ││ │ │ ││ + ││ │ │ ││ + ╰│ │ │ │╯ + T│ │ │ │ + │ ╰──────────────────────────────────────────────────────────────────────╯ │ + │ Choose Cancel │ + ╰──────────────────────────────────────────────────────────────────────────╯ + diff --git a/docs/screenshots/0.7/a05/probe-applied-120x40.png b/docs/screenshots/0.7/a05/probe-applied-120x40.png new file mode 100644 index 00000000..bdd86832 Binary files /dev/null and b/docs/screenshots/0.7/a05/probe-applied-120x40.png differ diff --git a/docs/screenshots/0.7/a05/probe-applied-120x40.txt b/docs/screenshots/0.7/a05/probe-applied-120x40.txt new file mode 100644 index 00000000..a665611d --- /dev/null +++ b/docs/screenshots/0.7/a05/probe-applied-120x40.txt @@ -0,0 +1,40 @@ + ALT // LOCAL WORKSPACE ○ fixture-no-weights · Guided changes + Home Local-first · you choose the model + 0.6.0 source 9ba7be1 + ▸ 1 Home │ Make something. Understand it. Make it work. + │ Describe your goal in ordinary language. Alt helps with the steps. + 2 Workspace │ Model: local · fixture-no-weights + │ Project: /tmp/alt-capture-edqqraii/project + 3 Models │ Agent engine ready · conversations stay on this computer + │ ╭ Start here ───────────────────────────────────────────────────────────────────────────────────╮ + 4 Connections │ │› Start a new conversation │ + │ │ Tell the assistant what you want to accomplish. │ + 5 Conversations │ │ Try a practice project │ + │ │ Learn repair, real checks and undo in a fresh example folder. │ + 6 Settings │ │ Choose a project folder │ + │ │ Pick the files Alt should work with. │ + 7 Help │ │ Prepare project checks │ + │ │ Choose how to test changes before asking your model to work. │ + 8 Task progress │ │ Choose a connection │ + │ │ Use Ollama, LM Studio, a model file, or another API. │ + 9 Project files │ │ Start with a guided task │ + │ │ Understand, build, troubleshoot, check, or review. │ + 0 Terminal jobs │ │ Agent engine is installed │ + │ │ A separate local component that gives your model tools. │ + · Context & mem │ │ Keep a project brief │ + │ │ Save goals, decisions, and next steps for future messages. │ + │ ╰───────────────────────────────────────────────────────────────────────────────────────────────╯ + │ ╭ How it works ──────────────────────────────────╮╭ For smaller computers ──────────────────────╮ + │ │1 Describe the result you want. ││Context budget: 4K tokens │ + │ │2 Review commands and file changes. ││Start with a small 3B–4B quantized model. │ + │ │3 Check the results together. ││More context needs more memory. │ + │ │ ││ │ + │ │You can stop a task with Esc. Conversations are ││An existing model server can use your GPU. │ + ON THIS COMPUTER │ │saved as you work. ││Alt's built-in runtime uses CPU. │ + 15.7 GiB RAM │ │ ││ │ + 4 CPU threads │ ╰────────────────────────────────────────────────╯╰─────────────────────────────────────────────╯ + Ctrl+P Actions │ Tip: your assistant can be wrong. Tool results show what actually happened. + F1 Help │ + Match the server context (4096) applied to this connection. The model and provider are unchanged; it takes effect on + ↑↓ Choose Enter Open Tab Navigation Ctrl+P Quick actions Ctrl+Q Quit + diff --git a/docs/screenshots/0.7/a05/probe-applied-80x24.png b/docs/screenshots/0.7/a05/probe-applied-80x24.png new file mode 100644 index 00000000..87763374 Binary files /dev/null and b/docs/screenshots/0.7/a05/probe-applied-80x24.png differ diff --git a/docs/screenshots/0.7/a05/probe-applied-80x24.txt b/docs/screenshots/0.7/a05/probe-applied-80x24.txt new file mode 100644 index 00000000..ace5930c --- /dev/null +++ b/docs/screenshots/0.7/a05/probe-applied-80x24.txt @@ -0,0 +1,24 @@ + ALT // LOCAL WORKSPACE ○ fixture-no-weights · Guided changes + Home Local-first · you choose the model + 0.6.0 source 9ba7be1 +▸1 Home 2 Chat 3 Models 4 Links 5 Saved 6 Settings 7 Help + + Make something. Understand it. Make it work. + Describe your goal in ordinary language. Alt helps with the steps. + Model: local · fixture-no-weights + Project: /tmp/alt-capture-44b2h512/project + Agent engine ready · conversations stay on this computer + ╭ Start here ────────────────────────────────────────────────────────────────╮ + │› Start a new conversation │ + │ Tell the assistant what you want to accomplish. │ + │ Try a practice project │ + │ Learn repair, real checks and undo in a fresh example folder. │ + │ Choose a project folder │ + │ Pick the files Alt should work with. │ + │ │ + ╰────────────────────────────────────────────────────────────────────────────╯ + Tip: your assistant can be wrong. Tool results show what actually happened. + + Match the server context (4096) applied to this connection. The model and + ↑↓ Choose Enter Open Tab Navigation Ctrl+P Quick actions Ctrl+Q Quit + diff --git a/docs/screenshots/0.7/a05/probe-results-120x40.png b/docs/screenshots/0.7/a05/probe-results-120x40.png new file mode 100644 index 00000000..83bd64cb Binary files /dev/null and b/docs/screenshots/0.7/a05/probe-results-120x40.png differ diff --git a/docs/screenshots/0.7/a05/probe-results-120x40.txt b/docs/screenshots/0.7/a05/probe-results-120x40.txt new file mode 100644 index 00000000..43baf724 --- /dev/null +++ b/docs/screenshots/0.7/a05/probe-results-120x40.txt @@ -0,0 +1,40 @@ + ALT // LOCAL WORKSPACE ○ fixture-no-weights · Guided changes + Home Local-first · you choose the model + 0.6.0 source 9ba7be1 + ▸ 1 Home │ Make something. Understand it. Make it work. + │ Describe your goal in ordinary language. Alt helps with the steps. + 2 Workspace │ Model: local · fixture-no-weights + │ Project: /tmp/alt-capture-edqqraii/project + 3 Models │ Agent engine ready · conversations stay on this computer + ╭ Probe results ───────────────────────────────────────────────────────────────────╮────────────────╮ + 4 Connections │ Tool call: no · thinking seen: no · finish: stop · native context 4096. Choose a │ │ + │ suggestion to apply it; nothing changes otherwise. │ │ + 5 Conversation│ │ │ + │ ╭ Choose an option ────────────────────────────────────────────────────────────╮ │ │ + 6 Settings │ │› Use compact tools │ │ │ + │ │ The model did not call the offered tool; smaller schemas help small models │ │ │ + 7 Help │ │ Match the server context (4096) │ │ │ + │ │ The server reports 4096 native context tokens, less than the configured 8192│ │ │ + 8 Task progres│ │ Inspect the probe report │ │ │ + │ │ Server facts, observed reply and every suggestion │ │ │ + 9 Project file│ │ Keep current settings │ │ │ + │ │ Nothing changes │ │ │ + 0 Terminal job│ │ │ │ │ + │ │ │ │ │ + · Context & me│ │ │ │ │ + │ │ │ │ │ + │ │ │ │────────────────╯ + │ │ │ │────────────────╮ + │ │ │ │ │ + │ │ │ │tized model. │ + │ ╰──────────────────────────────────────────────────────────────────────────────╯ │y. │ + │ Choose Cancel │ │ + ╰──────────────────────────────────────────────────────────────────────────────────╯use your GPU. │ + ON THIS COMPUTER │ │saved as you work. ││Alt's built-in runtime uses CPU. │ + 15.7 GiB RAM │ │ ││ │ + 4 CPU threads │ ╰────────────────────────────────────────────────╯╰─────────────────────────────────────────────╯ + Ctrl+P Actions │ Tip: your assistant can be wrong. Tool results show what actually happened. + F1 Help │ + Welcome. Choose a model and project, then describe what you want to do. + ↑↓ Choose Enter Open Tab Navigation Ctrl+P Quick actions Ctrl+Q Quit + diff --git a/docs/screenshots/0.7/a05/probe-results-80x24.png b/docs/screenshots/0.7/a05/probe-results-80x24.png new file mode 100644 index 00000000..7aa3b6dc Binary files /dev/null and b/docs/screenshots/0.7/a05/probe-results-80x24.png differ diff --git a/docs/screenshots/0.7/a05/probe-results-80x24.txt b/docs/screenshots/0.7/a05/probe-results-80x24.txt new file mode 100644 index 00000000..16953c39 --- /dev/null +++ b/docs/screenshots/0.7/a05/probe-results-80x24.txt @@ -0,0 +1,24 @@ + ALT // LOCAL WORKSPACE ○ fixture-no-weights · Guided changes + ╭ Probe results ───────────────────────────────────────────────────────────╮ + │ Tool call: no · thinking seen: no · finish: stop · native context 4096. │ +▸1│ Choose a suggestion to apply it; nothing changes otherwise. │ + │ │ + M│ ╭ Choose an option ────────────────────────────────────────────────────╮ │ + D│ │› Use compact tools │ │ + M│ │ The model did not call the offered tool; smaller schemas help small │ │ + P│ │ Match the server context (4096) │ │ + A│ │ The server reports 4096 native context tokens, less than the configu│ │ + ╭│ │ Inspect the probe report │ │╮ + ││ │ Server facts, observed reply and every suggestion │ ││ + ││ │ Keep current settings │ ││ + ││ │ Nothing changes │ ││ + ││ │ │ ││ + ││ │ │ ││ + ││ │ │ ││ + ││ │ │ ││ + ╰│ │ │ │╯ + T│ │ │ │ + │ ╰──────────────────────────────────────────────────────────────────────╯ │ + │ Choose Cancel │ + ╰──────────────────────────────────────────────────────────────────────────╯ + diff --git a/docs/screenshots/0.7/a06/tool-focus-120x40.png b/docs/screenshots/0.7/a06/tool-focus-120x40.png new file mode 100644 index 00000000..7a485000 Binary files /dev/null and b/docs/screenshots/0.7/a06/tool-focus-120x40.png differ diff --git a/docs/screenshots/0.7/a06/tool-focus-120x40.txt b/docs/screenshots/0.7/a06/tool-focus-120x40.txt new file mode 100644 index 00000000..84fb7058 --- /dev/null +++ b/docs/screenshots/0.7/a06/tool-focus-120x40.txt @@ -0,0 +1,40 @@ + ALT // LOCAL WORKSPACE ○ fixture-no-weights · Guided changes + Settings Local-first · you choose the model + 0.6.0 source 86c1ab8 + 1 Home │ Make Alt fit your computer + │ Change a setting with Enter. Changes apply to new conversations. + 2 Workspace │ + │ Appearance Models ▸Tools & access Runtime Data + 3 Models │ + ╭ Which tools fit this task? ──────────────────────────────────────────────────────╮────────────────╮ + 4 Connections │ This changes the schemas shown on the next connection. Full access remains an │ │ + │ independent setting. Select All whenever the task needs a wider tool set. │ │ + 5 Conversation│ │ │ + │ ╭ Choose an option ────────────────────────────────────────────────────────────╮ │our choice. │ + ▸ 6 Settings │ │› All native tools │ │ │ + │ │ │ │ │ + 7 Help │ │ Inspect and explain │ │ │ + │ │ │ │ │ + 8 Task progres│ │ Read, edit and run named checks │ │ │ + │ │ │ │ │ + 9 Project file│ │ Terminal and file reading │ │ │ + │ │ │ │ │ + 0 Terminal job│ │ Compact: smaller context, simple text edits, whole small-file rewrites │ │ │ + │ │ │ │ │ + · Context & me│ │ Compact with line-array edits │ │ │ + │ │ │ │ │ + │ │ │ │ │ + │ │ │ │ │ + │ │ │ │ │ + │ │ │ │ │ + │ ╰──────────────────────────────────────────────────────────────────────────────╯ │ │ + │ Choose Cancel │ │ + ╰──────────────────────────────────────────────────────────────────────────────────╯ │ + ON THIS COMPUTER │ ╰───────────────────────────────────────────────────────────────────────────────────────────────╯ + 15.7 GiB RAM │ Detected: 15.7 GiB RAM · 14.9 GiB available · 4 CPU threads + 4 CPU threads │ No NVIDIA GPU detected; CPU mode is available + Ctrl+P Actions │ CPU is the default. GPU layers require a compatible llama-server build. + F1 Help │ Data: /tmp/alt-capture-g_geea4q/state + Welcome. Choose a model and project, then describe what you want to do. + ←→ Category ↑↓ Choose setting Enter Change Settings are saved automatically + diff --git a/docs/screenshots/0.7/a06/tool-focus-80x24.png b/docs/screenshots/0.7/a06/tool-focus-80x24.png new file mode 100644 index 00000000..a125e2ac Binary files /dev/null and b/docs/screenshots/0.7/a06/tool-focus-80x24.png differ diff --git a/docs/screenshots/0.7/a06/tool-focus-80x24.txt b/docs/screenshots/0.7/a06/tool-focus-80x24.txt new file mode 100644 index 00000000..fcffb8f5 --- /dev/null +++ b/docs/screenshots/0.7/a06/tool-focus-80x24.txt @@ -0,0 +1,24 @@ + ALT // LOCAL WORKSPACE ○ fixture-no-weights · Guided changes + ╭ Which tools fit this task? ──────────────────────────────────────────────╮ + │ This changes the schemas shown on the next connection. Full access │ + 3│ remains an independent setting. Select All whenever the task needs a │ + │ wider tool set. │ + M│ ╭ Choose an option ────────────────────────────────────────────────────╮ │ + C│ │› All native tools │ │ + │ │ │ │ + │ │ Inspect and explain │ │ + │ │ │ │ + ╭│ │ Read, edit and run named checks │ │╮ + ││ │ │ ││ + ││ │ Terminal and file reading │ ││ + ││ │ │ ││ + ││ │ Compact: smaller context, simple text edits, whole small-file rewrit│ ││ + ││ │ │ ││ + ╰│ │ Compact with line-array edits │ │╯ + D│ │ │ │ + N│ │ │ │ + C│ │ │ │ + D│ ╰──────────────────────────────────────────────────────────────────────╯ │ + │ Choose Cancel │ + ╰──────────────────────────────────────────────────────────────────────────╯ + diff --git a/docs/screenshots/0.7/a07/terminal-approval-120x40.png b/docs/screenshots/0.7/a07/terminal-approval-120x40.png new file mode 100644 index 00000000..725cea5f Binary files /dev/null and b/docs/screenshots/0.7/a07/terminal-approval-120x40.png differ diff --git a/docs/screenshots/0.7/a07/terminal-approval-120x40.txt b/docs/screenshots/0.7/a07/terminal-approval-120x40.txt new file mode 100644 index 00000000..7a4adfdc --- /dev/null +++ b/docs/screenshots/0.7/a07/terminal-approval-120x40.txt @@ -0,0 +1,40 @@ + ALT // LOCAL WORKSPACE ● fixture-no-weights · Guided changes + Workspace ╭ Review this action ────────────────────────────────────────────────────────────────────────╮ur approval + 0.6.0 sourc│ fixture check │ + 1 Home │ Project: /tmp/alt-capture-gb4dqv9k/project │ + │ Read the proposed command or change below. It runs with your account's access. │ configured + ▸ 2 Workspa│ 1 request(s) waiting · PgUp/PgDn scroll details │rs + │ │ approval + 3 Models │ ╭ Proposed action / file changes ────────────────────────────────────────────────────────╮ │vidence ───╮ + │ │Run this command: │ │ │ + 4 Connect│ │fixture-only │ │ │ + │ │ │ │ │ + 5 Convers│ │Complete request details: │ │ │ + │ │{ │ │ │ + 6 Setting│ │ "command": "fixture-only" │ │ │ + │ │} │ │ │ + 7 Help │ │ │ │ │ + │ │ │ │ │ + 8 Task pr│ │ │ │ │ + │ │ │ │ │ + 9 Project│ │ │ │ │ + │ │ │ │ │ + 0 Termina│ │ │ │ │ + │ │ │ │ │ + · Context│ │ │ │ │ + │ │ │ │ │ + │ │ │ │ │ + │ │ │ │ │ + │ │ │ │───────────╯ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │───────────╮ + ON THIS COMP│ ╰────────────────────────────────────────────────────────────────────────────────────────╯ │ │ + 15.7 GiB RAM│ TERMINAL / EXTERNAL TOOL: runs with your own permissions. "Allow terminal this session" is │ │ + 4 CPU thread│ separate from project trust and lasts until you reconnect. Ctrl+Y allows once; Ctrl+N │ │ + Ctrl+P Acti│ rejects. │───────────╯ + F1 Help│ Reject Allow once Allow terminal this session │ + Working. To│ │ + Enter Send ╰────────────────────────────────────────────────────────────────────────────────────────────╯ + diff --git a/docs/screenshots/0.7/a07/terminal-approval-80x24.png b/docs/screenshots/0.7/a07/terminal-approval-80x24.png new file mode 100644 index 00000000..8ca5d858 Binary files /dev/null and b/docs/screenshots/0.7/a07/terminal-approval-80x24.png differ diff --git a/docs/screenshots/0.7/a07/terminal-approval-80x24.txt b/docs/screenshots/0.7/a07/terminal-approval-80x24.txt new file mode 100644 index 00000000..846fa099 --- /dev/null +++ b/docs/screenshots/0.7/a07/terminal-approval-80x24.txt @@ -0,0 +1,24 @@ + ALT // LOCAL WORKSPACE ● fixture-no-weights · Guided changes + ╭ Review this action ──────────────────────────────────────────────────────╮ + │ fixture check │ + 1│ Project: /tmp/alt-capture-thz0cbwo/project │ + │ Read the proposed command or change below. It runs with your account's │ + ╭│ access. │╮ + ││ 1 request(s) waiting · PgUp/PgDn scroll details ││ + ││ ╭ Proposed action / file changes ──────────────────────────────────────╮ ││ + ││ │Run this command: │ ││ + ││ │fixture-only │ ││ + ││ │ │ ││ + ││ │Complete request details: │ ││ + ││ │{ │ ││ + ││ │ "command": "fixture-only" │ ││ + ╰│ │} │ │╯ + ╭│ │ │ │╮ + ││ ╰──────────────────────────────────────────────────────────────────────╯ ││ + ││ TERMINAL / EXTERNAL TOOL: runs with your own permissions. "Allow ││ + ││ terminal this session" is separate from project trust and lasts until ││ + ╰│ you reconnect. Ctrl+Y allows once; Ctrl+N rejects. │╯ + │ Reject Allow once Allow terminal this session │ + │ │ + ╰──────────────────────────────────────────────────────────────────────────╯ + diff --git a/docs/screenshots/0.7/a08/gpu-runtime-120x40.png b/docs/screenshots/0.7/a08/gpu-runtime-120x40.png new file mode 100644 index 00000000..f680d857 Binary files /dev/null and b/docs/screenshots/0.7/a08/gpu-runtime-120x40.png differ diff --git a/docs/screenshots/0.7/a08/gpu-runtime-120x40.txt b/docs/screenshots/0.7/a08/gpu-runtime-120x40.txt new file mode 100644 index 00000000..67a3fdac --- /dev/null +++ b/docs/screenshots/0.7/a08/gpu-runtime-120x40.txt @@ -0,0 +1,40 @@ + ALT // LOCAL WORKSPACE ○ fixture-no-weights · Guided changes + Home Local-first · you choose the model + 0.6.0 source f322b8f + ▸ 1 Home │ Make something. Understand it. Make it work. + │ Describe your goal in ordinary language. Alt helps with the steps. + 2 Workspace │ Model: local · fixture-no-weights + │ Project: /tmp/alt-capture-ooflwvsq/project + 3 Models │ Agent engine ready · conversations stay on this computer + ╭ GPU runtime (CUDA 12) ───────────────────────────────────────────────────────────╮────────────────╮ + 4 Connections │ No NVIDIA GPU was detected (nvidia-smi unavailable). CPU mode stays available. │ │ + │ │ │ + 5 Conversation│ CPU remains the default. Alt never switches runtimes or GPU layers by itself │ │ + │ (GPU layers: 0). │ │ + 6 Settings │ │ │ + │ │ │ + 7 Help │ │ │ + │ ╭ Choose an option ────────────────────────────────────────────────────────────╮ │ │ + 8 Task progres│ │› No CUDA 12 build is pinned in this version │ │ │ + │ │ Build one from source below, or select an existing GPU llama-server │ │ │ + 9 Project file│ │ Build a Pascal-compatible runtime from source │ │ │ + │ │ scripts/build-pascal-runtime.sh (CUDA 12 toolkit, sm_61) │ │ │ + 0 Terminal job│ │ Select an existing llama-server │ │ │ + │ │ Choose a GPU build you already have │ │ │ + · Context & me│ │ Keep CPU mode │ │ │ + │ │ Nothing changes │ │ │ + │ │ │ │────────────────╯ + │ │ │ │────────────────╮ + │ │ │ │ │ + │ │ │ │tized model. │ + │ ╰──────────────────────────────────────────────────────────────────────────────╯ │y. │ + │ Choose Cancel │ │ + ╰──────────────────────────────────────────────────────────────────────────────────╯use your GPU. │ + ON THIS COMPUTER │ │saved as you work. ││Alt's built-in runtime uses CPU. │ + 15.7 GiB RAM │ │ ││ │ + 4 CPU threads │ ╰────────────────────────────────────────────────╯╰─────────────────────────────────────────────╯ + Ctrl+P Actions │ Tip: your assistant can be wrong. Tool results show what actually happened. + F1 Help │ + Welcome. Choose a model and project, then describe what you want to do. + ↑↓ Choose Enter Open Tab Navigation Ctrl+P Quick actions Ctrl+Q Quit + diff --git a/docs/screenshots/0.7/a08/gpu-runtime-80x24.png b/docs/screenshots/0.7/a08/gpu-runtime-80x24.png new file mode 100644 index 00000000..f403d57d Binary files /dev/null and b/docs/screenshots/0.7/a08/gpu-runtime-80x24.png differ diff --git a/docs/screenshots/0.7/a08/gpu-runtime-80x24.txt b/docs/screenshots/0.7/a08/gpu-runtime-80x24.txt new file mode 100644 index 00000000..b85f4b45 --- /dev/null +++ b/docs/screenshots/0.7/a08/gpu-runtime-80x24.txt @@ -0,0 +1,24 @@ + ALT // LOCAL WORKSPACE ○ fixture-no-weights · Guided changes + ╭ GPU runtime (CUDA 12) ───────────────────────────────────────────────────╮ + │ No NVIDIA GPU was detected (nvidia-smi unavailable). CPU mode stays │ +▸1│ available. │ + │ │ + M│ CPU remains the default. Alt never switches runtimes or GPU layers by │ + D│ itself (GPU layers: 0). │ + M│ │ + P│ │ + A│ ╭ Choose an option ────────────────────────────────────────────────────╮ │ + ╭│ │› No CUDA 12 build is pinned in this version │ │╮ + ││ │ Build one from source below, or select an existing GPU llama-server │ ││ + ││ │ Build a Pascal-compatible runtime from source │ ││ + ││ │ scripts/build-pascal-runtime.sh (CUDA 12 toolkit, sm_61) │ ││ + ││ │ Select an existing llama-server │ ││ + ││ │ Choose a GPU build you already have │ ││ + ││ │ Keep CPU mode │ ││ + ││ │ Nothing changes │ ││ + ╰│ │ │ │╯ + T│ │ │ │ + │ ╰──────────────────────────────────────────────────────────────────────╯ │ + │ Choose Cancel │ + ╰──────────────────────────────────────────────────────────────────────────╯ + diff --git a/docs/screenshots/0.7/b07/connection-form-120x40.png b/docs/screenshots/0.7/b07/connection-form-120x40.png new file mode 100644 index 00000000..ba3b94f4 Binary files /dev/null and b/docs/screenshots/0.7/b07/connection-form-120x40.png differ diff --git a/docs/screenshots/0.7/b07/connection-form-120x40.txt b/docs/screenshots/0.7/b07/connection-form-120x40.txt new file mode 100644 index 00000000..6db0d612 --- /dev/null +++ b/docs/screenshots/0.7/b07/connection-form-120x40.txt @@ -0,0 +1,40 @@ + ALT // LOCAL WORKSPACE ○ fixture-no-weights · Guided changes + Home Local-first · you choose the model + 0.6.0 source 258374f + ▸ 1 Home │ Make something. Understand it. Make it work. + │ Describe your goal in ordinary language. Alt helps with the steps. + 2 Workspace │ Model: local · fixture-no-weights + │ Project: /tmp/alt-capture-x9bjdcba/project + 3 Models │ Agent engine ready · conversations stay on this computer + │ ╭ Start here ───────────────────────────────────────────────────────────────────────────────────╮ + 4 Connections │ │› Start a new conversation │ + ╭ Connect your model · Step 1 of 2 ────────────────────────────────────────────────╮ │ + 5 Conversation│ Give this connection a name, then check its server address. │ │ + │ Start the server in your model application first. No API key is needed for most │ │ + 6 Settings │ local servers. │ │ + │ ╭ Connection name ─────────────────────────────────────────────────────────────╮ │ │ + 7 Help │ │LM Studio │ │ │ + │ ╰──────────────────────────────────────────────────────────────────────────────╯ │ │ + 8 Task progres│ ╭ Server address ──────────────────────────────────────────────────────────────╮ │ │ + │ │http://127.0.0.1:1234/v1 │ │ │ + 9 Project file│ ╰──────────────────────────────────────────────────────────────────────────────╯ │ │ + │ ╭ API key variable (optional; enter a variable name, not the key) ─────────────╮ │ │ + 0 Terminal job│ │ │ │ │ + │ ╰──────────────────────────────────────────────────────────────────────────────╯ │ │ + · Context & me│ Tab changes fields · Enter checks the connection · Alt+M types a model ID │ │ + │ │ │ + │ │────────────────╯ + │ │────────────────╮ + │ │ │ + │ Check connection Type model ID Cancel │tized model. │ + ╰──────────────────────────────────────────────────────────────────────────────────╯y. │ + │ │ ││ │ + │ │You can stop a task with Esc. Conversations are ││An existing model server can use your GPU. │ + ON THIS COMPUTER │ │saved as you work. ││Alt's built-in runtime uses CPU. │ + 15.7 GiB RAM │ │ ││ │ + 4 CPU threads │ ╰────────────────────────────────────────────────╯╰─────────────────────────────────────────────╯ + Ctrl+P Actions │ Tip: your assistant can be wrong. Tool results show what actually happened. + F1 Help │ + Welcome. Choose a model and project, then describe what you want to do. + ↑↓ Choose Enter Open Tab Navigation Ctrl+P Quick actions Ctrl+Q Quit + diff --git a/docs/screenshots/0.7/b07/connection-form-80x24.png b/docs/screenshots/0.7/b07/connection-form-80x24.png new file mode 100644 index 00000000..bf8e134f Binary files /dev/null and b/docs/screenshots/0.7/b07/connection-form-80x24.png differ diff --git a/docs/screenshots/0.7/b07/connection-form-80x24.txt b/docs/screenshots/0.7/b07/connection-form-80x24.txt new file mode 100644 index 00000000..a66ee2a3 --- /dev/null +++ b/docs/screenshots/0.7/b07/connection-form-80x24.txt @@ -0,0 +1,24 @@ + ALT // LOCAL WORKSPACE ○ fixture-no-weights · Guided changes + Home Local-first · you choose the model + ╭ Connect your model · Step 1 of 2 ────────────────────────────────────────╮ +▸1│ Give this connection a name, then check its server address. │ + │ Start the server in your model application first. No API key is needed │ + M│ for most local servers. │ + D│ ╭ Connection name ─────────────────────────────────────────────────────╮ │ + M│ │LM Studio │ │ + P│ ╰──────────────────────────────────────────────────────────────────────╯ │ + A│ ╭ Server address ──────────────────────────────────────────────────────╮ │ + ╭│ │http://127.0.0.1:1234/v1 │ │╮ + ││ ╰──────────────────────────────────────────────────────────────────────╯ ││ + ││ ╭ API key variable (optional; enter a variable name, not the key) ─────╮ ││ + ││ │ │ ││ + ││ ╰──────────────────────────────────────────────────────────────────────╯ ││ + ││ Tab changes fields · Enter checks the connection · Alt+M types a model ││ + ││ ID ││ + ││ ││ + ╰│ │╯ + T│ │ + │ Check connection Type model ID Cancel │ + ╰──────────────────────────────────────────────────────────────────────────╯ + ↑↓ Choose Enter Open Tab Navigation Ctrl+P Quick actions Ctrl+Q Quit + diff --git a/docs/screenshots/0.7/b07/manual-model-120x40.png b/docs/screenshots/0.7/b07/manual-model-120x40.png new file mode 100644 index 00000000..43f5c49d Binary files /dev/null and b/docs/screenshots/0.7/b07/manual-model-120x40.png differ diff --git a/docs/screenshots/0.7/b07/manual-model-120x40.txt b/docs/screenshots/0.7/b07/manual-model-120x40.txt new file mode 100644 index 00000000..e552ec38 --- /dev/null +++ b/docs/screenshots/0.7/b07/manual-model-120x40.txt @@ -0,0 +1,40 @@ + ALT // LOCAL WORKSPACE ○ fixture-no-weights · Guided changes + Home Local-first · you choose the model + 0.6.0 source 258374f + ▸ 1 Home │ Make something. Understand it. Make it work. + │ Describe your goal in ordinary language. Alt helps with the steps. + 2 Workspace │ Model: local · fixture-no-weights + │ Project: /tmp/alt-capture-x9bjdcba/project + 3 Models │ Agent engine ready · conversations stay on this computer + ╭ Enter a model identifier ────────────────────────────────────────────────────────╮────────────────╮ + 4 Connections │ Use the exact name from your server. This saves without checking its inventory. │ │ + │ │ │ + 5 Conversation│ │ │ + │ │ │ + 6 Settings │ ╭ Your text ───────────────────────────────────────────────────────────────────╮ │ │ + │ │ │ │ │ + 7 Help │ │ │ │ │ + │ │ │ │ │ + 8 Task progres│ │ │ │ │ + │ │ │ │ │ + 9 Project file│ │ │ │ │ + │ │ │ │ │ + 0 Terminal job│ │ │ │ │ + │ │ │ │ │ + · Context & me│ │ │ │ │ + │ │ │ │ │ + │ │ │ │────────────────╯ + │ │ │ │────────────────╮ + │ │ │ │ │ + │ │ │ │tized model. │ + │ ╰──────────────────────────────────────────────────────────────────────────────╯ │y. │ + │ Save Cancel │ │ + ╰──────────────────────────────────────────────────────────────────────────────────╯use your GPU. │ + ON THIS COMPUTER │ │saved as you work. ││Alt's built-in runtime uses CPU. │ + 15.7 GiB RAM │ │ ││ │ + 4 CPU threads │ ╰────────────────────────────────────────────────╯╰─────────────────────────────────────────────╯ + Ctrl+P Actions │ Tip: your assistant can be wrong. Tool results show what actually happened. + F1 Help │ + Welcome. Choose a model and project, then describe what you want to do. + ↑↓ Choose Enter Open Tab Navigation Ctrl+P Quick actions Ctrl+Q Quit + diff --git a/docs/screenshots/0.7/b07/manual-model-80x24.png b/docs/screenshots/0.7/b07/manual-model-80x24.png new file mode 100644 index 00000000..ca61f65f Binary files /dev/null and b/docs/screenshots/0.7/b07/manual-model-80x24.png differ diff --git a/docs/screenshots/0.7/b07/manual-model-80x24.txt b/docs/screenshots/0.7/b07/manual-model-80x24.txt new file mode 100644 index 00000000..17580b60 --- /dev/null +++ b/docs/screenshots/0.7/b07/manual-model-80x24.txt @@ -0,0 +1,24 @@ + ALT // LOCAL WORKSPACE ○ fixture-no-weights · Guided changes + ╭ Enter a model identifier ────────────────────────────────────────────────╮ + │ Use the exact name from your server. This saves without checking its │ +▸1│ inventory. │ + │ │ + M│ │ + D│ ╭ Your text ───────────────────────────────────────────────────────────╮ │ + M│ │ │ │ + P│ │ │ │ + A│ │ │ │ + ╭│ │ │ │╮ + ││ │ │ ││ + ││ │ │ ││ + ││ │ │ ││ + ││ │ │ ││ + ││ │ │ ││ + ││ │ │ ││ + ││ │ │ ││ + ╰│ │ │ │╯ + T│ │ │ │ + │ ╰──────────────────────────────────────────────────────────────────────╯ │ + │ Save Cancel │ + ╰──────────────────────────────────────────────────────────────────────────╯ + diff --git a/docs/screenshots/0.7/board/palette-setting-opened-120x40.png b/docs/screenshots/0.7/board/palette-setting-opened-120x40.png new file mode 100644 index 00000000..ee2928c3 Binary files /dev/null and b/docs/screenshots/0.7/board/palette-setting-opened-120x40.png differ diff --git a/docs/screenshots/0.7/board/palette-setting-opened-120x40.txt b/docs/screenshots/0.7/board/palette-setting-opened-120x40.txt new file mode 100644 index 00000000..3036d954 --- /dev/null +++ b/docs/screenshots/0.7/board/palette-setting-opened-120x40.txt @@ -0,0 +1,40 @@ + ALT // LOCAL WORKSPACE ○ fixture-no-weights · Guided changes + Settings Local-first · you choose the model + 0.6.0 source 0912617 + 1 Home │ Make Alt fit your computer + │ Change a setting with Enter. Changes apply to new conversations. + 2 Workspace │ + │ Appearance Models ▸Tools & access Runtime Data + 3 Models │ + ╭ Which tools fit this task? ──────────────────────────────────────────────────────╮────────────────╮ + 4 Connections │ This changes the schemas shown on the next connection. Full access remains an │ │ + │ independent setting. Select All whenever the task needs a wider tool set. │ │ + 5 Conversation│ │ │ + │ ╭ Choose an option ────────────────────────────────────────────────────────────╮ │our choice. │ + ▸ 6 Settings │ │› All native tools │ │ │ + │ │ │ │ │ + 7 Help │ │ Inspect and explain │ │ │ + │ │ │ │ │ + 8 Task progres│ │ Read, edit and run named checks │ │ │ + │ │ │ │ │ + 9 Project file│ │ Terminal and file reading │ │ │ + │ │ │ │ │ + 0 Terminal job│ │ Compact: smaller context and simple text edits │ │ │ + │ │ │ │ │ + · Context & me│ │ Compact with line-array edits │ │ │ + │ │ │ │ │ + │ │ │ │ │ + │ │ │ │ │ + │ │ │ │ │ + │ │ │ │ │ + │ ╰──────────────────────────────────────────────────────────────────────────────╯ │ │ + │ Choose Cancel │ │ + ╰──────────────────────────────────────────────────────────────────────────────────╯ │ + ON THIS COMPUTER │ ╰───────────────────────────────────────────────────────────────────────────────────────────────╯ + 15.7 GiB RAM │ Detected: 15.7 GiB RAM · 15.0 GiB available · 4 CPU threads + 4 CPU threads │ No NVIDIA GPU detected; CPU mode is available + Ctrl+P Actions │ CPU is the default. GPU layers require a compatible llama-server build. + F1 Help │ Data: /tmp/alt-capture-nwdrqym5/state + Welcome. Choose a model and project, then describe what you want to do. + ←→ Category ↑↓ Choose setting Enter Change Settings are saved automatically + diff --git a/docs/screenshots/0.7/board/palette-setting-opened-80x24.png b/docs/screenshots/0.7/board/palette-setting-opened-80x24.png new file mode 100644 index 00000000..16917b1f Binary files /dev/null and b/docs/screenshots/0.7/board/palette-setting-opened-80x24.png differ diff --git a/docs/screenshots/0.7/board/palette-setting-opened-80x24.txt b/docs/screenshots/0.7/board/palette-setting-opened-80x24.txt new file mode 100644 index 00000000..c5fd8907 --- /dev/null +++ b/docs/screenshots/0.7/board/palette-setting-opened-80x24.txt @@ -0,0 +1,24 @@ + ALT // LOCAL WORKSPACE ○ fixture-no-weights · Guided changes + ╭ Which tools fit this task? ──────────────────────────────────────────────╮ + │ This changes the schemas shown on the next connection. Full access │ + 3│ remains an independent setting. Select All whenever the task needs a │ + │ wider tool set. │ + M│ ╭ Choose an option ────────────────────────────────────────────────────╮ │ + C│ │› All native tools │ │ + │ │ │ │ + │ │ Inspect and explain │ │ + │ │ │ │ + ╭│ │ Read, edit and run named checks │ │╮ + ││ │ │ ││ + ││ │ Terminal and file reading │ ││ + ││ │ │ ││ + ││ │ Compact: smaller context and simple text edits │ ││ + ││ │ │ ││ + ╰│ │ Compact with line-array edits │ │╯ + D│ │ │ │ + N│ │ │ │ + C│ │ │ │ + D│ ╰──────────────────────────────────────────────────────────────────────╯ │ + │ Choose Cancel │ + ╰──────────────────────────────────────────────────────────────────────────╯ + diff --git a/docs/screenshots/0.7/board/palette-settings-120x40.png b/docs/screenshots/0.7/board/palette-settings-120x40.png new file mode 100644 index 00000000..458d8ff8 Binary files /dev/null and b/docs/screenshots/0.7/board/palette-settings-120x40.png differ diff --git a/docs/screenshots/0.7/board/palette-settings-120x40.txt b/docs/screenshots/0.7/board/palette-settings-120x40.txt new file mode 100644 index 00000000..ad33d85b --- /dev/null +++ b/docs/screenshots/0.7/board/palette-settings-120x40.txt @@ -0,0 +1,40 @@ + ALT // LOCAL WORKSPACE ○ fixture-no-weights · Guided changes + Home Local-first · you choose the model + 0.6.0 source 0912617 + ▸ 1 Home │ Make something. Understand it. Make it work. + │ Describe your goal in ordinary language. Alt helps with the steps. + 2 Workspace │ Model: local · fixture-no-weights + │ Project: /tmp/alt-capture-nwdrqym5/project + 3 Models │ Agent engine ready · conversations stay on this computer + │ ╭ Start here ───────────────────────────────────────────────────────────────────────────────────╮ + 4 Connections │ │› Start a new conversation │ + ╭ Command palette ─────────────────────────────────────────────────────────────────╮ │ + 5 Conversation│ ▸ setting: │ │ + │ ──────────────────────────────────────────────────────────────────────────────── │ │ + 6 Settings │ ▸ Setting: Access: Guided changes · 0 configured check(s) │ │ + │ Choose Review only, Guided changes, or Full access terminal. │ │ + 7 Help │ Setting: Agent engine executable │ │ + │ Auto-detect Goose; install from Home if missing │ │ + 8 Task progres│ Setting: Benchmark selected model │ │ + │ Measure this computer; exports exact settings, timings and runtime memory. │ │ + 9 Project file│ Setting: Check this model's tool use │ │ + │ A short live probe of the exact selected uncensored model. Saves its evidenc │ │ + 0 Terminal job│ Setting: Context: 8192 tokens · Balanced │ │ + │ More context uses more memory. Cycle: 4K → 8K → 16K → 32K. │ │ + · Context & me│ Setting: Fit Alt to this computer │ │ + │ Inspect hardware and choose a low-memory, balanced or larger context profile │ │ + │ Setting: Layout: Sidebar │────────────────╯ + │ Ctrl+L also cycles: sidebar, top tabs, bottom tabs, split. │────────────────╮ + │ │ │ + │ 19 result(s) · Type to filter · ↑↓ move · Enter run · Esc close │tized model. │ + ╰──────────────────────────────────────────────────────────────────────────────────╯y. │ + │ │ ││ │ + │ │You can stop a task with Esc. Conversations are ││An existing model server can use your GPU. │ + ON THIS COMPUTER │ │saved as you work. ││Alt's built-in runtime uses CPU. │ + 15.7 GiB RAM │ │ ││ │ + 4 CPU threads │ ╰────────────────────────────────────────────────╯╰─────────────────────────────────────────────╯ + Ctrl+P Actions │ Tip: your assistant can be wrong. Tool results show what actually happened. + F1 Help │ + Welcome. Choose a model and project, then describe what you want to do. + ↑↓ Choose Enter Open Tab Navigation Ctrl+P Quick actions Ctrl+Q Quit + diff --git a/docs/screenshots/0.7/board/palette-settings-80x24.png b/docs/screenshots/0.7/board/palette-settings-80x24.png new file mode 100644 index 00000000..9f674584 Binary files /dev/null and b/docs/screenshots/0.7/board/palette-settings-80x24.png differ diff --git a/docs/screenshots/0.7/board/palette-settings-80x24.txt b/docs/screenshots/0.7/board/palette-settings-80x24.txt new file mode 100644 index 00000000..6863fe32 --- /dev/null +++ b/docs/screenshots/0.7/board/palette-settings-80x24.txt @@ -0,0 +1,24 @@ + ALT // LOCAL WORKSPACE ○ fixture-no-weights · Guided changes + Home Local-first · you choose the model + ╭ Command palette ─────────────────────────────────────────────────────────╮ +▸1│ ▸ setting: │ + │ ──────────────────────────────────────────────────────────────────────── │ + M│ ▸ Setting: Access: Guided changes · 0 configured check(s) │ + D│ Choose Review only, Guided changes, or Full access terminal. │ + M│ Setting: Agent engine executable │ + P│ Auto-detect Goose; install from Home if missing │ + A│ Setting: Benchmark selected model │ + ╭│ Measure this computer; exports exact settings, timings and runtime m │╮ + ││ Setting: Check this model's tool use ││ + ││ A short live probe of the exact selected uncensored model. Saves its ││ + ││ Setting: Context: 8192 tokens · Balanced ││ + ││ More context uses more memory. Cycle: 4K → 8K → 16K → 32K. ││ + ││ Setting: Fit Alt to this computer ││ + ││ Inspect hardware and choose a low-memory, balanced or larger context ││ + ││ Setting: Layout: Sidebar ││ + ╰│ Ctrl+L also cycles: sidebar, top tabs, bottom tabs, split. │╯ + T│ │ + │ 19 result(s) · Type to filter · ↑↓ move · Enter run · Esc close │ + ╰──────────────────────────────────────────────────────────────────────────╯ + ↑↓ Choose Enter Open Tab Navigation Ctrl+P Quick actions Ctrl+Q Quit + diff --git a/docs/screenshots/0.7/h01/home-120x40.png b/docs/screenshots/0.7/h01/home-120x40.png new file mode 100644 index 00000000..c448913c Binary files /dev/null and b/docs/screenshots/0.7/h01/home-120x40.png differ diff --git a/docs/screenshots/0.7/h01/home-120x40.txt b/docs/screenshots/0.7/h01/home-120x40.txt new file mode 100644 index 00000000..d0717842 --- /dev/null +++ b/docs/screenshots/0.7/h01/home-120x40.txt @@ -0,0 +1,40 @@ + ALT // LOCAL WORKSPACE ○ fixture-no-weights · Guided changes + Home Local-first · you choose the model + 0.6.0 source 05ea611 + ▸ 1 Home │ Make something. Understand it. Make it work. + │ Describe your goal in ordinary language. Alt helps with the steps. + 2 Workspace │ Model: local · fixture-no-weights + │ Project: /tmp/alt-capture-ivv95umz/project + 3 Models │ Agent engine ready · conversations stay on this computer + │ ╭ ◈ MODEL ─────────────────────╮╭ ▣ PROJECT ────────────────────╮╭ ◇ TOOLS ─────────────────────╮ + 4 Connections │ │fixture-no-weights ││project ││Agent engine ready │ + │ │8K context · thinking default ││0 check(s) configured ││Guided changes │ + 5 Conversations │ ╰──────────────────────────────╯╰───────────────────────────────╯╰──────────────────────────────╯ + │ ╭ ◈ Start a new conversation ───────────────────╮╭ ◇ Try a practice project ────────────────────╮ + 6 Settings │ │Tell the assistant what you want to accomplish.││Learn repair, real checks and undo in a fresh │ + │ │ ││example folder. │ + 7 Help │ ╰───────────────────────────────────────────────╯╰──────────────────────────────────────────────╯ + │ ╭ ▣ Choose a project folder ────────────────────╮╭ ✓ Prepare project checks ────────────────────╮ + 8 Task progress │ │Pick the files Alt should work with. ││Choose how to test changes before asking your │ + │ │ ││model to work. │ + 9 Project files │ ╰───────────────────────────────────────────────╯╰──────────────────────────────────────────────╯ + │ ╭ ⇄ Choose a connection ────────────────────────╮╭ ✦ Start with a guided task ──────────────────╮ + 0 Terminal jobs │ │Use Ollama, LM Studio, a model file, or another││Understand, build, troubleshoot, check, or │ + │ │API. ││review. │ + · Context & mem │ ╰───────────────────────────────────────────────╯╰──────────────────────────────────────────────╯ + │ ╭ ⚙ Agent engine is installed ──────────────────╮╭ ≡ Keep a project brief ──────────────────────╮ + │ │A separate local component that gives your ││Save goals, decisions, and next steps for │ + │ │model tools. ││future messages. │ + │ ╰───────────────────────────────────────────────╯╰──────────────────────────────────────────────╯ + │ ╭ How it works ──────────────────────────────────╮╭ Models and settings ────────────────────────╮ + │ │1 Describe the result you want. ││Context budget: 8K tokens │ + │ │2 Review commands and file changes. ││Ctrl+P → Probe this model suggests thinking │ + │ │3 Check the results together. ││and output settings. │ + ON THIS COMPUTER │ │Esc stops a task · conversations are saved as ││Hosted APIs: Connect → a hosted API or │ + 15.7 GiB RAM │ │you work ││another server preset. │ + 4 CPU threads │ ╰────────────────────────────────────────────────╯╰─────────────────────────────────────────────╯ + Ctrl+P Actions │ Tip: your assistant can be wrong. Tool results show what actually happened. + F1 Help │ + Welcome. Choose a model and project, then describe what you want to do. + ↑↓ Choose Enter Open Tab Navigation Ctrl+P Quick actions Ctrl+Q Quit + diff --git a/docs/screenshots/0.7/h01/home-80x24.png b/docs/screenshots/0.7/h01/home-80x24.png new file mode 100644 index 00000000..89503cfe Binary files /dev/null and b/docs/screenshots/0.7/h01/home-80x24.png differ diff --git a/docs/screenshots/0.7/h01/home-80x24.txt b/docs/screenshots/0.7/h01/home-80x24.txt new file mode 100644 index 00000000..e9aa4581 --- /dev/null +++ b/docs/screenshots/0.7/h01/home-80x24.txt @@ -0,0 +1,24 @@ + ALT // LOCAL WORKSPACE ○ fixture-no-weights · Guided changes + Home Local-first · you choose the model + 0.6.0 source 05ea611 +▸1 Home 2 Chat 3 Models 4 Links 5 Saved 6 Settings 7 Help + + Make something. Understand it. Make it work. + Describe your goal in ordinary language. Alt helps with the steps. + Model: local · fixture-no-weights + Project: /tmp/alt-capture-ggs2fboo/project + Agent engine ready · conversations stay on this computer + ╭ Start here ────────────────────────────────────────────────────────────────╮ + │› Start a new conversation │ + │ Tell the assistant what you want to accomplish. │ + │ Try a practice project │ + │ Learn repair, real checks and undo in a fresh example folder. │ + │ Choose a project folder │ + │ Pick the files Alt should work with. │ + │ │ + ╰────────────────────────────────────────────────────────────────────────────╯ + Tip: your assistant can be wrong. Tool results show what actually happened. + + Welcome. Choose a model and project, then describe what you want to do. + ↑↓ Choose Enter Open Tab Navigation Ctrl+P Quick actions Ctrl+Q Quit + diff --git a/docs/screenshots/0.7/h01/home-selected-120x40.png b/docs/screenshots/0.7/h01/home-selected-120x40.png new file mode 100644 index 00000000..c8ca5a2d Binary files /dev/null and b/docs/screenshots/0.7/h01/home-selected-120x40.png differ diff --git a/docs/screenshots/0.7/h01/home-selected-120x40.txt b/docs/screenshots/0.7/h01/home-selected-120x40.txt new file mode 100644 index 00000000..d0717842 --- /dev/null +++ b/docs/screenshots/0.7/h01/home-selected-120x40.txt @@ -0,0 +1,40 @@ + ALT // LOCAL WORKSPACE ○ fixture-no-weights · Guided changes + Home Local-first · you choose the model + 0.6.0 source 05ea611 + ▸ 1 Home │ Make something. Understand it. Make it work. + │ Describe your goal in ordinary language. Alt helps with the steps. + 2 Workspace │ Model: local · fixture-no-weights + │ Project: /tmp/alt-capture-ivv95umz/project + 3 Models │ Agent engine ready · conversations stay on this computer + │ ╭ ◈ MODEL ─────────────────────╮╭ ▣ PROJECT ────────────────────╮╭ ◇ TOOLS ─────────────────────╮ + 4 Connections │ │fixture-no-weights ││project ││Agent engine ready │ + │ │8K context · thinking default ││0 check(s) configured ││Guided changes │ + 5 Conversations │ ╰──────────────────────────────╯╰───────────────────────────────╯╰──────────────────────────────╯ + │ ╭ ◈ Start a new conversation ───────────────────╮╭ ◇ Try a practice project ────────────────────╮ + 6 Settings │ │Tell the assistant what you want to accomplish.││Learn repair, real checks and undo in a fresh │ + │ │ ││example folder. │ + 7 Help │ ╰───────────────────────────────────────────────╯╰──────────────────────────────────────────────╯ + │ ╭ ▣ Choose a project folder ────────────────────╮╭ ✓ Prepare project checks ────────────────────╮ + 8 Task progress │ │Pick the files Alt should work with. ││Choose how to test changes before asking your │ + │ │ ││model to work. │ + 9 Project files │ ╰───────────────────────────────────────────────╯╰──────────────────────────────────────────────╯ + │ ╭ ⇄ Choose a connection ────────────────────────╮╭ ✦ Start with a guided task ──────────────────╮ + 0 Terminal jobs │ │Use Ollama, LM Studio, a model file, or another││Understand, build, troubleshoot, check, or │ + │ │API. ││review. │ + · Context & mem │ ╰───────────────────────────────────────────────╯╰──────────────────────────────────────────────╯ + │ ╭ ⚙ Agent engine is installed ──────────────────╮╭ ≡ Keep a project brief ──────────────────────╮ + │ │A separate local component that gives your ││Save goals, decisions, and next steps for │ + │ │model tools. ││future messages. │ + │ ╰───────────────────────────────────────────────╯╰──────────────────────────────────────────────╯ + │ ╭ How it works ──────────────────────────────────╮╭ Models and settings ────────────────────────╮ + │ │1 Describe the result you want. ││Context budget: 8K tokens │ + │ │2 Review commands and file changes. ││Ctrl+P → Probe this model suggests thinking │ + │ │3 Check the results together. ││and output settings. │ + ON THIS COMPUTER │ │Esc stops a task · conversations are saved as ││Hosted APIs: Connect → a hosted API or │ + 15.7 GiB RAM │ │you work ││another server preset. │ + 4 CPU threads │ ╰────────────────────────────────────────────────╯╰─────────────────────────────────────────────╯ + Ctrl+P Actions │ Tip: your assistant can be wrong. Tool results show what actually happened. + F1 Help │ + Welcome. Choose a model and project, then describe what you want to do. + ↑↓ Choose Enter Open Tab Navigation Ctrl+P Quick actions Ctrl+Q Quit + diff --git a/docs/screenshots/0.7/h01/home-selected-80x24.png b/docs/screenshots/0.7/h01/home-selected-80x24.png new file mode 100644 index 00000000..7c545000 Binary files /dev/null and b/docs/screenshots/0.7/h01/home-selected-80x24.png differ diff --git a/docs/screenshots/0.7/h01/home-selected-80x24.txt b/docs/screenshots/0.7/h01/home-selected-80x24.txt new file mode 100644 index 00000000..aaf3cb90 --- /dev/null +++ b/docs/screenshots/0.7/h01/home-selected-80x24.txt @@ -0,0 +1,24 @@ + ALT // LOCAL WORKSPACE ○ fixture-no-weights · Guided changes + Home Local-first · you choose the model + 0.6.0 source 05ea611 +▸1 Home 2 Chat 3 Models 4 Links 5 Saved 6 Settings 7 Help + + Make something. Understand it. Make it work. + Describe your goal in ordinary language. Alt helps with the steps. + Model: local · fixture-no-weights + Project: /tmp/alt-capture-ggs2fboo/project + Agent engine ready · conversations stay on this computer + ╭ Start here ────────────────────────────────────────────────────────────────╮ + │ Start a new conversation │ + │ Tell the assistant what you want to accomplish. │ + │ Try a practice project │ + │ Learn repair, real checks and undo in a fresh example folder. │ + │› Choose a project folder │ + │ Pick the files Alt should work with. │ + │ │ + ╰────────────────────────────────────────────────────────────────────────────╯ + Tip: your assistant can be wrong. Tool results show what actually happened. + + Welcome. Choose a model and project, then describe what you want to do. + ↑↓ Choose Enter Open Tab Navigation Ctrl+P Quick actions Ctrl+Q Quit + diff --git a/prompts/compact-lines.md b/prompts/compact-lines.md index c7761307..c7d79c16 100644 --- a/prompts/compact-lines.md +++ b/prompts/compact-lines.md @@ -3,6 +3,7 @@ The current source below is an actual read. Its handle covers exactly the shown Use those reads and the saved plan. Read/search again or save another plan only when additional information is needed. Use edit_lines(path, handle, lines) to replace that span: one literal source line per array item, preserving indentation. Do not copy old text or line numbers. Use create_lines(path, lines) for missing files; delete_file(path, handle) requires a complete-file read. +For a file of up to 300 lines that you read in full, replace_file(path, new_text) rewrites it whole; it is the most reliable edit for small files. A stale handle requires another read. Save a brief plan with remember when none exists. After changing code, fix syntax errors and run the configured checks on the current revision. Read actual failures, repair, rerun. Use terminal for arbitrary commands/networking only when Full access is selected. Follow actual permission decisions. diff --git a/prompts/compact.md b/prompts/compact.md index 23a29db4..76ae4d0a 100644 --- a/prompts/compact.md +++ b/prompts/compact.md @@ -3,6 +3,7 @@ The current source below is an actual read. Its handle covers exactly the shown Use those reads and the saved plan. Read/search again or save another plan only when additional information is needed. Use edit_text(path, handle, new_text) to replace that span. Supply actual source with line breaks and indentation. Do not copy old text or line numbers. Use create_file(path, new_text) for missing files; delete_file(path, handle) requires a complete-file read. +For a file of up to 300 lines that you read in full, replace_file(path, new_text) rewrites it whole; it is the most reliable edit for small files. A stale handle requires another read. Save a brief plan with remember when none exists. After changing code, fix syntax errors and run the configured checks on the current revision. Read actual failures, repair, rerun. Use terminal for arbitrary commands/networking only when Full access is selected. Follow actual permission decisions. diff --git a/requirements-dev.txt b/requirements-dev.txt index d821cf17..950663fc 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,10 +1,140 @@ # Virtual terminal for real PTY acceptance tests; not used by the application. -pyte==0.8.2 -wcwidth==0.2.13 +pyte==0.8.2 \ + --hash=sha256:5af970e843fa96a97149d64e170c984721f20e52227a2f57f0a54207f08f083f \ + --hash=sha256:85db42a35798a5aafa96ac4d8da78b090b2c933248819157fc0e6f78876a0135 +wcwidth==0.2.13 \ + --hash=sha256:3da69048e4540d84af32131829ff948f1e022c1c6bdb8d6102117aac784f6859 \ + --hash=sha256:72ea0c06399eb286d978fdedb6923a9eb47e1c486ce63e9b4e64fc18303972b5 # Official release SBOM schema validation; never imported by the application. -jsonschema==4.26.0 -attrs==26.1.0 -jsonschema-specifications==2025.9.1 -referencing==0.37.0 -rpds-py==2026.6.3 -typing-extensions==4.16.0 +jsonschema==4.26.0 \ + --hash=sha256:0c26707e2efad8aa1bfc5b7ce170f3fccc2e4918ff85989ba9ffa9facb2be326 \ + --hash=sha256:d489f15263b8d200f8387e64b4c3a75f06629559fb73deb8fdfb525f2dab50ce +attrs==26.1.0 \ + --hash=sha256:c647aa4a12dfbad9333ca4e71fe62ddc36f4e63b2d260a37a8b83d2f043ac309 \ + --hash=sha256:d03ceb89cb322a8fd706d4fb91940737b6642aa36998fe130a9bc96c985eff32 +jsonschema-specifications==2025.9.1 \ + --hash=sha256:98802fee3a11ee76ecaca44429fda8a41bff98b00a0f2838151b113f210cc6fe \ + --hash=sha256:b540987f239e745613c7a9176f3edb72b832a4ac465cf02712288397832b5e8d +referencing==0.37.0 \ + --hash=sha256:381329a9f99628c9069361716891d34ad94af76e461dcb0335825aecc7692231 \ + --hash=sha256:44aefc3142c5b842538163acb373e24cce6632bd54bdb01b21ad5863489f50d8 +rpds-py==2026.6.3 \ + --hash=sha256:0be972be84cfcaf46c8c6edf690ca0f154ac17babf1f6a955a51579b34ad2dc5 \ + --hash=sha256:127565fead0a10943b282957bd5447804ff3160ad79f2ad2635e6d249e380680 \ + --hash=sha256:127e08c0642d880cf32ca47ec2a4a77b901f7e2dd1ad9762adb13955d72ffcc9 \ + --hash=sha256:166cf54d9f44fc6ceb53c7860258dde44a81406646de79f8ed3234fca3b6e538 \ + --hash=sha256:168c733a7112e071bb7a66460e667edfcff06c017a3c523f7a8a8e08d0140804 \ + --hash=sha256:1967debc37f64f2c4dc90a7f563aec558b471966e12adcac4e1c4240496b6ebf \ + --hash=sha256:1cebd1337c242e4ec2293e541f712b2da849b29f48f0c293684b71c0632625d4 \ + --hash=sha256:1cf01971c4f2c5553b772a542e4aaf191789cd331bc2cd4ff0e6e65ba49e1e97 \ + --hash=sha256:1e5822dfc2f0d4ab7e745eaa6d85945069329beeccef965af3f3bb26058fcab6 \ + --hash=sha256:22bffe6042b9bcb0822bcd1955ec00e245daf17b4344e4ed8e9551b976b63e96 \ + --hash=sha256:23a439f31ccbeff1574e24889128821d1f7917470e830cf6544dced1c662262a \ + --hash=sha256:24e9c5386e16669b674a69c156c8eeefcb578f3b3397b713b08e6d60f3c7b187 \ + --hash=sha256:270b293dae9058fc9fcedab50f13cebf46fb8ed1d1d54e0521a9da5d6b211975 \ + --hash=sha256:29dfa0533a5d4c94d4dfa1b694fcb56c9c63aad8330ffdd816fd225d0a7a162f \ + --hash=sha256:2a9c6f195058cb45335e8cc3802745c603d716eb96bc9625950c1aac71c0c703 \ + --hash=sha256:2bfd04c19ddbd6640de0b51894d764bd2758854d5b75bd102d2ef10cb9c293a9 \ + --hash=sha256:2c54a076ca4d370980ab57bc0e31df57bbe8d41340436a90ef8b1219a3cbb127 \ + --hash=sha256:2c958bf94822e9290a40aaf2a822d4bc5c88099093e3948ad6c571eca9272e5f \ + --hash=sha256:2c99f7e8ccb3dd6e3e4bfeac657a7b208c9bac8075f4b078c02d7404c34107fa \ + --hash=sha256:2f7c26fbc5acd2522b95d4177fe4710ffd8e9b20529e703ffbf8db4d93903f05 \ + --hash=sha256:30c6dc199b24a5e3e81d50da0f00858c5bbdb2617a750395687f4339c5818171 \ + --hash=sha256:38a2fea2787428f811719ceb9114cb78964a3138838320c29ac39526c79c16ba \ + --hash=sha256:3a83ae6c67b7676b9878378547ca8e93ed77a580037bcbcd1d32f739e1e6089c \ + --hash=sha256:3cfe765c1da0072636ca06628261e0ea05688e160d5c8a03e0217c3854037223 \ + --hash=sha256:421aba32367055614287a4292b6a17f1939c9452299f7a0209c117e990b646d4 \ + --hash=sha256:425560c6fa0415f27261727bb20bd097568485e5eb0c121f1949417d1c516885 \ + --hash=sha256:4470ce197d4090875cf6affbf1f853338387428df97c4fb7b7106317b8214698 \ + --hash=sha256:4cf2d36a2357e4d07bb5a4f98801265327b48256867816cfd2ceb001e9754a8f \ + --hash=sha256:4f4bca01b63096f606e095734dd56e74e175f94cfbf24ff3d63281cec61f7bb7 \ + --hash=sha256:501f9f04a588d6a09179368c57071301445191767c64e4b52a6aa9871f1ef5ed \ + --hash=sha256:536bceea4fa4acf7e1c61da2b5786304367c816c8895be71b8f537c480b0ea1f \ + --hash=sha256:538949e262e46caa31ac01bdb3c1e8f642622922cacbabbae6a8445d9dc33eaf \ + --hash=sha256:539d75de9e0d536c84ff18dfeb805398e58227001ce09231a26a08b9aed1ee0e \ + --hash=sha256:54f45a148e28767bf343d33a684693c70e451c6f4c0e9904709a723fafbdfc1f \ + --hash=sha256:55927d532399c2c646100ff7feb48eaa940ad70f42cd68e1328f3ded9f81ca24 \ + --hash=sha256:58eadac9cd119677b60e1cf8ac4052f35949d71b8a9e5556efccbe82533cf22a \ + --hash=sha256:5e8d07bddee435a2ff6f1920e18feff28d0bc4533e42f4bf6927fbd073312c41 \ + --hash=sha256:62698275682bf121181861295c9181e789030a2d516071f5b8f3c23c170cd0fc \ + --hash=sha256:639c8929aa0afe81be836b04de888460d6bed38b9c54cfc18da8f6bfabf5af5d \ + --hash=sha256:67e3a721ffc5d8d2210d3671872298c4a84e4b8035cfe42ffd7cde35d772b146 \ + --hash=sha256:6de4744d05bd1aa1be4ed7ea1189e3979196808008113bbbf899a460966b925e \ + --hash=sha256:6e84adbcf4bf841aed8116a8264b9f50b4cb3e7bd89b516122e616ac56ca269e \ + --hash=sha256:7491ee23305ac3eb59e492b6945881f5cd77a6f731061a3f25b77fd40f9e99a4 \ + --hash=sha256:79486287de1730dbaff3dbd124d0ca4d2ef7f9d29bf2544f1f93c09b5bcbbd12 \ + --hash=sha256:7b689145a1485c335569bd056464f3243a29af7ed3871c7be31ad624ba239bc7 \ + --hash=sha256:7f88d653e7b3b779d71ae7454e20dcc9b6bae903f33c269db9f2be41bda3f261 \ + --hash=sha256:8020133a74bd81b4572dd8e4be028a6b1ebcd70e6726edc3918008c08bee6ee6 \ + --hash=sha256:808345f53cb952433ca2816f1604ff3515608a81784954f38d4452acfe8e61d5 \ + --hash=sha256:83e35b57523816c8613fd0776b40cd8bb9f596b37ddd2692eb4a6bb5ab2f8c93 \ + --hash=sha256:842e7b070435622248c7a2c44ae53fa1440e073cc3023bc919fed570884097a7 \ + --hash=sha256:847927daf4cffbd4e90e42bc890069897101edd015f956cb8721b3473372edda \ + --hash=sha256:882076c00c0a608b131187055ddc5ae29f2e7eaf870d6168980420d58528a5c8 \ + --hash=sha256:8b95977e7211527ab0ba576e286d023389fbeeb32a6b7b771665d333c60e5342 \ + --hash=sha256:8bb68f03f395eb793220b45c097bd4d8c32944393da0fad8b999efac0868fc8c \ + --hash=sha256:8c2642a7603ec0b16ed77da4555db3b4b472341904873788327c0b0d7b95f1bb \ + --hash=sha256:8c3d1e9c15b9d51ca0391e13da1a25a0a4df3c58a37c9dc368e0736cf7f69df0 \ + --hash=sha256:8c6e5a2f750cc71c3e3b11d71661f21d6f9bc6cebc6564b1466417a1ec03ec77 \ + --hash=sha256:8d2294a31386bfa251d8c8a39472beee17db67d4f1a6eabea665d35c9a4461c3 \ + --hash=sha256:8e4320744c1ffdd95a603def63344bfab2d33edeab301c5007e7de9f9f5b3885 \ + --hash=sha256:8e65860d238379ed982fd9ba690579b5e95af2f4840f99c772816dbe573cb826 \ + --hash=sha256:8f2e5c5ee828d42cb11760761c0af6507927bec42d0ad5458f97c9203b054617 \ + --hash=sha256:900a67df3fd1660b035a4761c4ce73c382ea6b35f90f9863c36c6fd8bf8b09bb \ + --hash=sha256:913ca42ccad3f8cc6e292b587ae8ae49c8c823e5dce51a736252fc7c7cdfa577 \ + --hash=sha256:9250a9a0a6fd4648b3f868da8d91a4c52b5811a62df58e753d50ae4454a36f80 \ + --hash=sha256:931908d9fc855d8f74783377822be318edb6dcb19e47169dc038f9a1bf60b06e \ + --hash=sha256:9826217f048f620d9a712672818bf231442c1b35d96b227a07eabd11b4bb6945 \ + --hash=sha256:9891e594296ab9dada6551c8e7b387b2721f27a67eecd528412e8906247a7b90 \ + --hash=sha256:9c1255b302953c86a486b81d330d5ee1d5bd937691ce271b6be0ef0e299eaab7 \ + --hash=sha256:a0811d33247c3d6128a3001d763f2aa056bb3425204335400ac54f89eec3a0d0 \ + --hash=sha256:a136d453475ac0fcbda502ef1e6504bd28d6d904700915d278deeab0d00fe140 \ + --hash=sha256:a214c993455f99a89aaeadc9b21241900037adc9d97203e374d75513c5911822 \ + --hash=sha256:a3086b538543802f84c843911242db20447de00d8752dd0efc936dbcf02218ba \ + --hash=sha256:a3450b693fde92133e9f51060568a4c31fcca76d5e53bbd611e689ca446517e9 \ + --hash=sha256:a550fb4950a06dde3beb4721f5ad4b25bf4513784665b0a8522c792e2bd822a4 \ + --hash=sha256:a9f4645593036b81bbdb36b9c8e0ea0d1c3fee968c4d59db0344c14087ef143a \ + --hash=sha256:aca6c1ef08a82bfe327cc156da694660f599923e2e6665b6d81c9c2d0ac9ffc8 \ + --hash=sha256:acac386b453c2516111b50985d60ce46e7fadb5ea71ae7b25f4c946935bf27cf \ + --hash=sha256:acc992ab27b15f852c76755eb2ab7dce86585ddadba6fa5946e58556088845b4 \ + --hash=sha256:ae3d4fe8c0b9213624fdce7279d70e3b148b682ca20719ebd193a23ebfa47324 \ + --hash=sha256:ae50181a047c871561212bb97f7932a2d45fb53e947bd9b57ebad85b529cbc53 \ + --hash=sha256:ae6dd8f10bd17aad820876d24caec9efdafd80a318d16c0a48edb5e136902c6b \ + --hash=sha256:af05d726809bff6b141be124d4c7ce998f9c9c7f30edb1f46c07aa103d540b41 \ + --hash=sha256:afd70d95892096cdb26f15a00c45907b17817577aa8d1c76b2dcc2788391f9e9 \ + --hash=sha256:b5c2dc92304aa48a4a60443b548bb12f12e119d4b72f314015e67b9e1be97fca \ + --hash=sha256:bc0011654b91cc4fb2ae701bec0a0ba1e552c0714247fa7af6c59e0ccfa3a4e1 \ + --hash=sha256:bcfbcf66006befb9fd2aeaa9e01feaf881b4dc330a02ba07d2322b1c11be7b5d \ + --hash=sha256:bdbd97738551fca3917c1bd7188bec1920bb520104f28e7e1007f9ceb17b7690 \ + --hash=sha256:c60924535c75f1566b6eb75b5c31a48a43fef04fa2d0d201acbad8a9969c6107 \ + --hash=sha256:c7b9a2f8f4d8e90af72571d3d495deebdd7e3c75451f5b41719aee166e940fc2 \ + --hash=sha256:ca6546b66be9dc4738b1b043d5ebd5488c66c578c5ff0fd0e8065313fe3afb76 \ + --hash=sha256:ccffae9a092a00deb7efd545fe5e2c33c33b88e7c054337e9a74c179347d0b7d \ + --hash=sha256:cdc7e35386f3847df728fbcb5e887e2d79c19e2fa1eba9e51b6621d23e3243af \ + --hash=sha256:d15fde0e6fb0d88a60d221204873743e5d9f0b7d29165e62cd86d0413ad74ba6 \ + --hash=sha256:d34c20167764fbcf927194d532dd7e0c56772f0a5f943fa5ef9e9afbba8fb9db \ + --hash=sha256:d483fe17f01ad64b7bf7cc38fcefff1ca9fb83f8c2b2542b68f97ffe0611b369 \ + --hash=sha256:d7469697dce35be237db177d42e2a2ee26e6dcc5fc052078a6fefabd288c6edd \ + --hash=sha256:db08f45aecde626498fb3df07bcf6d2ec040af42e859a4f5040d79c200342911 \ + --hash=sha256:dc319e5a1de4b6913aac94bf6a2f9e847371e0a140a43dd4991db1a09bc2d504 \ + --hash=sha256:de3eceba0b683bcbb1ab93da016d0270df1f9ae7be716b40214c5dafac6ea45a \ + --hash=sha256:dfcc8b909769d19db55c7cc9541eb64b9b774b1057ffffb4f1048070475bb9f9 \ + --hash=sha256:e059c5dde6452b44424bd1834557556c226b57781dee1227af23518459722b13 \ + --hash=sha256:e4316bf32babbed84e691e352faf967ce2f0f024174a8643c37c94a1080374fc \ + --hash=sha256:e52655eaf81e32593abedaa4bfe33170c8cfedf3365ed9be6e11e07f148f0278 \ + --hash=sha256:e55d236be29255554da47abe5c577637db7c24a02b8b46f0ca9524c855801868 \ + --hash=sha256:ea7bb13b7c9a29791f87a0387ba7d3ad3a6d783d827e4d3f27b40a0ff44495e2 \ + --hash=sha256:ea964164cc9afa72d4d9b23cc28dafae93693c0a53e0b42acbff15b22c3f9ddd \ + --hash=sha256:ec829541c45bca16e61c7ae50c20501f213605beb75d1aba91a6ee37fbbb56a4 \ + --hash=sha256:ecabd69db66de867690f9797f2f8fa27ba501bbc24540cbdbdc649cd15888ba6 \ + --hash=sha256:ed0c1e5d10cdc7135537988c74a0188da68e2f3c30813ba3744ab1e42e0480f9 \ + --hash=sha256:f0840b5b17057f7fd918b76183a4b5a0635f43e14eb2ce60dce1d4ee4707ea00 \ + --hash=sha256:f4d78253f6996be4901669ad25319f842f740eccf4d58e3c7f3dd39e6dde1d8f \ + --hash=sha256:f56f1695bc5c0871cbc33dc0130fcf503aab0c57dcc5a6700a4f49eba4f2652e \ + --hash=sha256:f826877d462181e5eb1c26a0026b8d0cab05d99844ecb6d8bf3627a2ca0c0442 \ + --hash=sha256:f8f23ead891a3b762f35ab3b04623da7056545b48aa60d59957e6789914545da \ + --hash=sha256:f90938e92afda60266da758ee7d363447f7f0138c9559f9e1811629580582d90 \ + --hash=sha256:faa679d19a6696fd54259ad321251ad77a13e70e03dd834daa762a44fb6196ef +typing-extensions==4.16.0 \ + --hash=sha256:481caa481374e813c1b176ada14e97f1f67a4539ce9cfeb3f350d78d6370c2e8 \ + --hash=sha256:dc983d19a509c94dba722ee6abd33940f7c05a89e243c47e907eb4db6f1a43e5 diff --git a/scripts/capture_screens.py b/scripts/capture_screens.py new file mode 100644 index 00000000..b7fba16c --- /dev/null +++ b/scripts/capture_screens.py @@ -0,0 +1,163 @@ +#!/usr/bin/env python3 +"""Capture work-order screens through a real PTY at 80x24 and one wide size. + +Usage: capture_screens.py ORDER [--out DIR] [--sizes 80x24,120x40] +Each ORDER below is a list of steps run against the deterministic fixture engine +(no model weights, no network). Text captures are always written; PNGs need the +optional Pillow + DejaVu fonts used by terminal_capture.py. +""" +import argparse, fcntl, os, pty, select, struct, subprocess, sys, tempfile, termios, time +from pathlib import Path + +import pyte + +repo = Path(__file__).resolve().parents[1] +sys.path.insert(0, str(repo / "scripts")) +binary = Path(os.environ.get("ALT_TEST_BINARY", repo / "target/debug/alt")).resolve() +fixture = repo / "tests/fixtures/acp_engine.py" + +# A saved connection that is never contacted while capturing menus. +FIXTURE_CONFIG = """default_profile = "local" + +[profiles.local] +provider = "openai" +endpoint = "http://127.0.0.1:9/v1" +model = "fixture-no-weights" +context_tokens = 8192 +max_turns = 12 +uncensored = true +""" + + +def palette(query): + return [("send", b"\x10"), ("wait", "Command palette"), ("send", query.encode()), ("wait", "result(s)"), ("send", b"\r")] + + +# Orders whose screens need a reachable fixture server (no weights). +NEEDS_SERVER = {"a05"} + +PLANS = { + "a05": [("wait", "Alt"), *palette("probe this model"), ("wait", "Probe results"), ("shot", "probe-results"), + ("send", b"\x1b[B\r"), ("wait", "applied to this connection"), ("shot", "probe-applied")], + "a07": [("wait", "Alt"), ("send", b"\x1b2"), ("wait", "Workspace"), ("send", b"tools"), ("send", b"\r"), + ("wait", "Review this action"), ("shot", "terminal-approval"), ("send", b"\x0e")], + "a01": [("wait", "Alt"), *palette("model thinking"), ("wait", "Model thinking"), ("shot", "thinking-menu"), ("send", b"\x1b"), + *palette("recover from a thinking"), ("wait", "whole answer allowance"), ("shot", "cutoff-recovery"), ("send", b"\x1b"), + ("send", b"\x1b6"), ("wait", "Preferences"), ("send", b"\x1b[C"), ("wait", "Thinking:"), ("shot", "settings-models")], + "a02": [("wait", "Alt"), *palette("advanced parameters"), ("wait", "Show raw JSON"), ("shot", "params-menu"), + ("send", b"\x1b[B\r"), ("wait", "Set Repeat penalty"), ("shot", "params-field"), ("send", b"\x1b"), ("send", b"\x1b"), + *palette("advanced parameters"), ("wait", "Show raw JSON"), ("send", b"\r"), ("wait", "raw JSON"), ("shot", "params-raw")], + "a03": [("wait", "Alt"), *palette("connect a hosted api"), ("wait", "Choose a provider"), ("shot", "provider-presets"), + ("send", b"\r"), ("wait", "NVIDIA_API_KEY is not set"), ("shot", "missing-key"), ("send", b"\x1b"), + ("wait", "integrate.api.nvidia.com"), ("shot", "nvidia-form"), ("send", b"\x1b")], + "a04": [("wait", "Alt"), *palette("hosted output guard"), ("wait", "Always stream live"), ("shot", "output-guard")], + "a06": [("wait", "Alt"), *palette("setting: tool focus"), ("wait", "Compact: smaller context"), ("shot", "tool-focus")], + "a08": [("wait", "Alt"), *palette("gpu runtime"), ("wait", "CPU remains the default"), ("shot", "gpu-runtime")], + "b07": [("wait", "Alt"), *palette("connect a model"), ("wait", "Where will your model run?"), ("send", b"\x1b[B\r"), + ("wait", "Type model ID"), ("shot", "connection-form"), ("send", b"\x1bm"), ("wait", "Enter a model identifier"), ("shot", "manual-model")], + "h01": [("wait", "Alt"), ("wait", "Tip: your assistant"), ("shot", "home"), ("send", b"\x1b[B\x1b[B"), ("shot", "home-selected")], + "board": [("wait", "Alt"), ("send", b"\x10"), ("wait", "Command palette"), ("send", b"setting:"), ("wait", "Setting: Context"), + ("shot", "palette-settings"), ("send", b"\x1b"), *palette("setting: tool focus"), ("wait", "Which tools fit"), + ("shot", "palette-setting-opened"), ("send", b"\x1b")], +} + + +def run(order, out, columns, lines): + steps = PLANS[order] + with tempfile.TemporaryDirectory(prefix="alt-capture-") as directory: + root = Path(directory) + project = root / "project" + project.mkdir() + (project / "README.md").write_text("Fixture project for screenshots.\n") + state = root / "state" + state.mkdir(mode=0o700) + config = FIXTURE_CONFIG + server = None + if order in NEEDS_SERVER: + import socket + with socket.socket() as probe_port: + probe_port.bind(("127.0.0.1", 0)) + port = probe_port.getsockname()[1] + server = subprocess.Popen([sys.executable, str(repo / "tests/fixtures/fake_llama_server.py"), "--port", str(port), "--alias", "fixture-no-weights"]) + config = config.replace("http://127.0.0.1:9/v1", f"http://127.0.0.1:{port}/v1") + for _ in range(50): + try: + with socket.create_connection(("127.0.0.1", port), timeout=0.2): + break + except OSError: + time.sleep(0.1) + (state / "config.toml").write_text(config) + (state / "preferences.toml").write_text(f'project = "{project}"\nmouse = false\n') + master, slave = pty.openpty() + fcntl.ioctl(slave, termios.TIOCSWINSZ, struct.pack("HHHH", lines, columns, 0, 0)) + env = {**os.environ, "TERM": "xterm-256color", "COLORTERM": "truecolor"} + process = subprocess.Popen([str(binary), "--data-dir", str(state), "--engine", str(fixture), "tui"], + stdin=slave, stdout=slave, stderr=slave, cwd=project, env=env) + screen = pyte.Screen(columns, lines) + stream = pyte.ByteStream(screen) + + def pump(t=0.05): + # Bounded: animated indicators redraw continuously. + end = time.monotonic() + 0.5 + while time.monotonic() < end and select.select([master], [], [], t)[0]: + stream.feed(os.read(master, 65536)) + + def wait(needle, timeout=15): + end = time.monotonic() + timeout + while time.monotonic() < end: + pump() + if needle in "\n".join(screen.display): + for _ in range(4): + pump(0.05) + return + if process.poll() is not None: + break + raise AssertionError(f"{order} {columns}x{lines}: missing {needle!r}\n" + "\n".join(screen.display)) + + saved = [] + try: + for kind, value in steps: + if kind == "send": + os.write(master, value) + pump(0.1) + elif kind == "wait": + wait(value) + elif kind == "shot": + destination = out / f"{value}-{columns}x{lines}" + destination.parent.mkdir(parents=True, exist_ok=True) + destination.with_suffix(".txt").write_text("\n".join(screen.display) + "\n") + try: + from terminal_capture import save_screen + save_screen(screen, destination) + except Exception as error: # Pillow/fonts are optional + print(f"text only for {destination.name}: {error}") + saved.append(destination.name) + finally: + if server is not None: + server.terminate() + server.wait() + process.terminate() + try: + process.wait(timeout=8) + except subprocess.TimeoutExpired: + process.kill() + process.wait() + os.close(master) + os.close(slave) + return saved + + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument("order", choices=sorted(PLANS)) + parser.add_argument("--out", type=Path) + parser.add_argument("--sizes", default="80x24,120x40") + args = parser.parse_args() + out = args.out or repo / "docs/screenshots/0.7" / args.order + for size in args.sizes.split(","): + columns, lines = (int(n) for n in size.split("x")) + print(f"PASS {args.order} {size}: {', '.join(run(args.order, out, columns, lines))}") + + +if __name__ == "__main__": + main() diff --git a/scripts/check_repo_weight.py b/scripts/check_repo_weight.py new file mode 100755 index 00000000..060b3970 --- /dev/null +++ b/scripts/check_repo_weight.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python3 +"""Keep the repository light (A09): no tracked file above 1 MiB and no model +weights or archives. Raw evidence over 1 MiB belongs in a release asset; git +keeps summaries. Files that predate this rule are listed explicitly.""" +import subprocess +import sys +from pathlib import Path + +LIMIT = 1024 * 1024 +GRANDFATHERED = {"release-evidence/2026-10-07/CONTENTS.json"} +FORBIDDEN = (".gguf", ".safetensors", ".bin", ".pt", ".pth", ".onnx", ".tar.gz", ".zip", ".7z") + + +def main(): + files = subprocess.run(["git", "ls-files", "-z"], capture_output=True, check=True).stdout.split(b"\0") + problems = [] + for name in filter(None, files): + path = Path(name.decode()) + if not path.is_file(): + continue + if path.name.lower().endswith(FORBIDDEN): + problems.append(f"{path}: model weights and archives stay out of git") + elif path.stat().st_size > LIMIT and str(path) not in GRANDFATHERED: + problems.append(f"{path}: {path.stat().st_size} bytes; publish raw evidence over 1 MiB as a release asset and commit a summary") + for line in problems: + print(line) + print(f"repository weight: {len(problems)} problem(s) across {len([f for f in files if f])} tracked files") + return 1 if problems else 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/scripts/live_acceptance.py b/scripts/live_acceptance.py index fc2df53e..d82f1d1e 100644 --- a/scripts/live_acceptance.py +++ b/scripts/live_acceptance.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 -"""Opt-in repeatable project evaluations; requires an exact uncensored artifact. +"""Opt-in repeatable project evaluations of an exact, truthfully labelled model. +--artifact-label is uncensored, standard or hosted; local artifacts are pinned by SHA256. Every attempt, timeout, independent oracle and source diff is retained. """ import argparse,hashlib,json,os,signal,sqlite3,subprocess,time,urllib.request,shutil,sys @@ -16,12 +17,19 @@ p.add_argument("--skill") p.add_argument('--thinking',choices=['default','on','off'],default='default');p.add_argument('--stop-after',type=int,help='Retain a bounded pilot and leave remaining matrix cells explicitly unmeasured');p.add_argument('--resume',action='store_true');p.add_argument('--tool-profile',choices=['all','inspect','coding','terminal','compact','compact-lines'],default='all');p.add_argument('--partition',choices=['development','held-out','all'],default='development');p.add_argument('--threads',type=int,default=2);p.add_argument('--batch',type=int,default=128) p.add_argument('--verification-plan',action='store_true');p.add_argument('--history-notes',type=int,default=0) -p.add_argument('--binary',type=Path,default=Path('target/debug/alt'));p.add_argument('--engine',type=Path,required=True);p.add_argument('--model',type=Path,required=True);p.add_argument('--sha256',required=True);p.add_argument('--uncensored',action='store_true',required=True);p.add_argument('--runtime',type=Path);p.add_argument('--provider',choices=['openai','ollama'],default='openai');p.add_argument('--endpoint');p.add_argument('--model-id');p.add_argument('--contexts',default='8192');p.add_argument('--repeats',type=int,default=5);p.add_argument('--cases');p.add_argument('--timeout',type=int,default=240);p.add_argument('--output',type=Path,required=True) -p.add_argument('--generated-tokens',type=int);p.add_argument('--requests',type=int) +p.add_argument('--binary',type=Path,default=Path('target/debug/alt'));p.add_argument('--engine',type=Path,required=True);p.add_argument('--model',type=Path,help='Local model file (required for a managed runtime and for local labels)');p.add_argument('--sha256',help='SHA256 of --model');p.add_argument('--artifact-label',choices=['uncensored','standard','hosted'],help='Recorded truthfully: publisher-labelled uncensored/abliterated, standard, or a hosted API model');p.add_argument('--uncensored',action='store_true',help='Deprecated alias for --artifact-label uncensored');p.add_argument('--thinking-level',choices=['default','off','low','medium','high'],help='A01 reasoning choice for any server (alt inference --thinking)');p.add_argument('--dialect',choices=['auto','llama-cpp','ollama','chat-template','openai-effort']);p.add_argument('--runtime',type=Path);p.add_argument('--provider',choices=['openai','ollama'],default='openai');p.add_argument('--endpoint');p.add_argument('--model-id');p.add_argument('--contexts',default='8192');p.add_argument('--repeats',type=int,default=5);p.add_argument('--cases');p.add_argument('--timeout',type=int,default=240);p.add_argument('--output',type=Path,required=True) +p.add_argument('--check-args',action='store_true',help='Validate arguments and exit before hashing files or issuing any model request');p.add_argument('--api-key-env',help='Environment variable holding the endpoint key (hosted comparison runs)');p.add_argument('--generated-tokens',type=int);p.add_argument('--requests',type=int) p.add_argument('--instruction-draft',type=Path,help='Trial this bounded offline supplement for this campaign only') p.add_argument('--interface',choices=['cli','tui'],default='cli');p.add_argument('--width',type=int,default=80);p.add_argument('--height',type=int,default=24) p.add_argument('--followup-prompt',action='append',default=[],help='Send a follow-up in the same actual TUI conversation after a normal turn; the total deadline/allowance remains shared') a=p.parse_args() +if a.uncensored: + assert a.artifact_label in (None,'uncensored'),'--uncensored conflicts with --artifact-label' + a.artifact_label='uncensored' +assert a.artifact_label,'Choose --artifact-label uncensored, standard or hosted; it is recorded as given' +assert a.artifact_label!='hosted' or (not a.runtime and a.endpoint and a.model_id),'Hosted runs use --endpoint and --model-id without a managed runtime' +assert a.artifact_label=='hosted' or not a.runtime or (a.model and a.sha256),'A managed runtime needs --model and --sha256' +assert (a.model is None)==(a.sha256 is None),'Pass --model and --sha256 together' if a.suite=='v5': from acceptance_v5 import CASES,setup,check,ORACLE_VERSION,DEVELOPMENT,HELD_OUT,oracle_inputs,assertion_script assert a.timeout>0 and a.threads>0 and 16<=a.batch<=8192 @@ -32,10 +40,15 @@ assert a.cases is None or all(n in CASES for n in a.cases.split(',')), 'Unknown fixture' a.cases=a.cases or ','.join(DEVELOPMENT if a.partition=='development' else HELD_OUT if a.partition=='held-out' else CASES);assert a.runtime or (a.endpoint and a.model_id),'Choose managed runtime or explicit endpoint/model';assert a.repeats>=1 assert a.runtime or a.thinking=='default','Configure reasoning on the external server; this switch controls only an owned runtime' -binary=a.binary.resolve();artifact=a.model.resolve();h=hashlib.sha256() -with artifact.open('rb') as f: - for b in iter(lambda:f.read(8*1024*1024),b''):h.update(b) -assert h.hexdigest()==a.sha256,'Wrong model artifact' +if a.check_args: + print(json.dumps({'arguments':'valid','artifact_label':a.artifact_label,'cases':a.cases.split(','),'contexts':a.contexts,'repeats':a.repeats,'tool_profile':a.tool_profile,'output_tokens':a.output_tokens,'thinking_level':a.thinking_level,'runtime':bool(a.runtime),'endpoint':a.endpoint,'model_id':a.model_id})) + raise SystemExit(0) +binary=a.binary.resolve();artifact=a.model.resolve() if a.model else None +if artifact: + h=hashlib.sha256() + with artifact.open('rb') as f: + for b in iter(lambda:f.read(8*1024*1024),b''):h.update(b) + assert h.hexdigest()==a.sha256,'Wrong model artifact' root=a.output.resolve();root.mkdir(parents=True,exist_ok=a.resume) from evaluation_preflight import inspect preflight=inspect([CASES[name] for name in a.cases.split(',')]) @@ -49,7 +62,7 @@ if not target.exists():shutil.copy2(Path(__file__).parent/source,target) else:assert hashlib.sha256(target.read_bytes()).hexdigest()==hashlib.sha256((Path(__file__).parent/source).read_bytes()).hexdigest(), "Resume evaluator source changed" binary=frozen -config={'oracle_version':ORACLE_VERSION,'context_scope':'Managed runtime native window and engine budget' if a.runtime else 'Engine budget; external native window is configured on server/tag and inspected separately','model_file':artifact.name,'sha256':a.sha256,'bytes':artifact.stat().st_size,'uncensored':'Explicit user-selected publisher-labelled uncensored/abliterated artifact; no fallback','provider':a.provider,'endpoint':a.endpoint,'model_id':a.model_id,'runtime':str(a.runtime) if a.runtime else 'external','contexts':[int(x)for x in a.contexts.split(',')],'repeats':a.repeats,'timeout_seconds':a.timeout,'binary_sha256':hashlib.sha256(binary.read_bytes()).hexdigest(),'physical_gpu_tested':False,'verification_plan':a.verification_plan,'history_notes':a.history_notes} +config={'oracle_version':ORACLE_VERSION,'context_scope':'Managed runtime native window and engine budget' if a.runtime else 'Engine budget; external native window is configured on server/tag and inspected separately','model_file':artifact.name if artifact else None,'sha256':a.sha256,'bytes':artifact.stat().st_size if artifact else None,'artifact_label':a.artifact_label,'artifact_scope':{'uncensored':'Explicit user-selected publisher-labelled uncensored/abliterated artifact; no fallback','standard':'Explicit user-selected standard (not uncensored) artifact; no fallback','hosted':'Hosted API model identified by --model-id; provider weights are not hashable locally'}[a.artifact_label],'api_key_env':a.api_key_env,'thinking_level':a.thinking_level,'dialect':a.dialect,'provider':a.provider,'endpoint':a.endpoint,'model_id':a.model_id,'runtime':str(a.runtime) if a.runtime else 'external','contexts':[int(x)for x in a.contexts.split(',')],'repeats':a.repeats,'timeout_seconds':a.timeout,'binary_sha256':hashlib.sha256(binary.read_bytes()).hexdigest(),'physical_gpu_tested':False,'verification_plan':a.verification_plan,'history_notes':a.history_notes} config.update({'cases':a.cases.split(','),'partition':a.partition,'tool_profile':a.tool_profile,'threads':a.threads,'batch':a.batch,'engine_sha256':hashlib.sha256(a.engine.read_bytes()).hexdigest(),'runtime_sha256':hashlib.sha256(a.runtime.read_bytes()).hexdigest() if a.runtime else None,'fixture_sha256':hashlib.sha256(json.dumps({name:CASES[name] for name in a.cases.split(',')},sort_keys=True).encode()).hexdigest()}) config['suite']=a.suite config['interface']=a.interface @@ -94,11 +107,14 @@ def memory_tree(pid): if a.thinking!='default': with (state/'preferences.toml').open('a') as settings:settings.write('thinking='+('true' if a.thinking=='on' else 'false')+'\n') base=[str(binary),'--data-dir',str(state),'--engine',str(a.engine.resolve()),'--access','trusted'] - arguments=['models','import',str(artifact),'--uncensored','--use']if a.runtime else ['init','--model',a.model_id,'--provider',a.provider,'--endpoint',a.endpoint,'--context',str(context),'--max-turns','12','--uncensored'] + claim=['--uncensored'] if a.artifact_label=='uncensored' else [] + arguments=['models','import',str(artifact),*claim,'--use']if a.runtime else ['init','--model',a.model_id,'--provider',a.provider,'--endpoint',a.endpoint,'--context',str(context),'--max-turns','12',*claim]+(['--api-key-env',a.api_key_env] if a.api_key_env else []) init=subprocess.run(base+arguments,cwd=project,capture_output=True,text=True,timeout=180);(run_dir/'setup.stdout').write_text(init.stdout);(run_dir/'setup.stderr').write_text(init.stderr);assert init.returncode==0,init.stderr allocation=[] for field in ['output_tokens','reasoning_tokens','temperature','top_p','generated_tokens','requests']: if getattr(a,field) is not None:allocation+=['--'+field.replace('_','-'),str(getattr(a,field))] + if a.thinking_level:allocation+=['--thinking',a.thinking_level] + if a.dialect:allocation+=['--dialect',a.dialect] if allocation:subprocess.run(base+['inference',*allocation],cwd=project,check=True,capture_output=True) subprocess.run(base+['workflow',a.workflow],cwd=project,check=True,capture_output=True) if a.skill:subprocess.run(base+['skills','use',a.skill],cwd=project,check=True,capture_output=True) @@ -128,7 +144,7 @@ def memory_tree(pid): peak=tui['sampled_alt_tree_peak_rss_bytes'];timed_out=tui['timed_out'];exit_code=tui['process_exit'] else: with (run_dir/'turn.jsonl').open('w')as out,(run_dir/'turn.stderr').open('w')as err: - proc=subprocess.Popen(base+['run',prompt,'--allow-tools','--json','--timeout',str(a.timeout)]+(['--instruction-draft',str(a.instruction_draft.resolve())] if a.instruction_draft else []),cwd=project,stdout=out,stderr=err,start_new_session=True) + proc=subprocess.Popen(base+['run',prompt,'--allow-tools','--allow-terminal','--json','--timeout',str(a.timeout)]+(['--instruction-draft',str(a.instruction_draft.resolve())] if a.instruction_draft else []),cwd=project,stdout=out,stderr=err,start_new_session=True) try: while proc.poll()is None: peak=max(peak,memory_tree(proc.pid)) diff --git a/scripts/package-linux.py b/scripts/package-linux.py index 1572ede7..721e06bb 100644 --- a/scripts/package-linux.py +++ b/scripts/package-linux.py @@ -44,7 +44,20 @@ subprocess.run(['openssl','dgst','-sha256','-sign',os.environ['ALT_SIGNING_KEY'],'-out',str(package/'PLATFORM.json.sig'),str(package/'PLATFORM.json')],check=True) for doc in ["README.md", "LICENSE", "THIRD_PARTY.md"]: shutil.copy2(repo / doc, package / doc) - shutil.copytree(repo / "docs", package / "docs") + # B11/A09: ship guides and screenshots, not the historical raw evidence. + def offline_docs(directory, names): + relative = Path(directory).relative_to(repo / "docs") + if relative == Path("."): + return [n for n in names if n == "evidence"] + if relative.parts[0] == "research": + return [n for n in names if (Path(directory) / n).is_file() and not n.endswith(".md")] + return [] + shutil.copytree(repo / "docs", package / "docs", ignore=offline_docs) + (package / "docs" / "EVIDENCE.md").write_text( + "# Raw evidence\n\nThis package carries the guides, summaries and screenshots. Raw evaluation\n" + f"evidence (request logs, receipts, matrices) stays in the source repository at the\n" + f"commit this package was built from ({build.get('commit', 'see BUILD.json')}), under docs/evidence and docs/research.\n" + ) shutil.copytree(repo / "prompts", package / "prompts") shutil.copytree(repo / "skills", package / "skills") shutil.copytree(repo / "training", package / "training",ignore=shutil.ignore_patterns('__pycache__','*.pyc')) diff --git a/scripts/pc_cuda_check.sh b/scripts/pc_cuda_check.sh new file mode 100755 index 00000000..5c2574c0 --- /dev/null +++ b/scripts/pc_cuda_check.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash +# A08 (owner PC, not run in the cloud): check that a CUDA 12 runtime serves the +# GPU before pinning it. Read-only apart from Alt's state folder you pass in. +# Usage: scripts/pc_cuda_check.sh /path/to/llama-server /path/to/model.gguf [STATE_DIR] +set -euo pipefail +server="${1:?llama-server path}"; model="${2:?GGUF model path}"; state="${3:-$(mktemp -d)}" +alt="${ALT_BINARY:-target/release/alt}" +echo "== GPU"; nvidia-smi --query-gpu=name,memory.total,compute_cap,driver_version --format=csv,noheader +echo "== runtime devices"; "$server" --list-devices +echo "== Alt view"; "$alt" --data-dir "$state" hardware | head -40 +"$alt" --data-dir "$state" models import "$model" --uncensored --use +"$alt" --data-dir "$state" runtime --gpu-layers 99 --cache-k q8_0 --cache-v q8_0 --flash-attention true +python3 - "$state" "$server" <<'PY' +import sys, tomllib, pathlib +state, server = map(pathlib.Path, sys.argv[1:]) +prefs = state / "preferences.toml" +text = prefs.read_text() +text = "\n".join(l for l in text.splitlines() if not l.startswith("runtime_path")) +prefs.write_text(f'runtime_path = "{server}"\n' + text + "\n") +PY +echo "== benchmark (16K context recommended for the 0.7 matrix)" +"$alt" --data-dir "$state" benchmark +nvidia-smi --query-gpu=memory.used --format=csv,noheader +echo "State kept in $state; stop any leftover llama-server with: pkill -f \"$server\"" diff --git a/scripts/pc_matrix_0_7.sh b/scripts/pc_matrix_0_7.sh new file mode 100755 index 00000000..5cb03e5f --- /dev/null +++ b/scripts/pc_matrix_0_7.sh @@ -0,0 +1,136 @@ +#!/usr/bin/env bash +# A10: matched 0.7 re-run of the 2026-10-08 PC trial (owner PC executes; the cloud +# only checks it with --dry-run). Same matrix as the trial note: suite v5, 8 cases, +# 16K context, compact tools, 4,096 output tokens, now 3 repeats, for +# Spark-X2.5 4B Q8 abliterated (Ollama, GPU) label uncensored +# MiMo V2.6 Distill 9B Q4_K_M abliterated (llama.cpp CUDA) label uncensored +# MiMo V2.6 Distill 9B Q4_K_M standard (llama.cpp CUDA) label standard +# moonshotai/kimi-k3 and z-ai/glm-5.3 (NVIDIA NIM) label hosted +# Arms: "trial" repeats the trial settings; "thinking-off" adds A01's thinking off. +# Every cell checks GPU headroom first, records skips, and stops every +# llama-server it started. Failed cells are kept; nothing is retried silently. +# +# Configure with environment variables (all paths absolute): +# ALT_BIN Alt binary under test (default target/release/alt) +# GOOSE Goose 1.53.0 binary (required) +# LLAMA_CUDA CUDA 12 llama-server (MiMo cells) +# MIMO_ABL MIMO_ABL_SHA abliterated GGUF and SHA256 +# MIMO_STD MIMO_STD_SHA standard GGUF and SHA256 +# SPARK_TAG Ollama tag for Spark 4B (default spark-x2.5:4b-q8) +# OLLAMA Ollama root (default http://127.0.0.1:11434) +# NVIDIA_MODELS space-separated ids (default "moonshotai/kimi-k3 z-ai/glm-5.3") +# ARMS space-separated arms (default "trial thinking-off") +# REPEATS (3) CONTEXT (16384) OUTPUT (4096) TIMEOUT (600) +# MIMO_NEED_MIB (6800) SPARK_NEED_MIB (5200) free VRAM required before a GPU cell +# OUT results folder (default ./pc-matrix-0.7-) +# NVIDIA_API_KEY must be set for hosted cells; only its name is passed to Alt. +set -euo pipefail +dry=false +[[ "${1:-}" == "--dry-run" ]] && dry=true +repo="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)" +ALT_BIN="${ALT_BIN:-$repo/target/release/alt}" +SPARK_TAG="${SPARK_TAG:-spark-x2.5:4b-q8}" +OLLAMA="${OLLAMA:-http://127.0.0.1:11434}" +NVIDIA_MODELS="${NVIDIA_MODELS:-moonshotai/kimi-k3 z-ai/glm-5.3}" +ARMS="${ARMS:-trial thinking-off}" +REPEATS="${REPEATS:-3}" CONTEXT="${CONTEXT:-16384}" OUTPUT="${OUTPUT:-4096}" TIMEOUT="${TIMEOUT:-600}" +MIMO_NEED_MIB="${MIMO_NEED_MIB:-6800}" SPARK_NEED_MIB="${SPARK_NEED_MIB:-5200}" +OUT="${OUT:-$PWD/pc-matrix-0.7-$(date +%Y-%m-%d)}" +CASES="python-feature,python-multifile,rust-feature,javascript-config,python-http-security,heldout-toposort,sealed-intervals,sealed-cache-expiry" +ledger="$OUT/ledger.jsonl" + +log() { printf '%s\n' "$*"; } +record() { $dry || printf '%s\n' "$1" >> "$ledger"; } + +free_vram_mib() { + nvidia-smi --query-gpu=memory.free --format=csv,noheader,nounits 2>/dev/null | sort -n | tail -1 +} + +# "ora-can-i-start": enough free VRAM for this cell, or skip and record why. +can_start() { + local need="$1" cell="$2" + if $dry; then log " [dry-run] would require ${need} MiB free VRAM for $cell"; return 0; fi + local free; free="$(free_vram_mib || true)" + if [[ -z "$free" || "$free" -lt "$need" ]]; then + log " SKIP $cell: free VRAM ${free:-unknown} MiB < ${need} MiB" + record "{\"cell\":\"$cell\",\"status\":\"skipped\",\"reason\":\"free VRAM ${free:-unknown} MiB below ${need} MiB\"}" + return 1 + fi +} + +servers_before="" +remember_servers() { servers_before="$(pgrep -x llama-server || true)"; } +stop_new_servers() { + local pid + for pid in $(pgrep -x llama-server || true); do + grep -qx "$pid" <<<"$servers_before" || { log " stopping leftover llama-server $pid"; kill "$pid" 2>/dev/null || true; } + done +} +unload_ollama() { + $dry && { log " [dry-run] would unload $1 from Ollama (keep_alive 0)"; return; } + curl -fsS "$OLLAMA/api/generate" -d "{\"model\":\"$1\",\"keep_alive\":0}" >/dev/null 2>&1 || true +} +trap 'stop_new_servers' EXIT + +run_cell() { + local cell="$1"; shift + local arm="$1"; shift + local extra=() + [[ "$arm" == "thinking-off" ]] && extra+=(--thinking-level off) + local cmd=(python3 "$repo/scripts/live_acceptance.py" --suite v5 --binary "$ALT_BIN" --engine "${GOOSE:-GOOSE_UNSET}" + --contexts "$CONTEXT" --repeats "$REPEATS" --cases "$CASES" --tool-profile compact + --output-tokens "$OUTPUT" --timeout "$TIMEOUT" --verification-plan + --output "$OUT/$cell-$arm" "$@" "${extra[@]}") + if $dry; then + log " [dry-run] ${cmd[*]}" + "${cmd[@]}" --check-args > /dev/null || { log " INVALID arguments for $cell/$arm"; exit 3; } + return 0 + fi + remember_servers + local status=0 + "${cmd[@]}" > "$OUT/$cell-$arm.stdout" 2> "$OUT/$cell-$arm.stderr" || status=$? + stop_new_servers + record "{\"cell\":\"$cell\",\"arm\":\"$arm\",\"exit\":$status,\"output\":\"$OUT/$cell-$arm\"}" + log " $cell/$arm exit $status" +} + +log "Alt 0.7 PC matrix → $OUT (dry-run: $dry)" +if ! $dry; then + mkdir -p "$OUT" + [[ -x "$ALT_BIN" && -x "${GOOSE:-}" ]] || { log "Set ALT_BIN and GOOSE to executables"; exit 2; } + "$ALT_BIN" build-info > "$OUT/BUILD.json" + nvidia-smi --query-gpu=name,memory.total,compute_cap,driver_version --format=csv > "$OUT/gpu.csv" || true +fi + +for arm in $ARMS; do + log "== arm $arm" + log "- spark-4b (Ollama $SPARK_TAG)" + if can_start "$SPARK_NEED_MIB" "spark-4b-$arm"; then + run_cell spark-4b "$arm" --artifact-label uncensored --provider ollama --endpoint "$OLLAMA" --model-id "$SPARK_TAG" + fi + unload_ollama "$SPARK_TAG" + for variant in abl std; do + if [[ "$variant" == abl ]]; then file="${MIMO_ABL:-}"; sha="${MIMO_ABL_SHA:-}"; label=uncensored + else file="${MIMO_STD:-}"; sha="${MIMO_STD_SHA:-}"; label=standard; fi + log "- mimo-9b-$variant (llama.cpp CUDA, $label)" + if [[ -z "$file" || -z "${LLAMA_CUDA:-}" ]] && ! $dry; then + record "{\"cell\":\"mimo-9b-$variant\",\"arm\":\"$arm\",\"status\":\"skipped\",\"reason\":\"MIMO_${variant^^} or LLAMA_CUDA not set\"}" + log " SKIP: set MIMO_${variant^^}, MIMO_${variant^^}_SHA and LLAMA_CUDA"; continue + fi + if can_start "$MIMO_NEED_MIB" "mimo-9b-$variant-$arm"; then + run_cell "mimo-9b-$variant" "$arm" --artifact-label "$label" --runtime "${LLAMA_CUDA:-LLAMA_CUDA_UNSET}" \ + --model "${file:-MIMO_${variant^^}_UNSET}" --sha256 "${sha:-SHA_UNSET}" + fi + done + for model in $NVIDIA_MODELS; do + cell="nvidia-${model//\//-}" + log "- $cell (NVIDIA NIM, hosted)" + if [[ -z "${NVIDIA_API_KEY:-}" ]] && ! $dry; then + record "{\"cell\":\"$cell\",\"arm\":\"$arm\",\"status\":\"skipped\",\"reason\":\"NVIDIA_API_KEY not set\"}" + log " SKIP: NVIDIA_API_KEY not set"; continue + fi + run_cell "$cell" "$arm" --artifact-label hosted --provider openai --endpoint https://integrate.api.nvidia.com/v1 \ + --model-id "$model" --api-key-env NVIDIA_API_KEY --dialect chat-template + done +done +log "Done. Ledger: $ledger. Summarise with scripts/summarize_matrix.py; record failures as well as passes." diff --git a/scripts/pin_cuda_runtime.py b/scripts/pin_cuda_runtime.py new file mode 100755 index 00000000..cafc9b84 --- /dev/null +++ b/scripts/pin_cuda_runtime.py @@ -0,0 +1,70 @@ +#!/usr/bin/env python3 +"""A08 (owner PC): package a verified CUDA 12 llama-server build as a pinned Alt runtime. + +Usage: pin_cuda_runtime.py BUILD_BIN_DIR OUTPUT_DIR [--name llama-cuda12-] [--bundle-cuda-libs] + +BUILD_BIN_DIR is the directory holding llama-server, e.g. ~/llama-cuda12/build/bin from +scripts/build-pascal-runtime.sh. The archive is deterministic (sorted, mtime 0, uid 0). +It prints the sha256/size and the exact `pub const CUDA12` value for src/runtime.rs. +Upload the archive as a release asset of alt-cli, then paste the pin and open a PR. + +Licensing (recheck before distributing, as AGENTS.md requires): llama.cpp is MIT. Shared +CUDA libraries (libcudart, libcublas, libcublasLt) are NVIDIA-redistributable only under +the CUDA EULA; --bundle-cuda-libs copies them and records that in NOTICE-CUDA.txt. +Without it, users need a CUDA 12 runtime installed system-wide. +""" +import argparse, gzip, hashlib, io, os, re, shutil, subprocess, sys, tarfile, tempfile +from pathlib import Path + +CUDA_LIBS = re.compile(r"lib(cudart|cublas|cublasLt)\.so\.12") + + +def main(): + parser = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) + parser.add_argument("build", type=Path) + parser.add_argument("output", type=Path) + parser.add_argument("--name") + parser.add_argument("--bundle-cuda-libs", action="store_true") + parser.add_argument("--url-base", default="https://github.com/3d3dcanada/alt-cli/releases/download/RUNTIME_TAG") + args = parser.parse_args() + server = args.build / "llama-server" + if not server.is_file() or not os.access(server, os.X_OK): + sys.exit(f"{server} is not an executable llama-server") + devices = subprocess.run([str(server), "--list-devices"], capture_output=True, text=True, timeout=30) + if "CUDA" not in devices.stdout + devices.stderr: + print("warning: --list-devices reported no CUDA device on this machine:\n" + devices.stdout + devices.stderr, file=sys.stderr) + name = args.name or "llama-cuda12-" + hashlib.sha256(server.read_bytes()).hexdigest()[:12] + files = sorted(p for p in args.build.iterdir() if p.is_file() and (p.name == "llama-server" or ".so" in p.name)) + ldd = subprocess.run(["ldd", str(server)], capture_output=True, text=True).stdout + cuda = [Path(m.split("=>")[1].split()[0]) for m in ldd.splitlines() if "=>" in m and CUDA_LIBS.search(m) and m.split("=>")[1].strip().startswith("/")] + notice = None + if cuda and args.bundle_cuda_libs: + files += sorted(set(p.resolve() for p in cuda)) + notice = ("CUDA runtime libraries in this archive are redistributed under the NVIDIA CUDA Toolkit EULA " + "(Attachment A, redistributable software): " + ", ".join(p.name for p in cuda) + "\n") + elif cuda: + print("note: llama-server links " + ", ".join(p.name for p in cuda) + " dynamically; users need a CUDA 12 runtime, " + "or rerun with --bundle-cuda-libs after checking the EULA.", file=sys.stderr) + args.output.mkdir(parents=True, exist_ok=True) + archive = args.output / f"{name}.tar.gz" + raw = io.BytesIO() + with tarfile.open(fileobj=raw, mode="w", format=tarfile.GNU_FORMAT) as tar: + entries = [(f.name if f.parent == args.build else Path(f).name, f.read_bytes(), 0o755 if f.name == "llama-server" else 0o644) for f in files] + entries.append(("NOTICE.txt", b"llama.cpp (MIT): https://github.com/ggml-org/llama.cpp\nBuilt with CUDA 12 for compute capability 6.1+.\n", 0o644)) + if notice: + entries.append(("NOTICE-CUDA.txt", notice.encode(), 0o644)) + for member, data, mode in sorted(entries): + info = tarfile.TarInfo(f"{name}/{member}") + info.size, info.mode, info.mtime, info.uid, info.gid, info.uname, info.gname = len(data), mode, 0, 0, 0, "", "" + tar.addfile(info, io.BytesIO(data)) + with open(archive, "wb") as handle, gzip.GzipFile(fileobj=handle, mode="wb", mtime=0, filename="") as gz: + gz.write(raw.getvalue()) + data = archive.read_bytes() + sha = hashlib.sha256(data).hexdigest() + print(f"archive: {archive}\nsha256: {sha}\nsize: {len(data)}\n") + print("Paste into src/runtime.rs (replace the `None`):\n") + print(f'pub const CUDA12: Option = Some(Pin {{\n label: "llama.cpp CUDA 12 ({name})",\n url: "{args.url_base}/{archive.name}",\n sha256: "{sha}",\n size: {len(data)},\n directory: "{name}",\n}});') + + +if __name__ == "__main__": + main() diff --git a/scripts/secret_scan.py b/scripts/secret_scan.py new file mode 100755 index 00000000..cb7043f6 --- /dev/null +++ b/scripts/secret_scan.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python3 +"""Scan added lines (or whole files) for credentials before a push. Stdlib only. + +Usage: secret_scan.py [--base REF] [--all] + --base REF scan lines added since REF (default origin/main) + --all scan every tracked file instead of a diff +Exit 1 when a likely secret is found. Fixture placeholders such as +`sk-test-fixture` or values built from repeated characters are ignored. +""" +import argparse +import re +import subprocess +import sys + +PATTERNS = [ + ("private key block", re.compile(r"-----BEGIN (?:RSA |EC |OPENSSH |DSA |PGP )?PRIVATE KEY-----")), + ("AWS access key", re.compile(r"\b(?:AKIA|ASIA)[0-9A-Z]{16}\b")), + ("GitHub token", re.compile(r"\b(?:ghp|gho|ghu|ghs|ghr)_[A-Za-z0-9]{36,}\b|\bgithub_pat_[A-Za-z0-9_]{60,}\b")), + ("NVIDIA API key", re.compile(r"\bnvapi-[A-Za-z0-9_-]{30,}\b")), + ("OpenAI-style key", re.compile(r"\bsk-(?:proj-|ant-)?[A-Za-z0-9_-]{32,}\b")), + ("Hugging Face token", re.compile(r"\bhf_[A-Za-z0-9]{30,}\b")), + ("Slack token", re.compile(r"\bxox[abprs]-[A-Za-z0-9-]{10,}\b")), + ("Google API key", re.compile(r"\bAIza[0-9A-Za-z_-]{35}\b")), + ("Groq key", re.compile(r"\bgsk_[A-Za-z0-9]{40,}\b")), + ("bearer header", re.compile(r"Authorization:\s*Bearer\s+[A-Za-z0-9._-]{24,}", re.I)), + ("assigned secret", re.compile(r"(?i)\b(?:api[_-]?key|secret|token|password)\b\s*[=:]\s*['\"]([A-Za-z0-9/+_=-]{24,})['\"]")), +] +ALLOW = re.compile(r"(?i)fixture|example|placeholder|dummy|redacted|xxxx|test-key|not-a-real") + + +def suspicious(value: str) -> bool: + # Repeated characters and obvious placeholders are fixtures, not credentials. + return len(set(value)) > 6 and not ALLOW.search(value) + + +def scan(lines): + found = [] + for origin, number, text in lines: + for label, pattern in PATTERNS: + for match in pattern.finditer(text): + value = match.group(match.lastindex or 0) + if suspicious(value) and not ALLOW.search(text): + found.append((origin, number, label, value[:6] + "…")) + return found + + +def diff_lines(base): + out = subprocess.run(["git", "diff", "--unified=0", "--no-color", f"{base}...HEAD"], + capture_output=True, text=True, check=True).stdout + out += subprocess.run(["git", "diff", "--unified=0", "--no-color", "HEAD"], + capture_output=True, text=True, check=True).stdout + path, number = "?", 0 + for line in out.splitlines(): + if line.startswith("+++ "): + path = line[6:] if line.startswith("+++ b/") else line[4:] + elif line.startswith("@@"): + number = int(re.search(r"\+(\d+)", line).group(1)) - 1 + elif line.startswith("+") and not line.startswith("+++"): + number += 1 + yield path, number, line[1:] + + +def all_lines(): + files = subprocess.run(["git", "ls-files"], capture_output=True, text=True, check=True).stdout.split("\n") + for path in filter(None, files): + try: + with open(path, encoding="utf-8") as handle: + for number, text in enumerate(handle, 1): + yield path, number, text + except (UnicodeDecodeError, IsADirectoryError, FileNotFoundError): + continue + + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument("--base", default="origin/main") + parser.add_argument("--all", action="store_true") + args = parser.parse_args() + found = scan(all_lines() if args.all else diff_lines(args.base)) + for path, number, label, preview in found: + print(f"{path}:{number}: possible {label} ({preview})") + print(f"secret scan: {len(found)} finding(s)") + return 1 if found else 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/scripts/setup-cloud.sh b/scripts/setup-cloud.sh index a0c05f93..ee59999d 100644 --- a/scripts/setup-cloud.sh +++ b/scripts/setup-cloud.sh @@ -51,7 +51,7 @@ if not binary.exists() or hashlib.sha256(binary.read_bytes()).hexdigest() != bin PY cd "$repo_dir" -python3 -m pip install --target /workspace/.alt-tools/python -r requirements-dev.txt --upgrade +python3 -m pip install --require-hashes --target /workspace/.alt-tools/python -r requirements-dev.txt --upgrade cargo build --locked cargo test --locked cargo fmt --all --check @@ -71,6 +71,8 @@ python3 scripts/test_campaign.py -v python3 scripts/test_evaluation_preflight.py -v python3 scripts/test_process_state.py -v python3 scripts/test_release_verification.py -v +python3 scripts/test_pc_matrix.py -v +bash scripts/pc_matrix_0_7.sh --dry-run > /dev/null python3 -m unittest discover -s training/tests -v python3 scripts/smoke_skills.py python3 scripts/smoke_analysis.py diff --git a/scripts/smoke_compact.py b/scripts/smoke_compact.py index 3680cedd..4813230d 100644 --- a/scripts/smoke_compact.py +++ b/scripts/smoke_compact.py @@ -24,6 +24,7 @@ FOLLOWUP_TEXT = 'CONTINUE_SAVED_TASK_FIXTURE: Continue the task.' EDITOR = 'edit_text' CREATE_BODY = "VALUE = '☃\\n'\n" +REPLACE_BODY = 'def scaled(x):\n return x * 3\n' class Provider(BaseProvider): @@ -57,6 +58,11 @@ def do_POST(self): assert 'Original task request (context; the latest user message takes precedence)' in content else: assert 'Original task request (context;' not in content, 'First request was needlessly duplicated' + elif any(m['role'] == 'user' and 'REPLACE_FILE_FIXTURE' in str(m.get('content')) for m in body['messages']): + # A06: whole-file rewrite of a small file already read in full. + assert 'replace_file' in tools, 'compact profiles offer replace_file' + if not results: + tool, arguments = 'replace_file', {'path': 'repair.py', 'new_text': REPLACE_BODY, 'reason': 'Rewrite the small file'} elif any(m['role'] == 'user' and 'CREATE_DELETE_FIXTURE' in str(m.get('content')) for m in body['messages']): if not results: tool = 'create_file' if EDITOR == 'edit_text' else 'create_lines' @@ -214,6 +220,14 @@ def run(*arguments): assert not (project / 'addon.py').exists() rows.append({'scenario':'create-delete-and-undo','events':events,'changes':[created,deleted],'requests':REQUESTS[request_offset:]}) request_offset = len(REQUESTS) + original = SOURCE.read_text() + events = [json.loads(line) for line in run('run', 'REPLACE_FILE_FIXTURE: rewrite repair.py in full.', '--json', '--allow-tools').splitlines()] + assert SOURCE.read_text() == REPLACE_BODY, json.dumps(events)[-3000:] + rewrite = next(c for c in json.loads(run('task', 'changes')) if c['path'] == 'repair.py' and c['after'] == REPLACE_BODY) + run('task', 'undo', rewrite['id']) + assert SOURCE.read_text() == original + rows.append({'scenario':'replace-file-and-undo','events':events,'requests':REQUESTS[request_offset:]}) + request_offset = len(REQUESTS) original_source = SOURCE.read_text() FOLLOWUP_GOAL = 'Repair scaled(x) in repair.py. ' + 'Preserve its original public interface. ' * 10 + 'FINAL_SCOPE_MARKER ☃.' if args.interface == 'tui': diff --git a/scripts/smoke_goose.py b/scripts/smoke_goose.py index 0bebc8be..df688b81 100644 --- a/scripts/smoke_goose.py +++ b/scripts/smoke_goose.py @@ -15,8 +15,13 @@ from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer REQUESTS = [] +AUTH = [] +# A03/B03: a fixture key that must reach the provider and never Alt's state. +SECRET = "alt-fixture-key-" + os.urandom(12).hex() +os.environ["ALT_SMOKE_KEY"] = SECRET MODEL = "alt-protocol-fixture" STALL_STARTED = threading.Event() +GARBAGE_SENT = [] STALL_RELEASE = threading.Event() @@ -50,6 +55,7 @@ def do_POST(self): self.send_json({"capabilities": ["completion", "tools"], "model_info": {"general.architecture": "llama", "llama.context_length": 8192}}) return REQUESTS.append((self.path, request)) + AUTH.append(self.headers.get("Authorization")) if self.path != "/v1/chat/completions": self.send_error(404) return @@ -59,7 +65,17 @@ def do_POST(self): STALL_RELEASE.wait(timeout=15) return tool_results = [m for m in messages if m["role"] == "tool"] - if any(m["role"] == "user" and "Report the previous evidence" in str(m.get("content")) for m in messages): + if any(m["role"] == "user" and "GARBAGE_FIXTURE" in str(m.get("content")) for m in messages): + # A04: the first reply is provider garbage with leaked template tokens. + text = "Clean answer after resend" if GARBAGE_SENT else "<|open|>垃圾 мусор 函数<|close|> λ" + GARBAGE_SENT.append(True) + message = {"role": "assistant", "content": text} + finish = "stop" + elif any(m["role"] == "user" and "CUTOFF_FIXTURE" in str(m.get("content")) for m in messages) and not tool_results: + # A01: every output token went to reasoning; no answer, no tool call. + message = {"role": "assistant", "content": "", "reasoning_content": "Thinking about the files in detail before acting"} + finish = "length" + elif any(m["role"] == "user" and "Report the previous evidence" in str(m.get("content")) for m in messages): memory = json.dumps(messages) message = {"role": "assistant", "content": "Restored memory contains ALT_TOOL_OK" if "ALT_TOOL_OK" in memory else "Memory missing"} finish = "stop" @@ -126,12 +142,15 @@ def run(*arguments): raise AssertionError(f"alt {arguments} failed\n{result.stderr}\n{result.stdout[-10000:]}") return result.stdout - run("init", "--model", MODEL, "--endpoint", endpoint, "--provider", args.provider, "--context", "8192") + run("init", "--model", MODEL, "--endpoint", endpoint, "--provider", args.provider, "--context", "8192", "--api-key-env", "ALT_SMOKE_KEY") print(run("doctor").strip()) denied = [json.loads(line) for line in run("run", "Run fixture check", "--json").splitlines()] assert not (workspace / "fixture-evidence.txt").exists(), "Unapproved shell tool executed" assert any(e["type"] == "permission_decision" and not e["allow"] for e in denied), json.dumps(denied)[-10000:] - allowed = [json.loads(line) for line in run("run", "Run fixture check", "--allow-tools", "--json").splitlines()] + project_only = [json.loads(line) for line in run("run", "Run fixture check", "--allow-tools", "--json").splitlines()] + assert not (workspace / "fixture-evidence.txt").exists(), "--allow-tools approved a terminal command" + assert any(e["type"] == "permission_decision" and not e["allow"] for e in project_only), json.dumps(project_only)[-10000:] + allowed = [json.loads(line) for line in run("run", "Run fixture check", "--allow-tools", "--allow-terminal", "--json").splitlines()] assert (workspace / "fixture-evidence.txt").read_text() == "ALT_TOOL_OK" assert any(e["type"] == "permission_decision" and e["allow"] for e in allowed) assert any(e["type"] == "update" and "ALT_TOOL_OK" in json.dumps(e) for e in allowed) @@ -143,7 +162,7 @@ def run(*arguments): connection=root/'mcp.json' connection.write_text(json.dumps({"name":"fixture_ext","transport":{"type":"stdio","command":"python3","args":[str(Path(__file__).resolve().parents[1]/'tests/fixtures/mcp_server.py')]},"enabled":False,"selected_tools":[]})) run('extensions','add',str(connection));run('extensions','check','fixture_ext');run('extensions','select','fixture_ext','counter') - external=[json.loads(line) for line in run('run','EXTERNAL_FIXTURE call the counter tool','--allow-tools','--json').splitlines()] + external=[json.loads(line) for line in run('run','EXTERNAL_FIXTURE call the counter tool','--allow-terminal','--json').splitlines()] assert any(e['type']=='permission_decision' and e['allow'] for e in external),external assert any(e['type']=='update' and 'Observed tool result:' in json.dumps(e) and '1' in json.dumps(e) for e in external),external run('extensions','disable','fixture_ext') @@ -152,6 +171,26 @@ def run(*arguments): assert plain.returncode==0,(plain.stdout,plain.stderr) assert 'Allow once? [y/N]' in plain.stdout and 'ALT_TOOL_OK' in plain.stdout,(plain.stdout,plain.stderr) assert (workspace/'fixture-evidence.txt').read_text()=='ALT_TOOL_OK' + mark = len(REQUESTS) + cut = [json.loads(line) for line in run('run', 'CUTOFF_FIXTURE explain the project', '--json').splitlines()] + assert any(e['type'] == 'reasoning_cutoff' and e['resent'] is False and e['charged'] for e in cut), cut + cut_requests = [r for p, r in REQUESTS[mark:] if p == '/v1/chat/completions'] + assert len(cut_requests) == 1, f"Alt must not resend after a cutoff: {len(cut_requests)}" + run('inference', '--thinking', 'off') + mark = len(REQUESTS) + run('run', 'Report the previous evidence', '--json') + body = [r for p, r in REQUESTS[mark:] if p == '/v1/chat/completions'][-1] + if args.provider == 'ollama': + assert body.get('think') is False and body.get('reasoning_effort') == 'none', body + else: + assert body.get('reasoning_effort') == 'none' and 'think' not in body, body + run('inference', '--output-guard', 'on') + guarded = run('run', 'GARBAGE_FIXTURE say hello', '--json') + assert 'Clean answer after resend' in guarded and '<|open|>' not in guarded, guarded[-4000:] + session = [json.loads(line) for line in guarded.splitlines()][0]['session']['id'] + assert '<|open|>' not in run('export', session), "Discarded provider output reached the conversation" + assert len(GARBAGE_SENT) == 2, GARBAGE_SENT + run('inference', '--output-guard', 'auto') cancellation = subprocess.Popen([alt, "--data-dir", str(root / "state"), "--engine", goose, "run", "STALL_FIXTURE", "--json"], cwd=workspace, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True) @@ -178,9 +217,17 @@ def run(*arguments): cancellation.kill() cancellation.wait() assert all(path == "/v1/chat/completions" for path, _ in REQUESTS) + assert AUTH and all(a == f"Bearer {SECRET}" for a in AUTH), "Provider key missing from model requests" + for path in (root / "state").rglob("*"): + if path.is_file(): + assert SECRET.encode() not in path.read_bytes(), f"API key value written to {path}" assert all(body["model"] == MODEL for _, body in REQUESTS) assert all(body.get("max_tokens") == 2048 for _, body in REQUESTS), "Actual server output limit missing" - assert all("options" not in body for _, body in REQUESTS), "Native-only fields leaked into compatible chat requests" + if args.provider == "ollama": + # A02: only Alt's explicit context reaches Ollama; engine options never leak. + assert all(body.get("options") == {"num_ctx": 8192} for _, body in REQUESTS), "Ollama options must be exactly the selected num_ctx" + else: + assert all("options" not in body for _, body in REQUESTS), "Native-only fields leaked into compatible chat requests" assert any("native tool calls" in json.dumps(body["messages"]) for _, body in REQUESTS), "Operator instructions missing" tools = sorted({tool["function"]["name"] for _, body in REQUESTS for tool in body.get("tools", [])}) assert sorted(name.split("__")[-1] for name in tools) == ["counter", "edit", "evidence", "list", "read", "remember", "run_check", "search", "skill", "terminal"], tools diff --git a/scripts/smoke_harness_tui.py b/scripts/smoke_harness_tui.py index 48b726aa..c9aab851 100644 --- a/scripts/smoke_harness_tui.py +++ b/scripts/smoke_harness_tui.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 """New small-model settings and effort choices in a real PTY; no model inference.""" -import argparse,json,subprocess,tempfile,tomllib +import time, argparse,json,subprocess,tempfile,tomllib from pathlib import Path from terminal_harness import Terminal @@ -12,17 +12,26 @@ def main(): (state/'preferences.toml').write_text('project='+json.dumps(str(project))+'\n') term=Terminal(binary,state,project,width=a.width,height=a.height) def choose(index):term.send(b'\x1b[B'*index+b'\r') - def settings():term.send(b'\x1b6');term.wait('Preferences');term.send(b'\x1b[A'*30);choose(13);term.wait('Model and runtime settings') + def settings():term.send(b'\x10');term.wait('Command palette');term.send(b'setting: model and runtime');term.wait('▸ Setting: Model and runtime');term.send(b'\r');term.wait('Model and runtime settings') def preferences():return tomllib.loads((state/'preferences.toml').read_text()) + def allocated(test): + end=time.monotonic()+10 + while time.monotonic(), + /// Per-launch key of an Alt-owned runtime. Never saved. + #[serde(skip)] + pub runtime_key: Option, } #[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, clap::ValueEnum)] @@ -79,6 +82,9 @@ impl Profile { } pub fn key(&self) -> Result> { + if let Some(key) = &self.runtime_key { + return Ok(Some(key.clone())); + } self.api_key_env .as_ref() .map(|name| { diff --git a/src/engine.rs b/src/engine.rs index 0262a671..4c5fdf37 100644 --- a/src/engine.rs +++ b/src/engine.rs @@ -175,14 +175,13 @@ impl Engine { // but Ollama 0.35's OpenAI handler only accepts top-level max_tokens. // Use the standard compatible client for chat, retaining native // Ollama inventory/evaluation elsewhere and the exact selected tag. - // Native context remains a server/tag setting, unlike Alt's budget. + // The relay replaces engine options with only the selected + // options.num_ctx (A02) and reads the loaded context from /api/ps. command .env("GOOSE_PROVIDER", "openai") .env("OPENAI_BASE_URL", &relay.endpoint); - ensure!( - profile.api_key_env.is_none(), - "Ollama authentication is not implemented in this slice" - ); + // B03: authenticated Ollama (for example behind a proxy) uses + // the same bearer key the relay already attaches to every call. } } let mut engine = Self::spawn(command).await?; @@ -423,6 +422,15 @@ impl Engine { .context("No active inference relay")? .add_allowance(requests, tokens) } + pub fn set_thinking( + &self, + choice: crate::inference::Thinking, + ) -> Result { + self.relay + .as_ref() + .context("No active inference relay")? + .set_thinking(choice) + } pub fn verification(&self) -> Result> { self.bridge .as_ref() diff --git a/src/extensions.rs b/src/extensions.rs index c46e0045..99daf0f4 100644 --- a/src/extensions.rs +++ b/src/extensions.rs @@ -46,23 +46,38 @@ fn path(root: &Path, name: &str) -> Result { ); Ok(root.join("extensions").join(format!("{name}.json"))) } +/// A bearer token sent over plain HTTP is readable on the network, so plain +/// HTTP with authentication is accepted only for loopback servers. +pub fn check_http(url: &str, authenticated: bool) -> Result<()> { + let u = reqwest::Url::parse(url)?; + ensure!( + matches!(u.scheme(), "http" | "https") + && u.host_str().is_some() + && u.username().is_empty() + && u.password().is_none() + && u.fragment().is_none() + && u.query().is_none(), + "Use an HTTP(S) MCP URL without embedded credentials, query or fragment" + ); + let host = u.host_str().unwrap_or(""); + let loopback = host.eq_ignore_ascii_case("localhost") + || host + .trim_start_matches('[') + .trim_end_matches(']') + .parse::() + .is_ok_and(|ip| ip.is_loopback()); + ensure!( + !authenticated || u.scheme() == "https" || loopback, + "An authentication variable needs an HTTPS URL; plain HTTP with a token is allowed only for localhost/127.0.0.1" + ); + Ok(()) +} pub fn save(root: &Path, c: &Connection) -> Result<()> { match &c.transport { Transport::Stdio { command, .. } => { ensure!(!command.as_os_str().is_empty(), "Provide a server command") } - Transport::Http { url, .. } => { - let u = reqwest::Url::parse(url)?; - ensure!( - matches!(u.scheme(), "http" | "https") - && u.host_str().is_some() - && u.username().is_empty() - && u.password().is_none() - && u.fragment().is_none() - && u.query().is_none(), - "Use an HTTP(S) MCP URL without embedded credentials, query or fragment" - ); - } + Transport::Http { url, auth_env } => check_http(url, auth_env.is_some())?, } ensure!( c.selected_tools.len() <= 16, @@ -176,6 +191,10 @@ impl SseDecoder { } impl Client { async fn connect(c: &Connection) -> Result { + // Recheck saved files written by an older Alt or by hand. + if let Transport::Http { url, auth_env } = &c.transport { + check_http(url, auth_env.is_some())?; + } let mut client = match &c.transport { Transport::Stdio { command, @@ -376,6 +395,17 @@ impl Client { mod sse_tests { use super::*; #[test] + fn plain_http_tokens_only_reach_loopback() { + assert!(check_http("http://127.0.0.1:9000/mcp", true).is_ok()); + assert!(check_http("http://localhost:9000/mcp", true).is_ok()); + assert!(check_http("http://[::1]:9000/mcp", true).is_ok()); + assert!(check_http("https://tools.example.com/mcp", true).is_ok()); + assert!(check_http("http://tools.example.com/mcp", false).is_ok()); + assert!(check_http("http://tools.example.com/mcp", true).is_err()); + assert!(check_http("http://10.0.0.5/mcp", true).is_err()); + assert!(check_http("http://localhost.example.com/mcp", true).is_err()); + } + #[test] fn bounded_seeded_mutation_corpus_never_panics_or_grows_without_limit() { let seed = b"data:{\"id\":7,\"result\":{\"text\":\"hello\"}}\n\n"; let mut random = 0x52414e444f4du64; @@ -431,6 +461,14 @@ mod sse_tests { assert!(decoder.feed(b"\n", 7).unwrap().is_some()); } } +/// One rule for every entry point that starts or contacts an external tool server. +pub fn require_full_access(policy: crate::project::Policy) -> Result<()> { + ensure!( + policy == crate::project::Policy::Trusted, + "Checking an external tool server starts its program or contacts its server; choose Full access (--access trusted) first" + ); + Ok(()) +} pub async fn probe(root: &Path, name: &str) -> Result { let c = load(root, name)?; let mut client = Client::connect(&c).await?; diff --git a/src/hardware.rs b/src/hardware.rs index 3c322c0a..4ef24cd0 100644 --- a/src/hardware.rs +++ b/src/hardware.rs @@ -60,7 +60,7 @@ pub fn artifact_preflight(component: runtime::Component) -> Result<()> { ); let minimum = match component { runtime::Component::Engine => (2, 28), - runtime::Component::Inference => (2, 34), + runtime::Component::Inference | runtime::Component::CudaInference => (2, 34), }; let libc = glibc().context( "These managed GNU binaries need glibc; use a compatible manually installed runtime", @@ -137,7 +137,7 @@ pub async fn evaluate( let runtime = runtime::LocalRuntime::start(root, preferences, profile, cancel.clone(), |_| {}) .await?; - effective.endpoint = runtime.endpoint.clone(); + runtime.attach(&mut effective); local = Some(runtime); } let id = uuid::Uuid::new_v4().to_string(); diff --git a/src/inference.rs b/src/inference.rs index f6e43d0a..9aba3bf1 100644 --- a/src/inference.rs +++ b/src/inference.rs @@ -35,6 +35,218 @@ pub struct Settings { pub max_requests: Option, #[serde(default)] pub output_parameter: OutputParameter, + /// One reasoning choice, translated per server dialect (A01). + #[serde(default)] + pub thinking: Thinking, + /// Which request fields this server understands for reasoning control. + #[serde(default)] + pub dialect: Dialect, + /// A02 open parameters. Each is an explicit choice; unset sends nothing. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub repeat_penalty: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub presence_penalty: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub frequency_penalty: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub seed: Option, + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub stop: Vec, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub typical_p: Option, + /// A JSON object merged into every request last. Keys Alt owns are refused. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub extra_body: Option, + /// Ollama only: `server-default` stops Alt sending `options.num_ctx`. + #[serde(default)] + pub ollama_context: OllamaContext, + /// Ollama only: how long the server keeps the model loaded (`5m`, `-1`, `0`). + #[serde(default, skip_serializing_if = "Option::is_none")] + pub keep_alive: Option, + /// A04: retries for 429, 5xx and dropped connections (0 disables). + #[serde(default = "default_retries")] + pub retries: u32, + /// A04: hold each response and discard degenerate provider output once. + #[serde(default)] + pub output_guard: OutputGuard, +} + +fn default_retries() -> u32 { + 2 +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq, Default, Serialize, Deserialize, clap::ValueEnum)] +#[serde(rename_all = "kebab-case")] +pub enum OutputGuard { + /// On for remote servers, off for this computer (keeps local streaming live). + #[default] + Auto, + On, + Off, +} +impl OutputGuard { + pub fn label(self) -> &'static str { + match self { + Self::Auto => "Automatic (on for remote servers)", + Self::On => "On", + Self::Off => "Off", + } + } +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq, Default, Serialize, Deserialize, clap::ValueEnum)] +#[serde(rename_all = "kebab-case")] +pub enum OllamaContext { + /// Send the profile context as `options.num_ctx`. + #[default] + Profile, + /// Send nothing; the server or model tag decides. + ServerDefault, +} + +/// Request fields Alt owns. `extra_body` may not replace them. +pub const RESERVED_BODY_KEYS: [&str; 9] = [ + "model", + "messages", + "tools", + "tool_choice", + "stream", + "stream_options", + "max_tokens", + "max_completion_tokens", + "n", +]; + +/// `default | off | low | medium | high | budget:N`. Default sends nothing. +#[derive(Debug, Clone, Copy, PartialEq, Eq, Default, Serialize, Deserialize)] +#[serde(try_from = "String", into = "String")] +pub enum Thinking { + #[default] + Default, + Off, + Low, + Medium, + High, + Budget(u32), +} +impl Thinking { + pub const CHOICES: [Self; 5] = [ + Self::Default, + Self::Off, + Self::Low, + Self::Medium, + Self::High, + ]; + pub fn label(self) -> String { + match self { + Self::Default => "Server default".into(), + Self::Off => "Off".into(), + Self::Low => "Low".into(), + Self::Medium => "Medium".into(), + Self::High => "High".into(), + Self::Budget(n) => format!("Budget of {n} tokens"), + } + } + fn effort(self) -> Option<&'static str> { + match self { + Self::Low => Some("low"), + Self::Medium => Some("medium"), + Self::High => Some("high"), + _ => None, + } + } +} +impl std::str::FromStr for Thinking { + type Err = anyhow::Error; + fn from_str(text: &str) -> Result { + let text = text.trim().to_ascii_lowercase(); + Ok(match text.as_str() { + "" | "default" => Self::Default, + "off" | "none" | "false" => Self::Off, + "low" => Self::Low, + "medium" => Self::Medium, + "high" | "on" | "true" => Self::High, + other => Self::Budget( + other + .strip_prefix("budget:") + .or_else(|| other.strip_prefix("budget(")) + .map(|n| n.trim_end_matches(')')) + .unwrap_or(other) + .parse() + .map_err(|_| { + anyhow::anyhow!( + "Thinking must be default, off, low, medium, high or budget:N" + ) + })?, + ), + }) + } +} +impl TryFrom for Thinking { + type Error = anyhow::Error; + fn try_from(text: String) -> Result { + text.parse() + } +} +impl From for String { + fn from(value: Thinking) -> Self { + match value { + Thinking::Budget(n) => format!("budget:{n}"), + other => other.label().to_ascii_lowercase().replace("server ", ""), + } + } +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq, Default, Serialize, Deserialize, clap::ValueEnum)] +#[serde(rename_all = "kebab-case")] +pub enum Dialect { + /// Owned/declared llama.cpp, Ollama by provider, otherwise OpenAI-style. + #[default] + Auto, + LlamaCpp, + Ollama, + /// vLLM, SGLang and NVIDIA NIM: `chat_template_kwargs`. + ChatTemplate, + /// OpenAI-style `reasoning_effort` only. + OpenaiEffort, +} +impl Dialect { + pub const ALL: [Self; 5] = [ + Self::Auto, + Self::LlamaCpp, + Self::Ollama, + Self::ChatTemplate, + Self::OpenaiEffort, + ]; + pub fn label(self) -> &'static str { + match self { + Self::Auto => "Automatic", + Self::LlamaCpp => "llama.cpp", + Self::Ollama => "Ollama", + Self::ChatTemplate => "vLLM / SGLang / NVIDIA NIM", + Self::OpenaiEffort => "OpenAI-style reasoning_effort", + } + } + pub fn fields(self) -> &'static str { + match self { + Self::Auto => "chosen from the connection", + Self::LlamaCpp => "chat_template_kwargs.enable_thinking + reasoning_budget_tokens", + Self::Ollama => "think + reasoning_effort", + Self::ChatTemplate => { + "chat_template_kwargs.enable_thinking/thinking + reasoning_effort" + } + Self::OpenaiEffort => "reasoning_effort", + } + } + pub fn saved_name(self) -> &'static str { + match self { + Self::Auto => "auto", + Self::LlamaCpp => "llama-cpp", + Self::Ollama => "ollama", + Self::ChatTemplate => "chat-template", + Self::OpenaiEffort => "openai-effort", + } + } } #[derive(Debug, Clone, Copy, Default, Serialize, Deserialize, clap::ValueEnum)] #[serde(rename_all = "snake_case")] @@ -58,8 +270,219 @@ impl Settings { total_generated_tokens: None, max_requests: None, output_parameter: OutputParameter::MaxTokens, + thinking: Thinking::Default, + dialect: Dialect::Auto, + repeat_penalty: None, + presence_penalty: None, + frequency_penalty: None, + seed: None, + stop: Vec::new(), + typical_p: None, + extra_body: None, + ollama_context: OllamaContext::Profile, + keep_alive: None, + retries: default_retries(), + output_guard: OutputGuard::Auto, + } + } + /// Whether responses are held and checked before reaching the engine. + pub fn guard_active(&self, p: &Profile) -> bool { + match self.output_guard { + OutputGuard::On => true, + OutputGuard::Off => false, + OutputGuard::Auto => reqwest::Url::parse(&p.endpoint) + .ok() + .and_then(|u| u.host_str().map(str::to_owned)) + .is_some_and(|host| { + let host = host + .trim_start_matches('[') + .trim_end_matches(']') + .to_owned(); + host != "localhost" + && !host + .parse::() + .is_ok_and(|ip| ip.is_loopback()) + }), + } + } + /// Parse and check `extra_body`: a JSON object without Alt-owned keys. + pub fn extra_object(&self) -> Result> { + let Some(text) = self.extra_body.as_deref().filter(|t| !t.trim().is_empty()) else { + return Ok(serde_json::Map::new()); + }; + ensure!( + text.len() <= 16 * 1024, + "Extra request JSON must be at most 16 KiB" + ); + let value: Value = + serde_json::from_str(text).context("Extra request fields must be valid JSON")?; + let object = value + .as_object() + .cloned() + .context("Extra request fields must be a JSON object, for example {\"top_a\":0.1}")?; + for key in object.keys() { + ensure!( + !RESERVED_BODY_KEYS.contains(&key.as_str()), + "Alt owns `{key}` (model, messages, tools, streaming and output-token fields); remove it from the extra request fields" + ); + } + Ok(object) + } + /// Sampling and penalty fields in this server's spelling, or an error naming + /// a choice the server cannot accept. + fn parameter_fields(&self, p: &Profile) -> Result> { + let dialect = self.resolved_dialect(p); + let mut fields = serde_json::Map::new(); + if let Some(v) = self.presence_penalty { + fields.insert("presence_penalty".into(), json!(v)); + } + if let Some(v) = self.frequency_penalty { + fields.insert("frequency_penalty".into(), json!(v)); + } + if let Some(v) = self.seed { + fields.insert("seed".into(), json!(v)); + } + if !self.stop.is_empty() { + fields.insert("stop".into(), json!(self.stop)); + } + if let Some(v) = self.repeat_penalty { + let name = match dialect { + Dialect::LlamaCpp | Dialect::Ollama => "repeat_penalty", + Dialect::ChatTemplate => "repetition_penalty", + _ => anyhow::bail!( + "This server's OpenAI-style API has no repeat penalty; use presence/frequency penalty, pick its dialect, or put the field in extra request JSON" + ), + }; + fields.insert(name.into(), json!(v)); + } + if let Some(v) = self.typical_p { + ensure!( + matches!(dialect, Dialect::LlamaCpp | Dialect::Ollama), + "typical_p is a llama.cpp/Ollama sampler; pick that dialect or use extra request JSON" + ); + fields.insert("typical_p".into(), json!(v)); + } + if p.provider == Provider::Ollama { + if self.ollama_context == OllamaContext::Profile { + fields.insert("options".into(), json!({"num_ctx": p.context_tokens})); + } + if let Some(v) = &self.keep_alive { + fields.insert("keep_alive".into(), json!(v)); + } + } + Ok(fields) + } + pub fn resolved_dialect(&self, p: &Profile) -> Dialect { + match self.dialect { + Dialect::Auto if p.local_model.is_some() || self.llama_extensions => Dialect::LlamaCpp, + Dialect::Auto if p.provider == Provider::Ollama => Dialect::Ollama, + Dialect::Auto => Dialect::OpenaiEffort, + chosen => chosen, } } + /// The legacy thinking budget remains a budget choice on llama.cpp. + pub fn effective_thinking(&self) -> Thinking { + match (self.thinking, self.reasoning_tokens) { + (Thinking::Default, Some(n)) => Thinking::Budget(n), + (choice, _) => choice, + } + } + /// Penalties, seed, stop, Ollama context, then `extra_body` merged last. + pub fn apply_parameters( + &self, + p: &Profile, + obj: &mut serde_json::Map, + ) -> Result<()> { + for key in [ + "presence_penalty", + "frequency_penalty", + "seed", + "stop", + "repeat_penalty", + "repetition_penalty", + "typical_p", + "keep_alive", + "options", + ] { + obj.remove(key); + } + for (key, value) in self.parameter_fields(p)? { + obj.insert(key, value); + } + for (key, value) in self.extra_object()? { + obj.insert(key, value); + } + Ok(()) + } + /// Write the reasoning fields for this dialect into a request and return a + /// record of exactly what was sent, for the receipt. + pub fn apply_thinking( + &self, + p: &Profile, + obj: &mut serde_json::Map, + allowance: u32, + ) -> Value { + for key in [ + "reasoning_budget_tokens", + "reasoning_effort", + "think", + "chat_template_kwargs", + ] { + obj.remove(key); + } + let dialect = self.resolved_dialect(p); + let thinking = self.effective_thinking(); + let room = allowance.saturating_sub(self.action_headroom); + let mut sent = serde_json::Map::new(); + match (dialect, thinking) { + (_, Thinking::Default) => {} + // Older saved budgets keep their exact request shape. + (Dialect::LlamaCpp, Thinking::Budget(n)) if self.thinking == Thinking::Default => { + sent.insert("reasoning_budget_tokens".into(), json!(n.min(room))); + } + (Dialect::LlamaCpp, choice) => { + let budget = match choice { + Thinking::Off => 0, + Thinking::Low => room / 4, + Thinking::Medium => room / 2, + Thinking::Budget(n) => n.min(room), + _ => room, + }; + sent.insert( + "chat_template_kwargs".into(), + json!({"enable_thinking": choice != Thinking::Off}), + ); + sent.insert("reasoning_budget_tokens".into(), json!(budget)); + } + (Dialect::Ollama, choice) => { + sent.insert("think".into(), json!(choice != Thinking::Off)); + sent.insert( + "reasoning_effort".into(), + json!(choice.effort().unwrap_or("none")), + ); + } + (Dialect::ChatTemplate, choice) => { + let on = choice != Thinking::Off; + sent.insert( + "chat_template_kwargs".into(), + json!({"enable_thinking": on, "thinking": on}), + ); + if let Some(effort) = choice.effort() { + sent.insert("reasoning_effort".into(), json!(effort)); + } + } + (_, choice) => { + sent.insert( + "reasoning_effort".into(), + json!(choice.effort().unwrap_or("none")), + ); + } + } + for (key, value) in &sent { + obj.insert(key.clone(), value.clone()); + } + json!({"dialect":dialect.saved_name(),"thinking":String::from(thinking),"fields":sent}) + } pub fn validate(&self, p: &Profile) -> Result<()> { ensure!(self.version == 1, "Unsupported inference settings version"); ensure!( @@ -94,14 +517,62 @@ impl Settings { self.top_k.is_none_or(|n| n >= -1), "top_k must be -1 or greater" ); + for (name, value) in [ + ("presence_penalty", self.presence_penalty), + ("frequency_penalty", self.frequency_penalty), + ] { + ensure!( + value.is_none_or(|n| n.is_finite() && (-2.0..=2.0).contains(&n)), + "{name} must be between -2 and 2" + ); + } + ensure!( + self.repeat_penalty + .is_none_or(|n| n.is_finite() && (0.0..=5.0).contains(&n)), + "repeat penalty must be 0..5 (1 means off)" + ); + ensure!( + self.typical_p + .is_none_or(|n| n.is_finite() && n > 0.0 && n <= 1.0), + "typical_p must be >0 and <=1" + ); + ensure!( + self.stop.len() <= 16 && self.stop.iter().all(|s| !s.is_empty() && s.len() <= 256), + "Use up to 16 non-empty stop sequences of at most 256 bytes" + ); + ensure!( + self.keep_alive.as_deref().is_none_or(|k| { + let k = k.trim(); + !k.is_empty() + && k.len() <= 16 + && k.chars() + .all(|c| c.is_ascii_alphanumeric() || c == '-' || c == '.') + }), + "keep_alive looks like 5m, 1h, 0 or -1" + ); + self.extra_object()?; + self.parameter_fields(p)?; + ensure!(self.retries <= 8, "Use 0–8 provider retries"); ensure!( self.total_generated_tokens.is_none_or(|n| n > 0) && self.max_requests.is_none_or(|n| n > 0), "Shared generation/request allowances must be positive" ); + let dialect = self.resolved_dialect(p); + ensure!( + !matches!(self.effective_thinking(), Thinking::Budget(_)) + || dialect == Dialect::LlamaCpp, + "A thinking token budget needs a llama.cpp server; {} accepts off, low, medium or high", + dialect.label() + ); + ensure!( + !matches!(self.thinking, Thinking::Budget(n) if n > self.output_tokens - self.action_headroom), + "Thinking budget must leave the selected action headroom inside total output" + ); ensure!( p.local_model.is_some() || self.llama_extensions + || dialect == Dialect::LlamaCpp || (self.top_k.is_none() && self.min_p.is_none() && self.reasoning_tokens.is_none()), @@ -141,22 +612,21 @@ impl Settings { obj.insert(name.into(), value); } } - obj.remove("reasoning_budget_tokens"); - if let Some(n) = self.reasoning_tokens { - obj.insert("reasoning_budget_tokens".into(), json!(n)); - } + self.apply_thinking(p, obj, self.output_tokens); + self.apply_parameters(p, obj)?; if obj.get("stream") == Some(&json!(true)) { obj.insert("stream_options".into(), json!({"include_usage":true})); } Ok(()) } pub fn accounting(&self, p: &Profile) -> Value { - json!({"settings":self,"input_allowance":p.context_tokens-self.output_tokens,"total_output_allowance":self.output_tokens,"reasoning_allowance":self.reasoning_tokens,"action_headroom":self.action_headroom,"accounting":"Owned runtime measures the full rendered chat/tools before forwarding when its template/tokenizer endpoints are available. Each receipt records measurement or unknown; server usage is authoritative. External native context is unqualified.","native_context":"Owned runtime configured; external server must be inspected separately","thinking_support":"Budget only affects a supported thinking parser; non-thinking checkpoints do not gain a thinking mode."}) + json!({"settings":self,"input_allowance":p.context_tokens-self.output_tokens,"total_output_allowance":self.output_tokens,"reasoning_allowance":self.reasoning_tokens,"action_headroom":self.action_headroom,"accounting":"Owned runtime measures the full rendered chat/tools before forwarding when its template/tokenizer endpoints are available. Each receipt records measurement or unknown; server usage is authoritative. External native context is unqualified.","native_context":"Owned runtime configured; external server must be inspected separately","thinking_support":"Budget only affects a supported thinking parser; non-thinking checkpoints do not gain a thinking mode.","thinking_control":{"choice":String::from(self.effective_thinking()),"dialect":self.resolved_dialect(p).label(),"fields":self.resolved_dialect(p).fields()},"request_parameters":self.parameter_fields(p).unwrap_or_default(),"extra_body":self.extra_object().unwrap_or_default()}) } } pub struct Relay { pub endpoint: String, + profile: Profile, listener: JoinHandle<()>, pub evidence: PathBuf, live: Live, @@ -165,6 +635,20 @@ pub struct Relay { struct Live { budget: std::sync::Arc>, status: tokio::sync::watch::Sender, + /// Explicit per-connection thinking choice made after a cutoff. + thinking: std::sync::Arc>>, +} +impl Live { + fn settings(&self, p: &Profile) -> Settings { + let mut settings = p.effective_inference(); + if let Some(choice) = *self.thinking.lock().expect("thinking override") { + settings.thinking = choice; + if choice != Thinking::Default { + settings.reasoning_tokens = None; + } + } + settings + } } /// Observed relay activity. Waiting includes server queueing and prompt processing; @@ -179,6 +663,8 @@ pub enum Stage { AllowanceExhausted, InputTooLarge, Interrupted, + /// The response hit the output limit with reasoning only: no answer, no tool call. + ReasoningCutoff, } impl Stage { pub fn label(self) -> &'static str { @@ -190,6 +676,7 @@ impl Stage { Self::AllowanceExhausted => "Model allowance exhausted", Self::InputTooLarge => "Prompt exceeds the input reserve", Self::Interrupted => "Model request interrupted", + Self::ReasoningCutoff => "Output allowance spent on thinking; no answer or tool call", } } } @@ -205,6 +692,19 @@ pub struct Status { pub output_allowance: u32, pub action_headroom: u32, pub reasoning_allowance: Option, + /// Responses on this connection that ended in a reasoning-only cutoff. + #[serde(default)] + pub reasoning_cutoffs: u32, + /// Ollama only: the context the loaded model actually uses, read from + /// `/api/ps` after a response. `None` until measured or when not reported. + #[serde(default)] + pub ollama_context: Option, + /// Provider retries (429, 5xx, dropped connections) on this connection. + #[serde(default)] + pub provider_retries: u32, + /// Degenerate responses discarded as provider faults on this connection. + #[serde(default)] + pub provider_faults: u32, } impl Status { fn new(p: &Profile) -> Self { @@ -220,6 +720,10 @@ impl Status { output_allowance: s.output_tokens, action_headroom: s.action_headroom, reasoning_allowance: s.reasoning_tokens, + reasoning_cutoffs: 0, + ollama_context: None, + provider_retries: 0, + provider_faults: 0, } } } @@ -246,7 +750,11 @@ impl Relay { settings.max_requests.unwrap_or(u32::MAX), ))); let (status, _) = tokio::sync::watch::channel(Status::new(p)); - let live = Live { budget, status }; + let live = Live { + budget, + status, + thinking: Default::default(), + }; let service = live.clone(); let client = reqwest::Client::builder() .redirect(reqwest::redirect::Policy::none()) @@ -270,6 +778,7 @@ impl Relay { }); Ok(Self { endpoint, + profile: p.clone(), listener, evidence, live, @@ -278,6 +787,33 @@ impl Relay { pub fn status(&self) -> Status { self.live.status.borrow().clone() } + /// Change the thinking choice for the rest of this connection, after the + /// user picked it (for example "thinking off" after a cutoff). Recorded as + /// evidence; spent tokens stay charged and no request is sent. + pub fn set_thinking(&self, choice: Thinking) -> Result { + let profile = &self.profile; + let mut next = profile.effective_inference(); + next.thinking = choice; + if choice != Thinking::Default { + next.reasoning_tokens = None; + } + next.validate(profile)?; + crate::config::atomic_write( + &self + .evidence + .join(format!("thinking-{}.json", uuid::Uuid::new_v4())), + &serde_json::to_vec_pretty( + &json!({"schema":1,"thinking":String::from(choice),"dialect":next.resolved_dialect(profile).saved_name(),"scope":"Explicit user choice for this connection; model, provider and spent costs unchanged; no request issued"}), + )?, + )?; + *self.live.thinking.lock().expect("thinking override") = Some(choice); + self.live.status.send_modify(|s| { + if s.stage == Stage::ReasoningCutoff { + s.stage = Stage::Ready; + } + }); + Ok(self.status()) + } /// Adds only a finite, explicitly requested allowance. Existing costs remain /// charged; configuration and model identity are unchanged. pub fn add_allowance(&self, requests: u32, tokens: u32) -> Result { @@ -413,6 +949,58 @@ pub fn response_complete(raw: &[u8], streaming: bool) -> bool { } done && finish } +/// A response that stopped at the output limit after producing reasoning but +/// neither content nor a tool call. Spent tokens stay charged; recovery is the +/// user's choice (thinking off, or a larger allowance), never a silent retry. +pub fn reasoning_cutoff(raw: &[u8], streaming: bool) -> bool { + let mut reasoning = false; + let mut answer = false; + let mut length = false; + let mut observe = |part: &Value, finish: &Value| { + for key in ["reasoning_content", "reasoning", "thinking"] { + reasoning |= part[key].as_str().is_some_and(|t| !t.trim().is_empty()); + } + answer |= part["content"] + .as_str() + .is_some_and(|t| !t.trim().is_empty()) + || part["tool_calls"].as_array().is_some_and(|c| !c.is_empty()); + length |= finish.as_str() == Some("length"); + }; + if streaming { + let text = String::from_utf8_lossy(raw); + for data in text.lines().filter_map(|l| l.strip_prefix("data:")) { + if let Ok(v) = serde_json::from_str::(data.trim()) { + for choice in v["choices"].as_array().into_iter().flatten() { + observe(&choice["delta"], &choice["finish_reason"]); + } + } + } + } else if let Ok(v) = serde_json::from_slice::(raw) { + for choice in v["choices"].as_array().into_iter().flatten() { + observe(&choice["message"], &choice["finish_reason"]); + } + } + length && reasoning && !answer +} +/// Read the loaded context of `model` from Ollama's `/api/ps`. +pub async fn ollama_loaded_context( + client: &reqwest::Client, + p: &Profile, + key: Option<&str>, +) -> Option { + let mut request = client + .get(format!("{}/api/ps", p.endpoint.trim_end_matches('/'))) + .timeout(Duration::from_secs(3)); + if let Some(key) = key { + request = request.bearer_auth(key); + } + let value = bounded_json(request.send().await.ok()?).await.ok()?; + value["models"].as_array()?.iter().find_map(|m| { + (m["name"].as_str() == Some(&p.model) || m["model"].as_str() == Some(&p.model)) + .then(|| m["context_length"].as_u64()) + .flatten() + }) +} pub fn cost(evidence: &Path) -> Result { let mut requests = 0u32; let mut charged = 0u64; @@ -447,6 +1035,7 @@ async fn serve( live: &Live, ) -> Result<()> { let (budget, live_status) = (&live.budget, &live.status); + let settings = live.settings(p); let (reader, mut writer) = stream.into_split(); let mut reader = BufReader::new(reader); let request = tokio::time::timeout(Duration::from_secs(20), async { @@ -491,7 +1080,7 @@ async fn serve( let mut bytes = vec![0; length]; reader.read_exact(&mut bytes).await?; let mut body: Value = serde_json::from_slice(&bytes)?; - p.effective_inference().apply(p, &mut body)?; + settings.apply(p, &mut body)?; Ok::(body) }) .await; @@ -515,15 +1104,21 @@ async fn serve( writer.write_all(&bytes).await?; return Ok(()); } - let allowance = p.effective_inference().output_tokens.min(budget.0); - let token_field = match p.effective_inference().output_parameter { + let allowance = settings.output_tokens.min(budget.0); + let token_field = match settings.output_parameter { OutputParameter::MaxTokens => "max_tokens", OutputParameter::MaxCompletionTokens => "max_completion_tokens", }; body[token_field] = json!(allowance); - if let Some(reasoning) = p.effective_inference().reasoning_tokens { - body["reasoning_budget_tokens"] = - json!(reasoning.min(allowance.saturating_sub(p.effective_inference().action_headroom))); + let thinking_sent = settings.apply_thinking( + p, + body.as_object_mut() + .context("Chat request must be an object")?, + allowance, + ); + // Extra request fields stay last, after the per-call thinking allocation. + for (key, value) in settings.extra_object()? { + body[key] = value; } // Measure the actual allocated body, including any reduced thinking budget. // Input rejection leaves the shared reservation untouched. @@ -538,7 +1133,7 @@ async fn serve( }); if input["tokens"] .as_u64() - .is_some_and(|n| n > (p.context_tokens - p.effective_inference().output_tokens) as u64) + .is_some_and(|n| n > (p.context_tokens - settings.output_tokens) as u64) { live_status.send_modify(|s| s.stage = Stage::InputTooLarge); crate::config::atomic_write( @@ -582,71 +1177,167 @@ async fn serve( Provider::Openai => format!("{}/chat/completions", p.endpoint.trim_end_matches('/')), Provider::Ollama => format!("{}/v1/chat/completions", p.endpoint.trim_end_matches('/')), }; - let mut req = client.post(url).json(&body); - if let Some(key) = key { - req = req.bearer_auth(key); - } - let response = match req.send().await { - Ok(v) => v, - Err(_) => { - writer - .write_all( - b"HTTP/1.1 502 Bad Gateway\r\nContent-Length: 0\r\nConnection: close\r\n\r\n", - ) - .await?; - anyhow::bail!("Selected provider connection failed; inspect the selected endpoint"); + let streaming = body["stream"] == true; + let guarded = settings.guard_active(p); + let mut retry_log: Vec = Vec::new(); + let mut faults: Vec = Vec::new(); + let mut extra_charged: u64 = 0; + // One resend after a discarded degenerate response; retries are separate. + let (status, captured, truncated) = loop { + let response = match send_with_retries( + client, + &url, + &body, + key, + settings.retries, + &mut budget.1, + &mut retry_log, + ) + .await + { + Ok(response) => response, + Err(error) => { + writer + .write_all( + b"HTTP/1.1 502 Bad Gateway\r\nContent-Length: 0\r\nConnection: close\r\n\r\n", + ) + .await?; + crate::config::atomic_write( + &receipt, + &serde_json::to_vec( + &json!({"complete":false,"status":"connection_failed","charged_generated_tokens":allowance,"generated_tokens":null,"allowance":allowance,"input_accounting":input,"retries":retry_log.len(),"retry_log":retry_log,"error":error.to_string()}), + )?, + )?; + anyhow::bail!( + "Selected provider connection failed after {} retr{}; inspect the selected endpoint", + retry_log.len(), + if retry_log.len() == 1 { "y" } else { "ies" } + ); + } + }; + let status = response.status(); + let mut stream = response.bytes_stream(); + let mut captured = Vec::new(); + let mut truncated = false; + if !guarded { + let content = if streaming { + "text/event-stream" + } else { + "application/json" + }; + writer.write_all(format!("HTTP/1.1 {} Provider\r\nContent-Type: {content}\r\nTransfer-Encoding: chunked\r\nConnection: close\r\n\r\n",status.as_u16()).as_bytes()).await?; + let mut raw_file = + tokio::fs::File::create(evidence.join(format!("{id}-response.raw"))).await?; + while let Some(chunk) = stream.next().await { + let chunk = chunk?; + let observed_stage = live_status.borrow().stage; + if !chunk.is_empty() && observed_stage != Stage::ReceivingOutput { + live_status.send_modify(|s| s.stage = Stage::ReceivingOutput); + } + if !truncated && captured.len() + chunk.len() <= 8 * 1024 * 1024 { + captured.extend_from_slice(&chunk); + raw_file.write_all(&chunk).await?; + } else { + truncated = true; + } + writer + .write_all(format!("{:x}\r\n", chunk.len()).as_bytes()) + .await?; + writer.write_all(&chunk).await?; + writer.write_all(b"\r\n").await?; + writer.flush().await?; + } + raw_file.sync_all().await?; + break (status, captured, truncated); } - }; - let status = response.status(); - let content = if body["stream"] == true { - "text/event-stream" - } else { - "application/json" - }; - writer.write_all(format!("HTTP/1.1 {} Provider\r\nContent-Type: {content}\r\nTransfer-Encoding: chunked\r\nConnection: close\r\n\r\n",status.as_u16()).as_bytes()).await?; - let mut stream = response.bytes_stream(); - let mut raw_file = tokio::fs::File::create(evidence.join(format!("{id}-response.raw"))).await?; - let mut captured = Vec::new(); - let mut truncated = false; - while let Some(chunk) = stream.next().await { - let chunk = chunk?; - let observed_stage = live_status.borrow().stage; - if !chunk.is_empty() && observed_stage != Stage::ReceivingOutput { - live_status.send_modify(|s| s.stage = Stage::ReceivingOutput); + // Guarded: hold the whole response, check it, then forward or discard. + while let Some(chunk) = stream.next().await { + let chunk = chunk?; + if live_status.borrow().stage != Stage::ReceivingOutput { + live_status.send_modify(|s| s.stage = Stage::ReceivingOutput); + } + if captured.len() + chunk.len() <= 8 * 1024 * 1024 { + captured.extend_from_slice(&chunk); + } else { + truncated = true; + break; + } } - if !truncated && captured.len() + chunk.len() <= 8 * 1024 * 1024 { - captured.extend_from_slice(&chunk); - raw_file.write_all(&chunk).await?; + let complete = status.is_success() && !truncated && response_complete(&captured, streaming); + let reason = if complete { + degenerate_output(&captured, streaming, &body) } else { - truncated = true; - } - writer - .write_all(format!("{:x}\r\n", chunk.len()).as_bytes()) - .await?; - writer.write_all(&chunk).await?; - writer.write_all(b"\r\n").await?; - writer.flush().await?; - } - raw_file.sync_all().await?; - let usage = if body["stream"] == true { - String::from_utf8_lossy(&captured) - .lines() - .filter_map(|l| l.strip_prefix("data:")) - .filter_map(|s| serde_json::from_str::(s.trim()).ok()) - .filter_map(|v| v.get("usage").filter(|u| u.is_object()).cloned()) - .next_back() + None + }; + let Some(reason) = reason else { + tokio::fs::write(evidence.join(format!("{id}-response.raw")), &captured).await?; + let content = if streaming { + "text/event-stream" + } else { + "application/json" + }; + writer.write_all(format!("HTTP/1.1 {} Provider\r\nContent-Type: {content}\r\nContent-Length: {}\r\nConnection: close\r\n\r\n",status.as_u16(),captured.len()).as_bytes()).await?; + writer.write_all(&captured).await?; + writer.flush().await?; + break (status, captured, truncated); + }; + // Provider fault, never model output: keep the raw bytes as evidence. + let n = faults.len() + 1; + tokio::fs::write(evidence.join(format!("{id}-discarded-{n}.raw")), &captured).await?; + let spent = response_usage(&captured, streaming) + .and_then(|u| u["completion_tokens"].as_u64()) + .unwrap_or(allowance as u64); + extra_charged = extra_charged.saturating_add(spent); + faults.push(json!({"reason":reason,"response_sha256":crate::project::digest(&captured),"charged_generated_tokens":spent})); + live_status.send_modify(|s| s.provider_faults += 1); + if faults.len() >= 2 || budget.1 == 0 { + let message = format!( + "The provider returned malformed output ({reason}){}. Recorded as a provider fault, not model output. Resend your message, lower the temperature, or choose another model or provider.", + if faults.len() >= 2 { " twice" } else { "" } + ); + let bytes = serde_json::to_vec(&json!({"error":{"message":message}}))?; + writer.write_all(format!("HTTP/1.1 502 Bad Gateway\r\nContent-Type: application/json\r\nContent-Length: {}\r\nConnection: close\r\n\r\n",bytes.len()).as_bytes()).await?; + writer.write_all(&bytes).await?; + let charged = (allowance as u64).max(extra_charged); + budget.0 = budget + .0 + .saturating_add(allowance) + .saturating_sub(charged.min(u32::MAX as u64) as u32); + crate::config::atomic_write( + &receipt, + &serde_json::to_vec( + &json!({"complete":false,"status":"provider_fault","charged_generated_tokens":charged,"generated_tokens":null,"allowance":allowance,"input_accounting":input,"retries":retry_log.len(),"retry_log":retry_log,"provider_faults":faults,"thinking":thinking_sent}), + )?, + )?; + live_status.send_modify(|s| { + if s.remaining_requests.is_some() { + s.remaining_requests = Some(budget.1); + } + if s.remaining_generated_tokens.is_some() { + s.remaining_generated_tokens = Some(budget.0); + } + s.stage = Stage::Interrupted; + }); + return Ok(()); + } + // The resend is another model call against the shared allowance. + budget.1 = budget.1.saturating_sub(1); + }; + let usage = response_usage(&captured, streaming); + let complete = status.is_success() && !truncated && response_complete(&captured, streaming); + let cutoff = complete && reasoning_cutoff(&captured, streaming); + let ollama_context = if complete && p.provider == Provider::Ollama { + ollama_loaded_context(client, p, key).await } else { - serde_json::from_slice::(&captured) - .ok() - .and_then(|v| v.get("usage").cloned()) + None }; - let complete = - status.is_success() && !truncated && response_complete(&captured, body["stream"] == true); let generated = usage .as_ref() .and_then(|u| u["completion_tokens"].as_u64()) .filter(|_| complete); - let charged = generated.unwrap_or(allowance as u64); + let charged = generated + .unwrap_or(allowance as u64) + .saturating_add(extra_charged); budget.0 = budget .0 .saturating_add(allowance) @@ -654,7 +1345,7 @@ async fn serve( crate::config::atomic_write( &evidence.join(format!("{id}-receipt.json")), &serde_json::to_vec( - &json!({"complete":complete,"status":status.as_u16(),"input_accounting":input,"response_sha256":crate::project::digest(&captured),"response_truncated":truncated,"request_sha256":crate::project::digest(&serde_json::to_vec(&body)?),"usage":usage,"generated_tokens":generated,"charged_generated_tokens":charged,"allowance":allowance,"provider_budget_violation":charged>allowance as u64}), + &json!({"complete":complete,"status":status.as_u16(),"input_accounting":input,"response_sha256":crate::project::digest(&captured),"response_truncated":truncated,"request_sha256":crate::project::digest(&serde_json::to_vec(&body)?),"usage":usage,"generated_tokens":generated,"charged_generated_tokens":charged,"allowance":allowance,"provider_budget_violation":generated.unwrap_or(0)>allowance as u64,"thinking":thinking_sent,"reasoning_cutoff":cutoff,"ollama_loaded_context":ollama_context,"retries":retry_log.len(),"retry_log":retry_log,"provider_faults":faults,"output_guard":guarded}), )?, )?; live_status.send_modify(|s| { @@ -664,14 +1355,186 @@ async fn serve( if s.remaining_generated_tokens.is_some() { s.remaining_generated_tokens = Some(budget.0); } + if cutoff { + s.reasoning_cutoffs += 1; + } + if ollama_context.is_some() { + s.ollama_context = ollama_context; + } + s.provider_retries += retry_log.len() as u32; s.stage = if !complete { Stage::Interrupted } else if budget.0 == 0 || budget.1 == 0 { Stage::AllowanceExhausted + } else if cutoff { + Stage::ReasoningCutoff } else { Stage::Ready }; }); - writer.write_all(b"0\r\n\r\n").await?; + if !guarded { + writer.write_all(b"0\r\n\r\n").await?; + } Ok(()) } + +fn response_usage(captured: &[u8], streaming: bool) -> Option { + if streaming { + String::from_utf8_lossy(captured) + .lines() + .filter_map(|l| l.strip_prefix("data:")) + .filter_map(|s| serde_json::from_str::(s.trim()).ok()) + .filter_map(|v| v.get("usage").filter(|u| u.is_object()).cloned()) + .next_back() + } else { + serde_json::from_slice::(captured) + .ok() + .and_then(|v| v.get("usage").cloned()) + } +} + +/// Send one request, retrying 429, 5xx and connection failures with capped +/// exponential backoff that honours `Retry-After`. Each retry is another +/// model call against the shared request allowance; retries are logged. +async fn send_with_retries( + client: &reqwest::Client, + url: &str, + body: &Value, + key: Option<&str>, + retries: u32, + remaining_requests: &mut u32, + log: &mut Vec, +) -> Result { + let mut attempt = 0u32; + loop { + let mut request = client.post(url).json(body); + if let Some(key) = key { + request = request.bearer_auth(key); + } + let outcome = request.send().await; + let retryable = match &outcome { + Ok(response) => { + let code = response.status().as_u16(); + code == 429 || (500..600).contains(&code) + } + Err(_) => true, + }; + if !retryable || attempt >= retries || *remaining_requests == 0 { + return Ok(outcome?); + } + let wait = match &outcome { + Ok(response) => retry_after(response.headers()), + Err(_) => None, + } + .unwrap_or_else(|| Duration::from_millis(500u64 << attempt.min(6))) + .min(Duration::from_secs(30)); + log.push(json!({"attempt":attempt+1,"status":outcome.as_ref().map(|r| r.status().as_u16()).ok(),"error":outcome.as_ref().err().map(|e| e.to_string()),"wait_ms":wait.as_millis() as u64})); + drop(outcome); + tokio::time::sleep(wait).await; + attempt += 1; + *remaining_requests = remaining_requests.saturating_sub(1); + } +} + +fn retry_after(headers: &reqwest::header::HeaderMap) -> Option { + headers + .get(reqwest::header::RETRY_AFTER)? + .to_str() + .ok()? + .trim() + .parse::() + .ok() + .map(Duration::from_secs) +} + +/// Text the assistant produced in a complete response (content only). +fn response_text(captured: &[u8], streaming: bool) -> String { + let mut text = String::new(); + if streaming { + for data in String::from_utf8_lossy(captured) + .lines() + .filter_map(|l| l.strip_prefix("data:")) + { + if let Ok(v) = serde_json::from_str::(data.trim()) { + for choice in v["choices"].as_array().into_iter().flatten() { + if let Some(part) = choice["delta"]["content"].as_str() { + text.push_str(part); + } + } + } + } + } else if let Ok(v) = serde_json::from_slice::(captured) { + for choice in v["choices"].as_array().into_iter().flatten() { + if let Some(part) = choice["message"]["content"].as_str() { + text.push_str(part); + } + } + } + text +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +enum Script { + Latin, + Cyrillic, + Greek, + Cjk, + Hangul, + Arabic, + Hebrew, + Indic, + Thai, + Other, +} +fn script(c: char) -> Option