Skip to content

Release dev to main - #233

Merged
MAbdurrehman1 merged 67 commits into
mainfrom
dev
Jul 10, 2026
Merged

Release dev to main#233
MAbdurrehman1 merged 67 commits into
mainfrom
dev

Conversation

@farhat-is-coding

Copy link
Copy Markdown
Collaborator

Summary

  • Releases the current dev branch to main.
  • Research Mode is now protected by the enable_research release flag, disabled by default.
  • The frontend hides Research entry points and routes when disabled.

Validation

  • TypeScript compilation and Prettier checks passed.
  • Full Vite bundling did not complete in this environment.

Rollout

Run migrations, then enable enable_research in Django admin only when ready.

Add the Research section behind the dashboard with a role-gated sidebar entry:
- Projects list with create / edit / delete
- Full-page create-edit wizard: define, bring-your-own sources upload,
  Scout tool selection, research standards (soul file), review
- Project workspace: Scout composer, Review Inbox, Project Knowledge,
  Sources, Memory/Context, Artifacts
- research Redux slice + types + constants; useCanAccessResearch gate

Frontend-only with mock data; no backend wiring yet.
…ory stores, dashboard overview

- Overview reworked into a calm project dashboard (status tiles, loop, recent activity)
- Dedicated Ask Scout (delegated) + Chat (hands-on) views sharing one ScoutComposer
- Runs view (agent-run audit) + three-store Memory/Context (auto vs on-demand + agent proposals)
- Nordic-model demo data; dev-productivity and proportional-representation seed projects
- Wider workspace (max-w-1600) and tighter list padding
Replace the frontend mock with real API integration (api -> asyncThunk ->
slice, per docs/RULES.md):

- Project list + create now call /api/research/projects/; project id is numeric
  to match the backend PK, and timestamps render via the shared date formatter.
- Tools step is dynamic: it lists the user's connected MCP integrations plus a
  built-in Web search (handled by Hermes for now), storing tool slugs in
  enabledTools. A small resolveToolMeta() keeps Review/Scout/workspace showing
  friendly names.
- Broaden the source-upload allowlist and derive the input accept filter from it.
The workspace now fetches its project (GET /api/research/projects/{id}/) and the
user's MCP connections on mount, feeding the real research question, source count
and enabled tools into OverviewPanel and the right-side ContextPanel — replacing
the PROJECT/ACTIVE_TOOLS mocks (kept only as public-preview fallbacks). Runs,
memory and soul-file panels stay mock pending their own increments.
The workspace reads runs[] from the project-detail payload and feeds them into
the Runs tab, the Overview (Runs count + recent activity), and Ask Scout's
recent-runs list. Canonical AgentRun/AgentRunToolCall types move to the redux
types (re-exported for the workspace); a runFormat helper formats role, status,
duration, cost and relative time. Mock runs remain only as a public-preview
fallback.
The create wizard now sends its attached files, and the workspace reads sources[]
from the project-detail payload to render the Sources tab (with an empty state).
The authenticated workspace passes concrete values (no mock fallback) so the
question, tools, runs, sources and counts reflect the real project; the mock
data remains only for the public preview.
The right-side Context panel (soul file + active memory) and the Memory/Context
tab (project memory + pending proposals) now read from the project payload, with
honest empty states for a fresh project. Removes the MEMORY/MEMORY_PROPOSALS
mocks and the structured soul-file mock from those views.
Align the workspace types with the backend BigAutoField PKs: ReviewItem and
KnowledgeItem ids are now `number` (mock ids renumbered) and the review-action
callbacks take `number`. Remove the dead SourceFile type and SOURCE_FILES mock.
The only remaining string ids are client-only temp keys (wizard draft files).
HandsOnChat loads the real transcript and streams replies token-by-token from
/api/research/projects/{id}/chat/ (fetch + ReadableStream so the JWT rides along;
renders message.delta live with a typing cursor, auto-scrolls, shows the soul-file
version). Replaces the mock conversation. The non-functional "Save to Project
Knowledge" action is dropped until the knowledge save-gate is built.
Lay the Chat tab out like a normal chat — fixed title, scrolling transcript,
composer pinned to the bottom. Enter now sends and Shift+Enter inserts a new
line (was Cmd/Ctrl+Enter). Centre the empty state.
Replace the mock Scout simulation with the real delegated loop:
- Ask Scout fires POST /scout/ (runs Hermes web search, waits, stages results);
  the composer shows the searching state, then jumps to the Review Inbox.
