Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions scripts/populate-kb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,10 @@ const entities: EntityDef[] = [
type: "adr",
id: "ADR-002",
properties: {
title: "Use Bun/Node.js as CLI wrapper around SWI-Prolog subprocess",
title: "Public API exports via re-export modules",
status: "accepted",
source: "scripts/populate-kb.ts",
tags: ["cli", "bun", "nodejs"],
source: "documentation/adr/ADR-002.md",
tags: ["architecture", "publishing", "exports"],
},
Comment on lines 176 to 183
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even with the title/source/tags aligned, this seed entry will still overwrite canonical metadata from documentation/adr/ADR-002.md (e.g., created_at/updated_at) because handleKbUpsert fills missing timestamps and the Prolog upsert retracts all existing triples for the entity before re-asserting. If the goal is execution-order idempotence vs doc-sync, include the canonical timestamps (and any other fields you want preserved) in the seeded properties, or adjust the upsert path to preserve existing created_at on updates.

Copilot uses AI. Check for mistakes.
},
{
Expand Down Expand Up @@ -242,7 +242,7 @@ const entities: EntityDef[] = [
properties: {
title:
"vscode-full-features: full VS Code extension with graph visualization",
status: "inactive",
status: "active",
source: "documentation/flags/FLAG-001.md",
tags: ["vscode", "deferred", "post-v0"],
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FLAG-001 still doesn’t mirror the canonical markdown: documentation/flags/FLAG-001.md uses tags [vscode, deferred, graph], but this seed uses [vscode, deferred, post-v0]. Since entity upsert retracts and rewrites all properties, running this script after doc-sync will overwrite the doc-derived tags and keep KB state order-dependent. Align the tags (and any other canonical fields you intend to preserve) with the markdown source.

Suggested change
tags: ["vscode", "deferred", "post-v0"],
tags: ["vscode", "deferred", "graph"],

Copilot uses AI. Check for mistakes.
},
Expand Down Expand Up @@ -346,10 +346,10 @@ const entities: EntityDef[] = [
type: "scenario",
id: "SCEN-001",
properties: {
title: "Agent queries requirements from KB via MCP kb_query tool",
status: "passing",
source: "scripts/populate-kb.ts",
tags: ["mcp", "query", "agent"],
title: "Critical Feature Scenario",
status: "active",
source: "documentation/scenarios/SCEN-001.md",
tags: ["critical"],
},
Comment on lines 346 to 353
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

documentation/scenarios/SCEN-001.md includes created_at/updated_at and multiple links (which become relationships). This seed upsert does not include timestamps or relationships, and entity upsert retracts all triples for the entity URI; if populate-kb.ts runs after doc-sync it can wipe SCEN-001’s outgoing relationships and replace canonical timestamps with new defaults. To make execution order truly idempotent, seed the canonical timestamps and the relationships derived from links (or change the upsert flow to preserve existing timestamps/relationships when updating).

Copilot uses AI. Check for mistakes.
},
{
Expand Down