Commit Graph

6 Commits

Author SHA1 Message Date
rob 66fd121ee4 Add AI review logging and --skip-ai-review flag to fabric sync
- Add comprehensive logging to run_ai_scrutiny_review() function
  - Log tool path checks, warning counts, timing
  - Log timeout events, JSON parse errors, all exceptions
  - Previously failures were silently swallowed
- Add --skip-ai-review flag for large bulk imports
  - Prevents rate limiting during initial imports
  - Passes through daemon_loop, run_sync, sync_pattern, publish_to_registry

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 01:41:45 -04:00
rob 12ae870b3c Fix tool argument passing for flag-style arguments
- Change nargs="*" to REMAINDER for tool_args to stop argparse from
  intercepting --flag style arguments meant for the tool
- Add -- separator handling to distinguish cmdforge args from tool args
- Map flag names to variable names using tool argument definitions
- Update AI review subprocess calls to use -- separator

Fixes scrutiny-ai-review tool arguments not being passed correctly.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 16:39:36 -04:00
rob e1cae5ffda Fix cmdforge executable path for AI review
Find cmdforge in venv or PATH instead of assuming it's in PATH.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 16:05:51 -04:00
rob 8471480aa7 Add AI-powered secondary review for scrutiny warnings
- Create scrutiny-ai-review tool that uses AI to analyze warnings
- Integrate AI review into publish flow (app.py)
- Integrate AI review into Fabric sync script
- If AI review returns APPROVE with >=80% confidence, auto-approve
- Display AI review results in admin pending tools modal
- Shows verdict (APPROVE/REJECT/NEEDS_HUMAN_REVIEW) with confidence
- Shows per-finding analysis (FALSE_POSITIVE/LEGITIMATE_CONCERN)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 16:03:44 -04:00
rob 5e01a335c0 Add registry improvements, tag filtering, and admin tools
Registry API improvements:
- Add /api/v1/me POST endpoint for profile updates
- Add /api/v1/me/password POST endpoint for password changes
- Fix visibility filtering on categories and tags endpoints to only
  show approved public tools
- Allow underscores in tool names for fabric pattern compatibility
- Fix sqlite3.Row access (use bracket notation instead of .get())

Web UI improvements:
- Add tag filter to /tools page with three-state buttons
  (include/exclude/neutral)
- Add mobile-friendly tag filter in responsive view
- Display tags on tool cards in the tools listing
- Add dashboard settings form handlers for profile and password

Admin improvements:
- Add scrutiny audit page for reviewing tool safety analysis
- Improve pending tools page with scrutiny report display
- Add scrutiny stats to admin dashboard

Fabric sync improvements:
- Add direct database publishing with scrutiny vetting
- Support auto-approve for tools passing scrutiny
- Improve error handling and logging
- Add source attribution for imported tools

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 06:20:16 -04:00
rob a5e0948881 Add admin configuration system and M3 content automation
Admin Configuration System:
- Add registry_settings table to database schema
- Create settings.py module with 17 configurable settings across 5 categories
  (vetting, similarity, sync, moderation, rate_limits)
- Add admin API endpoints for settings management (list/get/set/reset)
- Create admin settings web UI page with tabbed categories
- Add CLI commands: cmdforge registry config list/get/set
- Wire settings page link into admin index

M3 Content Automation Scripts:
- scrutiny.py: Quality scoring with 5 weighted checks
- similarity.py: TF-IDF based duplicate detection
- vet_pipeline.py: Combined vetting with auto-decision logic
- fabric_sync.py: Scheduled Fabric pattern synchronization
- fabric-sync.service/timer: systemd units for scheduled sync

Settings available:
- Vetting thresholds (approve/reject) and check weights
- Similarity detection thresholds (duplicate/similar/related)
- Fabric sync configuration (enabled, interval, auto-approve)
- Moderation settings (require review, auto-approve private)
- Rate limiting configuration

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 15:20:21 -04:00