## Problem CLI-created community corpus items (tier 3) were stored correctly but invisible via API queries. Two issues blocked discoverability: 1. **Prefix mismatch**: API hardcoded 'community://pattern/' for aggregated patterns, but CLI creates 'community://rust/http/...' URIs 2. **Query parameter parsing**: Axum's default parser doesn't support bracket notation (?sources[]=value) used by the dashboard Result: 0/22 CLI-created items were queryable. ## Solution ### Fix 1: Broaden Community Prefix - Changed: 'community://pattern/' → 'community://' in corpus handler - Impact: Now matches both aggregated patterns AND CLI-created items - Backward compatible: Broader prefix includes narrower results ### Fix 2: Add QsQuery Extractor - Added: serde_qs dependency + custom QsQuery extractor - Supports: Bracket notation for array parameters (?sources[]=a&sources[]=b) - Compatible: Works with JavaScript URLSearchParams standard - Tested: 3 new unit tests for extractor behavior ## Verification - ✅ All 22 CLI-created community items now queryable (was 0) - ✅ Source filtering works: community (22), RFC (2), vendor (5) - ✅ Multi-source queries work: ?sources[]=community&sources[]=rfc → 24 - ✅ All 89 API tests pass + 3 new extractor tests - ✅ Clippy clean (0 warnings) - ✅ No regressions in existing functionality ## Files Changed - crates/stemedb-api/Cargo.toml: Add serde_qs dependency - crates/stemedb-api/src/extractors.rs: New QsQuery extractor (117 lines) - crates/stemedb-api/src/handlers/aphoria/corpus.rs: Use QsQuery, broaden prefix - crates/stemedb-api/src/lib.rs: Export extractors module Also includes: Scale-adaptive thresholds, wiki corpus extraction, documentation updates, and dashboard UI improvements from prior work. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| src | ||
| .gitignore | ||
| components.json | ||
| CORPUS_STATUS.md | ||
| DOCUMENTATION_INDEX.md | ||
| INTEGRATION_STATUS.md | ||
| next.config.ts | ||
| package.json | ||
| postcss.config.mjs | ||
| QUICK_REFERENCE.md | ||
| README.md | ||
| tsconfig.json | ||
Aphoria Dashboard
Code quality assurance dashboard for Aphoria - the code-level truth linter powered by Episteme.
Features
- Scans: Run and view Aphoria code scans with conflict detection
- Claims: Manage authored claims (architectural decisions, safety invariants, policy requirements)
- Corpus: Browse and filter the community corpus of authoritative sources (RFCs, OWASP, CWEs)
Quick Start
# Install dependencies
npm install
# Run development server (port 18189)
npm run dev
# Build for production
npm run build
# Start production server (port 18189)
npm start
Architecture
- Framework: Next.js 16 with App Router
- UI: TailwindCSS 4 + shadcn/ui components
- Port: 18189 (Aphoria Dashboard)
- API Integration: Proxies requests to StemeDB API at port 18180
API Integration
The dashboard uses Next.js rewrites to proxy API requests:
// All /v1/* requests are proxied to http://localhost:18180/v1/*
// This is configured in next.config.ts
Leave NEXT_PUBLIC_STEMEDB_API_URL empty in .env.local to use proxy mode.
Project Structure
src/
├── app/ # Next.js app router pages
│ ├── scans/ # Aphoria scans route
│ ├── claims/ # Claims management route
│ ├── corpus/ # Corpus browser route
│ └── layout.tsx # Root layout with Aphoria branding
├── components/
│ ├── corpus/ # Corpus browser components
│ ├── scans/ # Scans panel components
│ ├── claims/ # Claims management components
│ ├── layout/ # Sidebar, header, theme toggle
│ ├── shared/ # Shared components (error, api-status)
│ └── ui/ # shadcn/ui components
└── lib/
├── api/ # API client (includes both StemeDB + Aphoria)
└── utils.ts # Utilities
Related Projects
- Aphoria Backend:
applications/aphoria/- Rust CLI and extractor engine - StemeDB Dashboard: Port 18188 - Database admin dashboard
- StemeDB API: Port 18180 - Backend API
Development
The dashboard shares some infrastructure with StemeDB Dashboard (UI components, API client, utilities). See applications/DASHBOARD_SYNC.md for sync procedures if you update shared code.