fix: keep workspace metadata compact in timestamped releases

This commit is contained in:
Agent Workbench Dev
2026-10-30 00:22:05 +08:00
parent 4c8321a2ee
commit 4117e9e4ea
11 changed files with 38 additions and 12 deletions
+4 -2
View File
@@ -96,7 +96,9 @@ test('compact checkout identities create in deep Unicode source directories whil
const f = fixture(t); deepSource(f, 142);
const before = captureWorkspaceSource(f), manager = new WorkspaceManager(f.store);
const label = 'x'.repeat(64), record = await manager.prepare(f.session, label);
assert.equal(path.basename(record.root), 'w-' + record.id);
assert.equal(record.label, label);
assert.ok(path.basename(record.root).length <= 22);
if (process.platform === 'win32') assert.ok(Buffer.byteLength(path.join(record.source.commonDir, 'worktrees', path.basename(record.root)), 'utf8') <= 200);
assert.ok(record.branch.startsWith('workbench/' + 'x'.repeat(32) + '-'));
await (await manager.start(f.session, record.id, record.fingerprint)).promise;
assert.equal(record.status, 'ready', record.summary);
@@ -104,7 +106,7 @@ test('compact checkout identities create in deep Unicode source directories whil
});
test('Windows Git metadata path limits reject creation before publishing a branch or changing source bytes', async t => {
const f = fixture(t); deepSource(f, 168);
const f = fixture(t); deepSource(f, 180);
const before = captureWorkspaceSource(f), manager = new WorkspaceManager(f.store);
if (process.platform === 'win32') {
await assert.rejects(manager.prepare(f.session, 'deep metadata'), /Git管理目录过长/);