Skip to content

Commit 0306bf0

Browse files
committed
Merge remote-tracking branch 'origin/main' into fix/tui-terminal-readability
2 parents b01d99a + 8e76c90 commit 0306bf0

68 files changed

Lines changed: 11908 additions & 294 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.husky/pre-push‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,7 @@ if (process.versions.bun !== expectedBunVersion) {
1818
}
1919
'
2020
bun typecheck
21+
# altimate_change — #1052 D8: scan pushed content for internal-tracker refs
22+
# (see RULES in the script for the specific patterns). Silent on clean;
23+
# exits 1 on hit. Bypass with SKIP_TRACKER_CHECK=1 for genuine emergencies.
24+
bun script/check-tracker-leaks.ts

‎CHANGELOG.md‎

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,43 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.9.7] - 2026-08-25
9+
10+
Grep/search reliability fix for everyone, a Codex model-picker unblock, and a first, opt-in look at Workspaces — shared project binding with cloud-synced memory.
11+
12+
### Fixed
13+
14+
- **`grep`/`glob` no longer return nothing because of a single bad match.** One oversized, unparseable, or non-UTF-8 ripgrep record — a minified bundle, a source map, a one-line JSON/CSV fixture, anywhere in the searched tree — used to fail the entire search stream and silently discard every match already found in unrelated files. Telemetry showed 74 machines / 83 sessions over 7 days on v0.9.3/v0.9.4. Records are independent of their neighbours, so a bad one is now logged and skipped instead of aborting the rest of the search; the same fix landed in the legacy `/find` parser, and an invalid search pattern now correctly returns HTTP 400 instead of 500. (#1094)
15+
- **ChatGPT Pro/Plus (Codex tier) users can pick `gpt-5.5` and `gpt-5.6`.** Both were live on OpenAI's side already, but the fork's OAuth allowlist hadn't been bumped past `gpt-5.4-mini` — any snapshot model not on the allowlist (and not containing "codex") was silently deleted from the picker before it ever reached you. Fixed; API-tier-only variants (`pro`, `luna`, `sol`, `terra`) stay out until confirmed available on the subscription tier. (#1133, closes #1132)
16+
- **The models.dev catalog cache no longer crashes or poisons itself on a bad response.** A non-JSON or malformed 2xx body is now rejected before it's parsed or cached, instead of throwing mid-load or writing garbage the next run would trust. The unconditional fetch that used to run at module import — the cause of a v0.9.4 CI hang under restricted DNS — is gone; short-lived commands now rely on the bundled snapshot / disk cache rather than a live network call, so models added to models.dev between releases won't show up in short-lived commands until the next release. A narrower hang path can still occur in dev-mode builds without the bundled snapshot (tracked in #1144). (#1085)
17+
18+
### Added
19+
20+
- **Workspaces — pilot, opt-in via `ALTIMATE_WORKSPACE=1`, off by default.** A first look at linking a project to a shared Altimate workspace: a post-scan prompt plus a new `altimate-code link` subcommand to create or bind one, a browser-based setup handoff, and memory blocks that sync to the bound workspace so a team shares context. Nothing about this is visible unless the pilot flag is set — no new prompts, network calls, or CLI surface for anyone not opted in. Binding now explicitly tells you that saved memory blocks sync to the workspace if memory is enabled for it. (#1099, #1100, #1116)
21+
- **`altimate_memory_refresh` tool.** Ask the CLI mid-session to re-fetch workspace memory instead of waiting for a new session — closes a gap where a running session could never pick up a memory block written after it started. `altimate_memory_read` now shows the same workspace-merged view the model actually sees, rather than local content only. (#1123)
22+
23+
### Changed
24+
25+
- **Public-repo hygiene: a pre-push scan for internal tracker references, and a hardened build-staleness guard.** A local pre-push hook scans branch names, commit messages, and diff content for Jira-key-shaped and known internal-hostname references before they can land in the public repo (no CI-side backstop yet — local hook only, tracked in #1141). The staleness guard behind the release smoke test now hashes every embedded build input — workspace packages, `tsconfig.json`, the lockfile — instead of only walking `src/`/`script/` mtimes, closing several ways a binary could go stale without the guard noticing. (#1085)
26+
27+
## [0.9.6] - 2026-08-23
28+
29+
Correctness release: `check --checks {validate,semantic,grade,pii,safety,policy}` and the `altimate-core-*` tools (`migration`, `compare`, `track-lineage`, `query-pii`, `classify-pii`) now tell you the truth. Several previously returned false-clean or wrong output — teams gating CI on `check --fail-on error|warning` may see new failures on unchanged SQL. **These are real findings the tool previously missed, not regressions in your code.** Also fixes a data-hygiene bug where truncated tool-output files were being deleted the moment they were written.
30+
31+
### Changed
32+
33+
- **`check --checks *` now surfaces the findings it was missing — expect newly-failing CI runs.** `altimate-core` upgrade `0.5.1 → 0.7.0` plus a consumer-contract sync catches a class of latent shape-mismatch bugs where the CLI was reading fields the engine no longer emits and rendering false-clean output as a result. Concretely: (a) `check --checks validate` gated on the wrong field and passed every file, now maps `ValidationError.location` and fails closed on engine failure; (b) `check --checks semantic` treated `valid:true` as clean, but `valid` means "plannable" — cartesian products came back "OK" for months, now reads `findings` and never gates on `valid`; (c) `check --checks grade` read fields `evaluate()` doesn't return, so no grade or finding ever surfaced, now reads `overall_grade`/`scores.overall`/`lint.findings` (with nested findings from `validation.errors` + `safety.threats`); (d) `check --checks pii` mapped the column name to the numeric column-position field and printed `[object Object]` for `{ Custom: string }` classifications, now reports the exposing alias and stringifies properly; (e) `check --checks policy` titled on `pass` (engine returns `allowed`), so clean SQL always rendered "VIOLATIONS FOUND", now inverted; (f) `check --checks safety` maps engine `high → error` and `medium → warning` (previously both degraded to `info`), so `--fail-on error|warning` no longer silently passes high-risk SQL injection threats; a new `unbalanced_quote` safety rule ships from the engine. Findings' `rule` field (when set — `lint` findings may omit it if the engine didn't attach one) names the rule in `--format json` output — that's how the safety and policy catalog is discovered in practice. (#1090)
34+
- **`altimate-core-migration` tool no longer renders "SAFE" for destructive migrations.** Previously read a non-existent `risks` field; every migration including `DROP COLUMN` came back safe. Now reads `findings`/`safe`/`overall_risk` (engine `MigrationResult`); never renders SAFE on engine error; counts only non-"safe" findings as risks. (#1090)
35+
- **`altimate-core-compare` tool no longer says "IDENTICAL" for different queries.** Read a non-existent `differences` field; different SQL always compared equal. Now reads the engine's `identical`/`diff_count`/`diffs` shape with an error-gated title. (#1090)
36+
- **`altimate-core-track-lineage` no longer returns "0 edges" for everything.** The tool read `edges` off the top-level result; the engine has always emitted them at `queries[].edges`, so lineage tracking silently produced nothing. Now collects correctly, renders `impact_map`, formats `{table, column}` refs, and renders ERROR instead of "0 edges" when the engine call itself fails. (#1090)
37+
- **`schema.detect_pii` returned zero findings for every scan.** Same shape-mismatch class: the detector read `piiData.findings`, but the engine's `PiiReport` is `{ columns, pii_count, … }`. Both cache and live paths now filter `classification !== "None"` through the shared `piiColumnsFromReport` helper. Malformed `PiiReport` shapes now throw rather than silently yield zero findings. Failed per-column classifications flip `success` to `false` — the schema-detect-pii tool renders "PII Scan: ERROR" with any partial findings attached, instead of a clean "no findings" verdict. (#1090)
38+
- **`altimate-core-{compare,column-lineage,extract-metadata,import-ddl}` no longer crash on the default invocation.** Empty-string dialects now coerce to `undefined` before hitting `Schema.fromDdl`, centralized as `dialectHint()` in `native/engine-coerce.ts` and applied across all 7 dialect-forwarding handlers. (#1090)
39+
40+
### Fixed
41+
42+
- **Truncated tool-output files were being deleted the moment they were written (since 2026-08-14).** `Identifier.create` packs `timestamp * 4096 + counter` into 6 bytes and wraps every ~795 days; the 26th wrap landed 2026-08-14T11:19:55Z. Both truncation cleanups (`tool/truncate.ts` Effect service and `tool/truncation.ts` legacy module — used by bootstrap, bash, prompt) computed a pre-wrap cutoff astronomically larger than every post-wrap file's decoded timestamp, so every truncated tool output written after Aug 14 was garbage-collected on the next cleanup pass. Both cleanups now age files by `mtime` (which doesn't wrap); `stat` failures keep the file (deletion fails safe, so a dangling symlink or transient FS error can't wipe real cached truncations). The Effect-service cleanup now `stat`s through the injected `FSUtil.Service` for consistency with every other operation. Tagged `upstream_fix` — the wrap-prone encoding is upstream OpenCode code. (#1113, closes #1112)
43+
- **Native bridge no longer poisons itself for the process lifetime on a transient NAPI load failure.** The lazy registration hook was nulled *before* the `await fn()` that loads all bridge handler modules; if the altimate-core NAPI binding failed to load mid-sequence (older glibc, unusual arch, permissions), every subsequent `Dispatcher.call` — not just the failing one — threw `No native handler for X` for the rest of the process, and the CLI had to be restarted. Registration is now cached as an in-flight promise: concurrent callers share one attempt, and on failure the cached promise is cleared so subsequent calls can retry. (v0.9.6 review)
44+
845
## [0.9.5] - 2026-08-10
946

1047
Windows `grep` back for the ~16% of Windows users it silently broke since v0.9.2, plus a mid-session YOLO toggle and a welcome panel that stops eating half of narrow terminals.

‎CONTRIBUTING.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ https://github.com/anomalyco/models.dev
3939
bun dev
4040
```
4141

42+
`bun install` sets up the pre-push hook via `husky` — subsequent `git push` runs a bun-version check, `bun typecheck`, and a scan for internal-tracker references. If the tracker scan blocks you legitimately (extremely unlikely on this public repo), bypass with `SKIP_TRACKER_CHECK=1 git push`.
43+
4244
### Running against a different directory
4345

4446
By default, `bun dev` runs Altimate Code in the `packages/opencode` directory. To run it against a different directory or repository:

‎docs/docs/usage/check.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ altimate-code check --fail-on warning
5050
| `semantic` | Semantic validation (cartesian products, wrong JOINs) | Optional | No |
5151
| `grade` | SQL quality grading with recommendations | Optional | No |
5252

53+
Findings usually carry a machine-readable `rule` field (e.g. `unbalanced_quote`, `sql_injection`, `L003`) visible in `--format json` output — see the [Finding Object](#finding-object) schema below. `safety` and `policy` findings always include one; `lint` findings may omit both `rule` and `code` if the engine didn't attach them, so switch on presence rather than assuming.
54+
5355
By default, `lint` and `safety` are enabled. Override with `--checks`:
5456

5557
```bash

‎docs/docs/usage/cli.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ altimate --agent analyst
3939
| `export` | Export session data |
4040
| `import` | Import session data |
4141
| `session` | Session management |
42+
| `link` | Link this project to an Altimate workspace (pilot, requires `ALTIMATE_WORKSPACE=1`) |
4243
| `trace` | List and view session traces (recordings of agent sessions) |
4344
| `github` | GitHub integration |
4445
| `pr` | Pull request tools |

‎packages/core/src/flag/flag.ts‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,23 @@ export const Flag = {
6161
OPENCODE_DB: process.env["OPENCODE_DB"],
6262

6363
OPENCODE_WORKSPACE_ID: process.env["OPENCODE_WORKSPACE_ID"],
64+
// Unrelated to ALTIMATE_WORKSPACE (SaaS project-binding pilot) — this gates upstream's multi-instance/worktree control plane.
6465
OPENCODE_EXPERIMENTAL_WORKSPACES: enabledByExperimental("OPENCODE_EXPERIMENTAL_WORKSPACES"),
6566

67+
// altimate_change start — pilot flag for the Workspaces feature (post-scan prompt +
68+
// altimate link subcommand). Read as a getter so tests and the runtime `--` middleware
69+
// can flip it between plugin activation and command execution.
70+
//
71+
// Opt-in only — deliberately does NOT inherit ``OPENCODE_EXPERIMENTAL`` (as
72+
// ``enabledByExperimental`` would). The pilot ships behind its own explicit
73+
// gate so users already opted into other experimental features don't get
74+
// this one turned on for them. (Kilo cycle 6.)
75+
// Unrelated to OPENCODE_EXPERIMENTAL_WORKSPACES (multi-instance control plane) — this gates the SaaS project-binding pilot.
76+
get ALTIMATE_WORKSPACE() {
77+
return truthy("ALTIMATE_WORKSPACE")
78+
},
79+
// altimate_change end
80+
6681
// Evaluated at access time (not module load) because tests, the CLI, and
6782
// external tooling set these env vars at runtime.
6883
get OPENCODE_DISABLE_PROJECT_CONFIG() {

0 commit comments

Comments
 (0)