- Review Inbox + Project Knowledge read the project's reviewItems/knowledgeItems
  (canonical §11 shape) from the detail payload; approve/reject/later call the
  review endpoint and refetch. Counts are real.
- ReviewItem/KnowledgeItem/Provenance move to the canonical API types (number
  ids, confidence 0–1, evidenceLabel, full provenance); signals.ts maps
  evidenceLabel + tool slugs. Drop the unbuilt "Ask Critic" action and the
  SCOUT_CANDIDATES/SEED_KNOWLEDGE mocks.
Selected tools now read clearly (primary border/tint + check); unselected are
muted with a dim dot. Running Scout only needs a query — tools default to the
project's enabled set and aren't a gate.
Scout no longer blocks the UI on a ~minute-long request:
- runScout fires POST /scout/, gets a runId, and polls GET /agent-runs/{id}/ for
  live status; the composer shows the real progress line ("Searching the web…",
  "Staged N findings.") instead of static text.
- The running run is adopted from the project's server-side runs, so the spinner
  + live status survive switching tabs, leaving the workspace, and full reloads.
- "Recent Scout runs" shows an in-flight run with its live status + spinner.
- On completion the project refetches, so findings appear in the Review Inbox.
The status poll spun forever on a 404 (e.g. a deleted/orphaned run), leaving a
stuck "Starting Scout…" spinner. Now any poll error stops the spinner and
refetches the project: a still-live run is re-adopted from server state, a
deleted one clears — which also flushes stale review cards from the cache.
- Each review card gets an "Ask Critic" action: it fires the Critic run, shows an
  "Assessing…" state, and on completion renders the verdict (Holds up /
  Overstated / Unsupported / Inconclusive) with reasoning + concerns from the
  item's criticMetadata.
- Extract usePolledRun: one clean poller shared by Scout and Critic (replaces the
  inline Scout poll), with the same self-heal-on-missing-run behaviour.
The run was created instantly but only the run-status endpoint was polled, so
project.runs (Recent Scout runs, Overview counts, Runs tab) stayed stale until a
manual reload. Now firing a run refetches the project immediately, and each poll
tick refetches too — so a run shows as Running with live status across every tab
the moment it starts, and findings/verdicts appear the moment they land.
Three overlapping left-nav tabs collapse into one "Context" hub with four
selectable cards — pick one, its content renders below:
- Durable Knowledge -> approved Project Knowledge
- Sources -> uploaded files
- Standards & Memory -> full soul file + project memory
- Agent Memory -> Hermes's pending proposals

