stemedb/ai-lookup/index.md
jml 3dac3dc914 feat(aphoria): implement Day 3 debugging features and comprehensive documentation
Implements all product gaps identified in msgqueue Day 3 evaluation (VG-DAY3-001/003/004)
and adds comprehensive documentation to prevent dogfooding failures.

## Product Features (VG-DAY3-XXX)

### VG-DAY3-001: --show-observations flag (P0)
- Shows all observations with concept paths for debugging extractor alignment
- Includes claim matching analysis (/ visual feedback)
- Explains tail-path matching and why observations don't match claims
- 8 unit tests in src/report/observations.rs
- 5 integration tests in src/tests/day3_debugging.rs

### VG-DAY3-003: aphoria extractors validate (P2)
- Validates extractor subject fields match claim concept_paths
- Smart fuzzy matching suggests corrections for typos
- Clear error messages with actionable hints
- Proper exit codes (0=success, 1=validation failed)

### VG-DAY3-004: aphoria extractors test NAME --file (P2)
- Tests single extractor pattern against one file (no full scan needed)
- Shows line numbers and matched text
- Previews what observation would be created
- Helpful troubleshooting when pattern doesn't match

## Documentation (P0-P1)

### New Docs Created
- docs/extractors/declarative-extractors.md (800 lines)
  - Complete field reference with emphasis on subject field format
  - 3 worked examples (timeout=0, unbounded queue, TLS disabled)
  - Common mistakes with fixes
  - Validation workflow
  - Debugging 0% detection rate

- docs/examples/extractors/timeout-zero-example.md (500 lines)
  - End-to-end flow: code → extractor → claim → conflict → fix
  - Visual diagrams showing path alignment
  - Troubleshooting guide
  - Validation checklist

- docs/dogfooding-common-mistakes.md (560 lines)
  - Mistake #1: Skipping Day 3 extractor creation (CRITICAL)
  - Mistake #2: Creating extractors with wrong subject format (NEW)
  - Evidence from msgqueue failures
  - Recovery procedures

### Docs Updated
- dogfood/msgqueue/plan.md (Day 3 Steps 3-4)
  - Added complete manual declarative extractor TOML format
  - Added validation workflow BEFORE scanning
  - Added debug workflow for 0% detection after creating extractors

- dogfood/msgqueue/eval/ (evaluation artifacts)
  - EVALUATION-REPORT-2026-02-10.md (600 lines)
  - DOC-FIXES-2026-02-10.md (summary of fixes)
  - IMPLEMENTATION-REVIEW-2026-02-10.md (feature review)

## New Extractors
- src/extractors/ack_mode_config.rs - Detects AckMode::AutoAck violations
- src/extractors/async_blocking.rs - Detects blocking calls in async functions
- src/extractors/unbounded_resources.rs - Detects unbounded queues/connections

## Code Changes
- src/cli/mod.rs: Add --show-observations flag to scan command
- src/cli/extractors.rs: Add Validate and Test subcommands
- src/handlers/scan.rs: Call format_observations when flag enabled
- src/handlers/extractors.rs: Implement handle_validate() and handle_test()
- src/report/observations.rs: Observation formatting with claim matching analysis
- src/tests/day3_debugging.rs: Integration tests for new features

## Dogfood Artifacts
- dogfood/msgqueue/ - Complete msgqueue Day 3 evaluation with findings
- dogfood/dbpool/ - Database pool dogfooding exercise

## Impact
- Time savings: 30 min per Day 3 debugging (67% faster)
- User experience: Transparent debugging (no blind trial-and-error)
- Documentation: 1,860 new lines covering all P0-P1 gaps

## Related Issues
- Closes VG-DAY3-001 (--show-observations)
- Closes VG-DAY3-002 (concept path alignment docs)
- Closes VG-DAY3-003 (extractors validate)
- Closes VG-DAY3-004 (extractors test)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-11 03:31:06 +00:00

60 lines
3.9 KiB
Markdown

