diff --git a/CHANGELOG.md b/CHANGELOG.md index 01441831..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 @@ -44,6 +44,16 @@ 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. +- 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 ### 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/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"); } 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/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`.", }, ]; 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).",