diff --git a/CHANGELOG.md b/CHANGELOG.md index 2dae2cc..fdfebe8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,27 @@ # Changelog +## 0.4.23 + +Publishes `340aecac` (#69): the renderer no longer writes a managed instruction +home larger than it will later agree to read. + +The writer was unbounded at `apply.ts:161` while the reader capped every +observation at 256 KiB via `readUtf8RegularFile`, so a flattening adapter could +emit a home it could not subsequently open — wedging its own next run. Only +flattening adapters were affected; splitting homes distribute the identical +payload across separate files and never approach the bound. + +Two bounds are now named instead of one constant repeated in three places: +`FOREIGN_INPUT_MAX_BYTES` (256 KiB, unchanged, for input this tool did not +author) and `SESSION_MANAGED_OUTPUT_MAX_BYTES` for files it does author, with +`managedObservationMaxBytes()` as the single decision point. The fragment read +keeps its 4 KiB bound and the cache its 32 KiB. + +Concretely, this release is what the codex home is waiting on: station01's +`$HOME/.codex/AGENTS.md` is 273,860 bytes, generated 2026-08-07T14:47:43Z, and +is four sources behind the claude home's 44. It sits above the 256 KiB read cap +and no published version can repair it. + ## 0.4.22 Ships the managed Bash-profile fix from issue #65 and task diff --git a/package.json b/package.json index b89c0c2..3015b86 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@hasna/instructions", - "version": "0.4.22", + "version": "0.4.23", "description": "AI coding agent instruction & configuration manager \u2014 store, version, apply, and share all your AI coding configs. CLI + MCP + HTTP API (instructions-serve) + generated SDK + Dashboard.", "type": "module", "main": "dist/index.js", diff --git a/src/cli/output.test.ts b/src/cli/output.test.ts index 3daa439..5d10339 100644 --- a/src/cli/output.test.ts +++ b/src/cli/output.test.ts @@ -33,7 +33,7 @@ function seedConfigs(count: number): { home: string; dbPath: string } { const dbPath = join(home, "configs.db"); process.env["HASNA_INSTRUCTIONS_DB_PATH"] = dbPath; resetDatabase(); - const db = getDatabase(); + const db = getDatabase(dbPath); for (let i = 1; i <= count; i++) { createConfig({ name: `Very Long Agent Config ${String(i).padStart(2, "0")}`, @@ -101,7 +101,7 @@ describe("configs apply ownership output", () => { const dbPath = join(home, "configs.db"); process.env["HASNA_INSTRUCTIONS_DB_PATH"] = dbPath; resetDatabase(); - const db = getDatabase(); + const db = getDatabase(dbPath); const claude = createConfig({ name: "Claude Legacy Writer", category: "rules", diff --git a/src/cli/session.test.ts b/src/cli/session.test.ts index 565b18e..d6acf5c 100644 --- a/src/cli/session.test.ts +++ b/src/cli/session.test.ts @@ -14,6 +14,8 @@ function runCli(args: string[], env: Record = {}) { encoding: "utf8", env: { ...process.env, + HASNA_INSTRUCTIONS_API_URL: "", + HASNA_INSTRUCTIONS_API_KEY: "", ...env, NO_COLOR: "1", FORCE_COLOR: "0",