stemedb/.agentive-remediation/aphoria-config-access/history.md
jordan 157dbbb9eb feat: Complete Aphoria Phase 8-9 + UAT suite (90/90 tests passing)
## Phase 8: Enterprise Extractor Improvements 
- 14 security extractors (TLS, JWT, SQL injection, XSS, etc.)
- 10 framework-specific extractors (Spring, Django, Rails, etc.)
- Config file security detection (YAML, TOML)

## Phase 9: Autonomous Extractor Generation 
- Shadow mode executor with TP/FP tracking
- Graduation pipeline with confidence thresholds
- Auto-rollback on regression detection
- Cross-project pattern syncing

## UAT Suite Complete (14 scripts, 90 tests)
- test-core-detection.sh (6 tests)
- test-declarative-extractors.sh (5 tests)
- test-domain-frameworks.sh (5 tests)
- test-domain-unreal.sh (3 tests)
- test-llm-extraction.sh (6 tests)
- test-eval-harness.sh (5 tests)
- test-cross-language.sh (3 tests)
- test-precommit-performance.sh (4 tests)
- test-output-formats.sh (8 tests)
- test-drift-detection.sh (6 tests)
- test-exit-codes.sh (12 tests)
+ 3 more scripts

## Other Changes
- Updated roadmap to mark Phase 8-9 complete
- Added .gitignore entries for build artifacts
- Updated pre-commit: 800 line limit, exclude tests/data/cmd

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 22:50:55 -07:00

1.7 KiB

aphoria-config-access

AUDIT (2026-02-06)

Pattern: Config cloning vs references, no getter methods Found: 5 problematic instances across 4 files

Problematic Cloning Instances

  1. handlers/scan.rs:33-40 - Clones entire config just to modify thresholds for strict mode

    • Should use with_strict_thresholds() method or Cow pattern
  2. scan/filter.rs:54 - ClaimProcessor stores config: AphoriaConfig (owned, cloned from &)

    • Only uses config.learning.max_patterns and config.learning.min_confidence
    • Should store references or just the needed values
  3. extractors/high_entropy/mod.rs:43 - Stores config: EntropyConfig (cloned)

    • Uses thresholds for entropy checks
    • EntropyConfig is small, clone is acceptable but could be reference
  4. shadow/registry.rs:43 - Stores config: ShadowConfig (cloned)

    • Uses config for graduation criteria checks
    • ShadowConfig is small, clone is acceptable but could be reference

Deeply-Nested Access (Candidates for Helpers)

  • config.learning.promotion.output_dir - 12+ occurrences
  • config.learning.promotion.min_projects - 4+ occurrences
  • config.episteme.data_dir - 8+ occurrences
  • config.shadow.* - 10+ occurrences
  1. Add builder method on AphoriaConfig::with_strict_thresholds() to avoid clone-and-modify
  2. For structs that store config, prefer storing &'a AphoriaConfig with lifetime
  3. Add convenience getters for deeply-nested common paths:
    • config.output_dir() -> &Path (promotion output dir)
    • config.gaps_path() -> PathBuf (episteme/gaps.json)
    • config.data_dir() -> &Path (episteme data dir)

FIX

  • handlers/scan.rs:33-40 - Add with_strict_thresholds() method <- CURRENT