Pivot to text-first column-stack workspace + merge-with-review across AI artifacts
Workspace - Pivot from "set of open panes" to a Finder-style miller column stack: TopBar / LeftSidebar / [section → entity → entity ...] / pinned text editor. openPanesStore is now an ordered Column[] with pushFrom / closeFrom / setStack; only one top-level section is rooted at a time. - New entity column panes: Term, Block, Association, Constraint, Requirement, Finding. Click-through navigation truncates deeper columns automatically. - LeftSidebar surfaces a pending-count chip per section (single-glance navigation cue) and spins its analyze ↻ via SVG Spinner whenever the LLM is working — including server-initiated runs caught by the runs poll, not just user-triggered ones. Analyze pipeline + persistence - Unified `concepts` pass (taxonomy + glossary in one LLM call) replaces the two-pass setup. Server still accepts ?section=taxonomy|glossary and normalizes them for back-compat. - model / requirements / detection (assumptions, risks, inconsistencies) + cross-layer validation rules (X1–X4: stale term link, unlinked formalism, undefined linked term, prose-only term). - Persistence: NarrativeDocument, ModelSnapshot, ChangelogEntry, TaxonomyTerm, RequirementEntry, Finding, AnalysisRun. Re-runs MERGE instead of replace: gentle update on existing items, suggested on new, deprecated on missing — same idiom for every artifact kind. User pins preserve "kept" decisions across re-analyses. - Migrations: pivot_text_first, add_requirement_linked_term, term_review_state, review_state_for_reqs_and_findings, add_term_definition_pinned. Concept ↔ ontology integration - linkedTermId on Block / Association / Constraint / Requirement. PromoteToolbar lets the user formalize a concept inline: + Block / + Association / + Constraint / + Requirement, all routed through applyOps so undo/redo and SSE work for free. - decideElement op for in-canvas keep/discard on review-pending model elements. User-authored definitions - TermColumn definition is click-to-edit. Save (Cmd-Enter / blur), Cancel (Esc), Reset to AI suggestion when pinned. - definitionPinned flag on TaxonomyTerm: future Analyze runs leave the user's text alone. setTermDefinition repo function + POST /api/projects/[id]/terms/[termId]/definition endpoint. - mergeTaxonomySuggestion + applyGlossaryDefinitions both pin-aware. UX/UI - StatusChip: single component for all state idioms (suggested, deprecated, accepted, dismissed, resolved, severity, validation code, confidence, warn). Replaces 5+ ad-hoc badge classes. - PaneControls (PaneViewTabs + PaneFilterChip): separates view-mode toggles from filter chips so toggling Pending no longer flips you off the current view. - PaneEmpty: unified empty-state with title + hint + action. - PaneDrawer: collapsible groups for Pending / Discarded review; cards group as Kept (top) → Pending (bottom drawer) → Discarded (Findings only, hidden when empty). Restore action recovers dismissed/resolved findings. - ConceptCard unifies Tree and A–Z views in Concepts; only Tree parents carry the chevron (no empty placeholder offset). - Type + spacing tokens (--text-xs..xl, --space-1..6, --lh-tight/ui/ prose, --radius-*) replace every ad-hoc value. - Buttons standardized to body sans 500 (was a mishmash of mono / display). - Card shells unified across Concepts / Requirements / Findings. Cleanup - Removed: LeftRail, FindingsPanel, IssuesPanel, SocratesDock, ProposalCard, SlashMenu, SlashExtension, slashSuggestion, CanvasHeader, TaxonomyPane, GlossaryPane, TermDetail (popover; now TermColumn). - Section ids in openPanesStore: dropped taxonomy/glossary, added concepts. localStorage migration runs on hydrate. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -27,6 +27,112 @@ model Project {
|
||||
changes ChangelogEntry[]
|
||||
threads SocratesThread[]
|
||||
findings Finding[]
|
||||
document NarrativeDocument?
|
||||
taxonomy TaxonomyTerm[]
|
||||
reqs RequirementEntry[]
|
||||
runs AnalysisRun[]
|
||||
}
|
||||
|
||||
/// Canonical prose. After the pivot, the narrative is the source of truth;
|
||||
/// taxonomy / glossary / model / findings are projections produced by the
|
||||
/// Analyze pipeline.
|
||||
model NarrativeDocument {
|
||||
id String @id @default(cuid())
|
||||
projectId String @unique
|
||||
doc String // ProseMirror JSON
|
||||
version Int @default(1)
|
||||
updatedAt DateTime @updatedAt
|
||||
project Project @relation(fields: [projectId], references: [id], onDelete: Cascade)
|
||||
}
|
||||
|
||||
/// Taxonomy term (concept / entity) extracted by the analyze-taxonomy pass.
|
||||
/// Optionally linked to a SysML block, which surfaces the "linked" indicator
|
||||
/// in the sidebar and powers the click-to-jump action.
|
||||
model TaxonomyTerm {
|
||||
id String @id @default(cuid())
|
||||
projectId String
|
||||
parentId String?
|
||||
label String
|
||||
definition String?
|
||||
/// JSON-encoded string[] of synonym surface forms.
|
||||
synonyms String @default("[]")
|
||||
/// SysML block id this term is currently linked to (if any).
|
||||
linkedBlockId String?
|
||||
/// Model version when this term was last refreshed.
|
||||
modelVersion Int
|
||||
/// Review state. `accepted` (default — confirmed term, surfaces normally),
|
||||
/// `suggested` (analyzer added in last run, awaits user keep/discard),
|
||||
/// `deprecated` (analyzer didn't see in last run, awaits user keep/discard).
|
||||
status String @default("accepted")
|
||||
/// User explicitly chose to keep this term despite the analyzer not seeing
|
||||
/// it. Future merges leave it alone instead of re-marking it deprecated.
|
||||
pinned Boolean @default(false)
|
||||
/// User authored or edited the definition by hand. When true, future
|
||||
/// Analyze runs will NOT replace the definition — the LLM's emit is
|
||||
/// dropped on the floor. Reset by writing an empty string back through
|
||||
/// setTermDefinition (which clears the pin).
|
||||
definitionPinned Boolean @default(false)
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
project Project @relation(fields: [projectId], references: [id], onDelete: Cascade)
|
||||
parent TaxonomyTerm? @relation("TaxonomyTree", fields: [parentId], references: [id], onDelete: SetNull)
|
||||
children TaxonomyTerm[] @relation("TaxonomyTree")
|
||||
|
||||
@@index([projectId])
|
||||
@@index([projectId, label])
|
||||
@@index([projectId, status])
|
||||
}
|
||||
|
||||
/// Requirement extracted from prose. Traceability is a JSON list of block ids
|
||||
/// that the analyzer believes fulfill the requirement.
|
||||
model RequirementEntry {
|
||||
id String @id @default(cuid())
|
||||
projectId String
|
||||
tag String
|
||||
text String
|
||||
/// JSON-encoded string[] of block ids.
|
||||
tracedToIds String @default("[]")
|
||||
unsupported Boolean @default(false)
|
||||
modelVersion Int
|
||||
/// Term this requirement is conceptually about (links REQ → concept).
|
||||
/// Null when the requirement isn't anchored to a specific term.
|
||||
linkedTermId String?
|
||||
/// Review state. Same triple as TaxonomyTerm — `accepted` (default,
|
||||
/// surfaces normally), `suggested` (analyzer added in last run), or
|
||||
/// `deprecated` (analyzer didn't see in last run). Pending statuses
|
||||
/// await user keep/discard.
|
||||
status String @default("accepted")
|
||||
/// User explicitly preserved → don't re-deprecate next merge.
|
||||
pinned Boolean @default(false)
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
project Project @relation(fields: [projectId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@index([projectId])
|
||||
@@index([projectId, status])
|
||||
}
|
||||
|
||||
/// One row per Analyze invocation per section. Powers last-run timestamps
|
||||
/// and progress indicators in the sidebar.
|
||||
model AnalysisRun {
|
||||
id String @id @default(cuid())
|
||||
projectId String
|
||||
/// "taxonomy" | "glossary" | "model" | "requirements"
|
||||
/// | "assumptions" | "risks" | "inconsistencies" | "all"
|
||||
section String
|
||||
/// "running" | "succeeded" | "failed"
|
||||
status String
|
||||
startedAt DateTime @default(now())
|
||||
finishedAt DateTime?
|
||||
modelVersion Int
|
||||
inputTokens Int?
|
||||
outputTokens Int?
|
||||
errorMessage String?
|
||||
|
||||
project Project @relation(fields: [projectId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@index([projectId, section])
|
||||
@@index([projectId, startedAt])
|
||||
}
|
||||
|
||||
model ModelSnapshot {
|
||||
@@ -106,8 +212,23 @@ model Finding {
|
||||
severity String?
|
||||
/// Inconsistencies only: optional structural-rule code (S1, M2, T1, …)
|
||||
validationCode String?
|
||||
/// Lifecycle: "open" | "dismissed" | "resolved"
|
||||
status String @default("open")
|
||||
/// Lifecycle (review-aware):
|
||||
/// "suggested" — new from latest run, awaits user keep/discard
|
||||
/// "accepted" — user has explicitly kept (or carried forward); the
|
||||
/// normal "open" surfaces in the pane
|
||||
/// "deprecated"— was accepted, analyzer didn't see in latest run
|
||||
/// "dismissed" — user said never (don't resurface)
|
||||
/// "resolved" — user marked done
|
||||
/// Pre-existing rows from before merge-with-review used "open"; we
|
||||
/// continue to accept that value as a synonym for "accepted" for one
|
||||
/// release.
|
||||
status String @default("suggested")
|
||||
/// User explicitly preserved → don't re-deprecate next merge.
|
||||
pinned Boolean @default(false)
|
||||
/// Stable identity key for cross-run matching. For LLM findings:
|
||||
/// `<kind>:<normalized-text>`; for cross-validation: `<validationCode>:<elementId>`.
|
||||
/// Null on legacy rows.
|
||||
suggestionKey String?
|
||||
/// Model version this finding was detected against.
|
||||
modelVersion Int
|
||||
/// Provider + model that emitted the finding.
|
||||
@@ -120,6 +241,7 @@ model Finding {
|
||||
|
||||
@@index([projectId, status])
|
||||
@@index([projectId, kind])
|
||||
@@index([projectId, suggestionKey])
|
||||
}
|
||||
|
||||
/// Web research results from validating a finding via Tavily / similar.
|
||||
|
||||
Reference in New Issue
Block a user