Skip to content

Commit 2cb400a

Browse files
docs(08-01): complete project notes copilot backend + component prop extensions plan
1 parent 61de0a7 commit 2cb400a

3 files changed

Lines changed: 131 additions & 9 deletions

File tree

  • .planning

‎.planning/ROADMAP.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ Phases execute in numeric order: 1 → 2 → 3 → 4 → 5 → 6 → 7 → 8
116116
| 5. Integration Polish | 1/1 | Complete | 2026-03-16 |
117117
| 6. CSV Loading Framework | 3/3 | Complete | 2026-03-17 |
118118
| 7. Experiment Table View | 4/4 | Complete | 2026-03-17 |
119-
| 8. Project Notes IDE | 0/3 | Planning | — |
119+
| 8. Project Notes IDE | 1/3 | In Progress| |
120120

121121
### Phase 6: CSV Loading Framework for Experiments
122122
**Goal**: Researchers can import CSV files containing experiment results into the experiment tree, with a multi-step wizard for column mapping, tree preview with interactive editing, and collision resolution for re-imports
@@ -173,7 +173,7 @@ Plans:
173173
4. Graph view shows all four node types with experiment group hull boundaries and physics controls
174174
5. AI copilot accepts @-mentioned experiments with config/metrics context and linked literature references
175175
6. Copilot produces suggestion tabs with diff view, accept/reject, and inline metric comparison charts
176-
**Plans:** 3 plans
176+
**Plans:** 1/3 plans executed
177177

178178
Plans:
179179
- [ ] 08-01-PLAN.md — Backend copilot infrastructure (migration, service, router) + NoteGraphView/NotesCopilotPanel prop extensions

‎.planning/STATE.md‎

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ gsd_state_version: 1.0
33
milestone: v1.0
44
milestone_name: milestone
55
status: executing
6-
stopped_at: Completed 07-03-PLAN.md (human verification approved — Phase 7 complete)
7-
last_updated: "2026-03-17T19:04:47.700Z"
6+
stopped_at: Completed 08-01-PLAN.md
7+
last_updated: "2026-03-18T08:10:50.420Z"
88
last_activity: 2026-03-17 — Completed plan 07-00 (Extract useLocalStorage hook, table view test scaffolds RED phase)
99
progress:
10-
total_phases: 7
10+
total_phases: 8
1111
completed_phases: 7
12-
total_plans: 24
13-
completed_plans: 24
12+
total_plans: 27
13+
completed_plans: 25
1414
percent: 100
1515
---
1616

@@ -68,6 +68,7 @@ Progress: [████████████] 100%
6868
| Phase 07-experiment-table-view P01 | 8 | 2 tasks | 1 files |
6969
| Phase 07-experiment-table-view P02 | 4 min | 2 tasks | 1 files |
7070
| Phase 06-implement-a-csv-loading-framework-to-nest-into-the-experimental-design P02 | 10 | 2 tasks | 1 files |
71+
| Phase 08-port-library-notes-ide-features-to-project-notes P01 | 20 min | 2 tasks | 8 files |
7172

7273
## Accumulated Context
7374

@@ -147,11 +148,15 @@ Recent decisions affecting current work:
147148
- [Phase 07-experiment-table-view]: Bulk actions (set status, duplicate, delete) shared between tree and table views via same selectedIds state
148149
- [Phase 07-experiment-table-view]: Group separator borders used instead of colored group headers in table view — less visual noise
149150
- [Phase 07-experiment-table-view]: Status and Parent columns pinned before config/metric groups so they are always visible on the left
151+
- [Phase 08-port-library-notes-ide-features-to-project-notes]: project_notes_copilot_service.py is separate from notes_copilot_service.py to avoid branching — same architecture, different scope key
152+
- [Phase 08-port-library-notes-ide-features-to-project-notes]: storagePrefix prop on NoteGraphView prevents localStorage key collisions between library and project graph views
153+
- [Phase 08-port-library-notes-ide-features-to-project-notes]: sendFn/scopeId prop injection pattern lets NotesCopilotPanel serve both library and project scopes without forking
150154

151155
### Roadmap Evolution
152156

