chore(deps): agent-profile-materialize 0.19.2 keeps mounted skills byte-identical - #201
Merged
Merged
Conversation
…te-identical 0.17.1 re-quoted a SKILL.md description that already carried quotes. The Lab's skills/profile-authoring/SKILL.md (3,862 bytes) mounted as 3,866 bytes, and a copy of the mount as 3,874. 0.19.2 returns the source bytes unchanged. Add a test that mounts that skill through provisionProfileWorkspace on the claude-code path and asserts byte identity, twice. 0.19.1 marks the generated context file and replaces its own output when the plan changes, so the resume test now asserts replacement for a generated CLAUDE.md and refusal for an agent-edited one.
A session resumed across the 0.17.1 to 0.19.2 upgrade holds the old plan digest, so the new plan re-applies. Two cases pin what happens to the unmarked context file 0.17.1 wrote: adopted once when its body matches the new plan, refused when the agent appended to it. Measured with a scratch 0.17.1 install through provisionProfileWorkspace. The skill-mount test header now names the scratch 0.17.1 reproduction as the source of the 3,866 and 3,874 byte counts; no live run recorded them.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change
@tangle-network/agent-profile-materialize0.17.1 -> 0.19.2, exact pin like the other@tangle-networkpins inpackage.json.pnpm-workspace.yamlalready lists0.19.2underminimumReleaseAgeExclude(added fortests/runtime-consumer), so no exemption change.package.jsononmain(1dffab1) declares exact0.17.1, not a^0.1.0range.The
^0.1.0range existed only from 5ec6309 (refactor(profiles): import published materializer + reword British→American #59) to 347de95, which widened it to^0.5.1; af8d49a (feat(profiles): adopt current materializer contracts #80) pinned exact0.9.2, and every later bump kept an exact pin, most recently0.16.0->0.17.1at e94e87b.The container source b2bd3d0 carries the same exact
0.17.1pin and the same root resolution.The root importer resolved
0.17.1(@tangle-network/agent-interface@1.9.0).Only the
tests/runtime-consumerworkspace, a devDependency, resolved0.19.2(@tangle-network/agent-interface@2.3.1).So the bridge's serving path imported 0.17.1 while two materializer versions lived in one lockfile.
After: one version, 0.19.2, in both importers.
0.19.2 declares the peer
@tangle-network/agent-interface: ^1.0.0 || ^2.0.0, so the root's 1.9.0 pin still satisfies it.tests/skill-mount-bytes.test.tswith fixturetests/fixtures/profile-authoring-SKILL.md, a copy of discovery-labskills/profile-authoring/SKILL.md: 3,862 bytes, sha2567c505520ad7cc77e78c79d0488f19302ee7738270ca378bb3b253ce092b34131.It mounts the skill through
provisionProfileWorkspace(req, null, 'claude-code', cwd), the call the claude backend makes, and asserts the written.claude/skills/profile-authoring/SKILL.mdequals the source bytes.A second case mounts the mounted bytes again and asserts the same, which is the child-copies-the-mount case reproduced under Evidence (0.17.1: 3,866 then 3,874 bytes).
No Lab artifact records those counts; the r1 smoke's
live/native/profile-authoring-SKILL.mdis an older 3,509-byte body.tests/resume-rematerialization.test.ts: 0.19.1 marks the generated context file (CLAUDE.md) with a provenance marker and replaces its own output when the plan changes.The old test asserted the pre-0.19.1 refusal for exactly that case.
It is now two cases: a changed plan replaces the materializer's own
CLAUDE.md; an agent-appendedCLAUDE.mdis still refused with the same message and the edit survives.Two more cases pin the upgrade path itself: an unmarked
CLAUDE.mdas 0.17.1 wrote it, under a session that recorded the 0.17.1 plan digest, is adopted once when its body matches the new plan and refused when the agent appended to it.The mid-session profile swap stays refused at session binding (
tests/session-profile-binding.test.ts).Evidence
Reproduction outside the worktree, scratch npm installs of each version,
materializeProfile(profile, 'claude-code', { skip: ['mcp'] })on the Lab skill:d53d313e…) -> pass 2 3,874 (sha256fe3d97fa…).The only changed line is frontmatter line 3:
description: "Author an exact AgentProfile…"becomesdescription: "\"Author an exact AgentProfile…\"".7c505520…on all three.Upgrade path, reproduced through the bridge's own
provisionProfileWorkspaceon a scratch checkout ofmainwith 0.17.1 and then this worktree with 0.19.2 (profile: system prompt plus one instruction, claude-code):sha256:563c4e49…; itsCLAUDE.mdstarts at the body, no marker.One workspace then got an agent append (
- codeword: heliotrope).sha256:035f9f01…for the same profile, so a session holding the 0.17.1 digest re-applies the plan.The unedited workspace was adopted and rewritten with the marked file.
The edited workspace was refused:
AgentProfile workspace materialization failed: Refusing to replace existing workspace file: CLAUDE.md — planned sha256:5119de67… != existing sha256:7fa6679b….Commands in the worktree,
N=/Users/drew/.nvm/versions/node/v22.23.2/bin:$N/pnpm install --frozen-lockfile: Already up to date, 2 workspace projects (pnpm 11.25.0).$N/pnpm exec tsc --noEmit: exit 0.$N/pnpm exec vitest run: 1015 passed, 11 failed, 24 skipped of 1050 tests in 59 files.Both skill-mount tests pass; all 6 resume tests pass.
$N/pnpm run test:runtime-consumer: 1 of 1 pass.origin/main(1dffab1) worktree on this Mac:tests/docker-executor.test.ts(3),tests/failure-attribution.test.ts(1),tests/jail.test.ts(5),tests/pi-inference-isolation.test.ts(2); 11 failed, 172 passed, 10 skipped across those 4 files.Cause: macOS realpath expectations (
/private/var/…vs/var/…,/System/Volumes/Data/home/…) and seatbelt-specific assertions; CI runs on ubuntu.The checked-in
.ai-agent-hooks.mjsran merge-conflict-markers and suspicious-secrets at commit, and mergeable-with-base pluspnpm vitest run tests/trace-emitter.test.tsat push.libc:annotations pnpm 11.25 writes for rolldown and lightningcss binaries.pnpm@10.34.5 install --frozen-lockfile --lockfile-only --offlineon the new lockfile exits 0, which is thedocker/Dockerfilepath (corepack prepare pnpm@10).Other
@tangle-networkdependencies behind their latest published version (npm view), unchanged here:agent-interface1.9.0 (latest 2.3.1)tests/runtime-consumer:agent-eval0.173.3 (latest 0.174.0),agent-runtime0.194.0 (latest 0.196.0),sandbox0.37.1 (latest 0.38.0)agent-trace-contract1.0.2; runtime-consumeragent-interface2.3.1Upgrading the running bridge in
disco-fleet(not performed here)How the container got b2bd3d0.
The container was created as
docker run -d --name disco-fleet --privileged … node:24-bookworm sleep infinitywith pnpm 11.18.0 via corepack (discovery-labprereg/h2-topology/linux-host.md, step 1).It holds no GitHub credential (Lab handoff 2026-09-03, standing decision 5), so source is copied in.
The bridge worktree is copied to a directory named by its merged commit, then
pnpm install --frozen-lockfileandfind … -name '._*' -deletefor macOS AppleDouble files (linux-host.md, step 4).The smoke's
artifacts/meta-operator-recursion-smoke-r1/preflight/operator-run.jsonrecordsbridgeCwd: /bridge-b2bd3d008febbcc31c9aec96f79c0db181bd3b2c,bridgePid: 1389, and the spec'sbridgeUrlishttp://127.0.0.1:8899withops/bridge-8899.env.Steps once this PR merges at commit
<sha>:git -C /Users/drew/code/cli-bridge fetch origin && git worktree add /Users/drew/webb/_wt/cli-bridge-<sha> <sha>.node_modulesand.git:docker exec disco-fleet mkdir -p /bridge-<sha> && tar -C /Users/drew/webb/_wt/cli-bridge-<sha> --exclude node_modules --exclude .git -cf - . | docker exec -i disco-fleet tar -xf - -C /bridge-<sha>, thendocker exec disco-fleet find /bridge-<sha> -name '._*' -delete.docker exec -w /bridge-<sha> disco-fleet pnpm install --frozen-lockfile(better-sqlite3 builds viaallowBuilds), thendocker exec -w /bridge-<sha> disco-fleet pnpm typecheck, then confirmdocker exec -w /bridge-<sha> disco-fleet node -p "require('@tangle-network/agent-profile-materialize/package.json').version"prints0.19.2.docker exec disco-fleet pgrep -f "^bash tools/program-loop.sh") and let live runs on the lane settle (Lab handoff 2026-09-03, restart order).Settling is required, not a courtesy: a session resumed across the upgrade whose agent edited
CLAUDE.mdfails its first turn on the new bridge (Limits below).docker exec disco-fleet ss -tlnpH | grep :8899.Confirm
readlink /proc/<pid>/cwdis/bridge-b2bd3d008febbcc31c9aec96f79c0db181bd3b2cand its environ holdsBRIDGE_PORT=8899.Kill that node process, its
pnpm startparent, and the bash launcher, reading each pid first; never a pid below 2.Confirm the port is free and the data-directory lock
<BRIDGE_DATA_DIR>/.cli-bridge-data-directory.pidfromops/bridge-8899.envis released; one bridge per data directory.docker exec -d disco-fleet bash -c 'cd /bridge-<sha> && set -a; . /lab2/ops/bridge-8899.env; set +a; setsid nohup pnpm start >> /bridge-data-8899.log 2>&1 &'.GET /healthanswers (14 s last time);GET /advertisescapabilities.profileMaterialization: cli-bridge.profile-materialization.v2, which agent-runtime's bridge executor preflights; the new listener'sps -o etimes=is in seconds;readlink /proc/<newpid>/cwdis/bridge-<sha>.skills/profile-authoring/SKILL.mdand check the workspace's.claude/skills/profile-authoring/SKILL.mdis 3,862 bytes with sha2567c505520…; the next operator record must showbridgeCwd: /bridge-<sha>.Limits
provisionProfileWorkspacepath and on scratch installs of both versions.libcannotations were validated by pnpm 10.34.5 and 11.25.0 frozen installs, not by a Docker image build.appliedPlanDigestfrom 0.17.1 re-materializes once on its next turn; a context file 0.17.1 wrote is adopted when its body matches the new plan.CLAUDE.mdis refused on its first post-upgrade turn (Refusing to replace existing workspace file: CLAUDE.md), because the unmarked, edited body no longer matches the planned body; resumed sessions must finish before step 5 or start a fresh workspace.Reproduced above and pinned by the two 0.17.1 cases in
tests/resume-rematerialization.test.ts; not exercised live.🤖 Generated with Claude Code