WIP: Project Weight Reduction 2.2 UI refactor demo#2
Draft
exactlyallan wants to merge 64 commits into
Draft
Conversation
Restore the UI local CI entrypoint and add Project Weight Reduction contract fixtures, MSW handlers, and a table-driven capability matrix with tests. These guardrails give later UI refactor branches typed API shapes and selector behavior to build against.
Document the NAT 1.6 baseline for API and MCP guidance, remove stale NAT 1.4/1.5 release notes, and add a repository-level pytest guard that checks root, benchmark, and lockfile NAT package pins. Validation: .venv/bin/python -m pytest tests/test_nat_foundation.py -q; .venv/bin/python -m ruff check tests/test_nat_foundation.py
Add a structured /v1/research/submit endpoint that invokes the backend workflow so shallow/deep routing stays server-owned, plus a visible-job listing endpoint backed by persisted job context metadata. Rename proof-of-concept UI contracts and mocks from pwr-* to research-job-* so the branch namespace does not leak into durable source names. Validation: .venv/bin/python -m pytest frontends/aiq_api/tests -q; .venv/bin/python -m ruff check frontends/aiq_api/src/aiq_api/jobs/context.py frontends/aiq_api/src/aiq_api/routes/jobs.py frontends/aiq_api/src/aiq_api/auth/middleware.py frontends/aiq_api/tests/test_job_context.py frontends/aiq_api/tests/test_research_routes.py; tsc --noEmit; eslint targeted API files; vitest targeted research job contract tests.
Add a frontend research submit client with structured boundary-aware errors, a chat hook that preserves the existing shallow-answer and deep-research job handoff behavior, and InputArea wiring so normal sends use the backend-routed HTTP endpoint instead of WebSocket send. Validation: PATH=/Users/aenemark/.cache/codex-runtimes/codex-primary-runtime/dependencies/node/bin:/Users/aenemark/Desktop/Projects/AIQv2/aiq/node_modules/.bin:/opt/homebrew/bin:/opt/homebrew/sbin:/Library/Frameworks/Python.framework/Versions/3.10/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/pmk/env/global/bin:/usr/local/MacGPG2/bin:/usr/local/go/bin:/Users/aenemark/.codex/tmp/arg0/codex-arg0i181Gt:/Applications/Codex.app/Contents/Resources vitest --no-watch src/adapters/api/research-job-contracts.spec.ts src/adapters/api/research-job-msw-handlers.spec.ts src/adapters/api/research-submit-client.spec.ts src/features/chat/hooks/use-research-submit.spec.ts src/features/layout/components/InputArea.spec.tsx; PATH=/Users/aenemark/.cache/codex-runtimes/codex-primary-runtime/dependencies/node/bin:/Users/aenemark/Desktop/Projects/AIQv2/aiq/node_modules/.bin:/opt/homebrew/bin:/opt/homebrew/sbin:/Library/Frameworks/Python.framework/Versions/3.10/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/pmk/env/global/bin:/usr/local/MacGPG2/bin:/usr/local/go/bin:/Users/aenemark/.codex/tmp/arg0/codex-arg0i181Gt:/Applications/Codex.app/Contents/Resources tsc --noEmit; PATH=/Users/aenemark/.cache/codex-runtimes/codex-primary-runtime/dependencies/node/bin:/Users/aenemark/Desktop/Projects/AIQv2/aiq/node_modules/.bin:/opt/homebrew/bin:/opt/homebrew/sbin:/Library/Frameworks/Python.framework/Versions/3.10/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/pmk/env/global/bin:/usr/local/MacGPG2/bin:/usr/local/go/bin:/Users/aenemark/.codex/tmp/arg0/codex-arg0i181Gt:/Applications/Codex.app/Contents/Resources eslint src/adapters/api/research-submit-client.ts src/adapters/api/research-submit-client.spec.ts src/features/chat/hooks/use-research-submit.ts src/features/chat/hooks/use-research-submit.spec.ts src/features/layout/components/InputArea.tsx src/features/layout/components/InputArea.spec.tsx src/adapters/api/index.ts src/features/chat/hooks/index.ts
Scope submit responses to the originating conversation so delayed shallow answers, async job metadata, and error cards cannot mutate the currently selected session by accident. Remove InputArea's legacy WebSocket/HITL auto-connect path and preserve backend status details when the research submit proxy receives non-JSON responses. Validation: vitest --no-watch src/app/api/research/submit/route.spec.ts src/features/chat/hooks/use-research-submit.spec.ts src/features/layout/components/InputArea.spec.tsx src/adapters/api/research-submit-client.spec.ts; eslint targeted submit/InputArea/store files; tsc --noEmit; next build.
Introduce pure state helpers for the project weight reduction job UI: compact status polling across visible jobs, selected-job-only detail hydration, selected active-job live stream targeting, submit request binding, and stale poll snapshot guards. Add scenario tests for concurrent active jobs, submit-before-job-id binding, shallow response scoping, selection-change detail routing, missing selected jobs, and terminal-state regression protection. Validation: vitest --no-watch src/features/jobs/state/multi-job-flow.spec.ts src/features/jobs/state/capability-matrix.spec.ts; eslint targeted jobs state files; tsc --noEmit.
Add job capability selectors on top of the matrix and cover submitted, stale, interrupted, unavailable, anonymous, and completed-job states explicitly. Use the derived capabilities in InputArea for prompt and file-upload disabled state while keeping source/file panel access inspectable. Validation: vitest --no-watch src/features/jobs/state/job-capability-selectors.spec.ts src/features/jobs/state/capability-matrix.spec.ts src/features/layout/components/InputArea.spec.tsx; eslint targeted jobs/InputArea files; tsc --noEmit.
Add a typed research jobs client and polling hook, render backend-owned jobs in the sessions panel with local-session fallback, and create lightweight chat shells when a backend job is selected. Validation: vitest --no-watch --run src/features/chat/store.spec.ts src/adapters/api/research-jobs-client.spec.ts src/features/layout/components/SessionsPanel.spec.tsx; tsc --noEmit; targeted eslint
Add explicit knowledge-layer collection helpers, route submit and upload paths through collection naming, and bind data-source/file controls to selected job capabilities so terminal or errored jobs do not mutate source context. Validation: vitest --no-watch --run src/features/documents/research-collections.spec.ts src/features/chat/hooks/use-research-submit.spec.ts src/features/documents/hooks/use-file-upload.spec.ts src/features/layout/components/InputArea.spec.tsx src/features/layout/components/FileSourcesTab.spec.tsx src/features/layout/components/DataSourcesPanel.spec.tsx src/features/jobs/state/capability-matrix.spec.ts; tsc --noEmit; targeted eslint
Accept nullable backend job-list display fields while normalizing them to undefined for UI consumers, and make selected-job capability derivation tolerate ISO string timestamps restored from localStorage. Validation: TZ=UTC node node_modules/.bin/vitest --no-watch --run src/adapters/api/research-jobs-client.spec.ts src/features/jobs/state/job-capability-selectors.spec.ts; node node_modules/.bin/tsc --noEmit; node node_modules/.bin/eslint src/adapters/api/research-job-contracts.ts src/adapters/api/research-jobs-client.spec.ts src/features/jobs/state/job-capability-selectors.ts src/features/jobs/state/job-capability-selectors.spec.ts
Keep interaction sessions tab-local while persisting only conversations anchored to active, completed, failed, or interrupted deep-research report jobs. Filter backend async-job rows to report-level research jobs before rendering the sessions panel so implementation/sub-agent jobs do not replace chat sessions. Validation: TZ=UTC node node_modules/.bin/vitest --no-watch --run src/features/chat/store.spec.ts src/features/chat/lib/prune-message-for-storage.spec.ts src/features/chat/lib/storage-manager.spec.ts src/features/chat/lib/session-activity.spec.ts src/features/jobs/state/report-job-scope.spec.ts src/features/chat/lib/report-session-persistence.spec.ts src/features/layout/components/SessionsPanel.spec.tsx; node node_modules/.bin/tsc --noEmit; node node_modules/.bin/eslint src/features/jobs/state/report-job-scope.ts src/features/jobs/state/report-job-scope.spec.ts src/features/jobs/state/index.ts src/features/chat/lib/report-session-persistence.ts src/features/chat/lib/report-session-persistence.spec.ts src/features/chat/store.ts src/features/chat/store.spec.ts src/features/layout/components/SessionsPanel.tsx src/features/layout/components/SessionsPanel.spec.tsx
Clear the shallow-streaming navigation blocker after HTTP submit hands off to an async deep-research job, and link local interaction sessions to their backend report job so the sessions panel folds backend metadata into the owning local session instead of rendering a duplicate job card. Validation: TZ=UTC node node_modules/.bin/vitest --no-watch --run src/features/chat/store.spec.ts src/features/chat/hooks/use-research-submit.spec.ts src/features/chat/lib/session-activity.spec.ts src/features/layout/components/SessionsPanel.spec.tsx; node node_modules/.bin/tsc --noEmit; node node_modules/.bin/eslint src/features/chat/hooks/use-research-submit.ts src/features/chat/hooks/use-research-submit.spec.ts src/features/chat/lib/session-activity.ts src/features/chat/lib/session-activity.spec.ts src/features/layout/components/SessionsPanel.tsx src/features/layout/components/SessionsPanel.spec.tsx src/features/layout/components/MainLayout.tsx
Remove the unused frontend WebSocket client, hook, recovery helper, NAT schema exports, and gateway /websocket backend proxy. Keep framework websocket upgrades for Next.js internals only and update stale transport comments/tests. Validation: TZ=UTC bundled-node vitest --no-watch --run use-chat use-current-session-busy SessionsPanel store transport-auth-signals rum; bundled-node tsc --noEmit; bundled-node eslint targeted files; bundled-node --check server.js; next build outside sandbox.
Delete the dead useChat hook, chat-client adapter, OpenAI-compatible schema layer, and legacy /api/chat and /api/generate proxy routes. Keep generate-pdf untouched and leave active deep-research SSE for a dedicated polling-replacement slice. Validation: TZ=UTC bundled-node vitest --no-watch --run InputArea rum research-submit-client store; bundled-node tsc --noEmit; bundled-node eslint targeted files; next build outside sandbox.
Delete AgentPrompt and PlanTab, remove the Plan research-panel tab, and stop using pending HITL state to block session navigation or current-session busy checks. Leave deeper persisted store fields for a later state-model migration rather than mixing storage-shape changes into the component prune. Validation: TZ=UTC bundled-node vitest --no-watch --run ChatArea ChatThinking ResearchPanel SessionsPanel MainLayout layout-store use-current-session-busy AppBar ExportFooter; bundled-node tsc --noEmit; bundled-node eslint targeted files; next build outside sandbox.
Collapse the research panel to Research, Citations, and Artifacts; move secondary AppBar actions into the user menu; add a compact prompt status strip; and make research sessions easier to scan with backend job status and report hints. Active research entry points now open Artifacts for progress, while completed report entry points open Research. The new Artifacts tab summarizes report availability, generated files, task progress, and tool activity without exposing raw token streams. Validation: npm test -- --run; npm run type-check; npm run lint; npm run build
Start the 2.2 project weight reduction UI rough-in around a persistent application shell instead of the prior overlay-heavy layout. Key changes: - Move the left research sessions surface into a persistent compact/expanded rail with stable controls, grouped session age buckets, active/completed/temp/error icons, inline edit/delete controls, and report/job-aware session selection. - Replace the old right-side panel model with a Deep Research rail and drawer that exposes Data Sources, Citations, Research, Artifacts, and Thinking as fixed nav destinations. - Simplify panel content hierarchy: data sources now starts with file attachments, citations/artifacts/thinking remove nested button-group navigation, and thinking focuses on thoughts. - Restyle the prompt area as a floating rounded-xl card with a state-derived status row, backend-job stop action, compact source/file counters, and no prompt-local attach button or drag/drop upload path. - Move user settings into the AppBar account popover and remove the SettingsPanel surface entirely. - Add branded icon aliases needed by the rough-in rails, session states, prompt status, and stop action. - Treat backend failure/interrupted job statuses as domain job states in the deep research client rather than adapter-level transport errors, with regression coverage. This is still intentionally a rough-in pass: visual polish and final UX details remain follow-up work, but the layout, state boundaries, and component hierarchy are now in the intended direction for the refocused UI. Validation: - npm test: 83 files passed, 1188 tests passed, 1 skipped. - npm run type-check: passed. - npm run lint: passed with existing warnings only, 0 errors. - npm run build: passed; build still reports existing CSS optimizer @Property warnings.
Replace the deep-research EventSource client with REST polling over status, state, and report endpoints. Keep job-state hydration shared between active polling and historical job loading, and make removed stream routes fail with a clear HTTP response. Remove backend SSE stream routes, connection-manager shutdown handling, and NAT browser WebSocket route exposure for the AIQ API proof of concept. Preserve persisted job events as backend state snapshots for polling consumers. Validation: npm run lint; npm run type-check; npm test -- src/features/chat/hooks/use-deep-research.spec.ts src/features/chat/hooks/use-load-job-data.spec.ts src/adapters/api/deep-research-client.spec.ts 'src/app/api/jobs/async/[...path]/route.spec.ts' src/features/chat/lib/transport-auth-signals.spec.ts src/features/chat/hooks/use-current-session-busy.spec.ts; npm run build; .venv/bin/python -m ruff check frontends/aiq_api/src/aiq_api frontends/aiq_api/tests/test_auth.py tests/aiq_agent/fastapi_extensions/test_deep_research.py tests/aiq_agent/jobs/test_runner.py; .venv/bin/python -m pytest frontends/aiq_api/tests/test_auth.py tests/aiq_agent/fastapi_extensions/test_deep_research.py tests/aiq_agent/jobs/test_runner.py -q
Project persisted job events into compact state for polling clients, including LLM thinking steps, current activity, and reliable tool status. Hydrate the UI Thinking tab and prompt status from that state without reopening SSE or WebSocket transports. Also add run_id metadata to callback events and update stale docs that referenced the removed SSE stream route. Validation: .venv/bin/python -m pytest tests/aiq_agent/fastapi_extensions/test_deep_research.py tests/aiq_agent/jobs/test_runner.py -q; .venv/bin/python -m ruff check frontends/aiq_api/src/aiq_api/routes/jobs.py frontends/aiq_api/src/aiq_api/jobs/callbacks.py tests/aiq_agent/fastapi_extensions/test_deep_research.py tests/aiq_agent/jobs/test_runner.py; node node_modules/.bin/vitest --no-watch src/features/chat/lib/deep-research-job-state.spec.ts src/features/chat/hooks/use-deep-research.spec.ts src/features/chat/hooks/use-load-job-data.spec.ts src/features/layout/components/InputArea.spec.tsx; node node_modules/.bin/tsc --noEmit; node node_modules/eslint/bin/eslint.js <touched frontend files>
Centralize prompt disabled state, status strip copy, stop control availability, and source/file counter enablement in a pure selector derived from the backend job capability matrix. Wire the prompt area through the selector and add matrix coverage for unavailable data sources so UI controls do not keep duplicating local job-state logic. Validation: node node_modules/.bin/vitest --no-watch src/features/jobs/state src/features/layout/components/DataSourcesPanel.spec.tsx src/features/layout/components/FileSourcesTab.spec.tsx src/features/layout/components/InputArea.spec.tsx; node node_modules/typescript/bin/tsc --noEmit; node node_modules/eslint/bin/eslint.js src --ext .ts,.tsx
Add a small Node generator that renders the runtime capability matrix and research UI state projection into Markdown tables for PR review and agent orientation. The generated doc includes canonical match conditions, capability outputs, prompt bar behavior, side panel behavior, and a curated scenario checklist for long-running workflow edge cases. Validation: node scripts/generate-state-matrix-doc.cjs --check; node node_modules/.bin/vitest --no-watch src/features/jobs/state; node node_modules/typescript/bin/tsc --noEmit; node node_modules/eslint/bin/eslint.js src --ext .ts,.tsx; node --check scripts/generate-state-matrix-doc.cjs
Add a UI docs entry point for the research state matrix, include the update process in the generated Markdown, and link the matrix from the main UI README. Wire the generated-doc freshness check into the local UI CI flow so matrix changes fail when the Markdown table is stale. Validation: env PATH=/Users/aenemark/.cache/codex-runtimes/codex-primary-runtime/dependencies/node/bin:/Users/aenemark/Desktop/Projects/AIQv2/aiq/node_modules/.bin:/opt/homebrew/bin:/opt/homebrew/sbin:/Library/Frameworks/Python.framework/Versions/3.10/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/pmk/env/global/bin:/usr/local/MacGPG2/bin:/usr/local/go/bin:/Users/aenemark/.codex/tmp/arg0/codex-arg0Vnldp1:/Applications/Codex.app/Contents/Resources ./scripts/ci-check.sh --quick
Load report content when opening the Research rail tab for a selected completed backend job, while guarding against active jobs that are not report-ready. Treat the Thinking rail tab as selected-job state hydration so LLM thought traces can load from backend job-state snapshots without SSE. Validation: node node_modules/.bin/vitest --no-watch src/features/layout/components/ResearchPanel.spec.tsx src/features/chat/hooks/use-load-job-data.spec.ts src/features/chat/hooks/use-deep-research.spec.ts src/features/jobs/state; node node_modules/typescript/bin/tsc --noEmit; node node_modules/eslint/bin/eslint.js src --ext .ts,.tsx
Tighten expanded session panel spacing against the icon rail, keep the rail divider mounted in both compact and expanded states, and replace metadata pills with one state line per session. Make the AppBar brand act as a guarded new-session button wired to the existing MainLayout new-session handler. Validation: node node_modules/.bin/vitest --no-watch src/features/layout/components/SessionsPanel.spec.tsx src/features/layout/components/AppBar.spec.tsx src/features/layout/components/MainLayout.spec.tsx; node node_modules/typescript/bin/tsc --noEmit; node node_modules/eslint/bin/eslint.js src/features/layout/components/SessionsPanel.tsx src/features/layout/components/SessionsPanel.spec.tsx src/features/layout/components/AppBar.tsx src/features/layout/components/AppBar.spec.tsx src/features/layout/components/MainLayout.tsx
Make the AppBar brand and expanded new-session label read as clickable controls, differentiate selected session titles from inactive titles, and color session state labels to match their status icons. Add footer padding under the session persistence note so it does not sit flush against the bottom of the panel. Validation: node node_modules/.bin/vitest --no-watch src/features/layout/components/SessionsPanel.spec.tsx src/features/layout/components/AppBar.spec.tsx src/features/layout/components/MainLayout.spec.tsx; node node_modules/typescript/bin/tsc --noEmit; node node_modules/eslint/bin/eslint.js src/features/layout/components/SessionsPanel.tsx src/features/layout/components/SessionsPanel.spec.tsx src/features/layout/components/AppBar.tsx src/features/layout/components/AppBar.spec.tsx src/features/layout/components/MainLayout.tsx
Add high-level deep research job state helpers, update the generated UI state matrix docs, and wire the prompt/session surfaces to derived active, error, interrupted, and completed states. Improve backend job hydration, draft report rendering from markdown artifacts, persistent status banners, current-task popover behavior, and stop/status affordances for shallow and deep research flows. Polish the session and research panels by tightening icon/status treatments, making artifacts scroll cleanly, simplifying data-source/citation/thinking empty states, and removing redundant summary cards and placeholder copy. Validation: node node_modules/typescript/bin/tsc --noEmit; node scripts/generate-state-matrix-doc.cjs --check; node node_modules/vitest/vitest.mjs run changed specs (209 passed); node node_modules/eslint/bin/eslint.js changed files (0 errors, existing no-explicit-any warnings in specs); node node_modules/prettier/bin/prettier.cjs --check changed source/spec files.
Add scoped thinking-step actions so submit lifecycle updates can be written back to the originating conversation even after the user switches sessions. Mark shallow submit activity for the research-panel surface, keep legacy chat-inline thinking separate, and project research-panel activity alongside deep LLM steps in the Thinking tab. Validation: vitest run store/use-research-submit/ThinkingTab specs (83 passed); vitest run prune-message-for-storage spec (15 passed); tsc --noEmit; eslint touched files; prettier --check touched files.
Remove the inline chat thinking disclosure and selected data source block from chat responses. Route submit metadata, selected sources, collection, attachments, request/job ids, and shallow/deep/error routing details into the research-panel Thinking activity instead. Preserve capped research-panel thinking content in local storage so restored sessions can still show the submit details, while continuing to strip inline/deep refetchable thinking data. Validation: vitest focused chat/submit/storage/store/thinking specs; tsc --noEmit; eslint touched files; prettier --check touched files; git diff --check.
Replace the tracked .agents/skills parent symlink with a real directory containing leaf symlinks for aiq-research and aiq-deploy. This keeps the canonical root skills catalog intact while making the old GitHub URLs under .agents/skills/<skill> resolve instead of 404ing. Validation: git diff --cached --check; test -f .agents/skills/aiq-research/SKILL.md; test -f .agents/skills/aiq-deploy/SKILL.md
* update README, diagram * Update README.md Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* Add NVSkills CI request workflow Signed-off-by: Ajay Thorve <athorve@nvidia.com> * Fix DeepResearch Bench II README link Signed-off-by: Ajay Thorve <athorve@nvidia.com> * Clarify DeepResearch Bench II README link Signed-off-by: Ajay Thorve <athorve@nvidia.com> --------- Signed-off-by: Ajay Thorve <athorve@nvidia.com>
* Align AIQ skills with global requirements Signed-off-by: Ajay Thorve <athorve@nvidia.com> * Deduplicate skill README prerequisites Signed-off-by: Ajay Thorve <athorve@nvidia.com> * Address NVSkills validation findings Signed-off-by: Ajay Thorve <athorve@nvidia.com> * Remove AIQ research script magic numbers Signed-off-by: Ajay Thorve <athorve@nvidia.com> * Attach NVSkills validation signatures * Exclude generated skill artifacts from lint hooks Signed-off-by: Ajay Thorve <athorve@nvidia.com> --------- Signed-off-by: Ajay Thorve <athorve@nvidia.com> Co-authored-by: nvskills-svc-account <svc-nvskills-signing@nvidia.com>
Signed-off-by: Ajay Thorve <athorve@nvidia.com>
…dates (NVIDIA-AI-Blueprints#251) * Prune expired deep research sessions Check persisted deep research job IDs when the sessions panel opens and remove current-user sessions whose backend job is no longer available. This keeps the sessions nav from linking to reports that have aged out of backend retention. Validation: vitest run src/features/chat/store.spec.ts src/features/layout/components/SessionsPanel.spec.tsx; eslint src/features/chat/store.ts src/features/chat/types.ts src/features/chat/store.spec.ts src/features/layout/components/SessionsPanel.tsx src/features/layout/components/SessionsPanel.spec.tsx; tsc --noEmit * Split expired session cleanup out of PR 225 Move the session expiration and orphaned-report cleanup work onto a dedicated branch based on the clean PR 225 auth-token baseline. This deliberately keeps expired-session behavior out of PR 225 so the auth-token fix and session lifecycle work can be reviewed independently. Includes localStorage/session activity cleanup, expired report handling, document-resource discard for upload-only sessions, and session panel affordances/tests. Validation: env PATH=/Users/aenemark/.cache/codex-runtimes/codex-primary-runtime/dependencies/node/bin:$PWD/node_modules/.bin:$PATH TZ=UTC ./node_modules/.bin/vitest run src/features/chat/lib/session-activity.spec.ts src/features/chat/lib/storage-manager.spec.ts src/features/chat/store.spec.ts src/features/layout/components/SessionsPanel.spec.tsx; env PATH=/Users/aenemark/.cache/codex-runtimes/codex-primary-runtime/dependencies/node/bin:$PWD/node_modules/.bin:$PATH ./node_modules/.bin/tsc --noEmit --pretty false * Soften expired report load failures Classify missing deep research jobs separately from backend connectivity failures so expired reports can be marked unavailable without surfacing aggressive load errors. Preserve proxy error details from the deep research REST adapter, avoid failing report state when the backend is unreachable, and cover the behavior with targeted hook and adapter tests. Validation: vitest targeted report/session/WebSocket suite; tsc --noEmit * Clear stale shallow streaming state Reset shallow WebSocket loading flags when the socket unmounts mid-request and when starting a fresh draft session, preventing restored or abandoned sessions from leaving the UI stuck in a thinking state. Validation: PATH=/Users/aenemark/.cache/codex-runtimes/codex-primary-runtime/dependencies/node/bin:/Users/aenemark/Desktop/Projects/AIQv2/aiq/node_modules/.bin:/opt/homebrew/bin:/opt/homebrew/sbin:/Library/Frameworks/Python.framework/Versions/3.10/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/pmk/env/global/bin:/usr/local/MacGPG2/bin:/usr/local/go/bin ./node_modules/.bin/vitest run src/features/chat/hooks/use-websocket-chat.spec.ts src/features/chat/store.spec.ts; git diff --check * Unify research panel hydration Add a shared tab-loading policy so report views use the report endpoint while detail tabs replay the stream only when needed. Wire ResearchPanel, report banners, and chat View Report actions through the same policy to avoid inconsistent hydration behavior. Validation: PATH=/Users/aenemark/.cache/codex-runtimes/codex-primary-runtime/dependencies/node/bin:/Users/aenemark/Desktop/Projects/AIQv2/aiq/node_modules/.bin:/opt/homebrew/bin:/opt/homebrew/sbin:/Library/Frameworks/Python.framework/Versions/3.10/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/pmk/env/global/bin:/usr/local/MacGPG2/bin:/usr/local/go/bin ./node_modules/.bin/vitest run src/features/chat/hooks/use-load-job-data.spec.ts src/features/layout/components/ResearchPanel.spec.tsx src/features/chat/components/AgentResponse.spec.tsx; PATH=/Users/aenemark/.cache/codex-runtimes/codex-primary-runtime/dependencies/node/bin:/Users/aenemark/Desktop/Projects/AIQv2/aiq/node_modules/.bin:/opt/homebrew/bin:/opt/homebrew/sbin:/Library/Frameworks/Python.framework/Versions/3.10/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/pmk/env/global/bin:/usr/local/MacGPG2/bin:/usr/local/go/bin ./node_modules/.bin/tsc --noEmit --pretty false; git diff --check * Improve source defaults and keyboard flow Default new sessions to all returned data sources instead of filtering authenticated sources out up front. Put the chat prompt and send button first in keyboard tab order, and prioritize inline plan approval when it is present. Validation: vitest run src/features/layout/store.spec.ts src/features/chat/store.spec.ts src/features/layout/components/InputArea.spec.tsx src/features/chat/components/AgentPrompt.spec.tsx; tsc --noEmit --pretty false; git diff --check * Guard chat and report stream ownership Queue outbound chat messages on the existing WebSocket client while it is handshaking instead of replacing the client and opening a parallel socket. Also avoid duplicate low-level connects while a WebSocket is still CONNECTING. Scope deep-research SSE replay and live callbacks to the captured job ID so stale streams cannot flush reports, citations, or terminal errors into the active job after the UI switches sessions/jobs. Validation: node ./node_modules/vitest/vitest.mjs --no-watch use-websocket-chat.spec.ts use-deep-research.spec.ts websocket-client.spec.ts; node ./node_modules/typescript/bin/tsc --noEmit; node ./node_modules/eslint/bin/eslint.js changed files (0 errors, existing any warnings in test mocks). * Harden archived report replay UX Scope completed-job stream replay to the session that initiated the load so stale callbacks cannot hydrate another session after navigation. Simplify deep research banner actions to keep only the successful View Report CTA. Remove positive tabindex usage from HITL and prompt input controls, order plan approval actions as Approve then Reject, and keep secondary input toolbar controls out of the sequential tab path so keyboard focus reaches the prompt and submit button predictably. Validation: node node_modules/vitest/vitest.mjs --no-watch use-load-job-data.spec.ts InputArea.spec.tsx AgentPrompt.spec.tsx DeepResearchBanner.spec.tsx; node node_modules/typescript/bin/tsc --noEmit; node node_modules/eslint/bin/eslint.js <touched files>; node node_modules/prettier/bin/prettier.cjs --check <touched files> * Simplify research panel tabs Remove the redundant Plan and Citations research panel tabs, fold source read/referenced views into the Thinking tab controls, and keep the last known deep research task list in persisted chat state while continuing to prune heavier stream artifacts. Validation: frontends/ui focused vitest suite; tsc --noEmit; eslint on touched files; next build * Clarify empty thinking tab states Use neutral empty-state copy across Thinking sub-tabs so the placeholders make sense both before research has produced data and after completed-report replay details are unavailable. Add coverage for thoughts, agents, tools, files, and source views. Validation: frontends/ui focused Thinking tab vitest suite; tsc --noEmit; eslint on touched files * Only show final report artifacts in report tab Require deep research output artifacts to be tagged final_report before promoting them into reportContent, including live SSE and archived replay paths. Preserve final report category metadata for report endpoint loads and state replay. Validation: node node_modules/vitest/vitest.mjs --no-watch src/features/chat/hooks/use-deep-research.spec.ts src/features/chat/hooks/use-load-job-data.spec.ts; node node_modules/typescript/bin/tsc --noEmit; node node_modules/eslint/bin/eslint.js focused files; git diff --check * Restore active research task progress Replay top-level deep research todo artifacts during live SSE and stream catch-up, while keeping workflow-scoped sub-agent todo lists out of the main Tasks tab. Normalize todo statuses through a shared helper and persist the latest lightweight task state onto the active tracking message so refresh restores useful progress before replay catches up. Validation: node node_modules/vitest/vitest.mjs --no-watch src/features/chat/hooks/use-deep-research.spec.ts src/features/chat/hooks/use-load-job-data.spec.ts src/features/chat/store.spec.ts; node node_modules/typescript/bin/tsc --noEmit; node node_modules/eslint/bin/eslint.js focused files; git diff --check * Address Greptile review feedback Queue research tab loads that occur during an active panel fetch, guard overlapping session status refreshes, and debounce persisted deep-research todo snapshots while keeping live task updates immediate. Validation: TZ=UTC node node_modules/vitest/vitest.mjs run; node node_modules/typescript/bin/tsc --noEmit; eslint touched UI files (warnings only). * Polish expired report recovery UX Replace stale completed-report banners with an explicit expired warning when the backend no longer has the job, and keep the logged-out layout from mounting or auto-opening the data sources panel. Validation: TZ=UTC node node_modules/vitest/vitest.mjs run src/features/chat/components/DeepResearchBanner.spec.tsx src/features/chat/store.spec.ts src/features/chat/hooks/use-load-job-data.spec.ts src/features/layout/components/MainLayout.spec.tsx; node node_modules/typescript/bin/tsc --noEmit; node node_modules/eslint/bin/eslint.js touched files; git diff --check
* Fix NVSkills validation blockers Signed-off-by: Ajay Thorve <athorve@nvidia.com> * Attach NVSkills validation signatures Signed-off-by: nvskills-svc-account <svc-nvskills-signing@nvidia.com> * Trigger deploy skill signature regeneration Signed-off-by: Ajay Thorve <athorve@nvidia.com> * Address NVSkills security findings Signed-off-by: Ajay Thorve <athorve@nvidia.com> * Attach NVSkills validation signatures Signed-off-by: nvskills-svc-account <svc-nvskills-signing@nvidia.com> --------- Signed-off-by: Ajay Thorve <athorve@nvidia.com> Signed-off-by: nvskills-svc-account <svc-nvskills-signing@nvidia.com> Co-authored-by: nvskills-svc-account <svc-nvskills-signing@nvidia.com>
* Add copy-pr-bot support to CI and UI workflows Switch both workflows to push-only triggers and add pull-request/[0-9]+ branch pattern so CI runs on mirror branches created by copy-pr-bot after `/ok to test` approval. * Add copy-pr-bot configuration Enable copy-pr-bot with auto-sync on ready PRs. Vetters: exactlyallan, AjayThorve, sarathm-nvidia.
…nts#260) Align push trigger with ci.yml and ui.yml.
Track outbound chat and HITL payloads after they are written to the socket, keep them unacknowledged until the backend emits a frame, and replay once when an unexpected close happens before acknowledgement. This covers the staging failure mode where the browser reported an open WebSocket, sent a prompt, then the socket closed before the backend produced any response. The replay is bounded to one attempt and scoped to the active conversation to avoid duplicate workflows or cross-session sends. Validation: vitest run src/features/chat/hooks/use-websocket-chat.spec.ts; vitest run src/adapters/api/websocket-client.spec.ts; full UI vitest run; tsc --noEmit; eslint src --ext .ts,.tsx; next build
Start a 15s acknowledgement timer after each outbound chat or HITL send. If no backend frame arrives and the payload has not already been replayed, rotate the socket and replay once; if the replay also times out, surface a connection failure and clear the delivery buffers. Discard stale acknowledgement timers after a conversation switch so timeout handling cannot replay or surface errors in the wrong session. Validation: vitest run src/features/chat/hooks/use-websocket-chat.spec.ts; full UI vitest run; tsc --noEmit; eslint src --ext .ts,.tsx; next build
Lower the unacknowledged outbound delivery timeout from 15 seconds to 7 seconds so stale-open socket sends recover faster while preserving the one-replay guardrail. Validation: vitest run src/features/chat/hooks/use-websocket-chat.spec.ts -t 'ack timeout'; vitest run src/features/chat/hooks/use-websocket-chat.spec.ts; tsc --noEmit; git diff --check
Clear the unacknowledged outbound delivery timer when an intermediate backend frame passes the streaming stale guard. NAT intermediate frames can carry internal workflow parent ids, so requiring parent-id equality could falsely replay active requests even after ChatThinking appeared. Validation: vitest run src/features/chat/hooks/use-websocket-chat.spec.ts -t 'ack timeout'; vitest run src/features/chat/hooks/use-websocket-chat.spec.ts; full UI vitest run; tsc --noEmit; targeted eslint; next build
…ebsocket-outbound-delivery-guard Guard WebSocket outbound delivery
Pull latest upstream develop backend, docs, deploy, skills, and dependency updates into pwr/2.2-dev while preserving the PWR frontend tree unchanged. Resolved frontends/aiq_api routes/jobs.py by combining upstream data-source validation with the PWR research submit and backend-owned job-list context APIs. Kept backend WebSocket reconnect removed for the no-WebSocket PWR direction. Validation: uv run --frozen python -m ruff check frontends/aiq_api/src/aiq_api/routes/jobs.py frontends/aiq_api/tests/test_job_submit_data_sources.py; uv run --frozen python -m pytest frontends/aiq_api/tests/test_job_submit_data_sources.py -q; uv run --frozen python -m pytest tests/aiq_agent/jobs/test_runner.py -q; uv run --frozen python -m py_compile frontends/aiq_api/src/aiq_api/routes/jobs.py frontends/aiq_api/src/aiq_api/jobs/runner.py frontends/aiq_api/src/aiq_api/plugin.py; git diff --check.
Verify restored report sessions against backend job state before presenting them as available. Show checking and unknown states while backend state is loading or unreachable, keep active research sessions in the thinking state, and use the shared spinner for running sessions. Render transient error banners inline in the chat stream and exclude dismissible error messages from report-session persistence. Keep blank session drafts out of saved session history until the user submits a prompt. Validation: node ./node_modules/vitest/dist/cli.js run src/features/chat/components/DeepResearchBanner.spec.tsx src/features/layout/components/SessionsPanel.spec.tsx src/features/layout/components/ChatArea.spec.tsx src/features/chat/lib/report-session-persistence.spec.ts; node ./node_modules/vitest/dist/cli.js run src/features/chat/store.spec.ts; node ./node_modules/vitest/dist/cli.js run src/features/layout/components/InputArea.spec.tsx; node ./node_modules/eslint/bin/eslint.js src/features/chat/store.ts src/features/chat/store.spec.ts src/features/layout/components/InputArea.tsx src/features/layout/components/SessionsPanel.tsx src/features/layout/components/SessionsPanel.spec.tsx
Keep artifact cards readable by letting the artifacts panel scroll instead of compressing generated file cards. Preserve completed report timestamps across backend refreshes so selecting an old completed report does not promote it into the New bucket, and show the completion date in the session state label. Validation: node ./node_modules/vitest/dist/cli.js run src/features/layout/components/ArtifactsTab.spec.tsx src/features/layout/components/SessionsPanel.spec.tsx src/features/chat/store.spec.ts; node ./node_modules/eslint/bin/eslint.js src/features/layout/components/ArtifactsTab.tsx src/features/layout/components/ArtifactsTab.spec.tsx src/features/layout/components/FileCard.tsx src/features/layout/components/SessionsPanel.tsx src/features/layout/components/SessionsPanel.spec.tsx src/features/layout/components/MainLayout.tsx src/features/chat/lib/session-activity.ts src/features/chat/store.ts src/features/chat/store.spec.ts
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.
WIP Demo Branch
This is a draft PR for the Project Weight Reduction proof-of-concept work targeting the AIQ 2.2 UI/API refactor direction.
This PR is intentionally opened against
exactlyallan/aiq:develop, not the upstream NVIDIA repo. It is a WIP demo branch meant to make the current refactor reviewable, runnable, and easy to split into staged PRs later.Branch Structure
Aggregate branch:
pwr/2.2-dev- demo/integration branch for the full proof of conceptRelated slice branches rolled into, or represented by, this aggregate branch:
pwr/nat-1.6-foundation- NAT 1.6 baseline and package/version guardrailspwr/quality-gates- UI/backend safety checks and branch validation scaffoldingpwr/job-context-api- backend job context/listing/report API foundationpwr/http-chat-submit- HTTP submit path replacing UI WebSocket submit behaviorpwr/http-submit-review-fixes- scoped submit/error handling fixes from reviewpwr/session-scope-model- frontend session/job scoping modelpwr/multi-job-flow-model- concurrent async job state model and selectorspwr/ui-state-model- capability/state matrix foundation for UI disabled/error statespwr/job-sessions-panel- backend job-backed session panel behaviorpwr/rag-data-source-flow- RAG file/data-source/collection submit flowpwr/session-panel-runtime-fixes- runtime fixes from local browser testingpwr/session-job-dedupe- active report job/session dedupe behaviorpwr/component-prune- initial legacy WebSocket/HITL/component removalpwr/ui-refocus-rough-in- rough UI shell and design pass for the refocused layoutWork Done
Work To Do
Review Guidance
Please treat this as a WIP demo branch, not a final merge candidate.
Suggested review order:
pwr/job-context-api,pwr/http-chat-submit,pwr/http-submit-review-fixes.pwr/session-scope-model,pwr/multi-job-flow-model,pwr/ui-state-model.pwr/job-sessions-panel,pwr/session-job-dedupe,pwr/rag-data-source-flow.pwr/component-prune,pwr/ui-refocus-rough-in.pwr/2.2-dev.Validation
Latest focused local checks:
npm test -- src/features/layout/components/SessionsPanel.spec.tsxnpm test -- src/features/layout/components/ResearchPanel.spec.tsxnpm run type-checknpm run lint- passed with existing warnings onlyEarlier branch validation included broader UI test/build passes before the latest design polish.