#5952 · Archive retirement discards local edits
Verdict: REPRODUCED · Root-cause confidence: high
1. TL;DR
Archiving an idle thread in an owned managed Git worktree can discard both modified tracked files and untracked files after its environment retirement grace expires. The real archive HTTP route accepts the archive, the server schedules retirement five minutes later, and the real built-in provider forcibly removes the dirty checkout. Two clean-checkout runs reproduced this through the actual server lifecycle and plugin removal code with a real migrated SQLite database and temporary Git repository. Unpushed committed work was not deleted in either run: the source repository retained the local branch and its commit. The existing archive dialog has no worktree-loss warning, but that disclosure finding is from source inspection, not a browser session.
2. Claims vs findings
| Claim | Finding | Evidence |
|---|---|---|
| Archive can delete uncommitted work. | Verified | Both runs: HTTP 200, environment destroyed, tracked and untracked files absent. |
| Deletion occurs around five minutes later. | Verified scheduling; accelerated execution | Actual provider default is 300,000 ms; retireAt bounds checked after archive. Only the persisted deadline was backdated before the normal sweep. No five-minute wall-clock wait. |
| Unpushed commits are deleted too. | Refuted for the tested attached-branch case | Both runs recovered committed.txt with git show on the original branch, and its tip still matched the pre-archive commit. Detached HEAD and eventual garbage collection were not tested. |
| The archive confirmation lacks a worktree-loss warning. | Verified from source | Dialog inputs contain thread and child count, and buttons are only Cancel/Archive. No git status input or file-loss disclosure. No rendered UI reproduction claimed. |
3. Environment
- Public repository get-bb/bb; both clean checkouts at
405592c0b71b1655a6ab2e1cc7498b5beeb78caa. - Linux 4.19.0-gvisor; Node.js 22.19.0; pnpm 9.15.0; Git 2.39.5; Vitest 4.1.1.
- Built-in environment-git-worktree plugin 0.1.0; Plugin SDK 0.6.64. No LLM agent, account, remote, or additional dependency.
- First checkout:
<work>/base-one; second:<work>/base-two. Each started detached and clean; only the authored reproduction test was added. - No live app or listening server; Hono in-process requests. No ports used. Each test creates and deletes a distinct temporary Git repository, host-data directory, host-entry harness, and real migrated SQLite test database.
4. Minimal reproduction
- Check out the recorded commit in an isolated checkout. Install and build trusted source:
pnpm install --frozen-lockfile --prefer-offline pnpm exec turbo run build:types build --filter=@get-bb/plugin-sdk pnpm exec turbo run build
The first full build raced an unbuilt SDK host entry; the SDK prerequisite build and retry succeeded. Both final full builds passed all 67 tasks. - Save the complete authored test shown inline in this report at
apps/server/test/threads/issue-5952.repro.test.ts. It creates a real managed worktree, makes one local-only commit, modifies README.md, and adds an untracked scratch.txt. - Run from that checkout:
pnpm exec turbo run test --filter=@bb/server -- test/threads/issue-5952.repro.test.ts
- The test loads the actual server plugin and actual host entry. Its fake plugin API supplies registration and RPC transport only; the removal operation is delegated to the real host-entry handler. It uses the normal archive HTTP route and normal lifecycle sweep, checks the five-minute deadline, then backdates only retireAt to exercise expiry without waiting.
- Expected safety assertion: the dirty worktree still exists. Actual: exit 1 from the intended safety assertion, after successful destructive cleanup:
BEFORE {"dirty":true,"hasRemote":false} AFTER {"archiveStatus":200,"environmentStatus":"destroyed","teardownStatus":"removed","worktreeExists":false,"trackedFileExists":false,"untrackedFileExists":false,"unpushedCommitRetained":true,"committedContent":"unpushed commit"} AssertionError: Archive must preserve uncommitted work: expected false to be trueThe failing assertion is the regression signal, not an installation or transport failure.
Complete reproduction test
import { execFile } from "node:child_process";
import { existsSync } from "node:fs";
import { mkdir, mkdtemp, rm, writeFile } from "node:fs/promises";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { promisify } from "node:util";
import { environments, getEnvironment, getThread } from "@bb/db";
import { createFakePluginHost } from "@get-bb/plugin-sdk/testing";
import { experimental_createHostEntryHarness } from "@get-bb/plugin-sdk/testing/host";
import { eq } from "drizzle-orm";
import { expect, it } from "vitest";
import { worktreeHostContract } from "../../../../plugins/environment-git-worktree/contract.js";
import { createWorktreeHostEntry } from "../../../../plugins/environment-git-worktree/host.js";
import worktreePlugin from "../../../../plugins/environment-git-worktree/server.js";
import { sweepProviderEnvironment } from "../../src/services/environments/environment-engine.js";
import { setPluginEnvironmentProviderBridge } from "../../src/services/plugins/plugin-environment-provider-registry.js";
import {
seedEnvironment,
seedHostSession,
seedProjectWithSource,
seedThread,
} from "../helpers/seed.js";
import { withTestHarness } from "../helpers/test-app.js";
const execFileAsync = promisify(execFile);
async function git(cwd: string, ...args: string[]) {
const result = await execFileAsync("git", args, {
cwd,
env: {
...process.env,
GIT_AUTHOR_NAME: "Reproduction",
GIT_AUTHOR_EMAIL: "repro@example.com",
GIT_COMMITTER_NAME: "Reproduction",
GIT_COMMITTER_EMAIL: "repro@example.com",
},
});
return result.stdout.trim();
}
it("preserves uncommitted files when archive retires a managed worktree", async () => {
const root = await mkdtemp(join(tmpdir(), "bb-5952-repro-"));
const sourcePath = join(root, "source");
const dataDir = join(root, "host-data");
const hostHarness = experimental_createHostEntryHarness(
createWorktreeHostEntry(),
{ experimental_paths: { dataDir, tempDir: join(root, "temp") } },
);
try {
await mkdir(sourcePath);
await mkdir(dataDir);
await git(sourcePath, "init", "--initial-branch=main");
await writeFile(join(sourcePath, "README.md"), "initial\n");
await git(sourcePath, "add", ".");
await git(sourcePath, "commit", "-m", "Initial fixture");
const branchName = "bb/repro-5952";
const created = await hostHarness.experimental_call("create", {
operationId: "create-repro",
sourcePath,
pathKey: "repro-5952",
branchName,
baseBranch: { kind: "default" },
branchMode: "reset",
});
if (created.status !== "created") throw new Error(created.message);
await writeFile(join(created.path, "committed.txt"), "unpushed commit\n");
await git(created.path, "add", "committed.txt");
await git(created.path, "commit", "-m", "Local fixture commit");
const commitBefore = await git(created.path, "rev-parse", "HEAD");
await writeFile(join(created.path, "README.md"), "unsaved tracked work\n");
await writeFile(join(created.path, "scratch.txt"), "untracked work\n");
const statusBefore = await git(created.path, "status", "--porcelain");
expect(statusBefore).toContain("M README.md");
expect(statusBefore).toContain("?? scratch.txt");
console.log("BEFORE", JSON.stringify({ dirty: true, hasRemote: false }));
await withTestHarness(async (harness) => {
const plugin = createFakePluginHost({
experimental_callHostRpc: async (call) => {
if (call.method !== "remove") {
throw new Error(`Unexpected RPC: ${call.method}`);
}
return hostHarness.experimental_call(
"remove",
worktreeHostContract.remove.input.parse(call.input),
);
},
});
await worktreePlugin(plugin.bb);
const provider =
plugin.harness.registrations.environmentProviders.get("git-worktree");
if (provider === undefined) throw new Error("Provider not registered");
expect(provider.policy.retireGraceMs).toBe(300_000);
const record = { pluginId: "environment-git-worktree", provider };
setPluginEnvironmentProviderBridge({
listEnvironmentProviders: () => [record],
getEnvironmentProvider: (id) =>
id === provider.id ? record : undefined,
invokeProvider: async (_id, _label, run) => ({
ok: true,
value: await run(),
}),
decisionTimeoutMs: 10_000,
});
const { host } = seedHostSession(harness.deps);
const { project } = seedProjectWithSource(harness.deps, {
hostId: host.id,
path: sourcePath,
});
const environment = seedEnvironment(harness.deps, {
hostId: host.id,
projectId: project.id,
path: created.path,
status: "ready",
environmentProviderId: provider.id,
environmentProviderPluginId: record.pluginId,
environmentProviderInstanceKey: "repro-5952",
providerOwnsPath: true,
isGitRepo: true,
branchName,
});
const thread = seedThread(harness.deps, {
projectId: project.id,
environmentId: environment.id,
status: "idle",
});
const archiveStartedAt = Date.now();
const response = await harness.app.request(
`/api/v1/threads/${thread.id}/archive-all`,
{ method: "POST" },
);
expect(response.status).toBe(200);
expect(getThread(harness.db, thread.id)?.archivedAt).not.toBeNull();
await sweepProviderEnvironment(harness.deps, environment.id);
const retireAt = getEnvironment(harness.db, environment.id)?.retireAt;
expect(retireAt).toBeGreaterThanOrEqual(archiveStartedAt + 300_000);
expect(retireAt).toBeLessThanOrEqual(Date.now() + 300_000);
expect(existsSync(created.path)).toBe(true);
harness.db
.update(environments)
.set({ retireAt: Date.now() - 1 })
.where(eq(environments.id, environment.id))
.run();
await sweepProviderEnvironment(harness.deps, environment.id);
const current = getEnvironment(harness.db, environment.id);
const branchRetained =
(await git(sourcePath, "rev-parse", branchName)) === commitBefore;
const committedContent = await git(
sourcePath,
"show",
`${branchName}:committed.txt`,
);
console.log(
"AFTER",
JSON.stringify({
archiveStatus: response.status,
environmentStatus: current?.status,
teardownStatus: current?.teardownStatus,
worktreeExists: existsSync(created.path),
trackedFileExists: existsSync(join(created.path, "README.md")),
untrackedFileExists: existsSync(join(created.path, "scratch.txt")),
unpushedCommitRetained: branchRetained,
committedContent,
}),
);
expect(branchRetained).toBe(true);
expect(committedContent).toBe("unpushed commit");
expect(
existsSync(created.path),
"Archive must preserve uncommitted work",
).toBe(true);
});
} finally {
setPluginEnvironmentProviderBridge(undefined);
await hostHarness.experimental_dispose();
await rm(root, { recursive: true, force: true });
}
}, 60_000);
5. Root cause
Archiving schedules managed-environment retirement without a dirty-worktree safety check; provider removal forces Git worktree deletion and recursively removes the directory.
Archive changes the thread state and invokes provider retirement without checking dirty files.
apps/server/src/services/threads/thread-archive.ts:82
void cancelProviderEnvironmentCreation(deps, archivedThread.id).catch(
(error) =>
deps.logger.warn({ error }, "Environment launch cancellation failed"),
);
void removeCreatingMachine(deps, archivedThread.id).catch((error) =>
deps.logger.warn({ error }, "Machine launch cancellation failed"),
);
if (archivedThread.environmentId !== null)
void sweepProviderEnvironment(deps, archivedThread.environmentId).catch(
(error) => deps.logger.warn({ error }, "Environment retirement failed"),
);
The worktree provider declares per-attempt ownership but does not override the normalized five-minute retirement default.
plugins/environment-git-worktree/server.ts:174
bb.experimental_environments.register({
id: GIT_WORKTREE_ENVIRONMENT_PROVIDER_ID,
displayName: "Worktree",
description: "Create an isolated Git worktree for your changes.",
icon: "FolderGit",
requires: { gitCheckout: true },
inputs: worktreeInputsSchema,
policy: { pathKeys: "per-attempt" },
experimental_existingPath: (inputs) =>
"kind" in inputs ? inputs.path : null,
async create(context) {
packages/plugin-sdk/src/internal/host-policy.ts:2637
const environmentProviderPolicySchema = z
.object({
retireGraceMs: z.number().int().nonnegative().nullable().default(300_000),
pathKeys: z.enum(["per-thread", "per-attempt"]).default("per-thread"),
})
.strict();
Once there are no live users and the retirement deadline has expired, the server proceeds to removal. A still-running or shared environment has other lifetime constraints; the reproduced thread is idle and the sole user.
apps/server/src/services/environments/environment-engine.ts:880
if (row.retireAt === null) {
if (
!cancelled &&
record.provider.policy.retireGraceMs === null &&
row.status !== "destroyed"
)
return;
const retireAt =
row.status === "destroyed" || cancelled
? now
: now + (record.provider.policy.retireGraceMs ?? 0);
writeEnvironment(deps, environmentId, { retireAt });
row = { ...row, retireAt };
}
if (row.retireAt !== null && row.retireAt > now) return;
if (!requestEnvironmentRemoval(deps, environmentId)) return;
The host removal path kills workspace processes, runs git worktree remove with --force and allowFailure, then recursively removes the checkout regardless of the Git removal result. This bypasses Git's normal dirty-worktree protection. There is no branch deletion here, explaining the retained unpushed commit.
plugins/environment-git-worktree/host/worktree.ts:653
await tryWithCheckoutMutationLock(
workspacePath,
() =>
withWorktreeMetadataLock(commonDir, () =>
runGit(
[
"--git-dir",
commonDir,
"worktree",
"remove",
workspacePath,
"--force",
],
{
cwd: path.dirname(workspacePath),
...(args.signal !== undefined ? { signal: args.signal } : {}),
allowFailure: true,
},
),
),
args.signal,
signalOptions(args.signal),
);
}
throwIfProvisionAborted(args.signal);
await fs.rm(workspacePath, { recursive: true, force: true });
await removeDirectoryIfEmpty(parentPath);
The dialog's source promises the thread can be unarchived but does not disclose irreversible working-directory removal or inspect Git status. Thread restoration is not restoration of discarded uncommitted files.
apps/app/src/components/dialogs/ThreadArchiveDialog.tsx:87
<DialogHeader>
<DialogTitle>Archive thread?</DialogTitle>
<DialogDescription>
{active ? "This will stop current work. " : null}
Its{" "}
<span className="font-semibold">
{formatChildThreadCount(childThreadCount)}
</span>{" "}
will be archived too. Archived threads stay available and can be
unarchived.
</DialogDescription>
</DialogHeader>
<DialogFooter>
<Button
type="button"
variant="outline"
disabled={pending}
onClick={() => onOpenChange(false)}
>
Cancel
</Button>
<Button type="submit" disabled={pending}>
Archive
</Button>
6. Proposed fix and simple-fix assessment
Design an archive-specific safe-retirement policy: read authoritative worktree state before destructive teardown, preserve dirty resources, surface the reason through the existing archive controls, and repeat the safety check at deletion time to avoid a stale preflight. Keep thread archival distinct from explicitly destructive environment/project/machine cleanup. Add regression coverage for tracked and untracked edits, descendant/shared environments, disconnected hosts, and edits made during the grace period. Avoid promising that unarchive can restore discarded working files.
No automatic PR. A complete safe repair spans archive confirmation, server retention policy, and the provider removal boundary. An isolated host-only refusal would also change explicit teardown behavior and can leave existing project/machine deletion flows blocked; removing --force alone is ineffective because recursive deletion still follows. Selecting retention/recovery behavior is a product/lifecycle decision, so this does not satisfy the one-subsystem, no-product-decision simple-fix gate. No production patch, fix branch, or push was made.
7. Verification
The same agent repeated the reproduction in a second clean trusted checkout, not an independent review. Both use the same recorded commit and fresh temporary resources; no linked PR code was checked out or run. Run one and run two each failed exactly the intended worktree-preservation assertion after actual removal, while both assertions proving retained local commits passed.
| Checkout | Command | Result |
|---|---|---|
| base-one | Turbo server test with issue-5952.repro.test.ts | 1 test failed as expected; output inline in appendix |
| base-two | Same Turbo server test | 1 test failed as expected; output inline in appendix |
The only changes to the test between runs were formatting and removing an ignored seed-fixture property; neither changes executed behavior. Report correction supported by both runs: only uncommitted-file loss is established, not loss of the attached branch's unpushed commit. The five-minute deadline was checked, not waited out. UI copy was inspected rather than rendered. The host teardown-hook transport is a successful test harness response; actual worktree creation/removal, archive state changes, retirement, and SQLite access are real.
Existing adjacent tests also pass without a production fix:
pnpm exec turbo run test --filter=@bb/server -- test/threads/archive-undo-grace.test.ts test/threads/thread-environment-restore.test.ts pnpm exec turbo run test --filter=bb-plugin-environment-git-worktree -- host.test.ts server.test.ts
17 server tests and 41 provider tests passed. Existing restoration coverage protects committed branch reuse but did not test preserving dirty working files through archive retirement.
Existing server tests
@bb/server:test: cache miss, executing 1cf50423d788f575 @bb/server:test: @bb/server:test: > @bb/server@0.0.1 test <work>/base-one/apps/server @bb/server:test: > vitest run --config vitest.config.ts "test/threads/archive-undo-grace.test.ts" "test/threads/thread-environment-restore.test.ts" @bb/server:test: @bb/server:test: @bb/server:test: RUN v4.1.1 <work>/base-one/apps/server @bb/server:test: @bb/server:test: (node:9570) ExperimentalWarning: SQLite is an experimental feature and might change at any time @bb/server:test: (Use `node --trace-warnings ...` to show where the warning was created) @bb/server:test: (node:9571) ExperimentalWarning: SQLite is an experimental feature and might change at any time @bb/server:test: (Use `node --trace-warnings ...` to show where the warning was created) @bb/server:test: ✓ |@bb/server| test/threads/archive-undo-grace.test.ts (6 tests) 3464ms @bb/server:test: ✓ |@bb/server| test/threads/thread-environment-restore.test.ts (11 tests) 4259ms @bb/server:test: @bb/server:test: Test Files 2 passed (2) @bb/server:test: Tests 17 passed (17) @bb/server:test: Start at 02:34:41 @bb/server:test: Duration 42.42s (transform 68.24s, setup 10.22s, import 55.31s, tests 7.72s, environment 0ms) @bb/server:test: Tasks: 10 successful, 10 total Cached: 0 cached, 10 total Time: 1m7.266s
Existing provider tests
bb-plugin-environment-git-worktree:test: cache miss, executing e2c3d92dc5603d6c bb-plugin-environment-git-worktree:test: bb-plugin-environment-git-worktree:test: > bb-plugin-environment-git-worktree@0.1.0 test <work>/base-one/plugins/environment-git-worktree bb-plugin-environment-git-worktree:test: > vitest run --config vitest.config.ts "host.test.ts" "server.test.ts" bb-plugin-environment-git-worktree:test: bb-plugin-environment-git-worktree:test: bb-plugin-environment-git-worktree:test: RUN v4.1.1 <work>/base-one/plugins/environment-git-worktree bb-plugin-environment-git-worktree:test: bb-plugin-environment-git-worktree:test: ✓ |bb-plugin-environment-git-worktree| server.test.ts (17 tests) 88ms bb-plugin-environment-git-worktree:test: ✓ |bb-plugin-environment-git-worktree| host.test.ts (24 tests) 3539ms bb-plugin-environment-git-worktree:test: ✓ creates and discovers cleanup paths for repository names with NFD 446ms bb-plugin-environment-git-worktree:test: ✓ creates and discovers cleanup paths for repository names with punctuation only 400ms bb-plugin-environment-git-worktree:test: bb-plugin-environment-git-worktree:test: Test Files 2 passed (2) bb-plugin-environment-git-worktree:test: Tests 41 passed (41) bb-plugin-environment-git-worktree:test: Start at 02:35:26 bb-plugin-environment-git-worktree:test: Duration 6.90s (transform 5.66s, setup 0ms, import 6.10s, tests 3.63s, environment 0ms) bb-plugin-environment-git-worktree:test: Tasks: 6 successful, 6 total Cached: 0 cached, 6 total Time: 8.317s
8. Related issues and PR check
No linked open PR in the issue timeline and no open PR found by a search for issue number 5952 in PR bodies at investigation time. #2724 concerns retained local branches after cleanup; the present reproduction independently confirms branch retention and distinguishes it from discarded working files. No external issue links or instructions were executed.
9. Appendix and trust boundary
Issue text was treated only as untrusted claims. Its proposed actions and wording were not followed. All executed repository code came from the recorded trusted origin/main commit plus the locally authored test; there were no workflows, delegated agents, external scripts, or linked PR executions. Public artifacts contain only synthetic fixtures, sanitized test output, and trusted source excerpts.
Preparation and validation: git fetch origin main; record the full base SHA; create two detached clean worktrees; frozen installs; SDK prerequisite builds; full Turbo builds; authored test; relevant existing suites; git diff --check. No live runtime instance or user worktree was used. Synthetic data was removed by test finalizers.
First-run output
@bb/server:test: cache miss, executing f9c68625a3dda888
@bb/server:test:
@bb/server:test: > @bb/server@0.0.1 test <work>/base-one/apps/server
@bb/server:test: > vitest run --config vitest.config.ts "test/threads/issue-5952.repro.test.ts"
@bb/server:test:
@bb/server:test:
@bb/server:test: RUN v4.1.1 <work>/base-one/apps/server
@bb/server:test:
@bb/server:test: (node:8688) ExperimentalWarning: SQLite is an experimental feature and might change at any time
@bb/server:test: (Use `node --trace-warnings ...` to show where the warning was created)
@bb/server:test: stdout | test/threads/issue-5952.repro.test.ts > preserves uncommitted files when archive retires a managed worktree
@bb/server:test: BEFORE {"dirty":true,"hasRemote":false}
@bb/server:test:
@bb/server:test: stdout | test/threads/issue-5952.repro.test.ts > preserves uncommitted files when archive retires a managed worktree
@bb/server:test: AFTER {"archiveStatus":200,"environmentStatus":"destroyed","teardownStatus":"removed","worktreeExists":false,"trackedFileExists":false,"untrackedFileExists":false,"unpushedCommitRetained":true,"committedContent":"unpushed commit"}
@bb/server:test:
@bb/server:test: ❯ |@bb/server| test/threads/issue-5952.repro.test.ts (1 test | 1 failed) 2423ms
@bb/server:test: × preserves uncommitted files when archive retires a managed worktree 294ms
@bb/server:test:
@bb/server:test: ⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯
@bb/server:test:
@bb/server:test: FAIL |@bb/server| test/threads/issue-5952.repro.test.ts > preserves uncommitted files when archive retires a managed worktree
@bb/server:test: AssertionError: Archive must preserve uncommitted work: expected false to be true // Object.is equality
@bb/server:test:
@bb/server:test: - Expected
@bb/server:test: + Received
@bb/server:test:
@bb/server:test: - true
@bb/server:test: + false
@bb/server:test:
@bb/server:test: ❯ test/threads/issue-5952.repro.test.ts:158:82
@bb/server:test: 156| expect(branchRetained).toBe(true);
@bb/server:test: 157| expect(committedContent).toBe("unpushed commit");
@bb/server:test: 158| expect(existsSync(created.path), "Archive must preserve uncommit…
@bb/server:test: | ^
@bb/server:test: 159| });
@bb/server:test: 160| } finally {
@bb/server:test: ❯ withTestHarness test/helpers/test-app.ts:387:12
@bb/server:test: ❯ test/threads/issue-5952.repro.test.ts:77:5
@bb/server:test:
@bb/server:test: ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/1]⎯
@bb/server:test:
@bb/server:test:
@bb/server:test: Test Files 1 failed (1)
@bb/server:test: Tests 1 failed (1)
@bb/server:test: Start at 02:33:02
@bb/server:test: Duration 39.55s (transform 32.45s, setup 4.83s, import 27.09s, tests 2.42s, environment 0ms)
@bb/server:test:
@bb/server:test: ELIFECYCLE Test failed. See above for more details.
Tasks: 9 successful, 10 total
Cached: 0 cached, 10 total
Time: 1m4.502s
Failed: @bb/server#test
ERROR run failed: command exited (1)Second-run output
@bb/server:test: cache miss, executing 0abd6c10f4f6e335
@bb/server:test:
@bb/server:test: > @bb/server@0.0.1 test <work>/base-two/apps/server
@bb/server:test: > vitest run --config vitest.config.ts "test/threads/issue-5952.repro.test.ts"
@bb/server:test:
@bb/server:test:
@bb/server:test: RUN v4.1.1 <work>/base-two/apps/server
@bb/server:test:
@bb/server:test: (node:9056) ExperimentalWarning: SQLite is an experimental feature and might change at any time
@bb/server:test: (Use `node --trace-warnings ...` to show where the warning was created)
@bb/server:test: stdout | test/threads/issue-5952.repro.test.ts > preserves uncommitted files when archive retires a managed worktree
@bb/server:test: BEFORE {"dirty":true,"hasRemote":false}
@bb/server:test:
@bb/server:test: stdout | test/threads/issue-5952.repro.test.ts > preserves uncommitted files when archive retires a managed worktree
@bb/server:test: AFTER {"archiveStatus":200,"environmentStatus":"destroyed","teardownStatus":"removed","worktreeExists":false,"trackedFileExists":false,"untrackedFileExists":false,"unpushedCommitRetained":true,"committedContent":"unpushed commit"}
@bb/server:test:
@bb/server:test: ❯ |@bb/server| test/threads/issue-5952.repro.test.ts (1 test | 1 failed) 2653ms
@bb/server:test: × preserves uncommitted files when archive retires a managed worktree 451ms
@bb/server:test:
@bb/server:test: ⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯
@bb/server:test:
@bb/server:test: FAIL |@bb/server| test/threads/issue-5952.repro.test.ts > preserves uncommitted files when archive retires a managed worktree
@bb/server:test: AssertionError: Archive must preserve uncommitted work: expected false to be true // Object.is equality
@bb/server:test:
@bb/server:test: - Expected
@bb/server:test: + Received
@bb/server:test:
@bb/server:test: - true
@bb/server:test: + false
@bb/server:test:
@bb/server:test: ❯ test/threads/issue-5952.repro.test.ts:171:9
@bb/server:test: 169| existsSync(created.path),
@bb/server:test: 170| "Archive must preserve uncommitted work",
@bb/server:test: 171| ).toBe(true);
@bb/server:test: | ^
@bb/server:test: 172| });
@bb/server:test: 173| } finally {
@bb/server:test: ❯ withTestHarness test/helpers/test-app.ts:387:12
@bb/server:test: ❯ test/threads/issue-5952.repro.test.ts:77:5
@bb/server:test:
@bb/server:test: ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/1]⎯
@bb/server:test:
@bb/server:test:
@bb/server:test: Test Files 1 failed (1)
@bb/server:test: Tests 1 failed (1)
@bb/server:test: Start at 02:34:09
@bb/server:test: Duration 41.74s (transform 33.96s, setup 5.29s, import 28.37s, tests 2.65s, environment 0ms)
@bb/server:test:
@bb/server:test: ELIFECYCLE Test failed. See above for more details.
Tasks: 9 successful, 10 total
Cached: 8 cached, 10 total
Time: 43.486s
Failed: @bb/server#test
ERROR run failed: command exited (1)AGENT GENERATED