Repository navigation
Release 0.8.20: NEMAR AI experience, search overview, privacy choices, five-year retention - #735
Merged
Merged
Conversation
…p-after-v0.8.19 chore: sync develop with main after v0.8.19
* Stop suggesting https://*.pages.dev as a cors_origins example The validator's error message and the cors_origins docstring offered https://*.pages.dev as the wildcard example, which would authorize every Cloudflare Pages site. They now use a wildcard on a domain the community controls, and the docstring says why. Two .context notes likewise. No community config uses a shared-host wildcard. CORS tests pass (13), ruff clean. * Remove agent worktree paths staged by mistake * Review follow-up: the remaining *.pages.dev examples, and the apex note _wildcard_origin_to_regex's docstring and a wildcard-syntax test used https://*.pages.dev as their example; both now use example.org. The cors_origins docstring and the .context note add that a wildcard never matches the domain itself. Community config and CORS tests pass.
* chore: vendor NEMAR eegprep-lean 0.5.0 The wheel is the eegprep 0.5.0 release. eegprep and eegprep-lean now share one version, and the only package code change since 0.1.0.dev3 is help() and dir() (sccn/eegprep#440). Co-authored-by: Suraj Ranganath <[email protected]> * style: ruff format test_build_notebook_site Co-authored-by: Suraj Ranganath <[email protected]> --------- Co-authored-by: Cursor Agent <[email protected]>
* Point the osa-worker KV bindings at the sccn namespaces Swaps RATE_LIMITER_KV for production and env.dev to the namespaces created in the sccn Cloudflare account. Merge only after CI's Cloudflare credentials point at sccn: the new IDs do not exist in the personal account. * Document the sccn KV namespaces in the changelog, checklist and worker docs Addresses review findings on the KV binding swap: a changelog entry under Unreleased, the checklist step marked done for sccn, and the two places that said the namespaces already exist without naming the account. Docs and comments only; not run.
Epics E1 to E8 from the NEMAR team's feedback and the 2026-11-10 review, the delivery loop, and the review canvas boards as markup references. Documentation only; not tested.
protect-dev's required_approving_review_count is 0 since 2026-11-10 so the agent delivery loop can merge reviewed PRs without --admin; main is unchanged. Documentation only; verified the live ruleset with gh api.
…#682) AI Mode becomes a teal ActionBar pill on dataset pages that opens the center-stage dialog, and a toggle inside the search field on the home page and Discover. Plan E6 updated; E6 boards approved. Documentation only.
The AI Mode toggle's icon is the only sparkle; the field keeps its magnifier and the button stays Search. Documentation only.
* feat(widget): store up to 30 conversations (history format v3) Replace the single stored chat with a v3 record of up to 30 conversations (#654). Pure store functions beside CHAT_HISTORY_VERSION; loadHistory and saveHistory are thin callers. Saves re-read the record and replace only the active conversation; v1, v2 and bare-array records migrate to one conversation; a version above 3 is never overwritten; a full storage evicts the oldest inactive conversation and retries. Adds startConversation, listConversations, activateConversation and deleteConversation hooks, no UI. Existing widget tests read the active conversation; they pass. * test(widget): cover the conversation store, wired into CI Migration from v2, v1 and bare arrays, the 30-conversation limit, round trip, unreadable records, a full storage, and two widgets on one storage. 163 checks pass. * docs: describe saved conversations in the widget guide * fix(widget): conversation store review fixes (empty chats take no slot, unreadable records kept aside, votes do not bump updatedAt, feedback flushed on swap, quota notice); tested with test-widget-history-store.js * docs: saved conversations, unreadable record copy, mixed-version hazard, changelog entry * fix(widget): unreadable-record copy is best effort when storage is full, one unreadable rule, storage notices queue when the panel is closed, JSDoc typedefs; tested with test-widget-history-store.js * docs: unreadable record copy when storage is full, notice timing, changelog spacing
* test: record failing and noisy runs from real Pyodide as fixtures Adds record-run-card-fixtures.js, which runs a KeyError, a SyntaxError, an error with no line, cut stdout, cut stderr and a run with warnings through the worker core on the npm Pyodide, and the recorded data (stdout, stderr, traceback). Not yet used; the run card tests read it. Tested: regenerated and diffed. * feat: one run card for consent, running, done and failed runs (#664, #672) Replaces the consent/progress panel, the 'Ran Python' disclosure and the 'Code' disclosure with one card (a Run card block of pure builders in the widget). Done cards show figures first, then Show code (aria-expanded/controls), Copy code with a visible Copied, Output, Download and an in-card Edit and run. A restored card is the same card without figures. Failed runs open with Type: message, the failing line marked, All code, Full traceback (new stored traceback field) and Copy error, plus a retry line while the reply waits. Warnings of ok runs show as a collapsed count; cut output says how many characters are not shown. Stored stdout, stderr and traceback are cut from the middle so an error at the end of stderr survives. Tests: new test-widget-run-card.js (wired into CI), updated tools, popout and color-scheme suites, run-card-check.mjs screenshots at 400 px light and dark; docs rewritten. All frontend suites and tests/test_frontend pass. * test: allowlist run-card-check harness and run it in CI (tests/test_frontend 113 passed, harness passes locally) * fix: retry line says the assistant may run again; error type read from the traceback (run card tests 233 passed) * fix: run card keyboard reach, Copy error fallback, no-message line, card-scoped panels; docs and changelog (run card tests 246 passed, all widget suites and Chrome harness pass) * fix: run card Copy error builds its fallback block only when the copy is refused; type read from a module-qualified traceback; error text has a role and name (run card tests 261 passed, all widget suites and Chrome harness pass) * test: expect the empty traceback the loader adds to stored runs The run card stores a traceback on every run, and loading fills a missing one with an empty string. The conversation store test now feeds v2 runs without it and expects it on load. All frontend suites pass locally.
…essful runs (E4.1) (#684) * chore: add jupytext as a dev dependency for the notebook script round trip * feat: add the conversation notebook builder and its tests (E4.1) Builds an nbformat 4.5 notebook and a percent-format script from a chat's successful runs. Tested with bun, nbformat and jupytext over recorded and hand-authored conversations. * feat: expose buildConversationNotebook through OSARuntime and rebuild the bundle Regenerates the runtime bundle and its integrity line with Bun 1.4.3. Tested: bundle check and the bundle test, which compares the minified builder with the source. * ci: run the notebook builder tests with the frontend tests * docs: changelog entry for the conversation notebook builder * style: format the notebook builder test * fix: hoist only the leading import block, and keep colliding imports in their step Tested: bun frontend/test-notebook-builder.js (125 passed), new cases for sys.path.insert before an import, a written helper module, two imports of one name. * fix: escape markdown in titles from the chat; word the origin line without an article Tested: bun frontend/test-notebook-builder.js (129 passed). * test: the notebook fixture names read from the registry must equal what the builder built * docs: note the Jupytext version the script writer mirrors; cap the dev pin below 1.20 * build: rebuild the runtime bundle and its integrity hash for the notebook builder changes Tested: bun scripts/build-runtime-bundle.js --check * fix: escape $ and www. in chat text; name an unnamed left-out run once; define index before the hoisted imports Tested: bun frontend/test-notebook-builder.js * build: rebuild the runtime bundle and its integrity hash (tested: --check)
…pact summary (E8.1, E8.2) (#686) * feat: quick_model and analysis_model community keys (E8.1) Both or neither, each resolved through normalize_model, and an execute_code client tool is required. NEMAR sets haiku and sonnet. start_analysis is a reserved client tool name. Tested: config tests. * feat: tier decisions and the start_analysis client tool (E8.1) wants_analysis, the tier type, the quick-turn prompt section and the summary limit live in src/agents/model_routing.py. A quick turn binds start_analysis in place of execute_code and get_full_output. Tested: tests/test_agents. * feat: handover event sequence and new-session seeding (E8.2) stream_handover emits summarizing, summarized and started, seeds a new analysis session with the summary and the reader's message, and streams the analysis run on it. Tested with the router wiring in the next commit. * feat: route chat turns to the quick or analysis model and hand over (E8.1, E8.2) ChatSession.mode, a tier threaded through _configured_default, _select_model, _route_request and create_community_assistant, a quick-turn prompt section, start_analysis turned into a handover by the stream layer, mode on done, and /chat/resume on the session's tier. Tested: tests/test_api/test_model_routing.py with the model stand-in. * docs: handover events and routing keys; add LLM-marked routing tests Documents the handover events in docs/community-widget.md, the keys in yaml_registry.md and the changelog. The LLM tests skip without an Anthropic key and were not run here. * fix: narrow the keyword routing to unambiguous requests; a false match is sticky Bare run(s), spectrum, filter and fit matched ordinary BIDS and NEMAR vocabulary and moved the reader to the analysis model for the rest of the conversation. Tested: unit tests incl. negatives for the reported phrases. * fix: hold the turn claim across a handover instead of releasing it over a yield A first-message start_analysis released the session and re-claimed it after the nested run sent its session event; a handover claimed its new session only after the same event. Both now claim first and pass the claim on (turn_claimed). Tested: claims are None on every session after each handover path, follow-ups succeed, and the claim is held when the analysis run starts. * fix: retry the handover summary once and degrade instead of losing the turn A summarizer error after the summarizing event ended the stream. It now retries a provider failure that can clear, and falls back to the tail (not the head) of the reader's last three messages, logged and flagged degraded on the event. The summary is framed as background context and fenced from the reader's message. Tested: unit and stream-level tests with a failing summarizer. * fix: one request_log row per request id; meter the handover summary The quick run and the summary are logged as <request id>:quick, priced at the quick model, so done.request_id names one row. The summary's tokens are counted and it runs under the request's LangFuse config. Tested: rows per handover path read from the real metrics database. * refactor: define the Tier type once in the community config module Tier was written three times (model_routing, assistants/community, client_tools); all now import it from src.core.config.community. The quick-mode instruction merge is computed before the constructor call. Tested: routing and config tests. * fix: do not announce the start_analysis call as a tool_call; test the widget against the handover stream The widget set a 'writing' label for it and no tool_start or tool_end followed. Adds frontend/test-widget-handover-events.js (handover events ignored, second session event adopted, next message on the new session), wired into Frontend Tests. Tested: bun test passes, API tests pass. * test: assert handover event order by position; add quick-text-before-call and kill-switch cases Replaces a check that was always true with index comparisons, simplifies the redundant tool-binding assertion. Tested: API routing tests pass. * test: report the events when the analysis follow-up has no done; ask it to run nothing (LLM test, not run: no key) * fix: narrow routing_info and awm in hand_over for the type checker (tested) * fix: refuse an already-claimed handover session; type run_analysis as AsyncGenerator; document degraded (tested)
…685) * feat: start a fresh chat on return, with a resume card (E1.2, #655) A new browser session or a chat idle past the server's 24 h session starts a new conversation and offers the old one back. Never in a pop-out or over an empty chat. Tested: new fresh-return widget test, existing widget tests, drift test. * feat: dataset_id and moved_from in page_context, widget search_paths (E1.3, #656) Backend side of the context switch: PageContext validates dataset_id and moved_from, the system prompt gets a reader-context block, and widget search_paths is a validated community key (NEMAR: /discover). Tested: API model, prompt, config and endpoint tests. * feat: notice, new chat or continue on a context change (E1.3, #656) The widget compares the page's context (setDataset, or a search path) with the chat's, shows the A1 notice, starts a new chat on the next send or continues with moved_from, and sends dataset_id. Tested: new context-switch widget test and the existing widget tests. * docs: fresh chat, context switch and search_paths in the widget guide Adds the widget guide sections and CHANGELOG entries for E1.2 and E1.3 (the E1.2 entry is already in; this adds E1.3). Docs only. * fix: refuse an id on a search move, skip a no-op move in the prompt, tests for search_paths limits and page context off (tested: pytest, ruff) * fix: widget context switch review fixes: home page search path, move told only when carried and still current, saved wording, a11y, focus, popstate (tested: bun widget suites) * docs: context switch review fixes, search_paths limits, popstate and pushState behaviour * docs: a reload before the first send after Continue drops the move * fix: resume card falls back to 'your last chat' when the previous title is empty (tested: bun widget suites, embed hygiene)
…2) (#688) * feat: propose_plan client tool and plan decision resume (E2.1) Add the derived propose_plan client tool (analysis tier, python tool bound, declared by the caller), PlanDecision and build_plan_tool_message for /chat/resume, a 409 when the answer kind does not match the parked call, and keep plan answers out of the browser-run budget. Tested: tool binding, schema bounds, real graph parking, and the real app through /chat and /chat/resume (edit, approve, changes, mismatch, budget). * feat: plan-first prompt for NEMAR (E2.2) Add CommunityConfig.plan_first_instructions (valid only with quick_model and analysis_model), plan_first_section, and append it to an analysis turn that declares propose_plan. NEMAR sets the text; docs and changelog updated. The widget still does not declare propose_plan, so this is inert in production. Tested: config validation, section present only for analysis plus declared plus configured, absent on quick, undeclared and kill switch, and through the real app. * Reject blank plan step titles and fold newlines out of them; derive plan test bounds from the MAX_PLAN constants (tested) * Document plan_first_instructions in the registry notes * Sort imports in test_client_tools * Build the plan decision message once; word an undecided plan as not approved, not as failed code (tested) * Refuse a plan out of browser runs with a plan-specific reason (tested) * Test plan handover binding, left plans and plan-only cut-off replies; tie NEMAR plan tool names to the prompt ladder; note runsCode rule for #662 (tested) * Fold a plan step's detail onto one line in the plan tool message (tested) * Word the left-call reason tool-neutrally: 'before it was answered', not 'before it was run' (tested)
…ut (E1.4, E1.5) (#689) * feat: add WorkspaceStore.figuresForCalls to read a run's saved figures (#658) Reads figure-1.. of each run found by call id, bounded by the operation deadline; a call id two runs share is left out. Bundle rebuilt. Tested: bun frontend/test-workspace.js (in-memory dbFactory), real IndexedDB write/read phases in the Chrome harness (exact PNG bytes after reload). * feat: keep a run's figure count and read saved figures back into restored chats (#658, closes #493) A run stores figureCount (0..3) beside images: [], written from the images in memory and kept when there are none. hydrateFigures reads them from the workspace once the runtime is ready, after load and after opening a chat, into memory only; a missing figure shows a one-line note. The pop-out reads the same IndexedDB through its own init. Tested: bun frontend/test-widget-history-store.js; panel suite in the next commit. * feat: History sheet with chats by day, open, delete and clear all (#657) Header History button, a bottom sheet with scrim (dialog, Escape, focus return, inert chat behind), rows with dataset, step and figure counts and a lazy thumbnail, Open/Delete/+ New chat, two-click Clear all (clearAllConversations), off while a reply loads, hidden on the notebook tab. Tested: bun frontend/test-widget-history-panel.js (161 checks, in-memory IndexedDB under the real WorkspaceStore). * test: check the History sheet and saved figures in real Chrome, wire CI (#657, #658) history-check.mjs runs a figure through the real controller and IndexedDB, reloads, and finds it in the restored chat, the opened chat, the History thumbnail and the pop-out at 390x844, light and dark. The widget header title now wraps so the extra button does not overlap the badge. Both new scripts run in the frontend-tests job. Tested: history-check.mjs, chrome.js, run-card-check.mjs, popout-check.mjs. * docs: changelog entry for the History sheet and saved figures (#657, #658) Documentation only. * feat: figuresForCalls takes a per-run limit and names ambiguous call ids; test on the shared in-memory IndexedDB (tested: test-workspace.js, bundle rebuilt) * fix: tell a figure that could not be read from one that is gone; retry on the next hydrate (tested: test-widget-history-panel.js) * perf: read the history thumbnails of the rows in view in one call, figure 1 only; no object URL for a read the sheet outlived (tested: test-widget-history-panel.js) * fix: close the History sheet when Settings, Clear or Pop-out is used; keep the scrim below a header that changes height (tested: test-widget-history-panel.js) * fix: History button is a disclosure (aria-expanded), row actions a plain disclosure, busy reason reachable without a tooltip (tested: test-widget-history-panel.js) * fix: History footer and Clear-all note say figures stay in the workspace; cap from MAX_CONVERSATIONS (tested: test-widget-history-panel.js) * test: History harness counts a timeout once, measures contrast of the likeliest low-contrast controls, uploads screenshots on CI failure (tested: history-check.mjs in Chrome) * test: pin the History panel's time and date assertions to the formatter's locale; rewrite the seed comment (tested: test-widget-history-panel.js, also under LC_ALL=de_DE) * test: allow the History harness page in the embed-snippet hygiene list (tested: tests/test_frontend) * docs: changelog for the review round on the History sheet * test: the rejected-read History test uses a real WorkspaceStore over a failing database factory, not a hand-written store (tested: test-widget-history-panel.js) * fix: the disabled History button keeps no hover wash and dims to 0.4 like the other header buttons (tested: widget frontend tests, tests/test_frontend)
* PRIVACY.md: [email protected] for privacy questions and requests about your data; changelog Tested: tests/test_frontend/test_privacy_page.py and test_embed_snippet_hygiene.py (19 passed). * Review round 1: privacy contact for questions only, and say data is not tied to a person; changelog names #727
* Search overview: refuse a query under three words with a 422, before any model call query_word_count counts whitespace tokens holding a letter or digit; MIN_QUERY_WORDS = 3. Tests move to three-word queries and cover the count, the 422 and its reason. Tested: tests/test_api and tests/test_metrics (2112 passed). * Docs: the overview's three-word minimum and its 422; changelog * Review round 1: the three-word minimum is stated as the maintainer's rule, not a model limit; api-structure.md and the worker routing test follow it Tested: overview tests (166 passed); bun workers/osa-worker/test-routing.js passes.
…o corner icon (#732) * Widget: OSAChatWidget.seed puts a host page's text at the head of the chat seed(text, {mode}?) sends nothing: the text is the assistant's first message (marked seeded), the window opens in the mode, and the reader's first send carries it as prior_turns. A seeded chat counts as a chat with content in History, trimming, retiring and the empty-chat checks; the reply gets no thumbs row. Tested in happy-dom (new test-widget-seed.js, wired into CI; test-widget-reseed.js extended). * Test: a seeded assistant-only prior_turns is accepted and reaches the model (#730) Server side of OSAChatWidget.seed: prior_turns of one assistant turn for an unknown session returns 200, the model sees one user message with the text and the researcher message, and the stored history is [human, ai]. No src/ change needed. Tested: tests/test_api/test_reseed.py passes. * Widget: 120 ms open and dock animations for the center-stage dialog Keyframe animations on the opened state (scrim fade-in, window fade and scale from 0.98) and after a dock (corner window fade-in, scrim fade-out under a class a 150 ms timer removes). State changes (inert, scroll lock, focus, events) are immediate and nothing waits for an animation event. All off in the reduced-motion block. Tested: test-widget-seed.js (durations, reduced motion, no animationend or transitionend, timer cleanup); the host-api tests pass unchanged. * Widget: Move to corner icon points to the bottom right ICONS.dock is now an arrow to the bottom right (M7 7l10 10, M17 7v10H7) in the same 24x24 stroke svg, drawn at the header icons' 18 px. Label and title stay 'Move to corner'. Tested: test-widget-seed.js checks the paths, view box, size, aria-label and title. * Docs: OSAChatWidget.seed, the dialog's motion and arrow, changelog (#730) Host API table row and a seed subsection in docs/community-widget.md, the reseed note that a seeded reply is carried, and a CHANGELOG entry under Unreleased. Docs-only; the frontend and Python docs tests pass. * Test: browser harnesses read the dialog after its open animation ends The 120 ms open scales the window from 98%, so a size read in the first frames was 2% short (60 px field read 58.8). center-stage-check.mjs and privacy-choices-check.mjs now wait for finite animations before each read, and not on a call that carries a user gesture. Tested in Chrome: both harnesses pass. * Share the animation-settled evaluate across the browser harnesses; check the dock fade starts in real Chrome (tested: center-stage and privacy-choices checks pass) * Give the dock fade its own keyframes so it restarts after a settled open; count a seeded chat as content on context switch and return; trim before the seed length limit; pop-out and context tests; docs tidy (tested: widget suites, hygiene tests) * Docs: seeded chat counts as content in the three older statements; re-wrap widget comments (comment and doc text only; not run)
…d not to end its reply between steps (#733) * Plan: tell the model not to end its reply between steps in run_all mode (Refs #731) (tested) * Widget: Pause on a run-all plan, and no Run step N while it runs; the rail follows (Closes #731 part 2) (tested) * Docs and changelog: the run-all bar, Pause and why a run-all plan reaches its last step (docs only) * Widget: read a reply in flight from currentReply, not isLoading; no Pause on the last step; tell the model a held step never ran; a new plan clears a pause (Refs #731) (tested) * Docs and changelog: the active computation is the main cause; held step and Pause on the last step (docs only) * Widget: only the plan's own reply counts as running it, the retry line and the send guard read currentReply, Run step N is grayed during an unrelated reply, the held note survives a failed send; the Next line says an unanswered call was not run (Refs #731) (tested)
Contributor
Preview Deployment
This preview will be updated automatically when you push new commits. |
Merged
2 tasks done
… and cache-row docs (#736) * Run-all Next line: a step that fails twice stops the plan, the one message before the last step Matches NEMAR's plan_first_instructions item 6. Tested: test_tool_results, test_plan_first, test_frontend (283 passed). * Docs: the overview example calls widget.osc.earth; a cache hit logs a zero-cost row; the worker deploys on a push to main
…ump] (#737) * Privacy: AI Mode search row names nemar.org's Home and Discover search and the three-word minimum (docs only) * Privacy: overview row names corrected words, match count and its usage record; earlier-turns row covers Ask a follow-up (review round 1, docs only)
* feat(widget): open the notebook as a Notebook tab inside the center dialog (#738) The dialog no longer docks to the corner for the notebook: Chat and Notebook tabs appear in its header once the notebook has been opened, on the one frame in the one window. Move to corner keeps the tab, open() and ask() still show the chat, a focus guard after the frame keeps the real Tab key in the dialog, and the tab switch fades in 60 ms (none under reduced motion). Tested: bun widget suites and center-stage-check in headless Chrome. * test(widget): Notebook tab in the dialog, in the happy-dom suites (#738) New host-api cases for the tabs, the one frame, header buttons per tab, docking, open()/ask(), arrow keys and the focus guard; the notebook-entry and plan-rail cases that asserted a dock now assert the dialog stays up. Tested: bun frontend/test-widget-{host-api,notebook-entry,plan-rail}.js. * test(harness): notebook tab checks in center-stage-check (#738) Real Chrome at 1280x900 and 390x844, light and dark, against a stand-in notebook site on another origin: the frame fills the dialog, the real Tab key never leaves it, arrow keys switch tabs, docking keeps the same iframe element with one page load, motion is short and none under reduced motion. Tested: bun frontend/browser-harness/center-stage-check.mjs (all pass). * docs: Notebook tab in the center dialog (#738) Docs-only; tested by the widget docs tests (see PR). * fix(widget): keep focus in the dialog when the tab row goes, close overlays on the notebook tab (#738) Review fixes: focus leaves a hidden tab row, the window counts as nowhere for the focus rescue, Try again returns focus to the selected tab, the notebook tab closes Settings/feedback/privacy, and an unselected tab's hover no longer looks selected. Tested: bun widget suites (host-api 339 pass) and center-stage-check (371 ok). * fix(widget): header fits at every width; panels outside the dialog stay open; unread cue (#738) Round 2 review: header buttons drop labels to icons at 900px and under (Close no longer leaves the dialog), the dataset line absorbs the shrink; setTab closes Settings/feedback/privacy only in the dialog; focus rescue also covers a control that is no longer shown; hover lighter than the selected tab; a reply ending on the Notebook tab dots the Chat tab and is announced from the header. Width sweep 360-1440 added to center-stage-check. Tested: bun widget suites (host-api 354), center-stage-check 378 ok, pytest tests/test_frontend 174. * docs: scope the frame and keyboard claims, mention the unread cue and #740 (#738) Docs-only.
* widget: show the dialog's Chat and Notebook tabs from the start, hide the launcher behind it (#743) Tabs show whenever a notebook is available (no notebookTabSeen); the launcher is hidden while the center dialog is open and restored on dock, close and Escape. Bun suites updated and extended; tested with bun frontend/test-widget-host-api.js and test-widget-notebook-entry.js. * harness: check the dialog's tabs before any code runs and the hidden launcher in Chrome (#743) * docs: changelog and widget docs for the dialog's notebook entry (#743) * widget: rescue focus from a hidden tab row by testing focus before the hide; engage the launcher hiding last (#743) * harness: check the focus rescue in Chrome, sweep the header down to 320 px (#743)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Promotes
developtomain: the NEMAR AI experience work (a conversation that plans first, runs known procedures on demand, offers Pause on a run-all plan, and keeps its history and notebook in the widget), the widget's host API with the center-stage dialog,seedand a Notebook tab inside the dialog, the search overview endpoint with its three-word rule, the Privacy choices and the five-year retention of usage metrics and feedback, and a server that notices a forgotten session while the page stays open.Fifty-one merged pull requests (#628, #629, #631, #638, #645, #679 to #686, #688 to #690, #692 to #697, #699, #700, #704, #705, #707 to #709, #711 to #713, #715 to #718, #720, #722, #723, #726, #727, #729, #732 to #734, #737, #739, #742, #745, and the review fixes #736 and #746), plus CI-owned version bumps.
#628 is the post-0.8.19 sync of
mainintodevelop, and eight of the others are documentation only (#645, #679, #682, #683, #727, #737, #742, #746).The CHANGELOG split that files 0.8.19 and 0.8.20 under their own versions is #734, a documentation-only PR into
developthat merges before this one.What reaches production
propose_plan(a derived client tool) and the widget draws an editable plan card with step progress, Stop plan and a choice between pausing after each step and running all steps; NEMAR's plan-first prompt makes it propose before it runs code (feat: propose_plan client tool and NEMAR plan-first prompt (E2.1, E2.2) #688);isLoading; the run-all prompt and theNext:block of the tool result tell the model not to end its reply between steps (Plan bar: run-all plans offer Pause, not Run step N; the model is told not to end its reply between steps #733).procedures, and the model gets aget_proceduretool that returns one known procedure's Markdown document. NEMAR declares seven: power spectrum, band power, ERP by condition, ERP image by condition, band power topography, ERP topography and time-frequency by condition (NEMAR procedures: band power topography, ERP topography, time-frequency by condition (#721) #722), whose slow-run warning scales with the request (Time-frequency procedure: the slow-run warning scales with the request #723).quick_model: haikuandanalysis_model: sonnet; most turns run on the quick model and an analysis request hands over to the analysis model with a compact summary, which the widget draws as a handover card with a session divider and mode label.request_logrecords thetierand aconversation_idper turn, andosa metrics cost-reportreports cost per conversation.prior_turns, feat: reseed a resumed chat after its server session expired (E1.6) #696), framed as the assistant's own earlier reply (Reseed framing: continue the restored chat as the assistant's own #712), and one forgotten while the page stays open is noticed and sent again (expect_sessionand the 409session_unknown, Detect a forgotten session while the page stays open: expect_session and session_unknown #713).open,close,ask,setModeandononOSAChatWidget, a modal AI Mode dialog with a start screen drawn fromwidget.center_startandwidget.analysis_docs, a plan rail and Continue in notebook in the dialog, andOSAChatWidget.seed(text, {mode}?), which puts a host page's text at the head of a chat as the assistant's first message and sends nothing, with a 120 ms open and dock motion and a bottom-right Move to corner arrow.POST /{community}/overviewon the quick model for nemar.org's Discover panel, cached 24 hours, with its own hourly budget at the worker (100 in production) and no Turnstile. A search needs at least three words, or it answers 422 before any model call (Search overview: a search needs at least three words #729).PRIVACY.mdfor the osc.earth deployment and a Privacy choices control in the widget (page use and usage data), linking the docs privacy page; NEMAR'swidget.privacy_urlpoints at the NEMAR policy;PRIVACY.mdnames what an AI Mode search on nemar.org sends to the overview and what Ask a follow-up sends (Privacy: AI Mode search row for nemar.org's Home and Discover [skip-bump] #737).develop(ci: close issues named by a pull request merged into develop #700), the paced-reveal check observes every redraw (Make the paced-reveal check observe every redraw, not sample on a timer #718), the tool-call resume fixtures moved totests/helpers(Move the tool-call resume test fixtures to tests/helpers #717), and the design, plan and review-rule documents.Compatibility
share_usageonly when false;expect_sessionis ignored by a server without it).POST /{community}/chattakesprior_turns(at most 24{role, text}turns, otherwise 422),mode(quickoranalysis),expect_session(bool, default false; needssession_id, else 422) andshare_usage(bool, default true).page_contexttakesdataset_id,moved_from({type: dataset|search, id?}) andmemory_budget_mb(256, 512, 1024 or 2048).POST /{community}/chat/resumeand/asktakeshare_usage; the resumeresultis aClientToolResultor aPlanDecision(forpropose_plan).ResumeRequestforbids extra fields, so ashare_usagesent to a server that predates this release would be a 422; the widget never sends it unless the reader turns it off.{"detail", "code": "session_unknown"}on/chatwhenexpect_sessionis true, noprior_turnscame and the server holds no session (before any session, stream or model call; no usage row); 422 on/overviewfor a field out of bounds or aqueryunder three words; 404 on/overviewfor a community with noquick_model; 502 on/overviewwhen the model wrote nothing that could be shown; 403 without an allowed Origin or a caller's key.POST /{community}/overview(overviewjoins the metrics middleware's community suffixes).GET /{community}gainswidget.center_start,widget.analysis_docs,widget.privacy_urlandwidget.search_paths, all omitted when a community sets none, and the offered tools gainpropose_planwhere configured.quick_modelandanalysis_model(both or neither, each an offered model,execute_codeconfigured),plan_first_instructions,procedures(a list of{id, title, when, file}; at most 20, each file a Markdown document in the community's folder of at most 32,000 characters, read at load; a bad entry fails the load).widget:center_start(up to three{title, text}cards and a note),analysis_docs({title, url}, https only),privacy_urlandsearch_paths. Only NEMAR'sconfig.yamlsets them; every other community's config is unchanged, so their behavior is too.frontend/osa-chat-widget.jswas rewritten (+19,000 lines) and the runtime bundle and its own integrity constant are rebuilt (the constant matches the bundle ondevelop: checked). The widget atdevelop's head (685a503, after Dialog: tabs from the start, launcher hidden behind it (#743) #745) hashes tosha384-axZ+AmhWnYfIH2NaXqfef9J0TYbpt86O6Gq+3r04i4Ly+Q8RErT4VsLFejPSFcGG, againstsha384-/yJGRl7zOgiENwN83Um4V7oNifeXD2C3eLV0kbvhfF3OWivE3RXBMNIQ7Sawwmwtatmain; the release notes carry the final hash forv0.8.20. A site pinned to a version with anintegrityattribute must move tov0.8.20and the new hash, or it keeps the old widget. The widget loads the runtime bundle beside its own script URL, so moving the pin moves both.sync-worker-cors.ymldeploys on a push tomainthat touchesworkers/osa-worker/; this release does, so it deploys the production worker withbunx wrangler deploy, wrangler 4.136.2, using the sccnCLOUDFLARE_ACCOUNT_ID,CLOUDFLARE_API_TOKEN):workers/osa-worker/: Point the osa-worker KV bindings at the sccn account #631 (wrangler.toml: the production and devRATE_LIMITER_KVids move to the sccn namespacesosa-RATE_LIMITERandosa-dev-RATE_LIMITER), Search overview endpoint on the quick model (E6.3) #704 (index.js: the/:communityId/overviewroute andhandleOverview, rate limit only and no Turnstile, a per-IP hourly budget of 100 in production in its own KV counterrl:overview:hour:, exempt from the/chatcounter), and test-only changes in Widget: Privacy choices control with page use and usage data choices #708, Detect a forgotten session while the page stays open: expect_session and session_unknown #713 and Search overview: a search needs at least three words #729 (test-routing.js).wrangler.toml's routes are unchanged.edge.osc.earth/osa/*andedge.osc.earth/osa*(andwidget.osc.earth/osa/*) already cover/osa/nemar/overview, so the route reaches the worker as soon as the code deploys.scripts/sync_worker_cors.pyreports no changes on thedeveloptree./overview; the website's call is not part of this repository.Origin, which only browsers enforce, and its community budget alerts and does not block (workers/osa-worker/README.md).src/api/config.py,deploy/,.env.exampleandpyproject.toml's runtime dependencies are identical tomain(jupytextjoins the dev group only). No new setting and no new Infisical value: none. NEMAR'squick_model: haikuandanalysis_model: sonnetuse the providers already configured, and the Docker image'sCOPY src/carries the newprocedures/*.mdfiles.request_loggains two nullable columns,tierandconversation_id, and an index onconversation_id.init_metrics_dbadds them withALTER TABLE ... ADD COLUMNon the first start and creates the index after; both are idempotent, nothing is rewritten, and an older image ignores the columns, so a rollback needs no schema step.feedback_logis unchanged. A request with "Share usage data" off keeps its tokens, cost, tier and counts and loses itsconversation_id, tools and Langfuse trace id.init_metrics_db, whether or not the scheduler is on (the daily 03:15 job needs the scheduler). It deletes rows more than five calendar years old. The metrics database began with feat: backend metrics collection and request logging #138 on 2026-02-02 (my reading of the history; the server's own file was not inspected), so the first purge deletes nothing and logs nothing; the first deletions come no earlier than 2031 (Delete usage metrics and feedback after five years #726 says 2030 at the earliest, to be safe;feedback_logdates from 2026-06-04). It never runs if the metrics database failed to initialize, and a failure is logged without stopping the start.main(deploy-pages.yml,deploy-notebook.yml), while the backend moves at the next hourly pull of:latestafter the release image is built. For up to about an hour the new widget talks to the previous backend; the new request fields are optional or ignored there, and apropose_planthe widget declares is ignored by a server that does not configure it (it binds only the tools both configured and declared). Two effects in that window: a reader who turns off Share usage data is not honoured by the 0.8.19/chat(it ignoresshare_usage, so the row keeps the conversation id and tool names), and the same reader's/chat/resumegets a 422 (ResumeRequestforbids the unknown field); and/overviewanswers 404 through the worker until the backend has the route. Both close when the backend updates, so force it right afterdocker-build.ymlfinishes (on the server:deploy/auto-update.sh --force) rather than waiting for the hourly pull.eegprep_lean-0.5.0-py3-none-any.whl) and its lock changes; the lock the widget reads comes fromGET /nemar, so a page loaded before the deploy may request the old wheel once and get a 404 until it reloads.developpush runs of Tests failed after merge on browser checks (the headless Chrome launcher geometry sampling 3 frames at 390x640 on Plan bar: run-all plans offer Pause, not Run step N; the model is told not to end its reply between steps #733; the NEMARwidget_e2e.pyserver not starting on Time-frequency procedure: the slow-run warning scales with the request #723 and Delete usage metrics and feedback after five years #726), while each pull request's own run was green. This PR's own run is the gate; a rerun is the remedy if one of those browser checks fails again.tag-release.ymlandensure-stable-version.ymlact onsrc/version.pyas for 0.8.19; the CHANGELOG's[0.8.20]section (merged through Changelog: file 0.8.19 and 0.8.20 [skip-bump] #734) should be in place first.Review
One integration-scoped Sonnet review (the feature PRs were reviewed individually). No blockers.
It checked nine seams, with evidence:
seedthrough the reseed path: an assistant-onlyprior_turnsis accepted and folded,expect_sessioncannot fire on the first send, and a seeded reply survives a reload.currentReplyas the one source for the bar, rail and dialog.The full Python suite passed (6320; one environmental failure from a local hed-lsp checkout with no
node_modules), as did all 49 bun suites and the runtime-bundle check.edge.osc.earth, which its allowlist and CSP do not namewidget.osc.earth) and the checklist below/healthreports 0.8.20, with a forced server update right after the image builds/chatand a 422 on/chat/resumeNext:text had no exception for a step that fails twice.context/api-structure.mdsaid the worker is deployed by handFinal review at 685a503
A second integration-scoped Sonnet review covered what merged after the first one (#736, #737, #739, #742, #745). It found nothing blocking.
What it checked
OverviewRequest.seedlimits.close-issues-on-develop-merge.yml, which is safe to land onmain. It has never run, because GitHub runspull_request_targetfrom the default branch, so AI Mode dialog: Continue in notebook opens a Notebook tab inside the dialog, not in the corner #738 and AI Mode dialog: no way to open the notebook until code has run; the launcher's notebook circle is inert behind it #743 were closed by hand.PRIVACY.mdagainst the code.What it ran
center-stage-check.mjsin Chrome: 448 checks.[0.8.20]said opening the notebook docks the dialog, which #739 and #745 reverseddocs/search-overview.mddid not list the worker's 400 and 429[0.8.20]Version
src/version.pycarries the.devNsuffix (0.8.20.dev43at the review, higher after #736).ensure-stable-version.ymlstrips the suffix onmain; it is not hand-bumped.Before merge
developdevelopdevelop[0.8.20]date inCHANGELOG.mdis the merge date (2026-11-12 after Release 0.8.20 final review fixes: changelog and overview status table [skip-bump] #746; fix it in a[skip-bump]PR if the merge moves to another day)developis a bump commit, so its Tests run was the skip shim)mainruleset)After merge
sync-worker-cors.ymldeploys the production worker;edge.osc.earth/osa/healthandwidget.osc.earth/osa/healthanswer, andedge.osc.earth/osa-dev/still reaches dev (08:03Z, success; both health routes answer 200)ensure-stable-version.ymlsets0.8.20,tag-release.ymltags it, the release is published, anddocker-build.ymlmoveslatest(v0.8.20atffdf7e3; the GitHub release and PyPI are published; the tag build pushed:latest)docker-build.ymlhas pushed the release image, force the server update (deploy/auto-update.sh --forceon the server) instead of waiting for the hourly pull;https://api.osc.earth/osa/healthreports 0.8.20 andrequest_loghastierandconversation_id(forced by the maintainer;/healthreports 0.8.20 atffdf7e3)POST widget.osc.earth/osa/nemar/overview(andedge.osc.earth/osa/nemar/overview) from an allowed origin answers 200 for a three-word search and 422 for two words (08:13Z: 422 for an invalid body and for two words on both hosts; 200 with an overview for the site's own three-word request)v0.8.20with the SRI hash in the release notes, and, if the website turns on AI Mode search, its overview call goes towidget.osc.earth/osa/nemar/overview(the host its allowlist and CSP name) (nemar.org 0.2.38, website NEMAR: default to GPT-6 Luna #530 and Serve GPT-6 Luna, Qwen3 Next and gpt-oss-120b from Amazon Bedrock #527: the page loadsosa@ffdf7e3with the release hash, and AI Mode search callswidget.osc.earth/osa/nemar/overview)widget-route-health.ymlreportsedge.osc.earth/osa/healthhealthy (a run that fires before the worker deploy finishes can fail once) (08:20Z run, after the 08:03Z worker deploy: success)sync-develop.ymlopens its PR intodevelop(chore: sync develop with main after v0.8.20 #747, merged)