perf(artifacts)!: name each edge's child through its occurrence (#1493)
Every inventory edge is created from one occurrence and copied that occurrence's artifact_id and logical_path as child_artifact_id and logical_path. Edges now keep the occurrence_id reference alone. Edge IDs still hash the same child and path, read from the occurrence, so they are unchanged; validation and artifact comparison read the occurrence too. inspect_artifact output: Transmission.app 1.10 MB to 0.97 MB, Visual Studio Code.app 15.37 MB to 13.48 MB. BREAKING CHANGE: Artifact inventory edges no longer include child_artifact_id or logical_path; read them from the occurrence named by occurrence_id. The graph commitment changes, so inventory Evidence recorded by earlier versions no longer validates. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
1f692c83e2
commit
a0e5e9db2b
@@ -71,14 +71,21 @@ export const artifactContradictionId = (input: {
|
||||
"Artifact",
|
||||
)}`;
|
||||
|
||||
/** Identify an edge by its semantic relationship and exact occurrence. */
|
||||
/**
|
||||
* Identify an edge by its semantic relationship and exact occurrence. The
|
||||
* child artifact and logical path come from that occurrence.
|
||||
*/
|
||||
export const artifactEdgeId = (
|
||||
semantic: Pick<
|
||||
ArtifactEdge,
|
||||
| "parent_artifact_id"
|
||||
| "child_artifact_id"
|
||||
| "relation"
|
||||
| "occurrence_id"
|
||||
| "logical_path"
|
||||
>,
|
||||
): string => `edge_${digestCanonicalValue(semantic, "Artifact")}`;
|
||||
edge: Pick<ArtifactEdge, "parent_artifact_id" | "relation" | "occurrence_id">,
|
||||
occurrence: Pick<ArtifactOccurrence, "artifact_id" | "logical_path">,
|
||||
): string =>
|
||||
`edge_${digestCanonicalValue(
|
||||
{
|
||||
parent_artifact_id: edge.parent_artifact_id,
|
||||
child_artifact_id: occurrence.artifact_id,
|
||||
relation: edge.relation,
|
||||
occurrence_id: edge.occurrence_id,
|
||||
logical_path: occurrence.logical_path,
|
||||
},
|
||||
"Artifact",
|
||||
)}`;
|
||||
|
||||
Reference in New Issue
Block a user