stemedb/applications/aphoria/Cargo.toml
jml bb0c33f8d3 fix(api): enable querying of CLI-created community corpus items
## 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>
2026-02-09 15:54:35 +00:00

95 lines
2.0 KiB
TOML

[package]
name = "aphoria"
version = "0.1.0"
edition = "2021"
description = "A code-level truth linter powered by Episteme"
authors = ["Orchard9"]
license = "MIT"
[[bin]]
name = "aphoria"
path = "src/main.rs"
[lib]
name = "aphoria"
path = "src/lib.rs"
# Use workspace lints with CLI overrides
[lints]
workspace = true
[dependencies]
# StemeDB dependencies (relative paths from applications/aphoria/)
stemedb-core = { path = "../../crates/stemedb-core" }
stemedb-storage = { path = "../../crates/stemedb-storage" }
stemedb-ingest = { path = "../../crates/stemedb-ingest" }
stemedb-query = { path = "../../crates/stemedb-query" }
stemedb-wal = { path = "../../crates/stemedb-wal" }
stemedb-lens = { path = "../../crates/stemedb-lens" }
# CLI
clap = { version = "4.5", features = ["derive"] }
# Async runtime
tokio = { version = "1", features = ["full"] }
# File walking
ignore = "0.4"
# Parallel extraction
rayon = "1.10"
# Pattern matching
regex = "1.10"
globset = "0.4"
# Serialization
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
serde_yaml = "0.9"
toml = "0.8"
# Output formatting
comfy-table = "7.1"
# Cryptography
ed25519-dalek = { version = "2.1", features = ["rand_core"] }
blake3 = "1.5"
rand = "0.8"
hex = "0.4"
# Error handling
thiserror = "1.0"
# Platform directories
dirs = "5.0"
shellexpand = "3.1"
# Logging
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
# rkyv for zero-copy (consistent with stemedb)
rkyv = { version = "0.7", features = ["validation"] }
bytecheck = "0.6"
# HTTP client for RFC/OWASP fetching
ureq = { version = "2.9", features = ["tls"] }
# Pattern learning
uuid = { version = "1.11", features = ["v4", "serde"] }
chrono = { version = "0.4", features = ["serde"] }
once_cell = "1.20"
# System info
whoami = "1.5"
# Observation storage for LLM evaluation
rusqlite = { version = "0.32", features = ["bundled"] }
# Async trait support for corpus builders
async-trait = "0.1"
[dev-dependencies]
tempfile = "3.10"