Skip to content

Release 0.8.20: NEMAR AI experience, search overview, privacy choices, five-year retention - #735

Merged
neuromechanist merged 100 commits into
mainfrom
develop
Nov 12, 2026
Merged

neuromechanist merged 100 commits into
mainfrom
develop

Conversation

@neuromechanist

@neuromechanist neuromechanist commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Promotes develop to main: 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, seed and 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 main into develop, 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 develop that merges before this one.

What reaches production

Compatibility

  • API: additions only, no removal and no rename. An older widget keeps working against the new backend, and the new widget sends only what an older server tolerates (share_usage only when false; expect_session is ignored by a server without it).
    • POST /{community}/chat takes prior_turns (at most 24 {role, text} turns, otherwise 422), mode (quick or analysis), expect_session (bool, default false; needs session_id, else 422) and share_usage (bool, default true). page_context takes dataset_id, moved_from ({type: dataset|search, id?}) and memory_budget_mb (256, 512, 1024 or 2048).
    • POST /{community}/chat/resume and /ask take share_usage; the resume result is a ClientToolResult or a PlanDecision (for propose_plan). ResumeRequest forbids extra fields, so a share_usage sent to a server that predates this release would be a 422; the widget never sends it unless the reader turns it off.
    • New status codes: 409 {"detail", "code": "session_unknown"} on /chat when expect_session is true, no prior_turns came and the server holds no session (before any session, stream or model call; no usage row); 422 on /overview for a field out of bounds or a query under three words; 404 on /overview for a community with no quick_model; 502 on /overview when the model wrote nothing that could be shown; 403 without an allowed Origin or a caller's key.
    • New route: POST /{community}/overview (overview joins the metrics middleware's community suffixes).
    • GET /{community} gains widget.center_start, widget.analysis_docs, widget.privacy_url and widget.search_paths, all omitted when a community sets none, and the offered tools gain propose_plan where configured.
  • Community config schema: additions only. Top level: quick_model and analysis_model (both or neither, each an offered model, execute_code configured), 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_url and search_paths. Only NEMAR's config.yaml sets them; every other community's config is unchanged, so their behavior is too.
  • Widget SRI hash changes; nemar.org's pin must move. frontend/osa-chat-widget.js was rewritten (+19,000 lines) and the runtime bundle and its own integrity constant are rebuilt (the constant matches the bundle on develop: checked). The widget at develop's head (685a503, after Dialog: tabs from the start, launcher hidden behind it (#743) #745) hashes to sha384-axZ+AmhWnYfIH2NaXqfef9J0TYbpt86O6Gq+3r04i4Ly+Q8RErT4VsLFejPSFcGG, against sha384-/yJGRl7zOgiENwN83Um4V7oNifeXD2C3eLV0kbvhfF3OWivE3RXBMNIQ7Sawwmwt at main; the release notes carry the final hash for v0.8.20. A site pinned to a version with an integrity attribute must move to v0.8.20 and 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.
  • Production worker changes (sync-worker-cors.yml deploys on a push to main that touches workers/osa-worker/; this release does, so it deploys the production worker with bunx wrangler deploy, wrangler 4.136.2, using the sccn CLOUDFLARE_ACCOUNT_ID, CLOUDFLARE_API_TOKEN):
  • The production server needs nothing new. src/api/config.py, deploy/, .env.example and pyproject.toml's runtime dependencies are identical to main (jupytext joins the dev group only). No new setting and no new Infisical value: none. NEMAR's quick_model: haiku and analysis_model: sonnet use the providers already configured, and the Docker image's COPY src/ carries the new procedures/*.md files.
  • The metrics database has an additive schema change. request_log gains two nullable columns, tier and conversation_id, and an index on conversation_id. init_metrics_db adds them with ALTER TABLE ... ADD COLUMN on 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_log is unchanged. A request with "Share usage data" off keeps its tokens, cost, tier and counts and loses its conversation_id, tools and Langfuse trace id.
  • The retention purge runs at the first start in production, in the lifespan right after 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_log dates from 2026-06-04). It never runs if the metrics database failed to initialize, and a failure is logged without stopping the start.
  • Anything else a deploy could trip on:
    • The widget and the notebook site deploy to Pages on the push to main (deploy-pages.yml, deploy-notebook.yml), while the backend moves at the next hourly pull of :latest after 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 a propose_plan the 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 ignores share_usage, so the row keeps the conversation id and tool names), and the same reader's /chat/resume gets a 422 (ResumeRequest forbids the unknown field); and /overview answers 404 through the worker until the backend has the route. Both close when the backend updates, so force it right after docker-build.yml finishes (on the server: deploy/auto-update.sh --force) rather than waiting for the hourly pull.
    • NEMAR's eegprep-lean wheel is renamed (eegprep_lean-0.5.0-py3-none-any.whl) and its lock changes; the lock the widget reads comes from GET /nemar, so a page loaded before the deploy may request the old wheel once and get a 404 until it reloads.
    • Three develop push 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 NEMAR widget_e2e.py server 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.yml and ensure-stable-version.yml act on src/version.py as 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:

  • seed through the reseed path: an assistant-only prior_turns is accepted and folded, expect_session cannot fire on the first send, and a seeded reply survives a reload.
  • The run-all wording against the plan-first rules, and currentReply as the one source for the bar, rail and dialog.
  • The procedures in the config loader (fail-fast at startup like every config, all seven under the cap, and the files ship in the image).
  • The overview on both worker hosts, the three-word rule, and the per-IP budget as the spend control.
  • The production worker deploy with Point the osa-worker KV bindings at the sccn account #631's KV ids and no new secrets.
  • The privacy chain, end to end.
  • The version skew between widget and backend.
  • This description against the code.
  • CI.

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.

# Severity Finding Outcome
M1 Medium The docs example and this checklist sent nemar.org's overview call to edge.osc.earth, which its allowlist and CSP do not name Fixed: #736 (the docs example uses widget.osc.earth) and the checklist below
M2 Medium The post-merge overview check ran before the backend had the route, so it could not pass Fixed: the check moved after /health reports 0.8.20, with a forced server update right after the image builds
M3 Medium In the widget-before-backend window, Share usage data off is ignored on /chat and a 422 on /chat/resume Fixed: stated under Compatibility, closed by the forced update in M2
L1 Low The run-all Next: text had no exception for a step that fails twice Fixed in #736, with a test
L2 Low The CHANGELOG said a cache hit adds no row; it adds a zero-cost row. .context/api-structure.md said the worker is deployed by hand Fixed in #736
L3 Low Version, PR count and date in this description Fixed here; the CHANGELOG date is checked at merge

Final 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

What it ran

  • Python: 6320 passed.
  • Bun: 46 suites.
  • center-stage-check.mjs in Chrome: 448 checks.
# Severity Finding Outcome
F1 Important Two #701 lines in [0.8.20] said opening the notebook docks the dialog, which #739 and #745 reversed Fixed in #746
F2 Suggestion This description's SRI hash, PR count and lists predated #737 to #745 Fixed here
F3 Suggestion CI on the head was still running during the review Gate: this PR's checks green on its final head
F4 Nit docs/search-overview.md did not list the worker's 400 and 429 Fixed in #746
F5 Nit Long multi-sentence lines in [0.8.20] Fixed in #746 (one sentence per line, long ones split at semicolons)

Version

src/version.py carries the .devN suffix (0.8.20.dev43 at the review, higher after #736). ensure-stable-version.yml strips the suffix on main; it is not hand-bumped.

Before merge

After merge

  • sync-worker-cors.yml deploys the production worker; edge.osc.earth/osa/health and widget.osc.earth/osa/health answer, and edge.osc.earth/osa-dev/ still reaches dev (08:03Z, success; both health routes answer 200)
  • ensure-stable-version.yml sets 0.8.20, tag-release.yml tags it, the release is published, and docker-build.yml moves latest (v0.8.20 at ffdf7e3; the GitHub release and PyPI are published; the tag build pushed :latest)
  • Once docker-build.yml has pushed the release image, force the server update (deploy/auto-update.sh --force on the server) instead of waiting for the hourly pull; https://api.osc.earth/osa/health reports 0.8.20 and request_log has tier and conversation_id (forced by the maintainer; /health reports 0.8.20 at ffdf7e3)
  • Only then: POST widget.osc.earth/osa/nemar/overview (and edge.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)
  • A NEMAR question answers in production, and a first analysis request proposes a plan
  • The widget on nemar.org is re-pinned to v0.8.20 with the SRI hash in the release notes, and, if the website turns on AI Mode search, its overview call goes to widget.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 loads osa@ffdf7e3 with the release hash, and AI Mode search calls widget.osc.earth/osa/nemar/overview)
  • widget-route-health.yml reports edge.osc.earth/osa/health healthy (a run that fires before the worker deploy finishes can fail once) (08:20Z run, after the 08:03Z worker deploy: success)
  • sync-develop.yml opens its PR into develop (chore: sync develop with main after v0.8.20 #747, merged)

github-actions Bot and others added 30 commits October 27, 2026 08:28
…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)
neuromechanist and others added 7 commits November 11, 2026 12:04
* 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)
@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Preview Deployment

Name Link
Preview URL https://develop-demo.osc.earth
Branch develop
Commit f1bfd06

This preview will be updated automatically when you push new commits.

neuromechanist and others added 2 commits November 11, 2026 15:58
… 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)
neuromechanist and others added 2 commits November 11, 2026 22:05
* 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.
neuromechanist and others added 2 commits November 11, 2026 23:35
* 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)
…e [skip-bump] (#746)

* Changelog 0.8.20: #701 lines no longer say the notebook docks the dialog; one sentence per line; date 2026-11-12

* Search overview docs: the worker's 400 and 429 in the status table
@neuromechanist
neuromechanist merged commit 2cc8634 into main Nov 12, 2026
28 checks passed
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.

2 participants