From a4f0d00d0d322f3c883d056aa818084ace7eae50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=BE=E5=B1=B1=E8=B2=B4=E8=87=B3?= Date: Mon, 8 Jun 2026 08:57:25 +0900 Subject: [PATCH 1/3] fix(cli): reject combining --session with --all on import `basou import claude-code` and `basou import codex` accept `--session ` to import one transcript and `--all` to import every transcript. The selector guard only rejected passing neither; passing both slipped through and silently took the `--session` path, ignoring `--all`. That is a quiet surprise -- the caller asked for two contradictory things and got one without warning. Reject the combination explicitly so the selector is always unambiguous, and cover both adapters with a test for the both-given case. Co-Authored-By: Claude Opus 4.8 (1M context) --- CHANGELOG.md | 7 +++++++ packages/cli/src/commands/import.test.ts | 20 ++++++++++++++++++++ packages/cli/src/commands/import.ts | 3 +++ 3 files changed, 30 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 01441831..814af50a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,6 +44,13 @@ All notable changes to **basou** are recorded here. The project follows - `basou init --source-root ` (repeatable) seeds `import.source_roots` for a new workspace, normalizing each value to a repo-root-relative path. +### Fixed + +- `basou import claude-code` and `basou import codex` now reject `--session` + and `--all` together instead of silently honouring `--session` and ignoring + `--all`. The selector must be unambiguous: import exactly one transcript or + every one, never both at once. + ## 0.6.0 — 2026-06-05 ### Added diff --git a/packages/cli/src/commands/import.test.ts b/packages/cli/src/commands/import.test.ts index e05a719c..16835d83 100644 --- a/packages/cli/src/commands/import.test.ts +++ b/packages/cli/src/commands/import.test.ts @@ -238,6 +238,16 @@ describe("basou import claude-code", () => { ).rejects.toThrow("Specify --session or --all"); }); + it("rejects --session combined with --all", async () => { + const repo = await setupInitedRepo(); + await expect( + doRunImportClaudeCode( + { session: "any-id", all: true }, + { cwd: repo, claudeProjectsDir: getProjectsRoot() }, + ), + ).rejects.toThrow("Specify either --session or --all, not both"); + }); + it("errors when the project's transcript directory is absent", async () => { const repo = await setupInitedRepo(); await expect( @@ -452,6 +462,16 @@ describe("basou import codex", () => { ).rejects.toThrow("Specify --session or --all"); }); + it("rejects --session combined with --all", async () => { + const repo = await setupInitedRepo(); + await expect( + doRunImportCodex( + { session: "any-id", all: true }, + { cwd: repo, codexSessionsDir: getCodexRoot() }, + ), + ).rejects.toThrow("Specify either --session or --all, not both"); + }); + it("errors when the Codex sessions directory is absent", async () => { const repo = await setupInitedRepo(); await expect( diff --git a/packages/cli/src/commands/import.ts b/packages/cli/src/commands/import.ts index 8744ea42..1b3a5088 100644 --- a/packages/cli/src/commands/import.ts +++ b/packages/cli/src/commands/import.ts @@ -256,6 +256,9 @@ export async function doRunImportCodex( } function assertSelector(options: ImportOptions): void { + if (options.session !== undefined && options.all === true) { + throw new Error("Specify either --session or --all, not both"); + } if (options.session === undefined && options.all !== true) { throw new Error("Specify --session or --all"); } From 6a336589fcd9a2af175e59930bb0cb16586fe865 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=BE=E5=B1=B1=E8=B2=B4=E8=87=B3?= Date: Mon, 8 Jun 2026 09:03:25 +0900 Subject: [PATCH 2/3] fix(core): drop unimplemented session export from session-import schema The `session-import` JSON Schema description claimed the payload was "produced by `basou session export`". No such command exists -- the CLI ships `basou session import` but never an `export` counterpart -- so the reference was misleading to anyone reading the published schema at basou.dev/schemas/. Trim the description to the consumer that actually exists and regenerate the committed artifact. Co-Authored-By: Claude Opus 4.8 (1M context) --- CHANGELOG.md | 3 +++ packages/core/schemas/session-import.schema.json | 2 +- packages/core/src/schemas/json-schema.ts | 3 +-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 814af50a..a5e6e523 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -50,6 +50,9 @@ All notable changes to **basou** are recorded here. The project follows and `--all` together instead of silently honouring `--session` and ignoring `--all`. The selector must be unambiguous: import exactly one transcript or every one, never both at once. +- The published `session-import` JSON Schema description no longer mentions a + `basou session export` command, which does not exist. It now documents only + `basou session import` as the consumer of the payload. ## 0.6.0 — 2026-06-05 diff --git a/packages/core/schemas/session-import.schema.json b/packages/core/schemas/session-import.schema.json index f0cf93ae..7941f6a8 100644 --- a/packages/core/schemas/session-import.schema.json +++ b/packages/core/schemas/session-import.schema.json @@ -2,7 +2,7 @@ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://basou.dev/schemas/0.1.0/session-import.schema.json", "title": "Basou Session Import Payload", - "description": "The portable session payload consumed by `basou session import` (and produced by `basou session export`).", + "description": "The portable session payload consumed by `basou session import`.", "type": "object", "properties": { "schema_version": { diff --git a/packages/core/src/schemas/json-schema.ts b/packages/core/src/schemas/json-schema.ts index 565e251d..47852c09 100644 --- a/packages/core/src/schemas/json-schema.ts +++ b/packages/core/src/schemas/json-schema.ts @@ -80,8 +80,7 @@ const DOCUMENTS: ReadonlyArray<{ name: "session-import", schema: SessionImportPayloadSchema, title: "Basou Session Import Payload", - description: - "The portable session payload consumed by `basou session import` (and produced by `basou session export`).", + description: "The portable session payload consumed by `basou session import`.", }, ]; From e875e8f707979e79fe4e71c72a32de36c4c4cda8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=BE=E5=B1=B1=E8=B2=B4=E8=87=B3?= Date: Mon, 8 Jun 2026 09:46:58 +0900 Subject: [PATCH 3/3] basou: Release v0.7.0 (multi-root capture and refresh --watch) Promote the Unreleased section to 0.7.0 and bump @basou/core, @basou/cli, @basou/sdk, and the bare `basou` installer to 0.7.0 in lockstep. Headline changes since 0.6.0: - Multi-root capture: one .basou/ workspace can aggregate the native logs of several sibling repositories via a repeatable --project flag and a manifest import.source_roots list. - `basou refresh --watch`: keep the workspace current automatically by polling the native-log stores and re-importing only settled, changed sessions. - Fixes: reject --session combined with --all on import; drop a reference to a nonexistent `basou session export` from the session-import JSON Schema. pnpm-lock.yaml is unchanged because internal deps use workspace:*. Tag push and npm publish are maintainer actions handled after merge. Co-Authored-By: Claude Opus 4.8 (1M context) --- CHANGELOG.md | 2 +- packages/basou/package.json | 2 +- packages/cli/package.json | 2 +- packages/core/package.json | 2 +- packages/sdk/package.json | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a5e6e523..c51cf363 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ All notable changes to **basou** are recorded here. The project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html) starting with v0.1.0. -## Unreleased +## 0.7.0 — 2026-06-08 ### Added diff --git a/packages/basou/package.json b/packages/basou/package.json index 2b4b383e..7caf3399 100644 --- a/packages/basou/package.json +++ b/packages/basou/package.json @@ -1,6 +1,6 @@ { "name": "basou", - "version": "0.6.0", + "version": "0.7.0", "type": "module", "license": "Apache-2.0", "description": "Convenience installer for the @basou/cli command. `npm install -g basou` exposes the same `basou` binary as `npm install -g @basou/cli`.", diff --git a/packages/cli/package.json b/packages/cli/package.json index e5a95994..d50a748d 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@basou/cli", - "version": "0.6.0", + "version": "0.7.0", "type": "module", "license": "Apache-2.0", "description": "basou command-line tool", diff --git a/packages/core/package.json b/packages/core/package.json index db583870..a4bbc4fc 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@basou/core", - "version": "0.6.0", + "version": "0.7.0", "type": "module", "license": "Apache-2.0", "description": "Core primitives for Basou: sessions, events, approvals, git capability", diff --git a/packages/sdk/package.json b/packages/sdk/package.json index d4f17a27..4e685bc6 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@basou/sdk", - "version": "0.6.0", + "version": "0.7.0", "type": "module", "license": "Apache-2.0", "description": "Read-only SDK for Basou: a stable, ergonomic API to read a workspace's provenance (sessions, events, tasks, approvals, stats).",