Drops the standalone Project Knowledge and Sources nav items (and the
NavSection values); folds their views into the hub. Pure FE re-org — schema and
the project payload are unchanged.
Fetch GET /api/research/agent-memory/ and render the agent's on-disk
SOUL.md / MEMORY.md / USER.md (each with a plain-language note; empty files read
"Hermes hasn't written this yet"), above the pending proposals. The real
per-call tool query now flows through to Runs unchanged.
USER.md/MEMORY.md live in the single shared default profile today, so they are
not yet per-project. Say so in the card rather than implying isolation we don't
have yet — that arrives with per-project Hermes profiles.
Reuse DARE's proven chat renderers (MermaidBlock, CodeBlock) via react-markdown
+ remark-gfm/rehype-highlight/rehype-raw, so artifacts Hermes emits as fenced
blocks render inline: ```mermaid -> a diagram, other langs -> highlighted code,
plus tables and links. Streaming still shows raw text (diagrams can't render
half-written); the settled message renders rich.
- Extend DARE's shared ArtifactRenderer (additive): html/svg render in a
  sandboxed iframe; excalidraw offers a .excalidraw download. New ArtifactType
  values html|svg|excalidraw.
- Research chat already renders these inline (markdown); the Artifacts tab now
  lists persisted ResearchArtifacts and renders each through the same type-keyed
  registry (research artifact -> Artifact shape).
- Grid of compact cards (default): type icon, title, source/time -> click opens
  a full-render modal. List mode keeps the vertical full-render stack; a toggle
  switches between them.
- SVG renderer now wraps content so the figure scales-to-fit and centers
  instead of rendering small in the corner.
- Replace the hand-rolled overlay with shadcn Dialog — a proper 94vw × 92vh
  modal (built-in close, focus trap, overlay) for a complete, full-area expand.
- Strip Mermaid's intrinsic max-width so diagrams fill the panel instead of
  rendering zoomed-out (fixes it in research + DARE's main artifact panel).
A composer in the Artifacts tab: describe an artifact + pick a type (Auto /
Diagram / SVG / HTML / Excalidraw) -> fires the delegated generate run, polls it
(shared usePolledRun), and refetches so the artifact appears. Replaces relying on
chat-prose scraping with the structured generate path.
Add @excalidraw/excalidraw and an ExcalidrawRenderer that renders a scene JSON
read-only (viewModeEnabled), lazy-loaded so it stays out of the main bundle.
Wire the ArtifactRenderer 'excalidraw' case to it (replacing the download
placeholder). Verified: production build passes (excalidraw code-split).
m-Hariss and others added 27 commits June 26, 2026 01:08
docs: standardize README to shared structure
Research Mode v1: the Research Workspace frontend
- Upgrade Tailwind v3.4 -> v4 (@tailwindcss/vite, CSS-based config in
  index.css @theme inline; tailwind.config.ts and postcss.config.js removed;
  tailwindcss-animate -> tw-animate-css)
- Theme system: src/themes/*.css define full token sets per
  [data-theme='name'] with .dark variants; default theme preserves DARE
  branding with a sanitized dark palette; 9 themes shared with Socratic
  Books + 5 new Hermes-inspired themes (midnight, ember, mono, cyberpunk,
  rose)
- themeSlice rewritten to { theme, mode: light|dark|system } with pure
  reducers, legacy 'dare-theme' key migration, and selectResolvedMode;
  ThemeProvider owns DOM application, persistence, and the OS
  prefers-color-scheme listener; FOUC-prevention script in index.html
- Settings -> Appearance: theme grid with color swatches and a
  Light/Dark/System segmented control
- Full token sweep: ~1,030 dark: utilities, hardcoded hexes, gray/slate
  classes, and the 290-line .dark !important override block replaced with
  semantic tokens (bg-background/card/muted/accent, text-foreground/
  muted-foreground, border-border, chart-1..5, sidebar-*); remaining dark:
  uses are status colors, prose-invert, and icon transforms
- Brand gradient is theme-aware via --brand-from/--brand-to consumed by
  bg-dare-gradient, .gradient-border, and workflow-builder accents; the
  --dare accent token follows each theme's dominant color (default theme
  keeps canonical red->blue)
Keep: default (DARE), cyberpunk, midnight, mono, rose.
Remove: amber-minimal, amethyst-haze, bold-tech, bubblegum, caffeine,
ember, ocean-breeze, sunset-horizon, t3-chat, twitter.
New: cobalt (Hermes Nous Blue-inspired vivid blue on cream), evergreen
(forest green + sage), aurora (teal->violet northern lights, the one
two-hue brand gradient).

Users with a removed theme persisted fall back to default via the
THEME_NAMES validation in themeSlice. Picker cards now include the new
themes (they were previously registered but missing from
AppearanceSettings, so they never appeared in the UI).
Multi-theme system: Tailwind v4, 15 themes, theme-aware brand gradient
chore: stop tracking auto-generated docs-site/next-env.d.ts
…isualization

- KnowledgeBundleView, ThesisSourceLinks, VisualizationView components
- ContextHub / GraphView / WorkspaceShell / ResearchWorkspaceView updates
- research API + redux types for thesis sources
The OKF / thesis-source code fetched server data directly from components
(local useState/useEffect) and defined ThesisSourceLink/ScoutResult inline in
the API layer — out of step with the rest of research, which uses the standard
async-thunk + slice pattern. Bring it in line:

- Move ScoutResult + ThesisSourceLink into redux/types/research.ts; extend
  ResearchState with OKF bundle + thesis-source-link state.
- Add thunks (getResearchOkfBundle, downloadOkfBundle, getThesisSourceLinks,
  add/removeThesisSourceLink) mirroring the existing project thunks.
- Slice holds okfBundle + thesisSourceLinks (keyed by thesisId) with the usual
  pending/fulfilled/rejected; the file download stores no blob in state.
- KnowledgeBundleView / ThesisSourceLinks / VisualizationView now dispatch +
  select; purely-UI state (active view, form inputs, busy flags) stays local.
…ization

Research mode: Sources UI — graph, visualization, knowledge bundle, thesis-source links
…w-json

feat: added workflow json export option
The MCP OAuth callback redirected to /mcp, which is gated behind the enableMcp
feature flag. That flag defaults to false while flags are still loading right
after the redirect, so the route didn't exist yet and fell through to the 404
catch-all — and even when it matched, the status/message params were ignored,
so a failed connect had no error state at all.

Add a dedicated MCPConnectionResult page and route it at /mcp/callback OUTSIDE
the enableMcp gate, so it always resolves and shows a proper success/error
state with a retry. Backend redirect targets /mcp/callback (separate PR).
fix(mcp): add OAuth callback result page, fix 404 on connect
The structuredOutput router's validation_required socket event was dropped by the Zod guard (context.aiAnalysis was non-nullable but the backend emits null), so the picker never rendered live and the node hung on its raw JSON; only a page refresh (REST path) recovered it. Also render the ValidationPanel below the executed nodes so it appears in execution order and the existing scroll-on-validation lands on it.
…ion-live

fix(workflows): live human-validation panel + correct ordering
Insert a Product tour section (screenshots of the shipping console) right
after Access on the landing page, leading with the usage dashboard and the
environmental impact / energy dashboard. Six tabbed stops rendered from the
real screenshots in public/screenshots, in a browser-chrome frame, lazy
loaded with a fixed aspect ratio so there's no layout shift or first-paint
cost. A WALKTHROUGH_VIDEO_URL constant adds an inline video walkthrough tab
when a recording URL is set.

Renumber section eyebrows to 01-07 for the new order. Add a Screenshots
gallery to the README.
Swap the featured full-width screenshot to the usage dashboard; move the
environmental impact shot into the gallery grid.
…hots

Add product tour with screenshots to landing page
The 'browse' affordance was a faint text link buried mid-sentence, so users
missed it and assumed only drag-and-drop worked (reported in QA). Replace it
with a visible 'Browse files' button as the explicit, keyboard-accessible
control, make the whole dropzone clickable for mouse users (with a hover
highlight), and strengthen the drag-over state so the icon, border, and copy
all shift to the accent state.

The outer zone intentionally carries no button role — the real <button> is the
accessible control — to avoid nesting two interactive elements, and the button
stops click propagation so the picker doesn't open twice.
Fix: make research source dropzone browse control discoverable
@farhat-is-coding
farhat-is-coding marked this pull request as ready for review July 10, 2026 18:44
@MAbdurrehman1
MAbdurrehman1 merged commit 0f416f5 into main Jul 10, 2026
2 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.

3 participants