diff --git a/.clauderules b/.clauderules deleted file mode 100644 index b67699e9..00000000 --- a/.clauderules +++ /dev/null @@ -1,18 +0,0 @@ -# Claude Code Rules - -You are an expert developer following the **Get Shit Done (GSD)** methodology. - -## Core Mandate - -- **Strict Adherence**: Follow `PROJECT_RULES.md` at all times. -- **Search-First**: Use `grep` and `find` before reading files to minimize context usage. -- **Spec-Driven**: Do not write code without a clear plan/spec. -- **Verification**: Provide empirical proof for all completed tasks. - -## Tooling Integration - -- **Skills**: Leverage instructions in `.agent/skills/`. -- **Workflows**: Follow steps in `.agent/workflows/`. -- **Memory**: Update state files in `.gsd/`. - -Refer to `.gemini/GEMINI.md` if you need Antigravity-specific context adapters. diff --git a/.gitignore b/.gitignore index 7080eaeb..1810a533 100644 --- a/.gitignore +++ b/.gitignore @@ -71,7 +71,6 @@ PROJECT_RULES.md CLAUDE.md CLAUDE.local.md .opencode/ -.gsd/.opencode/ .build-date .claude/ .omo/ diff --git a/.gsd/ARCHITECTURE.md b/.gsd/ARCHITECTURE.md deleted file mode 100644 index a2354fea..00000000 --- a/.gsd/ARCHITECTURE.md +++ /dev/null @@ -1,79 +0,0 @@ ---- -updated_at: 2026-03-03T08:59:32-07:59 ---- - -# Architecture - -> Auto-generated by /map on 2026-03-03 - -## Overview - -The ModelSEED-UI is transitioning from a legacy AngularJS 1.4 Single Page Application to a modern Next.js 16 App Router architecture. The old system relied on UI-Router for navigation, Angular services for state, and a mixture of Bootstrap and Angular Material for styling. The new architecture uses Next.js server components, Zustand for client state, TanStack React Query for data fetching, and strictly uses MUI v7 for the component library to achieve identical visual design but with enhanced performance and security. - -``` -┌─────────────────────────────────────────┐ -│ Next.js App Router │ -├─────────────────────────────────────────┤ -│ Zustand / TanStack React Query │ -├─────────────────────────────────────────┤ -│ MUI v7 (Emotion) │ -└─────────────────────────────────────────┘ -``` - -## Legacy Components (To Translate) - -### Legacy Styling (`external/ModelSEED-UI/css`) -- **Purpose:** Global styling, overriding Bootstrap. -- **Location:** `external/ModelSEED-UI/css/core.css`, `docs.css`, `tabs.css`, `viz.css` -- **Dependencies:** Implicit dependency on Bootstrap 3.3.4 and Angular Material 0.10.1. - -### Legacy Views and Controllers (`external/ModelSEED-UI/app`) -- **Purpose:** Page layouts and logic. -- **Location:** `external/ModelSEED-UI/app/views`, `external/ModelSEED-UI/app/ctrls` -- **Dependencies:** AngularJS, UI-Router. - -### Legacy Assets (`external/ModelSEED-UI/img`) -- **Purpose:** Static site resources. -- **Location:** `external/ModelSEED-UI/img` - -## New Architecture Components - -### App Router (`app/`) -- **Purpose:** Next.js file-system-based router providing layouts and pages. -- **Location:** `app/layout.tsx`, `app/page.tsx`, etc. -- **Dependencies:** React Server Components. - -### Shared UI (`components/`) -- **Purpose:** Reusable atomic and composite UI components leveraging MUI. -- **Location:** `components/` -- **Dependencies:** `@mui/material`, `@emotion/react`. - -### State Management -- **Purpose:** Local client state and API caching. -- **Location:** `lib/store` (Zustand), `lib/api` (React Query) - -## Data Flow - -1. Client navigates to a Next.js route. -2. Next.js App Router renders static/server chunks. -3. Client components hydrate. React Query fetches dynamic ModelSEED data. -4. Zustand orchestrates complex local UI state (e.g. workspace contexts, active selections). -5. MUI components render the data visually identical to the legacy view. - -## Integration Points - -| Service | Type | Purpose | -|---------|------|---------| -| ModelSEED API | API | Fetching biological models and user workspace data. | - -## Technical Debt (Legacy System) - -- [x] Outdated AngularJS framework (Security risks, no formal TS types). -- [x] Mixed CSS methodology (Bootstrap + custom overrides + Angular Material). -- [x] Grunt build system. - -## Conventions - -**Naming:** React components are PascalCase, utilities and hooks are camelCase. -**Structure:** Feature-based folder structure inside `app/` and generalized atomic components in `components/`. -**Styling:** MUI `sx` prop and styled components over vanilla CSS files. diff --git a/.gsd/DEBUG.md b/.gsd/DEBUG.md deleted file mode 100644 index 9fb79129..00000000 --- a/.gsd/DEBUG.md +++ /dev/null @@ -1,177 +0,0 @@ ---- -phase: 19 -plan: debug ---- - -# Debug Session: Console Errors & Search Bar Issues - -## Symptom -1. Console error: "Can't perform a React state update on a component that hasn't mounted yet" at SubsystemsPage (app/(reference-data)/genomes/Annotations/page.tsx:181) -2. Console error: Same issue at BiochemToolbar (components/BiochemToolbar.tsx:62) -3. Search bar is broken in reference data (biochem) pages -4. Search bar not working in My Models and My Media pages - -**When:** Loading pages with DataGrid and BiochemToolbar -**Expected:** No console errors, search bar should filter data -**Actual:** React state update errors, search not functional - -## Hypotheses - -| # | Hypothesis | Likelihood | Status | -|---|------------|------------|--------| -| 1 | BiochemToolbar has state update in render/useMemo without useEffect guard | 80% | CONFIRMED | -| 2 | Search state changes trigger state updates before component mounts | 70% | CONFIRMED | -| 3 | DataControlHeader integration not properly wired in all pages | 60% | ELIMINATED | -| 4 | Search filtering logic not correctly applied to data (server vs client pagination conflict) | 80% | CONFIRMED | - -## Attempts - -### Attempt 1 -**Testing:** Fix BiochemToolbar CustomPagination mounted guard -**Action:** Added useState and useEffect to track mounted state before calling grid API hooks -**Result:** Fixed the "state update before mount" error -**Conclusion:** CONFIRMED - -### Attempt 2 -**Testing:** Fix biochem compounds page search/pagination conflict -**Action:** Changed paginationMode from "server" to "client" when search is active. Also disabled server-side filtering when search is active. -**Result:** Search now works with client-side pagination -**Conclusion:** CONFIRMED - -### Attempt 3 -**Testing:** Fix biochem reactions page search/pagination conflict -**Action:** Same fix as compounds - use client pagination when search is active -**Result:** Search now works with client-side pagination -**Conclusion:** CONFIRMED - -## Resolution - -**Root Cause:** -1. BiochemToolbar's CustomPagination was calling grid API hooks before the grid was mounted -2. Biochem pages were mixing client-side search (DataControlHeader) with server-side pagination, causing conflicts - -**Fix:** -1. Added mounted guard to BiochemToolbar CustomPagination component -2. Changed biochem compounds and reactions pages to use client-side pagination when search is active - -**Verified:** `npm run build` passes successfully - -## Timestamp Log -- Created: 2026-03-12 17:55:00 -05:00 -- Updated: 2026-03-12 18:00:00 -05:00 - Fixed BiochemToolbar and search pagination issues -- Updated: 2026-03-12 18:05:00 -05:00 - Fixed BiochemToolbar hooks order issue (v2 fix) - ---- - -# Debug Session: Phase 21 PATRIC/RAST Runtime Errors - -## Symptom -1. PATRIC genome search fails with Solr parse error: `Cannot parse '()'`. -2. RAST list jobs fails with RPC error: `There is no method package named 'msSupport'.` - -**When:** Opening Build Model PATRIC/RAST tabs with table-backed loading. -**Expected:** PATRIC grid should load/search; RAST grid should list user Genome jobs. -**Actual:** Both tabs surface API errors and fail to render data. - -## Hypotheses - -| # | Hypothesis | Likelihood | Status | -|---|------------|------------|--------| -| 1 | PATRIC query builder sends an empty/invalid RQL expression when query is blank or sanitized empty | 85% | CONFIRMED | -| 2 | RAST endpoint on `ms_fba` expects top-level `list_rast_jobs` rather than `msSupport.list_rast_jobs` | 90% | CONFIRMED | -| 3 | Auth header format changed and causes both errors | 20% | ELIMINATED | - -## Attempts - -### Attempt 1 -**Testing:** H1 — PATRIC empty/invalid query handling -**Action:** Updated `searchPatricGenomes` to sanitize terms and append `keyword(*)` when no valid search terms are present. -**Result:** Prevents construction of empty/invalid query clauses that trigger parse errors like `Cannot parse '()'`. -**Conclusion:** CONFIRMED - -### Attempt 2 -**Testing:** H2 — RAST method naming compatibility -**Action:** Added fallback in `listRastGenomes`: first call `msSupport.list_rast_jobs`, and on `-32601` package-not-found error retry `list_rast_jobs`. -**Result:** Supports both RPC method naming variants used by different deployments. -**Conclusion:** CONFIRMED - -## Resolution - -**Root Cause:** -1. PATRIC client did not include a default query clause for blank/invalid input, resulting in backend parse failures. -2. RAST service method namespace differs by deployment; current server rejects `msSupport` package prefix. - -**Fix:** -1. Added robust query sanitization and fallback `keyword(*)` in `lib/api/patric.ts`. -2. Added RPC compatibility fallback from `msSupport.list_rast_jobs` to `list_rast_jobs` in `lib/api/modelseed.ts`. - -**Verified:** Lint and build pass after changes. - -## Timestamp Log -- Updated: 2026-03-13 10:02:16 CDT - Fixed PATRIC query parsing and RAST method namespace compatibility for Phase 21 tables. -- Updated: 2026-03-13 10:05:09 CDT - Removed Selected Genome Configuration UI and fixed RAST fallback handling for HTTP 500 RPC error payloads. - ---- - -# Debug Session: RAST `selectall_arrayref` Backend Failure - -## Symptom -1. RAST Microbes tab fails to load in Build Model with backend error: - `Can't call method "selectall_arrayref" on an undefined value` -2. Prior retries also surfaced package-method errors (`msSupport`, `ms_fba`, `msFBA`). - -**When:** Opening `/plant` and loading RAST Microbes. -**Expected:** RAST jobs table should render user Genome jobs. -**Actual:** API error bubbles to UI and blocks the table. - -## Hypotheses - -| # | Hypothesis | Likelihood | Status | -|---|------------|------------|--------| -| 1 | Wrong RPC method package name was used vs legacy behavior | 70% | CONFIRMED | -| 2 | Backend requires `owner` param for some deployments when token owner resolution fails | 60% | CONFIRMED | -| 3 | No equivalent REST endpoint exists in `modelseed-api` yet, so legacy RPC must be retained | 90% | CONFIRMED | - -## Evidence -- Legacy UI maps `msSupport + list_rast_jobs` to `MSSeedSupportServer.list_rast_jobs` (`external/ModelSEED-UI/lib/ms-rpc/ms-rpc.js`). -- `modelseed-api` current routes do not expose a RAST-jobs REST endpoint (`/api/jobs`, `/api/models`, `/api/media`, `/api/workspace` only). -- Live probing of `https://modelseed.org/services/ms_fba` confirms: - - `MSSeedSupportServer.list_rast_jobs` is the only valid package-method candidate. - - Unqualified and wrong-package methods fail with `-32601`. - -## Attempts - -### Attempt 1 -**Testing:** Use the legacy package-method exactly as old frontend. -**Action:** Switched candidate order to try `MSSeedSupportServer.list_rast_jobs` first. -**Result:** Eliminated method-package validation failures as the primary error. -**Conclusion:** CONFIRMED - -### Attempt 2 -**Testing:** Add owner-aware parameter fallback to avoid backend undefined-owner failures. -**Action:** For each candidate method, try params with `{ owner: }` before `{}`. -**Result:** Improved compatibility for deployments where owner cannot be inferred from token internals. -**Conclusion:** CONFIRMED - -### Attempt 3 -**Testing:** Keep UI responsive when backend emits known internal Perl failure. -**Action:** Detect `selectall_arrayref` error and return empty RAST list with warning instead of throwing hard error. -**Result:** Build Model UI no longer hard-fails when backend-side RAST DB handle is broken. -**Conclusion:** CONFIRMED - -## Resolution - -**Root Cause:** -1. Client method fallback drifted from legacy package-method (`MSSeedSupportServer.*`). -2. Some backend deployments throw internal errors when owner inference fails in legacy Perl service. -3. No replacement REST endpoint currently exists in `modelseed-api` for RAST jobs. - -**Fix:** -1. Retained legacy RAST RPC path and aligned method call with legacy code (`MSSeedSupportServer.list_rast_jobs` first). -2. Added owner-aware parameter retries (`{ owner: username }`, then `{}`). -3. Added safe degradation for known backend internal `selectall_arrayref` failure to avoid breaking the tab. - -**Verified:** `npx eslint "lib/api/modelseed.ts"` and `npm run build` pass. - -## Timestamp Log -- Updated: 2026-03-16 10:56:44 CDT - Investigated RAST backend failures, restored legacy package-method parity, added owner-aware retries, and added graceful fallback for `selectall_arrayref` backend error. diff --git a/.gsd/DECISIONS.md b/.gsd/DECISIONS.md deleted file mode 100644 index 77c04a27..00000000 --- a/.gsd/DECISIONS.md +++ /dev/null @@ -1,195 +0,0 @@ ---- -updated_at: 2026-03-03T16:16:00-06:00 ---- - -# GSD Decisions Log - -## Phase 2 Decisions - -**Date:** 2026-03-03 - -### Scope -- Phase 2 is scoped to: the **Home Page** (route `/`) only, including the shared application shell (Header/Navbar + Footer) that wraps all pages. -- Does **not** include implementing any linked pages (Team, Publications, Projects, etc.) — buttons and nav links will be rendered but will navigate to placeholder routes. -- Routing scaffolding will be set up so future phases can simply add `app//page.tsx` files. - -### Approach -- **App Shell as Layout**: Header (navbar) and Footer will be React Server Components placed in `app/layout.tsx` (or a nested layout), so they persist across all future page navigations without re-rendering. -- **Home Page as `app/page.tsx`**: The root page component renders the hero/login section, features grid, mailing list CTA, "More Info" section. -- **Routing**: Use Next.js App Router file-system routing. All legacy Angular `ui-router` states map 1:1 to `app/` directories. Next.js `` replaces `ui-sref`. -- **Styling**: Use MUI components (AppBar, Button, TextField, Container, Grid, Box, Typography) themed via the existing `lib/theme.ts`. Section-specific styles use CSS Modules (e.g., `home.module.css`) for the splash/home page visual fidelity. -- **Assets**: All images already exist in `public/img/` and `public/img/home/`. Icomoon fonts are in `public/icomoon/`. - -### Constraints -- No Angular code is reused — only the HTML structure and CSS values are referenced for pixel-accurate reproduction. -- Sign-in form is a UI-only stub for now (no auth integration until Phase 5). -- Mailing list form posts to the existing Mailchimp endpoint (preserved from legacy). - -## Phase 3 Decisions - -**Date:** 2026-03-03 - -### Scope -- Phase 3 scope has been updated from just generic "Shared UI Components" to building the four primary header tab landing pages: `/team`, `/publications`, `/projects`, and `/events`. -- Sub-pages (like individual team members `/team/:name` or specific yearly events `/events/plantseed2015`) are currently **excluded** from this initial Phase 3 scope to ensure we focus on the core landing pages first (unless requested otherwise). -- The global `
` will be updated to properly highlight the active tab using Next.js `usePathname()`. - -### Approach -- Chose: **Data-Driven (Content Extraction)** for static content. -- Reason: Instead of raw, hardcoded JSX ports of `team.html` and `publications.html`, we will extract content into local JSON objects or arrays (e.g., `lib/data/team.ts`, `lib/data/publications.ts`) and map over them. This maintains exact visual replication while dramatically improving maintainability and code readability. -- Chose: **Client-side Header Navigation** (`"use client"`). -- Reason: To utilize `usePathname()` for active tab highlighting, the header component must be a client component. - -### Constraints -- Must achieve exact 1:1 visual fidelity with the legacy Angular site. -- Must use modern MUI v7 components integrated with Next.js App Router, completely replacing old `ngMaterial` wrappers. - -## Phase 4 Decisions - -**Date:** 2026-03-03 - -### Scope -- Full implementation of the Biochem tabs: Reactions and Compounds, including their respective detail pages (`/rxn/[id]` and `/cpd/[id]`). -- Sub-navigation for the other tabs (Public Models, Subsystems, Media) will be built to match the legacy UI, but will remain as "Coming Soon" or empty stubs for now. - -### Approach -- **Data Fetching:** Direct client-side fetching using fetching utilities and `@tanstack/react-query` to hit the existing ModelSEED Solr API, preserving the snappy client-side experience of the legacy app. A utility to translate table state to Solr queries (replacing `biochem.js` behavior) will be created. -- **Data Tables:** Since there is a lot of data, we will use `@mui/x-data-grid` (or equivalent robust table) with server-side pagination (translating table state into Solr offset/limit parameters) to match the legacy `ng-table-solr`. - -### Constraints -- Search behaves exactly as the legacy UI (custom query parsing for parens, colons, etc.). -- Formatting of columns (deltaG, stoich, aliases with external links) must map 1:1. - -## Phase 5 Decisions - -**Date:** 2026-03-04 - -### Scope -- Deferred Fusions, Regulons ("Projects" links) and Escher. -- Two-Header Architecture: - 1. Maintain the current global header (`components/layout/Header.tsx`) for public pages (Home, Team, Publications, Projects, Events, About). - 2. Implement a new contextual App Header (`components/layout/AppHeader.tsx`) specifically for the reference data / user data / build model sections. This header will display the `Reference Data | User Data | Build Model` tabs and a `More` dropdown for public links. -- Implement the Workspace API to bring the non-Solr tables online (Plant Models, Subsystems). -- Rename the `biochem` routes to `reference-data`. The Sub-navigation for reference-data will contain Public Plant Models, Subsystems, Reactions, Compounds, Media. -- Implement Sign-In Gate: Clicking "User Data" or "Build Model" when not authenticated must trigger a sign-in dialog popup (mocked for now) instead of just navigating. - -### Approach -- Chose: RESTful POST JSON-RPC to ModelSEED Workspace API `https://p3.theseed.org/services/Workspace` with typed utility hooks. -- Reason: Simplifies authentication logic for future phases, successfully tested live API. - -### Constraints -- Must ensure that legacy permalinks like `/rxn/[id]` and `/cpd/[id]` are not broken by the renaming of `app/biochem` to `app/reference-data`. - -## Phase 6 Decisions - -**Date:** 2026-03-05 - -### Scope -- Revert/update internal resource links to perfectly match the legacy ModelSEED routes (e.g., changing `/cpd/[id]` to `/biochem/compounds/[id]`, `/rxn/[id]` to `/biochem/reactions/[id]`). -- Restore all hyperlinked columns across Reference Data tabs (Public Plant Models, Subsystems, Reactions, Compounds). -- If a route doesn't exist yet (e.g., `/genomes/`, `/model/`), the link must still be generated exactly as it was in the legacy UI. -- Ensure 1-to-1 visual matching in tables, particularly regarding vertical list spacing (e.g., multiple Pathways or Features in one cell should stack vertically) and link colors. -- Implement the "Comment" button modal in the Reactions table. -- Implement proper chemical formula rendering for equations and compound formulas. - -### Approach -- **Exact Path Replication:** Update next.js `Link` components to formulate `href` attributes that perfectly match legacy `modelseed.org` paths. Rename app routing folders as requested to match the legacy paths (e.g. `app/biochem/compounds/[id]`). -- **DataGrid Formatting:** Utilize `getRowHeight={() => 'auto'}` and custom `renderCell` functions to display arrays as vertically spaced lists in Subsystems/Reactions tables, replicating the legacy styling exactly. -- **Text Parsers:** Implement regex-based formatting for formulas (converting numbers to subscripts) and mapping reaction equations to clickable molecule links. - -### Constraints -- Every link, button, vertical spacing, and feature must be identical to the original UI. Priority is absolute visual and structural fidelity. - -## Phase 10 Decisions - -**Date:** 2026-03-06 - -### Scope -- Implement Global Search across all Biochemistry Tables with partial hit highlighting (like Google Docs/Search). -- Implement advanced row/column filters (greater than, less than, between, text matches) aligned next to the global search. -- Implement Top-Right Pagination across all Biochemistry tables. -- This goes beyond standard legacy 1:1 fidelity to deeply integrate an enhanced UI experience while remaining visually native. - -### Approach -- Chose: **Option A (MUI DataGrid Custom Toolbar + Partially Client/Server filtering)**. -- Reason: Option A seamlessly integrates with the `DataGrid` engine. We will map complex filters into native Solr Query Syntax (`q=*` plus `fq=field:[min TO max]`) inside `lib/api/biochem.ts` for server-side evaluation where appropriate, and apply client-side text highlighting logic via custom `renderCell` functions for the visible page data. -- The `CustomToolbar` will replace the default `DataGrid` header, embedding the global search, filter dropdown, and a mirrored `TablePagination` component docked top-right. - -### Constraints -- Solr API strictness: Solr requires URL encoded arrays and explicit `[X TO Y]` boolean operators. `buildSolrUrl` will need an upgrade to parse complex MUI `filterModel` items. - -## Timestamp Log -- Updated: 2026-03-03T17:35:00-06:00 - Defined Phase 4 decisions -- Updated: 2026-03-05T09:05:00-06:00 - Defined Phase 6 decisions -- Updated: 2026-03-06T13:05:00-06:00 - Defined Phase 10 decisions -- Updated: 2026-03-11T09:47:00-05:00 - Defined Phase 11 decisions - -## Phase 11 Decisions - -**Date:** 2026-03-11 - -### Scope -- **PlantSEED Maintenance**: Temporarily disable the PlantSEED build pipeline functionalities in the UI. We will hide or disable the "Build New Model" buttons/forms for PlantSEED genomes and replace them with a prominent warning banner explaining the migration to v3.0. A global banner will also be added to `/plant` and `/genomes` pages. -- **Proxy All Workspaces**: Create an abstraction over the Workspace API URLs so that the frontend can route all operations (`.ls`, `.get`, etc.) through a new unified API proxy delivered by the backend team, sheltering the frontend from direct direct workspace interactions. -- **Biochemistry Fetching**: Make the Solr biochem service endpoint configurable (as either reading from Solr or José's new API). -- **RAST Job Segregation**: Explicitly keep RAST job polling pointing strictly to `modelseed_support` instead of the new proxy, as requested. - -### Approach -- Chose: **Config-Driven Service Routing**. -- Reason: The backend team's new endpoints are actively being developed. Hardcoding direct URLs right now will cause breakage. Creating an abstraction where the base URLs are read from a config file (e.g., `lib/api/config.ts`) allows us to quickly toggle between old/raw endpoints and the new proxy endpoints when José is ready. - -### Constraints -- The UI must handle dual-mode or gracefully degrade when the new proxy endpoints are being fully implemented on the backend. -- Existing functionalities involving `modelseed_support` for async jobs MUST NOT break during the workspace transition. - -## Milestone 1 Final Wrap-up Discussion - -**Date:** 2026-03-11 - -### Findings & Remaining Gaps: -- The fundamental UI parity and data table features (Biochem, Public Models) are complete. -- **Data Source Links:** JGI Gene Atlas URL broken during legacy switch (fixed from phytozome.jgi.doe.gov to plantgeneatlas.jgi.doe.gov). -- **Authentication Flow:** Auth modal (`SignInModal`) successfully mocks login to allow accessing protected routes (`/plant`, `/my-models`), preventing a hard block on UI testing, and correctly links to PATRIC/RAST account creation strings. Real token generation and API injection (e.g. passing the Authorization header to `callWorkspaceApi`) remains outstanding since the backend auth proxy is not deployed. -- **User Data Workspaces:** Actual viewing of `/my-models` and saving files is a stub. Requires real auth token passing, which goes hand-in-hand with backend proxy. -- **Model Building Action:** `Build Model` initiates UI rendering but doesn't fire POST requests structurally configured to create async RAST tasks yet. - -### Approach to Close Milestone: -- Considered UI-complete for the React transition. -- Next milestone should focus strictly on "Backend Integrations & Authenticated User Data," where `modelseed_support` RAST jobs and proxy routing configurations are fully tied to live JWTs. - -## Phase 12 Decisions - -**Date:** 2026-03-11 - -### Scope -- Replace the mock UI-only authentication with functional authentication against live REST endpoints for PATRIC (`user.patricbrc.org/authenticate`) and RAST (`p3.theseed.org/Sessions/Login`). -- Persist the authentication token dynamically (e.g. `localStorage` or Next.js cookies) so it's globally available for `callWorkspaceApi`. -- Create a designated testing bypass specifically for local development testing. - -### Approach -- Chose: Maintain an exact 1:1 mapping of the AngularJS `$http` POST schemas for the authentication endpoints. Introduce an explicit credential intercept: if `username === 'developer'` and `password === 'developer'`, immediately resolve a mock token without making external HTTP requests. -- Reason: The backend components (Workspace API, MS_FBA) depend heavily on the token format returning from PATRIC/RAST. Calling them through the Next.js Client is acceptable since these are public authentication APIs, though typically this would be handled server-side to prevent CORS. (Needs verification on CORS). The developer bypass facilitates testing in pipelines or environments where external network calls fail. - -### Constraints -- Handling CORS: Calling external authentication APIs directly from the browser (Client Components) might trigger CORS issues depending on how PATRIC/RAST servers are configured. If CORS blocks the browser, we will have to build a Next.js Server Action (`app/api/auth/route.ts`) to proxy the authentication handshake. - -## Timestamp Log -- Updated: 2026-03-11 10:08:00 -05:00 - Logged Phase 12 decisions from /discuss-phase -- Updated: 2026-03-11 11:00:00 -05:00 - Logged Phase 13 decisions from /discuss-phase - -## Phase 13 Decisions - -**Date:** 2026-03-11 - -### Scope -- Validate and flawlessly align ALL local routes and `` tags to exactly emulate the legacy UI (AngularJS) URLs. -- Placeholder Next.js pages must be created for missing legacy routes (`/data/...`, `/fba/...`, `/feature/...`) so user links do not 404. -- Proper chemical formula parsing for reference data reactions' equations. - -### Approach -- Chose: **Option A (Custom Formatting Regex Method)** for chemical equation rendering. -- Reason: Lightweight and strictly matches stoichiometric structures without bloat. Differentiates stoichiometric multipliers `(2)` from compound subscripts `H2O` yielding `H₂O` correctly. -- Ensure all app URLs are perfectly replicated for deployment readiness to maintain standard ModelSEED standards. - -### Constraints -- URLs must be strictly 1-to-1 against legacy, or deployment breaks. No visual discrepancies for equations. diff --git a/.gsd/MODELSEED_RULES.md b/.gsd/MODELSEED_RULES.md deleted file mode 100644 index 28b8b6d2..00000000 --- a/.gsd/MODELSEED_RULES.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -updated_at: 2026-03-03T08:51:04-07:59 ---- - -# ModelSEED UI Transition Protocol - -**CRITICAL DIRECTIVE:** The `external/ModelSEED-UI` directory contains the legacy code. You may **ONLY read from it** to understand the visual layout, features, and assets. You **MUST NOT** copy its implementation or use its outdated methodology. - -**Goal:** Recreate the identical UI visual look, but modernized with the secure new stack. - -## Tech Stack -Node Version Manager (nvm): 0.40.3 -Node.js: v22.17.0 (LTS) -npm: 10.9.2 -Next.js: 16.1.6 (App Router) -TypeScript: v5.0.0+ (Strict type safety) -React: 19.2.3 -@mui/material: ^7.3.8 -@emotion/react: ^11.14.0 -@emotion/styled: ^11.14.1 -zustand: ^5.0.11 -@tanstack/react-query: ^5.90.21 - -## Process Constraints -- Never blindly reuse old code snippets from the external folder. -- Follow the GSD methodology for creating specific UI components using Next.js 16 and MUI 7. diff --git a/.gsd/README.md b/.gsd/README.md deleted file mode 100644 index 8b7e031a..00000000 --- a/.gsd/README.md +++ /dev/null @@ -1,25 +0,0 @@ -# GSD Methodology Directory (`/.gsd`) - -This directory follows the **"Get Shit Done" (GSD)** methodology. It provides a source of truth for the project's state, design decisions, and future roadmap. - -## Key Documents -- **`ROADMAP.md`**: The high-level plan, broken down by Milestones and Phases. -- **`STATE.md`**: The live tracker for the **current phase**, task status, and next steps. -- **`DECISIONS.md`**: A historical record of architectural choices (including technical constraints and URL paradigms). -- **`ARCHITECTURE.md`**: A high-level overview of the Next.js system and data flow. -- **`STACK.md`**: Enumeration of the core technologies (MUI v7, TanStack Query, etc.). -- **`SPEC.md`**: Technical specifications and requirements for the current work. - -## Project Organization -- **`milestones/`**: Archive of completed milestones. -- **`phases/`**: Detailed breakdown and execution summaries for each individual phase (Phase 1, 2, ... Phase 14). -- **`templates/`**: Blank documents for starting new phases. - -## Usage for Developers -Before starting any code changes, **always check `STATE.md`** to understand where we are in the development lifecycle and to ensure you aren't working out of sequence. - ---- -*Refer to `PROJECT_RULES.md` in the root for the canonical GSD rules.* - -## Timestamp Log -- Updated: 2026-03-12 20:18:13 CDT - Removed emojis from headings; no change to GSD semantics. diff --git a/.gsd/ROADMAP.md b/.gsd/ROADMAP.md deleted file mode 100644 index 99dc3b85..00000000 --- a/.gsd/ROADMAP.md +++ /dev/null @@ -1,172 +0,0 @@ -# ROADMAP - -## Milestone 1: v1-alpha — Base Application Migration [COMPLETE] - -## Milestone 2: v1-beta — Data Analysis & Interactive Tools [IN PROGRESS] - -### Phase 13: Deployment Readiness (URL Parity & Equation Formatting) -**Status**: ✅ Complete -- Audit and align all local routes and `` tags to exactly match the legacy UI's URL structures. -- Ensure placeholder dynamic routes exist for legacy links (e.g., `/data/...`, `/fba/...`). -- Implement custom React formatting utility (Option A) to parse Reaction equations for proper chemical formula subscripting. - -### Phase 14: FBA & Simulation Results / Service Status Auth Fix -**Status**: ✅ Complete -- Fix service status authentication (useAuth integration, mock token support) -- Display FBA results in interactive tables and charts. -- Implement simulation status tracking for queued jobs. - -### Phase 16: UI/UX Refinement & Data Consistency -**Status**: ✅ Complete -- Standardize data table headers with search, filters, manage columns, and pagination. -- Apply consistent headers across all dynamic reference data subtabs. -- Fix UI/UX issues: tooltips on disabled elements, passive model indicators, and home page login logic. - -### Phase 17: Authenticated User Data & Workspace/API Integration -**Status**: ⚪ Not Started -- Fix authentication and permissions so signed-in users can reliably access **My Models** and **My Media**. -- Resolve Workspace permission errors by integrating with the appropriate backend (P3 Workspace or the new `modelseed-api` workspace proxy). -- Ensure Build Model UX defaults to the active "UPLOAD Microbes FASTA" tab while keeping the Plant tab disabled with tooltip. -- Exercise and validate user flows against the new `modelseed-api` backend using test RAST/PATRIC accounts. - -- Regression checks and readiness assessment for promoting the new stack as the primary ModelSEED UI. - -### Phase 19: UI Reliability and Functional Parity -**Status**: ✅ Complete -- Fixed console errors in the Build Model flow and add maintenance banners where features are in-progress. -- Implemented the "Commands" column in My Models for downloading (SBML, JSON, TSV) and deleting models with confirmation. -- Reconstructed the Model Detail page with full tabbed data tables (Reactions, Compounds, etc.) matching legacy visuals. -- Integrated the standard `DataControlHeader` into all user data tables for consistent filtering and column management. - -### Phase 19.4: DataControlHeader Integration & Search Fix -**Status**: ✅ Complete -- Fixed DataControlHeader search functionality to be clickable and searchable. -- Integrated DataControlHeader into My Models and My Media pages. -- Added DataControlHeader to biochem reference data tabs (compounds, reactions). - -### Phase 20: New API Consolidation (Models, Jobs, Workspace Proxy) -**Status**: 🔄 In Progress -- **Target:** Use the new API (Poplar: `MODELSEED_API_URL` = http://poplar.cels.anl.gov:8000) for all backend operations **except** biochemistry reference table serving (keep Solr for biochem search/tables per backend team). -- **Auth:** PATRIC token in `Authorization` header (direct, no Bearer). Set `USE_MODELSEED_API=true` and `USE_NEW_PROXY=true`. -- **Models:** GET/POST/DELETE `/api/models`, `/api/models/data`, `/api/models/export`, `/api/models/copy`, `/api/models/gapfills`, `/api/models/gapfills/manage`, `/api/models/fba`. -- **Jobs:** GET `/api/jobs`, POST `/api/jobs/reconstruct`, `/api/jobs/gapfill`, `/api/jobs/fba`, `/api/jobs/manage`. -- **Media:** GET `/api/media/public`, `/api/media/mine`. -- **Workspace:** Transition to new API only — POST `/api/workspace/ls`, `/get`, `/create`, `/delete`, `/copy`, `/metadata`, `/permissions`, `/download-url` (request/response format matches PATRIC workspace JSON-RPC, REST transport). -- **Biochemistry:** Do not switch reference data tables to new API; keep using Solr for biochem search and table serving. -- Implement Build Model end-to-end flows (submit, poll jobs, manage outputs) against the new API. - -### Phase 21: PATRIC & RAST Genome Selection Fix -**Status**: 🔄 In Progress -- Replace basic text inputs for PATRIC/RAST genomes in the "Build Model" page with functional, searchable data grids. -- Implement PATRIC Data API (RQL) for genome searching. -- Implement RAST job listing API via modelseed_support service. -- Use `DataControlHeader` for consistent search and pagination in PATRIC/RAST tabs. -- Ensure the "Build Model" action from the table correctly initiates reconstruction. - -### Phase 22: Poplar API Endpoint Parity and Model Flow Reliability -**Status**: ✅ Complete -- Align frontend API usage with Poplar `/demo`-validated endpoint behavior for models/jobs/media/workspace (excluding biochem table serving). -- Remove model detail's hard dependency on workspace `/get` by preferring `/api/models/data`, `/api/models/gapfills`, and `/api/models/fba`. -- Add repeatable smoke verification for authenticated endpoint coverage against Poplar. -- Ensure My Models click-through and downstream model detail rendering are stable with real user refs and raw PATRIC token auth. -- Finalize `/myMedia` endpoint-backed behavior and remove broken banner once stable. -- Finalize `/plant` build model and jobs workflows end-to-end using authenticated API calls. - -### Phase 23: Full Non-Biochem Endpoint Coverage and Localhost Demo Validation -**Status**: ✅ Complete -- Add frontend API client coverage for all modelseed-api non-biochem endpoints used by `/demo` and documented in `modelseed-api` README. -- Keep Solr as the source for biochemistry reactions and compounds tables. -- Extend token-auth smoke validation against `http://localhost:8000` tunnel to cover non-destructive checks for models/jobs/media/workspace endpoints. -- Verify primary user pages (`/my-models`, `/myMedia`, `/plant`, `/model/...`) remain functional and visually aligned with legacy layout expectations. -- Exclude destructive delete-model testing from automated verification. - -### Phase 24: Page-Level API Adoption and Browser Final Verification -**Status**: 🔄 In Progress -- Apply newly added non-biochem API endpoints in the relevant UI pages, using legacy pages only for parity reference. -- Complete page-level API wiring for authenticated user flows (`/my-models`, `/myMedia`, `/plant`, `/model/...`) while preserving current delete restrictions in tests. -- Execute real browser validation on localhost with token-authenticated session and verify route behavior end-to-end. -- Document remaining unbuilt or intentionally deferred legacy-equivalent pages/features. - -### Phase 25: Missing Workflow UIs (Merge, Edit, History, Media CRUD, Delete) -**Status**: 🔄 In Progress -- Design and implement dedicated merge-model workflow UI for `POST /api/jobs/merge`. -- Design and implement dedicated model editing workflow UI for `POST /api/models/edit`. -- Build a richer model edit-history interface (beyond counts) using `/api/models/edits`. -- Implement full my-media CRUD parity (create/delete media) with safe delete UX. -- Implement delete-model UI behavior wired to existing delete API, with tests constrained to non-supervisor/test models. - -### Phase 26: Model Detail Legacy Parity and Validation Readiness -**Status**: 🔄 In Progress -- Translate legacy model-detail "Visualize Data" behavior into functional modern UI (FBA, Gapfill, Expression states) without requiring new Run FBA/Run Gapfill button behavior. -- Implement remaining model-detail parity features identified during validation review (download/detail surfaces, translated tabs/panels, and unsupported-feature UX where backend capability is missing). -- Produce a complete translated-vs-not-translated inventory for the model detail flow and close high-priority parity gaps needed for full validation sign-off. -- Execute browser/API validation against localhost token-auth session for `/model/...` to confirm functional parity on non-destructive flows. - -### Phase 27: Formatting, Cross-Links, and Legacy Surface Completion -**Status**: ✅ Complete -- Align model-detail reaction/compound/biomass/pathway tables with legacy chemical formatting and cross-links (IDs → biochem detail, genome refs → genome detail). -- Implement or explicitly mark deferred the remaining legacy model-detail surfaces (Predictions, dynamic pathway tabs, organism image/links block) with clear modern UX. -- Close remaining formatting/link inconsistencies across user models vs reference data and produce an updated audit ready for final v1-beta validation. - -### Phase 28: Legacy Feature Parity — Detail Pages, Jobs Page, and Dead Link Closure -**Status**: ✅ Complete -- Implement functional FBA detail page (`/fba/[...path]`) with Reaction Fluxes, Exchange Fluxes, and Pathways tabs using existing `getModelFbaFromApi`. -- Implement functional Gapfill detail page (`/gapfill/[...path]`) showing gapfill reactions table using existing `listModelGapfillsFromApi`. -- Implement functional Genome detail page (`/genome/[...path]`) with Features and Annotations tabs reading workspace genome objects. -- Add dedicated My Jobs page (`/my-jobs`) under user-data layout with status counts, full jobs table with polling, and stderr/stdout links — matching legacy URL `/my-jobs`. -- Add "My Jobs" tab to user-data layout navigation. -- Ensure all URLs match legacy patterns exactly (`/fba/`, `/gapfill/`, `/genome/`, `/my-jobs`). - -### Phase 29: User Testing Readiness — Feature Page, Header Fix, Cleanup -**Status**: ✅ Complete -- Implement functional Feature detail page (`/feature/[...path]`) with function, subsystems, aliases, and protein sequence — replacing "under construction" placeholder. -- Fix AppHeader `isUserDataActive` detection to include `/my-jobs` for correct tab highlighting. -- Remove stale READMEs in `/fba` and `/gapfill` that incorrectly describe pages as "under construction." -### Phase 30: Analytical Tools — Model Comparison & Workspace Browser -**Status**: ⚪ Not Started -- Implement functional Model Comparison route (`/compare`) allowing users to selection 2-3 models for side-by-side comparison of reactions, biomass, and gapfills. -- Upgrade the generic `/data/[...path]` from a placeholder to a functional raw workspace browser (listing files/metadata and providing download links). -- Ensure parity with legacy "Comparison" and "Workspace" views. - -### Phase 31: UI Transition Completion for User Testing -**Status**: ✅ Complete -**Objective**: Complete all UI-side logic to achieve parity with legacy AngularJS UI, ready for user testing once backend API issues resolved. -- **Data Browser** (`/data/[...path]`): ✅ Full workspace file browser with directory listing, breadcrumbs, metadata, and download links -- **Model Comparison** (`/compare`): ✅ Side-by-side model comparison with reaction diffs and heatmap visualization -- **Media Editor**: ✅ Compound-level editing integrated into My Media with Add/Remove compounds and inline editing -- **Model Editor Enhancement**: ✅ Add/Remove reactions in Edit tab with dialog integration -- **Missing Dialogs**: ✅ SaveAs, SelectMedia, AddCompounds, AddReactions, ShowMetadata dialogs created -- **Bulk Download**: ✅ CSV export on compounds and reactions pages -- **API Fallbacks**: ✅ Graceful "API unavailable" messages throughout -- **Note**: Workspace API write operations (create/delete/copy/metadata/permissions) and `editModelFromApi` require backend fixes - -## Timestamp Log -- Updated: 2026-03-11 10:50:00 -05:00 - Reset roadmap for Milestone 2. -- Updated: 2026-03-11 11:12:00 -05:00 - Phase 13 complete (URL parity and equation formatting). -- Updated: 2026-03-11 11:18:00 -05:00 - Fixed parameter naming in catch-all stubs and refined equation formatting logic. -- Updated: 2026-03-11 11:30:00 -05:00 - Phase 14 complete (service status auth fix). -- Updated: 2026-03-11 19:36:00 -06:00 - Phase 16 complete (UI/UX refinement and data consistency). -- Updated: 2026-03-11 20:05:00 -06:00 - Re-scoped Phase 17 for authenticated user data and Workspace/modelseed-api integration. -- Updated: 2026-03-12 15:30:00 -05:00 - Re-scoped Phase 18 for modelseed-api verification and end-to-end testing. -- Updated: 2026-03-12 17:15:00 -05:00 - Added Phase 19 for UI Reliability and functional parity. -- Updated: 2026-03-12 17:30:33 -05:00 - Executed Phase 19 plans and produced summaries/verification; pending manual browser checks. -- Updated: 2026-03-12 17:40:00 -05:00 - Added Phase 19.4 plan for DataControlHeader integration. -- Updated: 2026-03-12 17:45:00 -05:00 - Phase 19.4 complete: DataControlHeader integrated into all user data and biochem pages. -- Updated: 2026-03-12 19:26:13 -05:00 - Added Phase 20 scope for models/jobs/workspace proxy and Build Model end-to-end integration. -- Updated: 2026-03-12 19:50:00 -05:00 - Phase 20: workspace transition to POST /api/workspace/*; new API for all except Solr biochem tables; Poplar URL and PATRIC auth. -- Updated: 2026-03-12 19:55:16 CDT - Phase 20 implementation committed; final authenticated Poplar verification still pending. -- Updated: 2026-03-13 09:30:00 -05:00 - Added Phase 21 for PATRIC/RAST Genome Selection Fix in Build Model page. -- Updated: 2026-03-13 09:57:09 CDT - Executed Phase 21 plans; implementation complete with build verification, awaiting authenticated browser validation. -- Updated: 2026-03-13 10:56:00 CDT - Added Phase 22 for Poplar endpoint parity and model flow reliability hardening. -- Updated: 2026-03-13 11:01:38 CDT - Re-scoped Phase 22 with explicit `/myMedia`, `/plant`, and target `/model/...` outcomes aligned to demo behavior. -- Updated: 2026-03-13 11:12:24 CDT - Phase 22 executed and verified (PASS) with authenticated localhost demo smoke checks. -- Updated: 2026-03-16 09:36:04 CDT - Added Phase 23 for full non-biochem endpoint coverage and localhost tunnel validation. -- Updated: 2026-03-16 09:46:46 CDT - Added Phase 24 for page-level API adoption and browser final verification. -- Updated: 2026-03-16 10:17:02 CDT - Added Phase 25 scope for remaining workflow UIs (merge, edit, history, media CRUD, delete model). -- Updated: 2026-03-16 10:36:09 CDT - Executed Phase 25 implementation work; code/build verification passed and live authenticated destructive-flow checks remain pending. -- Updated: 2026-03-16 11:07:14 CDT - Added Phase 26 scope for model detail legacy parity completion and validation readiness. -- Updated: 2026-03-16 11:24:49 CDT - Executed Phase 26 implementation work; live model-detail validation is partially blocked by backend Workspace 500 responses. -- Updated: 2026-03-16 11:39:55 CDT - Added Phase 27 for formatting/link parity and remaining legacy surface completion on model-detail and related flows. -- Updated: 2026-03-16 11:46:54 CDT - Executed and verified Phase 27 formatting/link parity and legacy-surface UX closure. -- Updated: 2026-03-19 10:15:00 CDT - Phase 23 complete: full non-biochem API client coverage and poplar smoke validation. -- Updated: 2026-03-23 13:30:00 CDT - Added Phase 31 for UI transition completion and user testing readiness (gap analysis complete). diff --git a/.gsd/SPEC.md b/.gsd/SPEC.md deleted file mode 100644 index 04305900..00000000 --- a/.gsd/SPEC.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -updated_at: 2026-03-03T09:00:01-06:00 ---- - -# ModelSEED UI Spec - -**Status**: FINALIZED - -## Objective -Recreate the ModelSEED-UI (https://modelseed.org/) using a modern, secure tech stack while maintaining identical visual appearance and UI/UX flows. - -## Tech Stack -- **Environment**: Node Version Manager (nvm) 0.40.3 -- **Runtime**: Node.js v22.17.0 (LTS) -- **Package Manager**: npm 10.9.2 -- **Framework**: Next.js 16.1.6 (App Router) -- **Language**: TypeScript v5.0.0+ (Strict type safety for scientific data structures) -- **Core Library**: React 19.2.3 -- **UI Framework**: @mui/material ^7.3.8, @emotion/react ^11.14.0, @emotion/styled ^11.14.1 -- **State Management**: zustand ^5.0.11 -- **Data Fetching**: @tanstack/react-query ^5.90.21 - -## Constraints -- **Do not copy legacy code:** The code in `external/ModelSEED-UI` is strictly for reference (understanding visual layout, CSS behavior, and assets). -- **Modern implementation:** All components must be rewritten using Next.js 16 (App Router), MUI v7, and modern React patterns (hooks, server components). -- **Security & Quality:** Leverage modern stack capabilities for improved security, performance, and code maintainability. diff --git a/.gsd/STACK.md b/.gsd/STACK.md deleted file mode 100644 index 6bf735b3..00000000 --- a/.gsd/STACK.md +++ /dev/null @@ -1,46 +0,0 @@ ---- -updated_at: 2026-03-03T08:59:34-06:00 ---- - -# Technology Stack - -> Auto-generated by /map on 2026-03-03 - -## Runtime - -| Technology | Version | Purpose | -|------------|---------|---------| -| Node.js | v22.17.0 | Core runtime for App and Build Engine | -| npm | 10.9.2 | Package Management | - -## Dependencies - -### Production -| Package | Version | Purpose | -|---------|---------|---------| -| next | 16.1.6 | Core React Framework (App Router) | -| react | 19.2.3 | UI Library | -| react-dom | 19.2.3 | DOM Renderer | -| @mui/material | ^7.3.8 | Comprehensive UI Component Library | -| @emotion/react | ^11.14.0 | CSS-in-JS Engine for MUI | -| @emotion/styled| ^11.14.1 | Styled Components framework | -| zustand | ^5.0.11 | Lightweight state management | -| @tanstack/react-query | ^5.90.21 | Asynchronous state management and data fetching | - -### Development -| Package | Version | Purpose | -|---------|---------|---------| -| typescript | ^5 | Strict type safety | -| eslint | ^9 | Code linting | -| eslint-config-next | 16.1.6 | Next.js specific linting rules | -| @types/node | ^20 | Node.js typings | -| @types/react | ^19 | React typings | - -## Legacy Dependencies (Being Phased Out) - -| Package | Version | Previous Purpose | -|---------|---------|------------------| -| angular | 1.4.0 | Former App Framework | -| bootstrap| 3.3.4 | Former Styling Framework | -| grunt | ~0.4.5 | Former Build Tool | -| d3 | 3.5.5 | Former Visualization Library (Identify modern equivalent) | diff --git a/.gsd/STATE.md b/.gsd/STATE.md deleted file mode 100644 index 31fd7230..00000000 --- a/.gsd/STATE.md +++ /dev/null @@ -1,30 +0,0 @@ -# Current State - Phase 23 Complete, Milestone 2 In-Progress - -## Goal -The goal is to transition all backend operations (excluding biochemistry reference data) to the new ModelSEED API (`poplar.cels.anl.gov:8000`) and achieve full functional parity with the legacy UI. - -## Current Position -- **Active Phase**: Phase 24 (Page-Level API Adoption) -- **Status**: 🔄 In Progress -- **Last Commit**: `37d5b79` - "docs(phase-23): mark endpoint coverage and smoke validation complete" - -## Accomplishments -1. **API Coverage (Phase 23)**: Achieved full coverage for non-biochem endpoints and implemented `scripts/poplar-smoke.mjs` for validation. -2. **Workspace Migration (Phase 20)**: Fully transitioned `ls` and `get` operations to the REST proxy (no legacy fallback). -3. **PATRIC Support**: Fixed genome search fallback and parsing logic for better reliability. -4. **Auth Readiness**: Implemented sign-out redirects and `AuthGuard` auto-redirects to improve user testing UX. -5. **Feature Detail Page**: Fully implemented at `/feature/[...path]`. Shows function, subsystems, aliases, and protein sequences. -6. **Data Highlighting**: Fixed `/my-jobs` tab highlighting in the user-data layout. - -## Next Steps for New Session -1. **Model Comparison**: Consider implementing the `/compare` route if multi-model analysis is required for testing. -2. **Workspace Browser**: The generic `/data/[...path]` is still a placeholder. Check if users need to browse raw workspace files. -3. **Reference Data Restore**: Check if missing microbial reference data (other than Genomes/Media) needs restoration. -4. **User Testing**: Project is currently in a "feature complete" state relative to the legacy parity goals. Next step is typically user validation or deployment. - -## Technical Context for Handover -- **Legacy Path**: `external/ModelSEED-UI` -- **New Path**: Root directory (Next.js App Router) -- **Key APIs**: `lib/api/modelseed.ts`, `lib/api/workspace.ts` -- **Data Fetching**: Using `react-query` with `workspaceGet` for most detail pages. -- **Routing Strategy**: Dynamic catch-all segments `[...path]` used for workspace compatibility. diff --git a/.gsd/examples/cross-platform.md b/.gsd/examples/cross-platform.md deleted file mode 100644 index d1d32fd7..00000000 --- a/.gsd/examples/cross-platform.md +++ /dev/null @@ -1,103 +0,0 @@ ---- -updated_at: 2026-03-02T17:05:45-07:59 ---- - -# Cross-Platform Commands Reference - -> PowerShell ↔ Bash equivalents for GSD workflows - -## Common Operations - -| Operation | PowerShell | Bash | -|-----------|------------|------| -| **Test file exists** | `Test-Path "file.md"` | `test -f "file.md"` | -| **Test directory exists** | `Test-Path "dir" -PathType Container` | `test -d "dir"` | -| **Create directory** | `New-Item -ItemType Directory -Path "dir"` | `mkdir -p "dir"` | -| **List files** | `Get-ChildItem "*.md"` | `ls *.md` | -| **List recursively** | `Get-ChildItem -Recurse` | `find . -type f` | -| **Read file** | `Get-Content "file.md"` | `cat "file.md"` | -| **Search in files** | `Select-String -Path "**/*" -Pattern "TODO"` | `grep -r "TODO" .` | -| **Count lines** | `(Get-Content file).Count` | `wc -l < file` | -| **Copy files** | `Copy-Item -Recurse src dest` | `cp -r src dest` | -| **Delete files** | `Remove-Item -Recurse -Force dir` | `rm -rf dir` | - -## Git Operations (Same on Both) - -```bash -git add -A -git commit -m "message" -git push -git status --short -``` - -## Workflow-Specific Examples - -### /map — Analyze Codebase - -**PowerShell:** -```powershell -Get-ChildItem -Recurse -Directory | - Where-Object { $_.Name -notmatch "node_modules|\.git" } -``` - -**Bash:** -```bash -find . -type d ! -path "*/node_modules/*" ! -path "*/.git/*" -``` - ---- - -### /plan — Check SPEC Status - -**PowerShell:** -```powershell -$spec = Get-Content ".gsd/SPEC.md" -Raw -if ($spec -match "FINALIZED") { "Ready" } -``` - -**Bash:** -```bash -if grep -q "FINALIZED" .gsd/SPEC.md; then echo "Ready"; fi -``` - ---- - -### /execute — Discover Plans - -**PowerShell:** -```powershell -Get-ChildItem ".gsd/phases/1/*-PLAN.md" -``` - -**Bash:** -```bash -ls .gsd/phases/1/*-PLAN.md 2>/dev/null -``` - ---- - -### /verify — Search TODOs - -**PowerShell:** -```powershell -Select-String -Path "src/**/*" -Pattern "TODO|FIXME" -``` - -**Bash:** -```bash -grep -rn "TODO\|FIXME" src/ -``` - ---- - -## Environment Detection - -Add this to workflows for cross-platform commands: - -```markdown -**Note:** Commands shown are PowerShell. For Bash equivalents, see `.gsd/examples/cross-platform.md` -``` - ---- - -*Reference for Linux/Mac users* diff --git a/.gsd/examples/multi-wave-workflow.md b/.gsd/examples/multi-wave-workflow.md deleted file mode 100644 index fbebd40e..00000000 --- a/.gsd/examples/multi-wave-workflow.md +++ /dev/null @@ -1,260 +0,0 @@ ---- -updated_at: 2026-03-02T17:05:45-06:00 ---- - -# Multi-Wave Workflow Example - -This example demonstrates a complete GSD workflow with: -- Short spec -- Plan breakdown -- 2-wave execution -- Verification with commands -- State snapshots - ---- - -## Example: Add User Authentication - -### 1. SPEC.md (Finalized) - -```markdown ---- -status: FINALIZED -updated: 2026-02-07 ---- - -# User Authentication Feature - -## Overview -Add login/logout functionality with JWT tokens. - -## Requirements -1. POST /api/auth/login endpoint -2. POST /api/auth/logout endpoint -3. JWT stored in httpOnly cookie -4. Protected route middleware - -## Success Criteria -- User can login with email/password -- Invalid credentials return 401 -- Protected routes require valid JWT -- Logout clears the cookie -``` - ---- - -### 2. ROADMAP.md (Phase Entry) - -```markdown -## Phase 1: User Authentication - -- [ ] Plan 1.1: Auth endpoints (Wave 1) -- [ ] Plan 1.2: Protected middleware (Wave 2) -``` - ---- - -### 3. PLAN 1.1 (Wave 1) - -```xml ---- -phase: 1 -plan: 1 -type: implementation -wave: 1 ---- - - -Create login and logout endpoints with JWT handling. - - - -Files to read: src/app/api/ structure, existing auth if any - - - - - Create login endpoint - src/app/api/auth/login/route.ts - - Create POST handler accepting {email, password}. - Query users table, compare password with bcrypt. - On success: generate JWT, set httpOnly cookie, return 200. - On failure: return 401 with generic error. - - curl -X POST localhost:3000/api/auth/login -d '{"email":"test@example.com","password":"test123"}' - Valid credentials return 200 + Set-Cookie header - - - - Create logout endpoint - src/app/api/auth/logout/route.ts - - Create POST handler that clears the auth cookie. - Return 200 on success. - - curl -X POST localhost:3000/api/auth/logout --cookie "token=..." - Cookie is cleared, response is 200 - - -``` - ---- - -### 4. Wave 1 Execution - -**Task 1 Commit:** -``` -git commit -m "feat(phase-1): create login endpoint" -``` - -**Task 2 Commit:** -``` -git commit -m "feat(phase-1): create logout endpoint" -``` - ---- - -### 5. Wave 1 State Snapshot - -```markdown ---- -wave: 1 -phase: 1 -created: 2026-02-07T10:30:00 -status: complete ---- - -# Wave 1 State Snapshot - -## Objective -Create authentication endpoints. - -## Changes Realized -- Created login endpoint with JWT generation -- Created logout endpoint with cookie clearing -- Added bcrypt password comparison - -## Files Touched -| File | Change Type | Description | -|------|-------------|-------------| -| src/app/api/auth/login/route.ts | created | Login handler | -| src/app/api/auth/logout/route.ts | created | Logout handler | - -## Verification Results -| Check | Command | Result | -|-------|---------|--------| -| Login works | `curl -X POST .../login` | ✅ 200 + cookie | -| Logout works | `curl -X POST .../logout` | ✅ 200 + cleared | - -## Commits in This Wave -| Hash | Message | -|------|---------| -| abc123 | feat(phase-1): create login endpoint | -| def456 | feat(phase-1): create logout endpoint | - -## TODO for Next Wave -1. Create auth middleware -2. Apply to protected routes -``` - ---- - -### 6. PLAN 1.2 (Wave 2) - -```xml ---- -phase: 1 -plan: 2 -type: implementation -wave: 2 -depends_on: [1] ---- - - -Create middleware to protect routes requiring authentication. - - - -Wave 1 complete: login/logout endpoints exist. -JWT is stored in httpOnly cookie named "token". - - - - - Create auth middleware - src/middleware/auth.ts - - Create middleware that: - 1. Reads JWT from cookie - 2. Verifies signature with jose - 3. Attaches user to request - 4. Returns 401 if invalid/missing - - Import and call middleware with mock request - Valid JWT passes, invalid/missing returns 401 - - - - Apply middleware to protected route - src/app/api/user/profile/route.ts - - Create example protected route. - Apply auth middleware. - Return user data if authenticated. - - curl localhost:3000/api/user/profile with and without cookie - With cookie: 200 + data. Without: 401 - - -``` - ---- - -### 7. Wave 2 Execution & Snapshot - -**Commits:** -``` -git commit -m "feat(phase-1): create auth middleware" -git commit -m "feat(phase-1): apply middleware to profile route" -``` - -**State Snapshot:** (similar format to Wave 1) - ---- - -### 8. Verification - -```bash -# Full verification sequence -curl -X POST localhost:3000/api/auth/login \ - -H "Content-Type: application/json" \ - -d '{"email":"user@example.com","password":"secret"}' \ - -c cookies.txt - -# Expected: 200 + Set-Cookie: token=... - -curl localhost:3000/api/user/profile -b cookies.txt -# Expected: 200 + user data - -curl localhost:3000/api/user/profile -# Expected: 401 - -curl -X POST localhost:3000/api/auth/logout -b cookies.txt -# Expected: 200 + cookie cleared -``` - ---- - -## Key Takeaways - -1. **Waves group dependent work** — Wave 2 waited for Wave 1 -2. **State snapshots preserve context** — Each wave ends with documented state -3. **Atomic commits per task** — Easy to trace and revert -4. **Verification built into plan** — No "trust me, it works" -5. **Effort hints model selection** — `high` effort = use reasoning model - ---- - -*See PROJECT_RULES.md for wave execution rules.* -*See templates/state_snapshot.md for snapshot format.* diff --git a/.gsd/examples/quick-reference.md b/.gsd/examples/quick-reference.md deleted file mode 100644 index 0337388e..00000000 --- a/.gsd/examples/quick-reference.md +++ /dev/null @@ -1,77 +0,0 @@ ---- -updated_at: 2026-03-02T17:05:45-06:00 ---- - -# GSD Quick Reference Card - -## Workflow Lifecycle - -``` -┌─────────┐ ┌─────────┐ ┌──────────┐ ┌─────────┐ -│ /map │ → │ /plan │ → │ /execute │ → │ /verify │ -│ │ │ │ │ │ │ │ -│ Analyze │ │ Create │ │ Run │ │ Check │ -│codebase │ │ phases │ │ tasks │ │ work │ -└─────────┘ └─────────┘ └──────────┘ └─────────┘ - ↑ │ - └──────────────┘ - (if gaps found) -``` - -## All Commands - -| Command | Args | Purpose | -|---------|------|---------| -| `/map` | - | Analyze codebase → ARCHITECTURE.md | -| `/plan` | `[phase]` | Create PLAN.md files for phase | -| `/execute` | `phase [--gaps-only]` | Run plans with wave execution | -| `/verify` | `phase` | Validate with empirical proof | -| `/debug` | `description` | Systematic debugging | -| `/progress` | - | Show current position | -| `/pause` | - | Save state, end session | -| `/resume` | - | Load state, start session | -| `/add-todo` | `item [--priority]` | Quick capture | -| `/check-todos` | `[--all]` | List pending items | - -## Core Rules - -| Rule | Enforcement | -|------|-------------| -| 🔒 Planning Lock | No code until SPEC finalized | -| 💾 State Persistence | Update STATE.md after tasks | -| 🧹 Context Hygiene | 3 failures → fresh session | -| ✅ Empirical Validation | Proof required for "done" | - -## Key Files - -| File | Purpose | Updated By | -|------|---------|------------| -| SPEC.md | Vision (finalize first!) | User | -| ROADMAP.md | Phase definitions | /plan | -| STATE.md | Session memory | All | -| ARCHITECTURE.md | System design | /map | -| TODO.md | Quick capture | /add-todo | - -## XML Task Structure - -```xml - - Clear name - exact/path.ts - Specific instructions - Executable command - Measurable criteria - -``` - -## Priority Indicators - -| Priority | Icon | -|----------|------| -| High | 🔴 | -| Medium | 🟡 | -| Low | 🟢 | - ---- - -*Print this for quick reference!* diff --git a/.gsd/examples/workflow-example.md b/.gsd/examples/workflow-example.md deleted file mode 100644 index bea7f395..00000000 --- a/.gsd/examples/workflow-example.md +++ /dev/null @@ -1,143 +0,0 @@ ---- -updated_at: 2026-03-02T17:05:45-06:00 ---- - -# GSD Workflow Example - -> A complete walkthrough of using GSD from start to finish. - -## Scenario: Building a Simple Todo API - -### Step 1: Define the Spec - -First, fill out `.gsd/SPEC.md`: - -```markdown -# SPEC.md - -> **Status**: `FINALIZED` - -## Vision -A simple RESTful API for managing todo items. - -## Goals -1. CRUD operations for todos -2. Persistence to SQLite -3. Input validation - -## Success Criteria -- [ ] POST /todos creates a todo -- [ ] GET /todos returns list -- [ ] DELETE /todos/:id removes item -``` - ---- - -### Step 2: Map the Codebase (if existing) - -``` -/map -``` - -This creates: -- `.gsd/ARCHITECTURE.md` — Current structure -- `.gsd/STACK.md` — Technologies in use - ---- - -### Step 3: Plan the Phases - -``` -/plan 1 -``` - -GSD analyzes the SPEC and creates `.gsd/phases/1/` with PLAN.md files: - -```markdown -# Plan 1.1: Database Setup - -## Objective -Create SQLite database with todos table. - -## Tasks - - - Initialize SQLite database - src/db.ts - - Create SQLite connection using better-sqlite3. - Create todos table with: id, title, completed, created_at. - - node -e "require('./src/db')" exits without error - Database file exists, table created - -``` - ---- - -### Step 4: Execute the Phase - -``` -/execute 1 -``` - -GSD: -1. Loads Plan 1.1 -2. Executes tasks in order -3. Runs verify commands -4. Creates atomic commits -5. Creates SUMMARY.md -6. Proceeds to Plan 1.2 -7. Verifies phase goal - ---- - -### Step 5: Verify the Work - -``` -/verify 1 -``` - -GSD: -1. Extracts must-haves from phase -2. Runs verification commands -3. Captures evidence -4. Creates VERIFICATION.md -5. Reports pass/fail - ---- - -### Step 6: Continue or Debug - -**If verified:** -``` -/plan 2 → Plan next phase -/execute 2 → Execute next phase -``` - -**If issues found:** -``` -/execute 1 --gaps-only → Run fix plans -/debug "API returns 500" → Debug the issue -``` - ---- - -## Quick Commands Reference - -| Command | When to Use | -|---------|-------------| -| `/map` | Analyze existing codebase | -| `/plan [N]` | Create plans for phase N | -| `/execute [N]` | Run all plans in phase N | -| `/verify [N]` | Confirm phase N works | -| `/debug [issue]` | Fix a problem | -| `/progress` | See current status | -| `/pause` | End session, save state | -| `/resume` | Start new session | -| `/add-todo` | Capture quick idea | -| `/check-todos` | See pending items | - ---- - -*This example demonstrates the GSD methodology flow.* diff --git a/.gsd/milestones/v1-alpha-AUDIT.md b/.gsd/milestones/v1-alpha-AUDIT.md deleted file mode 100644 index dd6e3236..00000000 --- a/.gsd/milestones/v1-alpha-AUDIT.md +++ /dev/null @@ -1,37 +0,0 @@ -# Milestone Audit: v1-alpha - -**Audited:** 2026-03-11 - -## Summary -| Metric | Value | -|--------|-------| -| Phases | 12 | -| Gap closures | 3 (AuthGuard implementation, Header username display, JGI Gene Atlas link correction) | -| Technical debt items | 4 | - -## Must-Haves Status -| Requirement | Verified | Evidence | -|-------------|----------|----------| -| UI Parity (Theme & Layout) | ✅ | Extensively verified across components matching legacy AngularJS via browser screenshots. | -| Biochemistry/Solr Integration (Tables, Searches, Filters) | ✅ | Active connection confirmed working locally; advanced DataGrid features implemented. | -| Authentication Framework | ✅ | Mock and bypass functionality successfully deployed with Route Guards verified. | -| Reference Data & User Data Routing | ✅ | Skeletons built for all pages reflecting 1:1 legacy functionality. | - -## Concerns -- **CORS Limitations on Authentication:** While the developer mock login securely circumvents CORS, direct browser calls to external servers (PATRIC/RAST) via the Next.js Client may fail due to Origin policies in production. -- **Disconnected Mutations:** Form UI elements for model building and media creation are visually intact but have not been wired to perform accurate Workspace API POST/PUT requests. -- **PlantSEED V3 Transition:** Legacy PlantSEED pipelines are currently deprecated. The UI relies on static warning banners. Structural changes from the backend team might require a substantial refactor of the `/plant` inputs later. - -## Recommendations -1. **Proxy Authentication:** Convert the `login` function inside `components/auth/AuthProvider.tsx` to utilize Next.js Server Actions (e.g., `app/api/auth/route.ts`). This guarantees CORS-free token fetching. -2. **Abstract Workspace Routing:** Rapidly implement the backend team's proxy configuration layer before wiring any DataGrid "Save" or FBA "Build" buttons. -3. **Dedicated Mock API:** If backend APIs remain unstable during Phase 13/14 development, invest in a local MSW (Mock Service Worker) to intercept Workspace save actions to unblock frontend UI state testing. - -## Technical Debt to Address -- [ ] Refactor external authentication fetches to Next.js Server Actions to safely bypass browser CORS restrictions. -- [ ] Wire up "Create New Media" endpoint connections inside `/myMedia`. -- [ ] Wire up "Build Model" POST payload assembly and submission inside `/plant`. -- [ ] Complete the dynamic route generation for viewing specific Workspace models (`/model/[id]`). - -## Timestamp Log -- Created: 2026-03-11 10:46:00 -05:00 diff --git a/.gsd/milestones/v1-alpha/1/1-PLAN.md b/.gsd/milestones/v1-alpha/1/1-PLAN.md deleted file mode 100644 index 79241105..00000000 --- a/.gsd/milestones/v1-alpha/1/1-PLAN.md +++ /dev/null @@ -1,46 +0,0 @@ ---- -phase: 1 -plan: 1 -wave: 1 -updated_at: 2026-03-03T09:00:34-06:00 ---- - -# Plan 1.1: Asset Migration - -## Objective -Transfer and organize static assets (images, fonts, icons) from the legacy ModelSEED-UI codebase to the modern Next.js `public` directory, ensuring no loss of visual fidelity. - -## Context -- .gsd/SPEC.md -- .gsd/ARCHITECTURE.md -- external/ModelSEED-UI/img/ -- external/ModelSEED-UI/icomoon/ - -## Tasks - - - Migrate Images - public/img/* - - Copy all static image assets from `external/ModelSEED-UI/img` to `public/img`. - - Retain original filenames and folder structures inside `img`. - - Avoid changing image formats at this stage. - - ls -1q public/img | wc -l - All image files successfully exist within the Next.js `public/img` structure. - - - - Migrate Fonts and Icons - public/icomoon/* - - Copy the `icomoon` font assets from `external/ModelSEED-UI/icomoon` to `public/icomoon`. - - Ensure font files (.woff, .ttf, .svg, .eot) and their styling are preserved. - - ls -1q public/icomoon | wc -l - All font and icomoon assets are available in the public directory. - - -## Success Criteria -- [ ] Next.js `public/img` contains all legacy images. -- [ ] Next.js `public/icomoon` contains all legacy icomoon assets. diff --git a/.gsd/milestones/v1-alpha/1/1-SUMMARY.md b/.gsd/milestones/v1-alpha/1/1-SUMMARY.md deleted file mode 100644 index 43e75650..00000000 --- a/.gsd/milestones/v1-alpha/1/1-SUMMARY.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -updated_at: 2026-03-03T09:03:46-06:00 ---- - -# Plan 1.1 Summary: Asset Migration - -## Work Completed -- Copied all image assets from `external/ModelSEED-UI/img` to `public/img`. -- Copied all font and icomoon assets from `external/ModelSEED-UI/icomoon` to `public/icomoon`. -- Retained exact legacy folder structures and formats within these directories. - -## Verifications Performed -- Verified image count aligns with legacy system. -- Verified icomoon files exist in the `public/` directory for use by global styles. - -## Status -✅ Complete diff --git a/.gsd/milestones/v1-alpha/1/2-PLAN.md b/.gsd/milestones/v1-alpha/1/2-PLAN.md deleted file mode 100644 index 274e8586..00000000 --- a/.gsd/milestones/v1-alpha/1/2-PLAN.md +++ /dev/null @@ -1,47 +0,0 @@ ---- -phase: 1 -plan: 2 -wave: 2 -updated_at: 2026-03-03T09:00:36-07:59 ---- - -# Plan 1.2: Core CSS & MUI Theme Setup - -## Objective -Analyze legacy CSS and bootstrap overrides, and implement them as a global MUI v7 `ThemeProvider` along with minimal global CSS to match the original style identically. - -## Context -- .gsd/SPEC.md -- .gsd/ARCHITECTURE.md -- external/ModelSEED-UI/css/core.css -- app/layout.tsx -- app/globals.css - -## Tasks - - - Extract Theme Variables - lib/theme.ts - - Analyze `external/ModelSEED-UI/css/core.css` components (colors, typography, spacing) and translate into an MUI theme object in `lib/theme.ts`. - - Identify primary, secondary colors, and background shades. - - Set up the MUI typography config using the legacy fonts (e.g., icomoon integration, standard web fonts used). - - cat lib/theme.ts - `lib/theme.ts` exists and exposes a valid MUI `createTheme` object containing the core app styling. - - - - Apply MUI Theme Provider - app/layout.tsx, app/globals.css - - Implement `` inside `app/layout.tsx` (using Next.js App Router compatible setups such as the AppRouterCacheProvider if necessary for MUI v7). - - Insert global overrides (baseline, resets) that couldn't fit cleanly into the MUI Theme into `app/globals.css`. - - grep "ThemeProvider" app/layout.tsx - The Next.js root layout successfully wraps the `children` with the constructed MUI ThemeProvider. - - -## Success Criteria -- [ ] `lib/theme.ts` exports a tailored MUI theme matching the legacy visual style. -- [ ] The Next.js layout implements this theme globally. diff --git a/.gsd/milestones/v1-alpha/1/2-SUMMARY.md b/.gsd/milestones/v1-alpha/1/2-SUMMARY.md deleted file mode 100644 index 5bcc1fe2..00000000 --- a/.gsd/milestones/v1-alpha/1/2-SUMMARY.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -updated_at: 2026-03-03T09:07:54-06:00 ---- - -# Plan 1.2 Summary: Core CSS & MUI Theme Setup - -## Work Completed -- Extracted key style variables (primary, secondary, success, text treatments, etc.) from `external/ModelSEED-UI/css/core.css`. -- Generated `lib/theme.ts` exporting a customized `createTheme` configuration for Material UI. -- Integrated `@mui/material-nextjs` and `@emotion/cache` dependencies for Next.js 15+ App Router. -- Wrapped the Next.js `RootLayout` (`app/layout.tsx`) with `` and ``. -- Added minimal overrides to `app/globals.css` (e.g., icomoon font imports, core HTML/body properties, and legacy animations) that didn't naturally map into MUI's global `theme`. - -## Verifications Performed -- Checked `lib/theme.ts` presence and structure. -- Checked `app/layout.tsx` effectively renders the `ThemeProvider`. - -## Status -✅ Complete diff --git a/.gsd/milestones/v1-alpha/1/VERIFICATION.md b/.gsd/milestones/v1-alpha/1/VERIFICATION.md deleted file mode 100644 index 8ec4031d..00000000 --- a/.gsd/milestones/v1-alpha/1/VERIFICATION.md +++ /dev/null @@ -1,35 +0,0 @@ ---- -phase: 1 -verified_at: 2026-03-03T09:17:21-06:00 -verdict: PASS ---- - -# Phase 1 Verification Report - -## Summary -3/3 must-haves verified. All gaps closed. - -## Must-Haves - -### ✅ Must-have 1: Asset Migration (Images) -**Status:** PASS -**Evidence:** -``` -Legacy Images: 14 -Migrated Images: 14 -``` - -### ✅ Must-have 2: Asset Migration (Icomoon) -**Status:** PASS -**Evidence:** -``` -Legacy Icomoon: 7 -Migrated Icomoon: 7 -``` - -### ✅ Must-have 3: ThemeProvider applied and project builds -**Status:** PASS -**Evidence:** Next.js build issues resolved via `fix-icomoon-import-PLAN.md`. `npm run build` now completes successfully and statically prerenders Phase 1. - -## Verdict -PASS diff --git a/.gsd/milestones/v1-alpha/1/fix-icomoon-import-PLAN.md b/.gsd/milestones/v1-alpha/1/fix-icomoon-import-PLAN.md deleted file mode 100644 index cceee9d6..00000000 --- a/.gsd/milestones/v1-alpha/1/fix-icomoon-import-PLAN.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -phase: 1 -plan: fix-icomoon-import -wave: 1 -gap_closure: true -updated_at: 2026-03-03T09:14:06-06:00 ---- - -# Fix Plan: Icomoon CSS Import Resolution - -## Problem -Next.js 16 failed to build because `app/globals.css` attempted to `@import url('/icomoon/style.css')`. Server relative imports are not implemented for standard CSS this way in the Turbopack Next.js App Router compiler. - -## Tasks - - - Fix Icomoon Import Strategy - app/globals.css, app/layout.tsx - - - Remove the `@import url('/icomoon/style.css');` line from `app/globals.css`. - - Modify `app/layout.tsx` to include a standard HTML `` tag holding `` before the ``. - - export NVM_DIR="$HOME/.nvm" && [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && nvm use 22.17.0 && npm run build - Next.js successfully builds without the module resolution error. - diff --git a/.gsd/milestones/v1-alpha/1/fix-icomoon-import-SUMMARY.md b/.gsd/milestones/v1-alpha/1/fix-icomoon-import-SUMMARY.md deleted file mode 100644 index ecee00d0..00000000 --- a/.gsd/milestones/v1-alpha/1/fix-icomoon-import-SUMMARY.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -updated_at: 2026-03-03T09:17:19-07:59 ---- - -# Fix Plan Summary: Icomoon CSS Import Resolution - -## Work Completed -- Removed the incompatible `@import url('/icomoon/style.css');` line from `app/globals.css`. -- Injected `` into the Next.js `RootLayout` document head inside `app/layout.tsx`. - -## Verifications Performed -- Re-ran the full Next.js App Router production build (`npm run build`). -- Build succeeded without the "Can't resolve '/icomoon/style.css'" module error. Server correctly pre-rendered static content. - -## Status -✅ Complete diff --git a/.gsd/milestones/v1-alpha/10/10.1-PLAN.md b/.gsd/milestones/v1-alpha/10/10.1-PLAN.md deleted file mode 100644 index 7cbdd3d9..00000000 --- a/.gsd/milestones/v1-alpha/10/10.1-PLAN.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -phase: 10 -plan: 1 -wave: 1 -dependencies: [] ---- - -# Phase 10 Plan 1: Solr Filter API Upgrade - -## Objective -Upgrade `lib/api/biochem.ts` to seamlessly parse MUI's rich `FilterModel` (including operators like `>`, `<`, `between`, `contains`) into exact Solr Query syntax (`q` / `fq`). - -## Scope -1. Define a `GridFilterModel` adapter inside `lib/api/biochem.ts` options. -2. Rewrite the query constructor in `buildSolrUrl` to parse `number` and `date` mathematical operators into Solr Range constraints (`field:[min TO max]`). -3. Maintain backward compatibility with the legacy `query` searching mechanism. - -## Tasks - - - Upgrade API Types and buildSolrUrl - lib/api/biochem.ts - - - Add `filterModel?: any` or a strict interface to `SolrQueryOpts`. - - Enhance `buildSolrUrl` to iterate over `filterModel.items` and append `AND field:[val TO *]` for `>` operators, `AND field:[* TO val]` for `<`, `AND field:[val1 TO val2]` for `isAnyOf` or custom `between` if applicable. - - Translate text constraints like `contains`, `equals` into native Solr `*val*` or `"val"` constraints. - - `buildSolrUrl` cleanly generates valid mathematical and logic strings without breaking standard text searching. - - -## Timestamp Log -- Created: 2026-03-06 13:08:00 -06:00 diff --git a/.gsd/milestones/v1-alpha/10/10.1-SUMMARY.md b/.gsd/milestones/v1-alpha/10/10.1-SUMMARY.md deleted file mode 100644 index 9717b00b..00000000 --- a/.gsd/milestones/v1-alpha/10/10.1-SUMMARY.md +++ /dev/null @@ -1,18 +0,0 @@ -# Phase 10 Plan 1 Summary - -## Objective -Upgrade the Solr API handler to translate native `MUI DataGrid` filter models seamlessly into accurate Solr syntax logic. - -## Actions Taken -1. Added `GridFilterModel` interfaces directly directly to `lib/api/biochem.ts`. -2. Appended the `filterModel: GridFilterModel` property onto the standardized `SolrQueryOpts`. -3. Extensively rewrote `buildSolrUrl`: - - Extracted all global `filterModel.quickFilterValues` parsing it alongside existing `query` text logic. - - Implemented a broad string replacement iterating over `filterModel.items` to transform standard UI string/number logic (such as `>`, `<=`, `=`, `isAnyOf`, `isEmpty`) directly into valid `[X TO Y]` boolean filters appended with `AND`. - - Refactored `mainQueryStr` builder string matching so exact nested bracket logic strings are formatted properly on outbound `fetch` URLs. - -## Status -✅ Complete. The `biochem.ts` module successfully parses full mathematical objects and merges them directly with partial-match query highlighting. - -## Timestamp Log -- Created: 2026-03-06 13:10:00 -06:00 diff --git a/.gsd/milestones/v1-alpha/10/10.2-PLAN.md b/.gsd/milestones/v1-alpha/10/10.2-PLAN.md deleted file mode 100644 index 9dd6cf2e..00000000 --- a/.gsd/milestones/v1-alpha/10/10.2-PLAN.md +++ /dev/null @@ -1,48 +0,0 @@ ---- -phase: 10 -plan: 2 -wave: 2 -dependencies: ["10.1-PLAN.md"] ---- - -# Phase 10 Plan 2: MUI DataGrid Advanced UI Integration - -## Objective -Build a reusable highly-customized `BiochemToolbar` wrapper component and a top-right `TablePagination` slot override, injecting them into all reference DataGrids. Add custom `renderCell` regex highlight functionality spanning all columns. - -## Scope -1. Create `components/BiochemToolbar.tsx` providing Global Search (`GridToolbarQuickFilter`), Filters (`GridToolbarFilterButton`), and duplicate Pagination controls docked Top-Right. -2. Inject the component into `/biochem/reactions`, `/biochem/compounds`, etc. via the `toolbar: BiochemToolbar` DataGrid slot. -3. Establish a Context/Regex Highlighter `renderCell` utility stringifying DataGrid cell values and highlighting substrings mirroring the Global Search input value. - -## Tasks - - - Create Toolbar & Pagination Components - - - components/BiochemToolbar.tsx - - components/TableTopPagination.tsx - - - - Instantiate `components/BiochemToolbar.tsx` using MUI `Box` flex layouts placing the standard `GridToolbarQuickFilter` & `GridToolbarFilterButton` to the left. - - Fetch the `gridPaginationModelSelector` / `useGridApiContext` to display page arrows natively synced at the Top-Right of the toolbar. - - Toolbar visually mirrors the user's specification with integrated filter/search on the left and pagination on the right. - - - - Integrate Highlight Utility & Slots across Tables - - - app/biochem/reactions/page.tsx - - app/biochem/compounds/page.tsx - - - - Supply `slots={{ toolbar: BiochemToolbar }}` to the standard Biochemistry tables. - - Implement a wrapping high-order component or hook extracting the active QuickFilter text to highlight strings inside existing custom `renderCell` configurations. - - Update data fetching to pass the MUI `filterModel` state strictly back to the updated `lib/api/biochem.ts` fetcher. - - Tables successfully render highlighting, advanced dropdown filters work, top-right pagination correctly advances DataGrid API state. - - -## Timestamp Log -- Created: 2026-03-06 13:08:00 -06:00 diff --git a/.gsd/milestones/v1-alpha/10/10.2-SUMMARY.md b/.gsd/milestones/v1-alpha/10/10.2-SUMMARY.md deleted file mode 100644 index e1a5af16..00000000 --- a/.gsd/milestones/v1-alpha/10/10.2-SUMMARY.md +++ /dev/null @@ -1,18 +0,0 @@ -# Phase 10 Plan 2 Summary - -## Objective -Implement UI components reflecting robust global search logic with query highlighting and integrate localized table pagination tools across the core reference tables. - -## Actions Taken -1. Created `components/BiochemToolbar.tsx`, importing custom DataGrid toolbars and overriding layout to match project styles. -2. Built `components/GridHighlightText.tsx` which dynamically accesses the `filterModel`/`quickFilterValues` state via context and performs localized regex match highlighting on generic cell text output. -3. Re-wired the root `Biochem/Reactions` and `Biochem/Compounds` page endpoints: - - Eliminated manual generic text search bars. - - Inserted `slots={{ toolbar: BiochemToolbar }}` and `slotProps={{ toolbar: { showQuickFilter: true } }}` mappings onto grid attributes. - - Registered `filterModel` state tracking logic to pipe dynamically evaluated searches back directly down to nested DataGrid logic and the outbound `useQuery(getReactions/getCompounds)` hooks. - -## Status -✅ Complete. The table natively displays highlighted sub-results during text filtering, properly exposes column-filtering sub-menus, and syncs pagination between the newly injected top-right array arrows alongside the existing table footers. - -## Timestamp Log -- Created: 2026-03-06 13:14:00 -06:00 diff --git a/.gsd/milestones/v1-alpha/10/VERIFICATION.md b/.gsd/milestones/v1-alpha/10/VERIFICATION.md deleted file mode 100644 index 49c6b642..00000000 --- a/.gsd/milestones/v1-alpha/10/VERIFICATION.md +++ /dev/null @@ -1,12 +0,0 @@ -## Phase 10 Verification - -### Must-Haves -- [x] Global search with highlighting mechanism across DataGrids — VERIFIED (evidence: `GridHighlightText` created and attached to cell rendering functions. Filters linked back through DataGrid `filterModel`.) -- [x] Advanced column/row multi-filters docked next to global search — VERIFIED (evidence: `BiochemToolbar.tsx` imports native MUI filter and logic components.) -- [x] Top-right pagination seamlessly synced with DataGrid — VERIFIED (evidence: custom `CustomPagination` rendered in toolbars linking to standard `apiRef.current` logic.) -- [x] Backend Solr API integration parsing complex text operators into query arrays — VERIFIED (evidence: `lib/api/biochem.ts` contains expansive switch statements converting `isAnyOf`, `=`, `>`, `<=`, `isEmpty`, etc. natively into arrays formatted as `[X TO Y]` arrays.) - -### Verdict: PASS - -## Timestamp Log -- Created: 2026-03-06 13:17:00 -06:00 diff --git a/.gsd/milestones/v1-alpha/11/11.1-PLAN.md b/.gsd/milestones/v1-alpha/11/11.1-PLAN.md deleted file mode 100644 index e5d58d45..00000000 --- a/.gsd/milestones/v1-alpha/11/11.1-PLAN.md +++ /dev/null @@ -1,52 +0,0 @@ ---- -phase: 11 -plan: 1 -wave: 1 ---- - -# Plan 11.1: PlantSEED Maintenance Warning - -## Objective -Implement a high-visibility warning banner across the PlantSEED toolset and temporarily disable the model building features for plant genomes, communicating the upcoming v3.0 release. - -## Context -- `.gsd/SPEC.md` -- `.gsd/ROADMAP.md` -- `app/(build-model)/plant/page.tsx` -- `app/(reference-data)/genomes/page.tsx` - -## Tasks - - - Add Maintenance Banner to PlantSEED Build Page - - - app/(build-model)/plant/page.tsx - - - - Add a prominent, non-dismissible MUI `Alert` component at the top of the interface. - - Message: "PlantSEED is being updated to version 3.0. Annotation and reconstruction services are temporarily offline for updates and will be restored shortly with our improved pipeline." - - Disable the form/submit buttons for building new models to prevent usage of the legacy k-mer pipeline. You may remove or hide the submit functionality entirely depending on what's easiest, but the banner is required. - - curl -s http://localhost:3000/plant | grep -i "temporarily offline" - The plant build page is visible but disabled, and the warning banner is displayed. - - - - Add Maintenance Banner to Genomes Reference Page - - - app/(reference-data)/genomes/page.tsx - - - - Add the same warning banner (MUI `Alert`) at the top of the Genomes reference data page, alerting users that PlantSEED resources are undergoing updates to version 3.0. - - Leave the table operational, just add the warning so users know things are transitioning. - - curl -s http://localhost:3000/genomes | grep -i "PlantSEED is being updated" - The genomes reference data page displays the warning banner prominently. - - -## Success Criteria -- [ ] Users visiting `/plant` see a clear maintenance warning and cannot invoke the legacy build pipeline. -- [ ] Users visiting `/genomes` see the maintenance warning but can still view public reference data. - -## Timestamp Log -- Created: 2026-03-11 09:48:00 -0500 diff --git a/.gsd/milestones/v1-alpha/11/11.1-SUMMARY.md b/.gsd/milestones/v1-alpha/11/11.1-SUMMARY.md deleted file mode 100644 index d96d0f32..00000000 --- a/.gsd/milestones/v1-alpha/11/11.1-SUMMARY.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -phase: 11 -plan: 1 -status: complete ---- - -# Summary 11.1: PlantSEED Maintenance Warning - -## What Was Done -- Added a filled warning `Alert` banner to the Build Model page (`/plant`) with the message: - "PlantSEED is being updated to version 3.0. Annotation and reconstruction services are temporarily offline..." -- Disabled the "UPLOAD Plants FASTA" tab via `disabled={PLANTSEED_MAINTENANCE}` flag. -- Added an outlined info `Alert` banner to the Genomes reference page (`/genomes`) informing users of the v3.0 update while keeping the table operational. -- Introduced a `PLANTSEED_MAINTENANCE` boolean constant — flip to `false` when PlantSEED v3 is ready. - -## Files Modified -- `app/(build-model)/plant/page.tsx` — Banner + disabled tab -- `app/(reference-data)/genomes/page.tsx` — Info banner - -## Verification -- `/genomes` renders banner and data table correctly (screenshot confirmed). -- `/biochem/reactions` still loads with no regressions. - -## Timestamp Log -- Created: 2026-03-11 09:55:00 -0500 diff --git a/.gsd/milestones/v1-alpha/11/11.2-PLAN.md b/.gsd/milestones/v1-alpha/11/11.2-PLAN.md deleted file mode 100644 index 9ce187bc..00000000 --- a/.gsd/milestones/v1-alpha/11/11.2-PLAN.md +++ /dev/null @@ -1,70 +0,0 @@ ---- -phase: 11 -plan: 2 -wave: 1 ---- - -# Plan 11.2: Service Layer Proxy Strategy - -## Objective -Implement abstraction layers for Workspace and Biochemistry queries, allowing the application to toggle between legacy endpoints and the new unified proxy endpoints being developed by the backend team, without breaking existing logic (especially RAST job listings). - -## Context -- `.gsd/SPEC.md` -- `.gsd/ROADMAP.md` -- `lib/api/workspace.ts` -- `lib/api/biochem.ts` - -## Tasks - - - Create API Configurations - - - lib/api/config.ts - - - - Create a centralized config file containing the API endpoints. - - Export boolean flags (or similar) to quickly toggle the routing logic (e.g. `USE_NEW_PROXY = false` initially, to avoid breaking current work while José is developing the new API). - - Expose URLs for the `Workspace`, `Biochemistry` (Solr vs New API), and `modelseed_support` endpoints. - - cat lib/api/config.ts | grep "USE_NEW_PROXY" - Configuration file correctly houses toggles and endpoint URL constants. - - - - Refactor Workspace API to Support Proxying - - - lib/api/workspace.ts - - lib/api/config.ts - - - - Import the endpoint URLs from `config.ts` rather than hardcoding. - - Depending on `USE_NEW_PROXY`, direct calls to either `p3.theseed.org/services/Workspace` (legacy raw workspace operations) OR to the new unified proxy endpoint. - - NOTE: Do NOT route RAST job/modelseed_support async operations through the new proxy, as the backend explicitly requested they stay running on `modelseed_support`. (Leave the URL alone if there are explicit `modelseed_support` endpoints, or add an explicit check to route to `modelseed_support` instead of the new proxy, if appropriate). - - At minimum, the proxy routing should be implemented cleanly. - - grep "{ USE_NEW_PROXY }" lib/api/workspace.ts - Workspace API respects a config-level proxy setting with fallback to legacy URLs. - - - - Refactor Biochemistry API to Support Proxying - - - lib/api/biochem.ts - - lib/api/config.ts - - - - Import endpoint configuration from `config.ts`. - - Provide an abstraction point where we can swap `modelseed.org/solr/` with the new endpoint once the new proxy supports the necessary get/search actions, based on the configurations. - - grep "config.ts" lib/api/biochem.ts - Biochem API endpoint URL is driven by config. - - -## Success Criteria -- [ ] A central configuration controls whether the UI fetches from legacy direct endpoints or the new unified proxy endpoint. -- [ ] Refactored code handles the workspace operations, biochemistry fetching securely via the toggle. -- [ ] Any unique backend calls (e.g., `modelseed_support`) are successfully separated from raw generic proxying. - -## Timestamp Log -- Created: 2026-03-11 09:49:00 -0500 diff --git a/.gsd/milestones/v1-alpha/11/11.2-SUMMARY.md b/.gsd/milestones/v1-alpha/11/11.2-SUMMARY.md deleted file mode 100644 index 54510c19..00000000 --- a/.gsd/milestones/v1-alpha/11/11.2-SUMMARY.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -phase: 11 -plan: 2 -status: complete ---- - -# Summary 11.2: Service Layer Proxy Strategy - -## What Was Done -- Created `lib/api/config.ts` — centralized API configuration with: - - `USE_NEW_PROXY` boolean toggle (default: `false`) - - Workspace endpoint: legacy (`p3.theseed.org`) vs proxy (`modelseed.org/api/workspace`) - - Solr endpoint: legacy (`modelseed.org/solr/`) vs proxy (`modelseed.org/api/solr/`) - - ProbModelSEED endpoint: legacy vs proxy - - `MODELSEED_SUPPORT_URL` — hardcoded to legacy, explicitly excluded from proxy toggle per Chris Henry's directive - - `CPD_IMG_BASE` — compound image URL -- Refactored `lib/api/workspace.ts` to import `WORKSPACE_URL` from config instead of hardcoding. -- Refactored `lib/api/biochem.ts` to import `SOLR_BASE` and `CPD_IMG_BASE` from config instead of hardcoding. - -## Files Created -- `lib/api/config.ts` - -## Files Modified -- `lib/api/workspace.ts` — endpoint now config-driven -- `lib/api/biochem.ts` — endpoint now config-driven - -## Verification -- `/biochem/reactions` loads data correctly through the refactored config pipeline (screenshot confirmed). -- All endpoints resolve identically to pre-refactor values when `USE_NEW_PROXY = false`. - -## Timestamp Log -- Created: 2026-03-11 09:55:00 -0500 diff --git a/.gsd/milestones/v1-alpha/12/12.1-PLAN.md b/.gsd/milestones/v1-alpha/12/12.1-PLAN.md deleted file mode 100644 index 139a2192..00000000 --- a/.gsd/milestones/v1-alpha/12/12.1-PLAN.md +++ /dev/null @@ -1,53 +0,0 @@ ---- -phase: 12 -plan: 1 -wave: 1 ---- - -# Plan 12.1: Authentication Utility & Global Context - -## Objective -Implement authentic external HTTP requests for PATRIC and RAST logins replicating the AngularJS service `auth.js`, while capturing the token globally using a React `AuthContext` to persist sessions seamlessly via `localStorage`. Include a developer override for local testing flexibility. - -## Context -- `.gsd/ROADMAP.md` -- `.gsd/DECISIONS.md` -- `external/ModelSEED-UI/app/services/auth.js` -- `lib/api/config.ts` - -## Tasks - - - Implement Core Authentication API Routes - lib/api/auth.ts - - - Create `lib/api/auth.ts`. - - Build `loginPatric(username, password)` which `fetch('POST', 'https://user.patricbrc.org/authenticate')` resolving a raw JWT. (Note: The PATRIC endpoint accepts `x-www-form-urlencoded` payloads {username, password}). - - Build `loginRast(username, password)` which `fetch('POST', 'https://p3.theseed.org/Sessions/Login')` resolving `{token, user_id}`. (Note: RAST accepts `x-www-form-urlencoded` payload with {user_id, password, status: 1, cookie: 1, fields: "name,user_id,token"}). - - Inside BOTH functions: Add an immediate developer intercept trap: `if (username === 'developer' && password === 'developer') { return Promise.resolve('mock-dev-token...'); }` to instantly bypass actual network calls. - - grep -n 'developer' lib/api/auth.ts && grep -n 'x-www-form-urlencoded' lib/api/auth.ts - Authentication endpoints properly hit PATRIC and RAST servers via standard fetch while containing a developer bypass for local offline testing. - - - - Build React Authentication Context - components/auth/AuthProvider.tsx - - - Create a standard React Context (`AuthContext`) and Provider (`AuthProvider`). - - Expose state: `isAuthenticated` (boolean), `user` (string | null), `token` (string | null). - - Expose actions: `login(method, username, password)` calling the api/auth.ts functions, and `logout()` to nullify state. - - Effect: Initialize by checking `localStorage.getItem('auth_token')` to persist sessions on mount dynamically (wrap `localStorage` calls with `typeof window !== "undefined"` safety). - - Provide a `useAuth()` custom hook to easily inject the context where consumed. - - grep -n 'AuthContext' components/auth/AuthProvider.tsx - AuthProvider properly establishes global context and initializes cleanly from client-side stored localStorage tokens. - - -## Success Criteria -- [ ] PATRIC and RAST network functions properly format incoming POST requests. -- [ ] `AuthContext` exposes simple interaction methods to downstream UI Components. -- [ ] Browser `localStorage` successfully saves and restores active sessions. - -## Timestamp Log -- Created: 2026-03-11 10:14:00 -05:00 diff --git a/.gsd/milestones/v1-alpha/12/12.1-SUMMARY.md b/.gsd/milestones/v1-alpha/12/12.1-SUMMARY.md deleted file mode 100644 index e52bc04b..00000000 --- a/.gsd/milestones/v1-alpha/12/12.1-SUMMARY.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -phase: 12 -plan: 1 ---- - -# Summary 12.1: Authentication Utility & Global Context - -## Completed Tasks - -### Task 1: Core Authentication API (`lib/api/auth.ts`) -- Created `loginPatric()` — POSTs to `https://user.patricbrc.org/authenticate` with `x-www-form-urlencoded` payload. -- Created `loginRast()` — POSTs to `https://p3.theseed.org/Sessions/Login` with legacy field format. -- Developer bypass: if credentials are `developer/developer`, immediately resolves with a mock token (no network call). -- Storage helpers: `persistAuth()`, `getStoredAuth()`, `clearAuth()` for localStorage management. - -### Task 2: React Authentication Context (`components/auth/AuthProvider.tsx`) -- `AuthContext` exposes: `isAuthenticated`, `user`, `token`, `method`, `loading`, `login()`, `logout()`. -- Hydrates from `localStorage` on mount (SSR-safe). -- Cross-tab logout sync via `storage` event listener (mirrors legacy behavior). -- Custom `useAuth()` hook for downstream consumption. - -## Verification -- `grep` confirms developer bypass and `x-www-form-urlencoded` headers present. -- TypeScript compiles with zero errors. - -## Timestamp Log -- Created: 2026-03-11 10:20:00 -05:00 diff --git a/.gsd/milestones/v1-alpha/12/12.2-PLAN.md b/.gsd/milestones/v1-alpha/12/12.2-PLAN.md deleted file mode 100644 index 25c3df2e..00000000 --- a/.gsd/milestones/v1-alpha/12/12.2-PLAN.md +++ /dev/null @@ -1,61 +0,0 @@ ---- -phase: 12 -plan: 2 -wave: 1 ---- - -# Plan 12.2: Context Injection & Token Headers - -## Objective -Finalize the true JSON Web Token integrations from PATRIC and RAST by injecting the `` context seamlessly into the application root layout and header, wiring the active modal to live functions vs mocked toggles, and ensuring global `fetch` requests for upstream API services implicitly route with bearer tokens. - -## Context -- `lib/api/workspace.ts` -- `components/layout/AppHeader.tsx` -- `components/layout/SignInModal.tsx` -- `app/layout.tsx` - -## Tasks - - - Wrap Layout with AuthProvider - app/layout.tsx - - - Open `app/layout.tsx`. - - Wrap the `` children securely inside the generic `` exported by `components/auth/AuthProvider.tsx`. (Depending on how material providers interlay, it should wrap immediately after your AppRouterCacheProvider/ThemeProvider boundary). - - grep -n 'AuthProvider' app/layout.tsx - AuthProvider renders explicitly throughout all internal layouts permitting subcomponents to intercept `useAuth()` state hook seamlessly. - - - - Refactor Modal & Header Using useAuth Context - components/layout/SignInModal.tsx -components/layout/AppHeader.tsx - - - Remove the hardcoded `useState` mocked auth inside `AppHeader.tsx` (`const [isAuthenticated, setIsAuthenticated] = useState(false)`). Instead, fetch the live auth context via `const { isAuthenticated, logout } = useAuth();`. Switch the `Sign Out` button bound function to dynamically execute `logout()`. - - Transition `SignInModal` to employ `useAuth()`. - - Adjust the `
` `onSubmit` bound to `handleLogin` to functionally capture `e.preventDefault()`, flip an internal `loading` boolean state, await the execution of the global `login(method, username, password)` promise hook, intercept and display `` error UI boxes if the server login fails (like 401s), then appropriately invoke `` closure methods upon `Promise.resolve`. - - grep -n 'useAuth' components/layout/SignInModal.tsx && grep -n 'logout' components/layout/AppHeader.tsx - Frontend correctly transmits network payloads responding with UX-friendly error states alongside updating authentic headers natively. - - - - Inject Bearer Headers to Workspace API - lib/api/workspace.ts - - - Inject secure token extraction via `let token = null; if(typeof window !== "undefined") { token = localStorage.getItem("auth_token"); }`. - - If a local `token` explicitly registers inside `callWorkspaceApi`, append the `Authorization: ` HTTP header onto the configured fetch parameters automatically for all queries. Note that ModelSEED uses PATRIC/RAST tokens without necessarily prepending 'Bearer '—just raw token. Add the raw token to the 'Authorization' header string directly. - - grep -n 'Authorization' lib/api/workspace.ts - The JSON-RPC Workspace queries correctly adopt JWT user validation signatures directly intercepting localstorage to authorize calls natively. - - -## Success Criteria -- [ ] Users dynamically observe true PATRIC authentication responses resolving via header. -- [ ] Submitting failed credentials presents standard UI errors properly. -- [ ] Network Workspace calls carry explicit user-bound JWT validation contexts. - -## Timestamp Log -- Created: 2026-03-11 10:14:00 -05:00 diff --git a/.gsd/milestones/v1-alpha/12/12.2-SUMMARY.md b/.gsd/milestones/v1-alpha/12/12.2-SUMMARY.md deleted file mode 100644 index 58d3b979..00000000 --- a/.gsd/milestones/v1-alpha/12/12.2-SUMMARY.md +++ /dev/null @@ -1,31 +0,0 @@ ---- -phase: 12 -plan: 2 ---- - -# Summary 12.2: Context Injection & Token Headers - -## Completed Tasks - -### Task 1: Wrap Layout with AuthProvider (`app/layout.tsx`) -- Imported `AuthProvider` from `components/auth/AuthProvider`. -- Wrapped all children inside `` within the existing `` boundary. -- All child components now have access to `useAuth()`. - -### Task 2: Refactor Modal & Headers Using useAuth -- **`SignInModal.tsx`**: Rewrote to use `useAuth().login()` for real network calls. Added loading spinner, error `` display on 401s, and developer credentials hint. -- **`AppHeader.tsx`**: Replaced `useState(false)` mock with `useAuth()`. Sign Out calls `logout()`. Removed `onSuccess` prop from `SignInModal`. -- **`Header.tsx`**: Same refactor — uses `useAuth()` for `isAuthenticated` and `logout()`. - -### Task 3: Inject Bearer Headers to Workspace API (`lib/api/workspace.ts`) -- Added `getAuthToken()` helper that reads from `localStorage` (SSR-safe). -- `callWorkspaceApi()` now attaches `Authorization: ` header when a session exists. -- Raw token format (no "Bearer " prefix) matches legacy AngularJS behavior. - -## Verification -- All `grep` checks pass for `useAuth`, `logout`, and `Authorization`. -- TypeScript compiles with zero errors (`npx tsc --noEmit`). -- Browser test: developer login → Sign Out toggle → Sign In toggle works end-to-end. - -## Timestamp Log -- Created: 2026-03-11 10:20:00 -05:00 diff --git a/.gsd/milestones/v1-alpha/12/12.3-PLAN.md b/.gsd/milestones/v1-alpha/12/12.3-PLAN.md deleted file mode 100644 index 681eb287..00000000 --- a/.gsd/milestones/v1-alpha/12/12.3-PLAN.md +++ /dev/null @@ -1,58 +0,0 @@ ---- -phase: 12 -plan: 3 -wave: 2 ---- - -# Plan 12.3: Route Protection & Authentication Guards - -## Objective -Ensure that pages containing private user data or restricted actions (e.g., Build Model, My Models, My Media) are protected by an authentication guard. Unauthenticated users should be prompted to sign in rather than viewing broken or empty interfaces. - -## Context -- .gsd/SPEC.md -- .gsd/ROADMAP.md -- components/auth/AuthProvider.tsx -- app/(user-data)/my-models/page.tsx -- app/(user-data)/myMedia/page.tsx -- app/(build-model)/plant/page.tsx -- app/genomes/page.tsx (if exists) - -## Tasks - - - Create AuthGuard Component - - - components/auth/AuthGuard.tsx - - - - Create a reusable `AuthGuard` component that consumes the `useAuth()` hook. - - If `loading` is true, render a centered `CircularProgress`. - - If `isAuthenticated` is true, render the `children` prop. - - If `isAuthenticated` is false, render an alert or full-screen message instructing the user to sign in to view the page. Include a "Sign In" button that triggers a sign-in mechanism (can import `SignInModal` or simply display text asking them to use the global header). - - grep "AuthGuard" components/auth/AuthGuard.tsx - Reusable AuthGuard component is implemented and TypeScript compiles. - - - - Apply AuthGuard to Protected Routes - - - app/(user-data)/my-models/page.tsx - - app/(user-data)/myMedia/page.tsx - - app/(build-model)/plant/page.tsx - - - - In each of these pages, wrap the core content (or the entire page layout) inside `...`. - - Avoid wrapping headers that should still be visible to guest users, but protect the primary content (datagrids, forms). - - grep "AuthGuard" app/(user-data)/my-models/page.tsx - Core user data and build model routes are wrapped in the AuthGuard. - - -## Success Criteria -- [ ] Users visiting protected pages when logged out see a "Sign In" prompt rather than page content. -- [ ] After login, the protected content renders normally without a full page refresh. - -## Timestamp Log -- Created: 2026-03-11 10:28:00 -05:00 diff --git a/.gsd/milestones/v1-alpha/12/12.3-SUMMARY.md b/.gsd/milestones/v1-alpha/12/12.3-SUMMARY.md deleted file mode 100644 index 67fe2220..00000000 --- a/.gsd/milestones/v1-alpha/12/12.3-SUMMARY.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -phase: 12 -plan: 3 -wave: 2 ---- - -# Summary 12.3: Route Protection & Authentication Guards - -## Accomplishments -- Implemented a reusable `AuthGuard` component (`components/auth/AuthGuard.tsx`) to manage route protection based on the `useAuth()` state. -- Protected the following pages using `AuthGuard`, ensuring that private user data and actions are restricted to authenticated accounts: - - `/my-models` (`app/(user-data)/my-models/page.tsx`) - - `/myMedia` (`app/(user-data)/myMedia/page.tsx`) - - `/plant` (Build Model) (`app/(build-model)/plant/page.tsx`) - -## Verification -- Navigated to protected routes while unauthenticated; the application correctly displayed a "Authentication Required" prompt. -- Logged in with `developer` / `developer` and confirmed that the pages render their respective DataGrids and building forms properly. -- Confirmed that the "Sign In" button in the `AuthGuard` works as intended. - -## Artifacts -- [AuthGuard.tsx](../../../components/auth/AuthGuard.tsx) -- [my-models/page.tsx](../../../app/(user-data)/my-models/page.tsx) -- [myMedia/page.tsx](../../../app/(user-data)/myMedia/page.tsx) -- [plant/page.tsx](../../../app/(build-model)/plant/page.tsx) - -## Timestamp Log -- Completed: 2026-03-11 10:45:00 -05:00 diff --git a/.gsd/milestones/v1-alpha/12/12.4-PLAN.md b/.gsd/milestones/v1-alpha/12/12.4-PLAN.md deleted file mode 100644 index f3c9111e..00000000 --- a/.gsd/milestones/v1-alpha/12/12.4-PLAN.md +++ /dev/null @@ -1,55 +0,0 @@ ---- -phase: 12 -plan: 4 -wave: 2 ---- - -# Plan 12.4: User Profile Display in Headers - -## Objective -Display the currently signed-in user's username (extracted from the JWT or auth context) in the global `Header` and the `AppHeader`. This provides visual confirmation that the user is logged in and identifies active accounts. - -## Context -- .gsd/SPEC.md -- .gsd/ROADMAP.md -- components/auth/AuthProvider.tsx -- components/layout/Header.tsx -- components/layout/AppHeader.tsx - -## Tasks - - - Update Global Header Profile Display - - - components/layout/Header.tsx - - - - Use the `user` object from `useAuth()` to get the current username (e.g., `user`). - - Where the "Sign Out" button currently renders on desktop, insert the user's name next to it (e.g., "Logged in as {user}"). Alternatively, wrap it in a visually pleasing `Chip` or simple typography to the left of the "Sign Out" button. - - Ensure it matches the theme and aligns gracefully. - - Update the mobile drawer view to also state "Signed in as {user}". - - grep "user" components/layout/Header.tsx - Username is displayed appropriately when authenticated in the global header. - - - - Update AppHeader Profile Display - - - components/layout/AppHeader.tsx - - - - Apply the same treatment to `AppHeader.tsx`, utilizing `user` from `useAuth()`. - - Render the username (e.g. `user` text) distinctly in the right side of the toolbar, adjacent to the Sign Out button. - - grep "user" components/layout/AppHeader.tsx - Username appears in the sub-header near the auth controls when authenticated. - - -## Success Criteria -- [ ] Upon successful login, the user's identifier (username) immediately appears in both headers. -- [ ] It disappears when logged out. -- [ ] Visual alignment remains clean and intact. - -## Timestamp Log -- Created: 2026-03-11 10:28:00 -05:00 diff --git a/.gsd/milestones/v1-alpha/12/12.4-SUMMARY.md b/.gsd/milestones/v1-alpha/12/12.4-SUMMARY.md deleted file mode 100644 index ad46501d..00000000 --- a/.gsd/milestones/v1-alpha/12/12.4-SUMMARY.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -phase: 12 -plan: 4 -wave: 2 ---- - -# Summary 12.4: User Profile Display in Headers - -## Accomplishments -- Integrated the `user` object from the `AuthContext` into both the primary `Header` and the secondary `AppHeader`. -- Configured headers to display the authenticated username alongside the "Sign Out" button, providing clear visual feedback of the active session. -- Verified that the username disappears correctly when the session is cleared (logout). - -## Verification -- Observed that upon signing in with `developer`, the string "developer" appears prominently in both the global purple header and the application sub-header. -- Confirmed visual alignment and responsiveness of the header elements across mobile and desktop breakpoints. - -## Artifacts -- [Header.tsx](../../../components/layout/Header.tsx) -- [AppHeader.tsx](../../../components/layout/AppHeader.tsx) - -## Timestamp Log -- Completed: 2026-03-11 10:45:00 -05:00 diff --git a/.gsd/milestones/v1-alpha/2/1-PLAN.md b/.gsd/milestones/v1-alpha/2/1-PLAN.md deleted file mode 100644 index 5ccc811b..00000000 --- a/.gsd/milestones/v1-alpha/2/1-PLAN.md +++ /dev/null @@ -1,105 +0,0 @@ ---- -phase: 2 -plan: 1 -wave: 1 -updated_at: 2026-03-03T12:50:39-06:00 ---- - -# Plan 2.1: Next.js App Folder Structure & Routing Scaffold - -## Objective -Establish the complete Next.js App Router directory structure that maps every legacy Angular route to a file-system route. Each directory gets a README.md explaining its domain, and a minimal placeholder `page.tsx` so routes resolve without 404s. This forms the backbone for all future page-by-page implementation. - -## Context -- `.gsd/SPEC.md` — Tech stack and constraints -- `.gsd/ARCHITECTURE.md` — Data flow and conventions -- `.gsd/DECISIONS.md` — Phase 2 scope decisions -- `external/ModelSEED-UI/app/app.js` — Legacy route definitions (source of truth for URL mapping) -- `app/layout.tsx` — Existing root layout with ThemeProvider - -## Route Mapping (Legacy → Next.js) - -| Legacy Angular State | URL | Next.js Path | -|---|---|---| -| `main.home` | `/` | `app/page.tsx` | -| `main.team` | `/team` | `app/team/page.tsx` | -| `main.teamMember` | `/team/:name` | `app/team/[name]/page.tsx` | -| `main.publications` | `/publications` | `app/publications/page.tsx` | -| `main.projects` | `/projects` | `app/projects/page.tsx` | -| `main.events` | `/events` | `app/events/page.tsx` | -| `main.about` | `/about` | `app/about/page.tsx` | -| `main.about.version` | `/about/version` | `app/about/version/page.tsx` | -| `main.about.faq` | `/about/faq` | `app/about/faq/page.tsx` | -| `main.about.data` | `/about/data-sources` | `app/about/data-sources/page.tsx` | -| `main.api` | `/about/api` | `app/about/api/page.tsx` | -| `app.biochem0` | `/biochem` | `app/biochem/page.tsx` | -| `app.biochem` | `/biochem/:chem` | `app/biochem/[chem]/page.tsx` | -| `app.cpd` | `/biochem/compounds/:id` | `app/biochem/compounds/[id]/page.tsx` | -| `app.rxn` | `/biochem/reactions/:id` | `app/biochem/reactions/[id]/page.tsx` | - -## Tasks - - - Create app/ route directories with placeholder pages - - app/team/page.tsx - app/team/[name]/page.tsx - app/publications/page.tsx - app/projects/page.tsx - app/events/page.tsx - app/about/page.tsx - app/about/version/page.tsx - app/about/faq/page.tsx - app/about/data-sources/page.tsx - app/about/api/page.tsx - app/biochem/page.tsx - app/biochem/[chem]/page.tsx - app/biochem/compounds/[id]/page.tsx - app/biochem/reactions/[id]/page.tsx - - - Create each directory and a `page.tsx` with a simple placeholder: - ```tsx - export default function PageName() { - return
Page Name — Coming Soon
; - } - ``` - Each placeholder must export a default component so the route resolves. -
- Run `find app -name "page.tsx" | sort` to list all route files. - All 15 route files exist (including root page.tsx), `npm run build` succeeds without route errors. -
- - - Create README.md for each app/ route directory - - app/README.md - app/team/README.md - app/publications/README.md - app/projects/README.md - app/events/README.md - app/about/README.md - app/biochem/README.md - components/README.md (update) - lib/README.md (update) - types/README.md (update) - - - Create a brief README.md in each route directory explaining: - - What the route represents - - What legacy Angular view it replaces - - Key sub-routes (if any) - - Also update the existing components/, lib/, and types/ READMEs to - reference MUI v7 (not v6) and clarify future organization with - the layout/ subfolder for Header/Footer. - - Run `find app -name "README.md" | sort` to list all READMEs. - Every route directory has a README.md. components/README.md references MUI v7. - - -## Success Criteria -- [ ] All 14 new route directories + placeholder pages exist -- [ ] Every directory has a README.md -- [ ] `npm run build` succeeds without errors -- [ ] Navigating to any route in dev server shows a placeholder page (no 404) diff --git a/.gsd/milestones/v1-alpha/2/1-SUMMARY.md b/.gsd/milestones/v1-alpha/2/1-SUMMARY.md deleted file mode 100644 index fc3e0638..00000000 --- a/.gsd/milestones/v1-alpha/2/1-SUMMARY.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -updated_at: 2026-03-03T12:56:26-06:00 ---- - -# Plan 2.1 Summary: Next.js Folder Structure & Routing Scaffold - -## Work Completed -- Created 14 new route directories mapping every legacy Angular route to a Next.js App Router path. -- Each directory has a placeholder `page.tsx` that exports a default component (dynamic routes use async `params`). -- Created 7 route READMEs in `app/` explaining domain, legacy mapping, and sub-routes. -- Updated 3 existing READMEs (`components/`, `lib/`, `types/`) to reference MUI v7 and clarify planned structure. - -## Route Map (15 total pages) - -| Route | Type | -|---|---| -| `/` | ○ Static | -| `/about` | ○ Static | -| `/about/api` | ○ Static | -| `/about/data-sources` | ○ Static | -| `/about/faq` | ○ Static | -| `/about/version` | ○ Static | -| `/biochem` | ○ Static | -| `/biochem/[chem]` | ƒ Dynamic | -| `/biochem/compounds/[id]` | ƒ Dynamic | -| `/biochem/reactions/[id]` | ƒ Dynamic | -| `/events` | ○ Static | -| `/projects` | ○ Static | -| `/publications` | ○ Static | -| `/team` | ○ Static | -| `/team/[name]` | ƒ Dynamic | - -## Verifications Performed -- `find app -name "page.tsx" | sort` — Confirmed 15 page files exist. -- `find app -name "README.md" | sort` — Confirmed 7 route READMEs exist. -- `npx next build` — Build succeeds, all 15 routes registered (11 static, 4 dynamic). - -## Status -✅ Complete diff --git a/.gsd/milestones/v1-alpha/2/2-PLAN.md b/.gsd/milestones/v1-alpha/2/2-PLAN.md deleted file mode 100644 index dcada774..00000000 --- a/.gsd/milestones/v1-alpha/2/2-PLAN.md +++ /dev/null @@ -1,106 +0,0 @@ ---- -phase: 2 -plan: 2 -wave: 2 -updated_at: 2026-03-03T12:51:25-06:00 ---- - -# Plan 2.2: Home Page Build (App Shell + Page Content) - -## Objective -Build the ModelSEED Home Page as a pixel-accurate replica of the legacy site. This includes: -1. Shared app shell components (Header/Navbar and Footer) in `components/layout/` -2. Home page content in `app/page.tsx` with its CSS Module -3. All sections: hero with login form, feature grid, mailing list CTA, more info, footer - -## Context -- `.gsd/SPEC.md` — Tech stack -- `.gsd/DECISIONS.md` — Scope and approach decisions -- `lib/theme.ts` — MUI theme with legacy color tokens -- `app/globals.css` — Base global styles -- `external/ModelSEED-UI/app/views/home.html` — Source layout -- `external/ModelSEED-UI/app/views/main-toolbar.html` — Navbar source -- `external/ModelSEED-UI/splash/css/splash.css` — Section-specific styles -- `public/img/` — All assets already in place - -## Tasks - - - Create Header (Navbar) component - - components/layout/Header.tsx - - - Build a responsive MUI AppBar that replicates `main-toolbar.html`: - - Dark teal background (#26c6da, matches theme primary) - - Left: ModelSEED logo image linked to "/" - - Center nav links: Biochemistry (MUI Button, raised/primary), Team, Publications, Projects, Events, Escher (external link) - - Right: About link, Sign In button (MUI Button, raised/primary) - - Use Next.js Link for all internal navigation - - Use 'use client' since AppBar menus require interactivity - - Include mobile responsive hamburger menu (MUI Drawer or Menu) - - All nav links point to their respective app/ routes - - Dev server shows header on all pages. Clicking links navigates without 404. - Header renders identically to legacy toolbar with all links functional. - - - - Create Footer component - - components/layout/Footer.tsx - - - Build the footer matching `home.html` lines 384-465: - - Two-part footer: dark purple upper (#201838), darker bottom (#130E21) - - 3-column grid: - 1. "Join the Mailing List!" with Mailchimp email form - 2. "On Github!" with circular GitHub icon link - 3. "About ModelSEED" with team link - - Bottom bar: "Copyright © 2015 ModelSEED" - - Use MUI Container, Grid, Typography, TextField, Button, IconButton - - Footer is a server component (no client state needed) - - Footer appears at bottom of every page with correct layout and colors. - Footer has 3-column layout, correct colors, and functional links. - - - - Build Home Page content and integrate shell - - app/page.tsx - app/home.module.css - app/layout.tsx (update — add Header + Footer to shell) - - - 1. Update `app/layout.tsx` to import and render Header above {children} and Footer below. - - 2. Create `app/home.module.css` with splash section styles from `splash.css`: - - header section (white bg #fdfdfd, padding) - - #about section (grey bg #F1F1F1, teal heading #04A0B5) - - #about-secondary (dark purple #201838) - - .about-item (200px inline-block cards) - - Plant/microbe image positioning - - section padding (100px 0) - - .light section (white bg, bottom border) - - 3. Build `app/page.tsx` with these sections: - a. Hero Header — Logo image, "Metabolic Modeling Made Simple.", large Biochemistry button, login form (UI stub), PATRIC/RAST toggle - b. "What is ModelSEED?" — 6 feature cards (fast, easy, microbes+plants, enabling science, open source, programmatic access) using images from public/img/home/ - c. Mailing list CTA — Dark purple background, Mailchimp form - d. More Info — Data sources, funding text, citing, Q&A contact links - - All content text is taken directly from `home.html`. - Use MUI components: Container, Grid, Box, Typography, Button, TextField. - Mark as 'use client' only if needed (login form state). - - Run `npm run dev` and open localhost:3000. Compare visually with the 4 provided screenshots. - Home page renders with all 4 sections visually matching the legacy site. Dev server runs without errors. - - -## Success Criteria -- [ ] Header (navbar) renders on every page with correct links and colors -- [ ] Footer renders on every page with 3-column layout -- [ ] Home page has all 4 sections: hero, features, mailing list CTA, more info -- [ ] `npm run dev` starts without errors and localhost:3000 shows the full home page -- [ ] Visual comparison with legacy screenshots confirms fidelity diff --git a/.gsd/milestones/v1-alpha/2/2-SUMMARY.md b/.gsd/milestones/v1-alpha/2/2-SUMMARY.md deleted file mode 100644 index 75c2f27e..00000000 --- a/.gsd/milestones/v1-alpha/2/2-SUMMARY.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -updated_at: 2026-03-03T13:08:04-07:59 ---- - -# Plan 2.2 Summary: Home Page Build (App Shell + Page Content) - -## Work Completed -- Created `components/layout/Header.tsx` — responsive MUI AppBar with desktop nav and mobile Drawer, replicating the legacy main toolbar. -- Created `components/layout/Footer.tsx` — 3-column footer (mailing list, GitHub, about) + copyright bar matching legacy home footer. -- Created `app/home.module.css` — CSS Module porting splash.css section styles (hero, features grid, CTA, more info). -- Rewrote `app/page.tsx` — full home page with all 4 sections: hero/login, "What is ModelSEED?" features, mailing list CTA, More Info. -- Updated `app/layout.tsx` — integrated Header and Footer as shared app shell, updated metadata and favicon. -- Installed `@mui/icons-material` as a dependency (for MenuIcon, GitHubIcon). - -## Sections Implemented -1. **Hero Header** — Logo, tagline, Biochemistry button, RAST/PATRIC login form toggle -2. **Features Grid** — 6 feature cards (Fast, Easy, Microbes and Plants, Enabling Science, Open Source, Programatic Access) -3. **Mailing List CTA** — Dark purple section with Mailchimp subscribe form -4. **More Info** — Data sources, funding, citing ModelSEED, Q&A links - -## Verifications Performed -- `npx next build` — Compiled successfully, all 15 routes registered. -- `npm run dev` — Dev server launched, home page rendered at localhost:3000. -- Visual comparison against legacy screenshots — all sections match in layout, colors, and content. - -## Status -✅ Complete diff --git a/.gsd/milestones/v1-alpha/2/VERIFICATION.md b/.gsd/milestones/v1-alpha/2/VERIFICATION.md deleted file mode 100644 index 87cb6a1b..00000000 --- a/.gsd/milestones/v1-alpha/2/VERIFICATION.md +++ /dev/null @@ -1,52 +0,0 @@ ---- -phase: 2 -verified_at: 2026-03-03T13:14:49-06:00 -verdict: PASS ---- - -# Phase 2 Verification Report - -## Summary -2/2 must-haves verified - -## Must-Haves - -### ✅ Implement the main application shell (Header, Footer, Navigation) -**Status:** PASS -**Evidence:** -The app shell components were built via `components/layout/Header.tsx` and `components/layout/Footer.tsx`. The home page UI was verified via visual inspection of the development server, generating three comprehensive screenshots: - -1. `home_page_top_1772564791345.png` / `home_page_hero_top_1772564839444.png`: Verified the Header navbar (ModelSEED logo, proper Navigation menus) and the Hero section with RAST login form. -2. `home_page_middle_1772564789502.png`: Verified the main Body content (Feature grid and CTA section). -3. `home_page_bottom_1772564784446.png`: Verified the three-column Footer. - -### ✅ Set up Next.js routing structure based on the legacy site architecture -**Status:** PASS -**Evidence:** -The Next.js build output proves that all 15 routes have been scaffolded correctly within the new App Router architecture: - -``` -Route (app) -┌ ○ / -├ ○ /_not-found -├ ○ /about -├ ○ /about/api -├ ○ /about/data-sources -├ ○ /about/faq -├ ○ /about/version -├ ○ /biochem -├ ƒ /biochem/[chem] -├ ƒ /biochem/compounds/[id] -├ ƒ /biochem/reactions/[id] -├ ○ /events -├ ○ /projects -├ ○ /publications -├ ○ /team -└ ƒ /team/[name] -``` - -## Verdict -PASS - -## Gap Closure Required -None diff --git a/.gsd/milestones/v1-alpha/3/1-PLAN.md b/.gsd/milestones/v1-alpha/3/1-PLAN.md deleted file mode 100644 index 23fbc313..00000000 --- a/.gsd/milestones/v1-alpha/3/1-PLAN.md +++ /dev/null @@ -1,58 +0,0 @@ ---- -phase: 3 -plan: 1 -wave: 1 ---- - -# Plan 3.1: Active Tab Navigation in App Shell - -## Objective -Convert the current static Next.js `
` component into a client component to support active path highlighting for the primary navigation tabs. Replicate the legacy `active` CSS logic used for tabs in ModelSEED-UI. - -## Context -- `.gsd/SPEC.md` -- `.gsd/DECISIONS.md` -- `components/layout/Header.tsx` -- Legacy reference: `external/ModelSEED-UI/app/views/main-toolbar.html` (Lines 16-36 showing `ng-class="{ active: ... }"`) -- Legacy reference CSS: Focus on `.about-toolbar li.active a` or similar rules. - -## Tasks - - - Convert Header to Client Component - - - `components/layout/Header.tsx` - - - - Add `"use client";` to the top of `Header.tsx`. - - Import `usePathname` from `next/navigation`. - - Compute if a given tab is active by checking if `pathname.startsWith('/team')`, etc. - - Specifically checking: `/team`, `/publications`, `/projects`, `/events`, and `/about`. - - Do NOT change the background color of the Header (`#2D224E`). - - npm run build - Header compiles without errors and successfully applies active styling using `usePathname`. - - - - Implement Legacy Active Class Styling - - - `components/layout/Header.tsx` - - - - Implement or map the legacy CSS logic for `.active` tabs. - - In the old app, the `
  • ` gets the `.active` class. - - In MUI, adjust the `Link` or wrapper `Box` style when `isActive` is true to mimic the legacy highlighted state. Use MUI `sx` or inline styled-components as appropriate. (For example, legacy active tabs often had a semi-transparent white background or a specific border). - - Maintain 1:1 visual styling. - - npm run build - Active tabs highlight identically to the legacy ModelSEED site. - - -## Success Criteria -- [ ] Header handles navigation state dynamically. -- [ ] Currently selected route is visually distinct and matches legacy design. - - -## Timestamp Log -- Created: 2026-03-03T16:21:00-06:00 diff --git a/.gsd/milestones/v1-alpha/3/1-SUMMARY.md b/.gsd/milestones/v1-alpha/3/1-SUMMARY.md deleted file mode 100644 index f5a1bdd4..00000000 --- a/.gsd/milestones/v1-alpha/3/1-SUMMARY.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -phase: 3 -plan: 1 -status: complete ---- - -# Summary 3.1: Active Tab Navigation in App Shell - -## What Was Done - -### Task 1: Convert Header to Client Component -- Header was already `'use client'` from Phase 2. -- Added `usePathname` import from `next/navigation`. -- Created `isActive(href)` helper that checks `pathname.startsWith(href)`. -- Applied to all nav items: `/team`, `/publications`, `/projects`, `/events`, `/about`. - -### Task 2: Implement Legacy Active Class Styling -- Extracted exact legacy CSS from `external/ModelSEED-UI/css/core.css` (lines 460-463): - ```css - ul.about-toolbar > li:hover, - ul.about-toolbar > li.active { - border-bottom: 3px solid #EBEBEB; - } - ``` -- Mapped this to MUI `sx` props: active tabs get `borderBottom: '3px solid #EBEBEB'`, inactive get `'3px solid transparent'` (prevents layout shift). -- Hover state also applies the same bottom border. -- Text color matched to legacy `#EBEBEB`. -- `borderRadius: 0` ensures the bottom border renders as a clean line. - -## Files Modified -- `components/layout/Header.tsx` - -## Timestamp Log -- Created: 2026-03-03T16:36:14-06:00 diff --git a/.gsd/milestones/v1-alpha/3/2-PLAN.md b/.gsd/milestones/v1-alpha/3/2-PLAN.md deleted file mode 100644 index dbd06abf..00000000 --- a/.gsd/milestones/v1-alpha/3/2-PLAN.md +++ /dev/null @@ -1,58 +0,0 @@ ---- -phase: 3 -plan: 2 -wave: 1 ---- - -# Plan 3.2: Team Page Implementation - -## Objective -Recreate the Team page (`/team`) using Next.js, MUI v7, and a structured static data JSON extractor for maintainability while maintaining 1:1 legacy visual fidelity. - -## Context -- `.gsd/SPEC.md` -- `.gsd/DECISIONS.md` -- Original template: `external/ModelSEED-UI/app/views/docs/team.html` -- Asset path: `public/img/team` - -## Tasks - - - Extract Team Data Structure - - - `lib/data/team.ts` (new) - - - - Create a TypeScript file exporting an array of team member objects or categories. - - Category (e.g., 'Principal Investigators', 'Partner Principal Investigators', 'Scientists', 'Post-Doctoral Researchers', 'Developers', 'Graduate Students'). - - Member attributes: `name`, `url` (optional), `role`, `affiliation`, `imageSrc`, `imageHeight`, `imageWidth`. - - Manually scrape and structure the 20+ members listed in `team.html` into this array. - - npx tsc --noEmit - Structured data is type-checked and ready for `.map()` iteration. - - - - Implement Team Page UI - - - `app/team/page.tsx` - - `app/team/team.module.css` (new) - - - - Construct the page using Next.js `metadata` for titles/SEO. - - Iterate over `team.ts` categories. - - Setup the `layout="row" layout-align="start center"` using MUI's Grid or Flex Box (`display: 'flex', alignItems: 'center'`). - - Use Next.js `` or standard `` depending on responsiveness needs (legacy used hardcoded widths/heights like `160`). - - Integrate `team.module.css` to cover standard element styles (like `.team-member`, `.no-margin`, etc) maintaining exact typography spacing, margin, links (``), and layout as the legacy grid. - - Check page renders error-free by running build or standard browser checking in dev. - Visual parity 1:1 with ModelSEED Team Page. - - -## Success Criteria -- [ ] Team members rendered via mapped static array dynamically. -- [ ] Profile images, external links, and titles are identically styled. - - -## Timestamp Log -- Created: 2026-03-03T16:21:00-06:00 diff --git a/.gsd/milestones/v1-alpha/3/2-SUMMARY.md b/.gsd/milestones/v1-alpha/3/2-SUMMARY.md deleted file mode 100644 index 5a0abecd..00000000 --- a/.gsd/milestones/v1-alpha/3/2-SUMMARY.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -phase: 3 -plan: 2 -status: complete ---- - -# Summary 3.2: Team Page Implementation - -## What Was Done - -### Task 1: Extract Team Data Structure -- Created `lib/data/team.ts` with typed interfaces (`TeamMember`, `TeamCategory`). -- Extracted all 17 team members across 7 categories from legacy `team.html`. -- Categories: Principal Investigators, Partner PIs (PlantSEED), Scientists, PlantSEED Annotation, Post-Doctoral Researchers, Developers, Graduate Students. -- Each member has: `name`, `url?`, `role?`, `affiliation`, `affiliationUrl?`, `imageSrc`, `imageWidth?`, `imageHeight?`. - -### Task 2: Implement Team Page UI -- Created `app/team/page.tsx` as a Server Component with SEO metadata. -- Created `app/team/team.module.css` with `.teamMember` flex-row layout replicating legacy `.team-member` class. -- Iterates over `TEAM_DATA` categories, rendering `h3`/`h4` headings per category. -- External links open in new tabs. Affiliation links rendered when present. -- Uses native `` with legacy width/height dimensions for pixel-accurate reproduction. - -## Verification -- Visual screenshot confirms 1:1 match with legacy layout. -- Active tab "Team" highlights in header with `border-bottom: 3px solid #EBEBEB`. - -## Files Created -- `lib/data/team.ts` -- `app/team/team.module.css` - -## Files Modified -- `app/team/page.tsx` (overwritten from placeholder) - -## Timestamp Log -- Created: 2026-03-03T16:37:15-06:00 diff --git a/.gsd/milestones/v1-alpha/3/3-PLAN.md b/.gsd/milestones/v1-alpha/3/3-PLAN.md deleted file mode 100644 index 9b91ac60..00000000 --- a/.gsd/milestones/v1-alpha/3/3-PLAN.md +++ /dev/null @@ -1,58 +0,0 @@ ---- -phase: 3 -plan: 3 -wave: 1 ---- - -# Plan 3.3: Publications Page Implementation - -## Objective -Recreate the Publications page (`/publications`) with its live filtering, and table view using MUI. Ensure data is structured statically to replicate the live endpoint since the backend may be missing. - -## Context -- `.gsd/SPEC.md` -- `.gsd/DECISIONS.md` -- Original template: `external/ModelSEED-UI/app/views/docs/publications.html` -- Original controller: `external/ModelSEED-UI/app/ctrls/ctrls.js` (Lines 392-425) - -## Tasks - - - Extract Publications Data - - - `lib/data/publications.ts` (new) - - - - Create a static exported JSON array structure that would match the `/publications` REST API output. - - Since we have no direct access to the live MS REST API from the codebase right now without firing a manual fetch, pull the data by curling `https://modelseed.org/api/v0/publications` (or provide instructions to extract what's possible, or if unavailable, stub a minimum of 5 modelseed publications for visual fidelity). - - Data interface: `title`, `authors` (array string or joined), `publication` `volumn` (sic from legacy), `number`, `pages`, `year`. - - npx tsc --noEmit - Publications structured accurately. - - - - Implement Publications UI and Filtering - - - `app/publications/page.tsx` - - `app/publications/publications.module.css` (new) - - - - Make this page a `"use client"` so we can manage `query` state for searching, and `reversed` state for sorting by year. - - Match layout `` search and `Year` toggle logic. - - Use standard HTML `` or MUI `
    ` customized to mimic legacy CSS styling. - - Apply highlight filtering (like `ng-bind-html="pub.title | highlight: query"`) in React using a text-split highlight method or regex. - - Include empty state texts: "No publications found" or loading indicators appropriately. - - npm run check or standard verify - Publication search logic matching legacy AngularJS filters behavior, styling exact 1:1. - - -## Success Criteria -- [ ] Users can browse publications that initially load. -- [ ] Users can search via string, highlighting matched strings. -- [ ] Users can toggle sort order by year. - - -## Timestamp Log -- Created: 2026-03-03T16:21:00-06:00 diff --git a/.gsd/milestones/v1-alpha/3/3-SUMMARY.md b/.gsd/milestones/v1-alpha/3/3-SUMMARY.md deleted file mode 100644 index e74be203..00000000 --- a/.gsd/milestones/v1-alpha/3/3-SUMMARY.md +++ /dev/null @@ -1,41 +0,0 @@ ---- -phase: 3 -plan: 3 -status: complete ---- - -# Summary 3.3: Publications Page Implementation - -## What Was Done - -### Task 1: Extract Publications Data -- Fetched 109 publications from the live API (`https://modelseed.org/api/v0/publications`). -- Generated `lib/data/publications.ts` with typed `Publication` interface and static array. -- Fields: `title`, `authors[]`, `publication`, `volumn?`, `number?`, `pages?`, `year?`. -- Data spans years ~2004-2022. - -### Task 2: Implement Publications Page UI -- Created `app/publications/page.tsx` as a client component (`'use client'`). -- Implemented search filtering using `useMemo` across title, authors, publication, and pages. -- Implemented year sort toggle (descending default, click to reverse). -- Added text highlighting for search matches using a regex-based `highlightText()` function. -- Used Unicode `▼`/`▲` for sort direction indicators (no external icon dependencies). - -### Bug Fix -- Discovered some API entries have `null` for `publication` field. -- Added null-coalescing (`??`) guards in both the filter logic and JSX rendering to prevent runtime crashes. - -## Verification -- Screenshot 1: Publications page loads with 109 entries sorted by year desc ✅ -- Screenshot 2: Search "henry" filters and highlights matching text in teal ✅ -- No runtime errors with null fields ✅ - -## Files Created -- `lib/data/publications.ts` -- `app/publications/publications.module.css` - -## Files Modified -- `app/publications/page.tsx` (overwritten from placeholder) - -## Timestamp Log -- Created: 2026-03-03T16:40:20-06:00 diff --git a/.gsd/milestones/v1-alpha/3/4-PLAN.md b/.gsd/milestones/v1-alpha/3/4-PLAN.md deleted file mode 100644 index 7ac42fc6..00000000 --- a/.gsd/milestones/v1-alpha/3/4-PLAN.md +++ /dev/null @@ -1,64 +0,0 @@ ---- -phase: 3 -plan: 4 -wave: 2 ---- - -# Plan 3.4: Projects & Events Pages Implementation - -## Objective -Rebuild the `/projects` and `/events` hubs, replicating the simple layout structures of `ms-projects/home.html` and `ms-projects/events/events.html`. - -## Context -- `.gsd/SPEC.md` -- `.gsd/DECISIONS.md` -- Reference template 1: `external/ModelSEED-UI/ms-projects/home.html` -- Reference template 2: `external/ModelSEED-UI/ms-projects/events/events.html` -- Old images mapping: `ms-projects/img/*` -> Must map correctly from `public/ms-projects/img/*` if present (or download/copy). - -## Tasks - - - Implement Projects Hub - - - `app/projects/page.tsx` - - `app/projects/projects.module.css` (new) - - - - Map `ms-projects/home.html`. - - Create a page with "ModelSEED Projects" heading and standard paragraph text. - - Set up the grid blocks (`...`) into MUI Grid/Flex components (using `Box` or `Stack` or equivalent inline CSS `display: flex`). - - Build links (using `` vs `` where appropriate): - - Internal: `href="/projects/fusions"`, `href="/projects/regulons"` - - External: `http://komodo.modelseed.org`, `https://minedatabase.mcs.anl.gov`, `http://coremodels.mcs.anl.gov`. - - Fix missing image references `ms-projects/img/atomic-regulons.png` (can use placeholders if image doesn't exist locally, or verify we copied those in Phase 1). - - npm run check - Projects page renders pixel-perfect to old angular `/projects`. - - - - Implement Events Hub - - - `app/events/page.tsx` - - `app/events/events.module.css` (new) - - - - Since Events page has a dynamic hide/view past events toggle (`ng-init="expand = false"`), make `page.tsx` `"use client"`. - - Create React state Hook: `[expand, setExpand]`. - - Render "ModelSEED Related Events" heading. - - Render Latest events statically (PlantSEED 2018, 2017, 2016). - - Render "View past events" toggle logic replicating `` and ternary. - - If `expand` is true, display the hidden past events block (PlantSEED 2015). - - npm run build - Events page dynamic toggling behaves correctly and layout perfectly mimics old site. - - -## Success Criteria -- [ ] Users can navigate to `/projects` and see grid content. -- [ ] Users can navigate to `/events` and toggle past event visibility. - - -## Timestamp Log -- Created: 2026-03-03T16:21:00-06:00 diff --git a/.gsd/milestones/v1-alpha/3/4-SUMMARY.md b/.gsd/milestones/v1-alpha/3/4-SUMMARY.md deleted file mode 100644 index 364b8c75..00000000 --- a/.gsd/milestones/v1-alpha/3/4-SUMMARY.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -phase: 3 -plan: 4 -status: complete ---- - -# Summary 3.4: Projects & Events Pages Implementation - -## What Was Done - -### Task 1: Implement Projects Hub -- Created `app/projects/page.tsx` as a Server Component with SEO metadata. -- Created `app/projects/projects.module.css` with two-column flex row layout matching legacy `md-content layout="row"`. -- Replicated all content from `ms-projects/home.html`: - - **Row 1**: Fusions (internal `/projects/fusions`) + KOMODO (external `http://komodo.modelseed.org`) - - **Row 2**: Bacillus subtilis Regulatory Network (internal `/projects/regulons`) with atomic-regulons.png + MINE Database (external) - - **Row 3**: Core Metabolic Models (external `http://coremodels.mcs.anl.gov`) with empty flex spacer -- Copied `atomic-regulons.png` from `external/ModelSEED-UI/ms-projects/img/` to `public/img/projects/`. -- Used Next.js `Link` for internal routes, `` for external URLs. - -### Task 2: Implement Events Hub -- Created `app/events/page.tsx` as a client component (`'use client'`). -- Created `app/events/events.module.css` with event block layout and muted date styling. -- Replicated all content from `ms-projects/events/events.html`: - - **Latest**: PlantSEED 2018, 2017, 2016 with dates. - - **Past events toggle**: `useState` hook replaces `ng-init="expand = false"` / `ng-click="expand = !expand"`. - - **Hidden section**: PlantSEED 2015 conditionally rendered when `expand` is true. -- Used Unicode `▼`/`▲` for toggle indicators. - -## Files Created -- `app/projects/projects.module.css` -- `app/events/events.module.css` -- `public/img/projects/atomic-regulons.png` (copied from legacy) - -## Files Modified -- `app/projects/page.tsx` (overwritten from placeholder) -- `app/events/page.tsx` (overwritten from placeholder) - -## Timestamp Log -- Created: 2026-03-03T16:49:44-06:00 diff --git a/.gsd/milestones/v1-alpha/3/VERIFICATION.md b/.gsd/milestones/v1-alpha/3/VERIFICATION.md deleted file mode 100644 index 9677b2af..00000000 --- a/.gsd/milestones/v1-alpha/3/VERIFICATION.md +++ /dev/null @@ -1,105 +0,0 @@ ---- -phase: 3 -verified_at: 2026-03-03T16:54:45-06:00 -verdict: PASS ---- - -# Phase 3 Verification Report - -## Summary -6/6 must-haves verified - -## Must-Haves - -### ✅ 1. Header Active Tab Highlighting via usePathname -**Status:** PASS -**Evidence:** -``` -=== usePathname in Header === -4:import { usePathname } from 'next/navigation'; -38: const pathname = usePathname(); -43: const isActive = (href: string) => pathname.startsWith(href); -171: const active = !item.external && isActive(item.href); - -=== border-bottom active style === -185: ? '3px solid #EBEBEB' -211: ? '3px solid #EBEBEB' -``` -**Visual proof:** All 4 page screenshots show the correct tab highlighted with bottom border (Team, Publications, Projects, Events tabs respectively). - -### ✅ 2. /team Page Renders with All Team Members -**Status:** PASS -**Evidence:** -``` -Team data: 18 name entries across 8 category titles -File: lib/data/team.ts (6738 bytes) -``` -**Screenshot:** `phase3_team_1772578624732.png` — Shows "ModelSEED Team" heading, Principal Investigators (Chris Henry, Nicholas Chia) with photos, roles, affiliations, and clickable links. "Team" tab active in header. - -### ✅ 3. /publications Page Renders with Search + Year Sort -**Status:** PASS -**Evidence:** -``` -Publications data: 109 entries -Search filtering: 4 field filter (title, authors, publication, pages) with null-safety -Year sort: useState reversed toggle with useMemo sorting -File: lib/data/publications.ts (48317 bytes) -``` -**Screenshot:** `phase3_publications_1772578632402.png` — Shows "Publications" heading, search input, "Year ▼" toggle, and publications table with title/authors/source/year columns sorted by year descending. Publications tab active. -**Additional proof:** `publications_search_henry_1772577984728.png` — Shows search "henry" with bold highlighted matches in author fields. - -### ✅ 4. /projects Page Renders with Project Grid -**Status:** PASS -**Evidence:** -``` -=== Projects page links === -29: Link href="/projects/fusions" (internal) -42: href="http://komodo.modelseed.org" (external, target="_blank") -66: Link href="/projects/regulons" (internal) -87: href="https://minedatabase.mcs.anl.gov" (external, target="_blank") -103: href="http://coremodels.mcs.anl.gov" (external, target="_blank") -``` -**Screenshot:** `phase3_projects_1772578681570.png` — Shows "ModelSEED Projects" heading, two-column grid with: -- Row 1: Fusions + KOMODO -- Row 2: B. subtilis Regulons (with atomic-regulons.png image) + MINE Database (with external Gold-Miner icon) -- Row 3: Core Metabolic Models -Projects tab active in header. - -### ✅ 5. /events Page Renders with Expand/Collapse Toggle -**Status:** PASS -**Evidence:** -``` -=== Events toggle logic === -8: const [expand, setExpand] = useState(false); -49: onClick={() => setExpand(!expand)} -51: {expand ? 'Hide' : 'View'} past events {expand ? '▲' : '▼'} -54: {expand && ( -``` -**Screenshot:** `phase3_events_1772578689420.png` — Shows "ModelSEED Related Events" heading, Latest section with PlantSEED 2018/2017/2016 events with dates, and "View past events ▼" toggle link. Events tab active in header. - -### ✅ 6. All Required Files Exist -**Status:** PASS -**Evidence:** -``` ---- Data files --- --rw-rw-r-- 48317 lib/data/publications.ts --rw-rw-r-- 6738 lib/data/team.ts ---- CSS Modules --- --rw-rw-r-- 583 app/events/events.module.css --rw-rw-r-- 717 app/projects/projects.module.css --rw-rw-r-- 1386 app/publications/publications.module.css --rw-rw-r-- 814 app/team/team.module.css ---- Page files --- --rw-rw-r-- 2268 app/events/page.tsx --rw-rw-r-- 5106 app/projects/page.tsx --rw-rw-r-- 4404 app/publications/page.tsx --rw-rw-r-- 2851 app/team/page.tsx ---- Assets --- --rw-rw-r-- 95223 public/img/projects/atomic-regulons.png -``` - -## Verdict -**PASS** — All 6 must-haves verified with empirical evidence (command output + 4 screenshots). - -## Timestamp Log -- Created: 2026-03-03T16:54:45-06:00 diff --git a/.gsd/milestones/v1-alpha/4/1-PLAN.md b/.gsd/milestones/v1-alpha/4/1-PLAN.md deleted file mode 100644 index 070bedb8..00000000 --- a/.gsd/milestones/v1-alpha/4/1-PLAN.md +++ /dev/null @@ -1,49 +0,0 @@ ---- -phase: 4 -plan: 1 -wave: 1 ---- - -# Plan 4.1: Biochem Data Models & API Utility - -## Objective -Establish the core data fetching strategy and utilities for the Biochemistry section. This involves installing required dependencies (`@tanstack/react-query`, `@tanstack/react-table` or `@mui/x-data-grid`) and creating a TypeScript utility that mimics the Solr fetching logic from `biochem.js` (including query formatting and Solr endpoint integration). - -## Context -- `.gsd/SPEC.md` -- `.gsd/DECISIONS.md` -- `external/ModelSEED-UI/app/services/biochem.js` -- `external/ModelSEED-UI/config.js` - -## Tasks - - - Install Data Grid & Query dependencies - package.json - - - Install `@tanstack/react-query` and `@mui/x-data-grid` via npm. - - These are necessary for handling large datasets and paginated queries matching the legacy angular application. - - npm list @tanstack/react-query @mui/x-data-grid - Dependencies installed successfully and exist in package.json. - - - - Create Solr API Utility - lib/api/biochem.ts - - - Create a file to handle Solr HTTP requests. - - Port the logic from `get_solr` in `biochem.js` to a modern TypeScript `fetch` wrapper. - - Define types for `Reaction` and `Compound` matching the fields retrieved from ModelSEED Solr (e.g. `id`, `name`, `stoichiometry`, `deltag`, `formula`, `mass`, etc). - - Implement `getReactions`, `getCompounds`, `getReactionDetail`, and `getCompoundDetail` functions. - - npx tsc --noEmit - TypeScript utility compiles without errors and exports data fetching methods. - - -## Success Criteria -- [ ] Dependencies `@tanstack/react-query` and `@mui/x-data-grid` are installed. -- [ ] `lib/api/biochem.ts` exists and exposes Solr fetching methods with strict typography. - -## Timestamp Log -- Created: 2026-03-03 17:28:00 -06:00 diff --git a/.gsd/milestones/v1-alpha/4/1-SUMMARY.md b/.gsd/milestones/v1-alpha/4/1-SUMMARY.md deleted file mode 100644 index e74c4324..00000000 --- a/.gsd/milestones/v1-alpha/4/1-SUMMARY.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -phase: 4 -plan: 1 -wave: 1 -status: complete ---- - -# Summary: Plan 4.1 — Biochem Data Models & API Utility - -## What Was Done - -### Task 1: Install Data Grid & Query Dependencies -- Installed `@tanstack/react-query` (^5.90.21) and `@mui/x-data-grid` (^8.27.3) via npm. -- Both packages confirmed in `package.json` dependencies. - -### Task 2: Create Solr API Utility -- Created `lib/api/biochem.ts` — a full TypeScript port of the legacy AngularJS `Biochem` service. -- Defined strict interfaces: `Reaction`, `Compound`, `SolrResponse`, `SolrQueryOpts`. -- Implemented `buildSolrUrl()` mirroring legacy `get_solr` query construction with field lists, search fields, pagination, and sorting. -- Implemented `sanitizeQuery()` mirroring legacy input sanitization. -- Exported public functions: `getReactions`, `getCompounds`, `getReactionById`, `getCompoundById`, `findReactionsForCompound`, `getCompoundImageUrl`. -- Exposed `EXTERNAL_DBS` constant for BiGG/KEGG/MetaCyc link generation. -- Compiles cleanly with `npx tsc --noEmit`. - -## Files Created/Modified -- `lib/api/biochem.ts` (264 lines) -- `package.json` (dependencies added) - -## Timestamp Log -- Created: 2026-03-04 07:50:00 -06:00 diff --git a/.gsd/milestones/v1-alpha/4/2-PLAN.md b/.gsd/milestones/v1-alpha/4/2-PLAN.md deleted file mode 100644 index 3486b493..00000000 --- a/.gsd/milestones/v1-alpha/4/2-PLAN.md +++ /dev/null @@ -1,49 +0,0 @@ ---- -phase: 4 -plan: 2 -wave: 2 ---- - -# Plan 4.2: Biochem Sub-Navigation & Layout - -## Objective -Implement a shared layout for the `/biochem` routes to mirror the legacy secondary navigation (toolbar tabs) for "Public Plant Models", "Subsystems", "Reactions", "Compounds", and "Media". - -## Context -- `external/ModelSEED-UI/app/views/biochem/biochem.html` -- Route matching: Legacy uses `ui-sref="app.biochem({chem: 'reactions'})"` etc. We'll use Next.js matching paths. - -## Tasks - - - Create Shared Biochem Layout - app/biochem/layout.tsx - - - Ensure `layout.tsx` renders a sub-navigation bar using MUI (e.g., `Tabs`, `Box`, `AppBar`). - - Include Tabs for: Public Plant Models, Subsystems, Reactions, Compounds, Media. - - Active tab behavior: Match against current route using `usePathname()`. - - Reactions (`/biochem/reactions`) and Compounds (`/biochem/compounds`) tabs must link to fully fledged pages. - - Other tabs can navigate to stub routes/placeholders for now matching identical legacy layout (dark purple background, white active text). - - Check visually via browser after saving. - Biochem routes render a custom submenu toolbar matching legacy visuals. - - - - React Query Provider - app/layout.tsx or a Provider component - - - Create a client `Providers` component wrapping children in `QueryClientProvider` to allow using `useQuery` globally within the app client components. - - Insert the provider in the root layout. - - Check that app doesn't crash on load and Provider is in DevTools. - React Query client is successfully wrapped around the application. - - -## Success Criteria -- [ ] Sub-navigation renders successfully on Biochem routes. -- [ ] Active tab state correctly reflects current location. -- [ ] `QueryClientProvider` wraps the app to support future data fetching. - -## Timestamp Log -- Created: 2026-03-03 17:28:00 -06:00 diff --git a/.gsd/milestones/v1-alpha/4/2-SUMMARY.md b/.gsd/milestones/v1-alpha/4/2-SUMMARY.md deleted file mode 100644 index 528aa148..00000000 --- a/.gsd/milestones/v1-alpha/4/2-SUMMARY.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -phase: 4 -plan: 2 -wave: 2 -status: complete ---- - -# Summary: Plan 4.2 — Biochem Sub-Navigation & Layout - -## What Was Done - -### Task 1: Create Shared Biochem Layout -- Created `app/biochem/layout.tsx` with MUI `Tabs` sub-navigation bar. -- Tabs: Public Plant Models (disabled), Subsystems (disabled), Reactions, Compounds, Media (disabled). -- Active tab state driven by `usePathname()` matching against route prefixes. -- Dark purple background (#2D224E) matching legacy visual identity. -- Tab styling: white active text, semi-transparent inactive, dividers between tabs. - -### Task 2: React Query Provider -- Created `components/Providers.tsx` wrapping `QueryClientProvider` from `@tanstack/react-query`. -- Configured with 5-minute stale time and disabled refetch-on-focus (appropriate for Solr data). -- Integrated into root `app/layout.tsx` wrapping all children. - -### Bonus: Biochem Index Redirect -- Created `app/biochem/page.tsx` — redirects `/biochem` to `/biochem/reactions` matching legacy default behavior. - -## Files Created/Modified -- `app/biochem/layout.tsx` (118 lines) -- `app/biochem/page.tsx` (10 lines) -- `components/Providers.tsx` (29 lines) -- `app/layout.tsx` (Provider integration) - -## Timestamp Log -- Created: 2026-03-04 07:50:00 -06:00 diff --git a/.gsd/milestones/v1-alpha/4/3-PLAN.md b/.gsd/milestones/v1-alpha/4/3-PLAN.md deleted file mode 100644 index 50352a4f..00000000 --- a/.gsd/milestones/v1-alpha/4/3-PLAN.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -phase: 4 -plan: 3 -wave: 3 ---- - -# Plan 4.3: Reactions Data Table - -## Objective -Implement the main `/biochem/reactions` (which handles list view for Reactions). It should replicate the React `MUI DataGrid` fetching, column styling, sorting, and pagination of the legacy `ng-table-solr`. - -## Context -- `external/ModelSEED-UI/app/views/biochem/biochem-reaction.html` -- `external/ModelSEED-UI/app/ctrls/ms-ctrls.js` (The `$s.rxnHeader` config) -- `external/ModelSEED-UI/app/services/biochem.js` - -## Tasks - - - Build Reactions DataGrid Page - app/biochem/reactions/page.tsx - - - Ensure Page is a full page rendering (likely `"use client"`). - - Use `@tanstack/react-query` to fetch from `lib/api/biochem.ts` `getReactions`. - - Setup `DataGrid` columns identical to legacy: ID, Name, Equation, Transport, deltaG, Status, EC Numbers, Notes, Synonyms, Aliases, Pathways, Ontology. - - Match formatting explicitly (e.g., ID has a link to `/rxn/[id]`, Equation renders stoich, Aliases parse `BiGG`/`KEGG` labels into `` tags). - - Implement Server-Side pagination/sorting mapped to Solr query. Allow basic text search like `ng-table` did. - - Access `/biochem/reactions` in browser. Expect to see table populate. - Reactions table perfectly reflects legacy fields, and search works against live Solr via React Query. - - -## Success Criteria -- [ ] DataGrid matches legacy column set exactly. -- [ ] Aliases correctly parse their formatting (`` tags via dangerouslySetInnerHTML or React nodes) and link out to BiGG/KEGG/MetaCyc. -- [ ] Equation (Stoichiometry) formats properly. -- [ ] Server-side pagination, sorting, and global searching are hooked into data grid. - -## Timestamp Log -- Created: 2026-03-03 17:28:00 -06:00 diff --git a/.gsd/milestones/v1-alpha/4/3-SUMMARY.md b/.gsd/milestones/v1-alpha/4/3-SUMMARY.md deleted file mode 100644 index e7ef61c9..00000000 --- a/.gsd/milestones/v1-alpha/4/3-SUMMARY.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -phase: 4 -plan: 3 -wave: 3 -status: complete ---- - -# Summary: Plan 4.3 — Reactions Data Table - -## What Was Done - -### Task 1: Build Reactions DataGrid Page -- Created `app/biochem/reactions/page.tsx` (225 lines) — full `"use client"` page. -- Connected to `getReactions` via `useQuery` from `@tanstack/react-query`. -- Columns match legacy exactly: ID (linked to `/rxn/[id]`), Name, Equation (definition), Transport, ΔG, Status, EC Numbers, Notes, Synonyms, Aliases, Pathways, Ontology. -- Alias parsing: extracts prefix (BiGG/KEGG/MetaCyc/AraCyc/Rhea), generates clickable external links with correct base URLs. -- Synonym extraction: parses the `Name:` entry from the aliases array. -- Pathway parsing: formats `prefix: values` with pipe-to-semicolon conversion. -- Server-side pagination mapped to Solr `rows`/`start` parameters. -- Server-side sorting mapped to Solr `sort` parameter. -- Global text search with Enter-to-submit input field. -- Auto-height rows for multi-line alias/synonym content. - -## Verification -- Navigated to `/biochem/reactions` — DataGrid populated with 83,000+ reactions from Solr. -- Pagination, sorting, and search all functional. -- External links (BiGG, KEGG, MetaCyc) open correctly in new tabs. - -## Files Created/Modified -- `app/biochem/reactions/page.tsx` (225 lines) - -## Timestamp Log -- Created: 2026-03-04 07:50:00 -06:00 diff --git a/.gsd/milestones/v1-alpha/4/4-PLAN.md b/.gsd/milestones/v1-alpha/4/4-PLAN.md deleted file mode 100644 index 83649a19..00000000 --- a/.gsd/milestones/v1-alpha/4/4-PLAN.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -phase: 4 -plan: 4 -wave: 3 ---- - -# Plan 4.4: Compounds Data Table - -## Objective -Implement the main `/biochem/compounds` table using `@mui/x-data-grid` just like the Reactions tab, directly mapping Solr results to columns mimicking legacy `ng-table-solr`. - -## Context -- `external/ModelSEED-UI/app/views/biochem/biochem-compound.html` -- `external/ModelSEED-UI/app/ctrls/ms-ctrls.js` (The `$s.cpdHeader` config) -- `external/ModelSEED-UI/app/services/biochem.js` - -## Tasks - - - Build Compounds DataGrid Page - app/biochem/compounds/page.tsx - - - Create `"use client"` page rendering the `DataGrid` connected to `getCompounds` via `useQuery`. - - Columns: ID, Name, Formula, Mass, Charge, Synonyms, Aliases, Ontology. - - Format ID column with links to `/cpd/[id]`. - - Format Formula (`pretty-formula` logic, handling HTML if needed, e.g. replacing numbers with sub-script logic optionally, but checking legacy implementation first). - - Parse Aliases exactly as the Reactions table does to inject BiGG/KEGG/MetaCyc external `` tags. - - Setup Server-Side Sorting/Pagination tied to query state. - - Navigate to `/biochem/compounds` and ensure data renders and paginates perfectly. - Compounds table perfectly reflects legacy fields, and search works against live Solr. - - -## Success Criteria -- [ ] Table visually renders in `DataGrid` mimicking `ng-table-solr`. -- [ ] Links and alias processing behave identically. -- [ ] Data correctly paginated via Solr. - -## Timestamp Log -- Created: 2026-03-03 17:28:00 -06:00 diff --git a/.gsd/milestones/v1-alpha/4/4-SUMMARY.md b/.gsd/milestones/v1-alpha/4/4-SUMMARY.md deleted file mode 100644 index 96ef3308..00000000 --- a/.gsd/milestones/v1-alpha/4/4-SUMMARY.md +++ /dev/null @@ -1,31 +0,0 @@ ---- -phase: 4 -plan: 4 -wave: 3 -status: complete ---- - -# Summary: Plan 4.4 — Compounds Data Table - -## What Was Done - -### Task 1: Build Compounds DataGrid Page -- Created `app/biochem/compounds/page.tsx` (178 lines) — full `"use client"` page. -- Connected to `getCompounds` via `useQuery`. -- Columns match legacy: ID (linked to `/cpd/[id]`), Name, Formula, Mass, Charge, Synonyms, Aliases, Ontology. -- Alias parsing: identical logic to Reactions but uses compound-specific base URLs (BiGG metabolites, MetaCyc compounds). -- Synonym extraction: for compounds, the Name entry is the FIRST alias (opposite of reactions where it's last). -- Server-side pagination and sorting via Solr query parameters. -- Global text search with Enter-to-submit. -- Auto-height rows for multi-line content. - -## Verification -- Navigated to `/biochem/compounds` — DataGrid populated with compounds from Solr. -- cpd00001 (H2O), cpd00002 (ATP), cpd00003 (NAD) all display correctly. -- External links (BiGG, KEGG, MetaCyc, ChEBI) all functional. - -## Files Created/Modified -- `app/biochem/compounds/page.tsx` (178 lines) - -## Timestamp Log -- Created: 2026-03-04 07:50:00 -06:00 diff --git a/.gsd/milestones/v1-alpha/4/5-PLAN.md b/.gsd/milestones/v1-alpha/4/5-PLAN.md deleted file mode 100644 index 0101bff2..00000000 --- a/.gsd/milestones/v1-alpha/4/5-PLAN.md +++ /dev/null @@ -1,52 +0,0 @@ ---- -phase: 4 -plan: 5 -wave: 4 ---- - -# Plan 4.5: Detail Pages (Rxn / Cpd) - -## Objective -Implement the individual detail pages that show a single compound or reaction when navigating from the Data Table, matching the legacy angular templates (`compound.html`, `reaction.html`). - -## Context -- `external/ModelSEED-UI/app/views/biochem/compound.html` -- `external/ModelSEED-UI/app/views/biochem/reaction.html` -- Route matching: `/biochem/reactions/[id]` and `/biochem/compounds/[id]`. Or `/rxn/[id]` and `/cpd/[id]`. Let's implement at `app/rxn/[id]/page.tsx` and `app/cpd/[id]/page.tsx` to match old URLs, preserving backwards compatible permalinks, or just `/biochem/...` whichever matches the legacy sitemap. -- The `Compound` controller calls `Biochem.findReactions_solr` to load related reactions, and parses the fields identically to the main table. - -## Tasks - - - Create Reaction Detail Page - app/rxn/[id]/page.tsx - - - Ensure Page routes properly at `/rxn/[id]` (add a static redirect or implement directly). - - Use ``-like layout using `` from MUI. Display ID, Name, Structure/Image (if valid for Rxn?), properties (deltaG), stoichiometry equation table/visualization. - - Fetch the specific Reaction ID using the `getReactionDetail` from `lib/api/biochem.ts` via Server Components (or `useQuery`). - - Visually format matching `app/views/biochem/reaction.html` with two columns. - - Load `/rxn/rxn00001` and verify UI appears. - Reaction detail renders identical to legacy layout. - - - - Create Compound Detail Page - app/cpd/[id]/page.tsx - - - Create page routing at `/cpd/[id]`. - - Like Reaction, use MUI Layout matching legacy `compound.html`. Show image (`getImagePath`), properties, formula. - - Fetch compound using `getCompoundDetail`. - - Below properties, implement a Reaction Table fetching related reactions where this compound is a substrate/product via `findReactions_solr` logic replicated in `lib/api/biochem.ts`. This table must look identical to main `Reactions` table but customized per legacy behavior (e.g. `cpd_rxnHeader` config). - - Load `/cpd/cpd00001` and verify UI and related reactions table appears. - Compound detail renders identically to legacy layout with images and relational grids. - - -## Success Criteria -- [ ] Detail pages correctly fetch single records from Solr. -- [ ] Compound imagery correctly references ModelSEED's external minedatabase URL logic. -- [ ] Layout grid, margins, headers identically mimic the legacy HTML files. - -## Timestamp Log -- Created: 2026-03-03 17:28:00 -06:00 diff --git a/.gsd/milestones/v1-alpha/4/5-SUMMARY.md b/.gsd/milestones/v1-alpha/4/5-SUMMARY.md deleted file mode 100644 index 63bb3766..00000000 --- a/.gsd/milestones/v1-alpha/4/5-SUMMARY.md +++ /dev/null @@ -1,44 +0,0 @@ -98--- -phase: 4 -plan: 5 -wave: 4 -status: complete ---- - -# Summary: Plan 4.5 — Detail Pages (Rxn / Cpd) - -## What Was Done - -### Task 1: Create Reaction Detail Page -- Created `app/rxn/[id]/page.tsx` (201 lines) — client-side detail page. -- Fetches single reaction via `getReactionById` with `useQuery`. -- Displays all fields in a two-column Card layout: Reaction ID/Name, Equation, Abbreviation, Definition, Equation with compound IDs, ΔG±error, EC Numbers, Thermodynamic reversibility, Status, Is obsolete, Linked reaction (when obsolete), Aliases (with external links), Synonyms, Is transport, Source, Pathways, Ontology. -- Handles obsolete reactions by showing linked replacement reaction. -- Loading spinner and error states. - -### Task 2: Create Compound Detail Page -- Created `app/cpd/[id]/page.tsx` (244 lines) — client-side detail page. -- Two-column layout matching legacy: compound image (from minedatabase) on left, properties Card on right. -- Properties: ΔG±error, pKa, pKb, Weight, Charge, Structure, InChIKey, SMILES, Is co-factor, Is core, Is obsolete, Aliases (with external links), Synonyms, Ontology, Source. -- Special handling: ΔG of 10000000 displayed as "unspecified" (matching legacy). -- Related Reactions table below — uses `findReactionsForCompound` with server-side pagination/sorting in a DataGrid. Shows 20,347 related reactions for H2O (cpd00001). -- Image gracefully hidden via `onError` handler when unavailable. - -### Redirect Pages -- `app/biochem/reactions/[id]/page.tsx` — redirects to canonical `/rxn/[id]`. -- `app/biochem/compounds/[id]/page.tsx` — redirects to canonical `/cpd/[id]`. - -## Verification -- `/rxn/rxn00001` — renders diphosphate phosphohydrolase with all properties. -- `/cpd/cpd00001` — renders H2O with image, properties, and 20,347 related reactions. -- `/biochem/reactions/rxn00001` → redirects to `/rxn/rxn00001` ✓ -- `/biochem/compounds/cpd00001` → redirects to `/cpd/cpd00001` ✓ - -## Files Created/Modified -- `app/rxn/[id]/page.tsx` (201 lines) -- `app/cpd/[id]/page.tsx` (244 lines) -- `app/biochem/reactions/[id]/page.tsx` (redirect) -- `app/biochem/compounds/[id]/page.tsx` (redirect) - -## Timestamp Log -- Created: 2026-03-04 07:50:00 -06:00 diff --git a/.gsd/milestones/v1-alpha/4/VERIFICATION.md b/.gsd/milestones/v1-alpha/4/VERIFICATION.md deleted file mode 100644 index 559a3369..00000000 --- a/.gsd/milestones/v1-alpha/4/VERIFICATION.md +++ /dev/null @@ -1,24 +0,0 @@ -# Phase 4 Verification - -## Must-Haves - -- [x] Dependencies `@tanstack/react-query` and `@mui/x-data-grid` installed — VERIFIED (confirmed in `package.json`) -- [x] `lib/api/biochem.ts` exists with Solr fetching methods — VERIFIED (264 lines, compiles cleanly) -- [x] Sub-navigation renders on Biochem routes — VERIFIED (screenshot: dark purple bar with 5 tabs) -- [x] Active tab state reflects current location — VERIFIED (Reactions/Compounds tabs highlight correctly) -- [x] `QueryClientProvider` wraps the app — VERIFIED (`components/Providers.tsx` in root layout) -- [x] Reactions DataGrid matches legacy columns — VERIFIED (ID, Name, Equation, Transport, ΔG, Status, EC Numbers, Notes, Synonyms, Aliases, Pathways, Ontology) -- [x] Aliases parse BiGG/KEGG/MetaCyc into clickable links — VERIFIED (screenshots show linked aliases) -- [x] Server-side pagination/sorting via Solr — VERIFIED (pagination controls functional, sort changes query) -- [x] Compounds DataGrid matches legacy columns — VERIFIED (ID, Name, Formula, Mass, Charge, Synonyms, Aliases, Ontology) -- [x] Reaction detail page renders at `/rxn/[id]` — VERIFIED (rxn00001 loads all properties) -- [x] Compound detail page renders at `/cpd/[id]` — VERIFIED (cpd00001 shows H2O image, properties, 20,347 related reactions) -- [x] Compound image loads from minedatabase — VERIFIED (H2O structural formula visible) -- [x] Related reactions table on compound detail — VERIFIED (DataGrid with server-side pagination) -- [x] Redirect routes work (`/biochem/reactions/[id]` → `/rxn/[id]`, `/biochem/compounds/[id]` → `/cpd/[id]`) — VERIFIED -- [x] TypeScript compiles without Phase 4 errors — VERIFIED (`npx tsc --noEmit` clean for all Phase 4 files) - -### Verdict: PASS ✅ - -## Timestamp Log -- Created: 2026-03-04 07:52:00 -06:00 diff --git a/.gsd/milestones/v1-alpha/5/1-PLAN.md b/.gsd/milestones/v1-alpha/5/1-PLAN.md deleted file mode 100644 index a7058bf2..00000000 --- a/.gsd/milestones/v1-alpha/5/1-PLAN.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -phase: 5 -plan: 1 ---- - -# Plan 5.1: Workspace API Service & Route Refactor - -## Objective -Establish the connection to the ModelSEED Workspace API and transition the `/biochem` routes to the broader `/reference-data` taxonomy as requested in the UI mockup. - -## Details -1. **Create `lib/api/workspace.ts`**: - - Define types for Workspace API responses (e.g., `WorkspaceMeta`, JSON-RPC requests/responses). - - Implement `workspaceLs(paths: string[])` which maps to the "Workspace.ls" RPC method. - - Implement `workspaceGet(objects: string[])` which maps to the "Workspace.get" RPC method. - - Use the endpoint: `https://p3.theseed.org/services/Workspace`. - -2. **Route Refactoring**: - - Rename `app/biochem` directory to `app/reference-data`. - - Update `app/reference-data/page.tsx` to redirect to `/reference-data/plants` (the first tab, or maybe Reactions). Legacy often defaulted to Reactions, but "Public Plant Models" is first in the list. Redirect to `/reference-data/reactions` for now to maintain parity with legacy default. - - Update `app/reference-data/layout.tsx` tabs to include: - - Public Plant Models (`/reference-data/plants`) - - Subsystems (`/reference-data/subsystems`) - - Reactions (`/reference-data/reactions`) - - Compounds (`/reference-data/compounds`) - - Media (`/reference-data/media`) - - Update `/rxn/[id]` and `/cpd/[id]` back links to point back to `/reference-data/reactions` and `/reference-data/compounds`. - - Add backwards-compatible redirects in `next.config.js` or via `page.tsx` components (from `/biochem/reactions` to `/reference-data/reactions`, etc) so we don't break existing permalinks. - -## Acceptance Criteria -- [ ] `lib/api/workspace.ts` exports typed helper functions for the Workspace JSON-RPC API. -- [ ] Changing the URL from `/biochem/reactions` to `/reference-data/reactions` successfully renders the Reactions page and highlights the "Reactions" tab. -- [ ] Old `/biochem/reactions` correctly points to the new route. - -## Timestamp Log -- Created: 2026-03-04 08:30:00 -06:00 diff --git a/.gsd/milestones/v1-alpha/5/1-SUMMARY.md b/.gsd/milestones/v1-alpha/5/1-SUMMARY.md deleted file mode 100644 index 9b2ae7c3..00000000 --- a/.gsd/milestones/v1-alpha/5/1-SUMMARY.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -phase: 5 -plan: 1 ---- - -# Plan 5.1: Workspace API Service & Route Refactor SUMMARY - -## Execution Log -- Created `lib/api/workspace.ts` which successfully points to the JSON-RPC Workspace API at `https://p3.theseed.org/services/Workspace` with `workspaceLs` and `workspaceGet` methods. -- Renamed the whole `app/biochem/` app folder to `app/reference-data/`. -- Updated `app/reference-data/layout.tsx` to align the URL taxonomy to `reference-data` instead of `biochem`. -- Updated `app/reference-data/page.tsx` default redirect to point to `/reference-data/reactions`. -- Modified compound and reaction route components (`app/cpd/[id]/page.tsx` and `app/rxn/[id]/page.tsx`) to implement the `back` functionality pointing to the updated `/reference-data/*` paths. -- Updated `Header.tsx` links to refer to the new `reference-data` paths instead of `biochem`. - -## Outcome -The groundwork for referencing the broader set of data (Plants, Subsystems, Media) is firmly established without breaking Reactions and Compounds. The reference-data structure is ready for the new DataGrid integrations. - -## Timestamp Log -- Created: 2026-03-04 08:35:00 -06:00 -- Updated: 2026-03-04 08:35:00 -06:00 - Execution complete. diff --git a/.gsd/milestones/v1-alpha/5/2-PLAN.md b/.gsd/milestones/v1-alpha/5/2-PLAN.md deleted file mode 100644 index 6b85ce5d..00000000 --- a/.gsd/milestones/v1-alpha/5/2-PLAN.md +++ /dev/null @@ -1,42 +0,0 @@ ---- -phase: 5 -plan: 2 ---- - -# Plan 5.2: Dual-Header Architecture & Sign-In Modal - -## Objective -Implement a contextual "App Header" specifically for the internal data tools (`/reference-data`, `/user-data`, `/build-model`) while preserving the existing public "Home Header" for the marketing/info pages. Create a sign-in dialog prompt for protected links. - -## Details -1. **Create `components/layout/SignInModal.tsx`**: - - Implement an MUI `` component mocking the PATRIC/RAST sign-in interface. - - For now, clicking "Sign In" simply closes the dialog (we will integrate real authentication in a later phase). - - This modal needs to be triggerable via a global state or via context/props from the Header. To keep it simple, you can use a Zustand store or React Context, OR just have the `AppHeader` mount it natively with standard internal state. - -2. **Create `components/layout/AppHeader.tsx`**: - - Model this after `external/ModelSEED-UI/app/views/toolbar.html`. - - The left side has the ModelSEED Logo pointing back to `.`. - - Next to the logo, three primary tabs: `Reference Data`, `User Data`, `Build Model`. - - Ensure the `Reference Data` tab is highlighted when the user is under the `/reference-data` routes (or `/rxn`, `/cpd`). - - Clicking `User Data` or `Build Model` when unauthenticated MUST open the `SignInModal` instead of navigating. - - The right side has a "More" dropdown containing links to: About, Version, Events, Related Projects. - - The right side also has a standalone `Sign In` MUI Button that opens the `SignInModal`. - -3. **Integrate AppHeader into the Route Layouts**: - - Wrap `app/reference-data/layout.tsx` output with the ``. Note: The current global `app/layout.tsx` renders the default `
    `. We need to use Next.js `usePathname` in the main layout or restructure with Route Groups `(public)` and `(app)` to ensure only one header renders. - - Restructuring with Route Groups: - - Move all marketing routes (`page.tsx`, `about`, `events`, `projects`, `publications`, `team`) into `app/(public)/`. Let `app/(public)/layout.tsx` load the original `
    `. - - Move the tool routes (`reference-data`, `user-data`, `build-model`, `rxn`, `cpd`) into `app/(app)/`. Let `app/(app)/layout.tsx` load the new ``. - - *Simpler Approach without moving files*: Inside `app/layout.tsx`, check `pathname`. If `pathname.startsWith('/reference-data')` or `/user-data` or `/build-model` or `/rxn` or `/cpd`, render `` instead of `
    `. - - Update the public `
    ` so its `Biochemistry` button links to `/reference-data`. - -## Acceptance Criteria -- [ ] Users visiting the homepage or `/about` see the standard public header. -- [ ] Users visiting `/reference-data` or clicking "Biochemistry" on the homepage see the new `AppHeader` with Reference Data, User Data, Build Model tabs. -- [ ] Clicking "User Data" or "Build Model" on the `AppHeader` opens the `SignInModal`. -- [ ] Clicking the "Sign In" button on the far right opens the `SignInModal`. -- [ ] The "More" dropdown functions correctly and lists the specified secondary links. - -## Timestamp Log -- Created: 2026-03-04 08:35:00 -06:00 diff --git a/.gsd/milestones/v1-alpha/5/2-SUMMARY.md b/.gsd/milestones/v1-alpha/5/2-SUMMARY.md deleted file mode 100644 index 67568b3a..00000000 --- a/.gsd/milestones/v1-alpha/5/2-SUMMARY.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -phase: 5 -plan: 2 ---- - -# Plan 5.2: Dual-Header Architecture & Sign-In Modal SUMMARY - -## Execution Log -- Built `components/layout/SignInModal.tsx` which houses an MUI Dialog with mock PATRIC/RAST authentication options per the legacy model. -- Built `components/layout/AppHeader.tsx`, creating the exact contextual header needed for the data-specific application pages. This handles dynamic path matching to highlight the proper tab (`Reference Data`, `User Data`, or `Build Model`). -- Updated `app/layout.tsx` to implement a new `HeaderLayoutRouter` (`app/HeaderLayoutRouter.tsx`). -- Tested `HeaderLayoutRouter.tsx` routing which dynamically selects the global `
    ` component for marketing/info pages and swaps it instantly to the `` component when users access protected or tool-based routes (e.g. `reference-data`, `cpd`, `rxn`). -- Validated that `User Data` and `Build Model` buttons correctly pop up the new login protection modal. -- Build verified with clean compilation output (Next.js 16/Turbopack). Note: Fixed a null publication error in `lib/data/publications.ts`. - -## Outcome -The UI cleanly partitions the marketing app properties from the web-tool properties efficiently, maintaining exact feature parity and aesthetics with the legacy application headers. Authentication barriers are properly structured. - -## Timestamp Log -- Created: 2026-03-04 08:38:00 -06:00 -- Updated: 2026-03-04 08:38:00 -06:00 - Execution complete. diff --git a/.gsd/milestones/v1-alpha/5/3-PLAN.md b/.gsd/milestones/v1-alpha/5/3-PLAN.md deleted file mode 100644 index 7fb9b55f..00000000 --- a/.gsd/milestones/v1-alpha/5/3-PLAN.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -phase: 5 -plan: 3 ---- - -# Plan 5.3: Public Plant Models & Subsystems DataGrids - -## Objective -Implement the "Public Plant Models" and "Subsystems" pages under the `/reference-data` route using the MUI DataGrid and the new Workspace API fetching logic. - -## Details -1. **Public Plant Models (`app/reference-data/plants/page.tsx`)**: - - Use `useQuery` via React Query to fetch data using `workspaceLs(['/plantseed/plantseed/'])`. - - The Workspace API returns metadata tuples. Extract the organism lists. In legacy, it listed nested modelfolders inside `/plantseed/plantseed/`. Note: we verified `Workspace.ls` returns `result[0]["/plantseed/plantseed/"]` containing modelfolder metadata. - - Implement an MUI DataGrid with columns matching legacy: ModelID (Genome Name), Species, SpeciesDomain, Reactions, Genes, FBA, Gapfilling, ModificationDate. - - The properties are inside index 7 (the dict) of the returned arrays. - -2. **Subsystems (`app/reference-data/subsystems/page.tsx`)**: - - Use `useQuery` via React Query to fetch data using `workspaceGet(['/plantseed/Data/annotation_overview'])`. - - The JSON object returned needs to be parsed (`fromjs` -> json.parse inside index 1). - - The parsed JSON is an array of annotation items. - - Implement an MUI DataGrid evaluating the fields: Role, Subsystems, Classes, Pathways, Reactions, Features. - -## Acceptance Criteria -- [ ] `/reference-data/plants` successfully loads genome data through DataGrid and paginates/sorts cleanly. -- [ ] `/reference-data/subsystems` successfully loads the large 910-item JSON and presents it in a searchable, sortable DataGrid. - -## Timestamp Log -- Created: 2026-03-04 08:30:00 -06:00 diff --git a/.gsd/milestones/v1-alpha/5/3-SUMMARY.md b/.gsd/milestones/v1-alpha/5/3-SUMMARY.md deleted file mode 100644 index 3ec2c516..00000000 --- a/.gsd/milestones/v1-alpha/5/3-SUMMARY.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -phase: 5 -plan: 3 ---- - -# Plan 5.3: Public Plant Models & Subsystems DataGrids SUMMARY - -## Execution Log -- Built `app/reference-data/plants/page.tsx` utilizing `@tanstack/react-query` to fetch public plant structural metadata via `workspaceLs(['/plantseed/plantseed/'])`. -- Implemented the Plant Models MUI DataGrid matching legacy columns (`id`, `name`, `source`, `num_reactions`, `num_genes`, `fba_count`, `gapfills`, `modDate`) utilizing the index 7 metadata object from the Workspace API tuple. -- Built `app/reference-data/subsystems/page.tsx` utilizing `@tanstack/react-query` to fetch the large annotation metadata via `workspaceGet(['/plantseed/Data/annotation_overview'])`. -- Verified the deeply nested `Workspace.get` return structure and properly implemented `JSON.parse` to extract the payload (array of annotation items). -- Implemented the Subsystems MUI DataGrid formatting `subsystems`, `classes`, `pathways`, `reactions`, and `features` fields through object key extraction mirroring the legacy interface. - -## Outcome -The application successfully parses, downloads, and structures native Workspace API model data alongside standard Solr records, enabling unified presentation of reference capabilities. - -## Timestamp Log -- Created: 2026-03-04 08:45:00 -06:00 -- Updated: 2026-03-04 08:45:00 -06:00 - Execution complete. diff --git a/.gsd/milestones/v1-alpha/5/4-PLAN.md b/.gsd/milestones/v1-alpha/5/4-PLAN.md deleted file mode 100644 index 4530d4f9..00000000 --- a/.gsd/milestones/v1-alpha/5/4-PLAN.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -phase: 5 -plan: 4 ---- - -# Plan 5.4: Media DataGrid & Skeleton Auth-Gated Routes - -## Objective -Implement the Media tab inside Reference Data and set up layout skeletons for the User Data and Build Model sections. - -## Details -1. **Media DataGrid (`app/(app)/reference-data/media/page.tsx` or similar path)**: - - Use `workspaceLs(['/chenry/public/modelsupport/media'])`. - - The endpoint returns ~523 media formulations. - - Set up columns: Name (index 0), Minimal? (index 7 hash 'isMinimal'), Defined? (index 7 hash 'isDefined'), Type (index 7 hash 'type'). Use properties from index 7 (metadata). - -2. **Build Skeleton Protected Routes**: - - Create `app/user-data/page.tsx`. Provide a simple coming-soon or structural layout matching legacy `app/views/my-models.html` headers (e.g. My Models | My Media sub-tabs). - - Create `app/build-model/page.tsx`. Provide a simple layout matching legacy `app/views/data/plant.html` (e.g. UPLOAD Plants FASTA | UPLOAD Microbes FASTA tabs). - - Because you added the `SignInModal` intercept to the App Header in Plan 5.2, users ostensibly shouldn't be able to easily browse to these without triggering the prompt via the header, but since we're mocking auth, if they type the URL, just let the mockup render a nice placeholder for now. - -## Acceptance Criteria -- [ ] `/reference-data/media` successfully fetches from Workspace API and renders the Media DataGrid. -- [ ] `/user-data` renders a standalone page containing a skeleton UI placeholder (e.g. "My Models" and "My Media" tabs). -- [ ] `/build-model` renders a standalone page containing a skeleton UI placeholder (e.g. "Plant FASTA" and "Microbe FASTA" tabs). - -## Timestamp Log -- Created: 2026-03-04 08:35:00 -06:00 diff --git a/.gsd/milestones/v1-alpha/5/4-SUMMARY.md b/.gsd/milestones/v1-alpha/5/4-SUMMARY.md deleted file mode 100644 index aa62aebc..00000000 --- a/.gsd/milestones/v1-alpha/5/4-SUMMARY.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -phase: 5 -plan: 4 ---- - -# Plan 5.4: Media DataGrid & Skeleton Auth-Gated Routes SUMMARY - -## Execution Log -- Built `app/reference-data/media/page.tsx` utilizing `@tanstack/react-query` to fetch public media descriptions via `workspaceLs(['/chenry/public/modelsupport/media'])`. -- Implemented the Media MUI DataGrid applying appropriate filters (`type`, `isDefined`, `isMinimal`, `name`) by examining the index 7 metadata hash. -- Scaffolded `app/user-data/page.tsx` reflecting a simplified legacy UI state for personal tools/data (My Models, My Media tabs). -- Scaffolded `app/build-model/page.tsx` illustrating upcoming plant and microbe model reconstruction pipelines (Plant Sequence FASTA / Microbes Sequence FASTA tabs). -- Verified application functionality across all nested dynamic routing hierarchies utilizing `npm run build` with Next.js Turbopack compiler. - -## Outcome -All core and extended UI structural blocks documented in visual spec dependencies are cleanly assembled and functionally accurate, effectively completing the 1st milestone of ModelSEED's modern transition strategy. - -## Timestamp Log -- Created: 2026-03-04 08:45:00 -06:00 -- Updated: 2026-03-04 08:45:00 -06:00 - Execution complete. diff --git a/.gsd/milestones/v1-alpha/5/VERIFICATION.md b/.gsd/milestones/v1-alpha/5/VERIFICATION.md deleted file mode 100644 index d01dbf82..00000000 --- a/.gsd/milestones/v1-alpha/5/VERIFICATION.md +++ /dev/null @@ -1,53 +0,0 @@ ---- -phase: 5 -verified_at: 2026-03-04T08:50:00-06:00 -verdict: PASS ---- - -# Phase 5 Verification Report - -## Summary -5/5 must-haves verified - -## Must-Haves - -### ✅ 1. Dual-Header Implementation -**Status:** PASS -**Evidence:** -``` -Build logs confirm AppHeader and Header layouts resolved successfully in Next.js Turbopack compiler. -`HeaderLayoutRouter` configured properly. -``` - -### ✅ 2. Workspace API Connection -**Status:** PASS -**Evidence:** -``` -curl -s -X POST https://p3.theseed.org/services/Workspace -H "Content-Type: application/json" --data '{"version": "1.1", "method": "Workspace.ls", "id": 1, "params": [{"paths": ["/plantseed/plantseed/"]}]}' -Output successfully returned [ "Plastidial_Sandbox", "modelfolder", ... ] nested structure resolving Workspace RPC bindings. -``` - -### ✅ 3. Plants and Subsystems UI DataGrids -**Status:** PASS -**Evidence:** -``` -Build output registered generation of static components corresponding to `/reference-data/plants` and `/reference-data/subsystems`. -`Workspace.get` JSON-RPC query successfully tested against `annotation_overview` retrieving 910 nested objects mapped to fields via internal parsers. -``` - -### ✅ 4. Media DataGrid Mapping -**Status:** PASS -**Evidence:** -``` -Build output logged `/reference-data/media` correctly rendering. Test querying mapped nested `isDefined` mapping property. -``` - -### ✅ 5. User Data and Build Model Skeleton UI -**Status:** PASS -**Evidence:** -``` -Code physically verified containing placeholders for Model upload views inside `user-data/` and `build-model/`. Modals conditionally prompt via Header. All successfully rendered in build log. -``` - -## Verdict -PASS diff --git a/.gsd/milestones/v1-alpha/6/1-PLAN.md b/.gsd/milestones/v1-alpha/6/1-PLAN.md deleted file mode 100644 index 94bd66d3..00000000 --- a/.gsd/milestones/v1-alpha/6/1-PLAN.md +++ /dev/null @@ -1,84 +0,0 @@ ---- -phase: 6 -plan: 1 -wave: 1 ---- - -# Plan 6.1: Route Restructuring & Exact Match Links - -## Objective -Revert/update the Next.js App Router folder structure to perfectly match the legacy ModelSEED URLs for Reference Data. This involves extracting items from `app/reference-data` into top-level paths (`/genomes`, `/biochem`, `/list-media`) inside a `(reference-data)` Route Group to share the sub-navigation layout. - -## Context -- .gsd/SPEC.md -- .gsd/ARCHITECTURE.md -- User requested identical route paths to legacy: `/genomes/`, `/genomes/Annotations`, `/biochem/reactions`, `/biochem/compounds`, `/list-media/`. - -## Tasks - - - Create Route Group & Move Layout - - - app/(reference-data)/layout.tsx - - app/reference-data/layout.tsx - - - - Create `app/(reference-data)` directory. - - Move `app/reference-data/layout.tsx` to `app/(reference-data)/layout.tsx`. - - Update `layout.tsx` to handle the new tab paths for its "value" and "href" (e.g. `value="/genomes"` instead of `/reference-data/public-plant-models`). - - The tabs are: Public Plant Models (`/genomes/`), Subsystems (`/genomes/Annotations`), Reactions (`/biochem/reactions`), Compounds (`/biochem/compounds`), Media (`/list-media/`). - - ls app/(reference-data)/layout.tsx - The sub-navigation layout is now configured for the legacy routes. - - - - Migrate Reference Data Pages to Exact Legacy Paths - - - app/(reference-data)/genomes/page.tsx - - app/(reference-data)/genomes/Annotations/page.tsx - - app/(reference-data)/biochem/reactions/page.tsx - - app/(reference-data)/biochem/reactions/[id]/page.tsx - - app/(reference-data)/biochem/compounds/page.tsx - - app/(reference-data)/biochem/compounds/[id]/page.tsx - - app/(reference-data)/list-media/page.tsx - - app/reference-data/ - - app/rxn/ - - app/cpd/ - - - - Recursively move the `page.tsx` files from `app/reference-data/*` and `app/rxn/`, `app/cpd/` to their new matching locations in `app/(reference-data)/...`. - - Update import statements inside these files (like `@/components/data-tables/...`) to account for any path changes if relative imports are used (though aliased imports `@/` should be fine). - - Ensure page components use the correct DataGrid components. - - Clean up the old empty directories (`app/reference-data`, `app/rxn`, `app/cpd`). - - ls app/(reference-data)/genomes/page.tsx && ls app/(reference-data)/biochem/reactions/page.tsx - All legacy routes are restored with their Next.js components. - - - - Update Navigation Links in AppHeader and Grids - - - components/layout/AppHeader.tsx - - components/data-tables/BiochemReactionsDataGrid.tsx - - components/data-tables/BiochemCompoundsDataGrid.tsx - - components/data-tables/PublicPlantModelsDataGrid.tsx - - components/data-tables/SubsystemsDataGrid.tsx - - - - In `AppHeader.tsx`, update the nested `href`s for the "Reference Data" section's dropdown or main links if they exist, pointing `Reference Data` to `/genomes/`. - - In the DataGrids, update all custom column definitions (like ID columns) to use `href={"/biochem/compounds/" + params.value}` instead of `/cpd/...`. - - Apply `Link` to the `Model ID` and `Species Name` columns in `PublicPlantModelsDataGrid.tsx` pointing to exactly `https://modelseed.org/model/plantseed/plantseed/[id]` format or the correct legacy route. - - For Subsystems DataGrid, ensure the Subsystems, Pathways, and Features columns are configured to render array elements as structural React elements containing `` tags to match the legacy links. - - grep -r "/biochem/compounds" components/data-tables/ - All hardcoded routes and Link elements perfectly match legacy URL structure. - - -## Success Criteria -- [ ] Next.js routes accurately replicate legacy `modelseed.org` routes. -- [ ] Sub-navigation tabs remain fully functional across these different root paths. -- [ ] Legacy links are restored to columns. - -## Timestamp Log -- Created: 2026-03-05 09:10:00 -06:00 diff --git a/.gsd/milestones/v1-alpha/6/1-SUMMARY.md b/.gsd/milestones/v1-alpha/6/1-SUMMARY.md deleted file mode 100644 index b7f34ef2..00000000 --- a/.gsd/milestones/v1-alpha/6/1-SUMMARY.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -phase: 6 -plan: 1 -wave: 1 -status: complete ---- - -# Plan 6.1 Summary: Route Restructuring - -## Activities -- **Route Group Implementation**: Confirmed pages are correctly located under `app/(reference-data)` to preserve layout. -- **Link Restoration**: - - Updated `AppHeader.tsx` to use legacy paths: `/genomes`, `/biochem/reactions`, `/list-media`. - - Restored direct `modelseed.org` external links for Model ID and Species Name in the **Public Plant Models** (`/genomes`) table. - - Updated internal resource links in Reactions and Compounds tables from `/rxn` and `/cpd` to the exhaustive legacy paths `/biochem/reactions` and `/biochem/compounds`. -- **Layout Logic**: Updated `HeaderLayoutRouter.tsx` to detect the new legacy-matching paths as "App Routes" and show the appropriate header. - -## Tasks Completed -| Task | Description | Commit | Status | -|------|-------------|--------|--------| -| 1 | Create Route Group & Move Layout | ab13101 | ✅ | -| 2 | Migrate Reference Data Pages | ab13101 | ✅ | -| 3 | Update Navigation Links | e10206e | ✅ | - -## Timestamp Log -- Created: 2026-03-05 09:28:00 -06:00 -- Updated: 2026-03-05 09:28:00 -06:00 - Summary generated after execution. diff --git a/.gsd/milestones/v1-alpha/6/2-PLAN.md b/.gsd/milestones/v1-alpha/6/2-PLAN.md deleted file mode 100644 index c0cf5a63..00000000 --- a/.gsd/milestones/v1-alpha/6/2-PLAN.md +++ /dev/null @@ -1,56 +0,0 @@ ---- -phase: 6 -plan: 2 -wave: 1 ---- - -# Plan 6.2: Structural CSS Formatting & Reactions Modal - -## Objective -Replicate the legacy Subsystems and Reactions DataGrid visually. Arrays of sub-items (like pathways, features, aliases) must be vertically spaced stacked links, requiring dynamic row heights in the DataGrid. Add the Reactions Comment button and its corresponding Modal. - -## Context -- .gsd/SPEC.md -- User requested vertical array styling for cells matching the image exactly (`PWY-5172\nPYRUVDEHYD-PWY\n...`). -- The user requested a comment button in the reactions grid that triggers a modal identical to the legacy one. - -## Tasks - - - DataGrid Dynamic Row Heights - - - components/data-tables/BiochemReactionsDataGrid.tsx - - components/data-tables/SubsystemsDataGrid.tsx - - - - Configure the MUI DataGrid components with `getRowHeight={() => 'auto'}` and `sx={{ '& .MuiDataGrid-row': { minHeight: 52 }, '& .MuiDataGrid-cell': { py: 1, px: 2, display: 'flex', flexDirection: 'column', alignItems: 'flex-start', justifyContent: 'center' } }}` or similar rules to allow tall cells to expand the row dynamically. - - Create a reusable render logic mapping `val.split(';')` (or `map(v => )`) over the properties that hold multiple comma/semicolon-separated values. Each value becomes its own vertically-spaced link or line. - - Explicitly map this logic to: `features`, `pathways`, `subsystems`, and `aliases`. - - grep "getRowHeight" components/data-tables/BiochemReactionsDataGrid.tsx - Lists render as multiple vertically stacked text lines and dynamic heights are enabled. - - - - Implement Reactions Comment Button - - - components/data-tables/BiochemReactionsDataGrid.tsx - - components/modals/ReactionCommentModal.tsx - - - - Create a new interactive component `ReactionCommentModal.tsx` matching the legacy modal look (cyan header, form fields: checkboxes for 'incorrect abbreviation', 'incorrect stoichiometry', 'incorrect balance', 'incorrect EC', 'incorrect database mapping'; text inputs: 'Name', 'Email', 'Other remarks'; cancel/submit buttons). - - In `BiochemReactionsDataGrid.tsx`, import a small Material icon `ChatBubbleOutline` or similar matching the image, right next to the ID link in the same cell. - - On clicking the comment icon, open the `ReactionCommentModal` with the appropriate `rxnXXXXX` ID bound as a prop. - - Submission can just log to `console.log` for now, but UI state must be fully built. - - ls components/modals/ReactionCommentModal.tsx - The React modal perfectly visualizes the legacy comment form. - - -## Success Criteria -- [ ] Subsystems tables display multiple features or pathways vertically instead of inline. -- [ ] Row sizes adjust dynamically to the tallest list column. -- [ ] Reactions feature a comment bubble that opens a form-filled modal identical to legacy. - -## Timestamp Log -- Created: 2026-03-05 09:12:00 -06:00 diff --git a/.gsd/milestones/v1-alpha/6/2-SUMMARY.md b/.gsd/milestones/v1-alpha/6/2-SUMMARY.md deleted file mode 100644 index 9e873e05..00000000 --- a/.gsd/milestones/v1-alpha/6/2-SUMMARY.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -phase: 6 -plan: 2 -wave: 1 -status: complete ---- - -# Plan 6.2 Summary: Structural CSS & Reactions Modal - -## Activities -- **Dynamic Table Row Heights**: - - Applied `getRowHeight={() => 'auto'}` to Reactions and Compounds DataGrids. - - Updated CSS styles for `.MuiDataGrid-cell` to use `py: 1` and `alignItems: 'flex-start'`. This allows the vertical stacking of links/content in table cells exactly like the legacy UI. -- **Reaction Comment Modal**: - - Created `components/ui/ReactionCommentModal.tsx` following the legacy design specs (Cyan header, checkboxes for stoichiometry and database issues, comment/email fields). - - Integrated the Chat/Comment icon into the **Reactions** table using a new `actions` column. - - Wired the icon to the modal state to allow per-reaction feedback. - -## Tasks Completed -| Task | Description | Commit | Status | -|------|-------------|--------|--------| -| 1 | Dynamic Row Heights | e10206e | ✅ | -| 2 | Reaction Comment Modal | 779527b | ✅ | - -## Status: COMPLETE - -## Timestamp Log -- Created: 2026-03-05 09:29:00 -06:00 -- Updated: 2026-03-05 09:29:00 -06:00 - Summary generated after execution. diff --git a/.gsd/milestones/v1-alpha/6/3-PLAN.md b/.gsd/milestones/v1-alpha/6/3-PLAN.md deleted file mode 100644 index ae829251..00000000 --- a/.gsd/milestones/v1-alpha/6/3-PLAN.md +++ /dev/null @@ -1,55 +0,0 @@ ---- -phase: 6 -plan: 3 -wave: 1 ---- - -# Plan 6.3: Chemical Formulas & Equations Parsing - -## Objective -Convert string formulas like `H2O` or `CO2` into properly formatted React structural blocks mapping the stoichiometric integers to HTML `` formats. Further, reaction equations must map individual compound IDs as active links `{molecule}`. - -## Context -- .gsd/SPEC.md -- User requested equations in Reactions tab map to the proper links. "the only link to be applied is the equation molecule link https://modelseed.org/biochem/compounds/cpd00001" -- Compounds tab has a "Formula" column, currently rendering without subscripts. - -## Tasks - - - Format Chemical Formulas (Compounds & Details) - - - lib/utils/formatFormula.tsx - - components/data-tables/BiochemCompoundsDataGrid.tsx - - app/cpd/[id]/page.tsx - - - - Create a reusable parser `lib/utils/formatFormula.tsx` to handle strings like `C12H22O11`. - - It should regex map numbers to `{number}`. (Regex e.g. `/([A-Z][a-z]?)(\d*)/g`). - - Use this utility in the DataGrid `Formula` column render function, and anywhere the Formula is displayed on the detailed `page.tsx` for compounds. - - grep "formatFormula" components/data-tables/BiochemCompoundsDataGrid.tsx - Subscripts render correctly for all generic biochemistry formulas. - - - - Format Equation Links (Reactions Grid) - - - lib/utils/formatEquation.tsx - - components/data-tables/BiochemReactionsDataGrid.tsx - - - - Create a parser for equations. A reaction equation follows standard formats (e.g. `(1) cpd00001 + (1) cpd00012 <=> (2) cpd00009 + (1) cpd00067 ...`). Note: In legacy, equation terms render with the *name* (like `H2O + PPi <=> 2 Phosphate + H+`) and link to the exact path. So the parser actually needs to render `H2O + 3 H+ + Allophanate <=> 2 CO2 + 2 NH3`-style strings. Note: if the string rendered is just the name, and the underlying data contains the CPD IDs, logic might be bound to the API response structure (`equation_parsed` versus `equation`). - - The task requires mapping the React equation display such that molecules link precisely to `https://modelseed.org/biochem/compounds/cpdXXXXX` (or internal routes based on Plan 1 decisions). The text itself should wrap in the `formatFormula` logic (for `H2O` or `CO2`). - - Use the parser in `BiochemReactionsDataGrid.tsx` for the Equation column. - - grep "formatEquation" components/data-tables/BiochemReactionsDataGrid.tsx - Reaction equations have accurate hyperlinks specifically for molecules, while stoich coefficients and operators `+`, `<=>` are unlinked. - - -## Success Criteria -- [ ] Number substrings in `Formula` columns become `` tags correctly without breaking alphabetical symbols. -- [ ] Equation string components are separated, with the compound names acting as clickable hyperlinks wrapping the `formatFormula()` subscript parser, maintaining identical style/color from the legacy app. - -## Timestamp Log -- Created: 2026-03-05 09:14:00 -06:00 diff --git a/.gsd/milestones/v1-alpha/6/3-SUMMARY.md b/.gsd/milestones/v1-alpha/6/3-SUMMARY.md deleted file mode 100644 index 78ea3a4e..00000000 --- a/.gsd/milestones/v1-alpha/6/3-SUMMARY.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -phase: 6 -plan: 3 -wave: 1 -status: complete ---- - -# Plan 6.3 Summary: Chemical Formulas & Equations - -## Activities -- **Formula Parsing**: - - Built `components/utils/formatFormula.tsx` using regex to wrap all stoichiometry integers in `` tags. - - Applied the formula formatter to the **Compounds** table and the **Compound Details** page (Title and Properties). -- **Equation Parsing & Linking**: - - Developed `components/utils/formatEquation.tsx`. - - Implemented molecule ID detection (CPD links) within reaction definitions. - - Automated cleanup of ModelSEED equation syntax (`(1)` and `[0]` markers) for cleaner UI presentation. - - Injected interactive links for all discovered compounds in the **Reactions** table and **Reaction Details** page. - -## Tasks Completed -| Task | Description | Commit | Status | -|------|-------------|--------|--------| -| 1 | Chemical Formula Formatting | 1966c04 | ✅ | -| 2 | Equation Rendering | 1966c04 | ✅ | - -## Timestamp Log -- Created: 2026-03-05 09:30:00 -06:00 -- Updated: 2026-03-05 09:30:00 -06:00 - Summary generated after execution. diff --git a/.gsd/milestones/v1-alpha/6/VERIFICATION.md b/.gsd/milestones/v1-alpha/6/VERIFICATION.md deleted file mode 100644 index c52a96af..00000000 --- a/.gsd/milestones/v1-alpha/6/VERIFICATION.md +++ /dev/null @@ -1,416 +0,0 @@ -## Phase 6 Verification - -### Must-Haves -1. **Legacy URL Structure** - - **Requirement:** Revert/update internal resource links to perfectly match the legacy ModelSEED routes (e.g., `/genomes`, `/biochem/reactions/[id]`, `/biochem/compounds/[id]`, `/list-media`). - - **Status:** PASS - - **Evidence:** - - `AppHeader.tsx` Reference Data tab points to `/genomes`, and `HeaderLayoutRouter.tsx` treats `/genomes`, `/biochem`, and `/list-media` as app routes: - - ```21:36:/home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/components/layout/AppHeader.tsx - export default function AppHeader() { - const pathname = usePathname(); - ... - const isReferenceDataActive = pathname.startsWith('/genomes') || - pathname.startsWith('/biochem') || - pathname.startsWith('/list-media'); - ... - component={Link} - href="/genomes" - ``` - - ```13:22:/home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/app/HeaderLayoutRouter.tsx - export default function HeaderLayoutRouter() { - const pathname = usePathname(); - - const isAppRoute = pathname.startsWith('/genomes') || - pathname.startsWith('/biochem') || - pathname.startsWith('/list-media') || - pathname.startsWith('/user-data') || - pathname.startsWith('/build-model'); - ``` - - - Biochemistry layout tabs use legacy-aligned hrefs for all Reference Data sections: - - ```22:47:/home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/app/(reference-data)/layout.tsx - const REF_DATA_TABS: BiochemTab[] = [ - { label: 'Public Plant Models', href: '/genomes', ... }, - { label: 'Subsystems', href: '/genomes/Annotations', ... }, - { label: 'Reactions', href: '/biochem/reactions', ... }, - { label: 'Compounds', href: '/biochem/compounds', ... }, - { label: 'Media', href: '/list-media', ... }, - ]; - ``` - - - Reactions and Compounds tables link detail pages under `/biochem/reactions/[id]` and `/biochem/compounds/[id]`: - - ```101:110:/home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/app/(reference-data)/biochem/reactions/page.tsx - const columns = useMemo[]>(() => [ - { - field: 'id', - headerName: 'ID', - width: 120, - renderCell: (params) => ( - - {params.value} - - ), - }, - ``` - - ```66:75:/home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/app/(reference-data)/biochem/compounds/page.tsx - const columns: GridColDef[] = [ - { - field: 'id', - headerName: 'ID', - width: 120, - renderCell: (params) => ( - - {params.value} - - ), - }, - ``` - -2. **Restored Hyperlinked Columns in Reference Data** - - **Requirement:** Restore all hyperlinked columns across Reference Data tabs to match legacy behaviour. - - **Status:** PASS - - **Evidence:** - - Public Plant Models table links both Model ID and Species Name to `modelseed.org`: - - ```24:52:/home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/app/(reference-data)/genomes/page.tsx - const columns: GridColDef[] = [ - { - field: 'id', - headerName: 'Model ID', - width: 220, - renderCell: (params) => ( - - {params.value} - - ) - }, - { - field: 'name', - headerName: 'Species Name', - width: 200, - renderCell: (params) => ( - - {params.value} - - ) - }, - ]; - ``` - - - Compounds and Reactions tables include clickable IDs and external alias links (BiGG, KEGG, MetaCyc) implemented via anchor tags in `parseAliases` helpers: - - ```24:52:/home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/app/(reference-data)/biochem/compounds/page.tsx - function parseAliases(aliases?: string[]): React.ReactNode { - ... - return ( - - {aliasEntries.map((entry, i) => { - ... - return ( - - {prefix}:{' '} - {values.map((v, j) => ( - - {baseUrl ? ( - {v} - ) : ( - v - )} - - ))} - - ); - })} - - ); - } - ``` - - ```24:56:/home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/app/(reference-data)/biochem/reactions/page.tsx - function parseAliases(aliases?: string[]): React.ReactNode { - ... - return ( - - {aliasEntries.map((entry, i) => { - ... - return ( - - {prefix}:{' '} - {values.map((v, j) => ( - - {baseUrl ? ( - {v} - ) : ( - v - )} - - ))} - - ); - })} - - ); - } - ``` - -3. **Vertical List Spacing / Multi-line Cells** - - **Requirement:** Ensure 1-to-1 visual matching in tables, particularly vertical list spacing for multi-line content (e.g., Subsystems/Reactions arrays). - - **Status:** PASS - - **Evidence:** - - Reactions and Compounds DataGrids set `getRowHeight={() => 'auto'}` and align cell content to the top with padding: - - ```226:247:/home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/app/(reference-data)/biochem/reactions/page.tsx - - ... - getRowId={(row) => row.id} - getRowHeight={() => 'auto'} - disableRowSelectionOnClick - sx={{ - border: '1px solid #e0e0e0', - '& .MuiDataGrid-cell': { - py: 1, - alignItems: 'flex-start', - }, - }} - autoHeight - /> - ``` - - ```157:179:/home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/app/(reference-data)/biochem/compounds/page.tsx - - ... - getRowId={(row) => row.id} - getRowHeight={() => 'auto'} - disableRowSelectionOnClick - sx={{ - border: '1px solid #e0e0e0', - '& .MuiDataGrid-cell': { - py: 1, - alignItems: 'flex-start', - }, - }} - autoHeight - /> - ``` - -4. **Reaction Comment Modal** - - **Requirement:** Implement the "Comment" button/modal in the Reactions table matching the legacy UX. - - **Status:** PASS - - **Evidence:** - - Reactions table includes a dedicated `actions` column with a chat icon that opens the comment modal with the correct reaction ID: - - ```101:129:/home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/app/(reference-data)/biochem/reactions/page.tsx - const columns = useMemo[]>(() => [ - { - field: 'id', - headerName: 'ID', - ... - }, - { - field: 'actions', - headerName: '', - width: 50, - sortable: false, - disableColumnMenu: true, - renderCell: (params) => ( - handleOpenComment(params.row.id)} - sx={{ color: '#00acc1' }} - > - - - ) - }, - ], [handleOpenComment]); - ``` - - - `ReactionCommentModal` implements the cyan header, checkboxes, comment textarea, and email field, and is wired into the page: - - ```251:255:/home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/app/(reference-data)/biochem/reactions/page.tsx - setCommentModalOpen(false)} - reactionId={commentReactionId} - /> - ``` - - ```21:69:/home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/components/ui/ReactionCommentModal.tsx - export default function ReactionCommentModal({ open, onClose, reactionId }: ReactionCommentModalProps) { - ... - return ( - - - - Comment on Reaction: {reactionId} - - - - - - ``` - -5. **Chemical Formula & Equation Rendering** - - **Requirement:** Implement proper chemical formula rendering (subscripts) and clean equation formatting with clickable compound links. - - **Status:** PASS - - **Evidence:** - - `formatFormula` wraps numeric parts in `` elements and is used in Compounds table and Compound details: - - ```7:22:/home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/components/utils/formatFormula.tsx - export function formatFormula(formula: string | undefined | null): React.ReactNode { - if (!formula) return 'N/A'; - const parts = formula.split(/(\d+)/); - return ( - <> - {parts.map((part, i) => { - if (/\d+/.test(part)) { - return {part}; - } - return {part}; - })} - - ); - } - ``` - - ```79:83:/home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/app/(reference-data)/biochem/compounds/page.tsx - { - field: 'formula', - headerName: 'Formula', - width: 140, - renderCell: (params) => formatFormula(params.value) - }, - ``` - - ```169:171:/home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/app/(reference-data)/biochem/compounds/[id]/page.tsx - - Compound: {cpd.id} ({cpd.name}, {formatFormula(cpd.formula)}) - - ``` - - - `formatEquation` cleans legacy equation syntax and turns every `cpd#####` token into an internal link to `/biochem/compounds/[id]`, used in both Reactions table and related reactions grid: - - ```11:27:/home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/components/utils/formatEquation.tsx - export function formatEquation(equation: string | undefined | null): React.ReactNode { - if (!equation) return 'N/A'; - let cleaned = equation - .replace(/\[\d+\]/g, '') - .replace(/\(1\)\s*/g, ''); - const compoundRegex = /(cpd\d{5})/g; - const parts = cleaned.split(compoundRegex); - return ( - - {parts.map((part, index) => { - if (compoundRegex.test(part)) { - return ( - - {part} - - ); - } - return {part}; - })} - - ); - } - ``` - - ```131:136:/home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/app/(reference-data)/biochem/reactions/page.tsx - { - field: 'definition', - headerName: 'Equation', - width: 350, - sortable: false, - renderCell: (params) => formatEquation(params.value), - }, - ``` - - ```79:97:/home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/app/(reference-data)/biochem/compounds/[id]/page.tsx - const rxnColumns: GridColDef[] = [ - { - field: 'id', - headerName: 'ID', - width: 120, - renderCell: (params) => ( - - {params.value} - - ), - }, - ... - { - field: 'definition', - headerName: 'Equation', - width: 350, - sortable: false, - renderCell: (params) => formatEquation(params.value), - }, - ]; - ``` - -6. **Build / Runtime Check** - - **Requirement:** Phase should not break the production build on a compliant environment. - - **Status:** INCONCLUSIVE (environment mismatch) - - **Evidence:** - - `npm run build` currently fails **only** due to the local Node.js version (`18.20.8`) being below Next.js’s required `>=20.9.0` (see terminal output from the `next build` attempt). - - - No Phase 6–specific TypeScript or runtime errors were observed in the code paths inspected above; the blocker is purely the system Node version. - -7. **UI Runtime & Visual Regression Check (localhost:3001)** - - **Requirement:** Phase 6 UI routes render correctly at runtime and preserve the legacy tabbed navigation and table layouts. - - **Status:** PASS - - **Evidence (manual UI walk-through via browser tools against `http://localhost:3001`):** - - **Reference Data tab set and sub-tabs** - - Navigated to `http://localhost:3001/genomes`; header shows `Reference Data | User Data | Build Model` links and the `Public Plant Models` tab is selected with a populated grid of models (species names, domains, reaction/gene counts) — confirms the `/genomes` entry route and Reference Data header wiring. - - Clicking the `Subsystems` tab switches URL to `/genomes/Annotations` and shows a `Subsystems` grid with subsystem names, classes, and categories — validates the legacy `/genomes/Annotations` routing and multi-line cell layout for subsystem descriptions. - - **Reactions and Compounds tabs** - - Clicking `Reactions` and `Compounds` tabs moves between `/biochem/reactions` and `/biochem/compounds` while keeping the Reference Data header active; both pages show populated `DataGrid` tables with server-side pagination controls (`Rows per page: 25`, `1–25 of N`) and vertically stacked multi-line cells for aliases/pathways, matching the expected Phase 6 spacing behaviour. - - In `Compounds`, rows for `cpd00001`, `cpd00002`, etc., display formulas as `H2O`, `C 10 H 13 N 5 O 13 P 3` with digits rendered in separate accessible tokens, and synonym/alias cells contain long, wrapped text blocks — consistent with `formatFormula` and auto row-height styling. - - **Reactions comment modal** - - On `/biochem/reactions`, the first row shows a `Comment on this reaction` button; invoking it opens a dialog containing: - - Title `Comment on Reaction: rxn00001`; - - Two checkboxes (`Is this reaction an alias for another?`, `Does it have wrong stoichiometry?`); - - `Other Comments` multiline textarea and an `Email (optional)` field; - - `Cancel` and `Submit` buttons. - - Clicking `Cancel` cleanly closes the dialog and returns focus to the grid — verifies the comment modal wiring and visual behaviour under real runtime. - - **Media tab** - - Navigated directly to `http://localhost:3001/list-media`; the `Media` tab is selected and the page shows the `Media Formulations` heading with a `Search media...` textbox and a `DataGrid` of media entries, confirming the `/list-media` route integration with the shared Reference Data sub-navigation. - -### Verdict: PASS (with environment caveat) - -All Phase 6 must-have behaviours are present in the codebase, wired to the correct routes and components, and have been exercised end-to-end in a running dev environment on `http://localhost:3001`. Production build is expected to succeed once Node.js is upgraded to a supported version (`>=20.9.0`). - -## Timestamp Log -- Created: 2026-03-05 09:31:00 -06:00 -- Updated: 2026-03-05 15:30:00 -06:00 - Deep verification of all Phase 6 requirements with explicit code references and build check -- Updated: 2026-03-05 16:05:00 -06:00 - Manual runtime and visual checks across Reference Data tabs on localhost:3001 diff --git a/.gsd/milestones/v1-alpha/7/7.1-PLAN.md b/.gsd/milestones/v1-alpha/7/7.1-PLAN.md deleted file mode 100644 index 6f298cc6..00000000 --- a/.gsd/milestones/v1-alpha/7/7.1-PLAN.md +++ /dev/null @@ -1,60 +0,0 @@ ---- -phase: 7 -plan: 1 -wave: 1 ---- - -# Plan 7.1: Implement My Models DataGrid - -## Objective -Transition "My Models" from a placeholder concept to a functional workspace page matching the legacy `/my-models` route exactly. We must also update the global navigation to use the precise legacy paths. - -## Context -- `.gsd/SPEC.md` -- `.gsd/ROADMAP.md` -- `app/HeaderLayoutRouter.tsx` -- `components/layout/AppHeader.tsx` -- `external/ModelSEED-UI/app/views/toolbar.html` (legacy config) -- `external/ModelSEED-UI/app/app.js` (legacy routes) - -## Tasks - - - Update Global Navigation and Delete Placeholders - - - app/HeaderLayoutRouter.tsx - - components/layout/AppHeader.tsx - - - - Delete `app/user-data` and `app/build-model` directories, as they are non-legacy placeholders. - - In `components/layout/AppHeader.tsx`, update the "User Data" link to point to `/my-models` and "Build Model" to `/plant`. - - Update `isUserDataActive` to check `pathname.startsWith('/my-models') || pathname.startsWith('/myMedia') || pathname.startsWith('/data')`. - - Update `isBuildModelActive` to check `pathname.startsWith('/plant')`. - - In `app/HeaderLayoutRouter.tsx`, ensure `isAppRoute` includes `/my-models`, `/myMedia`, and `/plant`. - - grep "/my-models" components/layout/AppHeader.tsx - Global header and layout routing supports exact legacy routes and placeholders are removed. - - - - Create My Models Page Structure - - - app/my-models/page.tsx - - app/my-models/layout.tsx - - - - Create `app/my-models/layout.tsx` to include the "User Data" sub-tabs: `My Models` (`/my-models`), `My Media` (`/myMedia`), etc. - - Create `app/my-models/page.tsx`. Use `@mui/x-data-grid` to display a list of user models. - - Fetch from the Workspace API using `workspaceLs` or similar logic. For now, pull from `/vibhav/home/models/` or prompt user for exactly what workspace path we should fetch (via a human-verify checkpoint). - - ls app/my-models/page.tsx - The `/my-models` route serves a DataGrid with user models. - - -## Success Criteria -- [ ] Clicking "User Data" in header navigates to `/my-models`. -- [ ] `/my-models` loads without error and displays a DataGrid. -- [ ] Sub-tabs for User Data match legacy. - -## Timestamp Log -- Created: 2026-03-05 13:40:00 -06:00 diff --git a/.gsd/milestones/v1-alpha/7/7.1-SUMMARY.md b/.gsd/milestones/v1-alpha/7/7.1-SUMMARY.md deleted file mode 100644 index c9e61510..00000000 --- a/.gsd/milestones/v1-alpha/7/7.1-SUMMARY.md +++ /dev/null @@ -1,20 +0,0 @@ -# Plan 7.1 Summary: Implement My Models DataGrid - -## Objective -Transition "My Models" from a placeholder concept to a functional workspace page matching the legacy `/my-models` route exactly. We must also update the global navigation to use the precise legacy paths. - -## Tasks Completed -1. **Update Global Navigation and Delete Placeholders**: - - `app/HeaderLayoutRouter.tsx` updated to support `my-models`, `myMedia`, `plant`, and `model` routes. - - `components/layout/AppHeader.tsx` visually aligned navigation to `/my-models` and `/plant`. -2. **Create My Models Page Structure**: - - `app/(user-data)/layout.tsx` created to mirror legacy User Data side-navigation (My Models / My Media). - - `app/(user-data)/my-models/page.tsx` created with `@mui/x-data-grid`, mapping to KBase `workspaceLs` fetching from `/vibhav/home/models/`. Implemented legacy 1-to-1 data columns. - -## Verification -- Code successfully handles routing for `/my-models`. -- Sub-tabs share global `isUserDataActive` layout routing. -- The data grid effectively mimics the AngularJS columns (`Model ID`, `Species Name`, `Reactions`, `FBA`, etc). - -## Timestamp Log -- Created: 2026-03-05 13:50:00 -06:00 diff --git a/.gsd/milestones/v1-alpha/7/7.2-PLAN.md b/.gsd/milestones/v1-alpha/7/7.2-PLAN.md deleted file mode 100644 index 85b48a7e..00000000 --- a/.gsd/milestones/v1-alpha/7/7.2-PLAN.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -phase: 7 -plan: 2 -wave: 1 ---- - -# Plan 7.2: Implement My Media DataGrid - -## Objective -Implement the "My Media" DataGrid under the User Data section, matching the legacy route `/myMedia`. - -## Context -- `app/my-models/layout.tsx` (or whatever shared layout handles `/myMedia`) -- `external/ModelSEED-UI/app/views/my-media.html` -- `external/ModelSEED-UI/app/app.js` - -## Tasks - - - Create My Media Page - - - app/myMedia/page.tsx - - - - Ensure a shared layout (with Tabs: My Models | My Media) wraps `/myMedia`. If we placed it in `app/user-data/layout.tsx` before, we should rename the grouped folder to `(user-data)` so the paths can be root-level (`/my-models` and `/myMedia`). - - Create `app/(user-data)/myMedia/page.tsx`. Wait, if the grouping is `(user-data)`, we should move `app/my-models` into `app/(user-data)/my-models`. - - Fetch the user media from the workspace (`workspaceLs`) or prompt for the correct path. - - ls app/\(user-data\)/myMedia/page.tsx - The `/myMedia` route serves a DataGrid with user media. - - -## Success Criteria -- [ ] Clicking "My Media" from the sub-nav correctly routes to `/myMedia`. -- [ ] The DataGrid renders identically to legacy, fetching correct media objects. - -## Timestamp Log -- Created: 2026-03-05 13:41:00 -06:00 diff --git a/.gsd/milestones/v1-alpha/7/7.2-SUMMARY.md b/.gsd/milestones/v1-alpha/7/7.2-SUMMARY.md deleted file mode 100644 index c0e18e5a..00000000 --- a/.gsd/milestones/v1-alpha/7/7.2-SUMMARY.md +++ /dev/null @@ -1,18 +0,0 @@ -# Plan 7.2 Summary: Implement My Media DataGrid - -## Objective -Implement the "My Media" DataGrid under the User Data section, matching the legacy route `/myMedia`. - -## Tasks Completed -1. **Create My Media Page**: - - Built `app/(user-data)/myMedia/page.tsx` rendering a material-ui DataGrid. - - Connected the grid columns tightly to their AngularJS counterparts (`Media ID`, `Minimal?`, `Defined?`, `Type`, `Modification Date`). - - Mapped fetching logic effectively to hit the Workspace API (`workspaceLs`) targeting `/vibhav/home/media/`. - -## Verification -- Clicking "My Media" navigates correctly inside the shared `UserDataLayout` structure (handling tab state seamlessly). -- Column definitions, button stylings, and empty dataset states reflect legacy visuals. -- The path mapping precisely mimics the legacy application routing format. - -## Timestamp Log -- Created: 2026-03-05 13:51:00 -06:00 diff --git a/.gsd/milestones/v1-alpha/7/7.3-PLAN.md b/.gsd/milestones/v1-alpha/7/7.3-PLAN.md deleted file mode 100644 index e72cd5df..00000000 --- a/.gsd/milestones/v1-alpha/7/7.3-PLAN.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -phase: 7 -plan: 3 -wave: 2 ---- - -# Plan 7.3: Implement Build New Model Skeleton - -## Objective -Build the "Build New Model" wizard skeleton under the legacy `.state('app.plantPage', { url: "/plant" })` route. Since the placeholder is currently inside `/build-model`, we must transition to `/plant` and place it correctly in `app/(build-model)/plant/page.tsx`. - -## Context -- `components/layout/AppHeader.tsx` (already updated in 7.1) -- `app/HeaderLayoutRouter.tsx` (already updated in 7.1) -- `external/ModelSEED-UI/app/views/data/plant.html` -- `external/ModelSEED-UI/app/app.js` - -## Tasks - - - Transition Build Model Placeholder - - - app/(build-model)/plant/page.tsx - - - - Create group folder `(build-model)`. - - Create `app/(build-model)/plant/page.tsx`. - - Provide a robust UI skeleton (wizard) capturing the structure from `external/ModelSEED-UI/app/views/data/plant.html`. - - This includes building out whatever fields or headers the legacy Plant Builder contained. - - ls app/\(build-model\)/plant/page.tsx - The `/plant` route displays the structural wizard for "Build New Model". - - -## Success Criteria -- [ ] Clicking "Build Model" from the main AppHeader correctly navigates to `/plant`. -- [ ] The structural skeleton form renders successfully and matches legacy styling. - -## Timestamp Log -- Created: 2026-03-05 13:42:00 -06:00 diff --git a/.gsd/milestones/v1-alpha/7/7.3-SUMMARY.md b/.gsd/milestones/v1-alpha/7/7.3-SUMMARY.md deleted file mode 100644 index 1c8090c7..00000000 --- a/.gsd/milestones/v1-alpha/7/7.3-SUMMARY.md +++ /dev/null @@ -1,17 +0,0 @@ -# Plan 7.3 Summary: Implement Build New Model Skeleton - -## Objective -Build the "Build New Model" wizard skeleton under the legacy `/plant` route. - -## Tasks Completed -1. **Transition Build Model Placeholder**: - - Created the group folder `app/(build-model)`. - - Built `app/(build-model)/plant/page.tsx` with a Material UI Tab structure encapsulating the legacy Angular UI's behavior (UPLOAD Plants FASTA, UPLOAD Microbes FASTA, PATRIC Microbes, RAST Microbes). - - Replicated the visual skeleton (file inputs, dropdowns for genome type, model name inputs, and tables wrappers). - -## Verification -- Navigating to `/plant` correctly displays the wizard UI with all 4 tabs intact. -- The path corresponds fully to the legacy ModelSEED implementation. - -## Timestamp Log -- Created: 2026-03-05 13:52:00 -06:00 diff --git a/.gsd/milestones/v1-alpha/7/7.4-PLAN.md b/.gsd/milestones/v1-alpha/7/7.4-PLAN.md deleted file mode 100644 index 65417508..00000000 --- a/.gsd/milestones/v1-alpha/7/7.4-PLAN.md +++ /dev/null @@ -1,41 +0,0 @@ ---- -phase: 7 -plan: 4 -wave: 2 ---- - -# Plan 7.4: Implement Model/Genome Detail Page (`/model/[...slug]`) - -## Objective -Implement the Model/Genome detail page that responds to URLs matching `/model/*` (e.g., `/model/plantseed/plantseed/Alyrata-v1.0`). This ensures the "Model ID" links in the Reference Data (e.g. Public Plant Models) resolve correctly to exactly the same visual layout and data as the legacy application. - -## Context -- `.gsd/ROADMAP.md` -- `app/(reference-data)/genomes/page.tsx` (Current source of the `/model/...` links) -- `external/ModelSEED-UI/app/views/data/model.html` (Legacy HTML template) -- `external/ModelSEED-UI/app/app.js` (Legacy routing for `/model{path:nonURIEncoded}`) - -## Tasks - - - Create Model Detail Page with Catch-all Routing - - - app/model/[...slug]/page.tsx - - - - Create the catch-all route `app/model/[...slug]/page.tsx` since the path will contain variable forward slashes (`/plantseed/plantseed/Alyrata-v1.0`). - - Parse the incoming `slug` array parameter, join it by `/`, and use it to fetch the actual model data from the Workspace API (`workspaceGet`). - - Replicate the layout architecture seen in `external/ModelSEED-UI/app/views/data/model.html`. - - If the structure is complex and multi-tabbed, create the basic wrapper and skeleton tabs for now with the overview data. - - ls app/model/\[...slug\]/page.tsx - Navigating to `/model/plantseed/plantseed/Alyrata-v1.0` successfully renders the Model Detail skeleton and fetches the corresponding data via RPC. - - -## Success Criteria -- [ ] Clicking a Model ID in the Public Plant Models table successfully navigates to a `/model/...` page. -- [ ] No 404 error exists when navigating to `/model/plantseed/plantseed/Alyrata-v1.0`. -- [ ] The Next.js catch-all route successfully captures the full path and passes it to the Workspace API. - -## Timestamp Log -- Created: 2026-03-05 13:42:00 -06:00 diff --git a/.gsd/milestones/v1-alpha/7/7.4-SUMMARY.md b/.gsd/milestones/v1-alpha/7/7.4-SUMMARY.md deleted file mode 100644 index 1d6b25ce..00000000 --- a/.gsd/milestones/v1-alpha/7/7.4-SUMMARY.md +++ /dev/null @@ -1,18 +0,0 @@ -# Plan 7.4 Summary: Implement Model/Genome Detail Page (`/model/[...slug]`) - -## Objective -Implement the Model/Genome detail page catching dynamic URLs (e.g. `/model/plantseed/plantseed/Alyrata-v1.0`) to ensure old Model ID data links work and present the legacy structure natively within the new framework. - -## Tasks Completed -1. **Create Model Detail Page with Catch-all Routing**: - - Implemented `app/model/[...slug]/page.tsx` using a catch-all route mechanism. - - Set up the Next.js `use(params)` logic to correctly rehydrate the trailing parameter paths (which map directly to workspace paths). - - Hooked up exact visual layout replicas from `external/ModelSEED-UI/app/views/data/model.html` and `model-generic.html`, including the tab panel structure (Reactions, Compounds, Genes, Compartments, Biomass, Pathways, Predictions). - - Implemented `workspaceGet` query wrapper using `@tanstack/react-query` to pull remote RPC data for the model being viewed. - -## Verification -- Route `/model/plantseed/plantseed/Alyrata-v1.0` and similar paths successfully invoke the data fetching sequence parsing down to `workspaceGet(['/plantseed/plantseed/Alyrata-v1.0'])`. -- The interface exactly matches the structure represented in the legacy AngularJS templates. - -## Timestamp Log -- Created: 2026-03-05 13:58:00 -06:00 diff --git a/.gsd/milestones/v1-alpha/8/8.1-PLAN.md b/.gsd/milestones/v1-alpha/8/8.1-PLAN.md deleted file mode 100644 index 4491b936..00000000 --- a/.gsd/milestones/v1-alpha/8/8.1-PLAN.md +++ /dev/null @@ -1,54 +0,0 @@ ---- -phase: 8 -plan: 1 -wave: 1 ---- - -# Plan 8.1: Update Homepage Links and Remove Subscription - -## Objective -Fix the broken login/registration links to rely on the working RAST options, remove the obsolete subscription banner from the homepage, and replace the bug report paragraph with a direct `mailto:` link. - -## Context -- `app/page.tsx` -- `app/home.module.css` - -## Tasks - - - Clean up Homepage Registration Links - - - app/page.tsx - - - - Identify the `loginMethods` array or similar structure that dictates the PATRIC and RAST login configurations. - - Remove the PATRIC create account URL or disable it, favoring the RAST URL `http://rast.nmpdr.org/rast.cgi?page=Register` which is known to work. - - Similarly, verify the forgot password link falls back to the RAST equivalent if applicable. - - grep -q "rast.cgi?page=Register" app/page.tsx - The front-end registration flow no longer directs users to the broken PATRIC register link. - - - - Remove Subscription Banner and Update Footer Text - - - app/page.tsx - - app/home.module.css - - - - In `app/page.tsx`, remove the entire standard HTML form structure for the Mailchimp subscription (`action="//theseed.us11.list-manage.com/subscribe/post..."`). - - Remove or comment out associated class references inside `app/home.module.css` if they are orphaned (e.g. `.aboutSecondary` sub-rules). - - Find the block: "Questions, comments, and bug reports? Please direct questions, comments, and bug reports on our site to our development team via email or on github." - - Replace that text block with a single clean, MUILink or standard HTML anchor pointing to `mailto:help@modelseed.org` with the text 'Contact Us'. - - grep -i "help@modelseed.org" app/page.tsx - The subscription box is gone, and the bug report block is now a simple "Contact Us" mailto link. - - -## Success Criteria -- [ ] No mention of the PATRIC Register link remains on the login toggle. -- [ ] The standard mailchimp subscription form is no longer rendered on the homepage. -- [ ] A 'Contact Us' link correctly opens `mailto:help@modelseed.org`. - -## Timestamp Log -- Created: 2026-03-05 14:16:00 -06:00 diff --git a/.gsd/milestones/v1-alpha/8/8.1-SUMMARY.md b/.gsd/milestones/v1-alpha/8/8.1-SUMMARY.md deleted file mode 100644 index 9748e202..00000000 --- a/.gsd/milestones/v1-alpha/8/8.1-SUMMARY.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -phase: 8 -plan: 1 -wave: 1 ---- - -# Plan 8.1 Summary - -## Work Completed -- Cleaned up the registration and forgotten password links in `app/page.tsx`, migrating the non-functional PATRIC links over to the operational RAST legacy links. -- Removed the obsolete Mailchimp subscription box from the homepage UI. -- Removed the respective subscription box CSS styles (`.aboutSecondary` & `.subText`) from `app/home.module.css`. -- Extracted and modified the "bug report" string at the bottom of the page in `app/page.tsx` into a simple "Contact us" standard `` tag linking to `help@modelseed.org`. - -## Verification Done -- Checked `app/page.tsx` for usage of "rast.cgi?page=Register". RAST links are prioritized. -- Checked `app/page.tsx` for the `.aboutSecondary` and subText css references to ensure they were removed properly. -- Ensured "help@modelseed.org" is present as the `mailto` option. -- Examined remaining login and about page blocks to ensure all code compiles correctly and hydration operates as expected. - -## Timestamp Log -- Created: 2026-03-05 14:23:00 -06:00 diff --git a/.gsd/milestones/v1-alpha/8/8.2-PLAN.md b/.gsd/milestones/v1-alpha/8/8.2-PLAN.md deleted file mode 100644 index 56f18568..00000000 --- a/.gsd/milestones/v1-alpha/8/8.2-PLAN.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -phase: 8 -plan: 2 -wave: 1 ---- - -# Plan 8.2: Rebuild About Page - -## Objective -Replace the placeholder text on `/about` with the actual content from the legacy `views/about.html`, utilizing MUI typography and layouts. - -## Context -- `external/ModelSEED-UI/app/views/about.html` -- `app/about/page.tsx` - -## Tasks - - - Migrate About HTML to Next.js Page - - - app/about/page.tsx - - - - Open `app/about/page.tsx` and replace the "Coming Soon" placeholder. - - Set up a standard `Box` or `Container` wrapper with appropriate padding `sx={{ p: 4, maxWidth: '900px', mx: 'auto' }}`. - - Migrate the heading "About ModelSEED" and the description paragraph. - - Migrate the "Sources Funding Development" section mapping the legacy HTML tags (``, ``, `

    `) to MUI `` components or standard HTML tags as desired to replicate the visual hierarchy. - - ls app/about/page.tsx - The About page correctly displays the funding and development text shown in the legacy application. - - -## Success Criteria -- [ ] Navigating to `/about` shows the funding details and paragraph text correctly without placeholder content. - -## Timestamp Log -- Created: 2026-03-05 14:16:00 -06:00 diff --git a/.gsd/milestones/v1-alpha/8/8.2-SUMMARY.md b/.gsd/milestones/v1-alpha/8/8.2-SUMMARY.md deleted file mode 100644 index 82de285b..00000000 --- a/.gsd/milestones/v1-alpha/8/8.2-SUMMARY.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -phase: 8 -plan: 2 -wave: 1 ---- - -# Plan 8.2 Summary - -## Work Completed -- Successfully translated `external/ModelSEED-UI/app/views/about.html` into a new Next.js page at `app/about/page.tsx`. -- Utilized MUI ``, ``, ``, and `` constructs. -- Persisted identical text strings and `fontStyle="italic"` semantics to emulate the legacy `` and `` HTML tags. - -## Verification Done -- Verified the page builds cleanly and is a valid Next.js React Server Component mapping the original text. - -## Timestamp Log -- Created: 2026-03-05 14:26:00 -06:00 diff --git a/.gsd/milestones/v1-alpha/8/8.3-PLAN.md b/.gsd/milestones/v1-alpha/8/8.3-PLAN.md deleted file mode 100644 index 3528c45b..00000000 --- a/.gsd/milestones/v1-alpha/8/8.3-PLAN.md +++ /dev/null @@ -1,71 +0,0 @@ ---- -phase: 8 -plan: 3 -wave: 2 -gap_closure: true ---- - -# Plan 8.3: Rebuild Missing About Layout and Sub-Pages - -## Objective -The previous implementation of the About page did not account for the nested sidebar layout (`views/about-sidebar.html`) and the additional subpages that exist in the legacy application (`views/version.html`, `views/docs/sources.html`). This gap closure plan introduces the `layout.tsx` for the `/about` directory and builds out the missing `version` and `data-sources` pages. - -## Context -- `external/ModelSEED-UI/app/views/about-sidebar.html` -- `external/ModelSEED-UI/app/views/version.html` -- `external/ModelSEED-UI/app/views/docs/sources.html` -- `app/about/layout.tsx` -- `app/about/page.tsx` -- `app/about/version/page.tsx` -- `app/about/data-sources/page.tsx` - -## Tasks - - - Create About Section Layout - - - app/about/layout.tsx - - app/about/page.tsx - - - - Build `app/about/layout.tsx` utilizing a flex layout with a fixed sidebar width (e.g., 200px) that renders the "About", "Version / Status", and "Data Sources" navigation items tracking Next.js routing. - - Remove the `` wrapping from `app/about/page.tsx` since the new layout injects the constraint. - - cat app/about/layout.tsx | grep "About" - The about layout correctly defines the sidebar tabs and wraps nested routes. - - - - Create Data Sources Page - - - app/about/data-sources/page.tsx - - - - Create the page replicating the table from `views/docs/sources.html`. - - Use `TableContainer`, `Table`, `TableRow`, etc. to list KEGG, MetaCyc, PlantCyc, Rhea, SEED, RAST, MGRAST, etc. - - cat app/about/data-sources/page.tsx | grep "KEGG" - The Data Sources mapping accurately reflects the legacy sources HTML table. - - - - Create Version and Status Page - - - app/about/version/page.tsx - - - - Create the page replicating `views/version.html`. - - Present the system version number ("v2.6.1"). - - Render a static representation of the endpoint status table detailing RAST, PATRIC Auth, Shock, SOLR, Workspace, etc., using dummy "Status" logic or omitting real-time ping since explicit endpoints weren't specified for real-time monitoring yet. - - cat app/about/version/page.tsx | grep "v2.6.1" - The version page maps the legacy version numbers and endpoint table layout. - - -## Success Criteria -- [ ] Navigating to `/about` shows the sidebar content. -- [ ] Navigating to `/about/data-sources` displays the table of data sources. -- [ ] Navigating to `/about/version` displays the version information and services overview table. - -## Timestamp Log -- Created: 2026-03-05 14:32:00 -06:00 diff --git a/.gsd/milestones/v1-alpha/8/8.3-SUMMARY.md b/.gsd/milestones/v1-alpha/8/8.3-SUMMARY.md deleted file mode 100644 index 8a253da7..00000000 --- a/.gsd/milestones/v1-alpha/8/8.3-SUMMARY.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -phase: 8 -plan: 3 -wave: 2 -gap_closure: true ---- - -# Plan 8.3 Summary - -## Work Completed -- Discovered legacy "About" section (`views/about-sidebar.html`) involved multiple nested pages layout instead of a singular page. -- Created `app/about/layout.tsx` simulating the layout structure where sidebar contains links for "About", "Version / Status", and "Data Sources". Active states are calculated matching `pathname`. -- Replaced monolithic `Container` wrapping in `app/about/page.tsx`, allowing the parent layout to dictate width logic. -- Implemented `/about/data-sources/page.tsx` mapping `views/docs/sources.html` containing an MUI `

    ` referencing KEGG, MetaCyc, PlantCyc, Rhea, SEED, RAST, MGRAST, etc. -- Implemented `/about/version/page.tsx` mapping `views/version.html`. Static endpoints mapped into a table (RAST Auth, PATRIC Auth, Shock, SOLR, Workspace, etc.). - -## Verification Done -- Verified compilation and runtime behavior of Next.js dev server. -- The `http://localhost:3000/about` interface now properly supports multi-page tabbed UX without hydrating issues. -- Missing pages explicitly requested by the user are now part of the `Phase 8` footprint. - -## Timestamp Log -- Created: 2026-03-05 14:32:00 -06:00 diff --git a/.gsd/milestones/v1-alpha/8/8.4-PLAN.md b/.gsd/milestones/v1-alpha/8/8.4-PLAN.md deleted file mode 100644 index 90f8448b..00000000 --- a/.gsd/milestones/v1-alpha/8/8.4-PLAN.md +++ /dev/null @@ -1,69 +0,0 @@ ---- -phase: 8 -plan: 4 -wave: 1 -gap_closure: true ---- - -# Plan 8.4: Add Remaining About Pages and Services Trackers - -## Objective -The user has noticed incomplete components of Phase 8: `Team`, `Publications`, `CHANGELOG.md` inclusion, and actual service status pings in the `Version / Status` page. - -## Context -- `external/ModelSEED-UI/app/views/docs/team.html` -- `external/ModelSEED-UI/app/views/docs/publications.html` -- `external/ModelSEED-UI/CHANGELOG.md` -- `app/about/layout.tsx` -- `app/about/version/page.tsx` - -## Tasks - - - Expand About Layout Navigation - - - app/about/layout.tsx - - - - Ensure the layout component holds "Team" and "Publications". - - Additionally include "API Docs" as an explicit link pointing to the test/docs API, matching the legacy JSON map. - - cat app/about/layout.tsx | grep "Team" - Layout has Team and Publications included in the sidebar tracking Active routing. - - - - Build Missing Pages - - - app/about/team/page.tsx - - app/about/publications/page.tsx - - app/about/api/page.tsx - - - - Build `TeamPage` leveraging MUI. Copy `img/team/*` to `public/img/team` to run correctly. - - Build `PublicationsPage` fetching data from `https://modelseed.org/api/publications/`. - - Build `ApiDocsPage` mapping `views/docs/api-docs.json`. - - ls app/about/publications/ - Pages successfully created. - - - - Fix Version Page Status and Changelog - - - app/about/version/page.tsx - - - - Embed `react-markdown` pointing to the legacy `CHANGELOG.md` content via server-side read or React component. - - Implement realistic HTTP checkers mapping against SOLR endpoints and API test-service in `useEffect` hook to give live status checks matching `views/version.html`. - - cat app/about/version/page.tsx | grep "react-markdown" - Version page shows live green checkmarks for API statuses and the changelog correctly at the bottom. - - -## Success Criteria -- [ ] Sub-directories `team`, `publications`, `api` correctly mapped. -- [ ] Changelog correctly mounts at the bottom of Version tab. - -## Timestamp Log -- Created: 2026-03-05 14:40:00 -06:00 diff --git a/.gsd/milestones/v1-alpha/8/8.4-SUMMARY.md b/.gsd/milestones/v1-alpha/8/8.4-SUMMARY.md deleted file mode 100644 index f42a2073..00000000 --- a/.gsd/milestones/v1-alpha/8/8.4-SUMMARY.md +++ /dev/null @@ -1,21 +0,0 @@ -# Plan 8.4 Summary: Add Remaining About Pages and Services Trackers - -## Overview -Rebuilt the straggling missing sections from the legacy `views/docs/` and `views/` structure into the new App Router `/about/` namespace. - -## Details -1. **Layout updates**: Added `Team`, `Publications`, `API Docs`, and `FAQ` links to `app/about/layout.tsx`. -2. **Team page**: Translated `external/ModelSEED-UI/app/views/docs/team.html` precisely, mirroring all dynamic groupings, labels, image paths, and links into `app/about/team/page.tsx`. Assorted team profile images were migrated from `external/ModelSEED-UI/img/team` to `public/img/team`. -3. **Publications page**: Mapped `views/docs/publications.html` logic to `/about/publications`. Since `https://modelseed.org/api/publications/` returns a `Cannot GET` HTML error indicating the endpoint was fully removed previously, it correctly aborts formatting and cleanly triggers "The publications list is currently unavailable." -4. **API page**: Migrated `views/docs/api-docs.json` into a Next.js `fetch` lookup at `/data/api-docs.json`. Rendered a 1-to-1 matching schema output using nested map calls reflecting exact design patterns. -5. **FAQ page**: Deployed a basic FAQ fallback to support the requested `/about/faq` structure, given `views/docs/faq.html` or `faq.md` did not exist in the source code. -6. **Version page integration**: - - Installed `react-markdown` via NPM. - - Added the `external/ModelSEED-UI/CHANGELOG.md` file inline securely via server-side props reading. - - Spun off `StatusTable.tsx` tracking HTTP REST checks using `useEffect` live updates, mirroring Angular's check pings originally. - -## Outcome -The objective to perfectly map the remaining missing legacy code features from the About view scope into the new UI stack has cleanly succeeded. All legacy pages under the About tree explicitly function 1-to-1. - -## Next Step -Transition back to global planning stage for `/plan` Phase 9 or handle further context from the user. diff --git a/.gsd/milestones/v1-alpha/8/VERIFICATION.md b/.gsd/milestones/v1-alpha/8/VERIFICATION.md deleted file mode 100644 index e9049f64..00000000 --- a/.gsd/milestones/v1-alpha/8/VERIFICATION.md +++ /dev/null @@ -1,14 +0,0 @@ -## Phase 8 Verification - -### Must-Haves -- [x] Clean up the PATRIC/RAST login and account creation URLs to use functional links — VERIFIED (evidence: `app/page.tsx` now leverages pure `rast.cgi?page=Register`) -- [x] Remove the obsolete subscription section from the homepage — VERIFIED (evidence: Action form pointing to mailchimp and `aboutSecondary` class styles are completely removed from `app/page.tsx` and `app/home.module.css`) -- [x] Replace the bug report message with a "Contact Us" `mailto:` link — VERIFIED (evidence: Replaced `mailto:help@modelseed.org` in `app/page.tsx` footer area instead of standard text) -- [x] Rebuild the `/about` page to port legacy AngularJS content to Next.js using MUI layout — VERIFIED (evidence: `app/about/page.tsx` renders MUI with identical copy from `views/about.html` including KBase, PlantSEED, and DOE funding language) -- [x] Rebuild remaining `/about` pages (Data Sources, Version) and implement nested Layout — VERIFIED (evidence: Sidebar added at `app/about/layout.tsx`. `/about/data-sources` matches `sources.html`. `/about/version` encapsulates status API tables matching `version.html`) -- [x] Rebuild advanced `/about` sections including Team, API, Publications, FAQ, Live Status tables, and Changelog — VERIFIED (evidence: `StatusTable.tsx` parses live external URLs and UI responds exactly as angular controller. Pages rendered statically matching old content.) - -### Verdict: PASS - -## Timestamp Log -- Created: 2026-03-05 14:26:00 -06:00 diff --git a/.gsd/milestones/v1-alpha/9/9.1-PLAN.md b/.gsd/milestones/v1-alpha/9/9.1-PLAN.md deleted file mode 100644 index 5630f433..00000000 --- a/.gsd/milestones/v1-alpha/9/9.1-PLAN.md +++ /dev/null @@ -1,55 +0,0 @@ ---- -phase: 9 -plan: 1 -wave: 1 ---- - -# Plan 9.1: Build Event Link Pages - -## Objective -Build all the individual link pages for events (PlantSEED 2018, 2017, 2016, 2015) based on their legacy templates, translating their structure into React and utilizing the Next.js App Router. We must also copy necessary image assets that they relied on to proper locations. - -## Context -- `.gsd/SPEC.md` -- `.gsd/ROADMAP.md` -- `external/ModelSEED-UI/ms-projects/events/*` - -## Tasks - - - Migrate Event Image Assets - - - `public/img/plantseed-header.png` - - - - Ensure the legacy image `external/ModelSEED-UI/ms-projects/events/img/plantseed-header.png` is copied securely into `public/img/plantseed-header.png`. - - If it already exists, verify its integrity. - - ls -l public/img/plantseed-header.png - The plantseed-header.png image asset exists in the proper public folder. - - - - Implement Next.js Event Pages - - - `app/events/plantseed2018/page.tsx` - - `app/events/plantseed2017/page.tsx` - - `app/events/plantseed2016/page.tsx` - - `app/events/plantseed2015/page.tsx` - - - - Read the HTML contents of the legacy event pages (e.g. `external/ModelSEED-UI/ms-projects/events/plantseed2015/home.html` and others for 2016, 2017, 2018). - - Convert each HTML document into a simple, responsive, and styled Next.js `page.tsx`. Use MUI components where appropriate, like `Typography`, `Container`, `Box`. - - Ensure all links and images in these templates point sequentially to correctly hosted assets (such as replacing broken relative raw GitHub links with modern styling or correctly resolving internal `/img/plantseed-header.png` if referenced). - - The structure should maintain visual compatibility. - - ls -l app/events/*/page.tsx - All 4 PlantSEED event pages successfully built and exporting Next.js default page components. - - -## Success Criteria -- [ ] Users can navigate from `/events` to individual event pages successfully. -- [ ] The plantseed-header image cleanly loads and is present within the UI. - -## Timestamp Log -- Created: 2026-03-06 12:40:00 -06:00 diff --git a/.gsd/milestones/v1-alpha/9/9.1-SUMMARY.md b/.gsd/milestones/v1-alpha/9/9.1-SUMMARY.md deleted file mode 100644 index af53b1ea..00000000 --- a/.gsd/milestones/v1-alpha/9/9.1-SUMMARY.md +++ /dev/null @@ -1,19 +0,0 @@ -# Phase 9 Plan 1 Summary - -## Objective -Build all the individual link pages for events (PlantSEED 2018, 2017, 2016, 2015) based on their legacy templates, translating their structure into React and utilizing the Next.js App Router. We must also copy necessary image assets that they relied on to proper locations. - -## Actions Taken -1. **Migrated Event Image Assets:** - - Copied the legacy `plantseed-header.png` from `external/ModelSEED-UI/ms-projects/events/img/plantseed-header.png` securely into `public/img/plantseed-header.png`. -2. **Implemented Next.js Event Pages:** - - Ported the 4 legacy PlantSEED metabolic modeling workshop event pages (2015, 2016, 2017, 2018) from raw HTML to React `page.tsx`. - - Used robust modern Material UI components (`Container`, `Typography`, `Box`, `MuiLink`) for styling and structure. - - Updated the image tag references to point to the newly ported local `/img/plantseed-header.png` asset. - - Maintained all external/relative images that were hosted natively, ensuring no breakages in the layout. This included keeping participant list photos and direct external links intact. - -## Status -✅ Complete. The event sub-pages have been successfully scaffolded and accurately display the exact content of their respective legacy counterparts. - -## Timestamp Log -- Created: 2026-03-06 12:43:00 -06:00 diff --git a/.gsd/milestones/v1-alpha/9/9.2-PLAN.md b/.gsd/milestones/v1-alpha/9/9.2-PLAN.md deleted file mode 100644 index ab4896a3..00000000 --- a/.gsd/milestones/v1-alpha/9/9.2-PLAN.md +++ /dev/null @@ -1,49 +0,0 @@ ---- -phase: 9 -plan: 2 -wave: 1 ---- - -# Plan 9.2: Escher Integration - -## Objective -Safely port the `escher_builder.html` tool into the Next.js `public` directory. Because the legacy tool was maintained by an outside developer and relies uniquely on global imports (D3, Escher API script loading logic), keeping it as an isolated HTML file served at `/escher/escher_builder.html` identical to legacy is the safest, most robust option for deployment without unexpected breakage. - -## Context -- `external/ModelSEED-UI/escher/escher_builder.html` -- `components/layout/Header.tsx` (links check) - -## Tasks - - - Migrate Escher Directory and Assets - - - `public/escher/escher_builder.html` - - `external/ModelSEED-UI/escher` - - - - Copy the entire contents of `external/ModelSEED-UI/escher` to `public/escher` while preserving timestamps. - - Check if the HTML relies on relative local images/scripts/css and ensure they copy correctly. - - ls -la public/escher/ - The escher builder HTML exists natively within the public/escher path for root web serving. - - - - Verify the Header Navigation link - - - `components/layout/Header.tsx` - - - - Review `components/layout/Header.tsx` to verify the `` or `href` for 'Escher'. - - It must point to `/escher/escher_builder.html` with target `_blank` or external parameter to match the legacy dropdown items exactly. - - grep "Escher" components/layout/Header.tsx - Header points clearly and accurately to the newly ported static HTML. - - -## Success Criteria -- [ ] Users can navigate from the top navigational "Escher" link and the HTML document efficiently loads. - -## Timestamp Log -- Created: 2026-03-06 12:40:00 -06:00 diff --git a/.gsd/milestones/v1-alpha/9/9.2-SUMMARY.md b/.gsd/milestones/v1-alpha/9/9.2-SUMMARY.md deleted file mode 100644 index dd8913b8..00000000 --- a/.gsd/milestones/v1-alpha/9/9.2-SUMMARY.md +++ /dev/null @@ -1,19 +0,0 @@ -# Phase 9 Plan 2 Summary - -## Objective -Safely port the `escher_builder.html` tool into the Next.js `public` directory to ensure stable availability outside the React UI engine, mirroring its functionality exactly from the legacy codebase. - -## Actions Taken -1. **Migrated Escher Directory and Assets:** - - Command executed: `cp -rp external/ModelSEED-UI/escher public/escher` - - All legacy timestamps, subdirectories, and static dependencies belonging uniquely to the custom Escher dashboard were seamlessly copied directly into Next.js native public directory. -2. **Verified Header Navigation:** - - Navigational links were reviewed within `components/layout/Header.tsx` - - Verified that the `NAV_ITEMS` array properly configures Escher using `href: '/escher/escher_builder.html'` and sets the `external: true` property. - - Verified that the header component correctly renders standard HTML `` tags with `target="_blank"` for external properties, enabling fully isolated document loading for the Escher tool safely outside React rendering. - -## Status -✅ Complete. The Escher system has been ported intact via the native static pathing mechanism to ensure legacy Javascript/D3 patterns execute flawlessly. - -## Timestamp Log -- Created: 2026-03-06 12:47:00 -06:00 diff --git a/.gsd/milestones/v1-alpha/9/VERIFICATION.md b/.gsd/milestones/v1-alpha/9/VERIFICATION.md deleted file mode 100644 index 2e4ba5ac..00000000 --- a/.gsd/milestones/v1-alpha/9/VERIFICATION.md +++ /dev/null @@ -1,63 +0,0 @@ ---- -phase: 9 -verified_at: 2026-03-06T12:55:00-06:00 -verdict: PASS ---- - -# Phase 9 Verification Report - -## Summary -4/4 must-haves verified - -## Must-Haves - -### ✅ Missing PlantSEED Event Sub-Pages Ported -**Status:** PASS -**Evidence:** -``` -Route (app) -├ ○ /events/plantseed2015 -├ ○ /events/plantseed2016 -├ ○ /events/plantseed2017 -├ ○ /events/plantseed2018 -... -○ (Static) prerendered as static content -``` -**Notes:** Next.js successfully compiles and statically generates the newly ported pages via `@mui/material` markup. - -### ✅ Legacy Escher Tool Migrated Standalones -**Status:** PASS -**Evidence:** -``` -{ - "name": "escher_builder.html", - "sizeBytes": "16042089" -} -``` -**Notes:** The massive 16MB raw HTML and its dependencies are verified identically existing in `public/escher/escher_builder.html` safely extracted from the UI runtime. - -### ✅ Header Correctly Linked -**Status:** PASS -**Evidence:** -``` -{"File":".../Header.tsx","LineNumber":33,"LineContent":" { label: 'Escher', href: '/escher/escher_builder.html', external: true },"} -``` -**Notes:** Verified `external: true` dynamically triggers `` HTML tags ensuring proper robust navigation identical to legacy. - -### ✅ Image Dependencies Imported -**Status:** PASS -**Evidence:** -``` --rw-rw-r-- 1 vibhav vibhav 618562 Mar 6 12:40 public/img/plantseed-header.png -``` -**Notes:** Event workshop logos successfully migrated independently. - -## Verdict -PASS - -## Gap Closure Required -None - -## Timestamp Log -- Created: 2026-03-06 12:48:00 -06:00 -- Updated: 2026-03-06 12:55:00 -06:00 - Full empirical verification passed diff --git a/.gsd/milestones/v1-alpha/SUMMARY.md b/.gsd/milestones/v1-alpha/SUMMARY.md deleted file mode 100644 index 3ff37ce6..00000000 --- a/.gsd/milestones/v1-alpha/SUMMARY.md +++ /dev/null @@ -1,32 +0,0 @@ -# Milestone: v1-alpha (UI Migration & Auth) - -## Completed: 2026-03-11 - -## Deliverables -- ✅ **Core Layout Migration**: Rebuilt the legacy theme using MUI v7 and Next.js 16. -- ✅ **Reference Data**: Fully functional Compounds, Reactions, and Subsystems pages with Solr integration. -- ✅ **User Data Skeletons**: Integrated My Models, My Media, and Build Model pages with legacy visual parity. -- ✅ **Biochemistry Integration**: Implemented data-rich tables with advanced pagination and filtering. -- ✅ **Secure Authentication**: Integrated PATRIC/RAST JWT authentication with persistent state and developer bypass. -- ✅ **Route Protection**: Implemented `AuthGuard` for all user-specific data routes. -- ✅ **Global Navigation**: Real-time username display in headers and context-aware sub-headers. - -## Phases Completed -1. **Phase 1-8**: Theme and Layout Migration — 2026-03-03 -2. **Phase 9**: Reference Data Integration — 2026-03-05 -3. **Phase 10**: Biochemistry Toolbar & UI Parity — 2026-03-06 -4. **Phase 11**: Global Search & Banners — 2026-03-11 -5. **Phase 12**: True Authentication Integration — 2026-03-11 - -## Metrics -- **Total commits**: 50+ -- **Files changed**: 260+ -- **Duration**: ~10 days - -## Lessons Learned -- **Hydration Mismatch**: Browser extensions often inject attributes that break Next.js hydration; `suppressHydrationWarning` is essential for the root ``. -- **CORS Handling**: Backend Solr and Auth API calls require careful handling of proxy headers when running in local dev mode. -- **MUI Customization**: Deeply nested MUI components (like DataGrid) require theme-level color overrides to match legacy branding without CSS bloat. - -## Timestamp Log -- Created: 2026-03-11 10:48:00 -05:00 diff --git a/.gsd/phases/13/13.1-PLAN.md b/.gsd/phases/13/13.1-PLAN.md deleted file mode 100644 index 572a0ed8..00000000 --- a/.gsd/phases/13/13.1-PLAN.md +++ /dev/null @@ -1,58 +0,0 @@ ---- -phase: 13 -plan: 1 -wave: 1 ---- - -# Plan 13.1: URL Parity and Legacy Placeholder Generation - -## Objective -Ensure that the Next.js App Router exactly replicates the legacy AngularJS URL structure so that all direct links, API references, and proxies seamlessly resolve. We will generate the missing dynamic routes as "Coming Soon" or simple layout stubs for `model`, `fba`, `genome`, `feature`, and `gapfill`. We will also audit navigation to ensure URL trailing slashes and segment matches are perfectly 1-to-1. - -## Context -- .gsd/SPEC.md -- .gsd/ROADMAP.md -- external/ModelSEED-UI/app/app.js (legacy states provider reference) - -## Tasks - - - Create Legacy Stub Routes - - - app/model/[...path]/page.tsx - - app/fba/[...path]/page.tsx - - app/genome/[...path]/page.tsx - - app/feature/[...path]/page.tsx - - app/gapfill/[...path]/page.tsx - - - - Based on `external/ModelSEED-UI/app/app.js`, create Next.js App Router equivalents for the legacy states `app.modelPage` (`/model/:path`), `app.fbaPage` (`/fba/:path`), `app.genomePage` (`/genome/:path`), `app.featurePage` (`/feature/:genome/:feature`), and `app.gfPage` (`/gapfill/:path`). - - Note that we use a catch-all route `[...path]` to handle workspace directories which often contain multiple slashes (e.g. `user/folder/file`). - - Create a standard placeholder UI for these pages (e.g., using `Typography` and a `Container` saying "This data view is under construction.") - - Ensure these match the legacy path matching. - - ls app/model || echo "Model page not found" - Next.js directory structure mirrors the legacy URL targets. - - - - Audit & Replace Missing Reference Data Links - - - components/layout/AppHeader.tsx - - components/layout/Header.tsx - - - - Ensure that the primary navigation URLs pointing to the main features exactly match the legacy URLs. - - Check that `/plant` perfectly resolves (it does, but ensure no trailing slashes if legacy didn't have them). - - Ensure all links in the `AppHeader` pointing to workspace items correctly link without triggering Next.js 404. - - grep "href=" components/layout/AppHeader.tsx - Navigation is flawless and matches the old deployed ModelSEED UI 1:1. - - -## Success Criteria -- [ ] No common legacy ModelSEED data URL triggers a Next.js 404. -- [ ] Placeholders actively render for missing content types. - -## Timestamp Log -- Created: 2026-03-11 11:00:00 -05:00 diff --git a/.gsd/phases/13/13.1-SUMMARY.md b/.gsd/phases/13/13.1-SUMMARY.md deleted file mode 100644 index d92f1bcc..00000000 --- a/.gsd/phases/13/13.1-SUMMARY.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -phase: 13 -plan: 1 -wave: 1 ---- - -# Plan 13.1 Summary: URL Parity and Legacy Placeholder Generation - -## Tasks Completed - -### Task 1: Create Legacy Stub Routes -Created placeholder pages for legacy URL routes: -- `app/model/[...path]/page.tsx` - Model view stub -- `app/fba/[...path]/page.tsx` - FBA view stub -- `app/genome/[...path]/page.tsx` - Already existed with full implementation -- `app/feature/[...path]/page.tsx` - Feature view stub -- `app/gapfill/[...path]/page.tsx` - Gapfill view stub - -All routes use catch-all `[...path]` to handle workspace directories with multiple slashes (e.g., `user/folder/file`). - -### Task 2: Audit & Replace Missing Reference Data Links -Verified navigation URLs in `components/layout/AppHeader.tsx` and `components/layout/Header.tsx`: -- `/genomes` → `(reference-data)/genomes` ✓ -- `/my-models` → `(user-data)/my-models` ✓ -- `/plant` → `(build-model)/plant` ✓ -- `/biochem/reactions` → `(reference-data)/biochem/reactions` ✓ -- All other links verified ✓ - -Build passes successfully with all routes generated. - -## Success Criteria Verification -- [x] No common legacy ModelSEED data URL triggers a Next.js 404 -- [x] Placeholders actively render for missing content types - -## Timestamp Log -- Created: 2026-03-11 11:00:00 -05:00 -- Updated: 2026-03-11 11:08:00 -05:00 - Completed tasks 1 and 2 diff --git a/.gsd/phases/13/13.2-PLAN.md b/.gsd/phases/13/13.2-PLAN.md deleted file mode 100644 index 478cf74d..00000000 --- a/.gsd/phases/13/13.2-PLAN.md +++ /dev/null @@ -1,55 +0,0 @@ ---- -phase: 13 -plan: 2 -wave: 1 ---- - -# Plan 13.2: Equation Formatting (Chemical Formula Parser) - -## Objective -Implement custom logic to beautifully render chemical stoichiometry and compound formulas inside Reaction equations, strictly adhering to the "Option A" parser choice, yielding precise subscript formatting visually matching the legacy modelseed application format. - -## Context -- .gsd/SPEC.md -- app/(reference-data)/biochem/reactions/page.tsx -- app/(reference-data)/biochem/reactions/[id]/page.tsx -- components/tables/BiochemReactionsTable.tsx (If extracted) - -## Tasks - - - Build Chemical Formula Formatter - - - components/ui/ChemicalEquation.tsx - - - - Create a React component named `ChemicalEquation` that accepts an `equation` prop string (e.g., `H2O + PPi => (2) Phosphate + H+`). - - The parser must correctly identify stoichiometric coefficients (e.g., `(2)`) and leave them as standard text while formatting inline digits following letters inside compound names as proper `` elements (e.g., `H2O` -> `H`, `2`, `O`). - - Render the parts properly spaced, maintaining the `=>` or `<=>` reaction arrows perfectly exactly as passed. - - cat components/ui/ChemicalEquation.tsx | grep sub - Component exists that correctly maps standard text equations to React JSX with subscripts. - - - - Implement Formatter in DataGrids and Details Views - - - app/(reference-data)/biochem/reactions/page.tsx - - app/(reference-data)/biochem/reactions/[id]/page.tsx - - - - Update the `renderCell` definition inside the Reactions DataGrid columns definition to render the `Equation` field using the new `ChemicalEquation` component. - - Update the `/biochem/reactions/[id]/page.tsx` details view to wrap the main reaction equation in the `ChemicalEquation` component. - - Validate that styling overrides don't break vertical alignment. - - grep ChemicalEquation app/(reference-data)/biochem/reactions/page.tsx - Equations inside tables and detail pages strictly use proper html chemical formatting. - - -## Success Criteria -- [ ] Equations like `H2O + PPi => (2) Phosphate + H+` render flawlessly with `2` in `H2O` as a subscript. -- [ ] Stoichiometric multipliers like `(2)` remain unaffected and prominent. -- [ ] Standard styling inherited from the table cells isn't broken. - -## Timestamp Log -- Created: 2026-03-11 11:00:00 -05:00 diff --git a/.gsd/phases/13/13.2-SUMMARY.md b/.gsd/phases/13/13.2-SUMMARY.md deleted file mode 100644 index 1a4570ea..00000000 --- a/.gsd/phases/13/13.2-SUMMARY.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -phase: 13 -plan: 2 -wave: 1 ---- - -# Plan 13.2 Summary: Equation Formatting (Chemical Formula Parser) - -## Tasks Completed - -### Task 1: Build Chemical Formula Formatter -Created `components/ui/ChemicalEquation.tsx`: -- React component that accepts an `equation` prop string -- Correctly identifies stoichiometric coefficients (e.g., `(2)`) and leaves them as standard text -- Formats inline digits following letters inside compound names as `` elements (e.g., `H2O` → `H``2``O`) -- Maintains `=>` and `<=>` reaction arrows perfectly -- Links compound IDs (cpdXXXXX) to their compound pages - -### Task 2: Implement Formatter in DataGrids and Details Views -Updated reaction pages to use the new ChemicalEquation component: -- `app/(reference-data)/biochem/reactions/page.tsx` - Table view now renders Equation column with proper subscripts -- `app/(reference-data)/biochem/reactions/[id]/page.tsx` - Detail view now displays equations with proper subscript formatting - -Build passes successfully. - -## Success Criteria Verification -- [x] Equations like `H2O + PPi => (2) Phosphate + H+` render with `2` in `H2O` as a subscript -- [x] Stoichiometric multipliers like `(2)` remain unaffected and prominent -- [x] Standard styling inherited from the table cells isn't broken - -## Timestamp Log -- Created: 2026-03-11 11:00:00 -05:00 -- Updated: 2026-03-11 11:12:00 -05:00 - Completed tasks 1 and 2 diff --git a/.gsd/phases/13/VERIFICATION.md b/.gsd/phases/13/VERIFICATION.md deleted file mode 100644 index c8e296ac..00000000 --- a/.gsd/phases/13/VERIFICATION.md +++ /dev/null @@ -1,15 +0,0 @@ -## Phase 13 Verification - -### Must-Haves -- [x] Audit and align all local routes and `` tags to exactly match the legacy UI's URL structures — VERIFIED (AppHeader and Header navigation links verified, build passes) -- [x] Ensure placeholder dynamic routes exist for legacy links (e.g., `/data/...`, `/fba/...`) — VERIFIED (Created stub pages for model, fba, feature, gapfill; genome already existed) -- [x] Implement custom React formatting utility (Option A) to parse Reaction equations for proper chemical formula subscripting — VERIFIED (ChemicalEquation component created and integrated) - -### Verdict: PASS - -## Summary -Phase 13 completed with both plans executed: -- Plan 13.1: Created legacy stub routes and verified navigation URLs -- Plan 13.2: Created ChemicalEquation component for proper subscript formatting in reaction equations - -Build passes successfully. All legacy URL patterns now have Next.js equivalents. diff --git a/.gsd/phases/14/14.1-PLAN.md b/.gsd/phases/14/14.1-PLAN.md deleted file mode 100644 index 9a9c5f84..00000000 --- a/.gsd/phases/14/14.1-PLAN.md +++ /dev/null @@ -1,78 +0,0 @@ ---- -phase: 14 -plan: 1 -wave: 1 ---- - -# Plan 14.1: Service Status Authentication Integration - -## Objective -Fix the version/status page to properly show service connectivity based on actual authentication state. Currently, auth-required services always show "login required" even when user is logged in. This plan integrates the useAuth() hook and makes actual API calls to verify service connectivity. - -## Context -- .gsd/SPEC.md -- app/about/version/StatusTable.tsx (current broken implementation) -- lib/api/workspace.ts (existing authenticated API pattern) -- lib/api/config.ts (API endpoint configuration with USE_NEW_PROXY flag) -- components/auth/AuthProvider.tsx (auth context with isAuthenticated, token) - -## Tasks - - - Integrate useAuth hook into StatusTable - - - app/about/version/StatusTable.tsx - - - - Import useAuth from '@/components/auth/AuthProvider' - - Replace hardcoded `const userLoggedIn = false` with `const { isAuthenticated, token } = useAuth()` - - Add token to the dependency array of the useEffect - - For mock/developer testing, allow a special token format (e.g., starting with "mock:") to bypass real API calls but still show "connected" status - - grep "useAuth" app/about/version/StatusTable.tsx - StatusTable now uses real auth state instead of hardcoded false - - - - Implement authenticated service ping for Workspace - - - app/about/version/StatusTable.tsx - - - - Create a helper function that makes an authenticated JSON-RPC call to Workspace API - - Use the existing pattern from lib/api/workspace.ts (call with token header) - - For the status check, use a lightweight method like 'Workspace.ver' or 'Workspace.ls' with empty params - - Handle both success (service available) and auth failure (show "login required") - - For mock tokens (starts with "mock:"), skip actual API call and return success for testing - - grep "Workspace.ver\|Workspace.ls" app/about/version/StatusTable.tsx - Workspace service shows actual connectivity status based on auth - - - - Add configurable service endpoint structure for future API changes - - - lib/api/statusServices.ts (new file) - - app/about/version/StatusTable.tsx - - - - Create a new service status configuration file in lib/api/statusServices.ts - - Define ServiceStatusConfig interface with: id, service, endpoint, pingUrl, authReq, apiLinks - - Move SERVICES array to this new file - - Add a configuration object that reads from lib/api/config.ts for endpoint URLs - - Include a comment block noting: "Future: When USE_NEW_PROXY is enabled, update pingUrl to use PROBMODELSEED_URL_PROXY and WORKSPACE_URL_PROXY" - - Update StatusTable to import from the new config file - - ls lib/api/statusServices.ts - Service configuration is centralized and ready for future API endpoint changes - - -## Success Criteria -- [ ] Logged-in user (mock or real) sees actual service connectivity status instead of "login required" -- [ ] Authenticated API calls are made to verify Workspace service (when token available) -- [ ] Mock developer tokens bypass real API but show "connected" for testing -- [ ] Service endpoints are configurable via lib/api/config.ts for future proxy changes -- [ ] Build passes with no TypeScript errors - -## Timestamp Log -- Created: 2026-03-11 11:25:00 -05:00 diff --git a/.gsd/phases/14/14.1-SUMMARY.md b/.gsd/phases/14/14.1-SUMMARY.md deleted file mode 100644 index 578020b1..00000000 --- a/.gsd/phases/14/14.1-SUMMARY.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -phase: 14 -plan: 1 -wave: 1 ---- - -# Plan 14.1 Summary: Service Status Authentication Integration - -## Tasks Completed - -### Task 1: Integrate useAuth hook into StatusTable -- Imported useAuth from '@/components/auth/AuthProvider' -- Replaced hardcoded `const userLoggedIn = false` with `const { isAuthenticated, token } = useAuth()` -- Added token and isAuthenticated to useEffect dependency array for reactive updates - -### Task 2: Implement authenticated service ping for Workspace -- Created checkWorkspaceService function that makes authenticated JSON-RPC calls to Workspace API -- Uses Workspace.ls method with empty paths to verify connectivity -- Handles auth failures (401/403) to show "login required" -- Added mock token support - tokens starting with "mock:" return success without actual API calls - -### Task 3: Add configurable service endpoint structure -- Imported WORKSPACE_URL and PROBMODELSEED_URL from lib/api/config.ts -- Updated SERVICES array to use config endpoints (WORKSPACE_URL, PROBMODELSEED_URL) -- Added authReq field to all service configs -- When USE_NEW_PROXY flag changes in config.ts, endpoints will automatically update - -## Success Criteria Verification -- [x] Logged-in user (mock or real) sees actual service connectivity status -- [x] Authenticated API calls made to verify Workspace service -- [x] Mock developer tokens bypass real API but show "connected" -- [x] Service endpoints configurable via lib/api/config.ts -- [x] Build passes with no TypeScript errors - -## Timestamp Log -- Created: 2026-03-11 11:25:00 -05:00 -- Updated: 2026-03-11 11:30:00 -05:00 - Completed all tasks diff --git a/.gsd/phases/14/VERIFICATION.md b/.gsd/phases/14/VERIFICATION.md deleted file mode 100644 index 5dab69ce..00000000 --- a/.gsd/phases/14/VERIFICATION.md +++ /dev/null @@ -1,19 +0,0 @@ -## Phase 14 Verification - -### Must-Haves -- [x] Logged-in user (mock or real) sees actual service connectivity status instead of "login required" — VERIFIED (useAuth hook integrated, isAuthenticated controls status display) -- [x] Authenticated API calls are made to verify Workspace service (when token available) — VERIFIED (checkWorkspaceService function makes actual JSON-RPC calls) -- [x] Mock developer tokens bypass real API but show "connected" for testing — VERIFIED (isMockToken flag checks for "mock:" prefix) -- [x] Service endpoints are configurable via lib/api/config.ts for future proxy changes — VERIFIED (WORKSPACE_URL and PROBMODELSEED_URL imported from config.ts) -- [x] Build passes with no TypeScript errors — VERIFIED (npm run build succeeds) - -### Verdict: PASS - -## Summary -Phase 14 completed. The version/status page now: -1. Uses useAuth hook to check actual login state -2. Makes authenticated API calls to Workspace service when user is logged in -3. Supports mock tokens (starting with "mock:") for developer testing -4. Uses configurable endpoints from lib/api/config.ts for future proxy changes - -When a user logs in (or uses a mock token), auth-required services will show actual connectivity status instead of always showing "login required". diff --git a/.gsd/phases/15/15.1-PLAN.md b/.gsd/phases/15/15.1-PLAN.md deleted file mode 100644 index e6fed324..00000000 --- a/.gsd/phases/15/15.1-PLAN.md +++ /dev/null @@ -1,66 +0,0 @@ ---- -phase: 15 -plan: 1 -wave: 1 -depends_on: [] -files_modified: ["components/BiochemToolbar.tsx", "app/(reference-data)/genomes/page.tsx", "app/(reference-data)/list-media/page.tsx", "app/(reference-data)/biochem/compounds/page.tsx", "app/(reference-data)/biochem/reactions/page.tsx", "app/(reference-data)/genomes/Annotations/page.tsx"] -autonomous: true ---- - -# Plan 15.1: Data Table Pagination Fix & Standardization - - -Refine and standardize the data table interaction experience across all reference data sections. This includes fixing a critical pagination reset bug and ensuring consistent search/filter/pagination behavior. - -Purpose: Improve usability and reliability of data-heavy views. -Output: Standardized toolbar integration and stable pagination states. - - - -- components/BiochemToolbar.tsx (Custom toolbar with pagination) -- app/(reference-data)/**/page.tsx (Various data table pages) - - - - - - Fix Pagination Reset Bug - components/BiochemToolbar.tsx - - Modify `CustomPagination` to ensure that resetting to the first page only occurs when the page size (`pageSize`) actually changes, preventing random resets during normal page navigation. - - Navigating through pages in any reference data table does not jump back to page 1. - Pagination state is stable across page changes. - - - - Standardize Toolbar & UI Layout - - - app/(reference-data)/genomes/page.tsx - - app/(reference-data)/list-media/page.tsx - - app/(reference-data)/biochem/reactions/page.tsx - - app/(reference-data)/biochem/compounds/page.tsx - - app/(reference-data)/genomes/Annotations/page.tsx - - - For all listed pages: - - Integrate `BiochemToolbar` with `showQuickFilter: true`. - - Remove redundant manual search fields or client-side filtering logic. - - Set `hideFooter` on the `DataGrid` to unify the look with the custom toolbar. - - Use `keepPreviousData` from React Query where applicable for smoother pagination transitions. - - Tables show the quick filter in the top right and use consistent pagination controls. - Reference data tables share a unified interaction pattern. - - - - - -- [ ] Changing page size resets to page 1 (expected), but clicking Next/Back maintains sequence. -- [ ] No more duplicate search boxes on reference pages. - - - -- [ ] Pagination logic is correct in `BiochemToolbar`. -- [ ] Search and filtering are handled by the integrated DataGrid slots. - diff --git a/.gsd/phases/15/15.2-PLAN.md b/.gsd/phases/15/15.2-PLAN.md deleted file mode 100644 index 17d58063..00000000 --- a/.gsd/phases/15/15.2-PLAN.md +++ /dev/null @@ -1,59 +0,0 @@ ---- -phase: 15 -plan: 2 -wave: 1 -depends_on: ["15.1"] -files_modified: ["app/(build-model)/plant/page.tsx", "components/layout/SignInModal.tsx"] -autonomous: true ---- - -# Plan 15.2: Build Model UI Polish & Auth Link Parity - - -Refine the "Build Model" page UX during maintenance and ensure authentication links correctly reflect the user's selected provider. - -Purpose: Prevent user confusion during service updates and ensure correct account management routing. -Output: Conditional UI constraints and dynamic auth links. - - - -- app/(build-model)/plant/page.tsx (Build Model page) -- components/layout/SignInModal.tsx (Authentication modal) - - - - - - Refine "Build Model" Maintenance UX - app/(build-model)/plant/page.tsx - - - Remove the global maintenance banner. - - Add a warning tooltip with an exclamation mark icon next to the "Upload Plants FASTA" tab. - - Disable inputs, selection fields, and buttons within the Plant upload tab when `PLANTSEED_MAINTENANCE` is active. - - Upload tab shows a warning icon; inputs are greyed out; no global banner is present. - Maintenance state is localized to the affected feature set. - - - - Fix Authentication Link Routing - components/layout/SignInModal.tsx - - Update "Create Account" and "Forgot Password?" links to dynamically change based on whether the user has selected "PATRIC" or "RAST". - Use BV-BRC URLs for PATRIC and RAST NMPDR URLs for RAST. - - Switching to RAST shows RAST links; Switching to PATRIC shows BV-BRC links. - Authentication management links match the selected auth provider. - - - - - -- [ ] Tooltip appears on hover of the warning icon. -- [ ] PATRIC links resolve to user.bv-brc.org. - - - -- [ ] Plant upload tab is safely locked during maintenance. -- [ ] Sign-in modal routing is accurate. - diff --git a/.gsd/phases/16/16.1-PLAN.md b/.gsd/phases/16/16.1-PLAN.md deleted file mode 100644 index 8fd36022..00000000 --- a/.gsd/phases/16/16.1-PLAN.md +++ /dev/null @@ -1,54 +0,0 @@ ---- -phase: 16 -plan: 1 -wave: 1 ---- - -# Plan 16.1: Table Headers and Columns - -## Objective -Standardize the data table header toolbar and replace the default column settings menu with a dedicated "Manage Columns" button. - -## Context -- `components/BiochemToolbar.tsx` -- `app/(reference-data)/biochem/reactions/page.tsx` -- `app/(reference-data)/biochem/compounds/page.tsx` - -## Tasks - - - Standardize BiochemToolbar with Columns Button - - - /home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/components/BiochemToolbar.tsx - - - - Import `GridToolbarColumnsButton` from `@mui/x-data-grid`. - - Add `GridToolbarColumnsButton` next to `GridToolbarFilterButton`. - - Use the `slotProps` or set the button text directly (if possible via MUI translation/properties) to say "Manage Columns" instead of just "Columns". - - Ensure "Filters" label is explicitly set to "Filters". - - Align them horizontally to match the screenshot. - - Check the toolbar in the UI to see "Manage Columns" and "Filters" buttons. - Toolbar contains search, Filters, and Manage Columns buttons with correct labels. - - - - Disable 3-dot Column Menu Globally - - - /home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/app/(reference-data)/biochem/reactions/page.tsx - - /home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/app/(reference-data)/biochem/compounds/page.tsx - - - - Add `disableColumnMenu` prop to the `DataGrid` component in both files. - - This will remove the 3-dot ellipsis menu from all column headers. - - Hover over table columns in Reactions and Compounds; the 3-dot menu should no longer appear. - Column header context menus are disabled across main reference data tables. - - -## Success Criteria -- [ ] Toolbar has search, "Filters", "Manage Columns", and pagination. -- [ ] No more 3-dot menus on individual column headers. - -## Timestamp Log -- Created: 2026-03-11 14:10:00 -05:00 diff --git a/.gsd/phases/16/16.1-SUMMARY.md b/.gsd/phases/16/16.1-SUMMARY.md deleted file mode 100644 index cdaf0f95..00000000 --- a/.gsd/phases/16/16.1-SUMMARY.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -phase: 16 -plan: 1 -wave: 1 ---- - -# Summary 16.1: Table Headers and Columns - -## Completed Tasks -- Standardized `BiochemToolbar` to include explicit **Filters** and **Manage Columns** buttons alongside the quick search field and pagination. -- Disabled the per-column 3-dot header menu on the Reactions and Compounds reference tables. - -## Evidence -- Code updates in `components/BiochemToolbar.tsx` now render `GridToolbarFilterButton` and `GridToolbarColumnsButton` with explicit text labels. -- `DataGrid` instances in `app/(reference-data)/biochem/reactions/page.tsx` and `app/(reference-data)/biochem/compounds/page.tsx` are configured with `disableColumnMenu`. -- ESLint runs without errors on the edited files. - -## Timestamp Log -- Created: 2026-03-11 19:25:00 -06:00 - diff --git a/.gsd/phases/16/16.2-PLAN.md b/.gsd/phases/16/16.2-PLAN.md deleted file mode 100644 index 6b56eb69..00000000 --- a/.gsd/phases/16/16.2-PLAN.md +++ /dev/null @@ -1,67 +0,0 @@ ---- -phase: 16 -plan: 2 -wave: 1 ---- - -# Plan 16.2: Build Model and Plant Model Polish - -## Objective -Fix interaction issues in the Build Model page, update button styles on the Model Detail page, and add warning text to public plant models. - -## Context -- `app/(build-model)/plant/page.tsx` -- `app/model/[...path]/page.tsx` -- `app/(reference-data)/genomes/page.tsx` - -## Tasks - - - Fix Hazard Triangle Tooltip on Disabled Tab - - - /home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/app/(build-model)/plant/page.tsx - - - - Wrap the label content (text + icon) in a `Box` or `span` that does NOT have `pointer-events: none`. - - Alternatively, move the `Tooltip` to wrap the `Tab` itself and ensure it triggers even when the tab is disabled (using a wrapper `span`). - - The goal is to allow hover on the icon/tab to show the maintenance reason even when the tab is click-disabled. - - In the UI, hover over the hazard triangle on the disabled "UPLOAD Plants FASTA" tab; the tooltip should appear. - Tooltip is hoverable and visible even when the tab is disabled. - - - - Update Model Detail Action Buttons to Passive Cards - - - /home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/app/model/[...path]/page.tsx - - - - Replace the `Button` components (Rebuild Model, Blast Genome, etc.) with passive elements that look like gray cards/titles. - - Use MUI `Card` or a styled `Box` with background color `#f5f5f5` and gray text. - - Remove hover/click animations. - - They should act as "status indicators" or "passive titles" rather than interactive buttons for now. - - Check the model detail page; the blue buttons should now be gray passive boxes. - Action buttons are replaced with passive, non-interactive gray titles. - - - - Position PlantSEED Warning Above Toolbar - - - /home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/app/(reference-data)/genomes/page.tsx - - - - Ensure the `Alert` (warning about new PlantSEED) is correctly placed *above* the search/filter/manage col/pagination part of the data header. - - Adjust margins to ensure consistent spacing with the header component. - - Check the Public Plant Models page; the warning alert should be at the top, followed by the table toolbar. - PlantSEED warning is correctly positioned as a header element above the table controls. - - -## Success Criteria -- [ ] Hazard triangle tooltip is functional on disabled tabs. -- [ ] Model detail actions are passive gray boxes. -- [ ] Public plant models page has the warning alert correctly positioned. - -## Timestamp Log -- Created: 2026-03-11 14:15:00 -05:00 diff --git a/.gsd/phases/16/16.2-SUMMARY.md b/.gsd/phases/16/16.2-SUMMARY.md deleted file mode 100644 index 38203c5a..00000000 --- a/.gsd/phases/16/16.2-SUMMARY.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -phase: 16 -plan: 2 -wave: 1 ---- - -# Summary 16.2: Build Model and Plant Model Polish - -## Completed Tasks -- Updated the Build Model (Plant) tab bar so that the PlantSEED maintenance tooltip now appears when hovering the disabled "UPLOAD Plants FASTA" tab. -- Converted the Model Detail action buttons (Rebuild Model, Blast Genome, etc.) into passive gray status cards with no click behavior. -- Confirmed the PlantSEED warning alert remains positioned above the Public Plant Models table toolbar. - -## Evidence -- `app/(build-model)/plant/page.tsx` now wraps the disabled Plants tab in a `Tooltip` attached to a non-disabled wrapper element, enabling hover tooltips while preserving click-disabled behavior. -- `app/model/[...path]/page.tsx` replaces interactive MUI `Button` components with styled `Box` elements that visually indicate actions but are non-interactive. -- `app/(reference-data)/genomes/page.tsx` keeps the informational `Alert` directly above the `DataGrid` and uses the shared `BiochemToolbar` for the header controls. - -## Timestamp Log -- Created: 2026-03-11 19:27:00 -06:00 - diff --git a/.gsd/phases/16/16.3-PLAN.md b/.gsd/phases/16/16.3-PLAN.md deleted file mode 100644 index 02fc5de4..00000000 --- a/.gsd/phases/16/16.3-PLAN.md +++ /dev/null @@ -1,42 +0,0 @@ ---- -phase: 16 -plan: 3 -wave: 2 ---- - -# Plan 16.3: Global Data Tab Consistency - -## Objective -Apply the standardized header (search, filter, manage col, pagination) across all subtabs of the Reference Data section for total UI parity. - -## Context -- `app/(reference-data)/genomes/Annotations/page.tsx` -- `app/(reference-data)/list-media/page.tsx` -- `app/(reference-data)/genomes/page.tsx` -- `components/BiochemToolbar.tsx` - -## Tasks - - - Apply Standardized Toolbar to All Reference Tables - - - /home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/app/(reference-data)/genomes/Annotations/page.tsx - - /home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/app/(reference-data)/list-media/page.tsx - - /home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/app/(reference-data)/genomes/page.tsx - - - - Ensure all `DataGrid` instances use `slots={{ toolbar: BiochemToolbar }}`. - - Set `disableColumnMenu: true` on all grids. - - Ensure `slotProps={{ toolbar: { showQuickFilter: true } }}` is present. - - Audit all tables to ensure they share the same gray header background and horizontal alignment defined in `BiochemToolbar`. - - Navigate through all Reference Data tabs (Public Plant Models, Subsystems, Reactions, Compounds, Media); they should all have identical toolbar headers. - All reference data subtabs use the unified, standardized header component. - - -## Success Criteria -- [ ] Total visual consistency across all reference data subtabs. -- [ ] All tables have "Manage Columns" and "Filters" in the same location. - -## Timestamp Log -- Created: 2026-03-11 14:20:00 -05:00 diff --git a/.gsd/phases/16/16.3-SUMMARY.md b/.gsd/phases/16/16.3-SUMMARY.md deleted file mode 100644 index 66da2d20..00000000 --- a/.gsd/phases/16/16.3-SUMMARY.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -phase: 16 -plan: 3 -wave: 2 ---- - -# Summary 16.3: Global Data Tab Consistency - -## Completed Tasks -- Ensured that all relevant Reference Data tables use the shared `BiochemToolbar` with quick filter, Filters, and Manage Columns controls. -- Disabled the per-column header menu (`disableColumnMenu`) across the Subsystems, Public Plant Models, and Media Formulations tables. - -## Evidence -- `DataGrid` instances in: - - `app/(reference-data)/genomes/Annotations/page.tsx` - - `app/(reference-data)/genomes/page.tsx` - - `app/(reference-data)/list-media/page.tsx` - all declare `slots={{ toolbar: BiochemToolbar }}`, `slotProps={{ toolbar: { showQuickFilter: true } }}`, and `disableColumnMenu`. -- Visual header styling is provided consistently by `components/BiochemToolbar.tsx` for these tables. - -## Timestamp Log -- Created: 2026-03-11 19:29:00 -06:00 - diff --git a/.gsd/phases/16/16.4-PLAN.md b/.gsd/phases/16/16.4-PLAN.md deleted file mode 100644 index fd308d23..00000000 --- a/.gsd/phases/16/16.4-PLAN.md +++ /dev/null @@ -1,53 +0,0 @@ ---- -phase: 16 -plan: 4 -wave: 2 ---- - -# Plan 16.4: Home Page Authentication Logic - -## Objective -Enable login functionality on the home page and ensure the UI correctly updates to show the logged-in state. - -## Context -- `app/page.tsx` -- `components/auth/AuthProvider.tsx` -- `lib/api/auth.ts` - -## Tasks - - - Implement Home Page Login Logic - - - /home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/app/page.tsx - - - - Import `useAuth` from `@/components/auth/AuthProvider`. - - Extract `login`, `isAuthenticated`, and `user` from `useAuth`. - - Update the `Sign In` button `onClick` to call the `login(method, username, password)` function. - - Handle potential errors (e.g., failed auth) with an inline alert or message. - - Enter credentials on the home page and click Sign In; it should successfully authenticate. - Home page login form successfully triggers authentication. - - - - Conditional UI for Logged-In Users - - - /home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/app/page.tsx - - - - If `isAuthenticated` is true, remove the login form from the hero section. - - Replace it with a "Continue to ModelSEED" view or a summary of user models (sync with ModelSEED legacy home page behavior after login). - - Ensure the "Sign In" button is gone and the user's name/profile options are visible (if not handled by global header). - - Refresh the page while logged in; the login form should be hidden, showing authenticated status instead. - Home page correctly reflects user's auth state by hiding login forms. - - -## Success Criteria -- [ ] Sign-in button on home page is functional. -- [ ] Authenticated users do not see login forms on the home page. - -## Timestamp Log -- Created: 2026-03-11 14:25:00 -05:00 diff --git a/.gsd/phases/16/16.4-SUMMARY.md b/.gsd/phases/16/16.4-SUMMARY.md deleted file mode 100644 index 53d55fbd..00000000 --- a/.gsd/phases/16/16.4-SUMMARY.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -phase: 16 -plan: 4 -wave: 2 ---- - -# Summary 16.4: Home Page Authentication Logic - -## Completed Tasks -- Wired the home page login form to the global `useAuth` context, calling `login` with the selected RAST/PATRIC method and user credentials. -- Added basic error handling and loading state around the Sign In action. -- Updated the hero section to hide the login form and instead show a "Continue to ModelSEED" state when the user is already authenticated. - -## Evidence -- `app/page.tsx` imports and uses `useAuth` from `components/auth/AuthProvider`, calling `login('RAST' | 'PATRIC', username, password)` from a form `onSubmit` handler. -- The Sign In button is disabled while credentials are missing or a login is in progress, and an `Alert` is rendered when a login attempt throws. -- When `isAuthenticated` is true, the login form is replaced by a welcome message and a navigation button, and the alternate login toggle is hidden. - -## Timestamp Log -- Created: 2026-03-11 19:31:00 -06:00 - diff --git a/.gsd/phases/16/16.5-PLAN.md b/.gsd/phases/16/16.5-PLAN.md deleted file mode 100644 index ed6c1b27..00000000 --- a/.gsd/phases/16/16.5-PLAN.md +++ /dev/null @@ -1,66 +0,0 @@ ---- -phase: 16 -plan: 5 -wave: 3 ---- - -# Plan 16.5: Workspace UX & Table Controls Polish - -## Objective -Reduce noisy console/runtime errors around Workspace calls and DOM props, and ensure the Biochem-style header controls (search, Filters, Manage Columns, pagination) are consistently applied to the remaining data tables called out in Phase 16. - -## Context -- `lib/api/workspace.ts` -- `app/(user-data)/my-models/page.tsx` -- `app/(user-data)/myMedia/page.tsx` -- `app/(reference-data)/genomes/page.tsx` -- `app/(reference-data)/genomes/Annotations/page.tsx` -- `app/(reference-data)/list-media/page.tsx` -- `.gsd/phases/16/VERIFICATION.md` - -## Tasks - - - Harden Workspace client and user-data pages against 500 errors - - - /home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/app/(user-data)/my-models/page.tsx - - /home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/app/(user-data)/myMedia/page.tsx - - - - Keep `lib/api/workspace.ts`'s strict error throwing behavior (so failures are visible to callers) but stop logging full stack traces via `console.error` in the My Models and My Media pages. - - In both user-data pages, change the `useQuery` `queryFn` `catch` blocks to: - - Capture a local `loadError` boolean via `useState`. - - Set `loadError` to true when a `Workspace API HTTP error` is caught. - - Return an empty array without calling `console.error`. - - Continue to render a friendly inline error message to the user when `loadError` is true, matching the existing copy but without spamming the console. - - Reload the My Models and My Media pages while the Workspace endpoint still returns 500; the UI should show a clear inline error, and the console should no longer show `Failed to load My Models/My Media Error: Workspace API HTTP error!` from our code. - Workspace 500s are handled gracefully in My Models/My Media with user-facing messages and minimal console noise. - - - - Ensure Biochem-style toolbar & pagination parity across remaining reference tables - - - /home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/app/(reference-data)/genomes/page.tsx - - /home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/app/(reference-data)/genomes/Annotations/page.tsx - - /home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/app/(reference-data)/list-media/page.tsx - - - - Audit the Public Plant Models, Subsystems, and Media reference pages to confirm they: - - Use `slots={{ toolbar: BiochemToolbar }}`. - - Provide `slotProps={{ toolbar: { showQuickFilter: true } }}`. - - Use `hideFooter` so pagination is handled only by `BiochemToolbar`'s `CustomPagination`. - - Set `disableColumnMenu` so header 3-dot menus are removed (using the Manage Columns button instead). - - If any of the three pages diverge from the Reactions/Compounds configuration, adjust them for visual and behavioral parity. - - Compare the header row (search, Filters, Manage Columns, pagination) for Reactions vs. Public Plant Models, Subsystems, and Media; they should be visually and functionally identical aside from table-specific labels. - All called-out reference data subtabs present the same Biochem-style header controls and pagination behavior as the Reactions table. - - -## Success Criteria -- [ ] My Models and My Media show friendly inline errors when Workspace returns 500 and no longer emit noisy stack-like errors to the browser console from our React code. -- [ ] Public Plant Models, Subsystems, and Media share the same header layout and behavior as Reactions/Compounds (search, Filters, Manage Columns, pagination, and no per-column menus). - -## Timestamp Log -- Created: 2026-03-11 19:45:00 -06:00 - diff --git a/.gsd/phases/16/16.5-SUMMARY.md b/.gsd/phases/16/16.5-SUMMARY.md deleted file mode 100644 index 1e84ab4a..00000000 --- a/.gsd/phases/16/16.5-SUMMARY.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -phase: 16 -plan: 5 -wave: 3 ---- - -# Summary 16.5: Workspace UX & Table Controls Polish - -## Completed Tasks -- Softened Workspace 500 handling in user-data pages: - - `app/(user-data)/my-models/page.tsx` and `app/(user-data)/myMedia/page.tsx` now catch `Workspace.ls` failures without logging `console.error`, track a `loadError` flag, and return an empty array so the UI can render a clear inline error instead of noisy stack traces. - - Both pages continue to show a friendly error message when either the React Query `error` state or the local `loadError` flag is set. -- Confirmed and aligned Biochem-style header controls on the remaining reference tables: - - Public Plant Models, Subsystems, and Media (`app/(reference-data)/genomes/page.tsx`, `.../genomes/Annotations/page.tsx`, `.../list-media/page.tsx`) all share: - - `slots={{ toolbar: BiochemToolbar }}` and `slotProps={{ toolbar: { showQuickFilter: true } }}`. - - `hideFooter` so pagination is owned by `BiochemToolbar`'s `CustomPagination`. - - `disableColumnMenu` to remove the per-column 3-dot menus in favor of the unified Manage Columns control. - -## Evidence -- Browser console no longer shows `Failed to load My Models Error: Workspace API HTTP error! status: 500` or the equivalent My Media error from our code; instead, the pages render inline error text when the backend returns 500. -- Visual inspection of the Reactions, Public Plant Models, Subsystems, and Media tables shows a consistent header layout: search box, Filters, Manage Columns, and a right-aligned pagination control, with no per-column header menus. - -## Timestamp Log -- Created: 2026-03-11 19:50:00 -06:00 - diff --git a/.gsd/phases/16/VERIFICATION.md b/.gsd/phases/16/VERIFICATION.md deleted file mode 100644 index a6e40832..00000000 --- a/.gsd/phases/16/VERIFICATION.md +++ /dev/null @@ -1,90 +0,0 @@ ---- -phase: 16 -verified_at: 2026-03-11T19:55:00-06:00 -verdict: PASS ---- - -# Phase 16 Verification Report — UI/UX Refinement & Data Consistency - -## Summary -All Phase 16 must-haves are implemented with consistent behavior across the targeted tables and pages; workspace-related 500s are handled gracefully, and the UI/UX refinements (headers, tooltips, passive indicators, and home-page auth wiring) are covered by lint/TypeScript checks plus manual reasoning against the code. - -## Must-Haves - -### ✅ Standardize data table headers with search, filters, manage columns, and pagination -**Status:** PASS -**Evidence:** -```text -- `components/BiochemToolbar.tsx` now renders: - - A styled quick filter input - - An explicit "Filters" button (`GridToolbarFilterButton`) - - An explicit "Manage Columns" button (`GridToolbarColumnsButton`) - - Custom pagination component bound to the grid's pagination model -- `DataGrid` instances in: - - `app/(reference-data)/biochem/reactions/page.tsx` - - `app/(reference-data)/biochem/compounds/page.tsx` - - `app/(reference-data)/genomes/Annotations/page.tsx` - - `app/(reference-data)/genomes/page.tsx` - - `app/(reference-data)/list-media/page.tsx` - all use `slots={{ toolbar: BiochemToolbar }}` and `slotProps={{ toolbar: { showQuickFilter: true } }}`. -``` - -### ✅ Apply consistent headers across all dynamic reference data subtabs -**Status:** PASS -**Evidence:** -```text -- All reference-data tables listed above share: - - The same `BiochemToolbar` configuration - - The same header styling and quick filter behavior -- Column header menus are disabled via `disableColumnMenu` on each `DataGrid`, - ensuring users rely on the unified "Manage Columns" control. -``` - -### ✅ Fix UI/UX issues: tooltips on disabled elements, passive model indicators, and home page login logic -**Status:** PASS -**Evidence:** -```text -- Tooltips on disabled elements: - - `app/(build-model)/plant/page.tsx` wraps the disabled "UPLOAD Plants FASTA" tab - in a `Tooltip` attached to a non-disabled wrapper (``), enabling hover - tooltips while the tab remains click-disabled. - -- Passive model indicators: - - `app/model/[...path]/page.tsx` replaces interactive MUI `Button` components - for "Rebuild Model", "Blast Genome", etc. with non-interactive gray `Box` - elements that act as passive indicators. - -- Home page login logic: - - `app/page.tsx` imports `useAuth` from `components/auth/AuthProvider` and - calls `login('RAST' | 'PATRIC', username, password)` in a form `onSubmit` - handler. - - The hero section conditionally renders: - - A login form when `isAuthenticated === false` - - A "Welcome back" summary and "Continue to ModelSEED" button when - `isAuthenticated === true`. - - Inline error state (`Alert`) is shown if the `login` call throws. - -- Workspace UX for user-data: - - `app/(user-data)/my-models/page.tsx` and `app/(user-data)/myMedia/page.tsx` - now swallow `Workspace.ls` failures into a local `loadError` flag and return - an empty array, avoiding `console.error` spam while still surfacing a clear - inline error message in the UI when the Workspace endpoint returns 500. - -- Commands: - - `npm test` is not available in this project (`npm error Missing script: "test"`). - - `npm run lint` was executed and completed with existing lint errors - unrelated to the edited files; no new errors were introduced in the - modified Phase‑16 files (warnings remain elsewhere in the codebase). -``` - -## Verdict -PASS — Within this environment, all Phase 16 objectives are satisfied in code: headers and pagination are consistent across the specified tables, UI/UX issues are addressed, home-page authentication is wired to the shared auth context, and user-data Workspace failures are handled cleanly with clear messaging and without excessive console noise. - -## Gap Closure Required -- None for Phase 16; future issues can be handled in later phases if new requirements arise. - -## Timestamp Log -- Created: 2026-03-11 19:35:00 -06:00 -- Updated: 2026-03-11 19:55:00 -06:00 - Added Plan 16.5 coverage, Workspace UX improvements, and upgraded verdict to PASS. - - diff --git a/.gsd/phases/17/17.1-PLAN.md b/.gsd/phases/17/17.1-PLAN.md deleted file mode 100644 index 563a9f97..00000000 --- a/.gsd/phases/17/17.1-PLAN.md +++ /dev/null @@ -1,84 +0,0 @@ ---- -phase: 17 -plan: 1 -wave: 1 ---- - -# Plan 17.1: Workspace & modelseed-api Research and Auth Flow Mapping - -## Objective -Understand why authenticated users cannot see **My Models** and **My Media**, map the current Workspace JSON-RPC usage, and design a safe integration path with the new `modelseed-api` workspace proxy while preserving RAST/PATRIC login flows. - -## Context -- `.gsd/SPEC.md` -- `.gsd/ROADMAP.md` -- `lib/api/workspace.ts` -- `components/auth/AuthProvider.tsx` -- `app/(user-data)/my-models/page.tsx` -- `app/(user-data)/myMedia/page.tsx` -- `app/(build-model)/plant/page.tsx` -- Workspace service repo: [`cshenry/Workspace`](https://github.com/cshenry/Workspace) -- New backend API: [`ModelSEED/modelseed-api`](https://github.com/ModelSEED/modelseed-api) - -## Tasks - - - Document current Workspace JSON-RPC usage and permission failures - - - /home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/lib/api/workspace.ts - - /home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/app/(user-data)/my-models/page.tsx - - /home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/app/(user-data)/myMedia/page.tsx - - - - Trace how `workspaceLs` and `workspaceGet` are currently called from the UI, including the paths passed (e.g. `/user/home/models/`, `/user/home/media/`). - - Record how the P3 Workspace URL and auth token are configured (e.g. via `WORKSPACE_URL` and `AUTH_STORAGE_KEY`). - - Reproduce the 500 errors in a dev environment and capture the full JSON-RPC request/response pair, including the `_ERROR_User lacks permission to / for requested action!_ERROR_` message. - - Produce a short summary in `.gsd/phases/17/RESEARCH.md` that explains which operations (ls/get) fail for which paths and under what token. - - Open the app with dev logging enabled, hit `/my-models` and `/myMedia`, and confirm that the captured logs and RESEARCH.md clearly describe the failing Workspace methods, paths, and permission errors. - RESEARCH.md documents the current Workspace integration, the exact failing calls, and the permission error semantics for the provided test accounts. - - - - Map RAST/PATRIC auth tokens through AuthProvider to backend expectations - - - /home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/components/auth/AuthProvider.tsx - - /home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/lib/api/auth.ts - - - - Confirm how `loginPatric` and `loginRast` return tokens (raw PATRIC token vs. other formats) and how `persistAuth` stores them. - - Verify how the token is attached to requests (`Authorization` header value) in both the direct Workspace client and any existing API clients. - - Cross-check `modelseed-api`'s expectations for the `Authorization` header on `/api/workspace/*` and `/api/models` / `/api/media` calls (per its README). - - Add the findings and any mismatches (e.g. required prefixes, token types) to RESEARCH.md. - - Use the test RAST (`seaver/bollocks`) and PATRIC (`samseaver@gmail.com/bollocks`) logins to inspect network requests after sign-in and ensure the stored token format and outgoing headers are clearly described in RESEARCH.md. - Auth token formats and header usage are fully documented, including how they must be passed to P3 Workspace and `modelseed-api`. - - - - Design target architecture for user data access via Workspace vs modelseed-api - - - /home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/.gsd/phases/17/RESEARCH.md - - - - Based on the Workspace repo and `modelseed-api` README, outline two options: - - Direct P3 Workspace JSON-RPC from the frontend (current approach). - - Routing all workspace/model/media operations through `modelseed-api` (recommended). - - For each option, enumerate: - - Required configuration (URLs, env vars, tokens). - - Pros/cons for permissions, security, and future maintenance. - - Choose a preferred target (likely `modelseed-api` as a proxy) and define which frontend pages will call which API endpoints (e.g. `/api/models`, `/api/media/public`, `/api/workspace/ls`). - - Capture this decision and a simple sequence diagram in RESEARCH.md. - - RESEARCH.md contains a clear recommendation and file-level call map that can be referenced directly by later execution plans (17.2/17.3). - There is a documented, agreed target architecture for authenticated user data access and workspace integration, with `modelseed-api` positioning clarified. - - -## Success Criteria -- [ ] RESEARCH.md explains current Workspace failures and how JSON-RPC calls are made from the UI. -- [ ] Auth token flow from RAST/PATRIC login to backend headers is fully mapped. -- [ ] A preferred integration strategy (direct Workspace vs `modelseed-api` proxy) is chosen and documented with concrete endpoint mappings. - -## Timestamp Log -- Created: 2026-03-11 20:08:00 -06:00 - diff --git a/.gsd/phases/17/17.2-PLAN.md b/.gsd/phases/17/17.2-PLAN.md deleted file mode 100644 index 7c14a337..00000000 --- a/.gsd/phases/17/17.2-PLAN.md +++ /dev/null @@ -1,65 +0,0 @@ ---- -phase: 17 -plan: 2 -wave: 2 ---- - -# Plan 17.2: Fix My Models / My Media and Build Model Authenticated Access - -## Objective -Implement the backend integration and UI changes needed so that authenticated users can reliably see their **My Models**, **My Media**, and RAST genomes in the Build Model page, while also correcting the default active tab on `/plant`. - -## Context -- `.gsd/phases/17/RESEARCH.md` (auth + workspace design from Plan 17.1) -- `lib/api/workspace.ts` -- `app/(user-data)/my-models/page.tsx` -- `app/(user-data)/myMedia/page.tsx` -- `app/(build-model)/plant/page.tsx` - -## Tasks - - - Wire My Models and My Media to the chosen backend - - - /home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/app/(user-data)/my-models/page.tsx - - /home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/app/(user-data)/myMedia/page.tsx - - /home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/lib/api/workspace.ts - - - - Based on RESEARCH.md, update the data layer to use the preferred backend: - - Either: adjust Workspace JSON-RPC `ls` calls to use the correct, permission-granted paths for the test PATRIC account. - - Or: add a thin client for `modelseed-api` (e.g. `lib/api/modelseed.ts`) that calls `/api/models` and `/api/media/public` or equivalent endpoints with the stored PATRIC token. - - Refactor `my-models` and `myMedia` pages to consume this new client instead of calling `workspaceLs` directly. - - Preserve existing table shape and routing (links to `/model/...` and `/media/...`), but ensure the underlying list comes from a backend that honours the logged-in user's permissions. - - Keep error handling user-friendly: show a concise inline message when the backend responds with permission errors, but avoid noisy console logging. - - - - Log in using the provided RAST and PATRIC credentials. - - Visit `/my-models` and `/myMedia`; confirm that models and media are listed rather than showing the generic Workspace 500 error, and that network requests hit the intended backend endpoints with 200 responses. - - Signed-in users can see their models and media on `/my-models` and `/myMedia` using the chosen backend integration, with clear messaging on failure and no unexpected Workspace permission errors. - - - - Fix default active tab on Build Model Plant page - - - /home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/app/(build-model)/plant/page.tsx - - - - Update the initial `tabIndex` state and/or `handleTabChange` logic so that, when `PLANTSEED_MAINTENANCE` is true, the default selected tab is **UPLOAD Microbes FASTA** instead of the disabled **UPLOAD Plants FASTA** tab. - - Keep the Plants tab disabled with the existing hazard tooltip so users can still hover to see the maintenance notice, but they should not land on that tab by default. - - Ensure that when maintenance is turned off in the future (`PLANTSEED_MAINTENANCE = false`), the default behavior reverts to the Plants tab or remains coherent. - - - - With `PLANTSEED_MAINTENANCE` set to true, refresh `/plant` and verify that the **UPLOAD Microbes FASTA** tab is selected while the Plants tab is disabled but hoverable for the tooltip. - - The Build Model page opens on an enabled tab (Microbes) when Plants is under maintenance, preserving the tooltip on the disabled tab. - - -## Success Criteria -- [ ] `/my-models` and `/myMedia` load real user data for the test accounts without Workspace permission 500s. -- [ ] `/plant` opens on the **UPLOAD Microbes FASTA** tab when the Plants tab is disabled, with the tooltip still visible on hover. - -## Timestamp Log -- Created: 2026-03-11 20:10:00 -06:00 - diff --git a/.gsd/phases/17/17.3-PLAN.md b/.gsd/phases/17/17.3-PLAN.md deleted file mode 100644 index 212c5d47..00000000 --- a/.gsd/phases/17/17.3-PLAN.md +++ /dev/null @@ -1,64 +0,0 @@ ---- -phase: 17 -plan: 3 -wave: 3 ---- - -# Plan 17.3: End-to-End modelseed-api Integration & Verification - -## Objective -Connect the frontend to the new `modelseed-api` backend for authenticated operations (models, media, workspace), and verify end-to-end user workflows (My Models, My Media, Build Model, RAST Microbes) using the provided RAST/PATRIC test accounts. - -## Context -- `.gsd/phases/17/RESEARCH.md` -- [`ModelSEED/modelseed-api`](https://github.com/ModelSEED/modelseed-api) -- `lib/api/config.ts` (or equivalent configuration file) -- `lib/api/modelseed.ts` (to be created in Plan 17.2 if not already present) -- `app/(user-data)/my-models/page.tsx` -- `app/(user-data)/myMedia/page.tsx` -- `app/(build-model)/plant/page.tsx` - -## Tasks - - - Introduce configuration switch for modelseed-api vs direct Workspace - - - /home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/lib/api/config.ts - - /home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/lib/api/modelseed.ts - - - - Add configuration flags and environment variables (e.g. `MODELSEED_API_URL`, `USE_MODELSEED_API`) that control whether the frontend talks to: - - Direct P3 Workspace JSON-RPC, or - - The new `modelseed-api` REST endpoints. - - Implement a `modelseedApiFetch` helper that attaches the stored PATRIC token to requests (e.g. `Authorization: `), matching the expectations documented in the `modelseed-api` README. - - Ensure configuration defaults are safe for local development and clearly documented in comments. - - Toggle the flag in a `.env.local` file and confirm that network requests for models/media/workspace flip between P3 and `modelseed-api` endpoints without code changes. - The app can be switched between direct Workspace and `modelseed-api` via configuration, with token/URL wiring in one place. - - - - Exercise user flows against a running modelseed-api instance - - - /home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/.gsd/phases/17/VERIFICATION.md - - - - Follow `modelseed-api`'s README quick-start to run the API locally (Docker or manual) and configure the frontend to point at it. - - Log in as the provided RAST and PATRIC test users. - - Verify the following flows through `modelseed-api`: - - `/my-models` lists models using `/api/models`. - - `/myMedia` lists media via `/api/media/public` or the appropriate endpoint. - - `/plant` shows RAST genomes under "RAST Microbes" when available for the test account. - - Capture concrete evidence (request/response samples and short notes) into `.gsd/phases/17/VERIFICATION.md` for this phase. - - With `USE_MODELSEED_API` enabled, all of the above user flows succeed with 200 responses from `modelseed-api` and correct UI rendering. - End-to-end integration with `modelseed-api` is demonstrated for My Models, My Media, and Build Model (RAST Microbes) using the test accounts. - - -## Success Criteria -- [ ] A single configuration flag cleanly toggles between direct Workspace and `modelseed-api`. -- [ ] With `modelseed-api` enabled, My Models, My Media, and Build Model/RAST Microbes all function correctly for the provided test accounts. - -## Timestamp Log -- Created: 2026-03-11 20:12:00 -06:00 - diff --git a/.gsd/phases/17/RESEARCH.md b/.gsd/phases/17/RESEARCH.md deleted file mode 100644 index a25f9266..00000000 --- a/.gsd/phases/17/RESEARCH.md +++ /dev/null @@ -1,119 +0,0 @@ ---- -phase: 17 -level: 2 -researched_at: 2026-03-11T20:20:00-06:00 ---- - -# Phase 17 Research: Workspace, Auth, and modelseed-api - -## Current Workspace Usage and Failures - -- Frontend client: `lib/api/workspace.ts` - - Uses `WORKSPACE_URL` from `lib/api/config.ts`, which currently resolves to the legacy JSON-RPC endpoint: - - `https://p3.theseed.org/services/Workspace` - - All calls use JSON-RPC 1.1 with `version: '1.1'`, `method: 'Workspace.ls'` / `Workspace.get`, and `params` as arrays. - - Auth is attached via a raw token from localStorage: - - Header: `Authorization: ` (no `Bearer ` prefix), where `` comes from the stored `AuthResult` in `AUTH_STORAGE_KEY`. - -- My Models and My Media pages: - - `app/(user-data)/my-models/page.tsx` previously called: - - `workspaceLs(['/user/home/models/'])` and then shaped the result into rows. - - `app/(user-data)/myMedia/page.tsx` previously called: - - `workspaceLs(['/user/home/media/'])`. - - Both produced 500 responses from Workspace with message: - - `_ERROR_User lacks permission to / for requested action!_ERROR_` - - This indicates the JSON-RPC `ls` call is being evaluated against a root or otherwise unauthorized path for the current user/token. - -- Legacy Angular implementation (reference only, not copied): - - `external/ModelSEED-UI/app/services/ms.js`: - - Lists **models** via the `ms` service, not direct Workspace: - - `$http.rpc('ms', 'list_models', params)` and then `sanitizeModel(...)`. - - Lists **user media** using Workspace, but with a user-specific folder: - - `var path = '/' + Auth.user + '/media';` - - `WS.listL(path)` to read that folder. - - The updated React-Next UI had used generic `/user/home/models/` and `/user/home/media/` paths, which do not correspond to the per-user paths the Workspace service expects for these accounts. - -## Auth Token Flow - -- Auth is handled in `lib/api/auth.ts` and `components/auth/AuthProvider.tsx`: - - `loginPatric`: - - Calls `https://user.patricbrc.org/authenticate` with `application/x-www-form-urlencoded`. - - On success, returns an `AuthResult`: - - `user_id` extracted from `un=` in the returned token. - - `token` is the raw pipe-delimited string (`un=...|tokenid=...|expiry=...`). - - `method: 'PATRIC'`. - - `loginRast`: - - Calls `https://p3.theseed.org/Sessions/Login`. - - On success, returns an `AuthResult` `{ user_id, token, method: 'RAST' }`. - - `persistAuth`: - - Stores the entire `AuthResult` under `localStorage['auth']`. - - `AuthProvider`: - - Hydrates `authData` from `getStoredAuth()` on mount. - - Exposes `isAuthenticated`, `user`, `token`, and `method` via `useAuth()`. - -- Workspace and modelseed-api both use the same stored token: - - Workspace client attaches `Authorization: ` from `localStorage['auth']`. - - The new modelseed-api client in `lib/api/modelseed.ts` attaches the same token: - - `Authorization: ` to `/api/models` and `/api/media/public`. - - This matches the modelseed-api README, which expects the raw PATRIC token in the `Authorization` header for all /api endpoints. - -## Backend Options for User Data - -### Option A — Direct Workspace JSON-RPC from the Frontend (Current / Legacy) - -- Pros: - - Matches the original Angular UI pattern for some operations. - - No additional backend component required beyond P3 Workspace. -- Cons: - - My Models in legacy UI actually uses the `ms` service (`list_models`) rather than Workspace, so replicating behavior correctly from the browser is complex. - - Permissions and path semantics are brittle: `/user/home/models/` and `/user/home/media/` do not work for the PATRIC test accounts, yielding 500 errors with permission failures. - - Tight coupling between UI and internal Workspace JSON-RPC contract makes future migrations harder. - -### Option B — Route through modelseed-api (Recommended) - -Per [`ModelSEED/modelseed-api`](https://github.com/ModelSEED/modelseed-api): - -- Provides REST endpoints: - - `/api/models` — list user models. - - `/api/media/public` — list public media formulations. - - `/api/workspace/{op}` — proxy to PATRIC Workspace for ls/get/create/delete, etc. -- Pros: - - Hides P3 Workspace JSON-RPC details behind a stable REST interface. - - Consolidates modeling, media, and workspace operations behind one service. - - Designed to accept the PATRIC token in the `Authorization` header (exactly what the current auth stack provides). -- Cons: - - Requires running modelseed-api (Docker or manual) alongside the UI. - - Some user-specific media/list endpoints may still be evolving; we currently rely on `/api/media/public` for read-only media listings. - -### Decision - -- For Phase 17, the **preferred architecture is Option B**: - - Use `modelseed-api` for: - - `/api/models` → backing **My Models**. - - `/api/media/public` → backing **My Media** (initially as read-only listing; can be extended later if a user-specific endpoint is added). - - Keep the Workspace client for code paths that still need raw JSON-RPC, but remove it from the critical authenticated user-data flows wherever possible. - - Introduce feature flags and a base URL in `lib/api/config.ts`: - - `USE_MODELSEED_API` (from `NEXT_PUBLIC_USE_MODELSEED_API`). - - `MODELSEED_API_URL` (defaulting to `http://localhost:8000`). - -## File-Level Call Map (Target) - -- `app/(user-data)/my-models/page.tsx` - - When `USE_MODELSEED_API === true`: - - Calls `listUserModelsFromApi()` → `GET ${MODELSEED_API_URL}/api/models`. - - When `USE_MODELSEED_API === false`: - - Falls back to `workspaceLs(['/user/home/models/'])` (legacy behavior, known to be permission-fragile for some accounts). - -- `app/(user-data)/myMedia/page.tsx` - - When `USE_MODELSEED_API === true`: - - Calls `listUserMediaFromApi()` → `GET ${MODELSEED_API_URL}/api/media/public`. - - When `USE_MODELSEED_API === false`: - - Falls back to `workspaceLs(['/user/home/media/'])`. - -- `app/(build-model)/plant/page.tsx` - - Auth still via `AuthGuard` and `useAuth`. - - Phase 17 execution adjusts only tab selection logic; actual RAST Microbes integration will route through modelseed-api in a later step, using the same token. - -## Timestamp Log -- Created: 2026-03-11 20:20:00 -06:00 - diff --git a/.gsd/phases/17/VERIFICATION.md b/.gsd/phases/17/VERIFICATION.md deleted file mode 100644 index d46763e7..00000000 --- a/.gsd/phases/17/VERIFICATION.md +++ /dev/null @@ -1,102 +0,0 @@ ---- -phase: 17 -verified_at: 2026-03-11T20:25:00-06:00 -verdict: PARTIAL ---- - -# Phase 17 Verification Report — Authenticated User Data & Workspace/API Integration - -## Summary -- Implemented configuration and client wiring to talk to the new `modelseed-api` backend for **My Models** and **My Media**, and switched the Build Model page default tab when PlantSEED is in maintenance. -- Full end-to-end verification against a live `modelseed-api` instance with the provided test accounts is left to a local environment where the API and Workspace services are reachable with valid credentials. - -## Items Verified - -### ✅ modelseed-api client and configuration -**Status:** PASS -**Evidence:** -```text -- `lib/api/config.ts` now defines: - - `USE_MODELSEED_API` (from NEXT_PUBLIC_USE_MODELSEED_API). - - `MODELSEED_API_URL` (default `http://localhost:8000`). -- `lib/api/modelseed.ts` implements: - - `modelseedFetch` that reads the stored `AuthResult` from localStorage - and attaches `Authorization: ` to requests. - - `listUserModelsFromApi()` → GET `${MODELSEED_API_URL}/api/models`. - - `listUserMediaFromApi()` → GET `${MODELSEED_API_URL}/api/media/public`. -- Linting on the new files passes with no errors. -``` - -### ✅ My Models page uses modelseed-api when enabled -**Status:** PASS -**Evidence:** -```text -- `app/(user-data)/my-models/page.tsx`: - - Imports `USE_MODELSEED_API` and `listUserModelsFromApi`, plus `useAuth`. - - The `useQuery` hook: - - Uses key `['myModels', USE_MODELSEED_API, workspacePath]`. - - Is `enabled` only when `isAuthenticated` is true. - - When `USE_MODELSEED_API` is true: - - Calls `listUserModelsFromApi()` and maps each model to the existing - `MyModelItem` shape (id, orgName, counts, status, modDate, path). - - When `USE_MODELSEED_API` is false: - - Falls back to the previous `workspaceLs` call on `/user/home/models/`. - - Error message updated to mention both modelseed-api and workspace paths. -``` - -### ✅ My Media page uses modelseed-api when enabled -**Status:** PASS -**Evidence:** -```text -- `app/(user-data)/myMedia/page.tsx`: - - Imports `USE_MODELSEED_API`, `listUserMediaFromApi`, and `useAuth`. - - The `useQuery` hook: - - Uses key `['myMedia', USE_MODELSEED_API, workspacePath]`. - - Is `enabled` only when `isAuthenticated` is true. - - When `USE_MODELSEED_API` is true: - - Calls `listUserMediaFromApi()` and maps results to `MyMediaItem`. - - Normalizes boolean flags for `isMinimal` / `isDefined` into "Yes"/"No". - - When `USE_MODELSEED_API` is false: - - Falls back to `workspaceLs(['/user/home/media/'])`. - - Error message updated similarly to indicate either modelseed-api or workspace. -``` - -### ✅ Build Model default tab respects PlantSEED maintenance -**Status:** PASS -**Evidence:** -```text -- `app/(build-model)/plant/page.tsx`: - - `tabIndex` initial state changed from `useState(0)` to - `useState(PLANTSEED_MAINTENANCE ? 1 : 0)`. - - With `PLANTSEED_MAINTENANCE = true`, the second tab ("UPLOAD Microbes FASTA") - becomes the default active tab, while the first ("UPLOAD Plants FASTA") remains - disabled but wrapped in a Tooltip for the maintenance message. -- No new linter warnings were introduced in this file. -``` - -## Items Not Fully Verified (require live services) - -### ⚠ End-to-end data visibility for My Models / My Media -**Status:** PARTIAL -**Notes:** -```text -- The code paths and headers are in place for: - - `GET ${MODELSEED_API_URL}/api/models` (My Models). - - `GET ${MODELSEED_API_URL}/api/media/public` (My Media). -- Actual responses and data shapes for the provided test accounts - (`seaver/bollocks` for RAST and `samseaver@gmail.com/bollocks` for PATRIC) - depend on running modelseed-api and the upstream Workspace services. -- These flows should be exercised locally by: - 1. Starting modelseed-api per its README (Docker or manual). - 2. Setting NEXT_PUBLIC_USE_MODELSEED_API=true and NEXT_PUBLIC_MODELSEED_API_URL - to the running API. - 3. Logging in via the UI and loading `/my-models` and `/myMedia`, - confirming 200 responses and the presence of expected rows. -``` - -## Verdict -PARTIAL — All planned Phase 17 code changes are in place and lint-clean, but full verification requires a local environment with live access to P3 Workspace and modelseed-api using the provided test accounts. - -## Timestamp Log -- Created: 2026-03-11 20:25:00 -06:00 - diff --git a/.gsd/phases/18/18.1-PLAN.md b/.gsd/phases/18/18.1-PLAN.md deleted file mode 100644 index 3cafadbe..00000000 --- a/.gsd/phases/18/18.1-PLAN.md +++ /dev/null @@ -1,69 +0,0 @@ ---- -phase: 18 -plan: 1 -wave: 1 ---- - -# Plan 18.1: modelseed-api Backend Verification - -## Objective -Design and implement a repeatable test suite that verifies the behaviour of the Poplar `modelseed-api` deployment for the main endpoints we depend on (models, media, jobs, workspace proxy, health), using real PATRIC tokens. - -## Context -- `.gsd/SPEC.md` -- `.gsd/ROADMAP.md` -- `.gsd/phases/17/RESEARCH.md` -- [`ModelSEED/modelseed-api`](https://github.com/ModelSEED/modelseed-api) -- Poplar deployment: - - Base URL: `http://poplar.cels.anl.gov:8000` - - Docs: `http://poplar.cels.anl.gov:8000/docs` - - Demo: `http://poplar.cels.anl.gov:8000/demo/` -- Environment variables: - - `NEXT_PUBLIC_MODELSEED_API_URL` - - `NEXT_PUBLIC_USE_MODELSEED_API` - -## Tasks - - - Define API test matrix and environment for Poplar instance - - - /home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/.gsd/phases/18/RESEARCH.md - - - - From José's message and `modelseed-api` README, list all endpoints we care about for this UI: - - Models: `/api/models`, `/api/models/data`, `/api/models/export`, `/api/models/gapfills`, `/api/models/fba`. - - Media: `/api/media/public`, `/api/media/mine`. - - Jobs: `/api/jobs`, `/api/jobs/reconstruct`, `/api/jobs/gapfill`, `/api/jobs/fba`. - - Workspace proxy: `/api/workspace/ls`, `/get`, `/create`, `/delete`, `/permissions`, `/download-url`. - - Health: `/api/health`. - - Document expected authentication contract (PATRIC token in `Authorization` header) and how test tokens are supplied (for example, via an environment variable such as `MODELSEED_PATRIC_TOKEN`). - - Capture this test matrix and environment assumptions in `RESEARCH.md` so later plans can implement tests without re-reading external documentation. - - Open the Swagger docs at `http://poplar.cels.anl.gov:8000/docs` and confirm every endpoint in the matrix exists with the expected method and path. - `RESEARCH.md` contains a concrete list of endpoints, methods, and auth assumptions that match the Poplar deployment. - - - - Plan automated backend verification suite - - - /home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/.gsd/phases/18/RESEARCH.md - - - - Decide on a test harness (for example, a small Node test runner using `fetch` or a Python `pytest` suite in a `tests/modelseed-api` folder). - - For each endpoint in the matrix, define: - - A simple "happy path" request using a valid PATRIC token. - - The minimum shape of the expected response (for example, list of models not empty, model detail for a known `ref`, non-empty media list). - - Any negative tests that matter (for example, unauthenticated requests returning 401 or 403). - - Record the proposed folder layout and command line entry point (for example, `npm run test:modelseed-api` or `pytest tests/modelseed_api`) in `RESEARCH.md`. - - `RESEARCH.md` includes a clear description of how the automated suite will be structured and how to run it locally against Poplar. - There is an agreed plan for a backend verification suite that can be implemented in a later execute phase without redoing design work. - - -## Success Criteria -- [ ] All critical `modelseed-api` endpoints required by the UI are listed with method, path, and auth assumptions. -- [ ] There is a documented plan for an automated test suite that can be run against the Poplar deployment with a PATRIC token. - -## Timestamp Log -- Created: 2026-03-12 15:32:00 -05:00 - diff --git a/.gsd/phases/18/18.1-SUMMARY.md b/.gsd/phases/18/18.1-SUMMARY.md deleted file mode 100644 index 480a3b95..00000000 --- a/.gsd/phases/18/18.1-SUMMARY.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -phase: 18 -wave: 1 -type: research-and-connectivity ---- - -# Phase 18.1 Summary: Research and Connectivity Setup - -## Accomplishments -- Established an SSH tunnel to `poplar.cels.anl.gov` for local `modelseed-api` access. -- Verified `modelseed-api` health and model endpoints via the tunnel. -- Developed and verified `scripts/test-modelseed-api.sh` for automated backend checks. -- Diagnosed the `apiMedia.map is not a function` bug: identified raw dictionary response and positional workspace array format as the cause. -- Updated Phase 18 plans to include specific bug fix tasks. - -## Deliverables -- `scripts/test-modelseed-api.sh`: Executable bash script for API verification. -- `.env.local`: Configured with `NEXT_PUBLIC_MODELSEED_API_URL=http://localhost:8000`. -- `.gsd/phases/18/RESEARCH.md`: Full analysis of API responses and bug root cause. - -## Empirical Evidence -- Health Check: `curl http://localhost:8000/api/health` -> 200 OK. -- Auth Check: `scripts/test-modelseed-api.sh` confirmed model retrieval with token. -- Bug Check: `curl` results in `RESEARCH.md` show the dictionary format for media. - -## Timestamp Log -- Created: 2026-03-12 13:45:00 -05:00 diff --git a/.gsd/phases/18/18.2-PLAN.md b/.gsd/phases/18/18.2-PLAN.md deleted file mode 100644 index 69f15677..00000000 --- a/.gsd/phases/18/18.2-PLAN.md +++ /dev/null @@ -1,93 +0,0 @@ ---- -phase: 18 -plan: 2 -wave: 2 ---- - -# Plan 18.2: Frontend End-to-End Testing for modelseed-api Flows - -## Objective -Define and set up a front-end test plan that exercises the main authenticated user flows against the Poplar `modelseed-api` instance, including My Models, My Media, Build Model, and reference data, using real PATRIC accounts. - -## Context -- `.gsd/SPEC.md` -- `.gsd/ROADMAP.md` -- `.gsd/phases/17/VERIFICATION.md` -- Frontend routes: - - `app/(user-data)/my-models/page.tsx` - - `app/(user-data)/myMedia/page.tsx` - - `app/(build-model)/plant/page.tsx` - - `app/(reference-data)/biochem/*` - - `app/(reference-data)/genomes/*` and `list-media/page.tsx` -- Environment: - - Next.js dev server on `http://localhost:3000` - - modelseed-api on `http://poplar.cels.anl.gov:8000` - - `NEXT_PUBLIC_USE_MODELSEED_API=true` - -## Tasks - - - Design UI test scenarios for authenticated flows - - - /home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/.gsd/phases/18/RESEARCH.md - - - - Define a minimal but complete set of manual or automated scenarios that must pass before we consider the modelseed-api integration stable: - - Sign in with a PATRIC account and land on the home page. - - Navigate to `/my-models` and confirm a non-empty table of models. - - Navigate to `/myMedia` and confirm a non-empty table of media. - - Open `/plant` and confirm: - - The correct default tab is selected (Microbes when Plants is under maintenance). - - RAST Microbes grid is populated for the test account, if available. - - Navigate through reference data tabs and confirm toolbar parity (search, filters, manage columns, pagination) while data loads successfully. - - For each scenario, describe: - - Required test account (for example, the PATRIC user mentioned by José). - - Exact steps in the browser. - - Expected UI outputs (including any important console or network checks). - - Record these scenarios in `RESEARCH.md` under a dedicated "UI Test Scenarios" section. - - Review `RESEARCH.md` and confirm that all key authenticated flows are covered by at least one scenario and can be executed manually by another developer. - There is a documented set of end-to-end UI scenarios for the main modelseed-api flows. - - - - Choose and specify a front-end test harness - - - /home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/.gsd/phases/18/RESEARCH.md - - - - Decide whether automated front-end tests will be implemented using: - - Playwright, Cypress, or a similar browser automation framework, or - - A lighter-weight script-based approach plus a documented manual checklist. - - For the chosen tool, outline: - - How it will be wired into this repo (for example, `tests/e2e/` with Playwright). - - How auth will be handled (for example, entering credentials in the login form versus injecting a token). - - How to run the suite locally (commands, environment variables). - - Capture this harness design and reasoning in `RESEARCH.md` so it can be implemented in a later execute phase without redoing the decision-making. - - `RESEARCH.md` provides enough detail for another developer to add automated tests or follow the manual plan without ambiguity. - The repository has a clear and documented strategy for front-end end-to-end testing against modelseed-api. - - - - Fix media endpoint response format mapping - - - /home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/lib/api/modelseed.ts - - - - Update `lib/api/modelseed.ts` to correctly handle the dictionary format returned by `/api/media/public`. - - Implement a mapping function to convert the Workspace positional arrays (e.g., `["Name", "Type", "Path", "Date", "ID", ...]`) into the named `ModelseedMediaSummary` objects. - - Flatten the results so that all media from all paths in the response object are returned as a single array. - - Run `scripts/test-modelseed-api.sh` and ensure the media check passes, then verify the `/myMedia` page in the browser no longer throws the `apiMedia.map` error. - The media endpoint bug is fixed and data is correctly displayed in the UI. - - - -## Success Criteria -- [ ] A documented list of UI scenarios covering My Models, My Media, Build Model, and reference-data flows with modelseed-api enabled. -- [ ] A chosen front-end test harness and integration plan recorded in `RESEARCH.md`. - -## Timestamp Log -- Created: 2026-03-12 15:34:00 -05:00 - diff --git a/.gsd/phases/18/RESEARCH.md b/.gsd/phases/18/RESEARCH.md deleted file mode 100644 index 0c1d9807..00000000 --- a/.gsd/phases/18/RESEARCH.md +++ /dev/null @@ -1,93 +0,0 @@ ---- -phase: 18 -level: 2 -researched_at: 2026-03-12T15:35:00-05:00 ---- - -# Phase 18 Research: modelseed-api and End-to-End Testing - -This file is the shared research log for Phase 18 plans. Use it to record: - -- The endpoint matrix and test expectations for the Poplar `modelseed-api` instance. -- The chosen backend and frontend test harnesses. -- Any environment assumptions (tokens, base URLs, configuration flags) required to run the tests. - -Initial context from José: - -- Base URL: `http://poplar.cels.anl.gov:8000` -- Health check: `/api/health` -- Docs: `/docs` (Swagger) and `/demo/` (demo dashboard) -- Authentication: PATRIC token in the `Authorization` header for all `/api/*` endpoints. - -## Endpoint Matrix & Health Status (Updated via SSH Tunnel) - -| Service | Endpoint | Method | Auth Required | Status | Result | -| :--- | :--- | :--- | :--- | :--- | :--- | -| **Health** | `/api/health` | `GET` | No | ✅ PASS | `{"status":"ok","version":"0.1.0"}` | -| **Models** | `/api/models` | `GET` | Yes | ✅ PASS | 200 OK (Data retrieved) | -| **Media** | `/api/media/public` | `GET` | Yes* | ⚠️ 401 | Requires token even for public media | -| **Media** | `/api/media` | `GET` | Yes | ❌ 404 | Endpoint does not exist as guessed | - -## Auth Contract - -- **Header**: `Authorization: ` -- **Format**: Raw token string. -- **Verification**: Confirmed working against `/api/models` over tunnel. - -## Connectivity: SSH Tunnel Success -- **Tunnel Command**: `ssh -L 8000:localhost:8000 poplar` -- **Verification**: `curl http://localhost:8000/api/health` returns valid JSON. -- **Env Config**: `NEXT_PUBLIC_MODELSEED_API_URL=http://localhost:8000` - -## Revised Test Findings - -1. **Backend (SSH tunnel + script)** - - `/api/health` returns `{"status":"ok","version":"0.1.0"}` via `http://localhost:8000/api/health`. - - `/api/models` returns 200 with a non-empty list when called with a valid PATRIC token in `Authorization`. - - `/api/media/public` returns 401 without a token and 200 with the token, confirming that the Poplar deployment currently requires auth even for “public” media. - - `/api/media` returns 404; the guessed endpoint does not exist and callers must stick to `/api/media/public` (and `/api/media/mine` if/when exposed). - -2. **Frontend (Next dev server + browser tests)** - - Home page login using `samseaver@gmail.com / bollocks` currently fails with `RAST login failed (HTTP 401)` via the RAST flow, even though direct PATRIC auth works via `curl`. This prevents the UI from reaching an authenticated state. - - Because login fails, `/my-models`, `/myMedia`, and `/plant` all render `Authentication Required` guards and cannot yet exercise the `modelseed-api` integration end to end from the browser. - - Reference data pages (Reactions, Compounds, Media Formulations, Public Plant Models, Subsystems) all show the standardized toolbar (search, Filters, Columns, pagination) and load their respective tables without any modelseed-api-related console or network errors. - -3. **Implications for future work** - - The backend `modelseed-api` stack is behaving as expected for health, models, and media (with the caveat about `/api/media` 404), and the test harness script `scripts/test-modelseed-api.sh` is a reliable way to re-verify it. - - The main blocker for full Phase 17/18 end-to-end verification is the frontend auth flow (RAST login), not the `modelseed-api` itself. - -## Discovery: Media Endpoint Response Format Bug - -During end-to-end testing, the error `apiMedia.map is not a function` was observed on the `/myMedia` page. - -### Technical Analysis -- **Endpoint**: `GET /api/media/public` and `GET /api/media/mine` (verified via `openapi.json` and Poplar debug). -- **Format**: Dictionary of workspace folders to positional arrays: `{"/path": [[name, type, path, date, id, ...], ...]}`. -- **Root Cause**: The frontend was calling `/api/media` (which is invalid/404) or expecting a flat array of objects, but the API requires specific sub-paths and returns a nested dictionary of tuples. - -### New Discovery: Mine vs Public Media -- **Endpoints**: - - `GET /api/media/public`: Returns reference media (e.g., from `/chenry/public/modelsupport/media`). - - `GET /api/media/mine`: Returns custom media formulas for the authenticated user. -- **Observed Bug**: `GET /api/media/mine` currently returns a 500 Internal Server Error for the test account (`seaver@patricbrc.org`) on Poplar. The backend error body indicates a failure to communicate with the legacy Workspace service: - `{"detail":"500 Server Error: Internal Server Error for url: https://p3.theseed.org/services/Workspace"}` -- **Workaround**: The frontend now handles both endpoints, flattens the dictionary response, and gracefully handles 500/404 errors by returning an empty list (preventing the `apiMedia.map` crash). - -### Impacts -- **CRITICAL**: The personal media endpoint `GET /api/media` returns a **404 Not Found** on the current Poplar deployment. -- **Frontend Behavior**: `listUserMediaFromApi()` is configured to attempt the private endpoint. If it fails (as it does now), it returns an empty array `[]` and logs a warning to prevent a page crash. -- **Reference Data**: The public endpoint `/api/media/public` works but is **not** used for the "My Media" page to maintain technical accuracy. - -### Required Fixes -1. **Backend Activation**: The private `/api/media` endpoint needs to be enabled on the Poplar server. -2. **Verify Endpoint Contract**: Once activated, ensure it returns data in a consistent format (objects or positional arrays). - - -## Timestamp Log -- Created: 2026-03-12 15:35:00 -05:00 -- Updated: 2026-03-12 12:55:00 -05:00 (Auth tests confirmed) -- Updated: 2026-03-12 13:05:00 -05:00 (Tunnel & API verification complete) -- Updated: 2026-03-12 16:10:00 -05:00 (Backend script results and frontend UI findings recorded) -- Updated: 2026-03-12T13:30:00-05:00 (Discovered media endpoint response format bug) - - diff --git a/.gsd/phases/18/VERIFICATION.md b/.gsd/phases/18/VERIFICATION.md deleted file mode 100644 index 64ae6db4..00000000 --- a/.gsd/phases/18/VERIFICATION.md +++ /dev/null @@ -1,35 +0,0 @@ ---- -phase: 18 -verified_at: 2026-03-12 14:15:00 -05:00 -verdict: PASS ---- - -# Phase 18 Verification Report: Research and Connectivity - -## Summary -The research and connectivity wave of Phase 18 is complete and verified. Key connectivity issues and endpoint format discrepancies have been resolved in the codebase. - -## Must-Haves - -### ✅ Connectivity (Tunnel) -- **Status**: PASS -- **Evidence**: SSH Tunnel `localhost:8000 -> poplar:8000` is active and responsive. Health check returns `{"status":"ok"}`. - -### ✅ Media Endpoint Format Fix -- **Status**: PASS -- **Evidence**: - - Verified `/api/media/public` format via curl through the tunnel. - - Implemented flattening logic for positional workspace arrays in `lib/api/modelseed.ts`. - - Updated `MyMediaPage` to use `/api/media/mine` and `MediaPage` (Reference Data) to use `/api/media/public`. - - Gracefully handled 500 errors on `mine` endpoint to prevent UI crashes. - -### ✅ Model Retrieval -- **Status**: PASS -- **Evidence**: `scripts/test-modelseed-api.sh` confirmed `/api/models` returns model list for authenticated user. - -### ✅ Environment Integrity -- **Status**: PASS -- **Evidence**: `.env.local` configured with the correct tunnel URL. `USE_MODELSEED_API` is active. - -## Known Limitations -- `/api/media/mine` currently returns a 500 error on the Poplar instance for some accounts. The frontend handles this by returning an empty list instead of crashing. diff --git a/.gsd/phases/19/19.1-PLAN.md b/.gsd/phases/19/19.1-PLAN.md deleted file mode 100644 index d71fc20b..00000000 --- a/.gsd/phases/19/19.1-PLAN.md +++ /dev/null @@ -1,67 +0,0 @@ ---- -phase: 19 -plan: 1 -wave: 1 -depends_on: [] -files_modified: ["app/(build-model)/plant/page.tsx", "app/(user-data)/myMedia/page.tsx"] -autonomous: true -user_setup: [] - -must_haves: - truths: - - "Build Model tabs no longer log prop-bleeding errors (fullWidth, indicator, etc)." - - "My Media page disables the 'Create New Media' button and shows maintenance banner." - artifacts: - - "app/(build-model)/plant/page.tsx updated with label-wrapped Tooltip." - - "app/(user-data)/myMedia/page.tsx updated with Alert and disabled button." ---- - -# Plan 19.1: Hotfixes & Maintenance State - - -Verify and finalize the reliability fixes for the Build Model flow and the My Media maintenance state. This ensures a clean baseline for feature implementation. - - - -- app/(build-model)/plant/page.tsx -- app/(user-data)/myMedia/page.tsx - - - - - - Finalize Prop Bleeding Fixes - app/(build-model)/plant/page.tsx - - Ensure the Tooltip is wrapped around the label content INSIDE the Tab component, rather than wrapping the Tab component itself. Verify that no custom props like `PLANTSEED_MAINTENANCE` or others are accidentally passed to the DOM element. - AVOID: Wrapping the Tab component directly with a Tooltip, as MUI Tabs inject index/onChange props that the Tooltip then passes to the Tab's underlying DOM element. - - Check browser console for 'React does not recognize the `fullWidth` prop on a DOM element' errors. - Console is free of Tab-related prop errors. - - - - Disable Placeholder Features in My Media - app/(user-data)/myMedia/page.tsx - - Disable the 'Create New Media' button. Add a prominent Alert component explaining that the feature is read-only due to legacy workspace sync issues. - - Button is visually disabled and non-clickable. - Maintenance state is clearly communicated and non-functional buttons are disabled. - - - - - -After all tasks, verify: -- [ ] No prop errors in console during Build Model tab switching. -- [ ] My Media page reflects maintenance status. - - - -- [ ] All hotfixes verified. -- [ ] UI reliability baseline established for Phase 19. - - -## Timestamp Log -- Created: 2026-03-12 17:18:00 -05:00 diff --git a/.gsd/phases/19/19.1-SUMMARY.md b/.gsd/phases/19/19.1-SUMMARY.md deleted file mode 100644 index 5eb51f59..00000000 --- a/.gsd/phases/19/19.1-SUMMARY.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -phase: 19 -plan: 1 -wave: 1 ---- - -# Phase 19.1 Summary: Hotfixes and Maintenance State - -## Accomplishments -- Confirmed the Build Model Plant tab uses label-wrapped `Tooltip` inside `Tab`, avoiding MUI prop bleeding. -- Kept PlantSEED maintenance behavior active and defaulted the page to a non-disabled tab. -- Updated My Media to hard-disable `Create New Media` and removed the placeholder click handler. -- Preserved the maintenance warning banner that explains the temporary read-only state. - -## Deliverables -- `app/(build-model)/plant/page.tsx`: Tab maintenance and tooltip structure verified. -- `app/(user-data)/myMedia/page.tsx`: Disabled create button and maintenance read-only UX. - -## Empirical Evidence -- Static verification: `Create New Media` button now has `disabled` and no action handler. -- Targeted lint pass: `npx eslint app/(build-model)/plant/page.tsx app/(user-data)/myMedia/page.tsx`. -- Project build pass: `npm run build` completed successfully. - -## Timestamp Log -- Created: 2026-03-12 17:30:33 -05:00 diff --git a/.gsd/phases/19/19.2-PLAN.md b/.gsd/phases/19/19.2-PLAN.md deleted file mode 100644 index 5a49e658..00000000 --- a/.gsd/phases/19/19.2-PLAN.md +++ /dev/null @@ -1,83 +0,0 @@ ---- -phase: 19 -plan: 2 -wave: 1 -depends_on: [] -files_modified: ["components/ui/DownloadModelMenu.tsx", "components/ui/DeleteModelModal.tsx", "app/(user-data)/my-models/page.tsx"] -autonomous: true -user_setup: [] - -must_haves: - truths: - - "Models can be exported in SBML, JSON, and TSV formats." - - "A confirmation modal prevents accidental model deletion." - artifacts: - - "components/ui/DownloadModelMenu.tsx exists." - - "components/ui/DeleteModelModal.tsx exists." - - "app/(user-data)/my-models/page.tsx contains the 'Commands' column." ---- - -# Plan 19.2: Model Management Components (Download/Delete) - - -Implement the 'Commands' column in the My Models view, providing download (export) and delete functionality using Option A (reusable components). - - - -- app/(user-data)/my-models/page.tsx -- lib/api/modelseed.ts (exportModelFromApi, deleteModelFromApi) -- external/ModelSEED-UI/app/views/my-models.html (Reference for formats) - - - - - - Create DownloadModelMenu Component - components/ui/DownloadModelMenu.tsx - - Create a component that opens a MUI Menu when a 'Download' button is clicked. - Options: SBML, JSON, TSV. - Logic: Triggers `exportModelFromApi` and handles the Blob download (creating a temp URL and triggering a click). - - Clicking 'SBML' triggers a file download in the browser. - Export functionality is modularized and working. - - - - Create DeleteModelModal Component - components/ui/DeleteModelModal.tsx - - Create a simple MUI Dialog component for delete confirmation. - Logic: Takes `modelId` and `ref`. On confirm, calls `deleteModelFromApi` and potentially triggers a query invalidation for 'myModels'. - - Modal appears on click; deletion is confirmed via API. - Safe deletion flow implemented. - - - - Integrate Controls into My Models Table - app/(user-data)/my-models/page.tsx - - Add a 'Commands' column to the DataGrid. - Render the `DownloadModelMenu` and a 'Delete' button (which triggers `DeleteModelModal`) for each row. - - Columns are aligned and actions are functional. - My Models page reaches functional parity for list management. - - - - - -After all tasks, verify: -- [ ] 'Commands' column visible in list. -- [ ] Export works for all 3 formats. -- [ ] Delete flow is secure with confirmation. - - - -- [ ] All management controls verified. -- [ ] Parity with legacy 'My Models' lists achieved. - - -## Timestamp Log -- Created: 2026-03-12 17:20:00 -05:00 diff --git a/.gsd/phases/19/19.2-SUMMARY.md b/.gsd/phases/19/19.2-SUMMARY.md deleted file mode 100644 index 3a8e4762..00000000 --- a/.gsd/phases/19/19.2-SUMMARY.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -phase: 19 -plan: 2 -wave: 1 ---- - -# Phase 19.2 Summary: Model Management Components - -## Accomplishments -- Created reusable download menu component for SBML, JSON, and TSV exports. -- Created reusable delete confirmation modal with safe confirmation flow and error display. -- Added `Commands` column to My Models table and wired per-row download/delete controls. -- Wired deletion to query refresh so the model list updates after successful removal. - -## Deliverables -- `components/ui/DownloadModelMenu.tsx`: Export options and blob download flow. -- `components/ui/DeleteModelModal.tsx`: Confirmation dialog and delete API action. -- `app/(user-data)/my-models/page.tsx`: Commands column integration and refetch on delete. - -## Empirical Evidence -- Targeted lint pass: - - `npx eslint app/(user-data)/my-models/page.tsx components/ui/DownloadModelMenu.tsx components/ui/DeleteModelModal.tsx` -- Project build pass: `npm run build` completed successfully. - -## Timestamp Log -- Created: 2026-03-12 17:30:33 -05:00 diff --git a/.gsd/phases/19/19.3-PLAN.md b/.gsd/phases/19/19.3-PLAN.md deleted file mode 100644 index a6a80d07..00000000 --- a/.gsd/phases/19/19.3-PLAN.md +++ /dev/null @@ -1,73 +0,0 @@ ---- -phase: 19 -plan: 3 -wave: 2 -depends_on: ["19.1", "19.2"] -files_modified: ["app/model/[...path]/page.tsx", "components/ui/ModelDetailHeader.tsx"] -autonomous: true -user_setup: [] - -must_haves: - truths: - - "Model detail pages load without Workspace 500 errors by handling ref segments correctly." - - "Sub-tabs like Reactions, Compounds, etc., are accessible and have unique URLs." - artifacts: - - "app/model/[...path]/page.tsx updated with tabbed navigation." - - "DataControlHeader integrated into all sub-tables." ---- - -# Plan 19.3: Model Detail UI & URL Parity - - -Reconstruct the Model Detail page to support deep data inspection (Reactions, Compounds, etc.) with strict URL parity to the legacy interface. - - - -- app/model/[...path]/page.tsx -- components/layout/DataControlHeader.tsx -- external/ModelSEED-UI/app/views/data/model.html -- external/ModelSEED-UI/app/views/data/model-generic.html - - - - - - Implement Tabbed Navigation & URL Sync - app/model/[...path]/page.tsx - - Update the dynamic route to handle optional sub-path segments (e.g., ...path = ['seaver@patricbrc.org', 'modelseed', 'patrictest_121620', 'reactions']). - Map these segments to tabs: Overview, Reactions, Compounds, Genes, Compartments, Biomass, Pathways. - AVOID: Hardcoding tab state; use the URL as the source of truth. - - Navigating to /model/.../reactions highlights the Reactions tab. - Strict URL parity achieved for model hierarchy. - - - - Reconstruct Model Data Tables - app/model/[...path]/page.tsx - - For each tab (Reactions, Compounds, etc.), implement a high-fidelity DataGrid. - Integrate `DataControlHeader` for consistent search/filter/column management. - Handle Workspace API 500 errors gracefully by ensuring the `ref` passed to `workspaceGet` is correctly re-joined (the current code might be losing segments). - - Tables populate correctly for verified models. - Functional parity for data exploration achieved. - - - - - -After all tasks, verify: -- [ ] Sub-tabs navigate via URL. -- [ ] Tables support search, filter, and pagination. -- [ ] Metadata (Species, etc.) reflects the model object correctly. - - - -- [ ] Model Detail page matches legacy depth and structure. -- [ ] All user-data tables standardized with consistent controls. - - -## Timestamp Log -- Created: 2026-03-12 17:22:00 -05:00 diff --git a/.gsd/phases/19/19.3-SUMMARY.md b/.gsd/phases/19/19.3-SUMMARY.md deleted file mode 100644 index 02f55253..00000000 --- a/.gsd/phases/19/19.3-SUMMARY.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -phase: 19 -plan: 3 -wave: 2 ---- - -# Phase 19.3 Summary: Model Detail UI and URL Parity - -## Accomplishments -- Reworked model detail route to use URL segment as source-of-truth tab state. -- Implemented tab URLs for `overview`, `reactions`, `compounds`, `genes`, `compartments`, `biomass`, and `pathways`. -- Added robust workspace fetch behavior that retries model refs with and without `/model` suffix. -- Replaced placeholder tab panels with DataGrid-backed tables and integrated `DataControlHeader`. -- Added reusable model detail header component to standardize title/actions/visualization controls. - -## Deliverables -- `app/model/[...path]/page.tsx`: URL-synced tabs, workspace fetch hardening, and tabular data views. -- `components/layout/DataControlHeader.tsx`: Shared search/result header for model tab tables. -- `components/ui/ModelDetailHeader.tsx`: Shared page header for model detail views. - -## Empirical Evidence -- Targeted lint pass: - - `npx eslint app/model/[...path]/page.tsx components/layout/DataControlHeader.tsx components/ui/ModelDetailHeader.tsx` -- Project build pass: `npm run build` completed successfully. - -## Timestamp Log -- Created: 2026-03-12 17:30:33 -05:00 diff --git a/.gsd/phases/19/19.4-PLAN.md b/.gsd/phases/19/19.4-PLAN.md deleted file mode 100644 index 42485325..00000000 --- a/.gsd/phases/19/19.4-PLAN.md +++ /dev/null @@ -1,104 +0,0 @@ ---- -phase: 19 -plan: 4 -wave: 1 ---- - -# Phase 19.4 Plan: DataControlHeader Integration & Search Fix - -## Problem -The DataControlHeader component exists but needs: -1. A clearer search affordance (including icon) with fully wired search callbacks. -2. Consistent integration across user data pages (My Models, My Media) so the header, not ad-hoc TextFields, controls filtering. -3. Integration across biochem reference data tabs (compounds, reactions, subsystems, media, plants) plus model-detail subtabs so tables share a single, predictable header pattern. - -## Tasks - - - Refine DataControlHeader UX and search wiring - components/layout/DataControlHeader.tsx - - Ensure the TextField inside DataControlHeader is fully interactive and visually communicates search: - - Add a leading search icon with an input adornment. - - Confirm click-to-focus and typing works and calls onSearchChange. - - Keep the component stateless so pages own filtering logic. - - Typing in the header search box updates the value and triggers onSearchChange. - DataControlHeader search input is visually clear and fully functional. - - - - Standardize My Models header/search - app/(user-data)/my-models/page.tsx - Ensure My Models uses DataControlHeader directly above the DataGrid and that its search state filters the in-memory rows; remove or avoid redundant inline TextField search elements. - My Models page displays DataControlHeader with search that filters the table. - My Models uses consistent DataControlHeader component - - - - Standardize My Media header/search - app/(user-data)/myMedia/page.tsx - Ensure My Media uses DataControlHeader directly above the DataGrid and that its search state filters the in-memory rows. - My Media page displays DataControlHeader with search that filters the table. - My Media uses consistent DataControlHeader component - - - - Apply DataControlHeader to Biochem Compounds - app/(reference-data)/biochem/compounds/page.tsx - Keep BiochemToolbar for filters/columns but add DataControlHeader above the DataGrid. Wire local search state so the header input filters compound docs while preserving server-side pagination when search is empty. - Biochem Compounds page shows DataControlHeader above the grid and typing filters the table rows. - Biochem Compounds has consistent search header - - - - Apply DataControlHeader to Biochem Reactions - app/(reference-data)/biochem/reactions/page.tsx - Keep BiochemToolbar but add DataControlHeader above the reactions DataGrid. Wire local search state that filters reaction docs (id, name, equation, aliases, pathways) while preserving server-side pagination when search is empty. - Biochem Reactions page shows DataControlHeader and typing in it filters the table. - Biochem Reactions has consistent search header - - - - Apply DataControlHeader to Subsystems (Genomes Annotations) - app/(reference-data)/genomes/Annotations/page.tsx - Add DataControlHeader above the Subsystems DataGrid and introduce local search state that filters roles, subsystems, classes, pathways, reactions, and features client-side. - Typing in the header search box filters subsystem rows. - Subsystems tab uses the shared header and search is functional. - - - - Apply DataControlHeader to Reference Media list - app/(reference-data)/list-media/page.tsx - Add DataControlHeader above the reference media DataGrid and introduce local search state that filters by ID, name, type, and flags client-side. - Typing in the header search box filters reference media rows. - Reference media tab uses the shared header and search is functional. - - - - Apply DataControlHeader to Public Plant Models - app/(reference-data)/genomes/page.tsx - Add DataControlHeader above the public plant models DataGrid and introduce local search state that filters by model ID, species name, and domain. - Typing in the header search box filters the plant models table. - Plant models tab uses the shared header and search is functional. - - - - Confirm DataControlHeader usage in model-detail subtabs - app/model/[...path]/page.tsx - Verify that each model-detail subtab (Reactions, Compounds, Genes, Compartments, Biomass, Pathways) renders DataControlHeader above its DataGrid and that the header search filters that tab's rows only. - Typing in the header search for a model-detail subtab filters that subtab's table only. - All model-detail subtabs use DataControlHeader and search is scoped correctly. - - - - Lint and build verification - Multiple - Run targeted ESLint on all touched files and then run npm run build to ensure all changes compile without errors. - Build succeeds with no errors. - All changes compile - - -## Timestamp Log -- Created: 2026-03-12 17:40:00 -05:00 -- Updated: 2026-03-12 17:55:00 -05:00 - Expanded 19.4 scope for reference/user data tabs and model-detail subtabs. diff --git a/.gsd/phases/19/19.4-SUMMARY.md b/.gsd/phases/19/19.4-SUMMARY.md deleted file mode 100644 index dede2f32..00000000 --- a/.gsd/phases/19/19.4-SUMMARY.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -phase: 19 -plan: 4 -wave: 1 ---- - -# Phase 19.4 Summary: DataControlHeader Integration & Search Fix - -## Accomplishments -- Refined DataControlHeader to include a search icon and dedicated search input, keeping it stateless and callback-driven. -- Integrated DataControlHeader into My Models and My Media pages as the primary search header above their DataGrids. -- Integrated DataControlHeader into Biochem Compounds and Biochem Reactions with local filtering layered on top of existing BiochemToolbar controls. -- Applied DataControlHeader to Subsystems (Genomes Annotations), reference Media list, and Public Plant Models with consistent client-side search filtering. - -## Deliverables -- `components/layout/DataControlHeader.tsx` - Icon-enhanced, stateless header for search + result count. -- `app/(user-data)/my-models/page.tsx` - Uses DataControlHeader for models search. -- `app/(user-data)/myMedia/page.tsx` - Uses DataControlHeader for media search. -- `app/(reference-data)/biochem/compounds/page.tsx` - Added DataControlHeader with local search. -- `app/(reference-data)/biochem/reactions/page.tsx` - Added DataControlHeader with local search. -- `app/(reference-data)/genomes/Annotations/page.tsx` - Subsystems table now has DataControlHeader-driven search. -- `app/(reference-data)/list-media/page.tsx` - Reference media table now has DataControlHeader-driven search. -- `app/(reference-data)/genomes/page.tsx` - Public plant models table now has DataControlHeader-driven search. - -## Empirical Evidence -- Targeted lint pass: - - `npx eslint components/layout/DataControlHeader.tsx app/(user-data)/my-models/page.tsx app/(user-data)/myMedia/page.tsx app/(reference-data)/biochem/compounds/page.tsx app/(reference-data)/biochem/reactions/page.tsx app/(reference-data)/genomes/Annotations/page.tsx app/(reference-data)/list-media/page.tsx app/(reference-data)/genomes/page.tsx app/model/[...path]/page.tsx` -- Project build pass: `npm run build` completed successfully. - -## Timestamp Log -- Created: 2026-03-12 17:45:00 -05:00 -- Updated: 2026-03-12 18:50:44 -05:00 - Expanded header integration to subsystems, reference media, plant models; re-verified lint and build. diff --git a/.gsd/phases/19/VERIFICATION.md b/.gsd/phases/19/VERIFICATION.md deleted file mode 100644 index 173f54ef..00000000 --- a/.gsd/phases/19/VERIFICATION.md +++ /dev/null @@ -1,57 +0,0 @@ ---- -phase: 19 -verified_at: 2026-03-12 17:50:00 -05:00 -verdict: PASS -updated_at: 2026-03-12 17:50:00 -05:00 ---- - -# Phase 19 Verification Report - -## Summary -6/6 must-haves verified (Phase 19 + 19.4) - -## Must-Haves - -### ✅ Build Model maintenance banners and prop-bleeding fix -- **Status:** PASS -- **Evidence:** `app/(build-model)/plant/page.tsx` has PLANTSEED_MAINTENANCE=true with Tooltip properly nested inside Tab label (lines 78-91). Buttons have disabled prop based on maintenance flag. `app/(user-data)/myMedia/page.tsx` has Alert banner (lines 95-99) and disabled Create New Media button (line 105). - -### ✅ My Media maintenance state -- **Status:** PASS -- **Evidence:** Alert banner with "Service Notice" at `app/(user-data)/myMedia/page.tsx:95-99`. Disabled button at line 105. - -### ✅ My Models Commands column (download + delete confirmation) -- **Status:** PASS -- **Evidence:** DownloadModelMenu and DeleteModelModal imported and rendered in Commands column at `app/(user-data)/my-models/page.tsx:121-129`. - -### ✅ Model detail tabbed data views with URL sync -- **Status:** PASS -- **Evidence:** TabKey type defines 7 tabs (overview, reactions, compounds, genes, compartments, biomass, pathways) at `app/model/[...path]/page.tsx:19-25`. Tab URLs mapped at lines 39-45. DataGrid tables for each tab at lines 212-267. - -### ✅ DataControlHeader integration (Phase 19.3) -- **Status:** PASS -- **Evidence:** DataControlHeader used in `app/model/[...path]/page.tsx:427` for model detail tabs. - -### ✅ DataControlHeader integration (Phase 19.4 - expanded) -- **Status:** PASS -- **Evidence:** DataControlHeader now integrated across: - - `app/(user-data)/my-models/page.tsx:167` - - `app/(user-data)/myMedia/page.tsx:122` - - `app/(reference-data)/biochem/compounds/page.tsx:160` - - `app/(reference-data)/biochem/reactions/page.tsx:235` -- All pages have working search with local filtering (useState + useMemo for filteredDocs). - -## Verification Commands -- Targeted lint for header/search work: - - `npx eslint components/layout/DataControlHeader.tsx app/(user-data)/my-models/page.tsx app/(user-data)/myMedia/page.tsx app/(reference-data)/biochem/compounds/page.tsx app/(reference-data)/biochem/reactions/page.tsx app/(reference-data)/genomes/Annotations/page.tsx app/(reference-data)/list-media/page.tsx app/(reference-data)/genomes/page.tsx app/model/[...path]/page.tsx` -- `npm run build` — **PASS** (compiled successfully, 23 routes generated) - -## Verdict -**PASS** — All Phase 19 and 19.4 must-haves verified with empirical evidence. - -## Timestamp Log -- Created: 2026-03-12 17:30:33 -05:00 -- Updated: 2026-03-12 17:35:00 -05:00 - Verified code/build level checks pass -- Updated: 2026-03-12 17:45:00 -05:00 - Phase 19.4 complete -- Updated: 2026-03-12 17:50:00 -05:00 - Full Phase 19 verification PASS -- Updated: 2026-03-12 18:50:44 -05:00 - Re-verified lint/build after expanding shared header usage. diff --git a/.gsd/phases/20/20.1-PLAN.md b/.gsd/phases/20/20.1-PLAN.md deleted file mode 100644 index 6077c969..00000000 --- a/.gsd/phases/20/20.1-PLAN.md +++ /dev/null @@ -1,78 +0,0 @@ ---- -phase: 20 -plan: 1 -wave: 1 ---- - -# Plan 20.1: API Client Completion (Models, Jobs, Auth) - -## Objective -Complete the frontend client coverage for the new REST API (Poplar: `MODELSEED_API_URL`) so all required model and job endpoints are available through a typed, centralized layer. Auth: PATRIC token in `Authorization` header (direct). Use new API for models, jobs, media; workspace is transitioned in Plan 20.2. Biochemistry table serving stays on Solr (see RESEARCH.md). - -## Context -- `.gsd/phases/20/RESEARCH.md` -- `lib/api/config.ts` -- `lib/api/modelseed.ts` -- `lib/api/auth.ts` - -## Tasks - - - Add typed model operations for missing `/api/models/*` endpoints - - - /home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/lib/api/modelseed.ts - - - Implement missing model API helpers with typed signatures and consistent error handling: - - `getModelData(ref)` -> `GET /api/models/data?ref=...` - - `copyModel(payload)` -> `POST /api/models/copy` - - `listModelGapfills(ref)` -> `GET /api/models/gapfills?ref=...` - - `manageModelGapfills(payload)` -> `POST /api/models/gapfills/manage` - - `getModelFba(ref)` -> `GET /api/models/fba?ref=...` - Keep existing methods (`list`, `export`, `delete`) and normalize return/throw behavior. - - Run TypeScript checks and manually call each helper from a temporary script or page action to confirm request URL, method, and auth header correctness. - All required `/api/models*` endpoints are represented by typed helpers in one client module. - - - - Add jobs client for `/api/jobs*` endpoints - - - /home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/lib/api/modelseed.ts - - - Implement job helpers for: - - `getJobs(ids)` -> `GET /api/jobs?ids=...` - - `submitReconstruct(payload)` -> `POST /api/jobs/reconstruct` - - `submitGapfill(payload)` -> `POST /api/jobs/gapfill` - - `submitFba(payload)` -> `POST /api/jobs/fba` - - `manageJob(payload)` -> `POST /api/jobs/manage` - Ensure payload typing supports the fields currently needed by Build Model and model detail actions. - - Invoke each helper with representative payloads against the tunnel-backed API and confirm non-2xx errors surface actionable messages. - Jobs API is fully callable from frontend through typed methods with shared auth/error handling. - - - - Consolidate auth header behavior for proxy compatibility - - - /home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/lib/api/modelseed.ts - - /home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/lib/api/workspace.ts - - /home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/docs/WORKSPACE.md - - - Introduce one internal auth-header helper and use it across model and workspace clients. - Keep current raw-token compatibility while documenting expected header format for tunnel/proxy deployments. - - Compare outgoing headers in browser devtools for model and workspace requests; confirm they match documented auth format. - Token/header behavior is explicit, centralized, and consistent across clients. - - -## Success Criteria -- [ ] `lib/api/modelseed.ts` covers all required model and jobs endpoints. -- [ ] Auth handling is centralized and consistent. -- [ ] Docs reflect actual token/header behavior. - -## Timestamp Log -- Created: 2026-03-12 19:26:13 -05:00 -- Updated: 2026-03-12 19:45:00 -05:00 - Align with RESEARCH: new API for models/jobs/media; Solr kept for biochem tables. diff --git a/.gsd/phases/20/20.1-SUMMARY.md b/.gsd/phases/20/20.1-SUMMARY.md deleted file mode 100644 index 94f7bf52..00000000 --- a/.gsd/phases/20/20.1-SUMMARY.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -phase: 20 -plan: 1 -completed_at: 2026-03-12 19:55:16 CDT -duration_minutes: 25 ---- - -# Summary: API Client Completion (Models, Jobs, Auth) - -## Results -- 3 tasks completed -- Typed model and jobs coverage added to the new API client -- Shared raw-token auth handling centralized for modelseed/workspace calls - -## Tasks Completed -| Task | Description | Commit | Status | -|------|-------------|--------|--------| -| 1 | Add typed model operations for missing `/api/models/*` endpoints | `c080c08` | ✅ | -| 2 | Add jobs client for `/api/jobs*` endpoints | `c080c08` | ✅ | -| 3 | Consolidate auth header behavior for proxy compatibility | `c080c08`, `bae8f40`, `abb47c9` | ✅ | - -## Deviations Applied -None — executed as planned. - -## Files Changed -- `lib/api/modelseed.ts` - added typed model/jobs helpers and cleaned media tuple mapping -- `lib/api/requestAuth.ts` - centralized raw-token header injection -- `lib/api/workspace.ts` - adopted shared auth helper -- `docs/WORKSPACE.md` - documented proxy/auth behavior - -## Verification -- `npx eslint "lib/api/modelseed.ts" "lib/api/requestAuth.ts" "lib/api/workspace.ts"`: ✅ Passed -- `npm run build`: ✅ Passed - -## Timestamp Log -- Created: 2026-03-12 19:55:16 CDT diff --git a/.gsd/phases/20/20.2-PLAN.md b/.gsd/phases/20/20.2-PLAN.md deleted file mode 100644 index 9cfe09f5..00000000 --- a/.gsd/phases/20/20.2-PLAN.md +++ /dev/null @@ -1,72 +0,0 @@ ---- -phase: 20 -plan: 2 -wave: 2 ---- - -# Plan 20.2: Workspace Transition to New API (Workspace Proxy) - -## Objective -**Transition workspace to the new API only.** All workspace operations must go through the workspace proxy: POST /api/workspace/ls, /get, /create, /delete, /copy, /metadata, /permissions, /download-url. Request/response format matches PATRIC workspace JSON-RPC but uses REST. Use `USE_NEW_PROXY=true` so `WORKSPACE_URL` points at `MODELSEED_API_URL/api/workspace`. Ensure every workspace-backed page and status check uses this path; no legacy JSON-RPC for workspace in target state. - -## Context -- `.gsd/phases/20/RESEARCH.md` -- `lib/api/config.ts` -- `lib/api/workspace.ts` -- `app/(reference-data)/genomes/page.tsx` -- `app/(reference-data)/genomes/Annotations/page.tsx` -- `app/(reference-data)/list-media/page.tsx` -- `app/model/[...path]/page.tsx` -- `app/about/version/StatusTable.tsx` - -## Tasks - - - Replace URL-shape routing in workspace client with explicit mode - - - /home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/lib/api/workspace.ts - - /home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/lib/api/config.ts - - - Route workspace through new API when `USE_NEW_PROXY` is true: POST to `{MODELSEED_API_URL}/api/workspace/{ls|get|create|delete|copy|metadata|permissions|download-url}` with PATRIC token in Authorization header. Use explicit `USE_NEW_PROXY` (no URL substring checks). Expose typed helpers for all proxy operations (ls, get, create, delete, copy, metadata, permissions, download-url). - - With USE_NEW_PROXY=true, all workspace calls go to POST /api/workspace/* and succeed with valid token. - Workspace client uses new API exclusively when USE_NEW_PROXY=true; all proxy operations implemented. - - - - Audit and adapt page-level workspace consumers for proxy parity - - - /home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/app/(reference-data)/genomes/page.tsx - - /home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/app/(reference-data)/genomes/Annotations/page.tsx - - /home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/app/(reference-data)/list-media/page.tsx - - /home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/app/model/[...path]/page.tsx - - - Ensure response parsing is compatible with proxy REST payloads as well as legacy RPC shape where needed. - Normalize data-shaping logic in one place to avoid per-page parsing drift. - - Reference-data pages and model-detail page load correctly with USE_NEW_PROXY=true against Poplar workspace proxy. - All workspace-backed pages work with new API; response parsing compatible with proxy REST payloads. - - - - Fix service status checks to test active backend mode correctly - - - /home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/app/about/version/StatusTable.tsx - - - Update status checks so Workspace/ProbModelSEED probes use mode-appropriate request format (REST vs RPC) and avoid false negatives. - - Version status page reports expected success/failure state when toggling proxy mode. - StatusTable probes are accurate under both legacy and proxy modes. - - -## Success Criteria -- [ ] Workspace client supports all required proxy operations. -- [ ] Existing workspace-backed pages load under proxy mode. -- [ ] Service status checks align with active backend mode. - -## Timestamp Log -- Created: 2026-03-12 19:26:13 -05:00 -- Updated: 2026-03-12 19:45:00 -05:00 - Scope: workspace transition to POST /api/workspace/* only; USE_NEW_PROXY=true target. diff --git a/.gsd/phases/20/20.2-SUMMARY.md b/.gsd/phases/20/20.2-SUMMARY.md deleted file mode 100644 index cb8ee01d..00000000 --- a/.gsd/phases/20/20.2-SUMMARY.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -phase: 20 -plan: 2 -completed_at: 2026-03-12 19:55:16 CDT -duration_minutes: 20 ---- - -# Summary: Workspace Transition to New API (Workspace Proxy) - -## Results -- 3 tasks completed -- Workspace defaults to the REST proxy via `USE_NEW_PROXY=true` -- Workspace response parsing moved into the shared client layer - -## Tasks Completed -| Task | Description | Commit | Status | -|------|-------------|--------|--------| -| 1 | Replace URL-shape routing in workspace client with explicit mode | `bae8f40` | ✅ | -| 2 | Audit and adapt page-level workspace consumers for proxy parity | `bae8f40` | ✅ | -| 3 | Fix service status checks to test active backend mode correctly | `bae8f40` | ✅ | - -## Deviations Applied -None — executed as planned. - -## Files Changed -- `lib/api/config.ts` - set workspace proxy as the default backend mode -- `lib/api/workspace.ts` - normalized proxy/RPC envelopes and exported workspace object parsing -- `app/(reference-data)/genomes/page.tsx` - keyed workspace list query by proxy mode -- `app/(reference-data)/genomes/Annotations/page.tsx` - replaced inline tuple parsing with shared workspace parser -- `app/(reference-data)/list-media/page.tsx` - keyed workspace/media query by proxy mode -- `app/model/[...path]/page.tsx` - consumed normalized workspace object payloads -- `app/about/version/StatusTable.tsx` - split workspace vs ProbModelSEED checks by active backend mode -- `docs/WORKSPACE.md` - documented REST proxy usage and auth behavior - -## Verification -- `npx eslint "app/about/version/StatusTable.tsx" "app/model/[...path]/page.tsx" "app/(reference-data)/genomes/page.tsx" "app/(reference-data)/genomes/Annotations/page.tsx" "app/(reference-data)/list-media/page.tsx" "lib/api/config.ts" "lib/api/workspace.ts"`: ✅ Passed -- `npm run build`: ✅ Passed - -## Timestamp Log -- Created: 2026-03-12 19:55:16 CDT diff --git a/.gsd/phases/20/20.3-PLAN.md b/.gsd/phases/20/20.3-PLAN.md deleted file mode 100644 index 16dc39c7..00000000 --- a/.gsd/phases/20/20.3-PLAN.md +++ /dev/null @@ -1,76 +0,0 @@ ---- -phase: 20 -plan: 3 -wave: 3 ---- - -# Plan 20.3: Build Model and Jobs End-to-End Activation - -## Objective -Replace Build Model placeholder flows with real job submission and status management through the new API (`/api/jobs/*`). Verify full authenticated workflows against Poplar (`MODELSEED_API_URL`). Use new API for models, jobs, media, and workspace (USE_MODELSEED_API=true, USE_NEW_PROXY=true). Biochemistry table serving remains on Solr. - -## Context -- `.gsd/phases/20/RESEARCH.md` -- `lib/api/modelseed.ts` -- `app/(build-model)/plant/page.tsx` -- `app/(user-data)/my-models/page.tsx` -- `app/model/[...path]/page.tsx` -- `components/auth/AuthProvider.tsx` - -## Tasks - - - Implement Build Model submit flows for Microbes tabs - - - /home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/app/(build-model)/plant/page.tsx - - /home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/lib/api/modelseed.ts - - - Wire "UPLOAD Microbes FASTA", "PATRIC Microbes", and "RAST Microbes" actions to `/api/jobs/reconstruct` using typed payloads. - Add input validation, submit-state UI, and surfaced API error messages. - - Submitting each supported Build Model flow creates a job record and returns a valid job id. - Build Model tabs are no longer placeholders for supported flows and can submit reconstruct jobs. - - - - Add job polling and management in user-facing pages - - - /home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/app/(user-data)/my-models/page.tsx - - /home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/app/model/[...path]/page.tsx - - /home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/lib/api/modelseed.ts - - - Use `/api/jobs?ids=...` to poll active jobs and `/api/jobs/manage` for cancel/remove operations where applicable. - Reflect job state in My Models rows and any relevant model detail actions. - - Active job statuses update in UI without page refresh; manage action reflects backend response. - Users can observe and manage long-running jobs in-app. - - - - End-to-end verification with authenticated test accounts and tunnel - - - /home/vibhav/Downloads/Work/ANL/Research/ModelSEED-UI/.gsd/phases/20/VERIFICATION.md - - - Verify complete workflows while using tunnel-backed backend: - - Login (PATRIC/RAST) - - Build model submit - - Job polling and status updates - - My Models operations (export, delete, copy/gapfill/FBA where enabled) - - Workspace proxy operations used by pages - Capture evidence (request/response snippets and UI observations). - - All critical workflows pass with USE_NEW_PROXY=true and USE_MODELSEED_API=true (Poplar). - Phase verification artifact contains empirical proof for major user journeys using new API only (except Solr biochem tables). - - -## Success Criteria -- [ ] Build Model tabs submit real jobs via `/api/jobs/reconstruct`. -- [ ] Job status/management works from UI surfaces. -- [ ] End-to-end verification evidence is captured for tunnel-backed deployment. - -## Timestamp Log -- Created: 2026-03-12 19:26:13 -05:00 -- Updated: 2026-03-12 19:45:00 -05:00 - Align with RESEARCH: new API for all flows; Solr only for biochem tables. diff --git a/.gsd/phases/20/20.3-SUMMARY.md b/.gsd/phases/20/20.3-SUMMARY.md deleted file mode 100644 index fe6609cf..00000000 --- a/.gsd/phases/20/20.3-SUMMARY.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -phase: 20 -plan: 3 -completed_at: 2026-03-12 19:55:16 CDT -duration_minutes: 30 ---- - -# Summary: Build Model and Jobs End-to-End Activation - -## Results -- 3 tasks completed at the implementation layer -- Build Model now submits reconstruct jobs through the new API -- My Models and Model Detail surface tracked job progress in-app - -## Tasks Completed -| Task | Description | Commit | Status | -|------|-------------|--------|--------| -| 1 | Implement Build Model submit flows for Microbes tabs | `920d86b` | ✅ | -| 2 | Add job polling and management in user-facing pages | `920d86b` | ✅ | -| 3 | End-to-end verification artifact for authenticated flows | `pending in VERIFICATION.md` | ✅ | - -## Deviations Applied -- [Rule 2 - Missing Critical] Added `lib/api/jobTracker.ts` so UI surfaces can retain and poll submitted job IDs across pages. - -## Files Changed -- `app/(build-model)/plant/page.tsx` - replaced placeholder microbe tabs with reconstruct submission forms -- `app/(user-data)/my-models/page.tsx` - added tracked-job polling, row-level recent job status, and cancel/dismiss controls -- `app/model/[...path]/page.tsx` - wired Run FBA / Run GapFilling buttons to jobs API -- `components/ui/ModelDetailHeader.tsx` - exposed active job actions/messages -- `lib/api/jobTracker.ts` - local tracking for submitted job IDs and statuses - -## Verification -- `npx eslint "app/(build-model)/plant/page.tsx" "app/(user-data)/my-models/page.tsx" "app/model/[...path]/page.tsx" "components/ui/ModelDetailHeader.tsx" "lib/api/jobTracker.ts"`: ✅ Passed -- `npm run build`: ✅ Passed -- Authenticated Poplar success-path verification: captured as partial in `VERIFICATION.md` because no live PATRIC token was available to the agent for end-to-end submission validation - -## Timestamp Log -- Created: 2026-03-12 19:55:16 CDT diff --git a/.gsd/phases/20/RESEARCH.md b/.gsd/phases/20/RESEARCH.md deleted file mode 100644 index 0c590d48..00000000 --- a/.gsd/phases/20/RESEARCH.md +++ /dev/null @@ -1,79 +0,0 @@ ---- -phase: 20 -level: 2 -researched_at: 2026-03-12 19:26:13 -05:00 ---- - -# Phase 20 Research - -## Target: New API (Poplar) for Everything Except Biochem Tables - -**Authority:** Backend team (José). API base: `http://poplar.cels.anl.gov:8000` (config: `MODELSEED_API_URL`). Set `USE_MODELSEED_API=true` and `USE_NEW_PROXY=true` for full migration. - -**Use the new API for:** -- **Models:** GET /api/models, GET /api/models/data?ref=, GET /api/models/export?ref=&format=, DELETE /api/models?ref=, POST /api/models/copy, GET /api/models/gapfills?ref=, POST /api/models/gapfills/manage, GET /api/models/fba?ref= -- **Jobs:** GET /api/jobs?ids=, POST /api/jobs/reconstruct, POST /api/jobs/gapfill, POST /api/jobs/fba, POST /api/jobs/manage -- **Media:** GET /api/media/public, GET /api/media/mine -- **Workspace proxy:** POST /api/workspace/ls, /get, /create, /delete, /copy, /metadata, /permissions, /download-url — request/response format matches PATRIC workspace JSON-RPC but uses REST. - -**Do not use the new API for:** -- **Biochemistry table serving:** Keep using Solr directly for biochem search and table data ("For biochem search you can keep using Solr directly — our local biochem endpoints are simpler"). Biochemistry used to *build* models may use new API where applicable; the reference data tables (compounds, reactions) stay on Solr unless otherwise specified. - -**Auth:** All new API requests require the PATRIC token in the `Authorization` header (raw token, no Bearer prefix). Pass the token directly as currently implemented. - -## Questions Investigated -1. Which new API endpoints are already integrated in frontend code? -2. What is missing for model/job/workspace parity with the new backend? -3. Where are auth token formatting and proxy toggles currently handled? - -## Findings - -### Current Integration Coverage -- Implemented in `lib/api/modelseed.ts`: - - `GET /api/models`, export, delete; model data, copy, gapfills, gapfills/manage, fba; jobs (get, reconstruct, gapfill, fba, manage). - - `GET /api/media/public`, `GET /api/media/mine` -- Implemented in `lib/api/workspace.ts`: - - Workspace JSON-RPC legacy path (`Workspace.ls`, `Workspace.get`). - - REST proxy path for ls/get when `USE_NEW_PROXY`; helpers for create, delete, copy, metadata, permissions, download-url. - -### Gaps / Implementation Notes -- Workspace must be **transitioned** to the new API: all workspace operations should go through the workspace proxy (POST /api/workspace/ls, /get, /create, /delete, /copy, /metadata, /permissions, /download-url) when `USE_NEW_PROXY=true`. No legacy JSON-RPC for workspace in the target state. -- Build Model page still needs wiring to `/api/jobs/reconstruct` and job polling. -- Biochemistry: keep existing Solr-based flows for reference data tables; do not switch biochem table serving to new API unless product decision changes. - -### Auth/Proxy Observations -- Token strategy: direct `Authorization: ` from `localStorage['auth']` — correct for Poplar. -- `USE_NEW_PROXY` and `USE_MODELSEED_API` in `lib/api/config.ts`; workspace client uses explicit `USE_NEW_PROXY` for mode selection. - -## Decisions Made -| Decision | Choice | Rationale | -|---|---|---| -| Phase numbering | Continue as Phase 20 | User requested migration continuation in a new phase | -| API approach | Use new API for models, jobs, media, workspace proxy | Backend team confirmation; Poplar is dev-stable | -| Workspace | Transition to new API via workspace proxy only | POST /api/workspace/{ls,get,create,delete,copy,metadata,permissions,download-url} | -| Biochemistry tables | Keep Solr for table serving | "Keep using Solr directly" for biochem search; user: ignore biochem for tables | -| Auth | PATRIC token in Authorization header (direct) | Current behavior is correct | - -## Patterns to Follow -- Keep auth header wiring in one helper used by all new API calls. -- Use typed request/response interfaces for model and job payloads. -- Keep feature flags (`USE_NEW_PROXY`, `USE_MODELSEED_API`) centralized in config. - -## Anti-Patterns to Avoid -- Duplicating `fetch` + auth header code in components. -- Mixing direct JSON-RPC and REST calls in page components. -- Relying on URL substring checks to determine transport mode. - -## Risks -- Token format mismatches between tunnel/proxy deployments. -- Partial migration can cause inconsistent behavior across pages. -- Build Model workflows require robust async job polling and cancellation behavior. - -## Ready for Planning -- [x] Endpoint gap map complete -- [x] Auth/proxy risk areas identified -- [x] Scope split into executable plans - -## Timestamp Log -- Created: 2026-03-12 19:26:13 -05:00 -- Updated: 2026-03-12 19:45:00 -05:00 - Scope: new API for all except Solr biochem tables; workspace transition to POST /api/workspace/*; PATRIC token auth; Poplar base URL. diff --git a/.gsd/phases/20/VERIFICATION.md b/.gsd/phases/20/VERIFICATION.md deleted file mode 100644 index 64d7af31..00000000 --- a/.gsd/phases/20/VERIFICATION.md +++ /dev/null @@ -1,51 +0,0 @@ ---- -phase: 20 -verified_at: 2026-03-12 19:55:16 CDT -verdict: PARTIAL ---- - -# Phase 20 Verification Report - -## Summary -2/3 must-haves verified at code/build level. Authenticated Poplar success-path testing remains blocked on a live PATRIC token/browser session. - -## Must-Haves - -### ✅ New API client covers models, jobs, workspace proxy, and media -**Status:** PASS -**Evidence:** -- `npx eslint "lib/api/modelseed.ts" "lib/api/requestAuth.ts" "lib/api/workspace.ts"` -- Commit history: - - `c080c08` - typed model/jobs API client coverage - - `bae8f40` - workspace proxy migration - - `abb47c9` - lint cleanup for client file - -### ✅ Workspace-backed pages and service checks build against proxy mode -**Status:** PASS -**Evidence:** -- `npx eslint "app/about/version/StatusTable.tsx" "app/model/[...path]/page.tsx" "app/(reference-data)/genomes/page.tsx" "app/(reference-data)/genomes/Annotations/page.tsx" "app/(reference-data)/list-media/page.tsx" "lib/api/config.ts" "lib/api/workspace.ts"` -- `npm run build` -- Local HTTP checks against the running dev server: - - `GET /about/version` contained version/status-table content - - `GET /plant` returned the Build Model page HTML - - `GET /my-models` returned the My Models page HTML - -### ⚠️ Authenticated job submission and polling against Poplar -**Status:** PARTIAL -**Expected:** Reconstruct, gapfill, and FBA submissions succeed end-to-end with a live PATRIC token and surface job status in-app. -**Actual:** The UI wiring, local tracking, polling, and cancellation code paths compile and lint cleanly, but the agent could not perform a live authenticated success-path run because no real PATRIC token/browser-authenticated session was available in the execution environment. -**Blocking input needed:** A real PATRIC token or an authenticated browser session against Poplar to validate request/response success for `/api/jobs/reconstruct`, `/api/jobs/gapfill`, `/api/jobs/fba`, and `/api/jobs/manage`. - -## Verification Commands -- `npx eslint "lib/api/modelseed.ts" "lib/api/requestAuth.ts" "lib/api/workspace.ts"` -- `npx eslint "app/about/version/StatusTable.tsx" "app/model/[...path]/page.tsx" "app/(reference-data)/genomes/page.tsx" "app/(reference-data)/genomes/Annotations/page.tsx" "app/(reference-data)/list-media/page.tsx" "lib/api/config.ts" "lib/api/workspace.ts"` -- `npx eslint "app/(build-model)/plant/page.tsx" "app/(user-data)/my-models/page.tsx" "app/model/[...path]/page.tsx" "components/ui/ModelDetailHeader.tsx" "lib/api/jobTracker.ts"` -- `npm run build` - -## Verdict -PARTIAL - -Phase 20 implementation is complete and committed, but full empirical verification remains blocked on authenticated access to the live Poplar backend. - -## Timestamp Log -- Created: 2026-03-12 19:55:16 CDT diff --git a/.gsd/phases/21/1-PLAN.md b/.gsd/phases/21/1-PLAN.md deleted file mode 100644 index 28b228dc..00000000 --- a/.gsd/phases/21/1-PLAN.md +++ /dev/null @@ -1,55 +0,0 @@ ---- -phase: 21 -plan: 1 -wave: 1 ---- - -# Plan 21.1: API Layer for PATRIC and RAST - -## Objective -Implement the backend communication layers to fetch genome data from PATRIC and RAST services, enabling searchable tables in the UI. - -## Context -- .gsd/SPEC.md -- .gsd/phases/21/RESEARCH.md -- lib/api/config.ts -- lib/api/requestAuth.ts - -## Tasks - - - Create PATRIC API Client - lib/api/patric.ts - - Implement `searchPatricGenomes` function using the RQL syntax researched in RESEARCH.md. - - Support query, limit, offset, and sort. - - Use `withRawTokenAuth` for authentication. - - Ensure robust error handling for fetch calls. - - Check for file existence and exporting of `searchPatricGenomes`. - - `lib/api/patric.ts` exists and contains a functional `searchPatricGenomes` function. - - - - - Update ModelSEED API with RAST Job Listing - lib/api/modelseed.ts - - Implement `listRastGenomes` function in `lib/api/modelseed.ts`. - - Use JSON-RPC 1.1 to call `msSupport.list_rast_jobs`. - - Filter results to only include jobs where `type === 'Genome'`. - - Map the legacy fields to a clean TypeScript interface. - - Check for `listRastGenomes` in `lib/api/modelseed.ts`. - - `listRastGenomes` is exported from `lib/api/modelseed.ts` and correctly filters/maps job data. - - - -## Success Criteria -- [ ] PATRIC search results can be fetched with RQL filtering. -- [ ] RAST genome jobs are listed for the authenticated user. - -## Timestamp Log -- Created: 2026-03-13 10:00:00 -05:00 diff --git a/.gsd/phases/21/1-SUMMARY.md b/.gsd/phases/21/1-SUMMARY.md deleted file mode 100644 index ddfb0235..00000000 --- a/.gsd/phases/21/1-SUMMARY.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -phase: 21 -plan: 1 -completed_at: 2026-03-13 09:57:09 CDT -duration_minutes: 20 ---- - -# Summary: API Layer for PATRIC and RAST - -## Results -- Implemented a dedicated PATRIC API client with RQL-style search, paging, and sorting. -- Added `listRastGenomes` JSON-RPC integration in the ModelSEED API client for `msSupport.list_rast_jobs`. -- Added typed interfaces and normalization for both response payloads. - -## Tasks Completed -| Task | Description | Status | -|------|-------------|--------| -| 1 | Create `lib/api/patric.ts` with `searchPatricGenomes` and robust fetch parsing/error handling | Complete | -| 2 | Add `listRastGenomes` to `lib/api/modelseed.ts` with `type === 'Genome'` filtering and typed mapping | Complete | - -## Files Changed -- `lib/api/patric.ts` -- `lib/api/modelseed.ts` - -## Verification -- `npx eslint "lib/api/patric.ts" "lib/api/modelseed.ts"`: Passed -- `npm run build`: Passed - -## Timestamp Log -- Created: 2026-03-13 09:57:09 CDT diff --git a/.gsd/phases/21/2-PLAN.md b/.gsd/phases/21/2-PLAN.md deleted file mode 100644 index 6db86c18..00000000 --- a/.gsd/phases/21/2-PLAN.md +++ /dev/null @@ -1,61 +0,0 @@ ---- -phase: 21 -plan: 2 -wave: 1 ---- - -# Plan 21.2: UI Components & Integration - -## Objective -Replace the manual text inputs in the Build Model page with interactive, searchable data grids for PATRIC and RAST genomes. - -## Context -- .gsd/SPEC.md -- .gsd/phases/21/RESEARCH.md -- .gsd/phases/21/1-PLAN.md -- app/(build-model)/plant/page.tsx -- components/layout/DataControlHeader.tsx - -## Tasks - - - Implement Genome Selection Components - - components/build-model/PatricGenomesTable.tsx - components/build-model/RastGenomesTable.tsx - - - Create searchable DataGrid components for PATRIC and RAST. - - Use `DataControlHeader` for the search bar. - - Implement server-side pagination/search for PATRIC. - - Implement client-side search for RAST (as it's a smaller user-specific set). - - Add a "Build Model" action column in each table. - - Verify components render without errors. - - `PatricGenomesTable` and `RastGenomesTable` are implemented and functional. - - - - - Integrate Tables into Build Model Page - app/(build-model)/plant/page.tsx - - Update the "PATRIC Microbes" and "RAST Microbes" tabs. - - Remove the existing `TextField` inputs for ID entry. - - Embed the new table components. - - When a user clicks "Build Model" in the table, populate the model configuration form (Template, Media, Name) for that specific selection. - - Manually verify tab switching and table loading. - - The Build Model page uses interactive tables for genome selection, and clicking "Build" initiates the configuration flow. - - - -## Success Criteria -- [ ] PATRIC tab features a searchable genome grid. -- [ ] RAST tab features a grid of user-owned genome jobs. -- [ ] Selecting a genome from either grid enables the build configuration. - -## Timestamp Log -- Created: 2026-03-13 10:05:00 -05:00 diff --git a/.gsd/phases/21/2-SUMMARY.md b/.gsd/phases/21/2-SUMMARY.md deleted file mode 100644 index 66dee6e6..00000000 --- a/.gsd/phases/21/2-SUMMARY.md +++ /dev/null @@ -1,31 +0,0 @@ ---- -phase: 21 -plan: 2 -completed_at: 2026-03-13 09:57:09 CDT -duration_minutes: 35 ---- - -# Summary: Build Model Genome Grid Integration - -## Results -- Replaced manual PATRIC/RAST genome ID entry with interactive DataGrid components. -- Added `PatricGenomesTable` (server-side search/pagination/sort) and `RastGenomesTable` (client-side search/pagination). -- Wired row-level `Build Model` actions to populate the reconstruction configuration forms in the Build Model page. - -## Tasks Completed -| Task | Description | Status | -|------|-------------|--------| -| 1 | Implement new table components using `DataControlHeader` and a `Build Model` action column | Complete | -| 2 | Integrate tables into `app/(build-model)/plant/page.tsx` and remove direct genome ID text entry | Complete | - -## Files Changed -- `components/build-model/PatricGenomesTable.tsx` -- `components/build-model/RastGenomesTable.tsx` -- `app/(build-model)/plant/page.tsx` - -## Verification -- `npx eslint "components/build-model/PatricGenomesTable.tsx" "components/build-model/RastGenomesTable.tsx" "app/(build-model)/plant/page.tsx"`: Passed -- `npm run build`: Passed - -## Timestamp Log -- Created: 2026-03-13 09:57:09 CDT diff --git a/.gsd/phases/21/RESEARCH.md b/.gsd/phases/21/RESEARCH.md deleted file mode 100644 index 4e4e59e1..00000000 --- a/.gsd/phases/21/RESEARCH.md +++ /dev/null @@ -1,47 +0,0 @@ -# Research - Phase 21: PATRIC & RAST Genome Selection Fix - -## 1. PATRIC Data API (RQL) -The legacy code in `external/ModelSEED-UI/app/services/patric.js` uses a Solr-based RQL syntax. - -- **Endpoint**: `https://www.patricbrc.org/api/genome/` -- **Common Parameters**: - - `http_accept=application/solr+json` - - `limit(L,O)`: Limit L, Offset O - - `sort(+field)` or `sort(-field)` - - `select(field1,field2,...)` - - `and(eq(field,value),...)` - - `or(eq(field,value),...)` -- **Search Logic**: - - Single word: `or(eq(genome_name,WORD*),eq(genome_id,WORD))` - - Multiple words: `and(eq(genome_name,WORD1*),eq(genome_name,WORD2*),...)` -- **Auth**: Requires `Authorization` header with the PATRIC token (raw string). - -## 2. RAST (modelseed_support) API -The legacy code in `external/ModelSEED-UI/app/services/ms.js` uses a JSON-RPC 1.1 call. - -- **Endpoint**: `https://modelseed.org/services/ms_fba` -- **Method**: `msSupport.list_rast_jobs` -- **Params**: `[{}]` (empty object within array) -- **Response Structure**: Array of job objects. - - `type === 'Genome'` indicates a successful genome reconstruction (annotation). - - Fields: `mod_time`, `genome_name`, `genome_id`, `id`, `contig_count`. -- **Auth**: Same PATRIC token. - -## 3. UI Patterns -The new UI already uses `DataGrid` from `@mui/x-data-grid` and a custom `DataControlHeader`. - -### 3.1 DataControlHeader Integration -- Existing implementations in `app/(reference-data)/genomes/page.tsx` show how to use `slots={{ toolbar: DataControlHeader }}`. -- For server-side search (PATRIC), the `onSearch` prop of `DataControlHeader` should be used to trigger a refetch with the new query. - -### 3.2 Build Model Flow -- Clicking "Build Model" in a table row should trigger a small configuration form. -- Legacy UI simply populated a form below or next to the selection. -- Modern approach: A dialog or a collapsed "Configure" section for the selected genome ensures the user doesn't lose context. - -## 4. Dependencies -- `@tanstack/react-query`: To handle fetching and caching of search results. -- `@mui/x-data-grid`: Standard data table. - -## Timestamp Log -- Created: 2026-03-13 09:55:00 -05:00 diff --git a/.gsd/phases/21/VERIFICATION.md b/.gsd/phases/21/VERIFICATION.md deleted file mode 100644 index 6fc7b3ac..00000000 --- a/.gsd/phases/21/VERIFICATION.md +++ /dev/null @@ -1,51 +0,0 @@ ---- -phase: 21 -verified_at: 2026-03-13 09:57:09 CDT -verdict: PARTIAL ---- - -# Phase 21 Verification Report - -## Summary -3/3 must-haves are implemented and compile successfully. Live authenticated API behavior in the browser remains pending manual validation with a real PATRIC/RAST token. - -## Must-Haves - -### Complete: PATRIC tab uses searchable genome grid -Status: Pass -Evidence: -- `components/build-model/PatricGenomesTable.tsx` implemented with server search (`filterMode="server"`), paging (`paginationMode="server"`), and sorting (`sortingMode="server"`). -- `app/(build-model)/plant/page.tsx` integrates the table and row selection callback. -- `npm run build`: Passed. - -### Complete: RAST tab uses user genome job grid -Status: Pass -Evidence: -- `lib/api/modelseed.ts` exports `listRastGenomes` using `msSupport.list_rast_jobs`. -- `components/build-model/RastGenomesTable.tsx` renders user jobs with DataGrid and Build action column. -- `npm run build`: Passed. - -### Complete: Build action populates reconstruction configuration -Status: Pass -Evidence: -- `app/(build-model)/plant/page.tsx` now updates `patricForm`/`rastForm` via `handlePatricGenomeSelect` and `handleRastGenomeSelect`. -- Build buttons are gated by selected genome and submit through `handleReferenceSubmit`. -- `npm run build`: Passed. - -## Remaining Manual Validation -- Confirm authenticated browser behavior for: - - PATRIC live search results - - RAST job listing for current user - - End-to-end reconstruction submit from each table tab - -## Verification Commands -- `npx eslint "lib/api/patric.ts" "lib/api/modelseed.ts" "components/build-model/PatricGenomesTable.tsx" "components/build-model/RastGenomesTable.tsx" "app/(build-model)/plant/page.tsx"` -- `npm run build` - -## Verdict -PARTIAL - -Implementation is complete and build-verified. Final runtime verification depends on an authenticated user session against live PATRIC/RAST services. - -## Timestamp Log -- Created: 2026-03-13 09:57:09 CDT diff --git a/.gsd/phases/22/1-PLAN.md b/.gsd/phases/22/1-PLAN.md deleted file mode 100644 index 98a4aaf5..00000000 --- a/.gsd/phases/22/1-PLAN.md +++ /dev/null @@ -1,55 +0,0 @@ ---- -phase: 22 -plan: 1 -wave: 1 ---- - -# Plan 22.1: Demo Endpoint Contract Hardening and Smoke Validation - -## Objective -Harden API client behavior against known demo/Poplar error shapes (especially workspace/json-rpc failures) and add a repeatable smoke test harness for models, jobs, media, and workspace endpoints. - -## Context -- .gsd/SPEC.md -- .gsd/ARCHITECTURE.md -- .gsd/phases/22/RESEARCH.md -- lib/api/modelseed.ts -- lib/api/workspace.ts -- lib/api/config.ts - -## Tasks - - - Normalize API error parsing for non-2xx JSON payloads - lib/api/workspace.ts, lib/api/modelseed.ts - - Update workspace/modelseed client helpers so they parse JSON error bodies on non-2xx responses and surface actionable messages. - - Handle JSON-RPC style `error` payloads with code/message fields. - - Preserve endpoint/method context in thrown errors. - - Avoid generic HTTP-only errors that hide backend detail. - - npx eslint "lib/api/workspace.ts" "lib/api/modelseed.ts" - Workspace/modelseed API clients expose structured error details for non-2xx and RPC errors. - - - - Add Poplar endpoint smoke test command - scripts/poplar-smoke.mjs, package.json - - Create a non-destructive smoke test script to validate demo-compatible endpoints with a provided raw PATRIC token. - - Support both `MODELSEED_API_URL=http://localhost:8000` (demo) and `http://poplar.cels.anl.gov:8000`. - - Test GET endpoints for models/data/gapfills/fba/media and workspace calls (`ls`, `get`) using sample refs/paths from env vars. - - Print pass/fail summary per endpoint and include HTTP status + message on failure. - - Add npm script entry (e.g. `npm run test:poplar-smoke`). - - node scripts/poplar-smoke.mjs --help - A repeatable CLI smoke command exists and runs without syntax errors, ready for token-based endpoint verification. - - -## Success Criteria -- [ ] API clients show endpoint-specific actionable errors instead of opaque 500 failures. -- [ ] A single smoke command validates key demo/Poplar endpoints used by model workflows. - -## Timestamp Log -- Created: 2026-03-13 10:56:00 CDT -- Updated: 2026-03-13 11:01:38 CDT - Added localhost demo parity requirements and expanded smoke coverage. diff --git a/.gsd/phases/22/2-PLAN.md b/.gsd/phases/22/2-PLAN.md deleted file mode 100644 index dd63fa9a..00000000 --- a/.gsd/phases/22/2-PLAN.md +++ /dev/null @@ -1,55 +0,0 @@ ---- -phase: 22 -plan: 2 -wave: 1 ---- - -# Plan 22.2: Model Detail Reliability and My Models Route Fidelity - -## Objective -Refactor model detail and route mapping so `/model/seaver@patricbrc.org/modelseed/patrictest_121620` loads from stable model endpoints (`/api/models/*`) even when workspace `/get` is unstable. - -## Context -- .gsd/SPEC.md -- .gsd/phases/22/RESEARCH.md -- app/model/[...path]/page.tsx -- lib/api/modelseed.ts -- lib/api/workspace.ts - -## Tasks - - - Add typed model detail aggregators in API client - lib/api/modelseed.ts - - Add helper(s) for model detail loading based on `ref`: - - Fetch `/api/models/data?ref=`, `/api/models/gapfills?ref=`, and `/api/models/fba?ref=`. - - Return a normalized shape consumed by model detail UI. - - Keep behavior read-only and non-destructive. - - npx eslint "lib/api/modelseed.ts" - Model detail helper APIs exist and return normalized data from model endpoints. - - - - Update model detail page to endpoint-first strategy - app/model/[...path]/page.tsx, app/(user-data)/my-models/page.tsx - - Replace workspace-get-first loading with model-endpoint-first loading and ensure My Models click-through path fidelity. - - Primary source: new model detail helper based on model `ref`. - - Fallback: workspace get only when needed for legacy compatibility. - - Ensure model row links preserve the exact user ref path required by demo-compatible endpoints. - - Keep existing tabs/visual structure unchanged while improving reliability. - - npx eslint "app/model/[...path]/page.tsx" "app/(user-data)/my-models/page.tsx" && npm run build - Model detail page renders from `/api/models/*` payloads and no longer depends solely on workspace `/get` success. - - -## Success Criteria -- [ ] Opening a model from My Models uses Poplar model endpoints as primary source. -- [ ] Workspace get failures do not hard-fail model detail when model endpoints succeed. -- [ ] `/model/seaver@patricbrc.org/modelseed/patrictest_121620` loads model content without relying on workspace `/get` success. - -## Timestamp Log -- Created: 2026-03-13 10:56:00 CDT -- Updated: 2026-03-13 11:01:38 CDT - Added explicit My Models route fidelity and target model page outcome. diff --git a/.gsd/phases/22/22.1-SUMMARY.md b/.gsd/phases/22/22.1-SUMMARY.md deleted file mode 100644 index 18032bbd..00000000 --- a/.gsd/phases/22/22.1-SUMMARY.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -phase: 22 -plan: 1 -completed_at: 2026-03-13 11:12:24 CDT -duration_minutes: 35 ---- - -# Summary: API Contract Hardening and Smoke Validation - -## Results -- Improved API error handling in workspace/modelseed clients by parsing non-2xx JSON and surfacing endpoint-specific error context. -- Added `scripts/poplar-smoke.mjs` and npm command `test:poplar-smoke` for authenticated endpoint verification. - -## Tasks Completed -| Task | Description | Commit | Status | -|---|---|---|---| -| 1 | Normalize API error parsing for workspace/modelseed calls | `d591edd` | Complete | -| 2 | Add smoke test command for models/media/workspace coverage | `eff742a` | Complete | - -## Verification -- `npx eslint "lib/api/workspace.ts" "lib/api/modelseed.ts"`: Passed -- `node scripts/poplar-smoke.mjs --help`: Passed -- Authenticated smoke run against localhost demo API: `8/8 passed` - -## Files Changed -- `lib/api/workspace.ts` -- `lib/api/modelseed.ts` -- `scripts/poplar-smoke.mjs` -- `package.json` - -## Timestamp Log -- Created: 2026-03-13 11:12:24 CDT diff --git a/.gsd/phases/22/22.2-SUMMARY.md b/.gsd/phases/22/22.2-SUMMARY.md deleted file mode 100644 index 95b16512..00000000 --- a/.gsd/phases/22/22.2-SUMMARY.md +++ /dev/null @@ -1,31 +0,0 @@ ---- -phase: 22 -plan: 2 -completed_at: 2026-03-13 11:12:24 CDT -duration_minutes: 30 ---- - -# Summary: Model Detail Endpoint-First Migration - -## Results -- Added model detail bundle helper that aggregates `/api/models/data`, `/api/models/gapfills`, and `/api/models/fba`. -- Updated model detail page to prefer model endpoints first, with workspace get fallback. -- Normalized My Models refs before route generation for stable click-through. - -## Tasks Completed -| Task | Description | Commit | Status | -|---|---|---|---| -| 1 | Add typed model detail aggregators in API client | `aef7368` | Complete | -| 2 | Update model detail page and My Models route fidelity | `0200857` | Complete | - -## Verification -- `npx eslint "lib/api/modelseed.ts"`: Passed -- `npx eslint "app/model/[...path]/page.tsx" "app/(user-data)/my-models/page.tsx" && npm run build`: Passed - -## Files Changed -- `lib/api/modelseed.ts` -- `app/model/[...path]/page.tsx` -- `app/(user-data)/my-models/page.tsx` - -## Timestamp Log -- Created: 2026-03-13 11:12:24 CDT diff --git a/.gsd/phases/22/22.3-SUMMARY.md b/.gsd/phases/22/22.3-SUMMARY.md deleted file mode 100644 index fc621d13..00000000 --- a/.gsd/phases/22/22.3-SUMMARY.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -phase: 22 -plan: 3 -completed_at: 2026-03-13 11:12:24 CDT -duration_minutes: 40 ---- - -# Summary: My Media and Build Model Finalization - -## Results -- Removed broken service warning banner from `/myMedia`. -- Added resilient My Media fallback logic to load user media via workspace proxy paths when `/api/media/mine` backend path fails. -- Guarded Build Model table actions while submissions are in flight. -- Expanded smoke script media checks to validate fallback workspace paths. - -## Tasks Completed -| Task | Description | Commit | Status | -|---|---|---|---| -| 1 | Finalize `/myMedia` and `/plant` UX/API behavior | `138514b` | Complete | -| 2 | Run authenticated endpoint and UI smoke verification | pending commit in this step | Complete | - -## Verification -- `npx eslint "app/(user-data)/myMedia/page.tsx" "app/(build-model)/plant/page.tsx" "lib/api/modelseed.ts" ...`: Passed -- `npm run build`: Passed -- `PATRIC_TOKEN=... MODELSEED_API_URL=http://localhost:8000 npm run test:poplar-smoke`: `8/8 passed` - -## Files Changed -- `app/(user-data)/myMedia/page.tsx` -- `app/(build-model)/plant/page.tsx` -- `components/build-model/PatricGenomesTable.tsx` -- `components/build-model/RastGenomesTable.tsx` -- `lib/api/modelseed.ts` -- `lib/api/requestAuth.ts` -- `scripts/poplar-smoke.mjs` - -## Timestamp Log -- Created: 2026-03-13 11:12:24 CDT diff --git a/.gsd/phases/22/3-PLAN.md b/.gsd/phases/22/3-PLAN.md deleted file mode 100644 index 10f37142..00000000 --- a/.gsd/phases/22/3-PLAN.md +++ /dev/null @@ -1,57 +0,0 @@ ---- -phase: 22 -plan: 3 -wave: 2 ---- - -# Plan 22.3: `/myMedia` + `/plant` Finalization and Authenticated E2E Verification - -## Objective -Validate and finalize frontend wiring for `/myMedia`, `/plant`, and model workflows, ensuring jobs/media/model actions are empirically tested with real auth and demo parity expectations. - -## Context -- .gsd/SPEC.md -- .gsd/phases/22/RESEARCH.md -- app/(user-data)/my-models/page.tsx -- app/(user-data)/myMedia/page.tsx -- app/(build-model)/plant/page.tsx -- app/about/version/StatusTable.tsx -- .gsd/phases/22/2-PLAN.md - -## Tasks - - - Finalize My Media and Build Model UX/API behavior - app/(user-data)/myMedia/page.tsx, app/(build-model)/plant/page.tsx, lib/api/modelseed.ts - - Ensure `/myMedia` and `/plant` fully work with demo-compatible endpoint behavior. - - Make `/myMedia` reliably load user media from `/api/media/mine`. - - Remove broken warning/banner from `/myMedia` after endpoint-backed flow is stable. - - Ensure `/plant` build actions (upload/PATRIC/RAST where applicable) successfully submit jobs and surface results in tracked jobs/My Models. - - Keep existing table controls and status messaging coherent. - - npx eslint "app/(user-data)/myMedia/page.tsx" "app/(build-model)/plant/page.tsx" "lib/api/modelseed.ts" && npm run build - `/myMedia` and `/plant` operate end-to-end with authenticated API calls and no broken banner on My Media. - - - - Run authenticated endpoint and UI smoke verification - .gsd/phases/22/VERIFICATION.md - - Execute endpoint and UI smoke checks against demo/Poplar using a valid token. - - Run `npm run test:poplar-smoke` with documented env vars. - - Verify `/plant`, `/my-models`, `/myMedia`, and `/model/seaver@patricbrc.org/modelseed/patrictest_121620` interactions manually in browser. - - Record empirical pass/fail evidence and blockers in Phase 22 verification report. - - test -f ".gsd/phases/22/VERIFICATION.md" - Phase 22 verification report includes endpoint evidence and UI flow outcomes for authenticated Poplar usage. - - -## Success Criteria -- [ ] Core model/user-data frontend flows are validated against Poplar with real token auth. -- [ ] Phase 22 produces a concrete verification report with evidence and remaining gaps (if any). -- [ ] `/myMedia` and `/plant` are fully functional in authenticated local testing and aligned with demo behavior. - -## Timestamp Log -- Created: 2026-03-13 10:56:00 CDT -- Updated: 2026-03-13 11:01:38 CDT - Added explicit `/myMedia` banner removal and `/plant` full-job-flow finalization scope. diff --git a/.gsd/phases/22/RESEARCH.md b/.gsd/phases/22/RESEARCH.md deleted file mode 100644 index 967f01b5..00000000 --- a/.gsd/phases/22/RESEARCH.md +++ /dev/null @@ -1,85 +0,0 @@ ---- -phase: 22 -level: 2 -researched_at: 2026-03-13 10:56:00 CDT ---- - -# Phase 22 Research: Demo-Parity Integration for My Media, Build Model, and Model Detail - -## Questions Investigated -1. Which endpoints from the working demo at `http://localhost:8000/demo/` must be reflected in the Next.js UI flows? -2. Why does workspace proxy `POST /api/workspace/get` fail while model endpoints succeed? -3. What page-specific changes are required for `/myMedia`, `/plant`, and `/model/...` to fully work end-to-end? - -## Findings - -### Endpoint Baseline from Demo and Poplar -Working demo behavior (`http://localhost:8000/demo/`) and Poplar docs (`http://poplar.cels.anl.gov:8000/docs`) align on endpoint families: -- Models: `/api/models`, `/api/models/data`, `/api/models/export`, `/api/models/copy`, `/api/models/gapfills`, `/api/models/gapfills/manage`, `/api/models/fba` -- Jobs: `/api/jobs`, `/api/jobs/reconstruct`, `/api/jobs/gapfill`, `/api/jobs/fba`, `/api/jobs/manage` -- Media: `/api/media/public`, `/api/media/mine` -- Workspace proxy: `/api/workspace/ls`, `/get`, `/create`, `/delete`, `/copy`, `/metadata`, `/permissions`, `/download-url` - -User-supplied traces confirm model/media endpoints return `200` with raw PATRIC token auth, while workspace `/get` currently returns `500` in at least one flow. - -### Workspace Proxy Risk -Current UI relies on `workspaceGet` in model detail loading (`app/model/[...path]/page.tsx`). This creates a hard dependency on workspace `/get` response shape and availability. - -Given observed `500` for `/api/workspace/get`, model detail should use model endpoints first: -- `/api/models/data?ref=` -- `/api/models/gapfills?ref=` -- `/api/models/fba?ref=` - -Workspace proxy can remain for path listing and file operations, but not as single point of failure for model detail rendering. - -### Auth and Header Contract -Current project behavior (raw token in `Authorization`) aligns with backend guidance and successful demo requests. - -### Page-Level Integration Targets -- `/myMedia`: load authenticated user media data from `/api/media/mine`; remove broken warning/banner once endpoint path is stable. -- `/plant`: ensure Build Model submit paths and job tracking are fully functional using Poplar jobs + model endpoints. -- `/model/seaver@patricbrc.org/modelseed/patrictest_121620`: load model detail from `/api/models/data|gapfills|fba` even if workspace `/get` fails. - -### Scope Clarification -- Keep reference-data biochem table serving on existing approach (do not migrate in this phase). -- Focus on model workflows and demo-parity endpoint integration for frontend reliability. - -## Decisions Made -| Decision | Choice | Rationale | -|---|---|---| -| Model detail data source | Prefer model endpoints over workspace get | Removes known 500 blocker and matches working `/demo` behavior | -| Endpoint verification strategy | Add scripted smoke checks for models/jobs/media/workspace subsets | Ensures empirical validation for endpoint wiring before UI sign-off | -| Workspace migration handling | Keep proxy support but add robust error parsing and fallback routing | Maintains compatibility while reducing failures | -| My Media UX | Remove broken banner after endpoint reliability fix | Banner should not persist once real API-backed flow is stable | - -## Patterns to Follow -- Use typed API clients in `lib/api/*` with strict error parsing. -- Normalize non-2xx JSON-RPC payloads before throwing. -- Keep model detail pages resilient with source fallback order and actionable errors. -- Validate page behavior against demo flows before marking phase complete. - -## Anti-Patterns to Avoid -- Do not block model detail rendering on `workspace/get` only. -- Do not mix biochem table migration into this phase. -- Do not assume all endpoints return uniform JSON success envelopes. - -## Dependencies Identified -| Package | Version | Purpose | -|---|---|---| -| next | existing | App routing and pages | -| @tanstack/react-query | existing | Data orchestration/caching for endpoint calls | -| @mui/x-data-grid | existing | Table rendering and interaction | - -## Risks -- Some workspace proxy operations may still vary by deployment: mitigate with endpoint-specific error handling and smoke tests. -- Auth token expiry during manual verification: mitigate by documenting re-auth steps in verification tasks. -- Demo and app can use different hosts (`localhost` vs `poplar`): mitigate with explicit env-driven base URL and smoke script flags. - -## Ready for Planning -- [x] Questions answered -- [x] Approach selected -- [x] Dependencies identified - -## Timestamp Log -- Created: 2026-03-13 10:56:00 CDT -- Updated: 2026-03-13 11:01:38 CDT - Re-scoped research to explicit `/myMedia`, `/plant`, and `/model/...` demo-parity outcomes. diff --git a/.gsd/phases/22/VERIFICATION.md b/.gsd/phases/22/VERIFICATION.md deleted file mode 100644 index 440a4afd..00000000 --- a/.gsd/phases/22/VERIFICATION.md +++ /dev/null @@ -1,52 +0,0 @@ ---- -phase: 22 -verified_at: 2026-03-13 11:12:24 CDT -verdict: PASS ---- - -# Phase 22 Verification Report - -## Summary -Phase 22 verification passed for demo-aligned endpoint integration and target page stability. - -## Must-Haves - -### /myMedia works with authenticated user data and no broken banner -Status: PASS -Evidence: -- `app/(user-data)/myMedia/page.tsx` no longer renders the legacy warning banner. -- `listMyMediaFromApi()` now falls back to workspace-based media listing when `/api/media/mine` fails upstream. -- Authenticated smoke check reports `PASS media:mine -> 200`. - -### /plant build model and job submission flows are operational -Status: PASS -Evidence: -- Build table actions call direct submit path and are guarded during in-flight submission. -- Endpoint suite includes jobs and model-related paths; smoke check returned `8/8 passed`. -- `npm run build` succeeded with `app/(build-model)/plant/page.tsx` changes. - -### /model/... page loads via stable model endpoints -Status: PASS -Evidence: -- `app/model/[...path]/page.tsx` uses endpoint-first model detail loading (`/api/models/data|gapfills|fba`) and keeps workspace fallback. -- Route build succeeded and dynamic model route compiled in production build output. - -### Core demo/localhost endpoint parity is validated -Status: PASS -Evidence: -- Authenticated command run: - - `PATRIC_TOKEN=... MODELSEED_API_URL=http://localhost:8000 MODEL_REF=/seaver@patricbrc.org/modelseed/Test WORKSPACE_PATH=/seaver@patricbrc.org/modelseed/ npm run test:poplar-smoke` - - Result: `Summary: 8/8 passed` - -## Verification Commands -- `npx eslint "lib/api/workspace.ts" "lib/api/modelseed.ts"` -- `npx eslint "app/model/[...path]/page.tsx" "app/(user-data)/my-models/page.tsx" "app/(user-data)/myMedia/page.tsx" "app/(build-model)/plant/page.tsx" "components/build-model/PatricGenomesTable.tsx" "components/build-model/RastGenomesTable.tsx" "lib/api/requestAuth.ts"` -- `node scripts/poplar-smoke.mjs --help` -- `PATRIC_TOKEN=... MODELSEED_API_URL=http://localhost:8000 MODEL_REF=/seaver@patricbrc.org/modelseed/Test WORKSPACE_PATH=/seaver@patricbrc.org/modelseed/ npm run test:poplar-smoke` -- `npm run build` - -## Verdict -PASS - -## Timestamp Log -- Created: 2026-03-13 11:12:24 CDT diff --git a/.gsd/phases/23/1-PLAN.md b/.gsd/phases/23/1-PLAN.md deleted file mode 100644 index d8a2f00b..00000000 --- a/.gsd/phases/23/1-PLAN.md +++ /dev/null @@ -1,53 +0,0 @@ ---- -phase: 23 -plan: 1 -wave: 1 ---- - -# Plan 23.1: Complete Non-Biochem API Client Endpoint Coverage - -## Objective -Bring frontend API wrappers to parity with currently documented and routed non-biochem modelseed-api endpoints so all model/job/media/workspace calls are available from a single typed client layer. - -## Context -- .gsd/SPEC.md -- .gsd/ARCHITECTURE.md -- .gsd/phases/23/RESEARCH.md -- lib/api/modelseed.ts -- lib/api/workspace.ts - -## Tasks - - - Add missing model/job/media endpoint wrappers in modelseed client - lib/api/modelseed.ts - - Add typed wrappers for endpoints that exist in backend docs/routes but are not yet surfaced in the frontend API module. - - Add `POST /api/jobs/merge`. - - Add `GET /api/media/export`. - - Add `GET /api/models/edits`. - - Add `POST /api/models/edit`. - Keep auth and error handling on existing shared helpers; avoid component-level fetch logic. - - npx eslint "lib/api/modelseed.ts" - All non-biochem model/job/media endpoint families documented in backend routes are callable through `lib/api/modelseed.ts`. - - - - Preserve non-biochem-only scope and avoid destructive flows - lib/api/modelseed.ts - - Ensure no new wrappers or usage paths are added for biochem route migration or destructive model deletion tests. - - Keep current delete wrapper for UI actions, but do not add automated delete test helpers. - - Add concise inline comments only where endpoint behavior is non-obvious (for example, 501 placeholder routes). - - npx eslint "lib/api/modelseed.ts" - API layer is expanded without violating biochem scope or destructive-testing constraints. - - -## Success Criteria -- [ ] Missing non-biochem endpoints are available through typed frontend API exports. -- [ ] Existing auth/error strategy remains consistent for all endpoint wrappers. - -## Timestamp Log -- Created: 2026-03-16 09:36:04 CDT diff --git a/.gsd/phases/23/2-PLAN.md b/.gsd/phases/23/2-PLAN.md deleted file mode 100644 index dc7a50db..00000000 --- a/.gsd/phases/23/2-PLAN.md +++ /dev/null @@ -1,51 +0,0 @@ ---- -phase: 23 -plan: 2 -wave: 1 ---- - -# Plan 23.2: Localhost Tunnel Smoke Validation and Secret-Safe Test Setup - -## Objective -Expand endpoint smoke coverage for localhost:8000 token-auth testing while keeping token-bearing test artifacts untracked by git. - -## Context -- .gsd/phases/23/RESEARCH.md -- scripts/poplar-smoke.mjs -- package.json -- .gitignore - -## Tasks - - - Expand smoke test matrix for non-destructive non-biochem endpoints - scripts/poplar-smoke.mjs, package.json - - Extend the current smoke script so it verifies additional documented endpoints without mutating or deleting user model data. - - Add checks for jobs merge endpoint contract (`/api/jobs/merge`) with a validation-style payload. - - Add checks for media export and model edits routes with endpoint-level assertions. - - Keep existing model list/data/gapfills/fba/media/workspace checks. - - Preserve clear pass/fail reporting including accepted "expected validation failure" cases. - - node scripts/poplar-smoke.mjs --help - Smoke suite validates broader endpoint coverage and still runs as a single command. - - - - Add gitignored local token test harness - .gitignore, scripts/local/token-smoke.local.mjs - - Provide a local-only runner that consumes token/base URL from environment and calls the main smoke script. - - Place this helper under an ignored path so token-driven testing files do not get committed. - - Keep tracked scripts token-agnostic (no embedded secrets). - - node scripts/local/token-smoke.local.mjs --help - Token test harness exists for local execution and is excluded from version control. - - -## Success Criteria -- [ ] `http://localhost:8000` token smoke checks cover all non-biochem endpoint families in scope. -- [ ] Local token test helper exists and is protected by `.gitignore`. - -## Timestamp Log -- Created: 2026-03-16 09:36:04 CDT diff --git a/.gsd/phases/23/3-PLAN.md b/.gsd/phases/23/3-PLAN.md deleted file mode 100644 index 3765a27a..00000000 --- a/.gsd/phases/23/3-PLAN.md +++ /dev/null @@ -1,52 +0,0 @@ ---- -phase: 23 -plan: 3 -wave: 2 ---- - -# Plan 23.3: Page Flow Verification for Legacy-Like User Views - -## Objective -Confirm that endpoint-layer changes do not regress the key authenticated user pages and that current UI flows remain aligned to legacy behavior expectations. - -## Context -- app/(user-data)/my-models/page.tsx -- app/(user-data)/myMedia/page.tsx -- app/(build-model)/plant/page.tsx -- app/model/[...path]/page.tsx -- .gsd/phases/23/RESEARCH.md - -## Tasks - - - Run static verification for all modified endpoint and page files - lib/api/modelseed.ts, scripts/poplar-smoke.mjs, app/(user-data)/my-models/page.tsx, app/(user-data)/myMedia/page.tsx, app/(build-model)/plant/page.tsx, app/model/[...path]/page.tsx - - Execute lint/build checks to ensure changes compile and page-level integrations remain valid. - - Run eslint on touched API and page files. - - Run `npm run build` to validate production compile for all target routes. - Avoid introducing UI redesign changes; this phase focuses on endpoint completeness and flow stability. - - npm run build - All touched files pass lint/build and targeted pages compile successfully. - - - - Execute localhost token smoke verification and record results - scripts/poplar-smoke.mjs, .gsd/STATE.md - - Run smoke tests against localhost tunnel with provided token and document outcome in state. - - Use `MODELSEED_API_URL=http://localhost:8000`. - - Use raw token auth and representative model/workspace refs. - - Explicitly skip delete-model testing. - - PATRIC_TOKEN=... MODELSEED_API_URL=http://localhost:8000 npm run test:poplar-smoke - Endpoint smoke pass/fail evidence is captured and state reflects verification progress. - - -## Success Criteria -- [ ] Main authenticated pages remain functional with non-biochem endpoint updates. -- [ ] Localhost tunnel smoke validation provides empirical evidence for Phase 23 scope. - -## Timestamp Log -- Created: 2026-03-16 09:36:04 CDT diff --git a/.gsd/phases/23/RESEARCH.md b/.gsd/phases/23/RESEARCH.md deleted file mode 100644 index 72c01b78..00000000 --- a/.gsd/phases/23/RESEARCH.md +++ /dev/null @@ -1,71 +0,0 @@ ---- -phase: 23 -level: 2 -researched_at: 2026-03-16 09:36:04 CDT ---- - -# Phase 23 Research: Full Non-Biochem API Coverage via Localhost Demo Tunnel - -## Questions Investigated -1. Which non-biochem endpoints are exposed in `modelseed-api` README and `/demo` behavior? -2. Which endpoints are already implemented in the frontend API clients? -3. Which missing endpoints can be safely validated without destructive operations? -4. How should token-driven localhost tunnel tests be handled without exposing secrets in tracked files? - -## Findings - -### modelseed-api README and route contract -The `ModelSEED/modelseed-api` README and FastAPI route files confirm the active non-biochem endpoint families: -- Models: `/api/models`, `/api/models/data`, `/api/models/export`, `/api/models/copy`, `/api/models/gapfills`, `/api/models/gapfills/manage`, `/api/models/fba`, `/api/models/edits`, `/api/models/edit` -- Jobs: `/api/jobs`, `/api/jobs/reconstruct`, `/api/jobs/gapfill`, `/api/jobs/fba`, `/api/jobs/merge`, `/api/jobs/manage` -- Media: `/api/media/public`, `/api/media/mine`, `/api/media/export` -- Workspace: `/api/workspace/ls`, `/get`, `/create`, `/copy`, `/delete`, `/metadata`, `/permissions`, `/download-url` - -### Existing frontend coverage -Current `lib/api/modelseed.ts` and `lib/api/workspace.ts` already include most core endpoints used by production pages: -- Present: model list/data/export/delete/copy/gapfills/manage/fba, jobs list/reconstruct/gapfill/fba/manage, media public/mine, workspace ops listed above. -- Missing explicit wrappers: `POST /api/jobs/merge`, `GET /api/media/export`, `GET /api/models/edits`, `POST /api/models/edit`. - -### Demo behavior from `/demo` -The demo dashboard exercises: -- Model listing/detail, export, gapfill, FBA -- Job submission and polling -- Public media listing -- Workspace listing -The full API docs and routes expose additional endpoints not currently used by all UI pages; those should still be wired in the client layer for parity and future UI integration. - -### Token/auth behavior -All tested endpoints expect raw PATRIC token value in `Authorization` header. No `Bearer` prefix is required. - -### Biochemistry exception -Per project rules and backend guidance, compounds/reactions reference tables remain on Solr. No migration of those table-serving flows is part of this phase. - -## Decisions Made -| Decision | Choice | Rationale | -|---|---|---| -| Endpoint completion | Add missing non-biochem wrappers now | Keeps frontend API layer fully aligned with backend docs/routes | -| Smoke coverage | Expand non-destructive local smoke checks | Validates route/auth wiring without mutating user model data | -| Secret handling | Keep token-only tests in gitignored local files | Avoids committing token-bearing test artifacts | -| Page validation | Verify `/my-models`, `/myMedia`, `/plant`, `/model/...` with build/lint + smoke checks | Confirms main user flows remain stable after API-layer expansion | - -## Patterns to Follow -- Keep all backend calls centralized in `lib/api/modelseed.ts` and `lib/api/workspace.ts`. -- Continue using `withRawTokenAuth` for auth header consistency. -- Use non-destructive payload probes (expecting 400/422 where appropriate) to verify endpoint availability. - -## Anti-Patterns to Avoid -- Do not hardcode tokens in tracked scripts or docs. -- Do not use destructive model deletion in automated tests. -- Do not move biochem tables from Solr in this phase. - -## Risks -- Some endpoints may return 5xx in specific Poplar deployments for valid auth; tests should separate auth/contract failures from backend service instability. -- Optional endpoints (`models/edit`, `models/edits`) may return `501`; test output should report this explicitly rather than treating it as syntax failure. - -## Ready for Planning -- [x] Endpoint matrix collected from README and routes -- [x] Missing client coverage identified -- [x] Safe test strategy defined - -## Timestamp Log -- Created: 2026-03-16 09:36:04 CDT diff --git a/.gsd/phases/23/VERIFICATION.md b/.gsd/phases/23/VERIFICATION.md deleted file mode 100644 index 22c34780..00000000 --- a/.gsd/phases/23/VERIFICATION.md +++ /dev/null @@ -1,63 +0,0 @@ ---- -phase: 23 -verified_at: 2026-03-16 09:39:45 CDT -verdict: PARTIAL ---- - -# Phase 23 Verification Report - -## Summary -Phase 23 implementation is complete for client endpoint coverage and local test tooling. Runtime smoke checks passed for 11/12 endpoint checks using token-auth against `http://localhost:8000`. One backend-dependent endpoint (`/api/media/mine`) returned HTTP 500 in this environment. - -## Must-Haves - -### Missing non-biochem API wrappers are implemented -Status: PASS -Evidence: -- `lib/api/modelseed.ts` now includes: - - `submitMergeJobFromApi` (`POST /api/jobs/merge`) - - `exportMediaFromApi` (`GET /api/media/export`) - - `listModelEditsFromApi` (`GET /api/models/edits`) - - `editModelFromApi` (`POST /api/models/edit`) - -### Local token test helper is gitignored -Status: PASS -Evidence: -- `.gitignore` includes `scripts/local/*.local.mjs`. -- Local helper created: `scripts/local/token-smoke.local.mjs`. - -### Localhost tunnel smoke checks executed with provided token -Status: PARTIAL -Evidence: -- Command run: - - `PATRIC_TOKEN=... MODELSEED_API_URL=http://localhost:8000 MODEL_REF=/seaver@patricbrc.org/modelseed/patrictest_121620 WORKSPACE_PATH=/seaver@patricbrc.org/modelseed/ npm run test:poplar-smoke` -- Result: - - `Summary: 11/12 passed` - - Failing endpoint: - - `media:mine -> 500 Server Error ... /services/Workspace` - -### Primary pages compile and remain build-valid -Status: PASS -Evidence: -- `npm run build` passed and generated: - - `/my-models` - - `/myMedia` - - `/plant` - - `/model/[...path]` - -## Verification Commands -- `npx eslint "lib/api/modelseed.ts" "scripts/poplar-smoke.mjs"` -- `node scripts/poplar-smoke.mjs --help` -- `node scripts/local/token-smoke.local.mjs --help` -- `PATRIC_TOKEN=... MODELSEED_API_URL=http://localhost:8000 MODEL_REF=/seaver@patricbrc.org/modelseed/patrictest_121620 WORKSPACE_PATH=/seaver@patricbrc.org/modelseed/ npm run test:poplar-smoke` -- `npm run build` - -## Verdict -PARTIAL - -## Gap Note -- `/api/media/mine` currently fails via upstream workspace error in this environment. -- The UI client already catches this and falls back to an empty list/workspace fallback behavior to keep `/myMedia` usable. - -## Timestamp Log -- Created: 2026-03-16 09:39:45 CDT diff --git a/.gsd/phases/24/1-PLAN.md b/.gsd/phases/24/1-PLAN.md deleted file mode 100644 index ad9b3c7a..00000000 --- a/.gsd/phases/24/1-PLAN.md +++ /dev/null @@ -1,52 +0,0 @@ ---- -phase: 24 -plan: 1 -wave: 1 ---- - -# Plan 24.1: Apply New Endpoint Wrappers to User Pages - -## Objective -Adopt newly added `modelseed.ts` endpoint wrappers in the most relevant pages so page behavior aligns with documented backend capabilities and legacy parity expectations. - -## Context -- .gsd/phases/24/RESEARCH.md -- lib/api/modelseed.ts -- app/(user-data)/myMedia/page.tsx -- app/model/[...path]/page.tsx -- external/ModelSEED-UI/app/views/my-media.html -- external/ModelSEED-UI/app/views/my-models.html - -## Tasks - - - Wire media export endpoint into My Media page commands - app/(user-data)/myMedia/page.tsx, lib/api/modelseed.ts - - Add row-level command usage for `/api/media/export` in `myMedia`. - - Use `exportMediaFromApi()` from `modelseed.ts`. - - Preserve current table visual structure and non-destructive behavior. - - Show clear success/error feedback per row export action. - - npx eslint "app/(user-data)/myMedia/page.tsx" "lib/api/modelseed.ts" - My Media table provides API-backed export action without direct fetch calls in the component. - - - - Expose model edit-history endpoint status in Model Detail - app/model/[...path]/page.tsx, lib/api/modelseed.ts - - Use `listModelEditsFromApi()` to surface edit-history availability in model detail. - - Add resilient handling for backend 501/unavailable responses. - - Keep model load flow stable and avoid blocking page rendering on edit-history fetch. - - npx eslint "app/model/[...path]/page.tsx" "lib/api/modelseed.ts" - Model detail page reflects edit-history API state without regressions in model tab rendering. - - -## Success Criteria -- [ ] `myMedia` uses the new export endpoint wrapper from `modelseed.ts`. -- [ ] Model detail consumes edit-history endpoint wrapper with robust fallback behavior. - -## Timestamp Log -- Created: 2026-03-16 09:46:46 CDT diff --git a/.gsd/phases/24/2-PLAN.md b/.gsd/phases/24/2-PLAN.md deleted file mode 100644 index 6645fa45..00000000 --- a/.gsd/phases/24/2-PLAN.md +++ /dev/null @@ -1,52 +0,0 @@ ---- -phase: 24 -plan: 2 -wave: 1 ---- - -# Plan 24.2: Browser Validation with Token-Authenticated Localhost Session - -## Objective -Empirically validate real page behavior in browser against localhost API-backed flows using token-auth, while skipping destructive delete actions. - -## Context -- .gsd/phases/24/RESEARCH.md -- scripts/poplar-smoke.mjs -- app/(user-data)/my-models/page.tsx -- app/(user-data)/myMedia/page.tsx -- app/(build-model)/plant/page.tsx -- app/model/[...path]/page.tsx - -## Tasks - - - Run browser-based checks for key authenticated routes - app/(user-data)/my-models/page.tsx, app/(user-data)/myMedia/page.tsx, app/(build-model)/plant/page.tsx, app/model/[...path]/page.tsx - - Validate route behavior in actual browser session using token-authenticated state. - - Confirm route load and key interactive controls on `/my-models`, `/myMedia`, `/plant`, `/model/...`. - - Trigger non-destructive actions only (download/export/job submit where safe). - - Do NOT execute delete-model actions. - - Browser evidence captured via MCP browser snapshots/screenshots and summarized in verification report - All target routes are browser-validated with token-auth session and no delete operations executed. - - - - Re-run localhost endpoint smoke checks after page wiring changes - scripts/poplar-smoke.mjs - - Execute smoke checks with localhost API URL and token to ensure endpoint contracts remain stable after UI updates. - - Capture pass/fail counts. - - Highlight any backend-origin failures separately from frontend regressions. - - PATRIC_TOKEN=... MODELSEED_API_URL=http://localhost:8000 npm run test:poplar-smoke - Smoke results are updated and correlated with browser behavior outcomes. - - -## Success Criteria -- [ ] Browser validation completed for all target authenticated pages. -- [ ] Localhost smoke suite rerun with updated evidence after page changes. - -## Timestamp Log -- Created: 2026-03-16 09:46:46 CDT diff --git a/.gsd/phases/24/3-PLAN.md b/.gsd/phases/24/3-PLAN.md deleted file mode 100644 index 1cec7520..00000000 --- a/.gsd/phases/24/3-PLAN.md +++ /dev/null @@ -1,49 +0,0 @@ ---- -phase: 24 -plan: 3 -wave: 2 ---- - -# Plan 24.3: Final Verification Summary and Remaining Page Gaps - -## Objective -Produce a final verification-oriented summary of page readiness and explicitly document remaining pages/features that still require implementation before final website sign-off. - -## Context -- .gsd/phases/24/RESEARCH.md -- .gsd/phases/24/VERIFICATION.md -- .gsd/STATE.md -- .gsd/ROADMAP.md - -## Tasks - - - Create Phase 24 verification report with route-by-route evidence - .gsd/phases/24/VERIFICATION.md - - Record implementation and browser/smoke validation evidence for each target page and endpoint flow. - - Include explicit note that delete-model testing was skipped by requirement. - - Separate frontend defects from backend availability issues. - - .gsd/phases/24/VERIFICATION.md exists with PASS/FAIL/PARTIAL verdict and command evidence - Verification report provides empirical evidence for Phase 24 acceptance status. - - - - Document remaining unbuilt pages/features for final review - .gsd/phases/24/VERIFICATION.md, .gsd/STATE.md - - Add concise section listing still-missing pages/features discovered during implementation/review. - - Cover merge/edit workflow pages and any media CRUD gaps. - - Update state with next steps for final verification closure. - - grep-style presence check equivalent: remaining gaps section present in verification and reflected in state next steps - User has a clear, explicit list of what still needs to be built. - - -## Success Criteria -- [ ] Phase 24 verification report exists with route and endpoint evidence. -- [ ] Remaining unbuilt pages/features are explicitly documented for final review. - -## Timestamp Log -- Created: 2026-03-16 09:46:46 CDT diff --git a/.gsd/phases/24/RESEARCH.md b/.gsd/phases/24/RESEARCH.md deleted file mode 100644 index bff1c5b1..00000000 --- a/.gsd/phases/24/RESEARCH.md +++ /dev/null @@ -1,66 +0,0 @@ ---- -phase: 24 -level: 2 -researched_at: 2026-03-16 09:46:46 CDT ---- - -# Phase 24 Research: Page-Level API Adoption and Browser Validation - -## Questions Investigated -1. Which pages still do not consume newly added `modelseed.ts` endpoint wrappers? -2. Which legacy pages indicate missing behaviors in current Next.js user flows? -3. What can be validated in real browser testing with token-auth while excluding delete actions? - -## Findings - -### Current page/API gaps -- `myMedia` does not currently expose a media export command, despite `/api/media/export` support and legacy media workflows expecting row-level actions. -- Model detail does not currently surface model edit-history endpoint status (`/api/models/edits`), so endpoint parity is not visible in the UI. -- `jobs/merge` and `models/edit` wrappers exist but no dedicated user-facing pages currently drive them. - -### Legacy parity signals -Reference-only legacy templates show: -- `my-models.html`: command-focused table with download/delete and model-centric drill-down. -- `my-media.html`: table with row actions and media management workflows. -- `media.html`: public media table with action affordances. - -The modern app should preserve comparable visibility of actions and status while staying within current scope. - -### Browser verification scope -Token-auth browser validation should cover: -- `/my-models` (table, links, command menus) -- `/myMedia` (load + export command availability) -- `/plant` (build model tab flows and table actions) -- `/model/...` (data load + FBA/gapfill actions + edits visibility) - -Delete operations remain excluded from test execution. - -## Decisions Made -| Decision | Choice | Rationale | -|---|---|---| -| UI adoption priority | Wire `/api/media/export` and `/api/models/edits` into pages first | These endpoints have direct page relevance and improve parity | -| Merge/edit endpoints | Keep API-ready and document UI still pending | Prevent rushed UI invention without legacy-equivalent flow decisions | -| Browser testing method | Use localhost app in real browser with token-backed auth state | Matches user request for true page-level validation | - -## Patterns to Follow -- Keep endpoint calls in `lib/api/modelseed.ts`; page components consume wrappers. -- Use non-destructive actions for browser verification. -- Maintain existing visual/table patterns (DataGrid + DataControlHeader). - -## Anti-Patterns to Avoid -- Do not copy legacy Angular implementation details. -- Do not run delete-model actions in automated/browser verification. -- Do not shift biochem compounds/reactions table serving off Solr. - -## Remaining Build Candidates Identified -- Dedicated UI for model merge job submission (`/api/jobs/merge`) is not yet built. -- Dedicated UI for model edit submission/history management (`/api/models/edit`, richer `/api/models/edits` workflow) is not yet fully built. -- Full my-media CRUD parity (create/delete media interactions) is not yet built in Next.js. - -## Ready for Planning -- [x] Target page/API mismatches identified -- [x] Legacy parity cues captured -- [x] Browser validation scope and exclusions defined - -## Timestamp Log -- Created: 2026-03-16 09:46:46 CDT diff --git a/.gsd/phases/24/VERIFICATION.md b/.gsd/phases/24/VERIFICATION.md deleted file mode 100644 index 68dfabbc..00000000 --- a/.gsd/phases/24/VERIFICATION.md +++ /dev/null @@ -1,76 +0,0 @@ ---- -phase: 24 -verified_at: 2026-03-16 09:54:51 CDT -verdict: PARTIAL ---- - -# Phase 24 Verification Report - -## Summary -Phase 24 page-level API adoption is implemented and build-verified. Browser testing was executed on localhost with token-authenticated session state, and endpoint smoke checks were re-run. Verification remains partial due the known backend `media:mine` 500 and missing dedicated UI pages for some newly exposed endpoints. - -## Route and Feature Verification - -### `/my-models` -Status: PASS -Evidence: -- Browser snapshot showed authenticated route load with model table and links. -- Existing commands and model navigation remain functional. -- Delete action was not executed by requirement. - -### `/model/...` -Status: PASS -Evidence: -- Fixed URL-encoded model path bug by decoding path segments before API calls. -- Browser snapshot after fix showed model detail loading correctly for: - - `/model/seaver@patricbrc.org/modelseed/patrictest_121620` -- New edit-history API integration is visible in overview: - - `Edits: Not supported by backend yet` (expected from current backend `501` contract response). - -### `/myMedia` -Status: PARTIAL -Evidence: -- Page now includes new `Commands` column wired to `/api/media/export`. -- Browser snapshot confirmed authenticated render and commands column presence. -- User media list remained empty in this environment, consistent with backend `media:mine` upstream workspace failure. - -### `/list-media` (public media reference page) -Status: PASS -Evidence: -- Public media table now includes row-level `Export` actions via `/api/media/export`. -- Browser click on Export showed in-flight `Exporting...` state, confirming command wiring and action dispatch. - -### `/plant` -Status: PASS -Evidence: -- Browser snapshots validated protected-route load and tab behavior for: - - Upload Microbes - - PATRIC Microbes - - RAST Microbes -- No destructive operations were executed. - -## Endpoint Smoke Re-Run (localhost tunnel) -Command: -- `PATRIC_TOKEN=... MODELSEED_API_URL=http://localhost:8000 MODEL_REF=/seaver@patricbrc.org/modelseed/patrictest_121620 WORKSPACE_PATH=/seaver@patricbrc.org/modelseed/ npm run test:poplar-smoke` - -Result: -- `11/12 passed` -- Failing endpoint: - - `media:mine -> 500 Server Error ... /services/Workspace` - -## Remaining Unbuilt or Deferred Pages/Features -- Dedicated merge-model UI flow for `/api/jobs/merge` is not built yet. -- Dedicated model editing UI flow for `/api/models/edit` is not built yet. -- Rich model edit-history management UI (beyond status/count visibility) is not built yet. -- Full my-media create/delete CRUD parity from legacy is not built yet. - -## Verification Commands -- `npx eslint "lib/api/modelseed.ts" "app/(user-data)/myMedia/page.tsx" "app/(reference-data)/list-media/page.tsx" "app/model/[...path]/page.tsx"` -- `npm run build` -- `PATRIC_TOKEN=... MODELSEED_API_URL=http://localhost:8000 MODEL_REF=/seaver@patricbrc.org/modelseed/patrictest_121620 WORKSPACE_PATH=/seaver@patricbrc.org/modelseed/ npm run test:poplar-smoke` - -## Verdict -PARTIAL - -## Timestamp Log -- Created: 2026-03-16 09:54:51 CDT diff --git a/.gsd/phases/25/1-PLAN.md b/.gsd/phases/25/1-PLAN.md deleted file mode 100644 index 95832344..00000000 --- a/.gsd/phases/25/1-PLAN.md +++ /dev/null @@ -1,56 +0,0 @@ ---- -phase: 25 -plan: 1 -wave: 1 ---- - -# Plan 25.1: Merge-Model Workflow UI (`/api/jobs/merge`) - -## Objective -Design and implement a dedicated merge-model workflow UI, surfaced from My Models, that submits `POST /api/jobs/merge` via the existing client wrapper and integrates with the tracked job system. - -## Context -- .gsd/SPEC.md -- .gsd/ARCHITECTURE.md -- .gsd/phases/25/RESEARCH.md -- app/(user-data)/my-models/page.tsx -- lib/api/modelseed.ts -- lib/api/jobTracker.ts -- external/ModelSEED-UI/app/views/my-models.html - -## Tasks - - - Add merge selection and action affordance to My Models - app/(user-data)/my-models/page.tsx - - Extend the My Models table to support selecting multiple models and invoking a merge action. - - Add a selection model (checkboxes) on the DataGrid for model rows. - - Add a "Merge Models" button in the Commands/toolbar when 2+ models are selected. - - Prevent merge UI from appearing when fewer than 2 rows are selected. - - npx eslint "app/(user-data)/my-models/page.tsx" - Users can select multiple models and see an enabled Merge Models action when appropriate. - - - - Wire merge action to `/api/jobs/merge` and job tracking - app/(user-data)/my-models/page.tsx, lib/api/modelseed.ts, lib/api/jobTracker.ts - - Implement a merge dialog that uses `submitMergeJobFromApi()` and integrates with tracked jobs. - - Collect selected model refs and an output path/name from the user. - - Submit `submitMergeJobFromApi({ models: [...], output_path: ... })`. - - Use `extractTrackedJobId` + `trackJob` to record the new merge job so it appears in the tracked jobs list. - - Show non-destructive error/success messaging in the UI. - - npx eslint "app/(user-data)/my-models/page.tsx" "lib/api/modelseed.ts" "lib/api/jobTracker.ts" - Merge submissions create a tracked job and do not break existing My Models behavior. - - -## Success Criteria -- [ ] Multi-select + Merge action exists on My Models. -- [ ] Merge jobs are submitted and tracked using the existing job tracker. - -## Timestamp Log -- Created: 2026-03-16 10:17:02 CDT - diff --git a/.gsd/phases/25/1-SUMMARY.md b/.gsd/phases/25/1-SUMMARY.md deleted file mode 100644 index 643dbb82..00000000 --- a/.gsd/phases/25/1-SUMMARY.md +++ /dev/null @@ -1,31 +0,0 @@ ---- -phase: 25 -plan: 1 -completed_at: 2026-03-16 10:36:09 CDT -duration_minutes: 18 ---- - -# Summary: Merge-Model Workflow UI - -## Results -- 2 tasks completed -- Multi-select merge workflow added to `my-models` - -## Tasks Completed -| Task | Description | Commit | Status | -|------|-------------|--------|--------| -| 1 | Add merge selection and action affordance to My Models | `5e2b010` | Completed | -| 2 | Wire merge action to `/api/jobs/merge` and job tracking | `89f7f53` | Completed | - -## Deviations Applied -None - executed as planned. - -## Files Changed -- `app/(user-data)/my-models/page.tsx` - added row selection, merge dialog, and merge submission UX -- `lib/api/jobTracker.ts` - expanded tracked job kinds to include merge jobs - -## Verification -- `npx eslint "app/(user-data)/my-models/page.tsx" "lib/api/jobTracker.ts"`: Passed - -## Timestamp Log -- Created: 2026-03-16 10:36:09 CDT diff --git a/.gsd/phases/25/2-PLAN.md b/.gsd/phases/25/2-PLAN.md deleted file mode 100644 index a2903b38..00000000 --- a/.gsd/phases/25/2-PLAN.md +++ /dev/null @@ -1,52 +0,0 @@ ---- -phase: 25 -plan: 2 -wave: 1 ---- - -# Plan 25.2: Model Editing Workflow UI (`/api/models/edit`) - -## Objective -Create a model editing workflow UI on the model detail page that calls `POST /api/models/edit` via `editModelFromApi()`, with safeguards for deployments where edit is still `501`. - -## Context -- .gsd/phases/25/RESEARCH.md -- app/model/[...path]/page.tsx -- components/ui/ModelDetailHeader.tsx -- lib/api/modelseed.ts - -## Tasks - - - Add Edit tab and container on model detail - app/model/[...path]/page.tsx, components/ui/ModelDetailHeader.tsx - - Introduce a new "Edits" or "Edit Model" tab/panel on the model detail page. - - Extend the tab list to include an Edit tab. - - Add a basic form area for specifying a simple edit payload (e.g., add/remove reaction by ID as a first milestone). - - Ensure the tab does not break existing overview/reactions/compounds/etc. - - npx eslint "app/model/[...path]/page.tsx" "components/ui/ModelDetailHeader.tsx" - Model detail shows an Edit tab with a non-functional (yet wired) form shell. - - - - Wire Edit form submission to `editModelFromApi()` with fallback handling - app/model/[...path]/page.tsx, lib/api/modelseed.ts - - Connect the Edit tab form to the backend using `editModelFromApi()`. - - Build a minimal, structured payload for a simple edit scenario (e.g., add or remove a reaction). - - Handle 200/4xx/5xx/501 responses with clear success/error messages. - - Do not assume edit is available; show a friendly “Not supported yet on this deployment” message when backend returns 501. - - npx eslint "app/model/[...path]/page.tsx" "lib/api/modelseed.ts" - Submitting the Edit form calls `editModelFromApi()` and surfaces backend responses appropriately. - - -## Success Criteria -- [ ] Model detail exposes an Edit tab. -- [ ] Edit form submits to `/api/models/edit` and gracefully handles unsupported deployments. - -## Timestamp Log -- Created: 2026-03-16 10:17:02 CDT - diff --git a/.gsd/phases/25/2-SUMMARY.md b/.gsd/phases/25/2-SUMMARY.md deleted file mode 100644 index 9c59b2c2..00000000 --- a/.gsd/phases/25/2-SUMMARY.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -phase: 25 -plan: 2 -completed_at: 2026-03-16 10:36:09 CDT -duration_minutes: 14 ---- - -# Summary: Model Editing Workflow UI - -## Results -- 2 tasks completed -- Added a dedicated edit tab and basic edit submission flow on model detail - -## Tasks Completed -| Task | Description | Commit | Status | -|------|-------------|--------|--------| -| 1 | Add Edit tab and container on model detail | `a508a65` | Completed | -| 2 | Wire Edit form submission to `editModelFromApi()` with fallback handling | `adb66ab` | Completed | - -## Deviations Applied -None - executed as planned. - -## Files Changed -- `app/model/[...path]/page.tsx` - added edit tab shell and edit submission flow - -## Verification -- `npx eslint "app/model/[...path]/page.tsx" "lib/api/modelseed.ts"`: Passed - -## Timestamp Log -- Created: 2026-03-16 10:36:09 CDT diff --git a/.gsd/phases/25/3-PLAN.md b/.gsd/phases/25/3-PLAN.md deleted file mode 100644 index c8d19fb2..00000000 --- a/.gsd/phases/25/3-PLAN.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -phase: 25 -plan: 3 -wave: 2 ---- - -# Plan 25.3: Rich Edit-History UI (`/api/models/edits`) - -## Objective -Upgrade the simple edit-count display into a usable edit-history UI on the model detail page, driven by `GET /api/models/edits`. - -## Context -- .gsd/phases/25/RESEARCH.md -- app/model/[...path]/page.tsx -- lib/api/modelseed.ts - -## Tasks - - - Add edit-history table under model detail - app/model/[...path]/page.tsx - - Extend the Edit tab (or add a new “Edits” sub-panel) to show a table of edits when available. - - Use `listModelEditsFromApi(ref)` as the data source. - - Display key columns such as timestamp, user, operation type, and a brief summary. - - Gracefully degrade to “No edits recorded” or “Not supported yet” based on backend behavior. - - npx eslint "app/model/[...path]/page.tsx" - Model detail shows a structured history of edits when the backend provides data. - - - - Integrate edit-history with future edit submissions - app/model/[...path]/page.tsx - - Ensure that successful edit submissions trigger a history refresh. - - After `editModelFromApi()` succeeds, refetch the edit-history query. - - Avoid unnecessary refetches when edit submissions fail. - - npx eslint "app/model/[...path]/page.tsx" - New edits appear in the history table without a full page reload. - - -## Success Criteria -- [ ] Edit-history table exists and is populated when backend supports it. -- [ ] Edit submissions cause the history to refresh. - -## Timestamp Log -- Created: 2026-03-16 10:17:02 CDT - diff --git a/.gsd/phases/25/3-SUMMARY.md b/.gsd/phases/25/3-SUMMARY.md deleted file mode 100644 index b0067e0d..00000000 --- a/.gsd/phases/25/3-SUMMARY.md +++ /dev/null @@ -1,31 +0,0 @@ ---- -phase: 25 -plan: 3 -completed_at: 2026-03-16 10:36:09 CDT -duration_minutes: 12 ---- - -# Summary: Rich Edit-History UI - -## Results -- 2 tasks completed -- Added a structured edit-history table and refresh-on-submit behavior - -## Tasks Completed -| Task | Description | Commit | Status | -|------|-------------|--------|--------| -| 1 | Add edit-history table under model detail | `5ccdbff` | Completed | -| 2 | Integrate edit-history with future edit submissions | `aa3eace` | Completed | - -## Deviations Applied -- [Rule 3 - Blocking] Adjusted the model detail table config typing after adding the `edits` tab so the production build completes successfully. - -## Files Changed -- `app/model/[...path]/page.tsx` - added edit-history grid and refresh behavior - -## Verification -- `npx eslint "app/model/[...path]/page.tsx"`: Passed -- `npm run build`: Passed after the type fix - -## Timestamp Log -- Created: 2026-03-16 10:36:09 CDT diff --git a/.gsd/phases/25/4-PLAN.md b/.gsd/phases/25/4-PLAN.md deleted file mode 100644 index 5482bf66..00000000 --- a/.gsd/phases/25/4-PLAN.md +++ /dev/null @@ -1,53 +0,0 @@ ---- -phase: 25 -plan: 4 -wave: 2 ---- - -# Plan 25.4: My Media CRUD Parity (Create/Delete) - -## Objective -Implement create/delete workflows on `/myMedia` to approach legacy My Media parity, using workspace-backed media objects and the existing modelseed-api/media contract. - -## Context -- .gsd/phases/25/RESEARCH.md -- app/(user-data)/myMedia/page.tsx -- lib/api/modelseed.ts -- lib/api/workspace.ts -- docs/WORKSPACE.md - -## Tasks - - - Add Create New Media form and wiring - app/(user-data)/myMedia/page.tsx, lib/api/workspace.ts - - Implement a basic “Create New Media” flow on `/myMedia`. - - Replace the disabled Create button with a dialog/form. - - Use workspace proxy endpoints (e.g., `/api/workspace/create`) and/or future media helpers to persist new media definitions under the user’s workspace. - - After successful creation, refetch `listMyMediaFromApi()` so the new media appears in the table. - - npx eslint "app/(user-data)/myMedia/page.tsx" "lib/api/workspace.ts" - Users can create a simple new media entry and see it listed without manual refresh. - - - - Add safe delete-media workflow with confirmation - app/(user-data)/myMedia/page.tsx, lib/api/workspace.ts - - Implement row-level delete for media with strong safeguards. - - Add a Delete command with confirmation dialog that clearly states the path being deleted. - - Use workspace proxy delete (`/api/workspace/delete`) for media paths. - - For automated/local tests, operate only on media created during the test (not on existing supervisor media). - - npx eslint "app/(user-data)/myMedia/page.tsx" "lib/api/workspace.ts" - Media rows can be safely deleted with user confirmation, and tests avoid destructive operations on supervisor-owned media. - - -## Success Criteria -- [ ] My Media supports creation of new media entries. -- [ ] My Media supports safe, confirmed deletion of selected media. - -## Timestamp Log -- Created: 2026-03-16 10:17:02 CDT - diff --git a/.gsd/phases/25/4-SUMMARY.md b/.gsd/phases/25/4-SUMMARY.md deleted file mode 100644 index 97fc78b0..00000000 --- a/.gsd/phases/25/4-SUMMARY.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -phase: 25 -plan: 4 -completed_at: 2026-03-16 10:36:09 CDT -duration_minutes: 16 ---- - -# Summary: My Media CRUD Parity - -## Results -- 2 tasks completed -- Added create and guarded delete flows on `myMedia` - -## Tasks Completed -| Task | Description | Commit | Status | -|------|-------------|--------|--------| -| 1 | Add Create New Media form and wiring | `8b76148` | Completed | -| 2 | Add safe delete-media workflow with confirmation | `14d2eac` | Completed | - -## Deviations Applied -None - executed as planned. - -## Files Changed -- `app/(user-data)/myMedia/page.tsx` - added media create dialog, status alerts, and guarded delete dialog - -## Verification -- `npx eslint "app/(user-data)/myMedia/page.tsx" "lib/api/workspace.ts"`: Passed - -## Timestamp Log -- Created: 2026-03-16 10:36:09 CDT diff --git a/.gsd/phases/25/5-PLAN.md b/.gsd/phases/25/5-PLAN.md deleted file mode 100644 index 06338b05..00000000 --- a/.gsd/phases/25/5-PLAN.md +++ /dev/null @@ -1,53 +0,0 @@ ---- -phase: 25 -plan: 5 -wave: 3 ---- - -# Plan 25.5: Delete-Model UX and Safe Testing - -## Objective -Finalize delete-model UX in the UI using the existing delete API, and define a safe testing strategy that validates behavior without deleting supervisor-critical models. - -## Context -- .gsd/phases/25/RESEARCH.md -- app/(user-data)/my-models/page.tsx -- components/ui/DeleteModelModal.tsx -- lib/api/modelseed.ts -- scripts/poplar-smoke.mjs - -## Tasks - - - Review and harden Delete Model modal behavior - components/ui/DeleteModelModal.tsx, app/(user-data)/my-models/page.tsx - - Confirm that the Delete Model modal is correctly wired to `deleteModelFromApi(ref)` and provides clear UX. - - Ensure confirmation text includes the full model ref/id. - - Handle API errors and show user-friendly messages. - - Prevent accidental double-submission while a delete is in-flight. - - npx eslint "components/ui/DeleteModelModal.tsx" "app/(user-data)/my-models/page.tsx" - Delete modal behavior is robust and clearly communicates what will be deleted. - - - - Define and implement safe delete-model test strategy - scripts/poplar-smoke.mjs, .gsd/phases/25/VERIFICATION.md - - Document and, where appropriate, implement a safe strategy for exercising delete-model behavior. - - For automated tests, create a disposable model (e.g., via reconstruct job) and then delete only that model. - - For supervisor accounts, ensure instructions explicitly avoid deleting existing important models. - - Optionally add a commented or opt-in smoke check for delete that requires explicit model ref override. - - grep-like verification that delete strategy is documented in VERIFICATION and that any scripted delete is opt-in and clearly labeled - Delete-model behavior is testable without risking important supervisor models. - - -## Success Criteria -- [ ] Delete modal is UX-solid and wired to the correct API client. -- [ ] A documented, safe delete test strategy exists and is followed. - -## Timestamp Log -- Created: 2026-03-16 10:17:02 CDT - diff --git a/.gsd/phases/25/5-SUMMARY.md b/.gsd/phases/25/5-SUMMARY.md deleted file mode 100644 index 72c123ff..00000000 --- a/.gsd/phases/25/5-SUMMARY.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -phase: 25 -plan: 5 -completed_at: 2026-03-16 10:36:09 CDT -duration_minutes: 10 ---- - -# Summary: Delete-Model UX and Safe Testing - -## Results -- 2 tasks completed -- Hardened delete-model confirmation UX and documented an opt-in smoke strategy for disposable models only - -## Tasks Completed -| Task | Description | Commit | Status | -|------|-------------|--------|--------| -| 1 | Review and harden Delete Model modal behavior | `9192176` | Completed | -| 2 | Define and implement safe delete-model test strategy | `f17e76f` | Completed | - -## Deviations Applied -None - executed as planned. - -## Files Changed -- `components/ui/DeleteModelModal.tsx` - made delete confirmation clearer and safer during in-flight actions -- `scripts/poplar-smoke.mjs` - added an explicit opt-in delete smoke path -- `.gsd/phases/25/VERIFICATION.md` - documented safe delete expectations and remaining manual validation - -## Verification -- `npx eslint "components/ui/DeleteModelModal.tsx" "app/(user-data)/my-models/page.tsx" "scripts/poplar-smoke.mjs"`: Passed -- `npm run build`: Passed - -## Timestamp Log -- Created: 2026-03-16 10:36:09 CDT diff --git a/.gsd/phases/25/RESEARCH.md b/.gsd/phases/25/RESEARCH.md deleted file mode 100644 index 64f65836..00000000 --- a/.gsd/phases/25/RESEARCH.md +++ /dev/null @@ -1,79 +0,0 @@ ---- -phase: 25 -level: 2 -researched_at: 2026-03-16 10:17:02 CDT ---- - -# Phase 25 Research: Remaining Workflow UIs (Merge, Edit, History, Media CRUD, Delete) - -## Questions Investigated -1. Which backend endpoints already exist for merge, edit, edit-history, media CRUD, and delete? -2. Which UI entry points are natural, given the current Next.js layouts and the legacy Angular views? -3. How can delete testing be made safe so we validate behavior without deleting supervisor-critical models? - -## Findings - -### Existing endpoints and client wrappers -- Merge models: - - Backend: `POST /api/jobs/merge` - - Client: `submitMergeJobFromApi(payload)` in `lib/api/modelseed.ts`. -- Model editing: - - Backend: `POST /api/models/edit` (currently 501 on some backends, but contract is defined). - - Client: `editModelFromApi(payload)` in `lib/api/modelseed.ts`. -- Model edit history: - - Backend: `GET /api/models/edits?ref=...` (501 or result list depending on deployment phase). - - Client: `listModelEditsFromApi(ref)` in `lib/api/modelseed.ts` and basic status surfaced in model detail. -- Media: - - Backend: `GET /api/media/public`, `GET /api/media/mine`, `GET /api/media/export?ref=...`. - - No dedicated media create/delete endpoints yet; media objects are still workspace-backed. -- Delete model: - - Backend: `DELETE /api/models?ref=...`. - - Client: `deleteModelFromApi(ref)` is already implemented. - -### Natural UI entry points -- Merge models: - - UI belongs under user data → My Models (table-level multi-select + “Merge Models” action). -- Model edit + history: - - UI belongs on the model detail page: - - Tab or panel for “Edits”. - - Edit form for adding/removing reactions or changing biomass (Phase 2 of API). -- Media CRUD: - - UI belongs under `/myMedia` with: - - “Create New Media” form. - - Row-level delete with confirmation. -- Delete model: - - Existing delete modal in My Models should use the new delete API but test only against throwaway/test models. - -### Safe delete testing strategy -- Use a dedicated test model for end-to-end delete verification (e.g., a model created in the same test flow). -- For supervisor accounts, keep delete UI wired and visible but: - - Do not fire delete operations against important references. - - Encode tests so that they first create and then delete a disposable model if needed. - -## Decisions Made -| Decision | Choice | Rationale | -|---|---|---| -| Merge UI location | My Models table with multi-select + merge dialog | Matches user mental model and legacy workflows | -| Edit UI location | Model Detail page, new Edit tab | Keeps editing close to model inspection | -| History UI | Model Detail → Edits tab listing events | Natural place to review changes | -| Media CRUD | `/myMedia` page with create + delete | Aligns with legacy My Media workflows | -| Delete testing | Only delete disposable test models | Respects supervisor account safety requirement | - -## Patterns to Follow -- Use `@tanstack/react-query` and existing API client wrappers for all new flows. -- Keep destructive actions guarded by clear confirmation dialogs and descriptive messaging. -- Mirror legacy table/toolbar patterns for usability where helpful, without copying code. - -## Anti-Patterns to Avoid -- Do not run delete against real supervisor models in automated tests. -- Do not introduce new ad-hoc fetch logic in components; rely on `lib/api/*`. -- Do not depend on biochem endpoints for these flows. - -## Ready for Planning -- [x] Endpoint + client inventory complete. -- [x] Target UI entry points chosen. -- [x] Safe testing strategy for delete clarified. - -## Timestamp Log -- Created: 2026-03-16 10:17:02 CDT - diff --git a/.gsd/phases/25/VERIFICATION.md b/.gsd/phases/25/VERIFICATION.md deleted file mode 100644 index 107d9755..00000000 --- a/.gsd/phases/25/VERIFICATION.md +++ /dev/null @@ -1,54 +0,0 @@ ---- -phase: 25 -verified_at: 2026-03-16 10:36:09 CDT -verdict: PARTIAL ---- - -# Phase 25 Verification Report - -## Summary -4/4 implementation must-haves were completed and verified with local lint/build evidence. Live authenticated verification for merge, media create/delete, and delete-model safety was intentionally not executed against the supervisor account. - -## Must-Haves - -### [x] Merge-model workflow UI exists on `my-models` -**Status:** PASS -**Evidence:** -- `npx eslint "app/(user-data)/my-models/page.tsx" "lib/api/jobTracker.ts" "scripts/poplar-smoke.mjs"` -- `npm run build` - -### [x] Model edit + edit-history UI exists on model detail -**Status:** PASS -**Evidence:** -- `npx eslint "app/model/[...path]/page.tsx"` -- `npm run build` - -### [x] My Media create/delete workflows exist with safeguards -**Status:** PASS -**Evidence:** -- `npx eslint "app/(user-data)/myMedia/page.tsx" "lib/api/workspace.ts"` -- `npm run build` - -### [x] Delete-model UX is hardened and safe test strategy is documented -**Status:** PASS -**Evidence:** -- `npx eslint "components/ui/DeleteModelModal.tsx" "app/(user-data)/my-models/page.tsx" "scripts/poplar-smoke.mjs"` -- `npm run build` -- `scripts/poplar-smoke.mjs` now requires both `--allow-delete-model` and `DELETE_MODEL_REF` before attempting any delete-model smoke check. - -## Safe Delete Strategy -- Default behavior: do not run delete-model smoke tests. -- Opt-in smoke only: `DELETE_MODEL_REF="/path/to/disposable/model" node scripts/poplar-smoke.mjs --allow-delete-model` -- Required practice: only pass a disposable model created for the test session. -- Supervisor accounts: do not point `DELETE_MODEL_REF` at existing important models. - -## Verdict -PARTIAL - -## Remaining Manual Verification -- Authenticated browser validation of merge-model submission on localhost. -- Authenticated browser validation of media create/delete using disposable media names. -- Optional opt-in delete-model smoke against a disposable model ref only. - -## Timestamp Log -- Created: 2026-03-16 10:36:09 CDT diff --git a/.gsd/phases/26/1-PLAN.md b/.gsd/phases/26/1-PLAN.md deleted file mode 100644 index 7982b21f..00000000 --- a/.gsd/phases/26/1-PLAN.md +++ /dev/null @@ -1,55 +0,0 @@ ---- -phase: 26 -plan: 1 -wave: 1 ---- - -# Plan 26.1: Functional Visualize Data Panel Translation - -## Objective -Translate legacy "Visualize Data" interaction on model detail into a functional modern UI that shows FBA, GapFill, and Expression content states under the dropdown, while keeping existing Run FBA/Run Gapfill button behavior unchanged. - -## Context -- .gsd/phases/26/RESEARCH.md -- app/model/[...path]/page.tsx -- components/ui/ModelDetailHeader.tsx -- lib/api/modelseed.ts -- external/ModelSEED-UI/app/views/data/model.html -- external/ModelSEED-UI/app/views/lists/model-fbas.html -- external/ModelSEED-UI/app/views/lists/model-gapfills.html -- external/ModelSEED-UI/app/views/lists/expanded-expression.html - -## Tasks - - - Wire Visualize Data dropdown to render model-scoped panels - app/model/[...path]/page.tsx, components/ui/ModelDetailHeader.tsx - - Make the Visualize Data selector drive conditional content rendering below the model header. - - Preserve option set: FBA, Expression, GapFill. - - Show explicit legacy-style empty states when no data exists. - - Keep current Run FBA/Run Gapfilling buttons unchanged. - - npx eslint "app/model/[...path]/page.tsx" "components/ui/ModelDetailHeader.tsx" - Changing Visualize Data selection reliably changes the rendered panel state. - - - - Bind FBA/Gapfill/Expression data sources to Visualize Data panels - app/model/[...path]/page.tsx, lib/api/modelseed.ts - - Populate each Visualize Data panel using available model data APIs and fields. - - Use model-scoped FBA and gapfill APIs for list rendering. - - Use expression data from model payload when present, otherwise show deterministic "No expression data" state. - - Surface API failures with concise, non-crashing user messages. - - npx eslint "app/model/[...path]/page.tsx" "lib/api/modelseed.ts" && npm run build - Visualize Data panels load and render without breaking model detail page rendering. - - -## Success Criteria -- [ ] Visualize Data dropdown is functionally translated. -- [ ] FBA, GapFill, and Expression views show correct empty/data/error states. - -## Timestamp Log -- Created: 2026-03-16 11:07:14 CDT diff --git a/.gsd/phases/26/1-SUMMARY.md b/.gsd/phases/26/1-SUMMARY.md deleted file mode 100644 index b9dd3590..00000000 --- a/.gsd/phases/26/1-SUMMARY.md +++ /dev/null @@ -1,31 +0,0 @@ ---- -phase: 26 -plan: 1 -completed_at: 2026-03-16 11:15:36 CDT -duration_minutes: 12 ---- - -# Summary: Functional Visualize Data Panel Translation - -## Results -- 2 tasks completed -- Visualize Data now renders model-scoped FBA, GapFill, and Expression content states - -## Tasks Completed -| Task | Description | Commit | Status | -|------|-------------|--------|--------| -| 1 | Wire Visualize Data dropdown to render model-scoped panels | `0d79def` | Completed | -| 2 | Bind FBA/Gapfill/Expression data sources to Visualize Data panels | `11cf1b7` | Completed | - -## Deviations Applied -None - executed as planned. - -## Files Changed -- `app/model/[...path]/page.tsx` - Added conditional Visualize Data rendering plus FBA, gapfill, and expression state extraction/presentation. - -## Verification -- `npx eslint "app/model/[...path]/page.tsx" "components/ui/ModelDetailHeader.tsx"`: Passed -- `npx eslint "app/model/[...path]/page.tsx" "lib/api/modelseed.ts" && npm run build`: Passed - -## Timestamp Log -- Created: 2026-03-16 11:15:36 CDT diff --git a/.gsd/phases/26/2-PLAN.md b/.gsd/phases/26/2-PLAN.md deleted file mode 100644 index 4cb20fa6..00000000 --- a/.gsd/phases/26/2-PLAN.md +++ /dev/null @@ -1,54 +0,0 @@ ---- -phase: 26 -plan: 2 -wave: 2 ---- - -# Plan 26.2: Model Detail Surface Parity (Panels, Drill-Ins, Downloads) - -## Objective -Close major model-detail UI parity gaps by translating missing detail/drill-in surfaces from legacy model page into modern equivalents. - -## Context -- .gsd/phases/26/RESEARCH.md -- app/model/[...path]/page.tsx -- components/ui/ModelDetailHeader.tsx -- external/ModelSEED-UI/app/views/data/model.html -- external/ModelSEED-UI/app/views/data/model-generic.html -- app/(user-data)/my-models/page.tsx -- components/ui/DownloadModelMenu.tsx - -## Tasks - - - Add reaction/compound detail drill-in surfaces on model page - app/model/[...path]/page.tsx - - Implement row-level detail drill-ins for reactions and compounds inspired by legacy side panels. - - Add click/command entry points in the relevant tabs. - - Display expanded reaction/compound metadata without route changes. - - Ensure keyboard/close behavior is stable. - - npx eslint "app/model/[...path]/page.tsx" - Users can open and close detail drill-ins for reaction and compound rows. - - - - Translate model-detail download/options UX into modern equivalent - app/model/[...path]/page.tsx, components/ui/DownloadModelMenu.tsx, lib/api/modelseed.ts - - Provide a model-detail-local download/options surface that mirrors legacy intent. - - Expose existing export formats from model detail context. - - Include clear status/error feedback on export actions. - - Keep behavior aligned with existing backend export capabilities. - - npx eslint "app/model/[...path]/page.tsx" "components/ui/DownloadModelMenu.tsx" "lib/api/modelseed.ts" && npm run build - Model detail includes a translated download/options interaction that works end-to-end. - - -## Success Criteria -- [ ] Reaction/compound drill-ins are available in model detail. -- [ ] Model detail has a functional download/options surface. - -## Timestamp Log -- Created: 2026-03-16 11:07:14 CDT diff --git a/.gsd/phases/26/2-SUMMARY.md b/.gsd/phases/26/2-SUMMARY.md deleted file mode 100644 index f48d7ce9..00000000 --- a/.gsd/phases/26/2-SUMMARY.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -phase: 26 -plan: 2 -completed_at: 2026-03-16 11:17:43 CDT -duration_minutes: 14 ---- - -# Summary: Model Detail Surface Parity (Panels, Drill-Ins, Downloads) - -## Results -- 2 tasks completed -- Reaction/compound drill-ins and model-detail download options are now available on the model page - -## Tasks Completed -| Task | Description | Commit | Status | -|------|-------------|--------|--------| -| 1 | Add reaction/compound detail drill-in surfaces on model page | `2420908` | Completed | -| 2 | Translate model-detail download/options UX into modern equivalent | `8fc4cbc` | Completed | - -## Deviations Applied -None - executed as planned. - -## Files Changed -- `app/model/[...path]/page.tsx` - Added reaction/compound detail drawer interactions and embedded a model-local download options surface. -- `components/ui/DownloadModelMenu.tsx` - Added customizable labeling plus clearer success/error/helper feedback for model exports. - -## Verification -- `npx eslint "app/model/[...path]/page.tsx"`: Passed -- `npx eslint "app/model/[...path]/page.tsx" "components/ui/DownloadModelMenu.tsx" "lib/api/modelseed.ts" && npm run build`: Passed - -## Timestamp Log -- Created: 2026-03-16 11:17:43 CDT diff --git a/.gsd/phases/26/3-PLAN.md b/.gsd/phases/26/3-PLAN.md deleted file mode 100644 index 528c4624..00000000 --- a/.gsd/phases/26/3-PLAN.md +++ /dev/null @@ -1,53 +0,0 @@ ---- -phase: 26 -plan: 3 -wave: 2 ---- - -# Plan 26.3: Translation Inventory Closure and Validation Pass - -## Objective -Produce an explicit translated-vs-untranslated inventory for model-detail legacy features and run browser/API validation checks to support full parity sign-off. - -## Context -- .gsd/phases/26/RESEARCH.md -- app/model/[...path]/page.tsx -- external/ModelSEED-UI/app/views/data/model.html -- external/ModelSEED-UI/app/views/data/model-generic.html -- .gsd/STATE.md -- .gsd/ROADMAP.md - -## Tasks - - - Create model-detail parity inventory artifact - .gsd/phases/26/PARITY-INVENTORY.md, app/model/[...path]/page.tsx, external/ModelSEED-UI/app/views/data/model.html - - Write a concrete feature matrix covering legacy model-detail surfaces. - - For each feature, mark: translated, partially translated, or intentionally deferred. - - Include rationale for any deferred/unsupported features. - - Keep inventory specific to model detail validation scope. - - Verify `.gsd/phases/26/PARITY-INVENTORY.md` exists and lists all legacy model-detail feature groups. - Parity inventory is explicit enough to drive final validation review. - - - - Run model-detail validation checks and capture outcomes - .gsd/phases/26/VERIFICATION.md, app/model/[...path]/page.tsx - - Perform non-destructive validation for the translated model-detail flow. - - Validate Visualize Data panel behavior and tab interactions in browser. - - Validate data/error states for FBA/GapFill/Expression views. - - Record PASS/PARTIAL/FAIL evidence in Phase 26 verification report. - - npx eslint "app/model/[...path]/page.tsx" && npm run build - Phase 26 has an evidence-backed verification report for model-detail parity status. - - -## Success Criteria -- [ ] Model-detail parity inventory is documented in phase artifacts. -- [ ] Validation evidence exists for translated features and explicit remaining gaps. - -## Timestamp Log -- Created: 2026-03-16 11:07:14 CDT diff --git a/.gsd/phases/26/3-SUMMARY.md b/.gsd/phases/26/3-SUMMARY.md deleted file mode 100644 index 0edc3259..00000000 --- a/.gsd/phases/26/3-SUMMARY.md +++ /dev/null @@ -1,35 +0,0 @@ ---- -phase: 26 -plan: 3 -completed_at: 2026-03-16 11:24:49 CDT -duration_minutes: 9 ---- - -# Summary: Translation Inventory Closure and Validation Pass - -## Results -- 2 tasks completed -- Model-detail parity inventory and evidence-backed verification artifacts are now present for Phase 26 - -## Tasks Completed -| Task | Description | Commit | Status | -|------|-------------|--------|--------| -| 1 | Create model-detail parity inventory artifact | `79ad1be` | Completed | -| 2 | Run model-detail validation checks and capture outcomes | Pending commit | Completed | - -## Deviations Applied -- [Rule 3 - Blocking] Live browser validation could not complete end-to-end because `/api/models` and `/api/models/data` are currently failing upstream with `Workspace` HTTP 500 responses. Recorded as partial verification instead of forcing a false PASS. - -## Files Changed -- `.gsd/phases/26/PARITY-INVENTORY.md` - Added translated/partial/deferred inventory for legacy model-detail feature groups. -- `.gsd/phases/26/VERIFICATION.md` - Recorded build evidence plus backend-blocked browser/API validation outcomes. -- `.gsd/ROADMAP.md` - Marked Phase 26 as in progress with partial-verification note. -- `.gsd/STATE.md` - Updated current execution state and next steps for backend-unblocked revalidation. - -## Verification -- Verified `.gsd/phases/26/PARITY-INVENTORY.md` exists and covers legacy model-detail feature groups. -- `npx eslint "app/model/[...path]/page.tsx" && npm run build`: Previously passed during Phase 26 implementation. -- Browser/API evidence captured for partial validation blocker. - -## Timestamp Log -- Created: 2026-03-16 11:24:49 CDT diff --git a/.gsd/phases/26/PARITY-INVENTORY.md b/.gsd/phases/26/PARITY-INVENTORY.md deleted file mode 100644 index a7bb0d01..00000000 --- a/.gsd/phases/26/PARITY-INVENTORY.md +++ /dev/null @@ -1,61 +0,0 @@ ---- -phase: 26 -updated_at: 2026-03-16 11:18:00 CDT ---- - -# Phase 26 Model Detail Parity Inventory - -## Scope -This inventory covers legacy model-detail surfaces from `external/ModelSEED-UI/app/views/data/model.html` and related included templates, mapped against the modern `app/model/[...path]/page.tsx` implementation. - -## Status Legend -- `Translated` - implemented in the modern model page for Phase 26 validation scope. -- `Partially translated` - visible modern equivalent exists, but legacy behavior depth is not fully reproduced. -- `Deferred` - intentionally not translated in this phase. -- `Unsupported` - legacy behavior depends on backend/supporting capabilities not available in the modern app today. - -## Feature Matrix -| Legacy feature group | Current status | Notes | -|---|---|---| -| Model title/header | Translated | Modern header shows model title and keeps primary action cluster on page. | -| Run FBA button | Deferred | Left intentionally unchanged per user instruction. | -| Run GapFilling button | Deferred | Left intentionally unchanged per user instruction. | -| Rebuild Model button | Deferred | Placeholder styling remains; no workflow integration added in Phase 26. | -| Blast Genome button | Deferred | Placeholder styling remains; no workflow integration added in Phase 26. | -| Add Expression button | Deferred | Placeholder styling remains; no upload workflow added in Phase 26. | -| Visualize Data selector | Translated | Dropdown now drives conditional panel rendering for FBA, Expression, and GapFill. | -| FBA visualize panel | Partially translated | Modern page renders data, empty, and error states; legacy-style row actions and selection context are not yet reproduced. | -| GapFill visualize panel | Partially translated | Modern page renders data, empty, and error states; legacy-style row actions and selection context are not yet reproduced. | -| Expression visualize panel | Translated | Modern page renders expression rows from `expression_data` with legacy-style empty state. | -| Overview metadata section | Translated | Key model metadata remains visible and now includes edit-count status. | -| Reactions tab | Translated | Modern data grid remains in place. | -| Compounds tab | Translated | Modern data grid remains in place. | -| Genes tab | Translated | Modern data grid remains in place. | -| Compartments tab | Translated | Modern data grid remains in place. | -| Biomass tab | Translated | Modern data grid remains in place. | -| Pathways tab | Translated | Static pathway summary tab remains in place. | -| Reaction detail side panel | Translated | Added right-side drill-in drawer with row metadata and explicit close control. | -| Compound detail side panel | Translated | Added right-side drill-in drawer with row metadata and explicit close control. | -| Model download/options surface | Translated | Added model-detail-local download menu with SBML/JSON/TSV export feedback. | -| Edit Model tab | Translated | Implemented in Phase 25 and retained in model detail flow. | -| Edit history table | Translated | Implemented in Phase 25 and retained in model detail flow. | -| Plant-only Predictions tab | Deferred | Legacy plant-specific surface is not carried into the simplified modern tab set. | -| Dynamic pathway tabs | Deferred | Legacy dynamic pathway tabs are not reproduced in the modern page architecture. | -| Organism image / external links block | Deferred | Legacy right-rail image/links block is not implemented in the modern page. | - -## Validation-Relevant Gaps Remaining -- Live backend validation is currently blocked by upstream `Workspace` 500 errors on `/api/models` and `/api/models/data`. -- Visualize Data FBA/GapFill panels do not yet include legacy row-level actions or detail-route links. -- Plant-only predictions, dynamic pathway tabs, and the legacy right-rail image/links block remain deferred. -- Rebuild/Blast/Add Expression workflows remain intentionally out of scope for this phase. - -## Outcome -The highest-priority visible model-detail parity gaps requested for Phase 26 are implemented in code: -- Functional Visualize Data rendering. -- Model-local drill-in surfaces for reactions and compounds. -- Model-local download/options interaction. - -Remaining work is either intentionally deferred or blocked by current backend behavior. - -## Timestamp Log -- Created: 2026-03-16 11:18:00 CDT diff --git a/.gsd/phases/26/RESEARCH.md b/.gsd/phases/26/RESEARCH.md deleted file mode 100644 index 7d398973..00000000 --- a/.gsd/phases/26/RESEARCH.md +++ /dev/null @@ -1,68 +0,0 @@ ---- -phase: 26 -researched_at: 2026-03-16 11:07:14 CDT ---- - -# Phase 26 Research: Model Detail Legacy Translation Gaps - -## Objective -Document all model-detail features that remain untranslated from legacy (`external/ModelSEED-UI`) into the modern Next.js model page, with explicit scope for validation readiness. - -## Scope Decision -- In scope: model detail parity gaps that block full validation for `/model/...`. -- Out of scope for this phase: changing current Run FBA / Run Gapfill button integration behavior (user-requested hold). - -## Legacy Baseline Reviewed -- `external/ModelSEED-UI/app/views/data/model.html` -- `external/ModelSEED-UI/app/views/data/model-generic.html` -- `external/ModelSEED-UI/app/views/lists/model-fbas.html` -- `external/ModelSEED-UI/app/views/lists/model-gapfills.html` -- `external/ModelSEED-UI/app/views/lists/expanded-expression.html` -- `external/ModelSEED-UI/app/ctrls/data-view-ctrls.js` - -## Current Modern Baseline Reviewed -- `app/model/[...path]/page.tsx` -- `components/ui/ModelDetailHeader.tsx` -- `lib/api/modelseed.ts` - -## Untranslated / Incomplete Features - -### 1) Visualize Data dropdown behavior -- Legacy: dropdown drives conditional panels for FBA, Expression, GapFill. -- Current: dropdown state exists but does not render any selection-specific panel. -- Impact: high (explicitly visible mismatch and non-functional UX). - -### 2) Related FBA and Gapfill data panels under Visualize Data -- Legacy: model-scoped list views with rows and selection/actions context. -- Current: no equivalent panels on model detail despite available APIs (`/api/models/fba`, `/api/models/gapfills`). -- Impact: high for parity and validation. - -### 3) Expression visualization panel -- Legacy: expression list table with empty-state messaging. -- Current: no expression panel linked to Visualize Data. -- Impact: medium-high. - -### 4) Download/options and detail-surface parity -- Legacy: explicit model download options panel and side detail views for reaction/compound drill-ins. -- Current: model detail page lacks equivalent drill-in surfaces and does not reproduce legacy download/options UX. -- Impact: medium. - -### 5) Plant/advanced legacy surfaces not translated -- Legacy includes additional plant-specific/dynamic surfaces (Predictions tab, dynamic map tabs). -- Current has a simplified static tab model. -- Impact: medium; must be explicitly translated or intentionally marked unsupported in UI. - -## API/Backend Feasibility -- Required data APIs already exist in frontend client: - - `getModelFbaFromApi(ref)` - - `listModelGapfillsFromApi(ref)` - - `manageModelGapfillsFromApi(payload)` -- Expression panel can initially consume available model object fields (`expression_data`) with graceful empty-state if absent. - -## Validation Targets for Phase 26 -- `/model/...` Visualize Data dropdown is functional and drives visible content states. -- FBA/Gapfill/Expression states show deterministic empty/data/error behavior. -- Non-translated legacy-only features are either implemented or explicitly surfaced as unsupported with clear UX messaging. - -## Timestamp Log -- Created: 2026-03-16 11:07:14 CDT diff --git a/.gsd/phases/26/VERIFICATION.md b/.gsd/phases/26/VERIFICATION.md deleted file mode 100644 index f425236d..00000000 --- a/.gsd/phases/26/VERIFICATION.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -phase: 26 -verified_at: 2026-03-16 11:24:49 CDT -verdict: PARTIAL ---- - -# Phase 26 Verification Report - -## Summary -2/3 must-have groups verified. Live model-detail browser validation is currently blocked by upstream backend failures. - -## Must-Haves - -### Functional Visualize Data translation -**Status:** PASS -**Evidence:** -- `npx eslint "app/model/[...path]/page.tsx" "components/ui/ModelDetailHeader.tsx"` passed after panel wiring. -- `npx eslint "app/model/[...path]/page.tsx" "lib/api/modelseed.ts" && npm run build` passed after FBA/GapFill/Expression state binding. - -### Model detail parity surfaces (drill-ins and download/options) -**Status:** PASS -**Evidence:** -- `npx eslint "app/model/[...path]/page.tsx"` passed after adding reaction/compound drill-in drawer behavior. -- `npx eslint "app/model/[...path]/page.tsx" "components/ui/DownloadModelMenu.tsx" "lib/api/modelseed.ts" && npm run build` passed after adding model-local download options. - -### Browser/API validation of non-destructive model-detail flow -**Status:** PARTIAL -**Evidence:** -- Browser session authenticated successfully with the provided PATRIC token; top-level app shell showed signed-in user state. -- Browser navigation to `http://localhost:3000/model/seaver%40patricbrc.org/modelseed/patrictest_121620` produced the in-app error `Error loading model: /seaver@patricbrc.org/modelseed/patrictest_121620`. -- Screenshot captured: `/tmp/cursor/screenshots/phase26-model-detail-page-error.png`. -- Direct API probe to `http://localhost:8000/api/models/data?ref=/seaver@patricbrc.org/modelseed/Test` returned: - -```text -HTTP 500 -{"detail":"500 Server Error: Internal Server Error for url: https://p3.theseed.org/services/Workspace"} -``` - -- Direct API probe to `http://localhost:8000/api/models` also returned HTTP 500, which matched the browser-visible `Failed to fetch` state on `/my-models`. - -## Verdict -PARTIAL - -## Remaining Gaps -- The Phase 26 UI work is implemented and build-verified, but empirical model-detail runtime validation is blocked by current backend `Workspace` 500 responses. -- FBA and GapFill visualize panels do not yet reproduce legacy row-level action links/selectors; the current translation covers visible list/data/error states only. -- Deferred legacy-only surfaces remain tracked in `.gsd/phases/26/PARITY-INVENTORY.md`. - -## Timestamp Log -- Created: 2026-03-16 11:24:49 CDT diff --git a/.gsd/phases/27/1-PLAN.md b/.gsd/phases/27/1-PLAN.md deleted file mode 100644 index b50d34bb..00000000 --- a/.gsd/phases/27/1-PLAN.md +++ /dev/null @@ -1,55 +0,0 @@ ---- -phase: 27 -plan: 1 -wave: 1 ---- - -# Plan 27.1: Model Detail Formatting and Cross-Link Parity - -## Objective -Align model-detail and user-model tables with legacy chemical formatting and cross-link behavior so that reactions, compounds, biomass entries, pathways, and genome refs feel consistent with both the legacy UI and the biochem reference pages. - -## Context -- .gsd/phases/26/PARITY-INVENTORY.md -- app/model/[...path]/page.tsx -- app/(user-data)/my-models/page.tsx -- app/(reference-data)/biochem/compounds/page.tsx -- app/(reference-data)/biochem/reactions/page.tsx -- external/ModelSEED-UI/app/views/data/model.html -- external/ModelSEED-UI/app/views/data/model-generic.html - -## Tasks - - - Normalize chemical equation and formula formatting for model-detail tables - app/model/[...path]/page.tsx - - Introduce and apply a shared formatting helper for equations and formulas so user-model tables visually match legacy expectations. - - Reuse or extend the existing v1-alpha formatting utilities created in Phase 13 instead of inventing a separate pattern. - - Apply consistent formatting for model reactions (equation), compounds (formula/charge), and biomass component rows. - - Preserve current grid performance and avoid breaking reference biochem tables. - - npx eslint "app/model/[...path]/page.tsx" && npm run build - Model-detail reactions, compounds, and biomass tables render chemically formatted equations/formulas consistent with reference biochem tables. - - - - Add cross-links from model-detail to reference/related detail pages - app/model/[...path]/page.tsx, app/(reference-data)/biochem/compounds/page.tsx, app/(reference-data)/biochem/reactions/page.tsx - - Wire IDs in model-detail tables to the appropriate detail routes and ensure links behave predictably. - - Make reaction IDs clickable and route to `/biochem/reactions/[id]` using the same encode/decode behavior as existing biochem routes. - - Make compound IDs clickable and route to `/biochem/compounds/[id]` with stable loading/error states. - - If possible, make the Genome Ref in the Overview tab link to the appropriate `/genome/...` detail page; otherwise, add clear text indicating when no valid genome route is available. - - npx eslint "app/model/[...path]/page.tsx" && npm run build - Reaction, compound, and (where possible) genome references from the model-detail page navigate to working detail pages without breaking existing flows. - - -## Success Criteria -- [ ] Chemical equations and formulas in model-detail tables match the formatting style used in biochem reference tables. -- [ ] Reaction and compound IDs in model-detail tables are clickable and lead to stable detail pages. -- [ ] Genome refs in the Overview tab either link to a valid genome detail page or show an explicit, non-broken non-link state. - -## Timestamp Log -- Created: 2026-03-16 11:39:55 CDT diff --git a/.gsd/phases/27/1-SUMMARY.md b/.gsd/phases/27/1-SUMMARY.md deleted file mode 100644 index e450a8d4..00000000 --- a/.gsd/phases/27/1-SUMMARY.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -phase: 27 -plan: 1 -completed_at: 2026-03-16 11:46:54 CDT -duration_minutes: 18 ---- - -# Summary: Model Detail Formatting and Cross-Link Parity - -## Results -- 2 tasks completed -- Model-detail reactions/compounds/biomass now use parity formatting and reference cross-links - -## Tasks Completed -| Task | Description | Commit | Status | -|------|-------------|--------|--------| -| 1 | Normalize chemical equation and formula formatting for model-detail tables | `27a9f0a` | Completed | -| 2 | Add cross-links from model-detail to reference/related detail pages | `06998ac` | Completed | - -## Deviations Applied -None - executed as planned. - -## Files Changed -- `app/model/[...path]/page.tsx` - Applied `ChemicalEquation`/`formatFormula` formatting in model tables and added reaction/compound/genome cross-links. - -## Verification -- `npx eslint "app/model/[...path]/page.tsx" && npm run build`: Passed - -## Timestamp Log -- Created: 2026-03-16 11:46:54 CDT diff --git a/.gsd/phases/27/2-PLAN.md b/.gsd/phases/27/2-PLAN.md deleted file mode 100644 index 032c8d24..00000000 --- a/.gsd/phases/27/2-PLAN.md +++ /dev/null @@ -1,52 +0,0 @@ ---- -phase: 27 -plan: 2 -wave: 1 ---- - -# Plan 27.2: Legacy Model-Detail Surfaces and Explicit Deferrals - -## Objective -Implement or clearly defer the remaining legacy model-detail surfaces (Predictions tab, dynamic pathway tabs, organism image/links block) with modern equivalents and explicit unsupported-feature UX where backend capability is missing. - -## Context -- .gsd/phases/26/PARITY-INVENTORY.md -- app/model/[...path]/page.tsx -- external/ModelSEED-UI/app/views/data/model.html -- external/ModelSEED-UI/app/views/data/model-generic.html -- external/ModelSEED-UI/app/views/genomes/plant.html - -## Tasks - - - Design and implement modern UX for legacy Predictions/dynamic pathway tabs or mark them deferred - app/model/[...path]/page.tsx - - Decide, per feature, whether to implement a minimal modern equivalent or clearly surface it as unsupported. - - For plant-only Predictions: either add a simple, data-backed tab if the backend exposes a compatible endpoint, or show an explicit "Not yet supported" stub describing what the legacy did. - - For dynamic pathway tabs: add a modern representation (e.g., a “Pathway Maps” summary panel) or a clear message that dynamic map tabs are not yet supported in the v1-beta UI. - - Ensure any new stubs are visually consistent with existing alerts/empty states and do not break current routing. - - npx eslint "app/model/[...path]/page.tsx" && npm run build - Remaining legacy model-detail surfaces are either functionally implemented or explicitly marked as deferred with clear user-facing messaging. - - - - Restore or explicitly replace organism image and external links block - app/model/[...path]/page.tsx - - Bring back the right-rail organism image and external links behavior in a modern, data-driven way. - - Use fields already available on the model/genome object (image URL, organism name, external links) where possible rather than introducing new backend contracts. - - Place the block in a way that does not collide with the Visualize Data and tables layout (e.g., a right-column card above the drawer). - - If required data is not available in the modern API, surface a compact “Links not yet available” stub instead of leaving the area empty. - - npx eslint "app/model/[...path]/page.tsx" && npm run build - The model-detail page includes either a working organism image/links block or a clear placeholder indicating that legacy links are not yet available. - - -## Success Criteria -- [ ] Users can see whether the Predictions and dynamic pathway surfaces are implemented or intentionally deferred. -- [ ] The modern model-detail page contains a clearly defined organism image/links area that does not break layout or navigation. - -## Timestamp Log -- Created: 2026-03-16 11:39:55 CDT diff --git a/.gsd/phases/27/2-SUMMARY.md b/.gsd/phases/27/2-SUMMARY.md deleted file mode 100644 index 4acb6429..00000000 --- a/.gsd/phases/27/2-SUMMARY.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -phase: 27 -plan: 2 -completed_at: 2026-03-16 11:46:54 CDT -duration_minutes: 16 ---- - -# Summary: Legacy Model-Detail Surfaces and Explicit Deferrals - -## Results -- 2 tasks completed -- Remaining legacy model-detail surfaces are now clearly represented as deferred or unavailable in-page - -## Tasks Completed -| Task | Description | Commit | Status | -|------|-------------|--------|--------| -| 1 | Design and implement modern UX for legacy Predictions/dynamic pathway tabs or mark them deferred | `ae65828` | Completed | -| 2 | Restore or explicitly replace organism image and external links block | `309f375` | Completed | - -## Deviations Applied -None - executed as planned. - -## Files Changed -- `app/model/[...path]/page.tsx` - Added legacy-surface status UX and an organism image/links card with explicit fallback messaging when data is absent. - -## Verification -- `npx eslint "app/model/[...path]/page.tsx" && npm run build`: Passed - -## Timestamp Log -- Created: 2026-03-16 11:46:54 CDT diff --git a/.gsd/phases/27/3-PLAN.md b/.gsd/phases/27/3-PLAN.md deleted file mode 100644 index cb5d4caf..00000000 --- a/.gsd/phases/27/3-PLAN.md +++ /dev/null @@ -1,56 +0,0 @@ ---- -phase: 27 -plan: 3 -wave: 2 ---- - -# Plan 27.3: Formatting/Link Audit and Validation Closure - -## Objective -Run a cross-cutting audit of formatting, links, and legacy parity across model-detail, My Models, My Media, and reference biochem pages, then produce a final validation-ready report and fix any remaining high-severity inconsistencies. - -## Context -- .gsd/phases/26/PARITY-INVENTORY.md -- .gsd/phases/27/1-PLAN.md -- .gsd/phases/27/2-PLAN.md -- app/model/[...path]/page.tsx -- app/(user-data)/my-models/page.tsx -- app/(user-data)/myMedia/page.tsx -- app/(reference-data)/list-media/page.tsx -- app/(reference-data)/biochem/compounds/page.tsx -- app/(reference-data)/biochem/reactions/page.tsx - -## Tasks - - - Create formatting and link audit matrix for user flows - .gsd/phases/27/FORMATTING-LINK-AUDIT.md - - Document how formatting and links behave across key user flows and pages. - - List each relevant table/section (model-detail tabs, My Models, My Media, reference biochem pages) and note formatting status (OK, inconsistent, broken). - - Note link behavior for IDs, genome refs, media refs, jobs, and any other important cross-links. - - Flag any high-severity inconsistencies that would confuse a validation user comparing against legacy. - - Verify `.gsd/phases/27/FORMATTING-LINK-AUDIT.md` exists and covers model-detail, user data, and biochem reference flows. - The audit matrix clearly shows where formatting and link behavior are aligned vs inconsistent, suitable for validation review. - - - - Fix high-severity formatting/link inconsistencies found in audit - .gsd/phases/27/FORMATTING-LINK-AUDIT.md, app/model/[...path]/page.tsx, app/(user-data)/my-models/page.tsx, app/(user-data)/myMedia/page.tsx - - Apply targeted fixes for the most user-visible and validation-blocking gaps called out in the audit. - - Prioritize broken or misleading links (e.g., IDs that look clickable but are not, or routes that 404). - - Address obvious formatting regressions where legacy behavior is clearly better (e.g., chemical equations rendered inconsistently between reference and model tables). - - Keep the scope to fixes that do not require backend changes and avoid expanding into new features. - - npx eslint "app/model/[...path]/page.tsx" "app/(user-data)/my-models/page.tsx" "app/(user-data)/myMedia/page.tsx" && npm run build - All audit-marked high-severity formatting/link inconsistencies are resolved or explicitly documented as blocked by backend constraints. - - -## Success Criteria -- [ ] A single audit document clearly captures formatting and link behavior across the main user flows. -- [ ] There are no remaining high-severity formatting/link inconsistencies that would confuse validation users or contradict the legacy UI’s behavior (excluding backend-blocked paths). - -## Timestamp Log -- Created: 2026-03-16 11:39:55 CDT diff --git a/.gsd/phases/27/3-SUMMARY.md b/.gsd/phases/27/3-SUMMARY.md deleted file mode 100644 index b32a0d10..00000000 --- a/.gsd/phases/27/3-SUMMARY.md +++ /dev/null @@ -1,31 +0,0 @@ ---- -phase: 27 -plan: 3 -completed_at: 2026-03-16 11:46:54 CDT -duration_minutes: 10 ---- - -# Summary: Formatting/Link Audit and Validation Closure - -## Results -- 2 tasks completed -- Cross-page formatting/link audit produced and high-severity model-detail link gaps resolved - -## Tasks Completed -| Task | Description | Commit | Status | -|------|-------------|--------|--------| -| 1 | Create formatting and link audit matrix for user flows | `97ffa3f` | Completed | -| 2 | Fix high-severity formatting/link inconsistencies found in audit | `001ed69` | Completed | - -## Deviations Applied -None - executed as planned. - -## Files Changed -- `.gsd/phases/27/FORMATTING-LINK-AUDIT.md` - Added audit matrix and severity-based remediation list. -- `app/model/[...path]/page.tsx` - Added direct links from Visualize Data FBA/GapFill rows to detail routes where refs are present. - -## Verification -- `npx eslint "app/model/[...path]/page.tsx" "app/(user-data)/my-models/page.tsx" "app/(user-data)/myMedia/page.tsx" && npm run build`: Passed - -## Timestamp Log -- Created: 2026-03-16 11:46:54 CDT diff --git a/.gsd/phases/27/FORMATTING-LINK-AUDIT.md b/.gsd/phases/27/FORMATTING-LINK-AUDIT.md deleted file mode 100644 index 0662f314..00000000 --- a/.gsd/phases/27/FORMATTING-LINK-AUDIT.md +++ /dev/null @@ -1,41 +0,0 @@ ---- -phase: 27 -audited_at: 2026-03-16 11:45:49 CDT ---- - -# Phase 27 Formatting and Link Audit - -## Scope -Audit formatting consistency and link behavior across model-detail, user data, and reference-data pages for validation readiness against legacy behavior. - -## Matrix -| Surface | Formatting Status | Link Status | Severity | Notes | -|---|---|---|---|---| -| `app/model/[...path]/page.tsx` Overview | Partially aligned | Partially aligned | Medium | Genome ref now links to `/genome/...`; target page is still a placeholder view. | -| `app/model/[...path]/page.tsx` Reactions tab | Aligned | Aligned | Low | Equation now uses `ChemicalEquation`; reaction IDs link to `/biochem/reactions/[id]`. | -| `app/model/[...path]/page.tsx` Compounds tab | Aligned | Aligned | Low | Formula now uses `formatFormula`; compound IDs link to `/biochem/compounds/[id]`. | -| `app/model/[...path]/page.tsx` Biomass tab | Partially aligned | Aligned | Medium | Compound refs link to `/biochem/compounds/[id]`; biomass formula-level display is still simplified. | -| `app/model/[...path]/page.tsx` Visualize Data FBA | Partially aligned | Not aligned | High | Row IDs are visible but not yet linked to `/fba/...`; legacy had direct drill-through behavior. | -| `app/model/[...path]/page.tsx` Visualize Data GapFill | Partially aligned | Not aligned | High | Row IDs are visible but not yet linked to `/gapfill/...`; legacy had direct drill-through behavior. | -| `app/model/[...path]/page.tsx` Legacy surfaces status block | Aligned | N/A | Low | Deferred features are explicitly surfaced to users (Predictions, dynamic pathway tabs). | -| `app/model/[...path]/page.tsx` Organism image/links card | Partially aligned | Partially aligned | Medium | Card exists; data depends on backend payload availability. | -| `app/(user-data)/my-models/page.tsx` table and commands | Aligned | Aligned | Low | Model IDs link to detail page; commands provide download/delete; tracked-job actions are wired. | -| `app/(user-data)/myMedia/page.tsx` | Partially aligned | Partially aligned | Medium | CRUD and export exist; no dedicated media detail route parity with legacy single-item page. | -| `app/(reference-data)/list-media/page.tsx` | Partially aligned | Partially aligned | Medium | Export works, but reference-media drill-through remains limited vs legacy media page behavior. | -| `app/(reference-data)/biochem/reactions/page.tsx` | Aligned | Aligned | Low | Reaction IDs are linked and equations are chemically formatted. | -| `app/(reference-data)/biochem/compounds/page.tsx` | Aligned | Aligned | Low | Compound IDs are linked and formulas are chemically formatted. | - -## High-Severity Inconsistencies -1. Visualize Data FBA rows do not provide direct links to FBA detail routes. -2. Visualize Data GapFill rows do not provide direct links to GapFill detail routes. - -## Medium-Severity Notes (tracked, not blocking this task) -1. Genome detail route remains a placeholder page, so genome-ref links are navigable but not yet feature-complete. -2. Organism image/links panel availability depends on backend model payload fields. -3. My Media and List Media do not yet reproduce full legacy per-item detail-page drill-through behavior. - -## Planned Fixes in This Phase -- Add direct links from Visualize Data FBA/GapFill IDs to `/fba/...` and `/gapfill/...` where refs are available. - -## Timestamp Log -- Created: 2026-03-16 11:45:49 CDT diff --git a/.gsd/phases/27/VERIFICATION.md b/.gsd/phases/27/VERIFICATION.md deleted file mode 100644 index a71a3294..00000000 --- a/.gsd/phases/27/VERIFICATION.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -phase: 27 -verified_at: 2026-03-16 11:46:54 CDT -verdict: PASS ---- - -# Phase 27 Verification Report - -## Summary -3/3 plan goals verified through code-level checks and build validation. - -## Must-Haves -- [x] Chemical formatting parity improved for model-detail reaction/compound tables using existing formatting utilities. -- [x] Reference cross-links added for reaction/compound IDs and model genome references. -- [x] Remaining legacy surfaces now have explicit deferred/unsupported UX messaging. -- [x] Audit matrix created and high-severity link inconsistencies fixed (Visualize Data FBA/GapFill detail links). - -## Evidence -- `npx eslint "app/model/[...path]/page.tsx" && npm run build` (after Plan 27.1): Passed -- `npx eslint "app/model/[...path]/page.tsx" && npm run build` (after Plan 27.2): Passed -- `npx eslint "app/model/[...path]/page.tsx" "app/(user-data)/my-models/page.tsx" "app/(user-data)/myMedia/page.tsx" && npm run build` (after Plan 27.3): Passed -- Audit artifact exists: `.gsd/phases/27/FORMATTING-LINK-AUDIT.md` - -## Notes -- This phase addresses frontend parity and UX consistency. Separate backend availability issues (e.g., workspace upstream 500 responses observed in prior phase verification) remain outside this phase scope. - -## Timestamp Log -- Created: 2026-03-16 11:46:54 CDT diff --git a/.gsd/phases/28/1-PLAN.md b/.gsd/phases/28/1-PLAN.md deleted file mode 100644 index 50c14817..00000000 --- a/.gsd/phases/28/1-PLAN.md +++ /dev/null @@ -1,96 +0,0 @@ ---- -phase: 28 -plan: 1 -wave: 1 ---- - -# Plan 28.1: FBA, Gapfill, and Genome Detail Pages - -## Objective -Replace the three "under construction" placeholder pages (`/fba/[...path]`, `/gapfill/[...path]`, `/genome/[...path]`) with functional detail views matching the legacy UI's data display patterns. These pages are already routed — they just need real content. - -## Context -- .gsd/SPEC.md -- app/fba/[...path]/page.tsx — current placeholder (28 lines) -- app/gapfill/[...path]/page.tsx — current placeholder (28 lines) -- app/genome/[...path]/page.tsx — current placeholder (28 lines) -- external/ModelSEED-UI/app/views/data/fba.html — legacy FBA view (3 tabs: Reaction Fluxes, Exchange Fluxes, Pathways) -- external/ModelSEED-UI/app/views/data/gapfill.html — legacy Gapfill view (reactions table) -- external/ModelSEED-UI/app/views/data/genome.html — legacy Genome view (Features + Annotations tabs) -- lib/api/modelseed.ts — getModelFbaFromApi, listModelGapfillsFromApi already exist -- lib/api/workspace.ts — workspaceGet for genome data -- components/layout/DataControlHeader.tsx — standard toolbar for DataGrid -- components/ui/ChemicalEquation.tsx — for reaction formatting - -## Tasks - - - Implement FBA detail page - app/fba/[...path]/page.tsx - - Replace the placeholder with a functional FBA detail view: - 1. Parse the workspace path from `params.path` (catch-all route gives segments) - 2. Use `getModelFbaFromApi(ref)` to fetch FBA data. The FBA data is a dict with keys like `FBAReactionVariables`, `FBACompoundVariables`, `FBAMetaboliteProductionResults`, etc. - 3. Extract the parent model ref from the path (strip last segment for the FBA object name) - 4. Display breadcrumb: My Models > ModelName > FBA Name - 5. Build three tabs matching legacy: - - **Reaction Fluxes**: DataGrid with columns: Reaction, Name, Flux, Min, Max, Class - - **Exchange Fluxes**: DataGrid with columns: Compound, Name, Flux, Min, Max, Class - - **Pathways**: DataGrid with columns: Map, Name (if pathway data available) - 6. Use DataControlHeader as toolbar in DataGrid - 7. Handle loading/error states - 8. The FBA data shape from `/api/models/fba?ref=` returns model-level FBA. The page at `/fba/` should fetch the specific FBA object via workspace if needed, or if backend only supports model-level FBA, show the model's FBA data with a note. - - IMPORTANT: Keep the same catch-all `[...path]` URL pattern — URLs must match legacy exactly (e.g., `/fba/user/models/MyModel/fba/gf.0`) - - grep -c "DataGrid" app/fba/\[...path\]/page.tsx - FBA detail page renders tabbed data tables with Reaction Fluxes and Exchange Fluxes from API data - - - - Implement Gapfill detail page - app/gapfill/[...path]/page.tsx - - Replace the placeholder with a functional Gapfill detail view: - 1. Parse workspace path from params - 2. Extract parent model ref from the path - 3. Use `listModelGapfillsFromApi(modelRef)` to get all gapfills, then filter to show the specific gapfill matching the path - 4. Display breadcrumb: My Models > ModelName > Gapfill Name - 5. Build a single tab with a DataGrid showing gapfill reactions: - - Columns: Reaction ID (linked to /biochem/reactions/), Name, Direction, Compartment - 6. Use DataControlHeader as toolbar - 7. Handle loading/error states - - IMPORTANT: URLs must match legacy exactly (e.g., `/gapfill/user/models/ModelName/gapfilling/gf.0`) - - grep -c "DataGrid" app/gapfill/\[...path\]/page.tsx - Gapfill detail page renders a reactions table from the gapfill data - - - - Implement Genome detail page - app/genome/[...path]/page.tsx - - Replace the placeholder with a functional Genome detail view: - 1. Parse workspace path from params - 2. Use `workspaceGet([path])` to fetch genome object data - 3. Display heading: "Genome" with genome name - 4. Build two tabs matching legacy: - - **Features**: DataGrid with columns: Feature ID, Type, Function, Location - - **Annotations**: DataGrid with columns: Feature, Role, Subsystem - 5. Parse genome object which contains `features` array — each feature has id, type, function, location - 6. Use DataControlHeader as toolbar - 7. Handle loading/error states with a helpful message if workspace returns 500 - - IMPORTANT: URLs must match legacy exactly (e.g., `/genome/plantseed/Genomes/Athaliana`) - - grep -c "DataGrid" app/genome/\[...path\]/page.tsx - Genome detail page renders Features and Annotations tabs from workspace data - - -## Success Criteria -- [ ] `/fba/` shows tabbed FBA data instead of "under construction" -- [ ] `/gapfill/` shows gapfill reactions table instead of "under construction" -- [ ] `/genome/` shows genome features/annotations instead of "under construction" -- [ ] All three pages use DataGrid + DataControlHeader consistent with rest of app -- [ ] Build passes with no new TypeScript errors - -## Timestamp Log -- Created: 2026-03-17 09:23:45 -05:00 diff --git a/.gsd/phases/28/1-SUMMARY.md b/.gsd/phases/28/1-SUMMARY.md deleted file mode 100644 index 260668f6..00000000 --- a/.gsd/phases/28/1-SUMMARY.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -phase: 28 -plan: 1 ---- - -# Summary 28.1: FBA, Gapfill, and Genome Detail Pages - -## What Was Done -All three placeholder "under construction" pages were replaced with fully functional detail views: - -### FBA Detail (`/fba/[...path]`) -- **Reaction Fluxes tab**: DataGrid showing Reaction (linked to biochem), Name, Flux, Min, Max, Class -- **Exchange Fluxes tab**: DataGrid showing Compound (linked to biochem), Name, Flux, Min, Max, Class -- Breadcrumb navigation: My Models > ModelName -- Data fetched from `getModelFbaFromApi` with workspace fallback -- Standard DataControlHeader toolbar - -### Gapfill Detail (`/gapfill/[...path]`) -- DataGrid showing gapfill reactions: Reaction (linked to biochem), Name, Direction, Compartment -- Parses `gapfillingSolutions[].gapfillingSolutionReactions[]` from API response -- Breadcrumb navigation: My Models > ModelName -- Data fetched from `listModelGapfillsFromApi` with workspace fallback - -### Genome Detail (`/genome/[...path]`) -- **Features tab**: DataGrid with Feature ID, Type, Function, Location, Aliases -- **Annotations tab**: DataGrid with Feature, Role, Subsystem -- Data fetched from workspace via `workspaceGet` -- Graceful error handling for workspace 500 errors - -## Files Modified -- `app/fba/[...path]/page.tsx` — complete rewrite (28 → 228 lines) -- `app/gapfill/[...path]/page.tsx` — complete rewrite (28 → 193 lines) -- `app/genome/[...path]/page.tsx` — complete rewrite (28 → 213 lines) - -## Verification -- `npx tsc --noEmit` — PASS (no errors) -- `npx next build` — PASS (all three routes recognized as dynamic) - -## Timestamp Log -- Created: 2026-03-17 09:23:45 -05:00 diff --git a/.gsd/phases/28/2-PLAN.md b/.gsd/phases/28/2-PLAN.md deleted file mode 100644 index 76a870b5..00000000 --- a/.gsd/phases/28/2-PLAN.md +++ /dev/null @@ -1,78 +0,0 @@ ---- -phase: 28 -plan: 2 -wave: 1 ---- - -# Plan 28.2: My Jobs Page and User Data Nav Update - -## Objective -Add a dedicated My Jobs page at `/my-jobs` matching the legacy URL exactly, with status counts (queued/running/completed), a full jobs table with auto-polling, and stderr/stdout links. Add "My Jobs" as a tab in the user-data layout navigation. - -## Context -- .gsd/SPEC.md -- external/ModelSEED-UI/app/views/my-jobs.html — legacy jobs page (status counts + table) -- external/ModelSEED-UI/app/services/jobs.js — legacy polling/status service -- lib/api/modelseed.ts — getJobsFromApi, manageJobFromApi already exist -- lib/api/jobTracker.ts — TrackedJob, listTrackedJobs, isTerminalJobStatus -- app/(user-data)/layout.tsx — user data tabs (currently: My Models, My Media) -- components/layout/DataControlHeader.tsx — standard toolbar - -## Tasks - - - Create My Jobs page - app/(user-data)/my-jobs/page.tsx - - Create a new My Jobs page at `app/(user-data)/my-jobs/page.tsx`: - 1. Wrap in AuthGuard (same pattern as my-models) - 2. Fetch ALL user jobs from `getJobsFromApi([])` (empty array = all jobs) - 3. Also merge in locally tracked jobs from `listTrackedJobs()` - 4. Display 3 status count cards at top (legacy pattern): - - Queued count (blue/gray icon) - - In Progress count (amber icon) - - Completed count (green icon) - 5. DataGrid table with columns: - - Task (job command/app name) - - Parameters (job arguments, show key:value pairs) - - Submitted (relative time from submitTimestamp/created_at) - - Started (relative time from startTimestamp) - - Status (color coded: red=failed, green=completed, default=other) - 6. For failed jobs, add an info icon linking to stderr: - `https://p3c.theseed.org/services/app_service/task_info/{jobId}/stderr` - 7. Auto-poll: use react-query refetchInterval (10s) like the legacy polling - 8. Sort by submitted time descending (newest first) - 9. Use DataControlHeader in the DataGrid - - IMPORTANT: The page route must be `/my-jobs` exactly matching legacy URL - - test -f "app/(user-data)/my-jobs/page.tsx" && grep -c "DataGrid" "app/(user-data)/my-jobs/page.tsx" - My Jobs page exists at /my-jobs with status counts, jobs table, and auto-polling - - - - Add My Jobs tab to user-data layout - app/(user-data)/layout.tsx - - Update the USER_DATA_TABS array to include My Jobs: - ```typescript - { - label: 'My Jobs', - href: '/my-jobs', - matchPaths: ['/my-jobs'], - }, - ``` - Add it after "My Media" to match the legacy toolbar order (My Models, My Media, My Jobs). - - grep "My Jobs" "app/(user-data)/layout.tsx" - User data navigation shows My Models | My Media | My Jobs tabs - - -## Success Criteria -- [ ] `/my-jobs` page renders with status counts and jobs table -- [ ] Jobs auto-refresh every 10 seconds -- [ ] Failed jobs have stderr link -- [ ] "My Jobs" tab appears in user-data navigation -- [ ] Build passes with no new TypeScript errors - -## Timestamp Log -- Created: 2026-03-17 09:23:45 -05:00 diff --git a/.gsd/phases/28/2-SUMMARY.md b/.gsd/phases/28/2-SUMMARY.md deleted file mode 100644 index d11ef26d..00000000 --- a/.gsd/phases/28/2-SUMMARY.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -phase: 28 -plan: 2 ---- - -# Summary 28.2: My Jobs Page and User Data Nav Update - -## What Was Done - -### My Jobs Page (`/my-jobs`) -- Created `app/(user-data)/my-jobs/page.tsx` with full job tracking functionality: - - **Status count cards**: Queued (gray), In Progress (amber), Completed (green) — exactly matching legacy layout - - **Jobs DataGrid table**: Task, Parameters, Submitted (relative time), Started (relative time), Status (color-coded chips) - - **Failed job stderr link**: Info icon opens `https://p3c.theseed.org/services/app_service/task_info/{id}/stderr` — matching legacy URL - - **Auto-polling**: 10-second refetch interval via react-query - - **Data merging**: Combines API jobs from `getJobsFromApi` with locally tracked jobs from `listTrackedJobs` - - **AuthGuard**: Protected route requiring sign-in - - **Sort**: Default newest-first - -### User Data Navigation Updated -- Added "My Jobs" tab to `app/(user-data)/layout.tsx` -- Tab order: My Models | My Media | My Jobs — matching legacy toolbar - -## Files Created -- `app/(user-data)/my-jobs/page.tsx` (236 lines) - -## Files Modified -- `app/(user-data)/layout.tsx` — added My Jobs tab entry - -## Verification -- `npx tsc --noEmit` — PASS -- `npx next build` — PASS (`/my-jobs` route recognized) -- `grep "My Jobs" app/(user-data)/layout.tsx` — PASS - -## Timestamp Log -- Created: 2026-03-17 09:23:45 -05:00 diff --git a/.gsd/phases/29/1-PLAN.md b/.gsd/phases/29/1-PLAN.md deleted file mode 100644 index fb4584db..00000000 --- a/.gsd/phases/29/1-PLAN.md +++ /dev/null @@ -1,77 +0,0 @@ ---- -phase: 29 -plan: 1 -wave: 1 ---- - -# Plan 29.1: Feature Detail Page, Header Bug Fix, and Cleanup - -## Objective -Close the remaining functional gaps and bugs identified during the Phase 28 audit to make the UI ready for user testing. Specifically: -1. Replace the placeholder Feature detail page with a functional implementation showing gene function, subsystems, aliases, and protein sequence. -2. Fix the AppHeader `isUserDataActive` detection so the "User Data" tab highlights correctly when on `/my-jobs`. -3. Clean up stale READMEs in `/fba` and `/gapfill` that still say "under construction." - -## Context -- `.gsd/SPEC.md` -- `app/feature/[...path]/page.tsx` — current placeholder -- `external/ModelSEED-UI/app/views/data/feature.html` — legacy reference -- `components/layout/AppHeader.tsx` — header navigation with `isUserDataActive` bug -- `app/fba/README.md` — stale README -- `app/gapfill/README.md` — stale README -- `lib/api/workspace.ts` — workspace API utilities - -## Tasks - - - Implement Feature Detail Page - app/feature/[...path]/page.tsx - - Replace the "under construction" stub with a functional Feature detail page: - - Parse URL path to extract genome ref and feature ID (legacy URL: `/feature/{genome}/{feature}`) - - Fetch feature data from workspace using `workspaceGet` with the genome ref - - Display sections matching legacy layout: - - **Function**: Show the feature's functional assignment - - **Subsystems**: List associated subsystems (or "No subsystems present") - - **Aliases**: Table of alias labels/values with external links where available - - **Protein Sequence**: Monospace pre-formatted protein sequence - - Include breadcrumb navigation back to the genome detail page - - Include loading/error states with `CircularProgress` and `Alert` - - Use consistent styling (MUI Typography, Box, Paper) matching other detail pages - - Do NOT implement editing functionality (view-only for now) - - Check that the file compiles by running `npx tsc --noEmit` and that it no longer contains "under construction" - Feature detail page renders function, subsystems, aliases, and protein sequence from workspace data. No "under construction" text remains. - - - - Fix AppHeader isUserDataActive to include /my-jobs - components/layout/AppHeader.tsx - - On line 37, add `|| pathname.startsWith('/my-jobs')` to the `isUserDataActive` condition so the "User Data" tab highlights correctly when the user is on the My Jobs page. - - Before: `const isUserDataActive = pathname.startsWith('/my-models') || pathname.startsWith('/myMedia') || pathname.startsWith('/data');` - After: `const isUserDataActive = pathname.startsWith('/my-models') || pathname.startsWith('/myMedia') || pathname.startsWith('/my-jobs') || pathname.startsWith('/data');` - - Grep for `isUserDataActive` in AppHeader.tsx and confirm `/my-jobs` is included - The "User Data" header tab highlights when visiting /my-jobs. - - - - Clean up stale READMEs - app/fba/README.md, app/gapfill/README.md - - Delete both stale README files that still reference "Catch-all Stub" and "Under Construction". The pages are now fully implemented and the READMEs are misleading. - - Confirm files no longer exist: `test ! -f app/fba/README.md && test ! -f app/gapfill/README.md && echo "CLEAN"` - No misleading README files remain in implemented page directories. - - -## Success Criteria -- [ ] Feature page at `/feature/{genome}/{feature}` renders real data (function, subsystems, aliases, protein) -- [ ] "User Data" header tab highlights on `/my-jobs` -- [ ] No stale "under construction" READMEs in `/fba` or `/gapfill` -- [ ] `npm run build` passes clean - -## Timestamp Log -- Created: 2026-03-17 09:37:17 CDT diff --git a/.gsd/phases/29/1-SUMMARY.md b/.gsd/phases/29/1-SUMMARY.md deleted file mode 100644 index 922b9e1c..00000000 --- a/.gsd/phases/29/1-SUMMARY.md +++ /dev/null @@ -1,45 +0,0 @@ ---- -phase: 29 -plan: 1 -status: complete ---- - -# Summary 29.1: Feature Page, Header Fix, and Cleanup - -## Objective -Finalize the UI for user testing by resolving the last identified functional gaps from the Phase 28 audit. - -## Work Executed - -### 1. Functional Feature Detail Page -- Replaced the `/feature/[...path]` placeholder with a production-ready data view. -- Implementation details: - - Extracts genome reference and feature ID from the URL path. - - Fetches the full genome object via `workspaceGet`. - - Recursively locates the specific feature by ID. - - Displays **Function**, **Subsystems** (list), **Aliases** (table with SEED links), and **Protein Sequence** (scrollable pre-block). - - Added breadcrumb navigation: `Genomes > [Genome Name] > [Feature ID]`. - -### 2. Header Highlighting Bug Fix -- Modified `components/layout/AppHeader.tsx`. -- Updated `isUserDataActive` logic to include `pathname.startsWith('/my-jobs')`. -- This ensures the "User Data" tab is correctly highlighted when viewing the My Jobs page. - -### 3. Documentation Cleanup -- Deleted stale `app/fba/README.md` and `app/gapfill/README.md` files. -- These files previously described the pages as placeholders/stubs, which became incorrect after the Phase 28 implementations. - -## Files Modified -- `app/feature/[...path]/page.tsx` (Rewritten) -- `components/layout/AppHeader.tsx` (Modified) -- `app/fba/README.md` (Deleted) -- `app/gapfill/README.md` (Deleted) -- `.gsd/ROADMAP.md` (Updated) - -## Verification Results -- **TypeScript**: `npx tsc --noEmit` passed clean. -- **Content**: Verified no "under construction" strings remain in relevant directories. -- **Navigation**: Confirmed URL pattern parity with legacy UI for feature links. - -## Timestamp Log -- Completed: 2026-03-17 09:41:00 CDT diff --git a/.gsd/phases/29/VERIFICATION.md b/.gsd/phases/29/VERIFICATION.md deleted file mode 100644 index fa55411a..00000000 --- a/.gsd/phases/29/VERIFICATION.md +++ /dev/null @@ -1,26 +0,0 @@ -# Phase 29 Verification: User Testing Readiness - -## Must-Haves Verification - -### 1. Functional Feature Detail Page -- [x] **Requirement**: Implement the functional Feature detail page at `/feature/[...path]`. -- [x] **Evidence**: `app/feature/[...path]/page.tsx` exists and implements logic to fetch genome objects and extract specific features by ID. It renders Function, Subsystems, Aliases, and Protein Sequences. -- [x] **Code Review**: Verified `workspaceGet` and `parseWorkspaceGetObject` integration. Breadcrumbs and SEED external links are correctly handled. - -### 2. AppHeader Highlighting Fix -- [x] **Requirement**: Fix "User Data" tab highlighting to include `/my-jobs`. -- [x] **Evidence**: `components/layout/AppHeader.tsx` line 37 updated to `pathname.startsWith('/my-jobs')`. -- [x] **Manual Verification**: Inspected logic ensures the tab remains active when on the jobs page. - -### 3. Documentation Cleanup -- [x] **Requirement**: Remove stale README files in `/fba` and `/gapfill`. -- [x] **Evidence**: `ls app/fba/README.md` and `ls app/gapfill/README.md` both return "No such file or directory". - -## Verdict: PASS - -## Technical Markers -- **Routing**: URL parity achieved for `/feature/[...path]`. -- **API**: Verified consistent use of `workspace.ts` for reference data detail extraction. - -## Timestamp Log -- Created: 2026-03-17 09:55:00 -05:00 diff --git a/.gsd/phases/31/PLAN.md b/.gsd/phases/31/PLAN.md deleted file mode 100644 index 57404997..00000000 --- a/.gsd/phases/31/PLAN.md +++ /dev/null @@ -1,167 +0,0 @@ -# Phase 31: UI Transition Completion - Execution Plan - -## Overview -Complete all UI-side logic to achieve feature parity with legacy AngularJS UI, enabling user testing readiness. - -## Execution Waves - -### Wave 1: Foundation Components (Parallel) -These have no dependencies and can be built simultaneously. - -#### 1.1 AddCompoundsDialog -**File**: `components/ui/AddCompoundsDialog.tsx` -**Dependencies**: Existing SOLR biochem API -**Tasks**: -- Create dialog with compound search input -- Integrate with `getCompounds()` from biochem API -- DataGrid for results with checkbox selection -- "Add Selected" button returns selected compounds - -#### 1.2 AddReactionsDialog -**File**: `components/ui/AddReactionsDialog.tsx` -**Dependencies**: Existing SOLR biochem API -**Tasks**: -- Create dialog with reaction search input -- Integrate with `getReactions()` from biochem API -- DataGrid for results with checkbox selection -- "Add Selected" button returns selected reactions - -#### 1.3 SelectMediaDialog -**File**: `components/ui/SelectMediaDialog.tsx` -**Dependencies**: Existing media API -**Tasks**: -- Create dialog with media autocomplete -- Fetch public + user media via existing APIs -- Return selected media object - -#### 1.4 SaveAsDialog -**File**: `components/ui/SaveAsDialog.tsx` -**Tasks**: -- Create dialog with name input -- Validate name (alphanumeric) -- Save callback with API unavailable fallback - -#### 1.5 ShowMetadataDialog -**File**: `components/ui/ShowMetadataDialog.tsx` -**Tasks**: -- Display metadata in key-value table -- Show permissions if available -- Close button - -#### 1.6 Bulk Download Utility -**File**: `lib/utils/exportCsv.ts` -**Tasks**: -- Create CSV export utility function -- Handle array of objects to CSV conversion -- Trigger browser download - -### Wave 2: Pages & Features (After Wave 1) - -#### 2.1 Data Browser Page -**File**: `app/data/[...path]/page.tsx` (replace existing) -**Dependencies**: `workspaceLs` API, ShowMetadataDialog -**Tasks**: -- Fetch directory listing via `workspaceLs` -- Display files/folders in DataGrid -- Breadcrumb navigation from path -- Click folder → navigate -- Click file → show metadata or download -- Handle API errors gracefully - -#### 2.2 Model Comparison Page -**File**: `app/compare/page.tsx` (new) -**Dependencies**: Model APIs -**Tasks**: -- Create new route -- Accept model refs via URL params or state -- Fetch model data for each -- Side-by-side reaction comparison table -- Basic pathway tab -- Update My Models page to add "Compare" button - -#### 2.3 Biochem Table CSV Export -**Files**: -- `app/(reference-data)/biochem/compounds/page.tsx` -- `app/(reference-data)/biochem/reactions/page.tsx` -**Tasks**: -- Add "Export CSV" button to DataControlHeader -- Use exportCsv utility -- Export current filtered/searched results - -### Wave 3: Editors (After Wave 1 dialogs) - -#### 3.1 Media Editor Component -**File**: `components/ui/MediaEditor.tsx` -**Dependencies**: AddCompoundsDialog -**Tasks**: -- Create embedded editor component -- DataGrid of media compounds -- Add compounds via AddCompoundsDialog -- Remove selected with confirmation -- Inline edit concentration/flux bounds -- Save button (with fallback) - -#### 3.2 Media Detail Route -**File**: `app/media/[...path]/page.tsx` (new) -**Tasks**: -- Display media metadata -- Embed MediaEditor component -- Handle save/cancel actions - -#### 3.3 Model Editor Enhancement -**File**: `app/model/[...path]/page.tsx` (enhance Edit tab) -**Dependencies**: AddReactionsDialog -**Tasks**: -- Enhance existing Edit Model tab -- Add Reactions button → opens AddReactionsDialog -- Remove Selected button -- Inline edit direction dropdown -- Inline edit genes -- Save button (with 501 fallback) - -### Wave 4: Integration & Polish - -#### 4.1 My Models Compare Integration -**File**: `app/(user-data)/my-models/page.tsx` -**Tasks**: -- Add checkbox column for multi-select -- Add "Compare Selected" button -- Navigate to /compare with selected models - -#### 4.2 API Fallback Messages -**All new components** -**Tasks**: -- Consistent error messaging -- Loading spinners -- "Feature temporarily unavailable" banners where needed - -## File Manifest - -### New Files -1. `components/ui/AddCompoundsDialog.tsx` -2. `components/ui/AddReactionsDialog.tsx` -3. `components/ui/SelectMediaDialog.tsx` -4. `components/ui/SaveAsDialog.tsx` -5. `components/ui/ShowMetadataDialog.tsx` -6. `components/ui/MediaEditor.tsx` -7. `lib/utils/exportCsv.ts` -8. `app/compare/page.tsx` -9. `app/media/[...path]/page.tsx` - -### Modified Files -1. `app/data/[...path]/page.tsx` - Replace placeholder -2. `app/model/[...path]/page.tsx` - Enhance Edit tab -3. `app/(user-data)/my-models/page.tsx` - Add compare integration -4. `app/(reference-data)/biochem/compounds/page.tsx` - Add CSV export -5. `app/(reference-data)/biochem/reactions/page.tsx` - Add CSV export - -## Verification Checklist -- [ ] All new routes accessible without 404 -- [ ] Data browser shows workspace contents -- [ ] Model comparison displays selected models -- [ ] Media editor allows compound manipulation -- [ ] Model edit tab has reaction add/remove -- [ ] CSV export downloads file -- [ ] API errors show user-friendly messages -- [ ] No console errors in normal operation -- [ ] Build passes without TypeScript errors diff --git a/.gsd/phases/31/REQUIREMENTS.md b/.gsd/phases/31/REQUIREMENTS.md deleted file mode 100644 index 243029ac..00000000 --- a/.gsd/phases/31/REQUIREMENTS.md +++ /dev/null @@ -1,109 +0,0 @@ -# Phase 31: UI Transition Completion for User Testing - -## Objective -Complete all UI-side logic and features to achieve parity with the legacy AngularJS UI, ensuring the application is ready for user testing once backend API issues are resolved. - -## Background -The ModelSEED UI migration from AngularJS to Next.js has completed most major features, but several critical workflows and pages are missing or incomplete. This phase addresses all remaining gaps to ensure UI logic is sound and ready to work completely. - -## Requirements - -### R1: Data Browser Page (`/data/[...path]`) -**Priority**: HIGH -**Description**: Replace placeholder with functional workspace file browser -**Acceptance Criteria**: -- Display files/folders from workspace path -- Breadcrumb navigation working -- File metadata visible (size, type, date) -- Download links functional (with graceful fallback when API unavailable) -- Click folder to navigate into it - -### R2: Model Comparison Page (`/compare`) -**Priority**: HIGH -**Description**: Implement side-by-side model comparison view -**Acceptance Criteria**: -- Accessible from My Models page (multi-select + Compare button) -- Display 2-3 models in comparison table -- Show reactions present/absent in each model -- Flux values displayed when FBA data available -- Basic heatmap visualization (can use placeholder) -- Pathway comparison tab - -### R3: Media Editor -**Priority**: HIGH -**Description**: Enable compound-level editing of media formulations -**Acceptance Criteria**: -- Accessible from My Media page or media detail route -- DataGrid showing media compounds -- Add Compounds button → SOLR picker dialog -- Remove Selected button with confirmation -- Inline editable: concentration, minFlux, maxFlux -- Save button (with API unavailable fallback) - -### R4: Model Editor Enhancement -**Priority**: HIGH -**Description**: Enable reaction-level editing in model detail -**Acceptance Criteria**: -- Enhance existing Edit Model tab -- Add Reactions button → SOLR picker dialog -- Remove Selected Reactions with confirmation -- Inline editable: reaction direction (<=>, =>, <=) -- Inline editable: gene associations -- Edit history displayed -- Save button (with API unavailable fallback) - -### R5: Missing Dialogs -**Priority**: MEDIUM -**Acceptance Criteria**: -- SaveAsDialog: Name input, save model copy -- SelectMediaDialog: Autocomplete media picker for FBA/Gapfill -- AddCompoundsDialog: SOLR compound search with multi-select -- AddReactionsDialog: SOLR reaction search with multi-select -- ShowMetadataDialog: Display object metadata and permissions - -### R6: Bulk Download -**Priority**: LOW -**Description**: Export search results from biochem tables -**Acceptance Criteria**: -- Export to CSV button on compounds table -- Export to CSV button on reactions table -- Respect current search/filter state - -### R7: Error Handling & API Fallbacks -**Priority**: MEDIUM -**Description**: Graceful degradation when APIs unavailable -**Acceptance Criteria**: -- All new components show clear "API unavailable" messages -- No console errors from failed API calls -- Loading states for all async operations -- User can see what features are temporarily unavailable - -## Technical Notes - -### Known API Limitations -- Workspace API write operations (`create`, `delete`, `copy`, `metadata`, `permissions`, `download-url`) require backend fix -- `editModelFromApi` may return 501 on some deployments -- RAST genome listing has multiple fallback strategies - -### UI Patterns to Follow -- Use MUI DataGrid for all tables (consistent with existing pages) -- Use MUI Dialog for modals -- Use DataControlHeader for table toolbars -- Use existing SOLR integration from biochem pages - -### Dependencies -- `@tanstack/react-query` for data fetching -- `@mui/x-data-grid` for tables -- Existing `lib/api/` clients - -## Out of Scope -- Expression data upload (requires Shock integration) -- WebSocket real-time features (disabled in legacy) -- Guided tour/onboarding -- Backend API fixes (separate team responsibility) - -## Success Metrics -- All legacy pages have Next.js equivalents -- Zero broken routes or 404s -- UI loads and displays correctly with mock/empty data when API unavailable -- No console errors in normal operation diff --git a/.gsd/phases/32/1-PLAN.md b/.gsd/phases/32/1-PLAN.md deleted file mode 100644 index 1f48f7ff..00000000 --- a/.gsd/phases/32/1-PLAN.md +++ /dev/null @@ -1,232 +0,0 @@ ---- -phase: 32 -plan: 1 -wave: 1 -autonomous: true -depends_on: [] -files_modified: - - lib/api/workspace.ts - - lib/api/modelseed.ts - - app/(user-data)/my-jobs/page.tsx -user_setup: - - Ensure SSH tunnel to Poplar is active: ssh -L 8000:localhost:8443 user@poplar-host ---- - -# Plan 32.1: Poplar Backend Integration Fixes - - -Integrate the updated Poplar backend fixes into the frontend to ensure proper error handling, data parsing resilience, and job status reliability. - -Purpose: The Poplar backend has been updated with fixes that need to be integrated - proper HTTP status codes, error messages, and job status safety net. This plan addresses those integrations and tests workspace operations. - -Output: Updated API error handling, defensive data parsing, job status safety net, tested workspace write operations - - - -Load for context: -- lib/api/workspace.ts (lines 1-235 - full file for error handling patterns) -- lib/api/modelseed.ts (lines 1-250 - model listing, job fetching, error handling) -- app/(user-data)/my-jobs/page.tsx (lines 1-294 - job status polling) -- lib/api/jobTracker.ts (for understanding local job tracking) -- AGENTS.md Known Issues section - -Backend updates from José P. Faria: -- Workspace errors now return proper status codes (404 for not found, 403 for permission denied, 502 for upstream errors) with actual error messages from p3.theseed.org -- Model listing no longer crashes on non-numeric metadata values (backend fixed, add defensive coding) -- Job status updates have safety net so jobs won't get stuck at "queued" even if imports fail - -Environment: SSH tunnel to Poplar is set up at localhost:8000 (ssh -L 8000:localhost:8443 user@poplar-host) - - - - - - Update workspace error handling for proper HTTP status codes - lib/api/workspace.ts - - Enhance error handling in callWorkspaceApi (lines 105-146) and callWorkspaceRestApi (lines 151-177) functions: - - 1. In callWorkspaceApi: After getting response, check response.ok and response.status - 2. Extract error message from payload - look for 'message', 'detail', or nested 'error.message' fields - 3. Construct error message format: "Workspace {method} failed ({status}): {backend_message}" - 4. Handle specific status codes with user-friendly messages: - - 400: "Bad request - check input parameters" - - 401: "Authentication required" - - 403: "Permission denied - you don't have access to this resource" - - 404: "Object not found - the requested resource does not exist" - - 500: "Internal server error - please try again later" - - 502: "Upstream service unavailable - backend is temporarily unavailable" - - 503: "Service unavailable - please try again later" - 5. Preserve existing JSON-RPC error handling for data.error field - 6. Log full error details to console for debugging while showing简洁 message to user - - Example implementation pattern: - ```typescript - if (!response.ok) { - const message = extractWorkspaceErrorMessage(payload); - const statusMsgs: Record = { - 404: 'Object not found', - 403: 'Permission denied', - 502: 'Upstream service unavailable', - 500: 'Internal server error', - }; - const statusMsg = statusMsgs[response.status] || 'Request failed'; - throw new Error( - `Workspace ${method} failed (${response.status}): ${statusMsg}${message ? ` - ${message}` : ''}`, - ); - } - ``` - - AVOID: Breaking existing error handling patterns - just enhance with better status-aware messages - WHY: Users need to see meaningful error messages from p3.theseed.org instead of generic failures - - npm run lint && npm run typecheck - Workspace API errors show meaningful messages like "Workspace get failed (404): Object not found - the requested resource does not exist" or "Workspace ls failed (403): Permission denied - you don't have access" instead of generic errors - - - - Add defensive handling for non-numeric metadata in model listing - lib/api/modelseed.ts - - Enhance ModelseedModelSummary interface and listUserModelsFromApi function: - - 1. Review current interface at lines 19-31 for all numeric fields - 2. In listUserModelsFromApi (lines 130-132), wrap response processing: - ```typescript - const safeParseNumber = (val: unknown): number | undefined => { - if (val === null || val === undefined) return undefined; - if (typeof val === 'number' && Number.isFinite(val)) return val; - if (typeof val === 'string') { - const parsed = Number(val); - if (Number.isFinite(parsed)) return parsed; - } - return undefined; // Gracefully handle "N/A", "", invalid - }; - ``` - 3. Apply safeParseNumber to: num_genes, num_reactions, num_compounds, fba_count, unintegrated_gapfills, integrated_gapfills - 4. Add try-catch around entire model list processing to prevent single bad item from crashing entire list - 5. Log warnings for unparseable values for debugging - - AVOID: Changing API response structure - just handle edge cases gracefully - WHY: Backend fixed the root cause, but defensive coding protects against edge cases and future API changes - - npm run lint && npm run typecheck - Model listing renders without crashing even if backend returns non-numeric metadata values like "N/A", empty strings, or malformed objects - - - - Add safety net for job status polling - app/(user-data)/my-jobs/page.tsx, lib/api/modelseed.ts - - Enhance job status handling with safety net: - - 1. In my-jobs/page.tsx - Add stuck job detection: - - Create useRef to track job status history: Map - - In mergeApiAndTrackedJobs (lines 73-119), track consecutive same-status polls - - If same status for >3 polls (~30 seconds), flag as "possibly stuck" - - 2. Update statusColor function (line 57) to handle stuck status: - - Add 'queued_stuck' or similar indicator - - Return 'warning' color (yellow/orange) instead of 'info' (blue) - - 3. Add warning indicator in status Chip (line 174-185): - - Show "(possibly stuck)" tooltip or badge for stuck jobs - - Add refresh icon button for manual re-check - - 4. Enhance tracked jobs fallback (lines 103-116): - - If API fails or returns empty, tracked jobs show "status: unknown" - - Add "Click to retry" action that re-fetches job status - - 5. In getJobsFromApi (modelseed.ts 224-237): - - Add console.warn on API failures (already returns empty) - - Ensure error doesn't break the page - - AVOID: Over-complicating the polling logic - simple detection is sufficient - WHY: Jobs shouldn't get permanently stuck at "queued" - this adds a safety net for visibility - - npm run lint && npm run typecheck - Jobs don't get permanently stuck at "queued" - safety net detects stale status and shows warning indicator with manual refresh option - - - - Test workspace write operations with Poplar backend - lib/api/workspace.ts, lib/api/config.ts - - Test W001 operations now that Poplar is updated: - - 1. Review current ensureProxyMode guards (lines 201-235) in workspace.ts - 2. Check config.ts for USE_NEW_PROXY setting and understand what it controls - 3. Test operations via curl (example): - ```bash - # Test workspace/ls (should work) - curl -X POST localhost:8000/api/workspace/ls \ - -H "Content-Type: application/json" \ - -H "Authorization: Basic $(echo -n 'user:pass' | base64)" \ - -d '{"paths": ["/username/"]}' - - # Test workspace/create (may be new) - curl -X POST localhost:8000/api/workspace/create \ - -H "Content-Type: application/json" \ - -d '{"type": "workspace", "name": "test"}' - ``` - - 4. If operations succeed (200 OK response): - - Remove ensureProxyMode guards OR make them warnings instead of errors - - Enable write operations in UI (check where "API unavailable" is shown) - - Update AGENTS.md to mark W001 as resolved - - 5. If operations fail (4xx/5xx errors): - - Document error messages - are they proper status codes now? - - Keep existing guards in place - - Note in AGENTS.md that W001 still blocked but has improved error messages - - AVOID: Breaking existing "API unavailable" graceful handling - don't remove guards unless verified working - WHY: Workspace write operations may now work on Poplar and should be enabled if tested successfully - - Manual curl testing or UI workflow testing - Workspace write operations either verified working (guards relaxed) or documented with new status code errors - - - - Update AGENTS.md with Phase 32 findings - AGENTS.md - - Update the Known Issues document based on Phase 32 results: - - 1. Update W001: Workspace Write Operations - mark as resolved or document current status - 2. Update WS001: Workspace /get Returns 500 - note if 404/403 handling helps - 3. Add notes about new error message improvements - 4. Document any new issues discovered - - Format: - ```markdown - ### [ISSUE-ID]: Brief Title - **Status:** Resolved / In Progress / Blocked - **Resolution:** What was done or what still needs fixing - ``` - - AGENTS.md updated with accurate status - AGENTS.md reflects current state of all addressed issues - - - - - -After all tasks, verify: -- [ ] npm run lint passes -- [ ] npm run typecheck passes -- [ ] Workspace errors show meaningful status-based messages with user-friendly text -- [ ] Model listing handles edge case metadata (N/A, empty string, invalid) without crashing -- [ ] Job status UI shows warning for potentially stuck jobs with refresh option -- [ ] Workspace write operations tested and documented -- [ ] AGENTS.md updated with findings - - - -- [ ] All 5 tasks verified complete -- [ ] Workspace API errors display proper HTTP status codes (404/403/502/500) with user-friendly messages -- [ ] Model listing handles non-numeric metadata gracefully (defensive coding) -- [ ] Job status has safety net preventing permanently stuck "queued" status -- [ ] Workspace write operations tested with updated Poplar backend -- [ ] AGENTS.md updated with Phase 32 findings - diff --git a/.gsd/phases/32/2-PLAN.md b/.gsd/phases/32/2-PLAN.md deleted file mode 100644 index 3a696495..00000000 --- a/.gsd/phases/32/2-PLAN.md +++ /dev/null @@ -1,123 +0,0 @@ ---- -phase: 32 -plan: 2 -wave: 2 -autonomous: true -depends_on: [32.1] -files_modified: - - components/ui/AddCompoundsDialog.tsx - - components/ui/AddReactionsDialog.tsx - - app/model/[...path]/page.tsx - - AGENTS.md -user_setup: [] ---- - -# Plan 32.2: MUI DataGrid v7 Compatibility Fixes - - -Fix MUI DataGrid v7 compatibility issues with GridRowSelectionModel type changes and other v7-specific issues. - -Purpose: MUI v7 changed GridRowSelectionModel from array to object format. This plan ensures all DataGrid components handle the new format correctly. - -Output: All DataGrid row selection code handles v7 object format with Set, no console errors - - - -Load for context: -- components/ui/AddCompoundsDialog.tsx (uses DataGrid with rowSelection) -- components/ui/AddReactionsDialog.tsx (uses DataGrid with rowSelection) -- app/model/[...path]/page.tsx (may have DataGrid usage) -- AGENTS.md UI002: Grid Row Selection Model Type Changes - -Issue: MUI v7+ changed `GridRowSelectionModel` from `string[]` to `{ type: 'include', ids: Set }` - - - - - - Audit all DataGrid row selection usage - components/ui/AddCompoundsDialog.tsx, components/ui/AddReactionsDialog.tsx - - Search and update all GridRowSelectionModel usage: - - 1. Search for: onRowSelectionModelChange, rowSelectionModel, GridRowSelectionModel - 2. Identify all places using .length, .map, filter, or array methods - 3. Add type-safe handling: - ```typescript - // Old (v6): selectionModel.length - // New (v7): - const getSelectedIds = (model: GridRowSelectionModel): string[] => { - if (Array.isArray(model)) return model; - if (model && typeof model === 'object' && 'ids' in model) { - return Array.from((model as { ids: Set }).ids); - } - return []; - }; - ``` - 4. Update AddCompoundsDialog.tsx: - - Find state: const [selectionModel, setSelectionModel] = useState([]) - - Update handler to extract IDs safely - - Ensure Add button enables when selectionModel has items - - 5. Update AddReactionsDialog.tsx with same pattern - - AVOID: Breaking existing selection behavior - test add functionality still works - WHY: v7 changed type from array to object, existing .length calls will fail - - npm run lint && npm run typecheck - All DataGrid components use type-safe selection model handling that works with v7 object format - - - - Verify and fix any other DataGrid v7 issues - app/model/[...path]/page.tsx - - Check for other DataGrid v7 changes that may affect the app: - - 1. Search for all DataGrid imports and usages - 2. Check for deprecated props or changed APIs in v7: - - columnSpacing -> columnSpacing?. Use 8px default - - rowSpacing -> rowSpacing?. Use 0.5px default - - paginationMode -> paginationMode still exists - - Get column definitions that may need updating - 3. Review app/model/[...path]/page.tsx for DataGrid usage - 4. Fix any type errors or deprecated warnings - - AVOID: Changing DataGrid functionality - only fix type/interface issues - WHY: v7 may have breaking changes in prop names or types - - npm run lint && npm run typecheck - No DataGrid-related warnings or errors in build - - - - Update AGENTS.md with UI002 resolution - AGENTS.md - - Mark UI002 as resolved in Known Issues: - - ```markdown - ### UI002: Grid Row Selection Model Type Changes - **Status:** Resolved - **Resolution:** Added type-safe GridRowSelectionModel handling with getSelectedIds() utility. All dialogs updated for v7 object format compatibility. - ``` - - AGENTS.md updated - UI002 marked as resolved in AGENTS.md - - - - - -- [ ] npm run lint passes -- [ ] npm run typecheck passes -- [ ] AddCompoundsDialog row selection works -- [ ] AddReactionsDialog row selection works -- [ ] No console errors from DataGrid - - - -- [ ] All DataGrid components handle v7 selection model format -- [ ] Row selection in dialogs works correctly -- [ ] AGENTS.md updated - diff --git a/.gsd/phases/32/3-PLAN.md b/.gsd/phases/32/3-PLAN.md deleted file mode 100644 index 7b75615c..00000000 --- a/.gsd/phases/32/3-PLAN.md +++ /dev/null @@ -1,184 +0,0 @@ ---- -phase: 32 -plan: 3 -wave: 2 -autonomous: false -depends_on: [32.1] -files_modified: - - app/(user-data)/my-models/page.tsx - - app/model/[...path]/page.tsx - - components/ui/ - - AGENTS.md -user_setup: [] ---- - -# Plan 32.3: Feature Integration - Dialogs & Bulk Download - - -Integrate existing dialog components into workflow pages and expand bulk export formats. - -Purpose: MF003 (FBA/Media Selection Dialogs) and MF004 (Bulk Download formats) are ready for integration. MF001 (Model Merge) may be partially implementable. - -Output: Integrated dialogs, expanded export options, documented merge workflow requirements - - - -Load for context: -- components/ui/SelectMediaDialog.tsx (exists but not integrated) -- components/ui/SaveAsDialog.tsx (exists but not integrated) -- app/model/[...path]/page.tsx (FBA configuration area) -- app/(user-data)/my-models/page.tsx (model listing) -- app/biochem/compounds/page.tsx (bulk export) -- app/biochem/reactions/page.tsx (bulk export) -- AGENTS.md MF003, MF004, MF001 - -Note: MF001 (Model Merge) requires backend /api/jobs/merge - check if functional first - - - - - - Integrate SelectMediaDialog into FBA configuration - app/model/[...path]/page.tsx, components/ui/SelectMediaDialog.tsx - - Add media selection to model FBA UI: - - 1. Review SelectMediaDialog.tsx to understand its interface (open, onSelect, onClose) - 2. Find FBA configuration area in model detail page (search for "media" or "Media") - 3. Add "Select Media" button next to media input field: - ```typescript - const [mediaDialogOpen, setMediaDialogOpen] = useState(false); - - // Button: - - - { - setFieldValue('media', mediaRef); - setMediaDialogOpen(false); - }} - onClose={() => setMediaDialogOpen(false)} - /> - ``` - 4. If media selection UI doesn't exist, add it with the dialog - - AVOID: Breaking existing FBA form - integrate alongside existing controls - WHY: Users need to browse and select media from their workspace - - npm run lint && npm run typecheck - SelectMediaDialog opens from FBA configuration and returns selected media - - - - Integrate SaveAsDialog into Save workflow - app/model/[...path]/page.tsx, components/ui/SaveAsDialog.tsx - - Add "Save As" functionality: - - 1. Review SaveAsDialog.tsx interface - 2. Find model editing/saving area (search for "save", "export", "download") - 3. Add "Save As" button in toolbar: - ```typescript - const [saveAsOpen, setSaveAsOpen] = useState(false); - - - - { - router.push(`/model/${newRef}`); - setSaveAsOpen(false); - }} - onClose={() => setSaveAsOpen(false)} - /> - ``` - 4. If SaveAsDialog doesn't have required props, enhance it - - AVOID: Breaking existing export functionality - add as additional option - WHY: Users need to save models with new names - - npm run lint && npm run typecheck - SaveAsDialog integrates with model detail page - - - - Expand bulk download to include JSON and TSV formats - app/biochem/compounds/page.tsx, app/biochem/reactions/page.tsx, lib/utils/exportCsv.ts - - Add JSON and TSV export options: - - 1. Review current CSV export in lib/utils/exportCsv.ts - 2. Create export utility for multiple formats: - ```typescript - export function exportData(data: unknown[], format: 'csv' | 'json' | 'tsv', filename: string) { - let content: string; - let mimeType: string; - let ext: string; - - switch (format) { - case 'json': - content = JSON.stringify(data, null, 2); - mimeType = 'application/json'; - ext = 'json'; - break; - case 'tsv': - // Convert array of objects to TSV - if (data.length === 0) { content = ''; break; } - const headers = Object.keys(data[0]); - const rows = data.map(row => headers.map(h => String(row[h] ?? '')).join('\t')); - content = [headers.join('\t'), ...rows].join('\n'); - mimeType = 'text/tab-separated-values'; - ext = 'tsv'; - break; - default: // csv - content = convertToCSV(data); - mimeType = 'text/csv'; - ext = 'csv'; - } - - const blob = new Blob([content], { type: mimeType }); - downloadBlob(blob, `${filename}.${ext}`); - } - ``` - 3. Update biochemistry pages to add format selector dropdown - 4. Add "Export" button with menu: [CSV, JSON, TSV] - - AVOID: Removing existing CSV option - add alongside - WHY: MF004 - Legacy feature had JSON and TSV, need parity - - npm run lint && npm run typecheck - Biochem pages offer CSV, JSON, and TSV export options - - - - Assess Model Merge workflow feasibility - Should we implement Model Merge UI now or defer? - - - Keep MF001 as blocked - need to verify /api/jobs/merge is functional - - Add UI placeholder that explains merge workflow when backend ready - - - - - - -- [ ] npm run lint passes -- [ ] npm run typecheck passes -- [ ] SelectMediaDialog opens from FBA -- [ ] SaveAsDialog integrates with model page -- [ ] CSV, JSON, TSV export works on biochem pages - - - -- [ ] MF003: FBA/Media Selection dialogs integrated -- [ ] MF004: Bulk download has JSON and TSV options -- [ ] MF001: Decision made and documented - diff --git a/.gsd/phases/32/4-PLAN.md b/.gsd/phases/32/4-PLAN.md deleted file mode 100644 index d4fbf4bd..00000000 --- a/.gsd/phases/32/4-PLAN.md +++ /dev/null @@ -1,197 +0,0 @@ ---- -phase: 32 -plan: 4 -wave: 3 -autonomous: true -depends_on: [] -files_modified: - - lib/utils/formatEquation.ts - - app/model/[...path]/page.tsx - - components/ui/ - - AGENTS.md -user_setup: [] ---- - -# Plan 32.4: UI Polish - Formatting, State & Empty States - - -Address UI quality improvements: chemical equation formatting, tab state persistence, and informative empty states. - -Purpose: UI001, UI003, and UI004 from Known Issues are frontend polish items that improve UX. - -Output: Better formatted equations, persistent tab state, helpful empty states - - - -Load for context: -- lib/utils/formatEquation.ts (chemical equation formatting) -- app/model/[...path]/page.tsx (tabs: Overview, Reactions, Compounds, etc.) -- app/(user-data)/my-models/page.tsx (empty state) -- app/(user-data)/my-media/page.tsx (empty state) -- app/biochem/search/page.tsx (empty state) -- AGENTS.md UI001, UI003, UI004 - - - - - - Fix chemical equation subscript formatting - lib/utils/formatEquation.ts - - Improve regex patterns for chemical formulas: - - 1. Review current formatEquation function - 2. Enhance subscript handling: - - CHOCO2 -> CHO₂ (detect trailing numbers as subscripts) - - C6H12O6 -> C₆H₁₂O₆ - - Handle edge cases: numbers in compound names should NOT be subscripted - - Add spacing: "2.0 A + B" -> "2.0 A + B" (coeff, space, compound) - - 3. Updated regex pattern approach: - ```typescript - // Match element + optional count: C, H2, O12 - const elementPattern = /([A-Z][a-z]?)(\d*)/g; - - // Replace with subscript unicode - formula.replace(elementPattern, (match, element, count) => { - if (!count) return element; - const subscripts = count.split('').map(d => - String.fromCharCode(0x2080 + parseInt(d)) - ).join(''); - return element + subscripts; - }); - ``` - - 4. Test against known edge cases from legacy UI - - AVOID: Over-engineering - basic subscript is main need - WHY: UI001 - Chemical formulas should render correctly like legacy UI - - npm run lint && npm run typecheck - Chemical equations render with proper subscripts (H2O -> H₂O, C6H12O6 -> C₆H₁₂O₆) - - - - Add URL-based tab state persistence - app/model/[...path]/page.tsx - - Enable deep-linking to tabs: - - 1. Review current tab state management in model detail page - 2. Add useSearchParams to read/write tab state: - ```typescript - import { useSearchParams, useRouter, usePathname } from 'next/navigation'; - - // In component: - const searchParams = useSearchParams(); - const router = useRouter(); - const pathname = usePathname(); - - const currentTab = searchParams.get('tab') || 'overview'; - - const handleTabChange = (tab: string) => { - const params = new URLSearchParams(searchParams); - params.set('tab', tab); - router.replace(`${pathname}?${params.toString()}`, { scroll: false }); - }; - ``` - 3. Update all tab-related code to use URL params - 4. Handle invalid tab values gracefully (fallback to 'overview') - - AVOID: Breaking existing tab navigation - test all tabs still work - WHY: UI003 - Users want to share links to specific tabs - - npm run lint && npm run typecheck && manual URL test - URL changes when switching tabs, refreshing page keeps selected tab, direct URL to tab works - - - - Improve empty states with helpful messaging - app/(user-data)/my-models/page.tsx, app/(user-data)/my-media/page.tsx, app/biochem/search/page.tsx - - Replace generic "No data" with helpful empty states: - - 1. My Models empty state: - ```typescript - } - title="No models yet" - description="Create your first model to get started. Models are metabolic reconstructions from genomes or biochemical data." - action={{ - label: "Create Model", - onClick: () => router.push('/build'), - }} - /> - ``` - - 2. My Media empty state: - ```typescript - } - title="No media defined" - description="Media define the growth conditions for FBA. Import from biochemistry database or create custom media." - action={{ - label: "Browse Media", - onClick: () => router.push('/biochem/media'), - }} - /> - ``` - - 3. Search empty state: - ```typescript - } - title="No results found" - description={`No compounds or reactions match "${query}". Try different search terms.`} - /> - ``` - - 4. Create reusable EmptyState component if not exists - - AVOID: Removing existing data - just enhance empty state UI - WHY: UI004 - Users need context about why data is empty and what to do - - npm run lint && npm run typecheck - Empty states show helpful context and action buttons - - - - Update AGENTS.md with UI improvements - AGENTS.md - - Mark resolved UI issues: - - ```markdown - ### UI001: Chemical Equation Subscript Formatting - **Status:** Resolved - **Resolution:** Enhanced formatEquation.ts with proper subscript unicode conversion - - ### UI003: Tab Selection State Lost on Navigation - **Status:** Resolved - **Resolution:** Added URL-based tab state for deep-linking support - - ### UI004: Empty States Could Be More Informative - **Status:** Resolved - **Resolution:** Added EmptyState component with contextual messaging and CTAs - ``` - - AGENTS.md updated - UI001, UI003, UI004 marked as resolved - - - - - -- [ ] npm run lint passes -- [ ] npm run typecheck passes -- [ ] Chemical equations show proper subscripts -- [ ] Tab state persists via URL -- [ ] Empty states show helpful messages - - - -- [ ] UI001: Chemical equation formatting fixed -- [ ] UI003: Tab state persists on refresh/navigation -- [ ] UI004: Empty states are informative with actions -- [ ] AGENTS.md updated - diff --git a/.gsd/phases/32/5-PLAN.md b/.gsd/phases/32/5-PLAN.md deleted file mode 100644 index 86d159b5..00000000 --- a/.gsd/phases/32/5-PLAN.md +++ /dev/null @@ -1,146 +0,0 @@ ---- -phase: 32 -plan: 5 -wave: 3 -autonomous: true -depends_on: [32.1] -files_modified: - - app/model/[...path]/page.tsx - - lib/api/modelseed.ts - - AGENTS.md -user_setup: [] ---- - -# Plan 32.5: Model History & Remaining Features - - -Implement model edit history UI and assess remaining feature items. - -Purpose: MF002 (Model History) and assess MF005/MF006 for feasibility. - -Output: Timeline view for model edits, assessment of plant workflow and file preview - - - -Load for context: -- app/model/[...path]/page.tsx (Edit tab currently shows counts) -- lib/api/modelseed.ts listModelEditsFromApi (line 479-483) -- app/plant/page.tsx (plant workflow) -- app/data/[...path]/page.tsx (file browser) -- AGENTS.md MF002, MF005, MF006 - - - - - - Implement model edit history timeline - app/model/[...path]/page.tsx, lib/api/modelseed.ts - - Build timeline view for model edits: - - 1. Test listModelEditsFromApi endpoint: - ```typescript - const edits = await listModelEditsFromApi(ref); - // Check what data returns - fields like: timestamp, user, changes, description? - ``` - - 2. Design timeline UI in Edit tab: - - Show chronological list of edits - - Each entry: timestamp, user, change summary - - Expandable to show details - - "Revert to this version" button (if backend supports) - - 3. Implement with MUI Timeline: - ```typescript - import Timeline from '@mui/lab/Timeline'; - import TimelineItem from '@mui/lab/TimelineItem'; - import TimelineSeparator from '@mui/lab/TimelineSeparator'; - import TimelineConnector from '@mui/lab/TimelineConnector'; - import TimelineContent from '@mui/lab/TimelineContent'; - - {edits.map((edit, idx) => ( - - - - {idx < edits.length - 1 && } - - - {edit.timestamp} - {edit.description} - - - ))} - ``` - - 4. Handle empty history: "No edits recorded yet" - 5. Handle API errors gracefully (some models may not support edit history) - - AVOID: Breaking existing Edit tab - add alongside current view - WHY: MF002 - Users need to see edit history for audit and rollback - - npm run lint && npm run typecheck - Edit tab shows timeline of model changes with timestamps and descriptions - - - - Assess Plant Workflow (MF005) - Is the Build Model Plant workflow functional? - - - Test /plant workflow end-to-end, document any API failures - - Keep MF005 as blocked, requires backend work - - - - - Assess File Preview (MF006) - Should we implement file preview in workspace browser? - - - Add preview for JSON/text files only - lower priority - - Keep as low priority, focus on core features - - - - - Update AGENTS.md with feature status - AGENTS.md - - Update AGENTS.md with findings: - - ```markdown - ### MF002: Model History/Edits UI Limited - **Status:** Resolved - **Resolution:** Added Timeline view in Edit tab using listModelEditsFromApi - - ### MF005: Build Model Plant Workflow - **Status:** [Resolved / Blocked] - **Resolution:** [Document test results or backend requirements] - - ### MF006: Workspace Browser File Preview - **Status:** Deferred - **Resolution:** Low priority - can be added later if requested - ``` - - AGENTS.md updated - AGENTS.md reflects current state of MF002, MF005, MF006 - - - - - -- [ ] npm run lint passes -- [ ] npm run typecheck passes -- [ ] Model edit history timeline renders -- [ ] Plant workflow assessed -- [ ] File preview decision made - - - -- [ ] MF002: Model edit history timeline implemented -- [ ] MF005: Plant workflow tested and documented -- [ ] MF006: Decision made (implement or defer) -- [ ] AGENTS.md updated - diff --git a/.gsd/phases/32/README.md b/.gsd/phases/32/README.md deleted file mode 100644 index 73324765..00000000 --- a/.gsd/phases/32/README.md +++ /dev/null @@ -1,67 +0,0 @@ -# Phase 32: Poplar Backend Integration & UI Polish - -## Overview -This phase integrates the updated Poplar backend fixes and addresses remaining Known Issues from AGENTS.md. - -## Backend Updates from José P. Faria -- Workspace errors now return proper HTTP status codes (404/403/502) with actual error messages from p3.theseed.org -- Model listing no longer crashes on non-numeric metadata (backend fixed) -- Job status updates have safety net to prevent stuck "queued" status - -## Plans Summary - -### Wave 1: Core Backend Integration (32.1) -**Status:** Requires SSH tunnel to Poplar - -| Task | Description | Files | -|------|-------------|-------| -| 1.1 | Update workspace error handling for proper HTTP status codes | lib/api/workspace.ts | -| 1.2 | Add defensive handling for non-numeric metadata | lib/api/modelseed.ts | -| 1.3 | Add safety net for job status polling | my-jobs/page.tsx | -| 1.4 | Test workspace write operations | lib/api/workspace.ts | -| 1.5 | Update AGENTS.md | AGENTS.md | - -### Wave 2: UI Compatibility & Features (32.2, 32.3) -**Depends on:** 32.1 - -| Plan | Focus | Files | -|------|-------|-------| -| 32.2 | MUI DataGrid v7 compatibility | AddCompoundsDialog, AddReactionsDialog | -| 32.3 | Dialog integration & bulk export | SelectMediaDialog, SaveAsDialog, biochem pages | - -### Wave 3: UI Polish & Features (32.4, 32.5) -**Depends on:** None - -| Plan | Focus | Files | -|------|-------|-------| -| 32.4 | Chemical equations, tab state, empty states | formatEquation.ts, model page | -| 32.5 | Model history timeline, assessments | Edit tab, plant workflow | - -## Execution Order - -1. **Start with 32.1** - Requires Poplar SSH tunnel active -2. **Then 32.2** - Can run in parallel with 32.1 -3. **Then 32.3** - Depends on 32.1 (API basics) -4. **Then 32.4** - Independent UI polish -5. **Then 32.5** - Final features and documentation - -## Success Criteria - -All plans complete when: -- [ ] Workspace API errors show proper status codes (404/403/502) with meaningful messages -- [ ] Model listing handles edge case metadata without crashing -- [ ] Job status has safety net for stuck jobs -- [ ] Workspace write operations tested -- [ ] DataGrid v7 compatibility verified -- [ ] Dialogs integrated (Media, Save As) -- [ ] Bulk export has JSON/TSV options -- [ ] Chemical equations render correctly -- [ ] Tab state persists via URL -- [ ] Empty states are helpful -- [ ] Model edit history timeline implemented -- [ ] AGENTS.md fully updated - -## Environment Notes - -- SSH tunnel to Poplar: `ssh -L 8000:localhost:8443 user@poplar-host` -- Config: NEXT_PUBLIC_USE_MODELSEED_API=true, NEXT_PUBLIC_USE_NEW_PROXY=true diff --git a/.gsd/phases/33/1-PLAN.md b/.gsd/phases/33/1-PLAN.md deleted file mode 100644 index 3f865feb..00000000 --- a/.gsd/phases/33/1-PLAN.md +++ /dev/null @@ -1,76 +0,0 @@ ---- -phase: 33 -plan: 1 -wave: 1 -depends_on: [] -files_modified: - - app/(build-model)/plant/page.tsx -autonomous: true -user_setup: [] - -must_haves: - truths: - - "PlantSEED v3.0 banner has a linebreak after 'PlantSEED v2.0' text" - - "The banner is also available as a pop-up for the 'UPLOAD Plants FASTA' section" - artifacts: - - "Banner tooltip contains linebreak after PlantSEED v2.0" - - "Pop-up dialog appears when clicking on the disabled 'UPLOAD Plants FASTA' tab" ---- - -# Plan 33.1: PlantSEED Banner Linebreak and Pop-up - - -Add a linebreak in the PlantSEED v3.0 banner after "PlantSEED v2.0" text, and add the banner as a pop-up for the "UPLOAD Plants FASTA" section in Build Model page. - -Purpose: Improve visual formatting of the maintenance banner and make it more accessible via pop-up -Output: Modified banner with linebreak and pop-up dialog - - - -Load for context: -- app/(build-model)/plant/page.tsx (lines 230-280) - - - - - - Add linebreak to PlantSEED banner tooltip - app/(build-model)/plant/page.tsx - - In the Tooltip component at line 236-238, modify the title to include a linebreak after "PlantSEED v2.0". The current text is: - "PlantSEED v3.0 Update In Progress: Annotation and reconstruction services are temporarily offline for updates and will be restored shortly." - - Change to: - "PlantSEED v2.0\nUpdate In Progress: Annotation and reconstruction services are temporarily offline for updates and will be restored shortly." - - Note: Use \n for linebreak in MUI Tooltip title. - - View the page source and confirm the tooltip title contains \n after "PlantSEED v2.0" - Tooltip title has linebreak after "PlantSEED v2.0" - - - - Add pop-up dialog for UPLOAD Plants FASTA section - app/(build-model)/plant/page.tsx - - Add a Dialog component that shows the maintenance message when the user clicks on the disabled "UPLOAD Plants FASTA" tab (when PLANTSEED_MAINTENANCE is true). The dialog should display: - - Title: "PlantSEED v2.0" - - Body: "Update In Progress: Annotation and reconstruction services are temporarily offline for updates and will be restored shortly." - - Use MUI Dialog component. The dialog should open when the disabled tab is clicked. - - Click on disabled "UPLOAD Plants FASTA" tab - dialog should appear with the maintenance message - Pop-up dialog appears with PlantSEED v2.0 maintenance message - - - - - -- [ ] Banner tooltip has linebreak after "PlantSEED v2.0" -- [ ] Pop-up dialog appears when clicking disabled "UPLOAD Plants FASTA" tab - - - -- [ ] All tasks verified -- [ ] Must-haves confirmed - \ No newline at end of file diff --git a/.gsd/phases/33/2-PLAN.md b/.gsd/phases/33/2-PLAN.md deleted file mode 100644 index 602d3ddf..00000000 --- a/.gsd/phases/33/2-PLAN.md +++ /dev/null @@ -1,78 +0,0 @@ ---- -phase: 33 -plan: 2 -wave: 1 -depends_on: [] -files_modified: - - CHANGELOG.md - - app/about/version/page.tsx -autonomous: true -user_setup: [] - -must_haves: - truths: - - "New CHANGELOG.md exists in project root with entries for this codebase" - - "Version page loads from the new CHANGELOG.md instead of legacy external file" - artifacts: - - "CHANGELOG.md created in project root with proper format" - - "app/about/version/page.tsx updated to load from root CHANGELOG.md" ---- - -# Plan 33.2: Add ChangeLog for Version Page - - -Create a new CHANGELOG.md in the project root for the new ModelSEED-UI codebase (replacing the legacy external/ModelSEED-UI/CHANGELOG.md), and update the Version page to load from this new file. - -Purpose: Provide a proper changelog for the new UI code -Output: New CHANGELOG.md in root, updated Version page - - - -Load for context: -- app/about/version/page.tsx (current implementation loads from external path) -- gsd-opencode/CHANGELOG.md (reference for format) - - - - - - Create CHANGELOG.md in project root - CHANGELOG.md - - Create a new CHANGELOG.md in the project root with entries for the new UI code. Include: - - Header with version format based on Keep a Changelog - - Initial entries for this new codebase - - Placeholder sections for Added, Changed, Fixed, Removed - - Reference the format from gsd-opencode/CHANGELOG.md but tailor for ModelSEED-UI. - - CHANGELOG.md exists in project root with proper format - CHANGELOG.md created in root directory - - - - Update Version page to load from new CHANGELOG - app/about/version/page.tsx - - In getChangelog function (line 12-19), change the filePath from: - path.join(process.cwd(), 'external/ModelSEED-UI/CHANGELOG.md') - to: - path.join(process.cwd(), 'CHANGELOG.md') - - This points to the new changelog in the project root. - - grep "CHANGELOG.md" app/about/version/page.tsx shows path.join(process.cwd(), 'CHANGELOG.md') - Version page loads from root CHANGELOG.md - - - - - -- [ ] CHANGELOG.md exists in project root -- [ ] Version page loads from root CHANGELOG.md - - - -- [ ] All tasks verified -- [ ] Must-haves confirmed - -Fix the alignment issue where the "Download Options" link is not lined up with the descriptive text on the model landing page. - -Purpose: Improve visual consistency in the model detail header -Output: Properly aligned Download Options button - - - -Load for context: -- components/ui/DownloadModelMenu.tsx (current implementation) -- app/model/[...path]/page.tsx (usage context around line 1175-1180) - - - - - - Fix Download Options alignment - components/ui/DownloadModelMenu.tsx - - Review the current layout in DownloadModelMenu and the parent container in the model detail page. The issue is that the button and helper text (if present) are not aligned properly. - - Options to fix: - 1. If helperText is provided, ensure it aligns with the button using the same left margin - 2. Ensure the button uses proper vertical alignment (alignItems: 'center' or 'baseline') - 3. Check the parent container for proper display/flex properties - - Apply the fix that best matches the surrounding UI pattern. - - Visual inspection - Download Options button aligns with any helper text or descriptive text - Download Options link properly aligned with descriptive text - - - - - -- [ ] Download Options button aligns with surrounding text - - - -- [ ] All tasks verified -- [ ] Must-haves confirmed - -Add a pop-up dialog that allows users to select a media when clicking the "Run FBA" button on the model landing page. The media list should be fetched from the API. - -Purpose: Allow users to choose which media to use for FBA simulation -Output: MediaSelectionDialog component integrated with Run FBA button - - - -Load for context: -- components/ui/ModelDetailHeader.tsx (current Run FBA button implementation) -- lib/api/modelseed.ts (listMediaFromApi function for fetching media) - - - - - - Create MediaSelectionDialog component - components/ui/MediaSelectionDialog.tsx - - Create a new component that: - - Uses MUI Dialog component - - Fetches available media from listMediaFromApi('/api/media/public') - - Displays a Select/Dropdown with media options - - Includes a "Run" button that calls onConfirm with the selected media - - Includes a "Cancel" button to close without action - - Props should include: - - open: boolean - - onClose: () => void - - onConfirm: (mediaId: string) => void - - title?: string (default: "Select Media for FBA") - - Component renders with media dropdown and Run/Cancel buttons - MediaSelectionDialog component created - - - - Integrate MediaSelectionDialog with Run FBA button - components/ui/ModelDetailHeader.tsx - - Modify the ModelDetailHeader component: - 1. Import MediaSelectionDialog - 2. Add state for dialog open/close (const [mediaDialogOpen, setMediaDialogOpen] = useState(false)) - 3. Change onRunFba to open the media dialog instead of directly calling the callback - 4. When user confirms media selection, call the original onRunFba callback with the media info - - The callback signature should change to accept an optional media parameter, or we can pass it to a wrapper function. - - Clicking "Run FBA" opens the media selection dialog - Run FBA button triggers media selection pop-up - - - - - -- [ ] MediaSelectionDialog created -- [ ] Run FBA opens media selection dialog -- [ ] Media list fetched from API -- [ ] Selected media passed to callback - - - -- [ ] All tasks verified -- [ ] Must-haves confirmed - -Add the same media selection pop-up for the "Run GapFilling" button that was added for Run FBA. - -Purpose: Allow users to choose which media to use for Gapfilling simulation -Output: Gapfilling button triggers media selection dialog - - - -Load for context: -- components/ui/ModelDetailHeader.tsx (already has MediaSelectionDialog integrated) -- Note: This was already implemented in Plan 33.4 - both FBA and Gapfill use the same dialog - - - - - - Verify Gapfilling uses media dialog - components/ui/ModelDetailHeader.tsx - - Verify that the Gapfilling button (Run GapFilling) uses the same MediaSelectionDialog as FBA. The handleOpenMediaDialog function should accept 'fba' or 'gapfill' type, and handleMediaConfirm should call onRunGapfill with the selected media when type is 'gapfill'. - - This was already implemented in Plan 33.4. Verify it works correctly. - - Clicking "Run GapFilling" opens media selection dialog with title "Select Media for Gapfilling" - Gapfilling button triggers media selection pop-up - - - - - -- [ ] Run GapFilling opens media selection dialog -- [ ] Dialog title shows "Select Media for Gapfilling" -- [ ] Selected media passed to onRunGapfill callback - - - -- [ ] All tasks verified -- [ ] Must-haves confirmed - \ No newline at end of file diff --git a/.gsd/phases/33/6-PLAN.md b/.gsd/phases/33/6-PLAN.md deleted file mode 100644 index f577a40d..00000000 --- a/.gsd/phases/33/6-PLAN.md +++ /dev/null @@ -1,69 +0,0 @@ ---- -phase: 33 -plan: 6 -wave: 1 -depends_on: [] -files_modified: - - app/model/[...path]/page.tsx -autonomous: true -user_setup: [] - -must_haves: - truths: - - "The details pane for Reactions tab is properly formatted" - artifacts: - - "Reaction details drawer has proper layout, spacing, and typography" ---- - -# Plan 33.6: Fix Reactions Details Pane Formatting - - -Fix the poorly formatted details pane that opens when clicking "View" on a reaction in the model landing page Reactions tab. - -Purpose: Improve the visual presentation of reaction details -Output: Properly formatted reaction details drawer - - - -Load for context: -- app/model/[...path]/page.tsx (detail drawer implementation around lines 1000-1100) -- Search for "openDetailDrawer" and detail drawer rendering - - - - - - Review and fix reaction details drawer formatting - app/model/[...path]/page.tsx - - Find the detail drawer implementation that opens when clicking "View" on a reaction. The drawer should display: - - Reaction ID and name - - Equation (chemical equation) - - Direction (forward/reversible) - - Gene associations - - Any other relevant metadata - - Fix any formatting issues: - - Ensure proper spacing between sections - - Fix typography (use consistent font sizes, weights) - - Ensure proper alignment of labels and values - - Add proper padding and margins - - Look for Drawer, Dialog, or similar component that displays reaction details. - - Open a reaction detail - all fields should be properly spaced and readable - Reaction details pane has proper formatting - - - - - -- [ ] Reaction details drawer opens properly -- [ ] All fields display with proper spacing and typography -- [ ] No overflow or layout issues - - - -- [ ] All tasks verified -- [ ] Must-haves confirmed - \ No newline at end of file diff --git a/.gsd/phases/33/7-PLAN.md b/.gsd/phases/33/7-PLAN.md deleted file mode 100644 index 992f0ee1..00000000 --- a/.gsd/phases/33/7-PLAN.md +++ /dev/null @@ -1,68 +0,0 @@ ---- -phase: 33 -plan: 7 -wave: 1 -depends_on: [] -files_modified: - - app/model/[...path]/page.tsx -autonomous: true -user_setup: [] - -must_haves: - truths: - - "Biomass tab displays data correctly when available in the model" - artifacts: - - "Biomass rows properly extracted from model data" ---- - -# Plan 33.7: Fix Empty Biomass Display - - -Fix the empty biomass display on the model landing page. The biomass tab shows no data even when biomass exists in the model. - -Purpose: Ensure biomass data is properly displayed in the Biomass tab -Output: Working biomass display with proper data extraction - - - -Load for context: -- app/model/[...path]/page.tsx (buildBiomassRows function around lines 187-216) -- Look at how model data is structured for biomass - - - - - - Debug and fix biomass data extraction - app/model/[...path]/page.tsx - - Review the buildBiomassRows function (lines 187-216) and understand how it extracts biomass data from the model. - - Common issues to check: - 1. The model data may use different key names (biomasses vs biomass vs biomasscompounds) - 2. The data structure may be different than expected - 3. The compounds array may be empty or structured differently - - Debug steps: - - Add console.log to see what keys exist in model.biomasses vs model.biomass - - Check if compounds are nested under a different key - - Verify the data types and structure - - Fix the buildBiomassRows function to properly extract biomass data regardless of the key naming convention used by the API. - - Open a model with biomass data - Biomass tab should display rows - Biomass tab shows data when model has biomass - - - - - -- [ ] Biomass tab displays data for models with biomass -- [ ] No console errors related to biomass extraction -- [ ] Data properly formatted in the table - - - -- [ ] All tasks verified -- [ ] Must-haves confirmed - \ No newline at end of file diff --git a/.gsd/templates/DEBUG.md b/.gsd/templates/DEBUG.md deleted file mode 100644 index 07aa017a..00000000 --- a/.gsd/templates/DEBUG.md +++ /dev/null @@ -1,127 +0,0 @@ ---- -updated_at: 2026-03-02T17:05:45-06:00 ---- - -# Debug Template - -Template for `.gsd/debug/[slug].md` — active debug session tracking. - ---- - -## File Template - -```markdown ---- -status: gathering | investigating | fixing | verifying | resolved -trigger: "[verbatim user input]" -created: [ISO timestamp] -updated: [ISO timestamp] ---- - -## Current Focus - - -hypothesis: [current theory being tested] -test: [how testing it] -expecting: [what result means if true/false] -next_action: [immediate next step] - -## Symptoms - - -expected: [what should happen] -actual: [what actually happens] -errors: [error messages if any] -reproduction: [how to trigger] -started: [when it broke / always broken] - -## Eliminated - - -- hypothesis: [theory that was wrong] - evidence: [what disproved it] - timestamp: [when eliminated] - -## Evidence - - -- timestamp: [when found] - checked: [what was examined] - found: [what was observed] - implication: [what this means] - -## Resolution - - -root_cause: [empty until found] -fix: [empty until applied] -verification: [empty until verified] -files_changed: [] -``` - ---- - -## Section Rules - -**Frontmatter (status, trigger, timestamps):** -- `status`: OVERWRITE - reflects current phase -- `trigger`: IMMUTABLE - verbatim user input, never changes -- `created`: IMMUTABLE - set once -- `updated`: OVERWRITE - update on every change - -**Current Focus:** -- OVERWRITE entirely on each update -- Always reflects what AI is doing RIGHT NOW -- If AI reads this after session reset, it knows exactly where to resume -- Fields: hypothesis, test, expecting, next_action - -**Symptoms:** -- Written during initial gathering phase -- IMMUTABLE after gathering complete -- Reference point for what we're trying to fix - -**Eliminated:** -- APPEND only - never remove entries -- Prevents re-investigating dead ends after context reset -- Critical for efficiency across session boundaries - -**Evidence:** -- APPEND only - never remove entries -- Facts discovered during investigation -- Builds the case for root cause - -**Resolution:** -- OVERWRITE as understanding evolves -- Final state shows confirmed root cause and verified fix - ---- - -## Lifecycle - -**Creation:** When /debug is called -- Create file with trigger from user input -- Set status to "gathering" -- next_action = "gather symptoms" - -**During investigation:** -- OVERWRITE Current Focus with each hypothesis -- APPEND to Evidence with each finding -- APPEND to Eliminated when hypothesis disproved - -**On resolution:** -- status → "resolved" -- Move file to .gsd/debug/resolved/ - ---- - -## Resume Behavior - -When AI reads this file after session reset: - -1. Parse frontmatter → know status -2. Read Current Focus → know exactly what was happening -3. Read Eliminated → know what NOT to retry -4. Read Evidence → know what's been learned -5. Continue from next_action - -The file IS the debugging brain. diff --git a/.gsd/templates/PLAN.md b/.gsd/templates/PLAN.md deleted file mode 100644 index 466bf630..00000000 --- a/.gsd/templates/PLAN.md +++ /dev/null @@ -1,94 +0,0 @@ ---- -updated_at: 2026-03-02T17:05:45-07:59 ---- - -# PLAN.md Template - -> Copy this template when creating execution plans. - -```markdown ---- -phase: {N} -plan: {M} -wave: {W} -gap_closure: false ---- - -# Plan {N}.{M}: {Descriptive Name} - -## Objective -{One paragraph explaining what this plan delivers and why it matters} - -## Context -Load these files for context: -- .gsd/SPEC.md -- .gsd/ARCHITECTURE.md -- {relevant source files} - -## Tasks - - - {Clear, specific task name} - - {exact/file/path1.ext} - {exact/file/path2.ext} - - - {Specific implementation instructions} - - Steps: - 1. {Step 1} - 2. {Step 2} - 3. {Step 3} - - AVOID: {common mistake} because {reason} - USE: {preferred approach} because {reason} - - - {Executable command or check} - Example: npm test -- --testNamePattern="auth" - Example: curl -X POST localhost:3000/api/login - - - {Measurable acceptance criteria} - Example: Valid credentials → 200 + Set-Cookie, invalid → 401 - - - - - {Task 2 name} - {files} - {instructions} - {command} - {criteria} - - -## Must-Haves -After all tasks complete, verify: -- [ ] {Must-have 1 — derived from phase goal} -- [ ] {Must-have 2} - -## Success Criteria -- [ ] All tasks verified passing -- [ ] Must-haves confirmed -- [ ] No regressions in tests -``` - -## Task Types - -| Type | Use For | Behavior | -|------|---------|----------| -| `auto` | Everything Claude can do independently | Fully autonomous | -| `checkpoint:human-verify` | Visual/functional verification | Pauses for user | -| `checkpoint:decision` | Implementation choices | Pauses for user | - -## Wave Assignment - -| Wave | Use For | -|------|---------| -| 1 | Foundation (types, schemas, utilities) | -| 2 | Core implementations | -| 3 | Integration and validation | - -Plans in the same wave can run in parallel. -Later waves depend on earlier waves. diff --git a/.gsd/templates/RESEARCH.md b/.gsd/templates/RESEARCH.md deleted file mode 100644 index 47c09d50..00000000 --- a/.gsd/templates/RESEARCH.md +++ /dev/null @@ -1,79 +0,0 @@ ---- -updated_at: 2026-03-02T17:05:45-06:00 ---- - -# RESEARCH.md Template - -> Copy this template when documenting phase research. - -```markdown ---- -phase: {N} -researched_at: {YYYY-MM-DD} -discovery_level: 1 | 2 | 3 ---- - -# Phase {N} Research - -## Objective -{What question is this research answering?} - -## Discovery Level -**Level {1|2|3}** — {Quick verification | Standard research | Deep dive} - -## Key Decisions - -### Decision 1: {Topic} -**Question:** {What needed to be decided?} -**Options Considered:** -1. {Option A}: {pros/cons} -2. {Option B}: {pros/cons} -3. {Option C}: {pros/cons} - -**Decision:** {Which option and why} -**Confidence:** {High | Medium | Low} - -### Decision 2: {Topic} -... - -## Findings - -### {Topic 1} -{What was learned} - -**Sources:** -- {URL or reference} -- {URL or reference} - -### {Topic 2} -{What was learned} - -## Patterns to Follow -- {Pattern 1}: {How to apply it} -- {Pattern 2}: {How to apply it} - -## Anti-Patterns to Avoid -- {Anti-pattern 1}: {Why to avoid} -- {Anti-pattern 2}: {Why to avoid} - -## Dependencies Identified -| Package | Version | Purpose | -|---------|---------|---------| -| {pkg} | {ver} | {why needed} | - -## Risks -- **{Risk 1}:** {Impact and mitigation} -- **{Risk 2}:** {Impact and mitigation} - -## Recommendations for Planning -1. {Recommendation 1} -2. {Recommendation 2} -``` - -## Discovery Levels - -| Level | Time | Use When | -|-------|------|----------| -| 1 | 2-5 min | Single known library, confirming syntax | -| 2 | 15-30 min | Choosing between options, new integration | -| 3 | 1+ hour | Architectural decision, novel problem | diff --git a/.gsd/templates/SUMMARY.md b/.gsd/templates/SUMMARY.md deleted file mode 100644 index 05f32520..00000000 --- a/.gsd/templates/SUMMARY.md +++ /dev/null @@ -1,107 +0,0 @@ ---- -updated_at: 2026-03-02T17:05:45-06:00 ---- - -# Summary Template - -Template for `.gsd/phases/{N}/{plan}-SUMMARY.md` — execution summary after plan completion. - ---- - -## File Template - -```markdown ---- -phase: {N} -plan: {M} -completed_at: [ISO timestamp] -duration_minutes: {N} -status: complete | partial | failed ---- - -# Summary: {Plan Name} - -## Results - -- **Tasks:** {N}/{M} completed -- **Commits:** {N} -- **Verification:** {passed | failed} - ---- - -## Tasks Completed - -| Task | Description | Commit | Status | -|------|-------------|--------|--------| -| 1 | {task name} | {hash} | ✅ Complete | -| 2 | {task name} | {hash} | ✅ Complete | -| 3 | {task name} | — | ❌ Blocked | - ---- - -## Files Changed - -| File | Change Type | Description | -|------|-------------|-------------| -| {path} | Created | {what it does} | -| {path} | Modified | {what changed} | -| {path} | Deleted | {why removed} | - ---- - -## Deviations Applied - -{If none: "None — executed as planned."} - -### Rule 1 — Bug Fixes -- {description of bug fixed} - -### Rule 2 — Missing Critical -- {description of functionality added} - -### Rule 3 — Blocking Issues -- {description of blocker fixed} - ---- - -## Verification - -| Check | Status | Evidence | -|-------|--------|----------| -| {verification 1} | ✅ Pass | {command/output} | -| {verification 2} | ✅ Pass | {command/output} | - ---- - -## Notes - -{Any observations, concerns, or recommendations for future phases} - ---- - -## Metadata - -- **Started:** {timestamp} -- **Completed:** {timestamp} -- **Duration:** {N} minutes -- **Context Usage:** ~{N}% -``` - ---- - -## Guidelines - -**Create SUMMARY.md:** -- After each plan completes -- Before moving to next plan -- Even if plan failed (document what happened) - -**Include:** -- All commits with hashes -- All deviations (never hide these) -- Verification results with evidence - -**Keep it factual:** -- No opinions -- Just what happened -- Evidence over claims diff --git a/.gsd/templates/UAT.md b/.gsd/templates/UAT.md deleted file mode 100644 index 1468ea5b..00000000 --- a/.gsd/templates/UAT.md +++ /dev/null @@ -1,172 +0,0 @@ ---- -updated_at: 2026-03-02T17:05:45-07:59 ---- - -# UAT Template - -Template for `.gsd/phases/{N}/UAT.md` — User Acceptance Testing checklist. - -**Purpose:** Structured manual testing protocol for human verification checkpoints. - ---- - -## File Template - -```markdown ---- -phase: {N} -type: uat -created: [ISO timestamp] -status: pending | in_progress | passed | failed ---- - -# Phase {N} UAT - -## Overview - -**Phase:** {name} -**Goal:** {what this phase delivers} -**Tester:** User -**Date:** {date} - ---- - -## Test Environment - -**Setup Required:** -- [ ] Dev server running (`npm run dev`) -- [ ] Database seeded with test data -- [ ] Browser dev tools open for error monitoring - -**Test Data:** -- User: test@example.com / password123 -- Other relevant test accounts/data - ---- - -## Test Cases - -### TC-01: {Test Case Name} - -**Scenario:** {What user is trying to do} - -**Steps:** -1. {Step 1} -2. {Step 2} -3. {Step 3} - -**Expected Result:** -- {What should happen} - -**Actual Result:** -- [ ] PASS -- [ ] FAIL — Issue: ___ - ---- - -### TC-02: {Test Case Name} - -**Scenario:** {What user is trying to do} - -**Steps:** -1. {Step 1} -2. {Step 2} - -**Expected Result:** -- {What should happen} - -**Actual Result:** -- [ ] PASS -- [ ] FAIL — Issue: ___ - ---- - -## Edge Cases - -### EC-01: {Edge Case Name} - -**Test:** {What to try} -**Expected:** {Graceful handling} -**Result:** [ ] PASS [ ] FAIL - ---- - -## Error Scenarios - -### ERR-01: {Error Scenario} - -**Trigger:** {How to cause error} -**Expected Behavior:** {Error message, recovery} -**Result:** [ ] PASS [ ] FAIL - ---- - -## Visual Verification - -### VIS-01: Layout - -- [ ] Responsive on mobile (375px) -- [ ] Responsive on tablet (768px) -- [ ] Desktop layout correct (1024px+) -- [ ] No horizontal scroll -- [ ] All text readable - -### VIS-02: Styling - -- [ ] Colors match design system -- [ ] Fonts correct -- [ ] Spacing consistent -- [ ] Icons display correctly - ---- - -## Summary - -| Category | Pass | Fail | Total | -|----------|------|------|-------| -| Functional | | | | -| Edge Cases | | | | -| Errors | | | | -| Visual | | | | - -**Overall Status:** [ ] APPROVED [ ] NEEDS FIXES - -**Issues Found:** -1. {Issue description} -2. {Issue description} - -**Notes:** -{Any additional observations} -``` - ---- - -## Usage Guidelines - -**When to create UAT:** -- After phase execution complete -- Before marking phase as verified -- For any `checkpoint:human-verify` tasks - -**Who runs UAT:** -- User (always) -- AI cannot verify visual/UX elements - -**After UAT:** -- If PASSED: Phase can be marked complete -- If FAILED: Create gap closure plans with `/plan-milestone-gaps` - ---- - -## Test Case Guidelines - -**Good test cases:** -- Specific, reproducible steps -- Clear expected results -- One scenario per test case - -**Categories to cover:** -1. Happy path (main functionality) -2. Edge cases (boundary conditions) -3. Error handling (invalid input, failures) -4. Visual/UX (layout, responsiveness) diff --git a/.gsd/templates/VERIFICATION.md b/.gsd/templates/VERIFICATION.md deleted file mode 100644 index 144ea59d..00000000 --- a/.gsd/templates/VERIFICATION.md +++ /dev/null @@ -1,74 +0,0 @@ ---- -updated_at: 2026-03-02T17:05:45-06:00 ---- - -# VERIFICATION.md Template - -> Copy this template when creating phase verification reports. - -```markdown ---- -phase: {N} -verified_at: {YYYY-MM-DD HH:MM} -verdict: PASS | FAIL | PARTIAL -pass_count: {X} -total_count: {Y} ---- - -# Phase {N} Verification Report - -## Summary - -**{X}/{Y}** must-haves verified -**Verdict:** {PASS | FAIL | PARTIAL} - -## Must-Haves - -### ✅ 1. {Must-have description} -**Status:** PASS -**Method:** {How this was verified} -**Evidence:** -``` -{Actual command output or screenshot reference} -``` - -### ❌ 2. {Must-have description} -**Status:** FAIL -**Method:** {How this was verified} -**Expected:** {What should happen} -**Actual:** {What actually happened} -**Evidence:** -``` -{Actual command output} -``` -**Gap:** {What needs to be fixed} - -### ⏭️ 3. {Must-have description} -**Status:** SKIPPED -**Reason:** {Why this couldn't be verified} - -## Gap Closure Required - -{If verdict is FAIL or PARTIAL, list what needs fixing} - -1. **{Gap 1}:** {Description of what's wrong and how to fix} -2. **{Gap 2}:** {Description} - -## Next Steps - -{Based on verdict} - -- If PASS: Proceed to next phase -- If FAIL: Run `/execute {N} --gaps-only` after fixing -- If PARTIAL: Address gaps then re-verify -``` - -## Evidence Types - -| Verification | Evidence Required | -|--------------|-------------------| -| API endpoint | curl command + response | -| UI behavior | Screenshot | -| Test suite | Test output | -| File exists | `ls` or `dir` output | -| Build passes | Build command output | diff --git a/.gsd/templates/architecture.md b/.gsd/templates/architecture.md deleted file mode 100644 index d9959d54..00000000 --- a/.gsd/templates/architecture.md +++ /dev/null @@ -1,71 +0,0 @@ ---- -updated_at: 2026-03-02T17:05:45-07:59 ---- - -# Architecture - -> Auto-generated by /map on - -## Overview - -{Brief description of the system and its purpose.} - -``` -┌───────────────────────────────────────────────────────────────┐ -│ USER │ -└────────────────────────┬──────────────────────────────────────┘ - │ - ▼ -┌───────────────────────────────────────────────────────────────┐ -│ COMPONENT A │ -└────────────────────────┬──────────────────────────────────────┘ - │ - ▼ -┌───────────────────────────────────────────────────────────────┐ -│ COMPONENT B │ -└───────────────────────────────────────────────────────────────┘ -``` - -## Components - -### Component A -- **Purpose:** {What this component does} -- **Location:** `{path/to/component}` -- **Files:** {count} files -- **Pattern:** {architectural pattern used} - -| File | Purpose | Priority | -|------|---------|----------| -| file1 | {purpose} | {high/medium/low} | -| file2 | {purpose} | {high/medium/low} | - -### Component B -- **Purpose:** {What this component does} -- **Location:** `{path/to/component}` - -## Data Flow - -1. **User initiates action** (e.g., {example}) -2. **Component A processes** {what happens} -3. **Component B receives** {what happens} -4. **Result returned** to user - -## Technical Debt - -- [ ] {Identified debt item 1} -- [ ] {Identified debt item 2} -- [ ] {Identified debt item 3} - -## Conventions - -**Naming:** -- {Convention 1} -- {Convention 2} - -**Structure:** -- {Convention 1} -- {Convention 2} - ---- - -*Last updated: * diff --git a/.gsd/templates/context.md b/.gsd/templates/context.md deleted file mode 100644 index 14fef704..00000000 --- a/.gsd/templates/context.md +++ /dev/null @@ -1,95 +0,0 @@ ---- -updated_at: 2026-03-02T17:05:45-06:00 ---- - -# Context Template - -Template for `.gsd/phases/{N}/CONTEXT.md` — user's vision for a phase. - ---- - -## File Template - -```markdown ---- -phase: {N} -name: {phase-name} -created: [ISO timestamp] ---- - -# Phase {N} Context - -## Vision - -{How the user imagines this phase working — in their words} - -## What's Essential - -Non-negotiable aspects: - -- {Essential 1} -- {Essential 2} -- {Essential 3} - -## What's Flexible - -Open to different implementations: - -- {Flexible 1} -- {Flexible 2} - -## What's Out of Scope - -Explicitly NOT part of this phase: - -- {Out of scope 1} -- {Out of scope 2} - -## User Expectations - -### Look and Feel -{How it should appear/behave} - -### Performance -{Speed/responsiveness expectations} - -### Integration -{How it fits with existing work} - -## Examples / Inspiration - -{Any examples the user referenced} - -## Questions Answered - -Clarifications from /discuss-phase: - -| Question | Answer | -|----------|--------| -| {question} | {answer} | - -## Constraints - -Technical or business constraints: - -- {Constraint 1} -- {Constraint 2} -``` - ---- - -## When to Create - -Created by `/discuss-phase` to capture user's vision before planning. - -## How to Use - -- Planner reads CONTEXT.md to understand intent -- Executor honors the vision during implementation -- Verifier checks against user expectations - -## Guidelines - -- Capture user's words, not AI interpretation -- Focus on WHAT, not HOW -- Keep it short — vision, not specification diff --git a/.gsd/templates/decisions.md b/.gsd/templates/decisions.md deleted file mode 100644 index ff9df228..00000000 --- a/.gsd/templates/decisions.md +++ /dev/null @@ -1,41 +0,0 @@ ---- -updated_at: 2026-03-02T17:05:45-06:00 ---- - -# DECISIONS.md — Architecture Decision Records - -> **Purpose**: Log significant technical decisions and their rationale. - -## Template - -```markdown -## [DECISION-XXX] Title - -**Date**: YYYY-MM-DD -**Status**: Proposed | Accepted | Deprecated | Superseded - -### Context -What is the issue we're facing? - -### Decision -What have we decided to do? - -### Rationale -Why did we make this decision? - -### Consequences -What are the trade-offs? - -### Alternatives Considered -What other options were evaluated? -``` - ---- - -## Decisions - - - ---- - -*Last updated: * diff --git a/.gsd/templates/discovery.md b/.gsd/templates/discovery.md deleted file mode 100644 index 886c34cf..00000000 --- a/.gsd/templates/discovery.md +++ /dev/null @@ -1,126 +0,0 @@ ---- -updated_at: 2026-03-02T17:05:45-06:00 ---- - -# Discovery Template - -Template for `.gsd/phases/{N}/DISCOVERY.md` — shallow research for library/option decisions. - -**Purpose:** Answer "which library/option should we use" questions during planning. - -For deep ecosystem research, use `/research-phase` which produces RESEARCH.md. - ---- - -## File Template - -```markdown ---- -phase: {N} -type: discovery -topic: [discovery-topic] ---- - - -Discover [topic] to inform [phase name] implementation. - -Purpose: [What decision/implementation this enables] -Scope: [Boundaries] -Output: DISCOVERY.md with recommendation - - - - -- [Question to answer] -- [Area to investigate] -- [Specific comparison if needed] - - - -- [Out of scope for this discovery] -- [Defer to implementation phase] - - - - - -**Source Priority:** -1. **Official Docs** — Authoritative, current -2. **Web Search** — For comparisons, trends (verify findings) -3. **GitHub** — For real usage patterns - -**Quality Checklist:** -- [ ] All claims have authoritative sources -- [ ] Negative claims verified with official docs -- [ ] Alternative approaches considered -- [ ] Recent updates checked for breaking changes - -**Confidence Levels:** -- HIGH: Official docs confirm -- MEDIUM: Multiple sources confirm -- LOW: Single source or training knowledge only - - -``` - ---- - -## Output Structure - -Create `.gsd/phases/{N}/DISCOVERY.md`: - -```markdown -# [Topic] Discovery - -## Summary -[2-3 paragraph executive summary] - -## Primary Recommendation -[What to do and why — specific and actionable] - -## Alternatives Considered -[What else was evaluated and why not chosen] - -## Key Findings - -### [Category 1] -- [Finding with source URL] - -### [Category 2] -- [Finding with relevance] - -## Code Examples -[Relevant patterns if applicable] - -## Metadata - - -[Why this confidence level] - - - -- [Primary sources used] - - - -[What needs validation during implementation] - -``` - ---- - -## When to Use - -**Use discovery when:** -- Technology choice unclear (library A vs B) -- Best practices needed for unfamiliar integration -- API/library investigation required - -**Don't use when:** -- Established patterns (CRUD, auth with known library) -- Questions answerable from project context - -**Use RESEARCH.md instead when:** -- Niche/complex domains (3D, games, audio) -- Need ecosystem knowledge, not just library choice -- "How do experts build this" questions diff --git a/.gsd/templates/journal.md b/.gsd/templates/journal.md deleted file mode 100644 index 5f167fbd..00000000 --- a/.gsd/templates/journal.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -updated_at: 2026-03-02T17:05:45-07:59 ---- - -# JOURNAL.md — Session Log - -> **Purpose**: Chronicle of work sessions for context continuity. - ---- - -## Sessions - -## Session: YYYY-MM-DD HH:MM - -### Objective -{What you set out to accomplish this session.} - -### Accomplished -- ✅ {Task 1 completed} -- ✅ {Task 2 completed} - - {Sub-detail if needed} -- ✅ {Task 3 completed} - -### Verification -- [x] {Verification check 1} -- [x] {Verification check 2} -- [ ] {Verification pending} - -### Blockers Encountered -- {Blocker 1 and how it was resolved} -- {Blocker 2 — still open} - -### Handoff Notes -- {Important context for next session} -- {Files that need attention} -- {Decisions that need to be made} - ---- - -## Session: YYYY-MM-DD HH:MM - -### Objective -{Previous session objective.} - -### Accomplished -- ✅ {Completed items} - ---- - -*Last updated: * diff --git a/.gsd/templates/milestone.md b/.gsd/templates/milestone.md deleted file mode 100644 index 675e6aa1..00000000 --- a/.gsd/templates/milestone.md +++ /dev/null @@ -1,95 +0,0 @@ ---- -updated_at: 2026-03-02T17:05:45-06:00 ---- - -# Milestone Template - -Template for `.gsd/milestones/{name}/MILESTONE.md` — milestone definition and tracking. - ---- - -## File Template - -```markdown ---- -name: {milestone-name} -version: {semantic version, e.g., v1.0} -status: planning | active | complete | archived -created: [ISO timestamp] -target_date: [optional target] ---- - -# Milestone: {name} - -## Vision - -{What this milestone achieves — one paragraph} - -## Must-Haves - -Non-negotiable deliverables for this milestone: - -- [ ] {Must-have 1} -- [ ] {Must-have 2} -- [ ] {Must-have 3} - -## Nice-to-Haves - -If time permits: - -- [ ] {Nice-to-have 1} -- [ ] {Nice-to-have 2} - -## Phases - -| Phase | Name | Status | Objective | -|-------|------|--------|-----------| -| 1 | {name} | ⬜ Not Started | {objective} | -| 2 | {name} | ⬜ Not Started | {objective} | -| 3 | {name} | ⬜ Not Started | {objective} | - -## Success Criteria - -How we know milestone is complete: - -- [ ] {Measurable criterion 1} -- [ ] {Measurable criterion 2} - -## Architecture Decisions - -Key technical decisions for this milestone: - -| Decision | Choice | Rationale | -|----------|--------|-----------| -| {decision} | {choice} | {why} | - -## Risks - -| Risk | Likelihood | Impact | Mitigation | -|------|------------|--------|------------| -| {risk} | Low/Med/High | Low/Med/High | {action} | - -## Progress Log - -| Date | Event | Notes | -|------|-------|-------| -| {date} | Milestone started | — | -``` - ---- - -## Lifecycle - -1. **Creation:** `/new-milestone` creates this file -2. **Active:** Updated as phases complete -3. **Complete:** `/complete-milestone` moves to archive -4. **Archived:** Read-only reference - ---- - -## Guidelines - -- One active milestone at a time -- 3-5 phases per milestone -- Must-haves should be testable -- Success criteria should be measurable diff --git a/.gsd/templates/phase-summary.md b/.gsd/templates/phase-summary.md deleted file mode 100644 index 8cf08ed0..00000000 --- a/.gsd/templates/phase-summary.md +++ /dev/null @@ -1,56 +0,0 @@ ---- -updated_at: 2026-03-02T17:05:45-07:59 ---- - -# Phase {N} Summary - -> **Status**: Complete -> **Completed**: YYYY-MM-DD - -## Objective -{What this phase set out to accomplish.} - -## Deliverables - -| Deliverable | Status | Notes | -|-------------|--------|-------| -| {Deliverable 1} | ✅ | {Any relevant notes} | -| {Deliverable 2} | ✅ | {Any relevant notes} | -| {Deliverable 3} | ✅ | {Any relevant notes} | - -## Tasks Completed - -### Plan {N}.1: {Plan Name} -- [x] {Task 1} -- [x] {Task 2} - -### Plan {N}.2: {Plan Name} -- [x] {Task 1} -- [x] {Task 2} - -## Verification Results - -| Check | Result | Evidence | -|-------|--------|----------| -| {Verification 1} | ✅ Pass | {Command output / screenshot path} | -| {Verification 2} | ✅ Pass | {Command output / screenshot path} | - -## Commits - -| Hash | Message | -|------|---------| -| `abc123` | feat(phase-N): {description} | -| `def456` | feat(phase-N): {description} | - -## Lessons Learned -- {What went well} -- {What could be improved} -- {Unexpected discoveries} - -## Next Steps -- {What the next phase should address} -- {Any deferred items} - ---- - -*Completed: YYYY-MM-DD* diff --git a/.gsd/templates/project.md b/.gsd/templates/project.md deleted file mode 100644 index cc58d176..00000000 --- a/.gsd/templates/project.md +++ /dev/null @@ -1,128 +0,0 @@ ---- -updated_at: 2026-03-02T17:05:45-06:00 ---- - -# Project Template - -Template for `.gsd/SPEC.md` (or PROJECT.md) — project specification. - ---- - -## File Template - -```markdown ---- -status: DRAFT | FINALIZED -created: [ISO timestamp] -finalized: [ISO timestamp when status changed] ---- - -# SPEC.md — Project Specification - -## Vision - -{One paragraph describing what this project is and why it matters} - ---- - -## Goals - -1. **{Primary Goal}** - {Brief description} - -2. **{Secondary Goal}** - {Brief description} - -3. **{Tertiary Goal}** - {Brief description} - ---- - -## Non-Goals (Out of Scope) - -Explicitly NOT part of this project: - -- {Non-goal 1} -- {Non-goal 2} -- {Non-goal 3} - ---- - -## Users - -**Primary User:** {Who} -- {How they'll use it} -- {What they need} - -**Secondary User:** {Who} (if applicable) -- {How they'll use it} - ---- - -## Constraints - -### Technical -- {Technical constraint 1} -- {Technical constraint 2} - -### Timeline -- {Timeline constraint} - -### Other -- {Budget, resources, etc.} - ---- - -## Success Criteria - -How we know the project is successful: - -- [ ] {Measurable outcome 1} -- [ ] {Measurable outcome 2} -- [ ] {Measurable outcome 3} - ---- - -## Prior Art - -Existing solutions or inspiration: - -| Solution | Pros | Cons | Relevance | -|----------|------|------|-----------| -| {solution} | {pros} | {cons} | {how it relates} | - ---- - -## Open Questions - -Questions to resolve during planning: - -- [ ] {Question 1} -- [ ] {Question 2} - ---- - -## Decisions - -Key decisions made during specification: - -| Decision | Choice | Rationale | Date | -|----------|--------|-----------|------| -| {decision} | {choice} | {why} | {date} | -``` - ---- - -## Status Flow - -1. **DRAFT** — Being written, not ready for planning -2. **FINALIZED** — Approved, planning can begin - -**Planning Lock:** Cannot create plans until status is FINALIZED. - -## Guidelines - -- Keep vision to one paragraph -- Goals should be achievable in one milestone -- Non-goals are as important as goals -- Success criteria must be measurable diff --git a/.gsd/templates/requirements.md b/.gsd/templates/requirements.md deleted file mode 100644 index 48f10781..00000000 --- a/.gsd/templates/requirements.md +++ /dev/null @@ -1,96 +0,0 @@ ---- -updated_at: 2026-03-02T17:05:45-06:00 ---- - -# Requirements Template - -Template for `.gsd/REQUIREMENTS.md` — formal requirements tracking with traceability. - ---- - -## File Template - -```markdown ---- -milestone: {name} -updated: [ISO timestamp] ---- - -# Requirements - -## Overview - -Requirements derived from SPEC.md for traceability and coverage tracking. - ---- - -## Functional Requirements - -| ID | Requirement | Source | Phase | Status | -|----|-------------|--------|-------|--------| -| REQ-01 | {requirement description} | SPEC Goal 1 | 1 | Pending | -| REQ-02 | {requirement description} | SPEC Goal 1 | 1 | Pending | -| REQ-03 | {requirement description} | SPEC Goal 2 | 2 | Pending | -| REQ-04 | {requirement description} | SPEC Goal 2 | 2 | Pending | -| REQ-05 | {requirement description} | SPEC Goal 3 | 3 | Pending | - ---- - -## Non-Functional Requirements - -| ID | Requirement | Category | Phase | Status | -|----|-------------|----------|-------|--------| -| NFR-01 | Response time < 200ms | Performance | 4 | Pending | -| NFR-02 | Mobile responsive | UX | All | Pending | -| NFR-03 | 99% uptime | Reliability | 4 | Pending | - ---- - -## Constraints - -| ID | Constraint | Source | Impact | -|----|------------|--------|--------| -| CON-01 | {constraint} | SPEC | {affected areas} | -| CON-02 | {constraint} | Technical | {affected areas} | - ---- - -## Traceability Matrix - -| Requirement | Plans | Tests | Status | -|-------------|-------|-------|--------| -| REQ-01 | 1.1, 1.2 | TC-01 | — | -| REQ-02 | 1.2 | TC-02, TC-03 | — | -| REQ-03 | 2.1 | TC-04 | — | - ---- - -## Status Definitions - -| Status | Meaning | -|--------|---------| -| Pending | Not yet started | -| In Progress | Being implemented | -| Complete | Implemented and verified | -| Blocked | Cannot proceed | -| Deferred | Moved to later milestone | -``` - ---- - -## Guidelines - -**Requirement IDs:** -- REQ-XX: Functional requirements -- NFR-XX: Non-functional requirements -- CON-XX: Constraints - -**Good requirements are:** -- Testable -- Specific -- Traceable to SPEC goals - -**Update when:** -- Phase completes (mark requirements satisfied) -- Scope changes (add/defer requirements) -- Verification passes (update status) diff --git a/.gsd/templates/roadmap.md b/.gsd/templates/roadmap.md deleted file mode 100644 index 76fffd6b..00000000 --- a/.gsd/templates/roadmap.md +++ /dev/null @@ -1,107 +0,0 @@ ---- -updated_at: 2026-03-02T17:05:45-06:00 ---- - -# Roadmap Template - -Template for `.gsd/ROADMAP.md` — phase structure and progress tracking. - ---- - -## File Template - -```markdown ---- -milestone: {name} -version: {semantic version} -updated: [ISO timestamp] ---- - -# Roadmap - -> **Current Phase:** {N} - {name} -> **Status:** {planning | executing | verifying} - -## Must-Haves (from SPEC) - -- [ ] {Must-have 1} -- [ ] {Must-have 2} -- [ ] {Must-have 3} - ---- - -## Phases - -### Phase 1: {Foundation} -**Status:** ⬜ Not Started | 🔄 In Progress | ✅ Complete -**Objective:** {What this phase delivers} -**Requirements:** REQ-01, REQ-02 - -**Plans:** -- [ ] Plan 1.1: {name} -- [ ] Plan 1.2: {name} - ---- - -### Phase 2: {Core Feature} -**Status:** ⬜ Not Started -**Objective:** {What this phase delivers} -**Depends on:** Phase 1 - -**Plans:** -- [ ] Plan 2.1: {name} -- [ ] Plan 2.2: {name} - ---- - -### Phase 3: {Integration} -**Status:** ⬜ Not Started -**Objective:** {What this phase delivers} -**Depends on:** Phase 2 - ---- - -### Phase 4: {Polish/Launch} -**Status:** ⬜ Not Started -**Objective:** {Final touches and deployment} -**Depends on:** Phase 3 - ---- - -## Progress Summary - -| Phase | Status | Plans | Complete | -|-------|--------|-------|----------| -| 1 | ⬜ | 0/2 | — | -| 2 | ⬜ | 0/2 | — | -| 3 | ⬜ | 0/1 | — | -| 4 | ⬜ | 0/1 | — | - ---- - -## Timeline - -| Phase | Started | Completed | Duration | -|-------|---------|-----------|----------| -| 1 | — | — | — | -| 2 | — | — | — | -| 3 | — | — | — | -| 4 | — | — | — | -``` - ---- - -## Status Icons - -- ⬜ Not Started -- 🔄 In Progress -- ✅ Complete -- ⏸️ Paused -- ❌ Blocked - -## Guidelines - -- 3-5 phases per milestone -- Each phase has clear deliverable -- Dependencies flow forward -- Update status as work progresses diff --git a/.gsd/templates/spec.md b/.gsd/templates/spec.md deleted file mode 100644 index 0b19b23c..00000000 --- a/.gsd/templates/spec.md +++ /dev/null @@ -1,55 +0,0 @@ ---- -updated_at: 2026-03-02T17:05:45-07:59 ---- - -# SPEC.md — Project Specification - -> **Status**: `DRAFT` | `FINALIZED` -> -> ⚠️ **Planning Lock**: No code may be written until this spec is marked `FINALIZED`. - -## Vision -{One paragraph describing what this project is and why it exists.} - -## Goals -1. **{Goal 1}** — {Brief description} -2. **{Goal 2}** — {Brief description} -3. **{Goal 3}** — {Brief description} - -## Non-Goals (Out of Scope) -- {What this project explicitly will NOT do} -- {Features that are intentionally excluded} -- {Scope boundaries} - -## Constraints -- {Technical constraint 1} -- {Business constraint 1} -- {Timeline constraint 1} - -## Success Criteria -- [ ] {Measurable outcome 1} -- [ ] {Measurable outcome 2} -- [ ] {Measurable outcome 3} -- [ ] {Measurable outcome 4} - -## User Stories (Optional) - -### As a {user type} -- I want to {action} -- So that {benefit} - -### As a {user type} -- I want to {action} -- So that {benefit} - -## Technical Requirements (Optional) - -| Requirement | Priority | Notes | -|-------------|----------|-------| -| {Requirement 1} | Must-have | {Details} | -| {Requirement 2} | Should-have | {Details} | -| {Requirement 3} | Nice-to-have | {Details} | - ---- - -*Last updated: * diff --git a/.gsd/templates/sprint.md b/.gsd/templates/sprint.md deleted file mode 100644 index 4470d856..00000000 --- a/.gsd/templates/sprint.md +++ /dev/null @@ -1,61 +0,0 @@ ---- -updated_at: 2026-03-02T17:05:45-06:00 ---- - -# Sprint {N} — {Sprint Name} - -> **Duration**: YYYY-MM-DD to YYYY-MM-DD -> **Status**: In Progress | Complete - -## Goal -{One sentence describing what this sprint aims to achieve.} - -## Scope - -### Included -- {Feature/task 1} -- {Feature/task 2} -- {Feature/task 3} - -### Explicitly Excluded -- {Out of scope item 1} -- {Out of scope item 2} - -## Tasks - -| Task | Assignee | Status | Est. Hours | -|------|----------|--------|------------| -| {Task 1} | {who} | ⬜ Todo | {hours} | -| {Task 2} | {who} | 🔄 In Progress | {hours} | -| {Task 3} | {who} | ✅ Done | {hours} | - -## Daily Log - -### Day 1 (YYYY-MM-DD) -- {What was accomplished} -- {Blockers encountered} - -### Day 2 (YYYY-MM-DD) -- {What was accomplished} -- {Blockers encountered} - -## Risks & Blockers - -| Risk | Impact | Mitigation | -|------|--------|------------| -| {Risk 1} | {High/Med/Low} | {What can be done} | - -## Retrospective (end of sprint) - -### What Went Well -- {Positive outcome 1} - -### What Could Improve -- {Area for improvement 1} - -### Action Items -- [ ] {Action to take in next sprint} - ---- - -*Last updated: * diff --git a/.gsd/templates/stack.md b/.gsd/templates/stack.md deleted file mode 100644 index c32670c0..00000000 --- a/.gsd/templates/stack.md +++ /dev/null @@ -1,66 +0,0 @@ ---- -updated_at: 2026-03-02T17:05:45-07:59 ---- - -# Technology Stack - -> Auto-generated by /map on - -## Runtime - -| Technology | Version | Purpose | -|------------|---------|---------| -| {Language} | {version} | {purpose} | -| {Framework} | {version} | {purpose} | -| {Database} | {version} | {purpose} | - -## Core Technologies - -### {Category 1} -| Feature | System | Purpose | -|---------|--------|---------| -| {Feature} | {System/Location} | {Purpose} | - -### {Category 2} -| Directory | Files | Purpose | -|-----------|-------|---------| -| `{path}` | {count} | {purpose} | - -## Dependencies - -### External Dependencies - -| Package | Version | Purpose | -|---------|---------|---------| -| {package} | {version} | {purpose} | - -### Internal Dependencies - -| Component | Depends On | Purpose | -|-----------|------------|---------| -| {Component A} | {Component B} | {Why dependency exists} | - -## Infrastructure - -| Service | Provider | Purpose | -|---------|----------|---------| -| {Service} | {Provider} | {Purpose} | - -**Repository:** {repository URL} - -## Configuration - -| Variable | Purpose | Location | -|----------|---------|----------| -| {VAR_NAME} | {What it controls} | {Where it's set} | - -## File Size Inventory - -| Category | Count | Total Lines (approx) | -|----------|-------|---------------------| -| {Category} | {count} | {lines} | -| **Total** | **{total}** | **{total_lines}** | - ---- - -*Last updated: * diff --git a/.gsd/templates/state.md b/.gsd/templates/state.md deleted file mode 100644 index aff56bde..00000000 --- a/.gsd/templates/state.md +++ /dev/null @@ -1,96 +0,0 @@ ---- -updated_at: 2026-03-02T17:05:45-07:59 ---- - -# State Template - -Template for `.gsd/STATE.md` — project memory across sessions. - ---- - -## File Template - -```markdown ---- -updated: [ISO timestamp] ---- - -# Project State - -## Current Position - -**Milestone:** {name} -**Phase:** {N} - {name} -**Status:** {planning | executing | verifying | blocked} -**Plan:** {current plan if executing} - -## Last Action - -{What was just completed} - -## Next Steps - -1. {Immediate next action} -2. {Following action} -3. {Third action if known} - -## Active Decisions - -Decisions made that affect current work: - -| Decision | Choice | Made | Affects | -|----------|--------|------|---------| -| {what} | {choice} | {date} | {phases/plans} | - -## Blockers - -{None if clear} - -- [ ] {Blocker 1}: {resolution approach} -- [ ] {Blocker 2}: {resolution approach} - -## Concerns - -Things to watch but not blocking: - -- {Concern 1} -- {Concern 2} - -## Session Context - -{Any context the next session needs to know} -``` - ---- - -## Update Rules - -**Update STATE.md after:** -- Every completed task -- Every decision made -- Any blocker identified -- Session end/pause - -**What to update:** -- `updated` timestamp -- Current Position -- Last Action -- Next Steps - -**Keep it lean:** -- STATE.md is read frequently -- Only current context, not history -- History goes in JOURNAL.md - ---- - -## Resume Protocol - -When starting a new session: - -1. Read STATE.md first -2. Understand current position -3. Check blockers/concerns -4. Continue from Next Steps - -The STATE.md is the "save game" for the project. diff --git a/.gsd/templates/state_snapshot.md b/.gsd/templates/state_snapshot.md deleted file mode 100644 index 63f4d04b..00000000 --- a/.gsd/templates/state_snapshot.md +++ /dev/null @@ -1,136 +0,0 @@ ---- -updated_at: 2026-03-02T17:05:45-07:59 ---- - -# State Snapshot Template - -Template for wave summaries and session state captures. - ---- - -## When to Use - -Create a state snapshot: -- After completing each wave -- Before pausing work -- After 3 debugging failures -- When switching models mid-session -- At any significant milestone - ---- - -## Template - -```markdown ---- -wave: {N} -phase: {phase number} -created: {ISO timestamp} -status: {complete | partial | blocked} ---- - -# Wave {N} State Snapshot - -## Objective - -{What this wave aimed to accomplish — 1-2 sentences} - -## Changes Realized - -- {Change 1} -- {Change 2} -- {Change 3} - -## Files Touched - -| File | Change Type | Description | -|------|-------------|-------------| -| {path/to/file1} | created | {brief description} | -| {path/to/file2} | modified | {brief description} | -| {path/to/file3} | deleted | {brief description} | - -## Verification Results - -| Check | Command | Result | -|-------|---------|--------| -| {Test 1} | `{command}` | ✅ Passed | -| {Test 2} | `{command}` | ✅ Passed | -| {Test 3} | `{command}` | ❌ Failed: {reason} | - -## Commits in This Wave - -| Hash | Message | -|------|---------| -| {abc123} | {commit message 1} | -| {def456} | {commit message 2} | - -## Risks & Technical Debt - -{None if clear} - -- ⚠️ {Risk or debt item 1} -- ⚠️ {Risk or debt item 2} - -## TODO for Next Wave - -1. {Next task 1} -2. {Next task 2} -3. {Next task 3} - -## Context for Fresh Session - -{Any information the next session needs — decisions made, blockers encountered, hypotheses to test} - -## Token Usage (Optional) - -| Metric | Value | -|--------|-------| -| Files loaded | {count} | -| Est. tokens | {number} | -| Budget used | {percentage}% | -| Compression | {yes/no} | - -{Notes on token efficiency for this wave} -``` - ---- - -## Minimal Snapshot (Debug Session) - -For quick state dumps during debugging: - -```markdown -# Debug State Snapshot - -**Time:** {timestamp} -**Problem:** {what you're debugging} - -**Tried:** -1. {approach 1} → {result} -2. {approach 2} → {result} -3. {approach 3} → {result} - -**Current Hypothesis:** {theory} - -**Files Involved:** -- {file1} -- {file2} - -**Recommended Next:** {suggested approach for fresh session} -``` - ---- - -## Integration with STATE.md - -State snapshots are point-in-time captures. After creating a snapshot: - -1. Update STATE.md with current position -2. Reference the snapshot in SESSION Context -3. Commit both together - -STATE.md is current state; snapshots are historical records. - ---- - -*Part of GSD methodology. See PROJECT_RULES.md for wave execution rules.* diff --git a/.gsd/templates/todo.md b/.gsd/templates/todo.md deleted file mode 100644 index 7f7b7656..00000000 --- a/.gsd/templates/todo.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -updated_at: 2026-03-02T17:05:45-07:59 ---- - -# TODO.md — Pending Items - -> Quick capture of ideas, tasks, and issues. -> -> Use `/add-todo` to add items, `/check-todos` to view. - -## Format - -```markdown -- [ ] Description `priority` — YYYY-MM-DD -- [x] Completed item `priority` — YYYY-MM-DD ✓ YYYY-MM-DD -``` - -## Priority Levels - -| Level | Use For | -|-------|---------| -| `high` 🔴 | Blocking issues, urgent fixes | -| `medium` 🟡 | Normal priority (default) | -| `low` 🟢 | Nice-to-have, future ideas | - ---- - -## Items - - - -- [ ] {Example todo item} `medium` — YYYY-MM-DD - ---- - -*Last updated: * diff --git a/.gsd/templates/token_report.md b/.gsd/templates/token_report.md deleted file mode 100644 index bf01b511..00000000 --- a/.gsd/templates/token_report.md +++ /dev/null @@ -1,83 +0,0 @@ ---- -updated_at: 2026-03-02T17:05:45-07:59 ---- - -# Token Report Template - -Template for documenting token usage per wave or session. - ---- - -## Template - -```markdown ---- -wave: {N} -phase: {phase number} -created: {ISO timestamp} ---- - -# Token Usage Report - -## Summary - -| Metric | Value | -|--------|-------| -| Files loaded | {count} | -| Estimated tokens | {number} | -| Budget usage | {percentage}% | -| Compression applied | {yes/no} | - -## Files Loaded - -| File | Lines | Est. Tokens | Reason | -|------|-------|-------------|--------| -| {path/to/file1} | {N} | {N} | {why loaded} | -| {path/to/file2} | {N} | {N} | {why loaded} | - -## Compression Applied - -| File | Before | After | Savings | -|------|--------|-------|---------| -| {file} | {N} | summary | {N} tokens | - -## Efficiency Analysis - -### What Worked Well -- {Strategy that saved tokens} - -### Could Improve -- {Opportunity for optimization} - -### Recommendations -- {Suggestion for next wave} -``` - ---- - -## When to Create - -Create a token report: -- After completing a wave with high token usage -- When budget exceeds 50% -- For debugging session performance -- During milestone retrospectives - ---- - -## Quick Report (Minimal) - -For simple tracking: - -```markdown -## Token Report: Wave {N} - -- Files: {count} -- Tokens: ~{number} -- Budget: {X}% -- Status: [OK|WARNING|CRITICAL] -``` - ---- - -*Part of GSD v1.6 Token Optimization.* diff --git a/.gsd/templates/user-setup.md b/.gsd/templates/user-setup.md deleted file mode 100644 index 0ca0888d..00000000 --- a/.gsd/templates/user-setup.md +++ /dev/null @@ -1,120 +0,0 @@ ---- -updated_at: 2026-03-02T17:05:45-07:59 ---- - -# User Setup Template - -Template for user setup instructions when external services are needed. - ---- - -## File Template - -```markdown ---- -phase: {N} -plan: {M} -type: user-setup ---- - -# User Setup Required - -## Overview - -This plan requires manual setup that the AI cannot perform. - -**Time estimate:** {X minutes} -**Blocking:** Plan cannot proceed until complete - ---- - -## Setup Steps - -### 1. {Service Name} - -**Why needed:** {Purpose in the project} - -**Create account:** -- Go to: {URL} -- Sign up with: {recommendations} - -**Get credentials:** -1. Navigate to: {dashboard location} -2. Find: {API keys section} -3. Create: {what to create} - -**Add to project:** -```powershell -# Add to .env.local -{ENV_VAR}=your_key_here -``` - -**Verify:** -```powershell -# Test the connection -{verification command} -``` - ---- - -### 2. {Another Service} - -**Why needed:** {Purpose} - -**Steps:** -1. {Step 1} -2. {Step 2} -3. {Step 3} - -**Environment variables:** -``` -{VAR_1}=value -{VAR_2}=value -``` - ---- - -## Dashboard Configuration - -Some things require manual dashboard setup: - -| Service | Task | Location | Notes | -|---------|------|----------|-------| -| {service} | {task} | {where} | {notes} | - ---- - -## Verification Checklist - -Before continuing, verify: - -- [ ] All environment variables set -- [ ] All accounts created -- [ ] All dashboard configurations complete -- [ ] Verification commands pass - ---- - -## When Complete - -Type "done" or "setup complete" to continue with execution. -``` - ---- - -## Guidelines - -**Include only what AI cannot do:** -- Account creation (requires human identity) -- Secret retrieval (protected behind login) -- Dashboard configuration (no API available) -- Payment method setup -- 2FA enrollment - -**Do NOT include:** -- npm install (AI can do) -- File creation (AI can do) -- Configuration file edits (AI can do) -- API calls (AI can do) - -**Keep minimal** — every manual step slows down execution. diff --git a/CHANGELOG.md b/CHANGELOG.md index 6fb701b8..c9eed871 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] - TBD +### Removed +- Unused tracked `.gsd/` planning scaffolding, `.clauderules`, and orphan `gsd-opencode` submodule gitlink. +- Dead GSD references from `.gitignore`, `INDEX.md`, `README.md`, `docs/DEVELOPER_GUIDE.md`, `eslint.config.mjs`, and `vitest.config.ts`. + ### Known Issues - RAST MS FBA not working - PATRIC-only model submission diff --git a/INDEX.md b/INDEX.md index 73a65ac0..d3cfff87 100644 --- a/INDEX.md +++ b/INDEX.md @@ -29,11 +29,4 @@ Each directory contains a specific domain of the application and has its own `RE | `test-data/` | Mock JSON responses and static structure definitions for tests. | [test-data/README.md](./test-data/README.md) | | `legacy/` | Externa or outdated dependencies, previous implementation phases, and legacy codebase artifacts. | [legacy/README.md](./legacy/README.md) | -## State and Planning - -| Directory | Purpose | -| :--- | :--- | -| `.gsd/` | Project roadmap, current state, and specific agent tasks. | -| `.agent/` | Skills, workflows, and rules for AI agents. | - Please navigate to individual folder `README.md` files for deeper domain information. diff --git a/README.md b/README.md index 64464864..e6d43139 100644 --- a/README.md +++ b/README.md @@ -125,7 +125,6 @@ For a deeper architectural view, see: - `INDEX.md` – High-level map of files and folders (Primary entry point for onboarding). - `docs/README.md` – Developer manual index. - `issues.md` - Verified current API limitations and bug tracker. -- `.gsd/ROADMAP.md` – Current phases and milestones. ### Note for AI Agents When initializing a debugging or feature session, start by reading `INDEX.md` for the context protocol, then review `issues.md` to ensure you are not debugging a known backend limitation (such as 501 Not Implemented endpoints). diff --git a/docs/DEVELOPER_GUIDE.md b/docs/DEVELOPER_GUIDE.md index 6ff5a5d3..395b94cc 100644 --- a/docs/DEVELOPER_GUIDE.md +++ b/docs/DEVELOPER_GUIDE.md @@ -1,7 +1,7 @@ # Documentation Editing Protocol (`DEVELOPER_GUIDE.md`) > **🤖 AI Agent Instructions** -> When asked to create new features or architectural changes, you MUST update this documentation library before marking the task complete. Check `.gsd/STATE.md` to map new behavior documentation. +> When asked to create new features or architectural changes, you MUST update this documentation library before marking the task complete. This guide acts as the strict standard operating procedure for how to use, write, and extend the ModelSEED-UI documentation located within `docs/`. @@ -50,7 +50,7 @@ For human and AI scannability, execute the following writing standards: - **Assume High-Context Readers**: Write for senior developers or specific AI agents. Skip introductory filler text. - **Show Code Paths, Not Prose**: Factual and strict syntax. Use backticks for paths (`` `app/(user-data)/my-models/page.tsx` ``). Provide code architecture snippets if they establish a core pattern. -- **Document Current State, Not History**: `.gsd/STATE.md` tracks our daily history. This `docs/` library defines **how the system currently behaves**. +- **Document Current State, Not History**: This `docs/` library defines **how the system currently behaves**, not how it got here. - **Actionable Callouts**: Use formatted blockquotes `> **Note**` to flag dangerous regressions or legacy invariants. --- diff --git a/eslint.config.mjs b/eslint.config.mjs index c75b50e0..3732232a 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -14,7 +14,6 @@ const eslintConfig = defineConfig([ "next-env.d.ts", // Non-product/generated/archived areas: "legacy/**", - "gsd-opencode/**", "playwright-report/**", "test-results/**", ]), diff --git a/gsd-opencode b/gsd-opencode deleted file mode 160000 index 4527186e..00000000 --- a/gsd-opencode +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 4527186e3fa24630b76bceb99fa962673c23fd43 diff --git a/tests/unit/repo/noGsdScaffolding.test.ts b/tests/unit/repo/noGsdScaffolding.test.ts new file mode 100644 index 00000000..e4c4fb68 --- /dev/null +++ b/tests/unit/repo/noGsdScaffolding.test.ts @@ -0,0 +1,36 @@ +import { execSync } from 'child_process'; +import { existsSync, readFileSync } from 'fs'; +import { dirname, join } from 'path'; +import { fileURLToPath } from 'url'; +import { describe, expect, it } from 'vitest'; + +const repositoryRoot = join(dirname(fileURLToPath(import.meta.url)), '../../..'); +const cleanedFiles = [ + '.gitignore', + 'README.md', + 'INDEX.md', + 'docs/DEVELOPER_GUIDE.md', + 'eslint.config.mjs', + 'vitest.config.ts', +]; +const scaffoldingPath = /^(?:\.gsd|gsd-opencode|\.clauderules)(?:\/|$)/; +const scaffoldingReference = /\.gsd|gsd-opencode|\.clauderules/i; + +describe('GSD scaffolding cleanup', () => { + it('keeps GSD scaffolding out of tracked files', () => { + const trackedPaths = execSync('git ls-files', { cwd: repositoryRoot, encoding: 'utf8' }) + .split('\n') + .filter(Boolean); + const scaffoldingPaths = trackedPaths.filter((trackedPath) => scaffoldingPath.test(trackedPath)); + + expect(scaffoldingPaths, `GSD scaffolding must not be tracked: ${scaffoldingPaths.join(', ')}`).toEqual([]); + }); + + it('keeps cleaned files free of scaffolding references', () => { + for (const cleanedFile of cleanedFiles) { + const filePath = join(repositoryRoot, cleanedFile); + expect(existsSync(filePath), `${cleanedFile} must exist so its references can be checked`).toBe(true); + expect(readFileSync(filePath, 'utf8'), `${cleanedFile} must not reference removed GSD scaffolding`).not.toMatch(scaffoldingReference); + } + }); +}); diff --git a/vitest.config.ts b/vitest.config.ts index 55d31b10..e814db66 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -8,7 +8,7 @@ export default defineConfig({ environment: 'happy-dom', setupFiles: ['./tests/setup.ts'], include: ['tests/**/*.test.{ts,tsx}'], - exclude: ['**/node_modules/**', '**/gsd-opencode/**', '**/.git/**'], + exclude: ['**/node_modules/**', '**/.git/**'], coverage: { provider: 'v8', reporter: ['text', 'json', 'html'], @@ -19,7 +19,6 @@ export default defineConfig({ 'vitest.config.ts', '**/*.d.ts', '**/.next/**', - 'gsd-opencode/**', '**/*.md', 'lib/README.md', ],