# AI Lookup Index
Token-efficient fact storage for StemeDB. Query these for quick context without loading full docs.
## Services
| Topic | File | Confidence | Updated | Summary |
|-------|------|------------|---------|---------|
| Assertion | `services/assertion.md` | High | 2025-01-31 | Core data structure for all claims |
| Ballot Box | `services/ballot-box.md` | High | 2026-01-31 | High-velocity vote storage (VoteStore) |
| Ingestor | `services/ingestor.md` | High | 2026-01-31 | WAL-to-KV background worker |
| Lens | `services/lens.md` | High | 2026-01-31 | Read-time resolution strategies (includes TrustAwareAuthority) |
| Lifecycle | `services/lifecycle.md` | High | 2026-01-31 | Proposed/Approved state machine |
| Materializer | `services/materializer.md` | High | 2026-01-31 | Background worker for O(1) reads via MV: keys |
| API Surface | `services/api.md` | High | 2026-01-31 | HTTP API with axum + utoipa OpenAPI |
| SDK | `services/sdk.md` | High | 2026-02-01 | Go client libraries (core + ADK-Go integration) |
| Storage | `services/storage.md` | High | 2026-01-31 | KV layout and write path |
## Patterns
| Topic | File | Confidence | Updated | Summary |
|-------|------|------------|---------|---------|
| ADK-Go Integration | `patterns/adk-integration.md` | High | 2026-01-31 | Tool definitions and callbacks for agents |
| Content-Addressing | `patterns/content-addressing.md` | High | 2025-01-31 | BLAKE3 hashing for immutability |
| API Documentation | `patterns/api-documentation.md` | High | 2026-01-31 | utoipa + OpenAPI + Slate DRY pipeline |
| Error Handling | `patterns/error-handling.md` | High | 2025-01-31 | thiserror + context pattern |
## Features
| Topic | File | Confidence | Updated | Summary |
|-------|------|------------|---------|---------|
| Admission Control | `features/admission-control.md` | High | 2026-02-03 | PoW-based spam protection (Phase 7A) |
| Branching | `features/branching.md` | Medium | 2025-01-31 | "Fork Reality" overlay graphs |
| Circuit Breakers | `features/circuit-breakers.md` | High | 2026-02-03 | Per-agent misbehavior isolation (Phase 7D) |
| Content Defense | `features/content-defense.md` | High | 2026-02-03 | MinHash dedup, quality scoring, quarantine (Phase 7C) |
| Gardener | `features/gardener.md` | High | 2026-01-31 | TrustRank back-propagation on errors |
| Query Audit | `features/query-audit.md` | High | 2026-01-31 | Trace agent decisions for debugging |
| TrustRank | `features/trust-rank.md` | High | 2026-01-31 | Agent reputation system with learning loop |
| Simulation | `features/simulation.md` | High | 2026-01-31 | Agent-based modeling for validation |
| Phase 6 UAT | `features/phase6-uat.md` | High | 2026-02-02 | Distributed writes UAT results and fixes |
| Aphoria Config | `features/aphoria-config.md` | High | 2026-02-04 | Configuration options including hosted mode |
| Aphoria Flywheel | `features/aphoria-flywheel.md` | High | 2026-02-10 | Practical guide: skills enforce naming, flywheel works |
| Production Readiness | `features/production-readiness.md` | High | 2026-02-05 | Verification checklist for production deployment |
## Domain Ontology
| Topic | File | Confidence | Updated | Summary |
|-------|------|------------|---------|---------|
| Adding a Domain | `../docs/guides/adding-a-domain.md` | High | 2026-02-05 | Step-by-step guide for implementing new domains |
| Ontology Crate | `../crates/stemedb-ontology/README.md` | High | 2026-02-05 | Module overview, CLI usage, architecture |
## Use Cases
See [use-cases/README.md](../use-cases/README.md) for production scenarios with Postgres Test analysis.
| Use Case | File | Pillars | Summary |
|----------|------|---------|---------|
| Financial Due Diligence | `../use-cases/financial-due-diligence.md` | All Four | M&A investigation with contradictions |
| Agile AI Agent Team | `../use-cases/agile-agent-team.md` | All Four | Agent coordination with lifecycle stages |