FE-572: Canonical knowledge model foundation + cutover seam#34
Conversation
FE-572 Spike: knowledge-layer redesign ontology, graph, and workspace direction
SummaryRun slice 7a as a time-boxed redesign spike to specify the canonical brunch knowledge model before Phase 5/6 review slices harden the transitional Phase 4 seam. QuestionWhat should the canonical knowledge-layer design be for:
Constraints
Expected output
|
🤖 Augment PR SummarySummary: This PR lays the foundation for a canonical knowledge model and an explicit cutover seam away from the legacy “framing”/commitment storage. Changes:
Technical Notes: Dependency edges are now stored in 🤖 Was this summary useful? React with 👍 or 👎 |
| toItemId: number, | ||
| relation: InferSelectModel<typeof schema.knowledgeEdge>['relation'], | ||
| ): void { | ||
| db.insert(schema.knowledgeEdge).values({ from_item_id: fromItemId, to_item_id: toItemId, relation }).run(); |
There was a problem hiding this comment.
addKnowledgeEdge() will persist edges to any existing knowledge_item IDs, but nothing here enforces that toItemId belongs to the same project_id as fromItemId. If the observer outputs an ID from another project that happens to exist, this can create cross-project edges that won’t show up in projections but will remain in the DB.
Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| return 'knowledge_item'; | ||
| } | ||
|
|
||
| export function getScopeBundleForProject(db: DB, projectId: number) { |
There was a problem hiding this comment.
getScopeBundleForProject() currently reads all items of each kind for the project, ignoring turn_knowledge_item provenance / active-path semantics. If turn-tree revisit/branching is in play, this can mix off-path/stale scope items into the scope bundle used for closure/readiness.
Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| /** Schema for observer structured output. */ | ||
| export const observerOutputSchema = z.object({ | ||
| framing: z.array( | ||
| goals: z.array( |
There was a problem hiding this comment.
In this widened observerOutputSchema, the dependency ID fields (parentDecisionIds/parentAssumptionIds below) are still validated as unconstrained numbers, so floats/negatives/hallucinated IDs can make it through parsing and then fail at FK/PK insert time. Tightening validation (and/or ignoring unknown IDs) would make observer runs less brittle to model output quirks.
Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
45a362f to
24f084f
Compare

No description provided.