153157
- Phase 6 added: Implement a CSV loading framework to nest into the experimental design
154158
- Phase 7 added: Implement an alternative table view for experiments with spreadsheet-like filters and sorts
159+
- Phase 8 added: Port library notes IDE features to project notes (sidebar width, pinned notes, tabs, wikilinks, graph view, AI copilot with experiment results)
155160

156161
### Pending Todos
157162

@@ -174,5 +179,5 @@ None yet.
174179

175180
## Session Continuity
176181

177-
Last session: 2026-03-18T19:30:00Z
178-
Stopped at: Completed quick task 6 (experiment folders in ProjectNotes via composite notes array)
182+
Last session: 2026-03-18T08:10:50.415Z
183+
Stopped at: Completed 08-01-PLAN.md
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
---
2+
phase: 08-port-library-notes-ide-features-to-project-notes-sidebar-width-pinned-notes-tabs-wikilinks-graph-view-ai-copilot-with-experiment-results
3+
plan: 01
4+
subsystem: ai, api, ui
5+
tags: [fastapi, react, openai, copilot, experiment-context, notes]
6+
7+
# Dependency graph
8+
requires:
9+
- phase: 03-experiment-tree
10+
provides: experiments table + note service experiment_id support
11+
- phase: 08-port-library-notes-ide-features
12+
provides: NotesCopilotPanel + NoteGraphView shared components
13+
provides:
14+
- POST /api/projects/{id}/notes-copilot endpoint with experiment context building
15+
- project_id column on chat_messages (migration 020)
16+
- NoteGraphView: customSourceColors, customSourceLabels, storagePrefix props
17+
- NotesCopilotPanel: sendFn, scopeId, experiments props + experiments in @ mention dropdown
18+
- projectNotesCopilotApi exported from api.js
19+
affects: [08-02-project-notes-ide]
20+
21+
# Tech tracking
22+
tech-stack:
23+
added: []
24+
patterns:
25+
- "sendFn/scopeId prop injection to NotesCopilotPanel for project-scoped sends without forking component"
26+
- "storagePrefix prop on NoteGraphView to prevent localStorage key collisions between library/project graphs"
27+
- "Experiment context block: config KVs + metrics KVs + children summaries serialized into system message"
28+
- "ITEM_STYLE lookup table extended with experiment type (indigo/science icon)"
29+
- "EXPERIMENT_STATUS_COLOR map for colored status dots in @ mention dropdown"
30+
31+
key-files:
32+
created:
33+
- backend/migrations/020_project_notes_copilot.sql
34+
- backend/services/project_notes_copilot_service.py
35+
- backend/routers/project_notes_copilot.py
36+
modified:
37+
- backend/models/chat.py
38+
- backend/app.py
39+
- frontend/src/components/NoteGraphView.jsx
40+
- frontend/src/components/NotesCopilotPanel.jsx
41+
- frontend/src/services/api.js
42+
43+
key-decisions:
44+
- "project_notes_copilot_service.py copies architecture from notes_copilot_service.py but scopes to project_id — avoids overloading one service with branching logic"
45+
- "suggest_note_create target_type enum extended to include 'project' and 'experiment' so AI can propose notes under either entity"
46+
- "storagePrefix prop on NoteGraphView replaces hardcoded 'researchos.graph.' prefix — project graph settings stored at 'researchos.project.graph.' to avoid collision"
47+
- "experiments prop passed to NotesCopilotPanel with children pre-filtered client-side — avoids extra server round-trip at mention selection time"
48+
- "Show type checkboxes in NoteGraphView now iterate Object.keys(mergedColors) instead of hardcoded list — allows custom types added via customSourceColors to appear"
49+
50+
patterns-established:
51+
- "Backend copilot pattern: service handles persistence+LLM, router is a thin wrapper — same as library notes copilot"
52+
- "Context item metadata pattern: arbitrary dict field allows experiment config/metrics/children without schema changes"
53+
54+
requirements-completed: [IDE-05, IDE-04]
55+
56+
# Metrics
57+
duration: 20min
58+
completed: 2026-03-18
59+
---
60+
61+
# Phase 08 Plan 01: Project Notes Copilot Backend + Component Prop Extensions Summary
62+
63+
**Project-scoped AI copilot backend (POST /api/projects/{id}/notes-copilot) with experiment context building + NoteGraphView/NotesCopilotPanel prop extensions for reuse in ProjectNotesIDE**
64+
65+
## Performance
66+
67+
- **Duration:** ~20 min
68+
- **Started:** 2026-03-18T16:00:00Z
69+
- **Completed:** 2026-03-18T16:20:00Z
70+
- **Tasks:** 2
71+
- **Files modified:** 8
72+
73+
## Accomplishments
74+
- Created full backend copilot stack: migration adding project_id to chat_messages, service with experiment context building (_build_context_block handles status/config/metrics/children for experiment items), and router with GET/POST/DELETE endpoints under /api/projects/{id}/notes-copilot
75+
- Extended NoteGraphView with customSourceColors, customSourceLabels, and storagePrefix props; all SOURCE_COLOR/SOURCE_LABEL references replaced with merged counterparts; Show checkboxes now dynamic over merged keys
76+
- Extended NotesCopilotPanel with sendFn/scopeId override and experiments prop; @ mention dropdown shows experiments with status dot + metrics preview; projectNotesCopilotApi exported from api.js
77+
78+
## Task Commits
79+
80+
Each task was committed atomically:
81+
82+
1. **Task 1: Backend migration, service, router for project notes copilot** - `4338bbd` (feat)
83+
2. **Task 2: Extend NoteGraphView, NotesCopilotPanel props + frontend API client** - `61de0a7` (feat)
84+
85+
## Files Created/Modified
86+
- `backend/migrations/020_project_notes_copilot.sql` - Adds project_id column + index to chat_messages
87+
- `backend/models/chat.py` - Added project_id to ChatMessage; extended NotesCopilotContextItem docstring; added ProjectNotesCopilotMessageCreate model
88+
- `backend/services/project_notes_copilot_service.py` - Project-scoped copilot service with experiment context block building
89+
- `backend/routers/project_notes_copilot.py` - GET/POST/DELETE /api/projects/{id}/notes-copilot router
90+
- `backend/app.py` - Wire project_notes_copilot router
91+
- `frontend/src/components/NoteGraphView.jsx` - Added customSourceColors, customSourceLabels, storagePrefix props; replaced hardcoded SOURCE_COLOR/SOURCE_LABEL with merged versions
92+
- `frontend/src/components/NotesCopilotPanel.jsx` - Added sendFn, scopeId, experiments props; experiment @ mention with status dot + metrics preview; ITEM_STYLE + EXPERIMENT_STATUS_COLOR extended
93+
- `frontend/src/services/api.js` - Added projectNotesCopilotApi export
94+
95+
## Decisions Made
96+
- project_notes_copilot_service.py is a separate service (not merged with notes_copilot_service.py) to avoid branching complexity — same architecture, different scope key
97+
- suggest_note_create target_type enum includes 'project' and 'experiment' so the AI can propose notes at either scope
98+
- storagePrefix prop replaces hardcoded 'researchos.graph.' so library and project graph views don't share localStorage keys
99+
- Children for experiment context items are pre-filtered client-side by parentId at @ mention selection time — no extra round-trip
100+
101+
## Deviations from Plan
102+
103+
None - plan executed exactly as written.
104+
105+
## Issues Encountered
106+
None.
107+
108+
## User Setup Required
109+
Run `backend/migrations/020_project_notes_copilot.sql` in the Supabase SQL editor to add the project_id column to chat_messages before using the project notes copilot.
110+
111+
## Next Phase Readiness
112+
- Plan 02 (ProjectNotesIDE) can now import NoteGraphView with storagePrefix='researchos.project.graph.' and NotesCopilotPanel with sendFn=projectNotesCopilotApi.send + experiments prop without modifying shared components
113+
- projectNotesCopilotApi is ready for wiring in ProjectNotesIDE
114+
115+
---
116+
*Phase: 08-port-library-notes-ide-features-to-project-notes*
117+
*Completed: 2026-03-18*

0 commit comments

Comments
 (0)