feat(storage): index exact content references

This commit is contained in:
DCCONSTRUCTIONS
2026-07-29 15:21:03 +03:00
parent 611853d3af
commit 32c5d0dda5
13 changed files with 1081 additions and 32 deletions
@@ -36,8 +36,17 @@ export interface ArtifactHealth {
limitations: string[];
};
content_references: {
state: "not-indexed";
storage_model: "materialized-copies";
state: "not-indexed" | "indexed";
storage_model:
| "materialized-copies"
| "materialized-copies-with-reference-index";
result_id: string | null;
indexed_at_utc: string | null;
logical_reference_count: number;
canonical_content_count: number;
duplicate_reference_count: number;
exact_duplicate_bytes: number;
physical_reclamation_applied: false;
storage_migration_authorized: false;
next_gate: string;
};
@@ -66,6 +75,15 @@ export async function fetchArtifactHealth(
|| !Array.isArray(document.inventory.scopes)
|| !isRecord(document.exact_audit)
|| !isRecord(document.content_references)
|| !["not-indexed", "indexed"].includes(
String(document.content_references.state),
)
|| ![
"materialized-copies",
"materialized-copies-with-reference-index",
].includes(String(document.content_references.storage_model))
|| document.content_references.physical_reclamation_applied !== false
|| document.content_references.storage_migration_authorized !== false
) {
throw new Error("Ответ здоровья данных не соответствует контракту.");
}