feat(frontend): AI suggestion history in app state - #156
Conversation
Store generated note text per SG versionId in React state only; remove AISuggestionManager and related types from @dna/core. Call generateNote from useAISuggestion with debounced transcript regeneration. Keep Assistant version navigation; expose prompt/context for Prompt Debug only when viewing the newest note. Restore localStorage/sessionStorage polyfill in Vitest setup for ThemeModeProvider. Signed-off-by: Briana Johnson <brianajohnsxn@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
|
Note: the pink box is just to highlight the change, it is NOT visible in the interface! |
|
Dropping note here but talked in person! We should not remove the module from the core. It should contain the fetch logic in core then store in the state hook in the app package. |
|
Hey let me know if you need help pushing on the CLA signing |
|
Just following up on this. Let me know if you need help pinging someone within ILM to get the DCO check resolved |
|
Hey @jspada200! I pinged you on work chat abt this but Francois said he cant give personal accounts DCO perms. I’ll copy the code onto my work account and try again on Monday? |
|
Ah ic. I think in this specific case, it would be ok to sign the dco as an individual contributor. The complexity of moving it over is a pain. |
|
Thank you @jspada200! I have signed as an individual contributor. Just resolved the last two conflicts; ok to merge? |
# Summary Display pending note publishes in a new UI ## Testing - [X] I have tested these changes locally - [X] I have run all relevant automated tests - [X] I have verified this does not break existing workflows - [X] For changes that can be tested in UI, I have included screenshots or gif animations of the changes. ## How I Tested Published new notes and updated existing <img width="1453" height="1108" alt="2026-05-11 16 51 22" src="https://github.com/user-attachments/assets/d4cba001-0eb2-43a5-b5a7-bbd62e229b44" /> --------- Signed-off-by: James Spadafora <spadjv@gmail.com>
# Summary Hid the other notes tab. Note: This commit was done with the help of Claude code plugged into Zed code editor. ## Testing - [x] I have tested these changes locally - [x] I have run all relevant automated tests - [x] I have verified this does not break existing workflows - [x] For changes that can be tested in UI, I have included screenshots or gif animations of the changes. ## How I Tested I stood the application up and tried to click the area where the other notes tab existed before. I looked at the console to see if any errors were being produced at refresh of page or by clicking around. <img width="756" height="642" alt="Screenshot 2026-05-14 at 7 10 16 PM" src="https://github.com/user-attachments/assets/5b2cdc89-a1a8-4581-978a-5c4332d4b627" /> --------- Signed-off-by: Cameron Target <camerontarget@gmail.com>
Re-export AISuggestionManager from core with shared app singleton beside apiHandler for pipeline consumers. Delegate generation and debounced transcript regeneration to the manager while keeping per-version suggestion history in the hook. Signed-off-by: Briana Johnson <brianajohnsxn@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Restore the prior hook layout (notesByVersionId, runGenerate, regenerate). Delegate generate and transcript debounce to aiSuggestionManager; subscribe once to mirror loading, errors, and history updates when scheduled runs finish. Signed-off-by: Briana Johnson <brianajohnsxn@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
AISuggestionManager now only orchestrates generate-note calls and tracks loading/error. useAISuggestion stores note snapshots and history navigation in React state. Signed-off-by: Briana Johnson <brianajohnsxn@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
…n#158) # Summary Add docs related to CLAs and Slack channels. This is based on feedback from first time contributors. Signed-off-by: James Spadafora <spadjv@gmail.com>
# Summary This is a heavy but cool one! This change adds a note QC workflow. It allows users to add checks to notes with natural language then these checks run on publish. For example, you can verify a note vs the transcript. <img width="290" height="276" alt="image" src="https://github.com/user-attachments/assets/d9af6406-4532-44b4-94bf-5e6269c8653f" /> Checks can be added via the settings UI <img width="2106" height="1242" alt="2026-05-14 14 34 31" src="https://github.com/user-attachments/assets/75cae0f1-0f25-4c3f-b572-8cb2f89fd634" /> These checks run in the publish UI. They can update the note itself or the other fields on the note. The checks have access to tools to browse the prodtracking software. An example of where this can be used is to find attachments to plug into the note links, tos, or CCs, <img width="2106" height="1242" alt="2026-05-14 14 35 23" src="https://github.com/user-attachments/assets/842f918b-d411-4cc3-a271-e3aa8d7dd13b" /> ## Testing - [X] I have tested these changes locally - [ X ] I have run all relevant automated tests - [ X ] I have verified this does not break existing workflows - [X] For changes that can be tested in UI, I have included screenshots or gif animations of the changes. ## How I Tested - Created a transcript missing info and the QC catches it - Created a note mentioning a person who was not tagged - Checked content of a note to ensure it contained the requested information. --------- Signed-off-by: James Spadafora <spadjv@gmail.com>
…n#159) # Summary DevDays 2026 prompt eval submission. Includes 4 prompt variants tested against the shared dataset. notes_v4.txt is my original prompt. Key finding: model choice significantly impacts eval scores. phi4 scored 100% on the baseline prompt vs 71% with gemma2:9b and 19% with llama3.1:8b. All ran locally via Ollama. ## Testing - [X] I have tested these changes locally - [X] I have run all relevant automated tests - [X] I have verified this does not break existing workflows - [ ] For changes that can be tested in UI, I have included screenshots or gif animations of the changes. ## How I Tested Ran promptfoo eval from inside evals/devdays_2026/jtaruc_001/ using ollama:chat:phi4 as the provider. Results saved to jtaruc_001.csv included in this PR. Signed-off-by: Jerome Taruc <jerometaruc29@gmail.com> Co-authored-by: Cameron Target <127965975+camerontarget14@users.noreply.github.com>
…wareFoundation#162) # Summary This branch fixes the QC checks failing server side due to an auth issue. In addition, refine the prompt for the QC check to make it more reliable and provide more context about the fields of the draft note. This commit introduces a new file for API authorization rules, detailing the authentication provider pairing and user-scoped versus playlist-scoped API authorization. It also adds a utility function for case-insensitive email comparison to enhance authorization checks. ## Changes - New file: `.cursor/rules/api-auth-and-qc.mdc` with detailed API authorization guidelines. - New utility: `emails_match` function in `backend/src/dna/auth/email.py` for comparing email addresses. - Updated backend authorization checks to use `emails_match` for user email comparisons in several endpoints. - Added tests for the new email comparison function and updated tests for QC checks to reflect the new authorization logic. ## Testing - [X] Changes tested locally - [X] All relevant automated tests run successfully - [X] Verified no existing workflows are broken ## How I Tested Deployed branch to server --------- Signed-off-by: James Spadafora <spadjv@gmail.com>
# Summary New contributors have reported difficulty getting the stack running locally. This PR adds a single interactive `bootstrap.sh` script at the repo root that automates the entire first-time setup in one command. The script handles: - **Prerequisite checks** — verifies `npm` and `docker` are installed and the Docker daemon is running, with actionable error messages for each failure - **Config file setup** — backs up any existing files (timestamped `.bak.*`) then copies all three example configs: `docker-compose.local.yml`, `docker-compose.local.vexa.yml`, and `frontend/packages/app/.env` - **LLM provider setup** — interactive prompt for OpenAI or Gemini API key (skippable, leaves placeholder with a reminder) - **Transcription service setup** — presents three options: remote vexa.ai free tier (recommended), self-hosted Whisper service (with step-by-step instructions), or skip (automatically injects `SKIP_TRANSCRIPTION_CHECK=true` so Vexa starts cleanly) - **Frontend dependencies** — runs `npm install` in `frontend/` - **Vexa API key generation** — starts the Vexa services, waits for the admin API to be ready, creates a local dev user, generates an API token, and writes `VEXA_API_KEY` into `docker-compose.local.yml` automatically - **Full stack startup** — runs the equivalent of `make start-local` in detached mode The script is re-runnable: if config files already exist they are backed up before being overwritten. The `.gitignore` files are updated to exclude the `.bak.*` files the script produces. Compatible with macOS and Linux. ## Testing - [x] I have tested these changes locally - [x] I have run all relevant automated tests - [x] I have verified this does not break existing workflows - [x] For changes that can be tested in UI, I have included screenshots or gif animations of the changes. ## How I Tested Ran `./bootstrap.sh` on Linux (WSL2) end-to-end: 1. Selected OpenAI as LLM provider and entered a key — confirmed written to `docker-compose.local.yml` 2. Selected remote transcription (option 1) and entered a vexa.ai key — confirmed written to `docker-compose.local.vexa.yml` 3. Observed `npm install` complete successfully 4. Observed Vexa services start and the admin API become ready on `:8056` 5. Confirmed user creation (HTTP 201) and token generation via the Vexa admin API 6. Confirmed `VEXA_API_KEY` injected into `docker-compose.local.yml` 7. Confirmed full stack started with `docker compose up --build -d` Also verified: - Re-running the script backs up existing config files rather than silently overwriting them - Selecting "skip" for transcription appends `SKIP_TRANSCRIPTION_CHECK=true` to `docker-compose.local.vexa.yml` and Vexa starts without the 403 error - Bash syntax validated with `bash -n bootstrap.sh` - Admin API port corrected to `8056` (the gateway port accessible from the host; `8057` is internal Docker-network only) --------- Signed-off-by: James Spadafora <spadjv@gmail.com> Signed-off-by: Cameron Target <camerontarget@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Cameron Target <127965975+camerontarget14@users.noreply.github.com> Co-authored-by: Cameron Target <camerontarget@gmail.com>
…cademySoftwareFoundation#138) # Summary Adds a feature-flagged workflow that publishes a version's captured transcript into the production tracking system as a single custom-entity row per `(playlist, version, meeting)`. Ships dark: endpoint returns 404 and the UI button is hidden unless `DNA_ENABLE_TRANSCRIPT_PUBLISH=true` (backend) and `VITE_ENABLE_TRANSCRIPT_PUBLISH=true` (frontend build) are set. Closes AcademySoftwareFoundation#120. ## What changed Backend: - New pure helper `build_transcript_payload` in `dna/transcription_publish.py` (dedupe, sort, same-speaker collapse, stable `body_hash`). - New Mongo collection `published_transcripts` for bookkeeping, keyed by `(playlist_id, version_id, meeting_id)`; stores the SG entity id, the entity type at create time, and the `body_hash` used for idempotence. - Two methods on `ProdtrackProviderBase`: `publish_transcript` (create) and `update_transcript` (patch body + meeting_date only). ShotGrid implementation targets the slot configured via `SHOTGRID_TRANSCRIPT_ENTITY` (default `CustomEntity01`); the mock provider raises `NotImplementedError` with a user-facing message. - New REST endpoint `POST /playlists/{playlist_id}/publish-transcript` that wires the above together. Returns `created` / `updated` / `skipped` (when `body_hash` is unchanged). Feature-flagged off by default. Frontend: - New types `PublishTranscriptRequest` / `PublishTranscriptResponse` and `ApiHandler.publishTranscript` in `@dna/core`. - New `usePublishTranscript` hook and `PublishTranscriptDialog` Radix-Themes dialog in `@dna/app`. - Trigger button wired into the header of `TranscriptPanel`, visible only when `VITE_ENABLE_TRANSCRIPT_PUBLISH=true` and segments exist. Docs: - `QUICKSTART.md` — new env-var rows. - `DEPLOYMENT.md` — ShotGrid site-setup checklist (enable custom entity, fields, script-user perms). - `backend/docs/TRANSCRIPTION_PIPELINE.md` — new "Publishing to the Production Tracking System" section and ADR-005/006/007 (custom entity, body_hash idempotence pinned to bookkeeping, build-at-publish-time). - `backend/example.docker-compose.local.yml` — the two new vars default off. ## Design decisions worth flagging - `update_transcript` uses `existing.sg_entity_type` from the bookkeeping row, not the current env. This lets studios migrate to a new `CustomEntityNN` slot without breaking updates to rows created on the previous one. - If the SG create succeeds but the local bookkeeping upsert then fails, the endpoint surfaces a 500 whose message includes the SG entity id and logs at exception level, so operators can reconcile manually instead of blindly retrying (which would duplicate the SG row). - Coupling with AcademySoftwareFoundation#135: segment reading is isolated in `build_transcript_payload`, so when `StoredSegment` changes shape the publisher is a one-file diff. ## Testing - [x] I have tested these changes locally - [x] I have run all relevant automated tests - [x] I have verified this does not break existing workflows - [ ] For changes that can be tested in UI, I have included screenshots or gif animations of the changes. (Deferred: the Publish button / dialog only render against a real ShotGrid site that has the custom entity provisioned. Screenshots to be added when a test site is available; see DEPLOYMENT.md for the site-setup checklist.) ## How I Tested Backend: - `make test` in the backend docker stack: 552 passed, coverage 91% (floor 90%). - New file coverage: `transcription_publish.py` 100%; `published_transcript.py` 100%. - Brought the stack up with `make start-local` and `PRODTRACK_PROVIDER=mock`: - `curl /health` returned 200. - `POST /playlists/{id}/publish-transcript` with flag off returned 404. - With flag on and no metadata, returned 422 with the documented reason. - With flag on, no segments, returned 422. - With flag on and the mock provider, surfaced 501 with the "live ShotGrid connection required" message. - Verified naive-timestamp handling under `TZ=America/New_York` (the failing-first test only passes after the UTC-fallback fix). Frontend: - `@dna/core`: `tsc --noEmit` clean, 58 vitest tests pass. - `@dna/app`: 8 new vitest cases for the hook and dialog pass; Radix no longer warns about a missing `Dialog.Description`. Formatting: - `make format-python` clean. - `prettier --check` clean on touched frontend files. ## Rollout Flag off by default. Studios opt in by: 1. Enabling a `CustomEntityNN` slot on their ShotGrid site (see `DEPLOYMENT.md` for fields and permissions). 2. Setting `DNA_ENABLE_TRANSCRIPT_PUBLISH=true` and `SHOTGRID_TRANSCRIPT_ENTITY=CustomEntityNN` on the backend. 3. Setting `VITE_ENABLE_TRANSCRIPT_PUBLISH=true` on the frontend build. Rollback is dropping the flag; no schema migration required. ## Known V1 limitations (documented in ADRs) - No unique index on `published_transcripts` in this PR; two concurrent publishes against the same `(playlist, version, meeting)` can create two SG rows before either writes the bookkeeping row. Low-probability; acceptable for V1. - No automated summary generation; `sg_summary` is left blank for users to fill on the SG side. - `created_by` on the SG row is the script user, not the DNA user who clicked publish (no sudo in V1). --------- Signed-off-by: thc1006 <84045975+thc1006@users.noreply.github.com> Signed-off-by: Cameron Target <camerontarget@gmail.com> Co-authored-by: Cameron Target <camerontarget@gmail.com>
…urns (AcademySoftwareFoundation#163) # Summary - Fixes an auth issue that shows up in some cases - Runs check async so that we do not time out ## Testing - [X] I have tested these changes locally - [X] I have run all relevant automated tests - [X] I have verified this does not break existing workflows ## How I Tested Ran QC checks locally --------- Signed-off-by: James Spadafora <spadjv@gmail.com> Co-authored-by: Cameron Target <127965975+camerontarget14@users.noreply.github.com>
I moved some settings around and (currently) have them disabled by default. I also put together a setting for which page to sync with ShotGrid and the chrome plugin. I used Claude Code, plugged into my Zed code editor to make these changes. - [x] I have tested these changes locally - [x] I have run all relevant automated tests - [x] I have verified this does not break existing workflows - [x] For changes that can be tested in UI, I have included screenshots or gif animations of the changes. I stood the application up and tried a few different configurations. <img width="1023" height="416" alt="DNA_GIF" src="https://github.com/user-attachments/assets/5cefcfcd-35c3-4140-b215-9b7224642b46" /> <img width="606" height="547" alt="Screenshot 2026-06-03 at 10 36 30 AM" src="https://github.com/user-attachments/assets/fb89550b-1b4a-41fa-b6e6-b51edcfb68d5" /> --------- Signed-off-by: Cameron Target <camerontarget@gmail.com>
) # Summary Simple script to just inject some transcript from a json. Util to help with testing without live transcription. ## Testing - [X] I have tested these changes locally - [X] I have run all relevant automated tests - [X] I have verified this does not break existing workflows ## How I Tested Used successfully locally Signed-off-by: James Spadafora <spadjv@gmail.com> Co-authored-by: Cameron Target <127965975+camerontarget14@users.noreply.github.com>
# Summary Claude was used with Zed to put this PR together. Added glossaries support as context for AI notes. ## Testing - [x] I have tested these changes locally - [x] I have run all relevant automated tests - [x] I have verified this does not break existing workflows - [x] For changes that can be tested in UI, I have included screenshots or gif animations of the changes. ## How I Tested I ran the app and tried it all out. <img width="549" height="509" alt="Screenshot 2026-06-24 at 9 33 45 AM" src="https://github.com/user-attachments/assets/7181cd88-be3d-4b00-ad00-02cd3d01af11" /> <img width="519" height="351" alt="Screenshot 2026-06-24 at 9 34 47 AM" src="https://github.com/user-attachments/assets/e370b495-00e1-4ea6-bcdc-9f79c5e76d82" /> <img width="651" height="532" alt="Screenshot 2026-06-24 at 10 21 46 AM" src="https://github.com/user-attachments/assets/1e221545-15b9-4b98-a25d-9d0a4cf4bf31" /> --------- Signed-off-by: Cameron Target <camerontarget@gmail.com>
# Summary Adds Anthropic support for DNA, the boot strap script, and Also fixes bootstrap to properly allow for hosted vexa option. ## Testing - [x] I have tested these changes locally - [x] I have run all relevant automated tests - [x] I have verified this does not break existing workflows - [x] For changes that can be tested in UI, I have included screenshots or gif animations of the changes. ## How I Tested Tested by standing up the app and using it. --------- Signed-off-by: Cameron Target <camerontarget@gmail.com>
153313f to
e60a277
Compare
…nerate support. Move in-flight request deduplication to the manager, filter unusable model responses, and fix regenerate/history behavior while gating auto-generation on the AI enabled flag. Signed-off-by: Briana Johnson <brianajohnsxn@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
…l conflict. Keep suggestion history navigation and the AI enabled flag from this branch while adopting upstream main changes. Signed-off-by: Briana Johnson <brianajohnsxn@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
|
Hey @briwitched , I am not sure what is going on with the DCO. It looks like there were some bad commits in main. Will take a look, no action is needed on your end atm. Thanks! |
Summary
Store generated note text per SG versionId in React state only; remove AISuggestionManager and related types from @dna/core.
Call generateNote from useAISuggestion with debounced transcript regeneration. Keep Assistant version navigation; expose prompt/context for Prompt Debug only when viewing the newest note.
Restore localStorage/sessionStorage polyfill in Vitest setup for ThemeModeProvider.
Testing
How I Tested
npm run test-cilocalhost:5173Navigation between the notes of that session is shown below. When at max/min, the corresponding chevron is greyed out.