mirror of
https://github.com/morluto/rea
synced 2026-10-26 22:28:27 -04:00
perf(javascript)!: stop repeating the semantic identifier strategy per fact (#1474)
Every semantic graph node and relation carried an identifier_strategy object whose schema admits exactly one value per record type. The constant made up about 9% of analyze_javascript_application output (Obsidian app.asar: 12.04 MB to 10.96 MB), and semantic traces repeated it on every returned fact. The node_id and relation_id schema descriptions now state how each identifier is derived. BREAKING CHANGE: Semantic graph nodes and relations no longer include identifier_strategy, and relation IDs no longer hash that constant. Evidence recorded by earlier versions does not validate against the new semantic graph schema. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -233,11 +233,9 @@ export const javaScriptSemanticNodeInputSchema = z.strictObject({
|
||||
export const javaScriptSemanticNodeSchema =
|
||||
javaScriptSemanticNodeInputSchema.extend({
|
||||
evidence: javaScriptSemanticEvidenceReferenceSchema,
|
||||
node_id: semanticNodeIdSchema,
|
||||
identifier_strategy: z.strictObject({
|
||||
strategy: z.literal("semantic-content-sha256"),
|
||||
stability: z.literal("artifact-version"),
|
||||
}),
|
||||
node_id: semanticNodeIdSchema.describe(
|
||||
"SHA-256 of the node kind and identity; stable for one artifact version.",
|
||||
),
|
||||
});
|
||||
|
||||
/** One directed semantic relationship before its ID is derived. */
|
||||
@@ -254,11 +252,9 @@ export const javaScriptSemanticRelationInputSchema = z.strictObject({
|
||||
export const javaScriptSemanticRelationSchema =
|
||||
javaScriptSemanticRelationInputSchema.extend({
|
||||
evidence: javaScriptSemanticEvidenceReferenceSchema,
|
||||
relation_id: semanticRelationIdSchema,
|
||||
identifier_strategy: z.strictObject({
|
||||
strategy: z.literal("semantic-content-sha256"),
|
||||
stability: z.literal("relationship-exact"),
|
||||
}),
|
||||
relation_id: semanticRelationIdSchema.describe(
|
||||
"SHA-256 of the exact relation content, including its evidence reference.",
|
||||
),
|
||||
});
|
||||
|
||||
/** Reasons semantic analysis can leave an explicit frontier. */
|
||||
|
||||
Reference in New Issue
Block a user