feat: atomic revision-qualified annotations sync with ownership manifest (P5)

This commit is contained in:
2026-08-13 04:58:56 +02:00
parent b00b7f17c9
commit 259d5a0374
6 changed files with 325 additions and 3 deletions
+10
View File
@@ -4,6 +4,7 @@ import { mkdir, readdir, readFile, rename, rm, writeFile } from "node:fs/promise
import { isAbsolute, join } from "node:path";
import { buildInstallationContract, renderWorkspaceDocs } from "./contracts.js";
import { parseAnnotationsYaml } from "./annotations.js";
import { syncAnnotations } from "./annotations-sync.js";
import { assertCatalogMatchesDescriptor, parseWorkspaceCatalogYaml, type WorkspaceCatalog, type WorkspaceCatalogEntry } from "./catalog.js";
import {
GitWorkspaceRepository,
@@ -585,6 +586,15 @@ export class WorkspaceRegistry {
const annotations = await this.repository.annotationsObject(safeHead, id);
if (annotations !== undefined) {
parseAnnotationsYaml(annotations.contents.toString("utf8"));
if (this.config.dataRoot !== undefined) {
syncAnnotations({
dataRoot: this.config.dataRoot,
workspaceId: id,
commit: safeHead,
blobId: annotations.blobId,
contents: annotations.contents,
});
}
}
const collection = workspace.semantic_index.vector_store.collection;
const owner = collectionOwners.get(collection);