diff --git a/.impeccable/review/alpha3/README.md b/.impeccable/review/alpha3/README.md new file mode 100644 index 0000000..12a1203 --- /dev/null +++ b/.impeccable/review/alpha3/README.md @@ -0,0 +1,12 @@ +# Alpha 3 initial desktop captures + +These two fixture-data screenshots were captured during the initial alpha 3 +review on 2026-09-16 and retained through Fable's follow-up implementation. +They are included with the user's 2026-09-22 request to commit all task changes. + +- `home-desktop.png`: populated research overview. +- `queue-desktop.png`: populated decision queue. + +These are historical first-pass captures, not final design approval or screenshots +of the 2026-09-22 failed-run fix. See the implementation ledger and verification +checkpoint in `docs/audits/2026-09-16-alpha3/` for scope and limitations. diff --git a/.impeccable/review/alpha3/home-desktop.png b/.impeccable/review/alpha3/home-desktop.png new file mode 100644 index 0000000..b83890f Binary files /dev/null and b/.impeccable/review/alpha3/home-desktop.png differ diff --git a/.impeccable/review/alpha3/queue-desktop.png b/.impeccable/review/alpha3/queue-desktop.png new file mode 100644 index 0000000..279af59 Binary files /dev/null and b/.impeccable/review/alpha3/queue-desktop.png differ diff --git a/CHANGELOG.md b/CHANGELOG.md index e859ff3..149642a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,11 +4,126 @@ All notable public-facing changes to TaskSignal are recorded here. ## Unreleased +### Fixed + +- Project run history now distinguishes failed and unfinished scan responses + from completed runs, including failures returned with HTTP 200. Failed runs + display the connector error and retain their scan-detail link and ledger refresh. +- Allow the documented Fluid compute duration limit (`maxDuration: 300`) for + Vercel API preview deployments. + +### Security + +- Refreshed locked web and API dependencies (including Next.js 15.5.29) so the + production web audit (`npm audit --omit=dev`) and the base and MCP Python + audits report no known vulnerabilities. + +## 1.0.0a3 - 2026-09-16 + +### Added + +- Shareable decision-queue views that retain text search, sort order, project, + source, readiness, age, and decision filters in the URL. +- A filtered return link and continuous “Next in this queue” review path that + retains the next item when a saved decision removes the current item from the + filter. Unsaved reviews disable Next, warn before following other page links + or reloading, and survive background data refreshes. +- Project search and run-status filters, plus focused project creation in an + accessible disclosure below the saved projects. +- Project run history can rerun the project, open its scoped decision queue, and + jump to each run's scan record; project cards link to their scoped queue once + a run exists. +- Thread pages link the current and historical snapshots to their evidence + pages, confirm saved thread decisions, and warn before unsaved edits are lost. + +### Changed + +- Replaced the populated home introduction with current research totals, + prioritized review work, saved views, and recent projects. Onboarding appears + only in an empty workspace. +- Replaced the wide opportunity table with responsive evidence-rich rows, + visible sensitive-risk warnings, and expandable evidence gaps and score details. +- Put source evidence and human review ahead of scoring and export tools on + opportunity detail pages; preserved the existing teal visual system. + +### Fixed + +- Failed thread/project/source requests no longer masquerade as empty data; + recovery actions stay available beside the error. +- Failed scan-history, run-history, agent-session, source-registry, + stored-packet, integration, readiness, and workspace-profile loads now show + the API's error detail with a Retry action instead of raw JSON, a silent gap, + or an empty-state claim; the workspace form stays read-only until the stored + profile has loaded. +- Discourse forums keep their own names on the Sources page instead of sharing + one connector label. +- The opportunity score card stacks at narrow widths instead of squeezing its + description into a one-word column. +- Review saves refresh thread, snapshot, evaluation, and readiness views. + Project runs also refresh project history and comparison data. +- Background updates preserve in-progress review notes and labels. + +### Development status + +- Prepared and verified locally. This entry does not imply a public release, + deployment, or independently measured improvement in review speed. + +### Security + +- Updated Vitest and its mocker to 4.1.11 to resolve the development-tooling + advisory [GHSA-82fw-gwwq-j7x9](https://github.com/advisories/GHSA-82fw-gwwq-j7x9). + Production web dependencies are unchanged. + +## 1.0.0a2 - 2026-09-08 + +### Added + +- A live workspace home with real research totals, the next unreviewed + opportunity, recent projects, and a direct credential-free demo action. +- Keyboard-accessible quick navigation with Cmd/Ctrl+K, page filtering, and + direct evidence-search handoff. +- Queue text search and score, readiness, and recency sorting, alongside the + existing server-side research and decision filters. +- Shareable evidence-search URLs with browser history, stale-response protection, + preserved results during refresh, and copy-link support. +- Branded missing-page and recoverable page-error views. + +### Changed + +- Refreshed navigation, contextual page headers, visual hierarchy, loading + feedback, focus treatment, and the home layout for desktop and mobile. +- Opportunity review takes priority over setup and scan controls; advanced + settings remain available through progressive disclosure. + +### Development status + +- Prepared as a local alpha update. No public release, deployment, or GA claim + is implied by this version entry. + +### Fixed + +- Fixed/manual scheduling clears stale custom intervals across the API and + agent tools, so changing cadence no longer preserves an unintended schedule. +- Generation requested through a historical opportunity now uses the thread's + current snapshot. +- Detaching a snapshot referenced by an immutable build packet returns a clear + conflict response while preserving the packet's evidence. +- Dashboard onboarding now reports the immutable build-packet handoff complete + only after a packet exists and opens the current thread's Build Studio instead + of the legacy task-pack exporter. +- Repository test commands allocate an isolated temporary SQLite database per + run, preventing overlapping local verification processes from dropping one + another's test tables. + ### Security -- Refreshed locked web and API dependencies so the production web audit and - the base and MCP Python audits report no known vulnerabilities. The only - remaining web advisory is the unpatched `picomatch` ReDoS in dev tooling. +- Updated compatible web dependencies, including Next.js 15.5.25 and PostCSS + 8.5.28, and refreshed the lockfile to clear the web dependency audit. +- Updated the transitive Python cryptography dependency to 50.0.1; the hashed + production and MCP dependency audit reports no known vulnerabilities. +- Directly guarded API routes now reject malformed non-ASCII operator and demo + reset tokens with a constant-time byte comparison and a stable `403` response + instead of raising an internal error. ## 1.0.0a1 - 2026-07-11 diff --git a/DESIGN.md b/DESIGN.md index d08bf37..4e1262a 100644 --- a/DESIGN.md +++ b/DESIGN.md @@ -22,7 +22,8 @@ Layout: - Left navigation on desktop. - Single-column mobile flow. -- Data tables for ranked opportunities. +- Responsive rows for ranked opportunities, with secondary scoring details in + a native disclosure; one readable column on mobile. - Cards only for bounded summaries, repeated evidence items, and focused panels. - No nested cards. @@ -33,6 +34,32 @@ Interaction: - Loading states must be visible for async processing. - Focus states must remain visible. +## Next-version workbench + +The alpha.3 interface retains the existing teal palette and system font. A +slightly tinted navigation rail, a context bar, stronger page hierarchy, and a +compact research overview distinguish navigation, orientation, and task content. +Home totals always come from the API; loading and failed data are never shown as +invented results. Current opportunities refer to latest snapshots, not lifetime +snapshot counts. + +The decision queue precedes collection/setup tools in both visual and document +order. Advanced scope filters and setup details use native disclosure controls. +Quick navigation uses a native modal dialog, Cmd/Ctrl+K, visible focus, and Escape +support. Motion respects the operating system's reduced-motion preference. + +Populated home screens lead with current work. Empty-workspace onboarding is +conditional on successful, empty data. Projects lead with the saved list, search, +and run status; creation stays in a native disclosure below it. Failed requests +use explicit recovery states instead of claiming the workspace is empty. + +Queue filters and ordering are represented in the URL. Detail pages preserve +that queue context and show evidence before decisions and export tools. The +next-item link follows the original order and is disabled while review drafts +are unsaved. Internal page links and reloads warn about unsaved drafts; native +browser Back/Forward is not intercepted. Review drafts survive background +response updates while the page remains mounted. + ## Exports Generated from the locked TaskSignal system on 2026-07-10. The root diff --git a/Makefile b/Makefile index 6075eee..9419ce2 100644 --- a/Makefile +++ b/Makefile @@ -43,7 +43,10 @@ smoke: $(API_PYTHON) -u scripts/first_run_smoke.py test: - $(API_PYTHON) -m pytest apps/api/tests + @test_db_dir="$$(mktemp -d /tmp/tasksignal-tests.XXXXXX)"; \ + trap 'rm -rf "$$test_db_dir"' EXIT; \ + DATABASE_URL="sqlite:///$$test_db_dir/tasksignal.db" \ + $(API_PYTHON) -m pytest apps/api/tests cd apps/web && PATH="$(WEB_PATH)" npm test lint: diff --git a/README.md b/README.md index 76b4ffa..344a8dd 100644 --- a/README.md +++ b/README.md @@ -7,14 +7,38 @@ It remembers what each run observed, explains what changed, keeps related opportunities in persistent threads, and generates deterministic build documents whose provenance can be verified before implementation starts. -![TaskSignal current opportunity queue after processing demo data](docs/images/dashboard-browser-verified.jpg) +![TaskSignal alpha 1 opportunity queue after processing demo data](docs/images/dashboard-browser-verified.jpg) + +## Next version: 1.0.0 alpha 3 + +The decision queue keeps its text search, sort order, and project, source, +readiness, age, and decision filters in the URL, so a view can be copied or +reopened later. Opening an idea from the queue preserves that view: **Back to +filtered queue** returns to it and **Next in this queue** continues in the same +order. Unsaved reviews disable Next and warn before another page link or a reload +would discard them. + +The home page shows current research totals, unreviewed ideas, saved views, and +recent projects; onboarding appears only in an empty workspace. Projects list +saved work first with local search, run-status filters, and a focused **New +project** disclosure. Run history can rerun a project, open its scoped queue, and +jump to each run's scan record. Threads link every snapshot to its evidence page, +confirm saved decisions, and guard unsaved edits. Failed loads on every page keep +a **Retry** action and never masquerade as empty data. + +Press **Cmd+K** on macOS or **Ctrl+K** elsewhere to jump between views or search +for evidence. Submitted evidence searches have a reusable `?q=` address, with +browser back/forward support and a copy-link action. + +This is a local alpha update; see the changelog for its verification and release +boundaries. ## Project Status TaskSignal is an early-stage, local-first application for one operator. The latest public release is the [`v0.2.0` rollback baseline](https://github.com/Yurii201811/tasksignal/releases/tag/v0.2.0). -The current source tree is the pre-GA v1 alpha (`1.0.0a1` for Python and -`1.0.0-alpha.1` for the web app). +The current source tree is the pre-GA v1 alpha (`1.0.0a3` for Python and +`1.0.0-alpha.3` for the web app). The repository has a passing Linux/macOS Python 3.11–3.14 wheel matrix in this [`main` CI run](https://github.com/Yurii201811/tasksignal/actions/runs/29171023301). diff --git a/apps/api/app/api/routes.py b/apps/api/app/api/routes.py index 08e797d..09345ca 100644 --- a/apps/api/app/api/routes.py +++ b/apps/api/app/api/routes.py @@ -4,7 +4,6 @@ import json import re from datetime import UTC, datetime, timedelta -from secrets import compare_digest from uuid import UUID, uuid4 import httpx @@ -14,6 +13,7 @@ from sqlalchemy.orm import Session from app.core.config import settings +from app.core.security import secret_text_matches from app.core.version import TASKSIGNAL_VERSION from app.db.session import get_db from app.models.all_models import ( @@ -162,7 +162,10 @@ get_project_run, list_project_runs, ) -from app.services.research_projects.service import next_run_at_from +from app.services.research_projects.service import ( + next_run_at_from, + schedule_interval_for_project, +) from app.services.scoring.service import score_opportunity from app.services.search.service import semantic_search as search_semantically from app.workers.demo_pipeline import ensure_sources, process_demo, stats @@ -323,11 +326,7 @@ def author_hash_salt_uses_default() -> bool: def operator_scan_authorized(token: str | None) -> bool: - return bool( - settings.operator_scan_token - and token - and compare_digest(token, settings.operator_scan_token) - ) + return secret_text_matches(token, settings.operator_scan_token) def require_operator_token(token: str | None, action: str) -> None: @@ -339,7 +338,7 @@ def require_operator_token(token: str | None, action: str) -> None: "and sent as X-Operator-Scan-Token." ), ) - if not token or not compare_digest(token, settings.operator_scan_token): + if not secret_text_matches(token, settings.operator_scan_token): raise HTTPException( status_code=status.HTTP_403_FORBIDDEN, detail=f"{action} requires a valid X-Operator-Scan-Token.", @@ -706,6 +705,7 @@ def readiness_payload(db: Session) -> ReadinessOut: local_workspace = get_or_create_local_workspace(db) project_count = len(db.scalars(select(ResearchProject.id)).all()) opportunity_count = len(db.scalars(select(Opportunity.id)).all()) + build_packet_count = len(db.scalars(select(BuildPacket.id)).all()) due_count = len(db.scalars(due_project_query(datetime.now(UTC))).all()) blockers: list[str] = [] warnings: list[str] = [] @@ -713,7 +713,9 @@ def readiness_payload(db: Session) -> ReadinessOut: if project_count == 0: warnings.append("Create at least one saved research project.") if opportunity_count == 0: - warnings.append("Run a project or process fixtures before exporting task packs.") + warnings.append("Run a project or process fixtures before creating a build packet.") + elif build_packet_count == 0: + warnings.append("Review a thread and create an immutable build packet.") if not local_workspace.configured: warnings.append("Set the local workspace owner or goal for this machine.") if warning := public_scan_config_warning(): @@ -734,6 +736,7 @@ def readiness_payload(db: Session) -> ReadinessOut: checks = { "projects": project_count, "opportunities": opportunity_count, + "build_packets": build_packet_count, "due_projects": due_count, "local_workspace_configured": local_workspace.configured, "ready_sources": ready_sources, @@ -1708,6 +1711,11 @@ def create_research_project( ) labels = [label.strip() for label in payload.labels if label.strip()] + cadence = payload.cadence.strip() or "manual" + schedule_interval_hours = schedule_interval_for_project( + cadence, + payload.schedule_interval_hours, + ) project = ResearchProject( name=payload.name.strip(), description=payload.description.strip() if payload.description else None, @@ -1715,12 +1723,12 @@ def create_research_project( source_id=payload.source_id, query=payload.query.strip(), limit=payload.limit, - cadence=payload.cadence.strip() or "manual", - schedule_interval_hours=payload.schedule_interval_hours, + cadence=cadence, + schedule_interval_hours=schedule_interval_hours, next_run_at=next_run_at_from( datetime.now(UTC), - payload.cadence.strip() or "manual", - payload.schedule_interval_hours, + cadence, + schedule_interval_hours, ), labels_json=labels[:12], enabled=payload.enabled, @@ -1831,6 +1839,11 @@ def update_research_project( project.cadence = cadence if "schedule_interval_hours" in supplied: project.schedule_interval_hours = payload.schedule_interval_hours + if supplied & {"cadence", "schedule_interval_hours"}: + project.schedule_interval_hours = schedule_interval_for_project( + project.cadence, + project.schedule_interval_hours, + ) if "labels" in supplied: labels = [label.strip() for label in (payload.labels or []) if label.strip()] project.labels_json = list(dict.fromkeys(labels))[:12] @@ -2049,7 +2062,7 @@ def run_demo( if reset and ( not settings.demo_reset_token or x_demo_reset_token is None - or not compare_digest(x_demo_reset_token, settings.demo_reset_token) + or not secret_text_matches(x_demo_reset_token, settings.demo_reset_token) ): raise HTTPException( status_code=status.HTTP_403_FORBIDDEN, @@ -2943,6 +2956,7 @@ def regenerate_opportunity(opportunity_id: UUID, db: Session = Depends(get_db)) opportunity = db.get(Opportunity, opportunity_id) if opportunity is None: raise HTTPException(status_code=404, detail="Opportunity not found") + opportunity = current_thread_snapshot(db, opportunity) rows = cluster_signal_rows(db, opportunity.cluster_id) if not rows: @@ -2994,6 +3008,7 @@ def enhance_opportunity_prompt( opportunity = db.get(Opportunity, opportunity_id) if opportunity is None: raise HTTPException(status_code=404, detail="Opportunity not found") + opportunity = current_thread_snapshot(db, opportunity) try: provider, model, enhanced_prompt = enhance_prompt(opportunity.generated_prompt) diff --git a/apps/api/app/core/security.py b/apps/api/app/core/security.py new file mode 100644 index 0000000..f463d26 --- /dev/null +++ b/apps/api/app/core/security.py @@ -0,0 +1,8 @@ +from secrets import compare_digest + + +def secret_text_matches(supplied: str | None, configured: str | None) -> bool: + """Compare text secrets without raising on non-ASCII header values.""" + if not supplied or not configured: + return False + return compare_digest(supplied.encode("utf-8"), configured.encode("utf-8")) diff --git a/apps/api/app/core/version.py b/apps/api/app/core/version.py index 1684fff..27989c9 100644 --- a/apps/api/app/core/version.py +++ b/apps/api/app/core/version.py @@ -11,7 +11,7 @@ def installed_tasksignal_version() -> str: return version(distribution) except PackageNotFoundError: continue - return "1.0.0a1" + return "1.0.0a3" TASKSIGNAL_VERSION = installed_tasksignal_version() diff --git a/apps/api/app/main.py b/apps/api/app/main.py index 8e652d2..39e53f9 100644 --- a/apps/api/app/main.py +++ b/apps/api/app/main.py @@ -1,7 +1,6 @@ import os from collections.abc import AsyncIterator from contextlib import asynccontextmanager -from secrets import compare_digest os.environ.setdefault("DISABLE_SQLALCHEMY_CEXT_RUNTIME", "1") @@ -11,6 +10,7 @@ from app.api.routes import router from app.core.config import settings +from app.core.security import secret_text_matches from app.core.version import TASKSIGNAL_VERSION from app.db.base import Base from app.db.session import engine, ensure_sqlite_schema_compatibility @@ -26,9 +26,7 @@ def cors_allowed_origins() -> list[str]: def operator_token_matches(supplied_token: str | None, configured_token: str) -> bool: """Compare tokens without failing on malformed or non-ASCII header values.""" - if not supplied_token or not configured_token: - return False - return compare_digest(supplied_token.encode(), configured_token.encode()) + return secret_text_matches(supplied_token, configured_token) @asynccontextmanager diff --git a/apps/api/app/services/mcp_surface/writes.py b/apps/api/app/services/mcp_surface/writes.py index 6c083a8..e6443f9 100644 --- a/apps/api/app/services/mcp_surface/writes.py +++ b/apps/api/app/services/mcp_surface/writes.py @@ -92,7 +92,11 @@ ThreadVersionConflict, set_thread_decision, ) -from app.services.research_projects.service import mark_latest_project_run, next_run_at_from +from app.services.research_projects.service import ( + mark_latest_project_run, + next_run_at_from, + schedule_interval_for_project, +) from app.workers.scan_pipeline import ( CONNECTOR_FACTORIES, ProjectVersionConflict, @@ -413,6 +417,10 @@ def _create_project(db: Session, request: Mapping[str, Any]) -> dict[str, Any]: _validate_source_binding(db, source_type=source_type, source_id=payload.source_id) labels = _validate_labels(payload.labels) now = datetime.now(UTC) + schedule_interval_hours = schedule_interval_for_project( + payload.cadence, + payload.schedule_interval_hours, + ) project = ResearchProject( name=payload.name, description=payload.description or None, @@ -421,9 +429,9 @@ def _create_project(db: Session, request: Mapping[str, Any]) -> dict[str, Any]: query=payload.query, limit=payload.limit, cadence=payload.cadence, - schedule_interval_hours=payload.schedule_interval_hours, + schedule_interval_hours=schedule_interval_hours, next_run_at=( - next_run_at_from(now, payload.cadence, payload.schedule_interval_hours) + next_run_at_from(now, payload.cadence, schedule_interval_hours) if payload.enabled else None ), @@ -491,6 +499,11 @@ def _update_project(db: Session, request: Mapping[str, Any]) -> dict[str, Any]: project.cadence = payload.cadence if "schedule_interval_hours" in supplied: project.schedule_interval_hours = payload.schedule_interval_hours + if supplied & {"cadence", "schedule_interval_hours"}: + project.schedule_interval_hours = schedule_interval_for_project( + project.cadence, + project.schedule_interval_hours, + ) if "labels" in supplied: if payload.labels is None: raise _invalid_request() diff --git a/apps/api/app/services/opportunity_threads/service.py b/apps/api/app/services/opportunity_threads/service.py index 4a1b038..df0f256 100644 --- a/apps/api/app/services/opportunity_threads/service.py +++ b/apps/api/app/services/opportunity_threads/service.py @@ -13,6 +13,7 @@ from sqlalchemy.orm import Session from app.models.all_models import ( + BuildPacket, Cluster, ClusterItem, NormalizedItem, @@ -549,6 +550,10 @@ def detach_snapshot( ) if snapshot.match_method not in {"exact_evidence", "weighted_similarity"}: raise DetachNotAllowed("Only automatically matched snapshots can be detached.") + if db.scalar(select(BuildPacket.id).where(BuildPacket.snapshot_id == snapshot.id).limit(1)): + raise DetachNotAllowed( + "Snapshot has an immutable build packet and cannot be detached." + ) existing_snapshots = list( db.scalars( select(Opportunity) diff --git a/apps/api/app/services/research_projects/service.py b/apps/api/app/services/research_projects/service.py index c30c816..42b911c 100644 --- a/apps/api/app/services/research_projects/service.py +++ b/apps/api/app/services/research_projects/service.py @@ -14,13 +14,23 @@ } +def schedule_interval_for_project( + cadence: str, + explicit_interval: int | None, +) -> int | None: + if cadence.strip().lower() != "custom" or explicit_interval is None: + return None + return max(1, min(24 * 31, explicit_interval)) + + def interval_hours_for_project( cadence: str, explicit_interval: int | None, ) -> int | None: - if explicit_interval: - return max(1, min(24 * 31, explicit_interval)) - return CADENCE_INTERVAL_HOURS.get(cadence.strip().lower()) + normalized_cadence = cadence.strip().lower() + if normalized_cadence == "custom": + return schedule_interval_for_project(cadence, explicit_interval) + return CADENCE_INTERVAL_HOURS.get(normalized_cadence) def next_run_at_from( diff --git a/apps/api/pyproject.toml b/apps/api/pyproject.toml index 0286318..d1b6bab 100644 --- a/apps/api/pyproject.toml +++ b/apps/api/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "tasksignal" -version = "1.0.0a1" +version = "1.0.0a3" description = "FastAPI backend for TaskSignal, an AI-assisted problem discovery engine." readme = "README.md" requires-python = ">=3.11,<3.15" diff --git a/apps/api/tests/test_api.py b/apps/api/tests/test_api.py index 5f412b6..b7bcec0 100644 --- a/apps/api/tests/test_api.py +++ b/apps/api/tests/test_api.py @@ -157,6 +157,7 @@ def test_readiness_reports_workspace_state_without_secret_values(client, monkeyp assert payload["status"] == "ready" assert payload["checks"]["ready_sources"] assert payload["checks"]["codex_task_packs"] is True + assert payload["checks"]["build_packets"] == 0 assert payload["checks"]["operator_scan_token_configured"] is True assert "do-not-leak" not in json.dumps(payload) @@ -247,6 +248,11 @@ def test_source_registry_mutations_require_operator_token(client, monkeypatch) - headers={"X-Operator-Scan-Token": "wrong"}, json=payload, ) + malformed_token = client.post( + "/api/sources", + headers=[(b"x-operator-scan-token", b"\xff")], + json=payload, + ) created = client.post( "/api/sources", headers={"X-Operator-Scan-Token": "test-operator-token"}, @@ -255,6 +261,7 @@ def test_source_registry_mutations_require_operator_token(client, monkeypatch) - assert missing_token.status_code == 403 assert bad_token.status_code == 403 + assert malformed_token.status_code == 403 assert created.status_code == 200 assert created.json()["name"] == "Custom HN" assert created.json()["config_json"] == {} @@ -425,6 +432,41 @@ def test_due_research_project_run_advances_schedule(client) -> None: assert saved["run_count"] == 1 +def test_manual_cadence_ignores_stale_custom_interval(client) -> None: + created = client.post( + "/api/v1/research-projects", + json={ + "name": "Manual research", + "source_type": "fixture", + "query": "", + "limit": 20, + "cadence": "manual", + "schedule_interval_hours": 1, + "labels": [], + "enabled": True, + }, + ) + + assert created.status_code == 200 + assert created.json()["schedule_interval_hours"] is None + assert created.json()["next_run_at"] is None + + custom = client.patch( + f"/api/v1/research-projects/{created.json()['id']}", + json={"cadence": "custom", "schedule_interval_hours": 1}, + ) + assert custom.status_code == 200 + assert custom.json()["next_run_at"] is not None + + manual = client.patch( + f"/api/v1/research-projects/{created.json()['id']}", + json={"cadence": "manual"}, + ) + assert manual.status_code == 200 + assert manual.json()["schedule_interval_hours"] is None + assert manual.json()["next_run_at"] is None + + def test_due_credentialed_research_project_skips_without_operator_token(client) -> None: create_response = client.post( "/api/research-projects", @@ -534,6 +576,20 @@ def test_process_demo_reset_accepts_configured_token(client, monkeypatch) -> Non assert response.json()["opportunities_created"] >= 5 +def test_process_demo_reset_rejects_non_ascii_token(client, monkeypatch) -> None: + monkeypatch.setattr(routes.settings, "demo_reset_token", "test-reset-token") + + response = client.post( + "/api/process/demo?reset=true", + headers=[(b"x-demo-reset-token", b"\xff")], + ) + + assert response.status_code == 403 + assert response.json() == { + "detail": "Demo reset requires a valid X-Demo-Reset-Token header" + } + + def test_regenerate_opportunity_rebuilds_prompt_from_evidence(client) -> None: client.post("/api/process/demo") opportunity = client.get("/api/opportunities").json()[0] diff --git a/apps/api/tests/test_build_packets_api.py b/apps/api/tests/test_build_packets_api.py index e373643..2774f0f 100644 --- a/apps/api/tests/test_build_packets_api.py +++ b/apps/api/tests/test_build_packets_api.py @@ -102,6 +102,9 @@ def test_build_packet_requires_ready_build_candidate_and_is_immutable_downloadab ) assert created.status_code == 201, created.text packet = created.json() + readiness = client.get("/api/v1/readiness") + assert readiness.status_code == 200 + assert readiness.json()["checks"]["build_packets"] == 1 assert packet["generation_mode"] == "deterministic" assert packet["thread_id"] == thread["id"] assert packet["snapshot_id"] == thread["current_snapshot"]["id"] @@ -352,6 +355,36 @@ def test_regenerated_snapshot_keeps_packet_run_lineage(client, monkeypatch) -> N assert all(row["scan_ids"] for row in evidence_rows) +def test_snapshot_with_immutable_packet_cannot_be_detached(client, monkeypatch) -> None: + thread, evidence = create_packet_candidate(client, monkeypatch) + assert client.post( + "/api/v1/labels", + json={"item_id": evidence[0]["id"], "label": "true_signal"}, + ).status_code == 200 + assert client.post( + f"/api/v1/research-projects/{thread['project_id']}/run" + ).status_code == 200 + current = client.get(f"/api/v1/opportunity-threads/{thread['id']}").json() + snapshot_id = current["current_snapshot"]["id"] + assert current["current_snapshot"]["match_method"] == "exact_evidence" + + packet = client.post( + f"/api/v1/opportunity-threads/{thread['id']}/build-packets", + json={"expected_version": current["version"]}, + ) + assert packet.status_code == 201, packet.text + + detached = client.post( + f"/api/v1/opportunity-threads/{thread['id']}/snapshots/{snapshot_id}/detach", + json={"expected_version": current["version"]}, + ) + assert detached.status_code == 409 + assert "immutable build packet" in detached.json()["detail"] + unchanged = client.get(f"/api/v1/opportunity-threads/{thread['id']}").json() + assert unchanged["current_snapshot"]["id"] == snapshot_id + assert unchanged["snapshot_count"] == 2 + + def test_packet_uses_state_decision_not_latest_detach_event(client, monkeypatch) -> None: thread, evidence = create_packet_candidate(client, monkeypatch) assert client.post( diff --git a/apps/api/tests/test_opportunity_threads_api.py b/apps/api/tests/test_opportunity_threads_api.py index 6c2dad9..ad979c8 100644 --- a/apps/api/tests/test_opportunity_threads_api.py +++ b/apps/api/tests/test_opportunity_threads_api.py @@ -385,6 +385,17 @@ def test_regenerate_and_enhance_apply_create_new_immutable_snapshots(client, mon assert detail["current_snapshot"]["match_method"] == "enhanced" assert detail["current_snapshot"]["generated_prompt"].endswith("Enhanced.") + repeated = client.post( + f"/api/v1/opportunities/{original['id']}/enhance?apply=true", + headers={"X-Operator-Scan-Token": "test-token"}, + ) + assert repeated.status_code == 200 + detail = client.get(f"/api/v1/opportunity-threads/{thread['id']}").json() + assert detail["snapshot_count"] == 4 + assert detail["current_snapshot"]["generated_prompt"].endswith( + "Enhanced.\n\nEnhanced." + ) + def test_legacy_prompt_artifacts_resolve_the_latest_snapshot_consistently( client, diff --git a/apps/api/tests/test_version.py b/apps/api/tests/test_version.py index 54670f9..b4d8ee3 100644 --- a/apps/api/tests/test_version.py +++ b/apps/api/tests/test_version.py @@ -9,4 +9,4 @@ def missing_distribution(_distribution: str) -> str: monkeypatch.setattr(version_module, "version", missing_distribution) - assert version_module.installed_tasksignal_version() == "1.0.0a1" + assert version_module.installed_tasksignal_version() == "1.0.0a3" diff --git a/apps/api/uv.lock b/apps/api/uv.lock index 6eeacb2..0875f30 100644 --- a/apps/api/uv.lock +++ b/apps/api/uv.lock @@ -1,13 +1,13 @@ version = 1 -revision = 3 +revision = 5 requires-python = ">=3.11, <3.15" resolution-markers = [ "python_full_version >= '3.14' and sys_platform == 'win32'", "python_full_version >= '3.14' and sys_platform != 'win32'", "python_full_version >= '3.12' and python_full_version < '3.14' and sys_platform == 'win32'", - "python_full_version < '3.12' and sys_platform == 'win32'", "python_full_version >= '3.12' and python_full_version < '3.14' and sys_platform == 'emscripten'", "python_full_version >= '3.12' and python_full_version < '3.14' and sys_platform != 'emscripten' and sys_platform != 'win32'", + "python_full_version < '3.12' and sys_platform == 'win32'", "python_full_version < '3.12' and sys_platform != 'win32'", ] @@ -315,7 +315,7 @@ name = "cuda-bindings" version = "13.3.1" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "cuda-pathfinder", marker = "(python_full_version < '3.12' and sys_platform == 'emscripten') or (python_full_version >= '3.14' and sys_platform == 'emscripten') or (sys_platform != 'emscripten' and sys_platform != 'win32')" }, + { name = "cuda-pathfinder" }, ] wheels = [ { url = "https://files.pythonhosted.org/packages/51/6b/457ca12dad3ee9bfcc9a545cfd6b64b359ba49de40f776f6e028e678f262/cuda_bindings-13.3.1-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c5879712accf6e14bb01aa5e67440eb84998b8d104b509cc7a6dc0b8f656a474", size = 6053539, upload-time = "2026-05-29T23:11:43.19Z" }, @@ -348,34 +348,34 @@ wheels = [ [package.optional-dependencies] cudart = [ - { name = "nvidia-cuda-runtime", marker = "sys_platform == 'linux'" }, + { name = "nvidia-cuda-runtime" }, ] cufft = [ - { name = "nvidia-cufft", marker = "sys_platform == 'linux'" }, + { name = "nvidia-cufft" }, ] cufile = [ - { name = "nvidia-cufile", marker = "sys_platform == 'linux'" }, + { name = "nvidia-cufile" }, ] cupti = [ - { name = "nvidia-cuda-cupti", marker = "sys_platform == 'linux'" }, + { name = "nvidia-cuda-cupti" }, ] curand = [ - { name = "nvidia-curand", marker = "sys_platform == 'linux'" }, + { name = "nvidia-curand" }, ] cusolver = [ - { name = "nvidia-cusolver", marker = "sys_platform == 'linux'" }, + { name = "nvidia-cusolver" }, ] cusparse = [ - { name = "nvidia-cusparse", marker = "sys_platform == 'linux'" }, + { name = "nvidia-cusparse" }, ] nvjitlink = [ - { name = "nvidia-nvjitlink", marker = "sys_platform == 'linux'" }, + { name = "nvidia-nvjitlink" }, ] nvrtc = [ - { name = "nvidia-cuda-nvrtc", marker = "sys_platform == 'linux'" }, + { name = "nvidia-cuda-nvrtc" }, ] nvtx = [ - { name = "nvidia-nvtx", marker = "sys_platform == 'linux'" }, + { name = "nvidia-nvtx" }, ] [[package]] @@ -473,8 +473,8 @@ name = "httpcore2" version = "2.16.2" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "h11", marker = "python_full_version < '3.12' or python_full_version >= '3.14' or sys_platform != 'emscripten'" }, - { name = "truststore", marker = "python_full_version < '3.12' or python_full_version >= '3.14' or sys_platform != 'emscripten'" }, + { name = "h11" }, + { name = "truststore" }, ] sdist = { url = "https://files.pythonhosted.org/packages/92/9d/df40b41f7db0370f82019820709244e7b660c52aa3da3c9e5c4e8141f6e6/httpcore2-2.16.2.tar.gz", hash = "sha256:6c519d0f7b44f7269fa9bbb4d2763db395a4a2370f046d8e8e0a4b38227815d2", size = 70064, upload-time = "2026-11-16T10:12:19.491Z" } wheels = [ @@ -1147,7 +1147,7 @@ name = "nvidia-cublas" version = "13.1.1.3" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "nvidia-cuda-nvrtc", marker = "(python_full_version < '3.12' and sys_platform == 'emscripten') or (python_full_version >= '3.14' and sys_platform == 'emscripten') or (sys_platform != 'emscripten' and sys_platform != 'win32')" }, + { name = "nvidia-cuda-nvrtc" }, ] wheels = [ { url = "https://files.pythonhosted.org/packages/a7/a1/0bd24ee8c8d03adac032fd2909426a00c88f8c57961b1277ded97f91119f/nvidia_cublas-13.1.1.3-py3-none-manylinux_2_27_aarch64.whl", hash = "sha256:b7a210458267ac818974c53038fbec2e969d5c99f305ab15c72522fa9f001dd5", size = 542848918, upload-time = "2026-04-08T18:46:22.985Z" }, @@ -1186,7 +1186,7 @@ name = "nvidia-cudnn-cu13" version = "9.20.0.48" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "nvidia-cublas", marker = "(python_full_version < '3.12' and sys_platform == 'emscripten') or (python_full_version >= '3.14' and sys_platform == 'emscripten') or (sys_platform != 'emscripten' and sys_platform != 'win32')" }, + { name = "nvidia-cublas" }, ] wheels = [ { url = "https://files.pythonhosted.org/packages/56/c5/83384d846b2fd17c44bd499b36c75a45ed4f095fbbb2252294e89cea5c5c/nvidia_cudnn_cu13-9.20.0.48-py3-none-manylinux_2_27_aarch64.whl", hash = "sha256:e31454ae00094b0c55319d9d15b6fa2fc50a9e1c0f5c8c80fb75258234e731e1", size = 444574296, upload-time = "2026-03-09T19:28:27.751Z" }, @@ -1198,7 +1198,7 @@ name = "nvidia-cufft" version = "12.0.0.61" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "nvidia-nvjitlink", marker = "(python_full_version < '3.12' and sys_platform == 'emscripten') or (python_full_version >= '3.14' and sys_platform == 'emscripten') or (sys_platform != 'emscripten' and sys_platform != 'win32')" }, + { name = "nvidia-nvjitlink" }, ] wheels = [ { url = "https://files.pythonhosted.org/packages/8b/ae/f417a75c0259e85c1d2f83ca4e960289a5f814ed0cea74d18c353d3e989d/nvidia_cufft-12.0.0.61-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:2708c852ef8cd89d1d2068bdbece0aa188813a0c934db3779b9b1faa8442e5f5", size = 214053554, upload-time = "2025-09-04T08:31:38.196Z" }, @@ -1228,9 +1228,9 @@ name = "nvidia-cusolver" version = "12.0.4.66" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "nvidia-cublas", marker = "(python_full_version < '3.12' and sys_platform == 'emscripten') or (python_full_version >= '3.14' and sys_platform == 'emscripten') or (sys_platform != 'emscripten' and sys_platform != 'win32')" }, - { name = "nvidia-cusparse", marker = "(python_full_version < '3.12' and sys_platform == 'emscripten') or (python_full_version >= '3.14' and sys_platform == 'emscripten') or (sys_platform != 'emscripten' and sys_platform != 'win32')" }, - { name = "nvidia-nvjitlink", marker = "(python_full_version < '3.12' and sys_platform == 'emscripten') or (python_full_version >= '3.14' and sys_platform == 'emscripten') or (sys_platform != 'emscripten' and sys_platform != 'win32')" }, + { name = "nvidia-cublas" }, + { name = "nvidia-cusparse" }, + { name = "nvidia-nvjitlink" }, ] wheels = [ { url = "https://files.pythonhosted.org/packages/c8/c3/b30c9e935fc01e3da443ec0116ed1b2a009bb867f5324d3f2d7e533e776b/nvidia_cusolver-12.0.4.66-py3-none-manylinux_2_27_aarch64.whl", hash = "sha256:02c2457eaa9e39de20f880f4bd8820e6a1cfb9f9a34f820eb12a155aa5bc92d2", size = 223467760, upload-time = "2025-09-04T08:33:04.222Z" }, @@ -1242,7 +1242,7 @@ name = "nvidia-cusparse" version = "12.6.3.3" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "nvidia-nvjitlink", marker = "(python_full_version < '3.12' and sys_platform == 'emscripten') or (python_full_version >= '3.14' and sys_platform == 'emscripten') or (sys_platform != 'emscripten' and sys_platform != 'win32')" }, + { name = "nvidia-nvjitlink" }, ] wheels = [ { url = "https://files.pythonhosted.org/packages/f8/94/5c26f33738ae35276672f12615a64bd008ed5be6d1ebcb23579285d960a9/nvidia_cusparse-12.6.3.3-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:80bcc4662f23f1054ee334a15c72b8940402975e0eab63178fc7e670aa59472c", size = 162155568, upload-time = "2025-09-04T08:33:42.864Z" }, @@ -2243,7 +2243,7 @@ wheels = [ [[package]] name = "tasksignal" -version = "1.0.0a1" +version = "1.0.0a3" source = { editable = "." } dependencies = [ { name = "alembic" }, diff --git a/apps/web/package-lock.json b/apps/web/package-lock.json index 9567eb5..32a2a5a 100644 --- a/apps/web/package-lock.json +++ b/apps/web/package-lock.json @@ -1,12 +1,12 @@ { "name": "tasksignal-web", - "version": "1.0.0-alpha.1", + "version": "1.0.0-alpha.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "tasksignal-web", - "version": "1.0.0-alpha.1", + "version": "1.0.0-alpha.3", "dependencies": { "@tanstack/react-query": "^5.108.0", "clsx": "^2.1.1", diff --git a/apps/web/package.json b/apps/web/package.json index bba14ed..2fd154f 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -1,6 +1,6 @@ { "name": "tasksignal-web", - "version": "1.0.0-alpha.1", + "version": "1.0.0-alpha.3", "private": true, "scripts": { "dev": "next dev -H 127.0.0.1", diff --git a/apps/web/src/app/dashboard/page.tsx b/apps/web/src/app/dashboard/page.tsx index 4eb8f6f..44369ec 100644 --- a/apps/web/src/app/dashboard/page.tsx +++ b/apps/web/src/app/dashboard/page.tsx @@ -1,9 +1,16 @@ +import { Suspense } from "react"; import { Dashboard } from "@/features/dashboard"; export default function DashboardPage() { return ( - <> + + Preparing decision queue… + + } + > - + ); } diff --git a/apps/web/src/app/error.tsx b/apps/web/src/app/error.tsx new file mode 100644 index 0000000..1378abd --- /dev/null +++ b/apps/web/src/app/error.tsx @@ -0,0 +1,37 @@ +"use client"; + +import Link from "next/link"; +import { RefreshCw } from "lucide-react"; +import { Button } from "@/components/ui"; + +export default function ErrorPage({ + reset, +}: { + error: Error & { digest?: string }; + reset: () => void; +}) { + return ( +
+

