Skip to content

FE-572: Canonical knowledge model foundation + cutover seam#34

Merged
lunelson merged 4 commits into
mainfrom
ln/fe-572-spike-knowledge-ontology
Apr 10, 2026
Merged

FE-572: Canonical knowledge model foundation + cutover seam#34
lunelson merged 4 commits into
mainfrom
ln/fe-572-spike-knowledge-ontology

Conversation

@lunelson
Copy link
Copy Markdown
Contributor

@lunelson lunelson commented Apr 9, 2026

No description provided.

@linear
Copy link
Copy Markdown

linear Bot commented Apr 9, 2026

FE-572 Spike: knowledge-layer redesign ontology, graph, and workspace direction

Summary

Run 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.

Question

What should the canonical knowledge-layer design be for:

  • durable ontology (goal, term, context, constraint, assumption, decision, requirement, criterion)
  • cross-kind graph/edge model
  • storage direction (unified generic model vs continued mixed legacy/generic seam)
  • primary review/workspace shape beyond the current sidebar summary UI

Constraints

  • Preserve slice 7's new phase_outcome readiness architecture unless the spike finds a compelling incompatibility
  • Do not harden the current framing-based mixed legacy/generic seam into the long-term model
  • Produce a migration direction that gates slices 8–10 and 12 without invalidating already-landed closure mechanics

Expected output

  • Spike verdict with evidence from current code/docs
  • Recommended target ontology, graph, storage, and workspace direction
  • Traceability updates in memory/SPEC.md and memory/PLAN.md
  • Follow-on recommendation for the first scoped implementation slice

Copy link
Copy Markdown
Contributor Author

lunelson commented Apr 9, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@lunelson lunelson changed the title feat: cut over scope knowledge to canonical goal term context kinds FE-572: Canonical knowledge model foundation + cutover seam Apr 9, 2026
@lunelson lunelson marked this pull request as ready for review April 9, 2026 12:30
@augmentcode
Copy link
Copy Markdown

augmentcode Bot commented Apr 9, 2026

🤖 Augment PR Summary

Summary: This PR lays the foundation for a canonical knowledge model and an explicit cutover seam away from the legacy “framing”/commitment storage.

Changes:

  • Introduces canonical knowledge kinds goal, term, and context (replacing durable framing usage in the UI and observer flow).
  • Updates the shared knowledge-kind registry and the client sidebar tabs to render the new collections.
  • Widens the observer schema and prompts to extract canonical scope kinds in scope mode and allow scope-kind corrections in later modes.
  • Cuts over decisions/assumptions persistence to the generic knowledge_item seam while keeping kind-specific collections as compatibility projections.
  • Adds a generic knowledge_edge table and switches dependency projection to read from it.
  • Extends the entities API (/api/projects/:id/entities) to return goals/terms/contexts plus relationships from knowledge_edge.
  • Adds a scope-bundle projection helper intended to preserve slice-7 closure semantics during the cutover.
  • Updates server/client tests and planning/spec docs to reflect the new ontology and seam.

Technical Notes: Dependency edges are now stored in knowledge_edge; decisions/assumptions are stored in knowledge_item and projected as dedicated collections for API/UI stability.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode Bot left a comment

Choose a reason for hiding this comment

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

Review completed. No suggestions at this time.

Comment augment review to trigger a new review at any time.

Copy link
Copy Markdown

@augmentcode augmentcode Bot left a comment

Choose a reason for hiding this comment

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

Review completed. 1 suggestion posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread src/server/db.ts
toItemId: number,
relation: InferSelectModel<typeof schema.knowledgeEdge>['relation'],
): void {
db.insert(schema.knowledgeEdge).values({ from_item_id: fromItemId, to_item_id: toItemId, relation }).run();
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

Copy link
Copy Markdown

@augmentcode augmentcode Bot left a comment

Choose a reason for hiding this comment

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

Review completed. 1 suggestion posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread src/server/db.ts
return 'knowledge_item';
}

export function getScopeBundleForProject(db: DB, projectId: number) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

Copy link
Copy Markdown

@augmentcode augmentcode Bot left a comment

Choose a reason for hiding this comment

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

Review completed. 1 suggestion posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread src/server/observer.ts
/** Schema for observer structured output. */
export const observerOutputSchema = z.object({
framing: z.array(
goals: z.array(
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

Copy link
Copy Markdown
Contributor Author

lunelson commented Apr 10, 2026

Merge activity

  • Apr 10, 11:44 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Apr 10, 11:49 AM UTC: Graphite rebased this pull request as part of a merge.
  • Apr 10, 11:50 AM UTC: @lunelson merged this pull request with Graphite.

@lunelson lunelson changed the base branch from ln/fe-539-explicit-phase-outcomes-scope-closure to graphite-base/34 April 10, 2026 11:47
@lunelson lunelson changed the base branch from graphite-base/34 to main April 10, 2026 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant