Skip to content

Commit 6af88f4

Browse files
sahrizviclaude
andcommitted
release: v0.12.4
- CHANGELOG entry for 0.12.4. - `release-v0.12.4-adversarial.test.ts`: snapshot attribution under traversal and lookalike segments, `snapshotCopyYields` type confusion, skip reasons and displayed skill ids never carrying raw errors or control characters, sync problem boundaries and the announce latch, the `serve` workspace route gate across header combinations, hidden-workspace conflicts, and the review's wording fixes. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018fJ3X7pcGT4R9yzjsJnqsV
1 parent 4abdc21 commit 6af88f4

2 files changed

Lines changed: 306 additions & 0 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,33 @@ 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.12.4] - 2026-09-29
9+
10+
One fix for every TUI user, and a round of workspace-pilot work: the IDE extension can drive `/workspace` and `skill publish` over `serve`, a sync says which skills it skipped, and cached workspace state is scoped to the signed-in account. Everything under **Added** is behind `ALTIMATE_WORKSPACE=1`. **Heads-up for support (pilot):** after upgrading, each project's cached workspace link and synced skills are discarded and fetched again on first use (the cache format changed to carry the account), so the first turn in a linked project re-syncs.
11+
12+
### Added
13+
14+
- **`serve` exposes `/workspace` Refresh and Sync over HTTP**, so the VS Code / Cursor extension's workspace panel can run the same actions as the TUI's `/workspace` menu. The routes answer 409 outside the pilot, and refuse browser-originated requests: any request a browser labels cross-site, any `Origin` on a server without `OPENCODE_SERVER_PASSWORD`, and any other origin when one is set. Pilot only (`ALTIMATE_WORKSPACE=1`). (#1366)
15+
- **`skill publish` from the IDE extension.** `serve` lists which of the project's skills can be published and publishes one to the linked or extension-pinned workspace, with the same rules and refusal wording as the CLI: built-in, personal and workspace-delivered skills are refused, and a near-miss name gets a "did you mean". Pilot only (`ALTIMATE_WORKSPACE=1`). (#1371)
16+
- **A workspace sync says which skills it skipped, and why.** A skill that failed to arrive used to look exactly like a workspace with no skills. The TUI shows a warning, headless `run` prints one line, and `/workspace` → Refresh lists them — at most three by name, with a plain reason ("it is too large for this client", "it could not be saved on this device"); raw errors stay in the log. The same problem is not repeated every turn. An offline check in a project that is linked, or pinned by the IDE extension, now warns instead of passing silently. Pilot only (`ALTIMATE_WORKSPACE=1`). (#1374, #1376)
17+
18+
### Changed
19+
20+
- **Linking asks before uploading memory you saved earlier.** When the TUI finds that a project is already linked on the server, it now asks ("Attach and continue") before backfilling the memory saved on this machine into that workspace; nothing is sent until you choose it. New memory saved in a linked project still goes to its workspace, as before — a project belongs to exactly one workspace. Pilot only (`ALTIMATE_WORKSPACE=1`). (#1373, closes #1372)
21+
- **`/workspace` and `link` are clearer.** The menu adds **Open in browser** and **Switch workspace**, and an unlinked project is offered **Link to a workspace**. When the project is linked to a teammate's private workspace you cannot see, `link` says so instead of reporting a race and sending you round a retry loop. Relinking drops the previous workspace's memory from the session instead of continuing to show it. A skill you wrote in the project always wins over the workspace's copy of the same name, so publishing an update to it is no longer refused. Pilot only (`ALTIMATE_WORKSPACE=1`). (#1373)
22+
- **Outside the pilot, `altimate-code link` and `skill publish` explain themselves.** They print "Workspaces are a pilot feature and are off. Set ALTIMATE_WORKSPACE=1 to use this command." instead of failing with "Failed to change directory to …/link", and the TUI's `--workspace` option is no longer listed in `--help`. (#1373)
23+
24+
### Fixed
25+
26+
- **Returning to a conversation in the TUI kept the model it was using.** Picking a model in one conversation could rewrite the model recorded for the conversation opened before it, so switching back selected the wrong model. Every user, not only the pilot. (#1365, closes #1364)
27+
- **Two Altimate accounts on one machine no longer share workspace state.** The cached project link, the resolver's short-lived caches, and the synced workspace skills were keyed on the tenant only, so after switching to another account on the same tenant, the previous account's link — and its private workspace skills — could be served for up to five minutes. All of it is now keyed on the account, a snapshot another account fetched is withheld from discovery and removed, and anything that cannot be attributed is withheld rather than served. Pilot only (`ALTIMATE_WORKSPACE=1`). (#1377, fixes #1339)
28+
- **Link and re-link messages no longer talk about "bindings" or "pre-checks".** Found in this release's review.
29+
30+
### Known limitations
31+
32+
- Skill discovery now resolves the real path of each skill file it finds (one `realpath` per skill), for every user, to tell a workspace snapshot apart from an ordinary skill; a skill whose path cannot be resolved is left out, as a broken link already was.
33+
- `skill publish` keeps secrets out by file name only (`.env*`, `*.pem`, `credentials.json` and similar); it does not scan contents, so a token inside `config.yaml` is uploaded. Publishing is tenant-wide.
34+
835
## [0.12.3] - 2026-09-23
936

1037
**Heads-up before upgrading (every user):**
Lines changed: 279 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,279 @@
1+
/**
2+
* Adversarial coverage for the v0.12.4 release payload (v0.12.3..HEAD): the workspace pilot's
3+
* `serve` HTTP routes (#1366, #1371), skipped-skill reporting (#1374, #1376), relink / consent /
4+
* pinned skills (#1373), account-scoped binding cache and skill snapshot (#1377), and the TUI
5+
* model-store copy (#1365, covered by its own aliasing test), PLUS this release's review fixes:
6+
*
7+
* - user-facing link / re-link messages no longer say "binding" or "pre-check" (End User persona)
8+
*
9+
* Each PR carries its own behavioural suites (skill-sync, state-account-scope, the route tests,
10+
* skill.test.ts attribution cases). This file targets the pure helpers those PRs introduced with
11+
* hostile inputs: path traversal and lookalike segments against snapshot attribution, type
12+
* confusion against the precedence rule, raw-error leakage into user-facing skip reasons, control
13+
* characters in server-supplied skill ids, and header combinations against the route gate.
14+
*/
15+
import { afterEach, beforeEach, describe, expect, test } from "bun:test"
16+
import path from "path"
17+
import { readFileSync } from "fs"
18+
import {
19+
isWithin,
20+
snapshotCopyYields,
21+
snapshotProjectOf,
22+
} from "../../src/altimate/workspace/snapshot-path"
23+
import {
24+
describeSyncProblems,
25+
displayId,
26+
forgetAnnouncement,
27+
shouldAnnounce,
28+
skipReason,
29+
} from "../../src/altimate/workspace/skill-sync"
30+
import { ConflictError, isHiddenBindingConflict } from "../../src/altimate/workspace/api-client"
31+
import { Server } from "../../src/server/server"
32+
import { WORKSPACE_PILOT_OFF_MESSAGE } from "../../src/cli/cmd/workspace-pilot"
33+
34+
const SNAP = path.join(".altimate-code", "skill", "_workspace")
35+
36+
describe("v0.12.4 adversarial: snapshot attribution by path segments", () => {
37+
test("a traversal out of the snapshot is not attributed to it", () => {
38+
// Resolves to /p/.altimate-code/evil — no `_workspace` segment survives.
39+
expect(snapshotProjectOf(`/p/${SNAP}/../../evil/SKILL.md`)).toBeNull()
40+
})
41+
42+
test("a traversal INTO the snapshot is attributed after resolution", () => {
43+
expect(snapshotProjectOf(`/p/x/../${SNAP}/a/SKILL.md`)).toBe("/p")
44+
})
45+
46+
test("lookalike segments are not a snapshot", () => {
47+
expect(snapshotProjectOf("/p/.altimate-code/skill/_workspace2/a/SKILL.md")).toBeNull()
48+
expect(snapshotProjectOf("/p/.altimate-code-x/skill/_workspace/a/SKILL.md")).toBeNull()
49+
expect(snapshotProjectOf("/p/.altimate-code/skills/_workspace/a/SKILL.md")).toBeNull()
50+
expect(snapshotProjectOf("/p/_workspace/skill/.altimate-code/a/SKILL.md")).toBeNull()
51+
})
52+
53+
test("a project opened at the filesystem root is `/`, not 'no project'", () => {
54+
expect(snapshotProjectOf(`/${SNAP}/a/SKILL.md`)).toBe("/")
55+
})
56+
57+
test("nested snapshots attribute to the outermost project", () => {
58+
expect(snapshotProjectOf(`/p/${SNAP}/q/${SNAP}/a/SKILL.md`)).toBe("/p")
59+
})
60+
61+
test("isWithin refuses a prefix sibling and a parent", () => {
62+
expect(isWithin("/proj", "/proj2/SKILL.md")).toBe(false)
63+
expect(isWithin("/proj", "/")).toBe(false)
64+
expect(isWithin("/proj", "/proj")).toBe(true)
65+
expect(isWithin("/proj", "/proj/a/../b")).toBe(true)
66+
expect(isWithin("/proj", "/proj/../proj2")).toBe(false)
67+
})
68+
})
69+
70+
describe("v0.12.4 adversarial: snapshotCopyYields type confusion", () => {
71+
const match = `/proj/${SNAP}/pub-1/SKILL.md`
72+
73+
test("non-string or relative existing locations never make the workspace copy yield", () => {
74+
for (const existing of [undefined, null, 0, 1, {}, [], true, "builtin:x", "<built-in>", "relative/SKILL.md", ""]) {
75+
expect(snapshotCopyYields(match, existing as unknown, "/proj")).toBe(false)
76+
}
77+
})
78+
79+
test("no project root means no protection", () => {
80+
expect(snapshotCopyYields(match, "/proj/.claude/skills/x/SKILL.md", undefined)).toBe(false)
81+
expect(snapshotCopyYields(match, "/proj/.claude/skills/x/SKILL.md", "")).toBe(false)
82+
})
83+
84+
test("only a project skill inside the root wins over the workspace copy", () => {
85+
expect(snapshotCopyYields(match, "/proj/.claude/skills/x/SKILL.md", "/proj")).toBe(true)
86+
expect(snapshotCopyYields(match, "/proj2/.claude/skills/x/SKILL.md", "/proj")).toBe(false)
87+
expect(snapshotCopyYields(match, "/home/me/.claude/skills/x/SKILL.md", "/proj")).toBe(false)
88+
// Another snapshot entry is not the user's own skill.
89+
expect(snapshotCopyYields(match, `/proj/${SNAP}/pub-2/SKILL.md`, "/proj")).toBe(false)
90+
})
91+
92+
test("a non-snapshot match never yields, whatever it collides with", () => {
93+
expect(snapshotCopyYields("/proj/.claude/skills/y/SKILL.md", "/proj/.claude/skills/x/SKILL.md", "/proj")).toBe(false)
94+
})
95+
})
96+
97+
describe("v0.12.4 adversarial: skip reasons never carry the raw error", () => {
98+
test("non-Error inputs fall back to the generic reason", () => {
99+
for (const err of [undefined, null, "size mismatch", 42, {}, [], Symbol("x")]) {
100+
expect(skipReason(err)).toBe("it could not be downloaded")
101+
}
102+
})
103+
104+
test("paths and URLs in the message are not echoed", () => {
105+
const reason = skipReason(new Error("size mismatch for /Users/alice/.secrets/token at https://api.example.com/x"))
106+
expect(reason).toBe("its file size could not be verified")
107+
expect(reason).not.toContain("/Users")
108+
expect(reason).not.toContain("https://")
109+
})
110+
111+
test("local write failures are attributed to the device, network codes are not", () => {
112+
for (const code of ["ENOSPC", "EDQUOT", "EACCES", "EPERM", "EROFS"]) {
113+
expect(skipReason(Object.assign(new Error("x"), { code }))).toBe("it could not be saved on this device")
114+
}
115+
for (const code of ["ECONNRESET", "ETIMEDOUT", "__proto__", "constructor", "toString"]) {
116+
expect(skipReason(Object.assign(new Error("x"), { code }))).toBe("it could not be downloaded")
117+
}
118+
})
119+
120+
test("a message that merely CONTAINS a known prefix is not mapped", () => {
121+
expect(skipReason(new Error("server said: size mismatch"))).toBe("it could not be downloaded")
122+
})
123+
})
124+
125+
describe("v0.12.4 adversarial: server-supplied skill ids are sanitised for display", () => {
126+
test("control characters and line separators are stripped", () => {
127+
expect(displayId("pub\u0000-1\n\r\t\u001b[31m")).toBe("pub-1[31m")
128+
expect(displayId("a
b
c\u0085d")).toBe("abcd")
129+
})
130+
131+
test("an id that is empty after cleaning gets a placeholder", () => {
132+
expect(displayId("")).toBe("(unnamed skill)")
133+
expect(displayId("\u0000\n
")).toBe("(unnamed skill)")
134+
})
135+
136+
test("the 64-character boundary", () => {
137+
expect(displayId("a".repeat(64))).toBe("a".repeat(64))
138+
const long = displayId("a".repeat(65))
139+
expect(long.length).toBe(64)
140+
expect(long.endsWith("…")).toBe(true)
141+
})
142+
})
143+
144+
describe("v0.12.4 adversarial: describeSyncProblems boundaries", () => {
145+
const skipped = (n: number) => Array.from({ length: n }, (_, i) => ({ skill: `s${i}`, reason: "r" }))
146+
147+
test("nothing skipped and no error is not a problem", () => {
148+
expect(describeSyncProblems({ changed: false, skipped: [] })).toBeNull()
149+
})
150+
151+
test("an error alone is reported as the run failing", () => {
152+
expect(describeSyncProblems({ changed: false, skipped: [], error: "offline" })).toEqual({
153+
title: "Workspace skills not synced",
154+
message: "offline",
155+
})
156+
})
157+
158+
test("singular, exactly three, and more than three", () => {
159+
expect(describeSyncProblems({ changed: false, skipped: skipped(1) })!.title).toBe("1 workspace skill skipped")
160+
const three = describeSyncProblems({ changed: false, skipped: skipped(3) })!
161+
expect(three.message.split("\n")).toHaveLength(3)
162+
expect(three.message).not.toContain("more")
163+
const five = describeSyncProblems({ changed: false, skipped: skipped(5) })!
164+
expect(five.title).toBe("5 workspace skills skipped")
165+
expect(five.message.split("\n")).toEqual(["s0: r", "s1: r", "s2: r", "…and 2 more"])
166+
})
167+
168+
test("a run error is appended after the skipped list, not instead of it", () => {
169+
const p = describeSyncProblems({ changed: false, skipped: skipped(1), error: "publish failed" })!
170+
expect(p.message.split("\n")).toEqual(["s0: r", "publish failed"])
171+
})
172+
})
173+
174+
describe("v0.12.4 adversarial: the announce latch", () => {
175+
const problem = { title: "t", message: "m" }
176+
177+
test("the same problem is announced once per directory, keyed on the resolved path", () => {
178+
const dir = `/tmp/v0124-latch-${process.pid}-a`
179+
expect(shouldAnnounce(dir, problem)).toBe(true)
180+
expect(shouldAnnounce(`${dir}/./`, problem)).toBe(false)
181+
expect(shouldAnnounce(dir, { title: "t", message: "m2" })).toBe(true)
182+
})
183+
184+
test("a clean run clears the latch so a recurrence is announced again", () => {
185+
const dir = `/tmp/v0124-latch-${process.pid}-b`
186+
expect(shouldAnnounce(dir, problem)).toBe(true)
187+
expect(shouldAnnounce(dir, null)).toBe(false)
188+
expect(shouldAnnounce(dir, problem)).toBe(true)
189+
})
190+
191+
test("forgetting a stale problem does not drop a newer one", () => {
192+
const dir = `/tmp/v0124-latch-${process.pid}-c`
193+
const newer = { title: "t", message: "newer" }
194+
expect(shouldAnnounce(dir, problem)).toBe(true)
195+
expect(shouldAnnounce(dir, newer)).toBe(true)
196+
forgetAnnouncement(dir, problem)
197+
expect(shouldAnnounce(dir, newer)).toBe(false)
198+
forgetAnnouncement(dir, newer)
199+
expect(shouldAnnounce(dir, newer)).toBe(true)
200+
})
201+
})
202+
203+
describe("v0.12.4 adversarial: workspace route gate", () => {
204+
const original = process.env.ALTIMATE_WORKSPACE
205+
beforeEach(() => {
206+
process.env.ALTIMATE_WORKSPACE = "1"
207+
})
208+
afterEach(() => {
209+
if (original === undefined) delete process.env.ALTIMATE_WORKSPACE
210+
else process.env.ALTIMATE_WORKSPACE = original
211+
})
212+
213+
test("outside the pilot every request is a 409, whatever its headers", () => {
214+
delete process.env.ALTIMATE_WORKSPACE
215+
for (const [origin, fetchSite] of [
216+
[undefined, undefined],
217+
["http://127.0.0.1:4096", "same-origin"],
218+
["https://evil.example", "cross-site"],
219+
] as const) {
220+
expect(Server.workspaceRouteRefusal(origin, "127.0.0.1:4096", "pw", fetchSite)?.status).toBe(409)
221+
}
222+
})
223+
224+
test("a browser-labelled cross-site request is refused even with a password and matching origin", () => {
225+
for (const fetchSite of ["cross-site", "same-site", "Same-Origin", "NONE", " same-origin"]) {
226+
expect(Server.workspaceRouteRefusal("http://127.0.0.1:4096", "127.0.0.1:4096", "pw", fetchSite)?.status).toBe(403)
227+
}
228+
})
229+
230+
test("an origin on an unsecured server is refused; a native client is not", () => {
231+
expect(Server.workspaceRouteRefusal("http://127.0.0.1:4096", "127.0.0.1:4096", undefined)?.status).toBe(403)
232+
expect(Server.workspaceRouteRefusal("http://127.0.0.1:4096", "127.0.0.1:4096", "")?.status).toBe(403)
233+
expect(Server.workspaceRouteRefusal(undefined, "127.0.0.1:4096", undefined)).toBeUndefined()
234+
})
235+
236+
test("with a password, malformed and lookalike origins are refused", () => {
237+
for (const origin of ["null", "not a url", "http://127.0.0.1:4096.evil.example", "http://127.0.0.1:40960", "http://localhost:4096"]) {
238+
expect(Server.workspaceRouteRefusal(origin, "127.0.0.1:4096", "pw")?.status).toBe(403)
239+
}
240+
expect(Server.workspaceRouteRefusal("http://127.0.0.1:4096", undefined, "pw")?.status).toBe(403)
241+
})
242+
})
243+
244+
describe("v0.12.4 adversarial: hidden-workspace conflicts", () => {
245+
test("only a ConflictError naming an id and withholding the name is a hidden workspace", () => {
246+
const conflict = (detail: Record<string, unknown>) => new ConflictError(detail as never)
247+
expect(isHiddenBindingConflict(conflict({ message: "x", existing_datamate_id: 7 }))).toBe(true)
248+
expect(isHiddenBindingConflict(conflict({ message: "x", existing_datamate_id: 7, existing_datamate_name: "Growth" }))).toBe(false)
249+
expect(isHiddenBindingConflict(conflict({ message: "x", existing_datamate_id: "7" }))).toBe(false)
250+
expect(isHiddenBindingConflict(conflict({ message: "x" }))).toBe(false)
251+
for (const err of [undefined, null, new Error("409"), { detail: { existing_datamate_id: 7 } }, "conflict"]) {
252+
expect(isHiddenBindingConflict(err)).toBe(false)
253+
}
254+
})
255+
})
256+
257+
describe("v0.12.4 adversarial: user-facing wording (release review fixes)", () => {
258+
const src = (p: string) => readFileSync(path.resolve(import.meta.dir, "..", "..", "src", p), "utf-8")
259+
260+
test("link and re-link messages speak of links, not bindings or pre-checks", () => {
261+
const link = src("cli/cmd/link.ts")
262+
const tui = src("plugin/tui/altimate/workspace.tsx")
263+
for (const stale of [
264+
"Pre-check missed an existing binding",
265+
"No existing binding to re-link",
266+
"No existing binding for this remote to re-link",
267+
"pre-check skipped",
268+
]) {
269+
expect(link).not.toContain(stale)
270+
expect(tui).not.toContain(stale)
271+
}
272+
expect(link).toContain("This project is already linked to a workspace — re-linking it instead.")
273+
expect(tui).toContain("Could not reach the Altimate workspace service to check for an existing link.")
274+
})
275+
276+
test("the pilot-off message tells the user exactly how to opt in", () => {
277+
expect(WORKSPACE_PILOT_OFF_MESSAGE).toContain("ALTIMATE_WORKSPACE=1")
278+
})
279+
})

0 commit comments

Comments
 (0)