Skip to content

feat(wsi): add research assistant child - #12

Closed
raylim wants to merge 5 commits into
codex/wsi-native-annotationsfrom
codex/wsi-native-agent
Closed

raylim wants to merge 5 commits into
codex/wsi-native-annotationsfrom
codex/wsi-native-agent

Conversation

@raylim

@raylim raylim commented Sep 21, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • add the WSI research assistant as a child of the native annotation viewer
  • stream assistant replies and reviewable proposals in the RHS sidebar
  • preserve slide-coordinate geometry through OpenSeadragon pan/zoom transforms
  • validate proposal slide/source/viewer identity before applying or committing annotations
  • support approved rectangle/polygon creation and approved slide/coordinate/zoom actions
  • retain one-time approval with the terse Auto-approve checkbox

Stack

Parent annotation PR: #11

Backend dependencies:

Validation

  • pnpm run buildMain (Rspack completed; OpenSeadragon bundle assertion passed)
  • focused Jest: 8 suites, 49 tests passed
  • mocked Playwright WSI contracts: 2 tests passed (annotation commit and approved navigation)
  • changed-file formatting and git diff --check

The Playwright TypeScript project still has unrelated baseline implicit-any diagnostics in its existing fixture suite; runtime browser contracts are green.

@raylim

raylim commented Sep 21, 2026

Copy link
Copy Markdown
Owner Author

Implemented and pushed the agent-child hardening.\n\n- Isolates delayed annotation writes/updates/deletes by slide generation.\n- Captures the post-draw OSD viewport, source fingerprint, transform, and viewer generation.\n- Uses a separate purpose=agent capability.\n- Rejects stale/non-canonical proposal geometry before writing.\n- Adopts atomically committed annotations into the native viewer.\n\nValidation: 24 focused WSI/agent tests pass; frontend typecheck passes.\n\nCommits: 7572c46, 295ffbe.

@raylim raylim added the enhancement New feature or request label Sep 21, 2026
@raylim

raylim commented Sep 21, 2026

Copy link
Copy Markdown
Owner Author

Browser verification completed against the PR bundle served locally.\n\n- Playwright WSI foundation contract: 1 passed.\n- Playwright annotation/agent contract: 1 passed.\n- The new browser contract covers annotation layers, agent SSE response, proposal display, approval, atomic commit, and adoption into the viewer.\n- Playwright TypeScript check now passes after adding the TypeScript 6 deprecation setting.\n\nLatest commits: 54d989e, b6605d0.

@raylim
raylim force-pushed the codex/wsi-native-annotations branch from 73a05dd to acf45c7 Compare September 23, 2026 17:09
@raylim
raylim force-pushed the codex/wsi-native-agent branch from 4c3e808 to 0c34021 Compare September 23, 2026 17:09
raylim added a commit that referenced this pull request Sep 30, 2026
Port #12 onto the cbioportal-wsi-viewer package.

- Research assistant panel and proposal overlay in the package. It is on
  when the host installs `WsiViewerConfig.agent.enabled` together with
  `annotations` (the assistant is served by the annotation service). Both are
  host services in the startup runtime; the viewer entry reads them from
  there. The app fills the flag in buildWsiViewerConfig from
  `msk.wsi.agent.enabled` (`msk_wsi_agent_enabled`).
- wsiAuth fetches the `purpose=agent` study-scoped token through the same
  cache as the annotation token, and fingerprints the tile source of a slide
  access for proposal context checks. Assistant requests use the runtime
  fetch.
- The viewer controller captures the agent viewport and applies approved
  slide, filter, coordinate and zoom proposals. selectSlide resolves with the
  selection outcome once the first tile is ready, the metadata request fails
  or the mount is superseded.
- Playwright mocks can enable annotations and the assistant; the new
  annotation/assistant E2E spec runs in the WSI suite like the other mocked
  WSI specs, and the standalone route spec falls back to the mocks without a
  live viewer URL.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@raylim

raylim commented Sep 30, 2026

Copy link
Copy Markdown
Owner Author

Resource-data successor: #20 (codex/wsi-rd-agent, on #19). This PR stays on the native foundation track.

raylim added a commit that referenced this pull request Sep 30, 2026
Port #12 onto the cbioportal-wsi-viewer package.

- Research assistant panel and proposal overlay in the package. It is on
  when the host installs `WsiViewerConfig.agent.enabled` together with
  `annotations` (the assistant is served by the annotation service). Both are
  host services in the startup runtime; the viewer entry reads them from
  there. The app fills the flag in buildWsiViewerConfig from
  `msk.wsi.agent.enabled` (`msk_wsi_agent_enabled`).
- wsiAuth fetches the `purpose=agent` study-scoped token through the same
  cache as the annotation token, and fingerprints the tile source of a slide
  access for proposal context checks. Assistant requests use the runtime
  fetch.
- The viewer controller captures the agent viewport and applies approved
  slide, filter, coordinate and zoom proposals. selectSlide resolves with the
  selection outcome once the first tile is ready, the metadata request fails
  or the mount is superseded.
- Playwright mocks can enable annotations and the assistant; the new
  annotation/assistant E2E spec runs in the WSI suite like the other mocked
  WSI specs, and the standalone route spec falls back to the mocks without a
  live viewer URL.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
raylim added a commit that referenced this pull request Sep 30, 2026
Port #12 onto the cbioportal-wsi-viewer package.

- Research assistant panel and proposal overlay in the package. It is on
  when the host installs `WsiViewerConfig.agent.enabled` together with
  `annotations` (the assistant is served by the annotation service). Both are
  host services in the startup runtime; the viewer entry reads them from
  there. The app fills the flag in buildWsiViewerConfig from
  `msk.wsi.agent.enabled` (`msk_wsi_agent_enabled`).
- wsiAuth fetches the `purpose=agent` study-scoped token through the same
  cache as the annotation token, and fingerprints the tile source of a slide
  access for proposal context checks. Assistant requests use the runtime
  fetch.
- The viewer controller captures the agent viewport and applies approved
  slide, filter, coordinate and zoom proposals. selectSlide resolves with the
  selection outcome once the first tile is ready, the metadata request fails
  or the mount is superseded.
- Playwright mocks can enable annotations and the assistant; the new
  annotation/assistant E2E spec runs in the WSI suite like the other mocked
  WSI specs, and the standalone route spec falls back to the mocks without a
  live viewer URL.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@raylim

raylim commented Oct 9, 2026

Copy link
Copy Markdown
Owner Author

Superseded by #20 (research assistant in the viewer package).

@raylim raylim closed this Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant