Introduce a unified Seed→Lineage→Event pipeline replacing per-page Python BFS with Oracle CONNECT BY NOCYCLE queries, add staged /api/trace/* endpoints with rate limiting and L2 Redis caching, and wire progressive frontend loading via useTraceProgress composable. Key changes: - Add LineageEngine (split ancestors / merge sources / full genealogy) with QueryBuilder bind-param safety and batched IN clauses - Add EventFetcher with 6-domain support and L2 Redis cache - Add trace_routes Blueprint (seed-resolve, lineage, events) with profile dispatch, rate limiting, and Redis TTL=300s caching - Refactor query_tool_service to use LineageEngine and QueryBuilder, removing raw string interpolation (SQL injection fix) - Add rate limits and resolve cache to query_tool_routes - Integrate useTraceProgress into mid-section-defect with skeleton placeholders and fade-in transitions - Add lineageCache and on-demand lot lineage to query-tool - Add TraceProgressBar shared component - Remove legacy query-tool.js static script (3k lines) - Fix MatrixTable package column truncation (.slice(0,15) removed) - Archive unified-lineage-engine change, add trace-progressive-ui specs Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1.3 KiB
1.3 KiB
ADDED Requirements
Requirement: EventFetcher SHALL provide unified cached event querying across domains
EventFetcher SHALL encapsulate batch event queries with L1/L2 layered cache and rate limit bucket configuration, supporting domains: history, materials, rejects, holds, jobs, upstream_history.
Scenario: Cache miss for event domain query
- WHEN
EventFetcheris called for a domain with container IDs and no cache exists - THEN the domain query SHALL execute against Oracle via
read_sql_df() - THEN the result SHALL be stored in L2 Redis cache with key format
evt:{domain}:{sorted_cids_hash} - THEN L1 memory cache SHALL also be populated (aligned with
core/cache.pyLayeredCache pattern)
Scenario: Cache hit for event domain query
- WHEN
EventFetcheris called for a domain and L2 Redis cache contains a valid entry - THEN the cached result SHALL be returned without executing Oracle query
- THEN DB connection pool SHALL NOT be consumed
Scenario: Rate limit bucket per domain
- WHEN
EventFetcheris used from a route handler - THEN each domain SHALL have a configurable rate limit bucket aligned with
configured_rate_limit()pattern - THEN rate limit configuration SHALL be overridable via environment variables