Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 8 additions & 27 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions docs/decisions/claude-code-runtime.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ next to it.
`@schlessera/brain-backend-claude` at `^0.3.241`
(`"@anthropic-ai/claude-agent-sdk"`,
`packages/ui-backend-claude/package.json:49`), resolved by this repo's
lockfile (`"@anthropic-ai/claude-agent-sdk": [`, `bun.lock:504`): 0.3.278 when
lockfile (`"@anthropic-ai/claude-agent-sdk": [`, `bun.lock:503`): 0.3.278 when
this record was written, 0.3.280 from 0.37.0, 0.3.283 from 0.38.0.
The binary at `CLAUDE_CODE_PATH` is whatever the host put there.

Expand All @@ -87,13 +87,13 @@ than recalled:
(`node_modules/@anthropic-ai/claude-agent-sdk/sdk.d.ts:1887-1889`).
- The built-in executable is a real Claude Code release, shipped as per-platform
optional dependencies pinned to the SDK's exact version
(`optionalDependencies`, `bun.lock:504`, eight
(`optionalDependencies`, `bun.lock:503`, eight
`claude-agent-sdk-<os>-<arch>[-musl]@0.3.278` entries), each with an integrity
hash in the lockfile
(`"@anthropic-ai/claude-agent-sdk/@anthropic-ai/claude-agent-sdk-linux-x64": [`,
`bun.lock:2588`). The public SDK's platform package is nested because the
private development-only hygiene research alias retains its original292 pair;
the public backend still resolves293. The SDK carries a manifest naming the release and a checksum
(`"@anthropic-ai/claude-agent-sdk-linux-x64": [`,
`bun.lock:513`). The platform packages are hoisted again now that the
development-only hygiene research alias and its 0.3.292 pair are gone
(#2509). The SDK carries a manifest naming the release and a checksum
per platform (`node_modules/@anthropic-ai/claude-agent-sdk/manifest.json`:
`"version": "2.1.278"`, `linux-x64` checksum `5c47359…`).
- It is byte-identical to the standalone release. `sha256sum` of the SDK's
Expand Down
11 changes: 8 additions & 3 deletions experiments/fixtures/runtime-placement-probe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
import assert from "node:assert/strict";
import { copyFileSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
import { tmpdir } from "node:os";
import { dirname, join, resolve } from "node:path";
import { createRequire } from "node:module";
import { join, resolve } from "node:path";
import { captureSurface } from "../../scripts/capture-turn-surface.js";
import { observedSkills } from "../../scripts/turn-surface-skills.js";

Expand All @@ -11,15 +12,19 @@ assert.deepEqual(networkInterfaces, ["lo"], "OWNED_CLAUDE_REQUIRES_OFFLINE_NAMES
const root = resolve(import.meta.dir, "../../tmp"); mkdirSync(root, { recursive: true });
const outside = mkdtempSync(join(root, "odysseus-cli-placement-"));
const inside = mkdtempSync(join(tmpdir(), "odysseus-cli-placement-"));
const sdk = dirname(Bun.resolveSync("@anthropic-ai/claude-agent-sdk", join(import.meta.dir, "../../packages/ui-backend-claude/src")));
const installed = join(sdk, `node_modules/@anthropic-ai/claude-agent-sdk-linux-${process.arch}/claude`);
// Resolve the platform binary from the SDK entry, as the SDK itself does, so
// nested and hoisted layouts both find the package the SDK would launch.
const sdkRequire = createRequire(Bun.resolveSync("@anthropic-ai/claude-agent-sdk", join(import.meta.dir, "../../packages/ui-backend-claude/src")));
const installed = sdkRequire.resolve(`@anthropic-ai/claude-agent-sdk-linux-${process.arch}/claude`);
const manifest = JSON.parse(readFileSync(sdkRequire.resolve("./manifest.json"), "utf8"));
try {
const paths = [outside, inside].map(root => {
writeFileSync(join(root, "package.json"), '{"name":"odysseus-owned-cli-control"}\n');
const path = join(root, "claude"); copyFileSync(installed, path); return path;
});
const digest = (path: string) => new Bun.CryptoHasher("sha256").update(readFileSync(path)).digest("hex");
const installedDigest = digest(installed), runtimeDigests = paths.map(digest);
assert.equal(installedDigest, manifest.platforms[`linux-${process.arch}`].checksum, "OWNED_CLAUDE_NATIVE_MATCHES_SDK_MANIFEST");
assert.deepEqual(runtimeDigests, [installedDigest, installedDigest], "OWNED_CLAUDE_NATIVE_BYTES_MATCH");
const results = [];
for (const path of paths) {
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
"@modelcontextprotocol/sdk": "^1.29.0",
"@types/bun": "^1.4.2",
"axe-core": "^4.13.0",
"claude-agent-sdk-research-292": "npm:@anthropic-ai/claude-agent-sdk@0.3.292",
"github-slugger": "^2.0.0",
"mdast-util-to-string": "^4.0.0",
"oxlint": "^1.79.0",
Expand Down
2 changes: 1 addition & 1 deletion scripts/native-diagram-inputs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export interface NativeDiagramDiagnostic {
// Candidate qualification is exact: all source/installation drift requires fresh
// execution and requalification. The separate Docker mount boundary closes
// active initialization/shared-library reads; byte hashes alone do not.
const qualified:Omit<NativeDiagramIdentity,"runtime">={source:"e8502b6ffb3c575f2e9a1c93dea8dbf5ceda93ece367da9d542cb10b1c9ac32b",installation:"0c2758c046f2b69d5f33b66521baf3098db5f44256b73ec96961c98d381e6245"};
const qualified:Omit<NativeDiagramIdentity,"runtime">={source:"e8502b6ffb3c575f2e9a1c93dea8dbf5ceda93ece367da9d542cb10b1c9ac32b",installation:"47e78ac9977d948dd35bfcb1d916aa3e2f6ddab976bb047eebc2a531cdf8403d"};
const caller="packages/ui-kit/vitest.config.ts",owner="packages/ui-react/tests/browser/diagram-export-command.ts";
const sourcePins:Record<string,string>={
"packages/ui-kit/vitest.config.ts": "e724696a55955e9f32d396b2031214600086533c3f9b8baabcc1c6bb7311f1db",
Expand Down
4 changes: 2 additions & 2 deletions tests/native-diagram-inputs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const repo=resolve(import.meta.dir,".."),roots:string[]=[],owner="packages/ui-re
// Git archive filters, or a newly computed candidate fingerprint for this control.
const frozen="0d780605fe1ea9a281cce947b1f0074f3f3e7acc";
const qualifiedSource="e8502b6ffb3c575f2e9a1c93dea8dbf5ceda93ece367da9d542cb10b1c9ac32b";
const qualifiedInstallation="0c2758c046f2b69d5f33b66521baf3098db5f44256b73ec96961c98d381e6245";
const qualifiedInstallation="47e78ac9977d948dd35bfcb1d916aa3e2f6ddab976bb047eebc2a531cdf8403d";
const ownedPaths=[...diagramSourceSetup,...diagramSourceDomains.map(name=>`packages/${name}`),owner,caller,"scripts/ci-proof.ts"];
afterEach(()=>{for(const root of roots.splice(0))rmSync(root,{recursive:true,force:true});});
function fixture(current=false){
Expand Down Expand Up @@ -54,7 +54,7 @@ test("fixed native qualification binds the independently frozen complete source
expect(control.diagnostic(),"FROZEN_NATIVE_INSTALLATION_MUST_MATCH_QUALIFIED_BYTES: recover this owned install from a fresh private cache; never refresh qualification pins").toMatchObject({
status:"qualified",stage:"complete",sourceInputs:859,
actual:{source:qualifiedSource,installation:qualifiedInstallation},
installation:{packages:843,files:59516,bytes:1833832361}
installation:{packages:842,files:59489,bytes:1331664273}
});
expect(binding?.files.length,"COMPLETE_NATIVE_QUALIFICATION_WITHOUT_DOCKER_OR_IMAGE_LOOKUP").toBe(859);
expect(binding?.files.toSorted()).toEqual(nativeDiagramSourceInventory(control.root).inputs.map(entry=>entry.path).toSorted());
Expand Down
6 changes: 3 additions & 3 deletions tests/shipped-claude-runtime-pin.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// The public backend's exact Agent SDK and bundled Claude CLI pair. This half
// of the hygiene research-runtime test protects what ships, so it stays in
// product proof (#1386). The research 0.3.292 / 2.1.292 pair and its
// independence from this one were checked by the mechanical-hygiene spike
// harness, removed with the #838 evaluation machinery.
// product proof (#1386). The research 0.3.292 / 2.1.292 pair was checked by
// the mechanical-hygiene spike harness, removed with the #838 evaluation
// machinery; the root no longer installs that pair (#2509).
import { test, expect } from "bun:test";
import { readFileSync } from "node:fs";
import { dirname, join } from "node:path";
Expand Down
Loading