From 9d120af129be9398cbbdcef66b62662050169b8b Mon Sep 17 00:00:00 2001 From: Andrei Hasna Date: Sat, 8 Aug 2026 01:11:41 +0300 Subject: [PATCH 1/2] chore(release): prepare instructions 0.4.23 Bumps package.json 0.4.22 -> 0.4.23 so that 340aecac (#69) can be tagged and published. That commit gives managed session-render outputs their own size bound, stopping the renderer writing an instruction home larger than it will later agree to read. The concrete artefact waiting on this release is station01's codex home: $HOME/.codex/AGENTS.md is 273,860 bytes, generated 2026-08-07T14:47:43Z, four sources behind the claude home's 44. It sits above the 256 KiB read cap and no published version can repair it. Version bump and changelog entry only; no source change. Agent: Silvanus --- CHANGELOG.md | 22 ++++++++++++++++++++++ package.json | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) 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", From dd86538394a1be7296bf1280dc9edbc1c604cc79 Mon Sep 17 00:00:00 2001 From: Andrei Hasna Date: Sat, 8 Aug 2026 01:21:47 +0300 Subject: [PATCH 2/2] test: isolate CLI tests from cloud environment Agent: Agathon --- src/cli/output.test.ts | 4 ++-- src/cli/session.test.ts | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) 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",