Something interrupted this page

+

+ Let’s get your research back on screen. +

+

+ This page could not finish loading. Try opening it again, or return to + the workspace and choose another view. +

+
+ + + Back to workspace + +
+
+ ); +} diff --git a/apps/web/src/app/globals.css b/apps/web/src/app/globals.css index a1ebf97..dd417df 100644 --- a/apps/web/src/app/globals.css +++ b/apps/web/src/app/globals.css @@ -1,5 +1,3 @@ -/* Hallmark · macrostructure: Workbench · tone: technical utilitarian research-grade · anchor hue: teal · genre: modern-minimal · theme: TaskSignal locked · enrichment: none · nav: existing product side navigation · footer: none · contrast: pass (40–41) · slop: pass (2–58) · exception: gate 1 preserves DESIGN.md system sans · honest: pass (46) · chrome: pass (47) · tokens: pass (48) · responsive: pass (49) · icons: pass (30) · mobile: pass (34, 49, 50–57) */ -/* Hallmark · pre-emit critique: P5 H5 E4 S5 R5 V4 */ @import "./tokens.css"; @tailwind base; @@ -85,3 +83,208 @@ p { .prose h3 { color: var(--ts-text); } + +/* A quiet hierarchy shared by all research screens. */ +a:focus-visible, +summary:focus-visible { + outline: 2px solid var(--ts-focus-ring); + outline-offset: 3px; +} + +.eyebrow { + font-size: 0.6875rem; + font-weight: 650; + letter-spacing: 0.12em; + text-transform: uppercase; +} + +.home-hero { + background: linear-gradient( + 115deg, + var(--color-paper-2), + var(--color-accent-soft) + ); +} + +.command-dialog::backdrop { + background: oklch(25% 0.037 258 / 0.3); + backdrop-filter: blur(3px); +} + +.command-dialog[open] { + animation: dialog-enter var(--dur-short) var(--ease-out); +} + +@keyframes dialog-enter { + from { + opacity: 0; + transform: translateY(-8px); + } + to { + opacity: 1; + transform: translateY(0); + } +} + +@media (prefers-reduced-motion: no-preference) { + a { + transition: + color var(--dur-micro), + background-color var(--dur-micro); + } +} + +/* Hallmark · genre: modern-minimal · macrostructure: Workbench · design-system: DESIGN.md · designed-as-app */ +/* Alpha 3 keeps the established palette. Content, state and task order carry the design. */ +.workspace-metrics { + display: grid; + grid-template-columns: repeat(4, minmax(0, 1fr)); + padding-block: var(--space-sm) var(--space-lg); + border-bottom: var(--rule-hair) solid var(--color-rule); +} +.workspace-metrics > div { + padding-inline: var(--space-md); + border-left: var(--rule-hair) solid var(--color-rule); +} +.workspace-metrics > div:first-child { + border-left: 0; + padding-left: 0; +} +.attention-list { + border-block: var(--rule-hair) solid var(--color-rule); +} +.attention-item { + display: flex; + gap: var(--space-md); + justify-content: space-between; + padding: var(--space-md) var(--space-sm); + background: var(--color-paper-2); +} +.attention-item + .attention-item { + border-top: var(--rule-hair) solid var(--color-rule); +} +.attention-item:hover { + background: var(--color-paper-3); +} +.focus-view { + display: flex; + align-items: center; + justify-content: space-between; + gap: var(--space-md); + padding-block: var(--space-sm); + border-radius: var(--radius-card); +} +.onboarding-panel { + display: grid; + grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); + gap: var(--space-2xl); + padding: var(--space-lg); + border: var(--rule-hair) solid var(--color-rule); + border-radius: var(--radius-card); + background: var(--color-paper-2); +} +.onboarding-steps { + display: grid; + align-content: center; + gap: var(--space-md); +} +.onboarding-steps li { + display: flex; + align-items: flex-start; + gap: var(--space-sm); +} +.step-index { + display: grid; + place-items: center; + flex-shrink: 0; + width: 1.75rem; + height: 1.75rem; + border-radius: var(--radius-pill); + background: var(--color-accent-soft); + color: var(--color-accent); + font-size: var(--text-xs); + font-weight: 600; +} +.queue-column-head, +.queue-row { + display: grid; + grid-template-columns: minmax(0, 1fr) 140px 110px 80px; + gap: var(--space-md); +} +.queue-column-head { + padding-block: var(--space-xs); + border-bottom: var(--rule-hair) solid var(--color-rule); + font-size: var(--text-xs); + font-weight: 600; + color: var(--color-muted); +} +.queue-row { + padding-block: var(--space-md) var(--space-xs); + border-bottom: var(--rule-hair) solid var(--color-rule); +} +.queue-row:last-child { + border-bottom: 0; +} +.queue-title { + font-size: var(--text-base); + font-weight: 600; + line-height: 1.5; +} +.queue-title:hover { + color: var(--color-accent); +} +.queue-cell { + min-width: 0; +} +.queue-mobile-label { + display: none; +} +.queue-details { + grid-column: 1 / -1; + border-top: var(--rule-hair) solid var(--color-rule); +} +input, +textarea { + caret-color: var(--color-accent); +} +@media (max-width: 1279px) { + .queue-column-head, + .queue-row { + grid-template-columns: minmax(0, 1fr) 115px 96px 72px; + gap: var(--space-sm); + } +} +@media (max-width: 767px) { + .workspace-metrics { + grid-template-columns: repeat(2, minmax(0, 1fr)); + row-gap: var(--space-md); + } + .workspace-metrics > div:nth-child(3) { + border-left: 0; + padding-left: 0; + } + .onboarding-panel { + grid-template-columns: minmax(0, 1fr); + gap: var(--space-lg); + padding: var(--space-md); + } + .queue-column-head { + display: none; + } + .queue-row { + grid-template-columns: repeat(3, minmax(0, 1fr)); + gap: var(--space-sm); + } + .queue-row > div:first-child { + grid-column: 1 / -1; + } + .queue-mobile-label { + display: block; + margin-bottom: var(--space-2xs); + font-size: var(--text-xs); + color: var(--color-muted); + } + .queue-cell { + padding-top: var(--space-2xs); + } +} diff --git a/apps/web/src/app/layout.tsx b/apps/web/src/app/layout.tsx index 1aa8340..be911f6 100644 --- a/apps/web/src/app/layout.tsx +++ b/apps/web/src/app/layout.tsx @@ -4,8 +4,12 @@ import { AppShell } from "@/components/app-shell"; import { QueryProvider } from "@/components/query-provider"; export const metadata: Metadata = { - title: "TaskSignal", - description: "AI Problem Discovery Engine", + title: { + default: "TaskSignal · Research workbench", + template: "%s · TaskSignal", + }, + description: + "Find software opportunities in public evidence, review the signals, and build with context. A local-first research workbench.", }; export const viewport: Viewport = { diff --git a/apps/web/src/app/not-found.tsx b/apps/web/src/app/not-found.tsx new file mode 100644 index 0000000..b22ea0e --- /dev/null +++ b/apps/web/src/app/not-found.tsx @@ -0,0 +1,27 @@ +import { ArrowLeft, Search } from "lucide-react"; +import { ButtonLink } from "@/components/ui"; + +export default function NotFound() { + return ( +
+

Page not found · 404

+

+ This path ends here. +

+

+ The page may have moved, or the address may be incomplete. Return to + your workspace or search the evidence to pick up your research. +

+
+ + + Back to workspace + + + + Search evidence + +
+
+ ); +} diff --git a/apps/web/src/app/page.tsx b/apps/web/src/app/page.tsx index 17c7e6e..2389777 100644 --- a/apps/web/src/app/page.tsx +++ b/apps/web/src/app/page.tsx @@ -1,157 +1,5 @@ -import Link from "next/link"; -import { - ArrowRight, - ClipboardCheck, - FileText, - Layers3, - Search, -} from "lucide-react"; -import { Badge, ButtonLink, Card, PageHeader } from "@/components/ui"; +import { WorkspaceHome } from "@/features/workspace-home"; -const examples = [ - { - title: "AI-generated code needs production-readiness audits", - source: "GitHub Issues", - output: "Fixture opportunity", - }, - { - title: "Developers need clearer GitHub Actions failure diagnosis", - source: "Hacker News", - output: "Fixture opportunity", - }, - { - title: "Operators need spreadsheet-to-client-report automation", - source: "Fixture data", - output: "Fixture opportunity", - }, -]; - -const workflow = [ - { - title: "Set the local workspace", - description: - "Store your research focus, default source, query, and cadence on this machine.", - icon: Layers3, - }, - { - title: "Save and run projects", - description: - "Use public APIs by default, then add operator-gated credentials only when needed.", - icon: ClipboardCheck, - }, - { - title: "Export a task pack", - description: - "Carry evidence, acceptance criteria, and privacy constraints into Codex or another agent.", - icon: FileText, - }, -]; - -export default function LandingPage() { - return ( - <> -
- - Start setup - - Open dashboard - - - } - /> - -
- -
-
-

Start here

-

- Real local workflow -

-
- No paid LLM required -
-
- {workflow.map((step, index) => ( -
- - - -
-

- {index + 1}. {step.title} -

-

- {step.description} -

-
-
- ))} -
-
- - Configure workspace - - - Save a project - -
-
- - -
-
-

- Demo output -

-

- Fixture opportunities -

-
- Generated after processing fixtures -
-
- {examples.map((example) => ( -
-
-

- {example.title} -

-

- Top source: {example.source} -

-
-
- {example.output} -
-
- ))} -
- - Review ranked evidence - -
-
-
- - ); +export default function HomePage() { + return ; } diff --git a/apps/web/src/app/search/page.tsx b/apps/web/src/app/search/page.tsx index 902587f..3cb3b4e 100644 --- a/apps/web/src/app/search/page.tsx +++ b/apps/web/src/app/search/page.tsx @@ -1,9 +1,16 @@ +import { Suspense } from "react"; import { SemanticSearch } from "@/features/search"; export default function SearchPage() { return ( - <> + + Preparing evidence search… + + } + > - + ); } diff --git a/apps/web/src/app/settings/page.tsx b/apps/web/src/app/settings/page.tsx index 1f6b892..217a02b 100644 --- a/apps/web/src/app/settings/page.tsx +++ b/apps/web/src/app/settings/page.tsx @@ -21,6 +21,7 @@ import { StateMessage, } from "@/components/ui"; import { api } from "@/lib/api"; +import { apiErrorMessage as errorMessage } from "@/lib/api-error"; import type { Integration } from "@/lib/types"; const sourceOptions = [ @@ -39,22 +40,6 @@ const cadenceOptions = [ { value: "custom", label: "Custom" }, ]; -function errorMessage(error: unknown) { - if (error instanceof Error) { - try { - const parsed = JSON.parse(error.message); - if (parsed?.detail) { - return typeof parsed.detail === "string" - ? parsed.detail - : JSON.stringify(parsed.detail); - } - } catch { - return error.message; - } - } - return "The request failed."; -} - function statusTone( status: string, ): "green" | "amber" | "blue" | "red" | "slate" { @@ -160,10 +145,22 @@ export default function SettingsPage() {
- - {localWorkspace.data?.configured - ? "Local user set" - : "Local user not set"} + + {localWorkspace.isLoading + ? "Loading local profile" + : localWorkspace.isError && !localWorkspace.data + ? "Local profile unavailable" + : localWorkspace.data?.configured + ? "Local user set" + : "Local user not set"} Single-machine workspace
@@ -175,7 +172,12 @@ export default function SettingsPage() { type="submit" variant="secondary" loading={saveWorkspace.isPending} - disabled={saveWorkspace.isPending} + disabled={saveWorkspace.isPending || !localWorkspace.data} + title={ + localWorkspace.data + ? undefined + : "The saved profile must load before it can be replaced." + } > {saveWorkspace.isPending ? ( @@ -298,6 +300,26 @@ export default function SettingsPage() { + {localWorkspace.error ? ( + void localWorkspace.refetch()} + loading={localWorkspace.isFetching} + disabled={localWorkspace.isFetching} + > + {localWorkspace.isFetching ? "Retrying" : "Retry"} + + } + > + {errorMessage(localWorkspace.error)} Saving stays disabled so an + unseen profile is not overwritten. + + ) : null} {saveWorkspace.error ? ( {errorMessage(saveWorkspace.error)} @@ -339,6 +361,25 @@ export default function SettingsPage() {
+ {readiness.error ? ( + void readiness.refetch()} + loading={readiness.isFetching} + disabled={readiness.isFetching} + > + {readiness.isFetching ? "Retrying" : "Retry"} + + } + > + {errorMessage(readiness.error)} + + ) : null} {readiness.data ? (
@@ -434,8 +475,34 @@ export default function SettingsPage() { ) : null} {integrations.error ? ( - - {errorMessage(integrations.error)} + void integrations.refetch()} + loading={integrations.isFetching} + disabled={integrations.isFetching} + > + + {integrations.isFetching ? "Retrying" : "Retry"} + + } + > + {errorMessage(integrations.error)}{" "} + {integrations.data + ? "The last loaded connector status stays below until a retry succeeds." + : "Check that the local API is running, then retry."} ) : null} {integrations.isLoading ? ( @@ -561,7 +628,9 @@ function ReadinessCheck({

{label}

- {done ? "Ready" : "Needed"} + + {done ? "Ready" : "Needed"} +

{detail}

diff --git a/apps/web/src/app/tokens.css b/apps/web/src/app/tokens.css index 8e44ba3..bfe7477 100644 --- a/apps/web/src/app/tokens.css +++ b/apps/web/src/app/tokens.css @@ -1,7 +1,6 @@ -/* Hallmark · macrostructure: Workbench · tone: technical utilitarian research-grade · anchor hue: teal · genre: modern-minimal · theme: TaskSignal locked · enrichment: none · nav: existing product side navigation · footer: none · contrast: pass (40–41) · slop: pass (2–58) · exception: gate 1 preserves DESIGN.md system sans · honest: pass (46) · chrome: pass (47) · tokens: pass (48) · responsive: pass (49) · icons: pass (30) · mobile: pass (34, 49, 50–57) */ -/* Hallmark · pre-emit critique: P5 H5 E4 S5 R5 V4 */ :root { /* Core colour system */ + --color-sidebar: oklch(98.3% 0.007 255); --color-paper: oklch(97% 0.007 255); --color-paper-2: oklch(99% 0.004 255); --color-paper-3: oklch(95.8% 0.01 255); diff --git a/apps/web/src/components/app-shell.tsx b/apps/web/src/components/app-shell.tsx index 6155481..53c6f8f 100644 --- a/apps/web/src/components/app-shell.tsx +++ b/apps/web/src/components/app-shell.tsx @@ -24,6 +24,7 @@ import { } from "lucide-react"; import { api } from "../lib/api"; import { Button, Input } from "./ui"; +import { CommandMenu } from "./command-menu"; const NAV_ICON_CLASS = "h-[18px] w-[18px] shrink-0"; @@ -35,7 +36,7 @@ const navGroups: { label: "Research", items: [ { href: "/", label: "Home", icon: Home }, - { href: "/dashboard", label: "Dashboard", icon: BarChart3 }, + { href: "/dashboard", label: "Decision queue", icon: BarChart3 }, { href: "/evaluation", label: "Evaluation", icon: ClipboardCheck }, ], }, @@ -51,7 +52,7 @@ const navGroups: { { label: "Tools", items: [ - { href: "/search", label: "Search", icon: Search }, + { href: "/search", label: "Evidence search", icon: Search }, { href: "/sessions", label: "Agent sessions", icon: ShieldCheck }, { href: "/settings", label: "Integrations", icon: Settings }, ], @@ -144,7 +145,7 @@ function BrandMark({ compact = false }: { compact?: boolean }) { {!compact ? ( - Problem discovery engine + Research workbench ) : null} @@ -227,7 +228,7 @@ export function AppShell({ children }: { children: ReactNode }) { } return ( -
+
-