Skip to content

FE-566: Generic knowledge layer schema and sidebar projection#28

Merged
lunelson merged 3 commits into
mainfrom
ln/fe-566-generic-knowledge-layer
Apr 10, 2026
Merged

FE-566: Generic knowledge layer schema and sidebar projection#28
lunelson merged 3 commits into
mainfrom
ln/fe-566-generic-knowledge-layer

Conversation

@lunelson
Copy link
Copy Markdown
Contributor

@lunelson lunelson commented Apr 7, 2026

feat: surface framing items through the generic knowledge seam

feat: project dependency relationships through the entity seam

@linear
Copy link
Copy Markdown

linear Bot commented Apr 7, 2026

FE-566 Generic knowledge layer schema and sidebar projection

Introduce the broader semantic layer (framing, constraint, decision, assumption, requirement, criterion) with generic provenance and graph edges, then project it into the sidebar without regressing current reads.

Acceptance

  • Project state can load and display generic knowledge items and edges from the active path
  • Existing resume and hydration behavior stays intact

Copy link
Copy Markdown
Contributor Author

lunelson commented Apr 7, 2026

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

@lunelson lunelson changed the base branch from ln/fe-564-flexible-turn-response-model to graphite-base/28 April 7, 2026 16:23
@lunelson lunelson force-pushed the ln/fe-566-generic-knowledge-layer branch from 91d1d75 to 4a3af60 Compare April 7, 2026 21:00
@lunelson lunelson changed the base branch from graphite-base/28 to main April 7, 2026 21:00
@lunelson lunelson force-pushed the ln/fe-566-generic-knowledge-layer branch from 07e5bb4 to 5a204a6 Compare April 8, 2026 10:27
@lunelson lunelson changed the title feat: surface framing items through the generic knowledge seam FE-566: Generic knowledge layer schema + sidebar projection Apr 8, 2026
@lunelson lunelson marked this pull request as ready for review April 8, 2026 19:50
@augmentcode
Copy link
Copy Markdown

augmentcode Bot commented Apr 8, 2026

🤖 Augment PR Summary

Summary: This PR introduces a generic knowledge-item persistence seam and projects the expanded entity model into the workspace sidebar without regressing existing decision/assumption reads.

Changes:

  • Adds new DB tables + migration: knowledge_item and turn_knowledge_item for generic knowledge kinds with turn provenance.
  • Extends getEntitiesForProject and GET /api/projects/:id/entities to return kind-specific collections (framing, constraints, requirements, criteria) plus a typed relationships[] dependency projection.
  • Updates workspace durable entity state to hydrate/refresh the expanded entity snapshot/query payload.
  • Expands EntitySidebar with new tabs for generic knowledge kinds and renders dependency “Depends on” lists for decisions/assumptions.
  • Adds/updates server + client tests covering generic kind projection, relationship hydration, and sidebar rendering.

Technical Notes: Dependency edges are projected from legacy parent-link tables into a unified depends_on relationship read model while decision/assumption writes remain on legacy tables.

🤖 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. 3 suggestions posted.

Fix All in Augment

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

.map((relationship) =>
contentByEntity.get(entityKey(relationship.target.collection, relationship.target.id)),
)
.filter((content): content is string => Boolean(content));
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

filter((content) => Boolean(content)) will drop valid empty-string content, which could cause some dependency labels to silently disappear if an entity’s content is ''. If empty strings are possible here, filtering only null/undefined would avoid that edge case.

Severity: low

Fix This in Augment

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

<p className="text-xs font-medium text-muted-foreground">Depends on</p>
<ul className="mt-1 list-disc pl-4 text-xs text-muted-foreground">
{dependencyLabels.map((label) => (
<li key={label}>{label}</li>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Using the dependency label (entity content) as the React key can collide when multiple dependencies share the same text, which can lead to incorrect list reconciliation/rendering. A stable key derived from the relationship’s identity would avoid content-based collisions.

Other locations where this applies: src/client/components/EntitySidebar.tsx:191

Severity: medium

Other Locations
  • src/client/components/EntitySidebar.tsx:191

Fix This in Augment

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

Comment thread src/server/db.ts
export function createKnowledgeItem(
db: DB,
projectId: number,
kind: KnowledgeKind,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

createKnowledgeItem takes kind: KnowledgeKind, which currently includes legacy kinds like 'decision' and 'assumption'; that makes it easy to accidentally write those into knowledge_item while the migration plan keeps them in dedicated tables. Narrowing the accepted kinds for this API would reduce the risk of split-brain entity storage during the transition.

Severity: medium

Fix This in Augment

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

@lunelson lunelson changed the title FE-566: Generic knowledge layer schema + sidebar projection FE-566: Generic knowledge layer schema and sidebar projection Apr 10, 2026
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:45 AM UTC: @lunelson merged this pull request with Graphite.

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