528b16676e
gates / consistency-and-conventions (push) Successful in 2m16s
Adversarial review of the AI tools (commits 387f23f/0856b25) found 2 BLOCKING + 5 REQUIRED defects; all fixed: - pos-ai-hf --include/--exclude: bash-case glob filtering (array-safe, no jq regex interpolation, composes gguf->filename->include->exclude) - pos-ai-server: ExecStart rebuilt as single-line properly-quoted command (systemd_quote for executable + model path; systemd-analyze verify rc=0) - --branch/--revision aliased (last wins), dead BRANCH variable removed - parallel download drains all jobs: per-pid wait, honest 'X of Y files, N failed' summary, rc=1 on partial failure, no .hf-meta for half-downloaded models, EXIT-trap temp cleanup - detect_llama_version guarded; validate_requested_flags errors on unsupported explicit flags with version-aware message - pos ai hf cache [status|clear]: real implementation, fail-closed confirm - new bin/pos-ai-llamacpp thin forwarder + llamacpp shorthand in bin/pos-ai (pos ai llamacpp <subcmd> = pos ai --provider llamacpp <subcmd>) - docs synced: bin/pos-ai usage(), DOC/POS.md AI_PROVIDER row, howto/ai.md (adapter list, --provider backends, shorthand, providers table); gen regenerated (tree/dispatch/completions) Verified: bash -n all bin/pos*; make gen idempotent; make check green; make lint 0 FAIL, 0 WARN. Reviewer acceptance: APPROVE_WITH_NOTES (0 REQUIRED). Audit deliverables + agent reports included for context.
6.3 KiB
6.3 KiB
Detailed Audit of POS AI Tools vs. Underlying Applications
1. pos ai hf - Audit Table
| Category | Current Implementation | Upstream Hugging Face CLI | Missing | Incorrect | Fix |
|---|---|---|---|---|---|
| Repository Discovery | Basic search | hf list, hf info |
info command |
- | Add pos ai hf info <repo> |
| File Listing | --list flag |
hf files |
files command |
- | Add pos ai hf files <repo> |
| Model Information | Basic metadata | Detailed model info | No detailed info | - | Add model details display |
| Repository Files | Limited listing | hf files with sizes |
No file listing | - | Add file listing command |
| Downloading | Basic download | hf download with include/exclude |
No pattern filtering | - | Add --include/--exclude |
| Revisions | --branch |
--revision support |
No tag/commit support | - | Add revision support |
| Cache Management | No cache commands | hf cache |
No cache commands | - | Add pos ai hf cache |
| Authentication | HF_TOKEN only |
Credential helpers, more tokens | Limited auth | - | Add enhanced auth |
| Progress Reporting | Basic progress | Detailed metrics | Limited info | - | Add progress details |
| File Pattern Matching | Basic file matching | Wildcards, patterns | No pattern support | - | Add pattern matching |
| Multi-Shard Support | Limited | Full sharded support | No sharded model support | - | Add sharded model support |
| Error Handling | Basic errors | Detailed error messages | Limited context | - | Improve error reporting |
2. pos ai server - Audit Table
| Category | Current Implementation | Upstream llama.cpp | Missing | Incorrect | Fix |
|---|---|---|---|---|---|
| Model Loading | Basic model selection | --model with validation |
- | - | Enhance model validation |
| GPU Offloading | Auto-detect | --n-gpu-layers, multi-GPU |
No detailed GPU control | - | Add GPU layer control |
| Memory Context | Basic context | --ctx-size, KV cache |
Limited memory options | - | Add memory controls |
| Performance Tuning | Basic params | Batch sizes, threads, ubatch | No tuning | - | Add performance options |
| Sampling Controls | Basic | Temperature, top-k, top-p | No sampling options | - | Add sampling parameters |
| Advanced Features | No advanced | JSON/schema, tool calling | No advanced features | - | Add advanced options |
| Server Configuration | Basic | Health, metrics, concurrency | Limited server options | - | Add server options |
| Version Detection | No version | --version support |
No version awareness | - | Add version detection |
| Process Management | Basic | Graceful shutdown, monitoring | Limited process control | - | Add process monitoring |
| Logging | Basic | Logging controls | No log options | - | Add logging controls |
3. Detailed Missing Features
For pos ai hf:
Missing Repository Information:
- No
infocommand to show repository details - No way to see model architecture or parameters
- No commit history or version details
Missing File Operations:
- No
filescommand to list repository contents - No file pattern matching or filtering
- No file size information in listings
Missing Advanced Downloading:
- No
--include/--excludepatterns - No revision/tag support
- No cache management commands
Missing Authentication:
- No credential helper support
- No token validation
- No multi-auth method support
For pos ai server:
Missing GPU Configuration:
- No
--n-gpu-layerssupport - No tensor splitting (
--tensor-split) - No multi-GPU configuration
- No GPU device selection
Missing Memory Management:
- No
--ctx-sizecontrol - No KV cache configuration
- No memory mapping (
--mmap) or locking (--mlock)
Missing Performance Options:
- No batch size control (
--batch-size) - No ubatch size (
--ubatch-size) - No continuous batching options
Missing Sampling Controls:
- No temperature control
- No top-k, top-p options
- No repetition penalty
- No JSON/schema support
Missing Server Features:
- No health endpoint configuration
- No metrics endpoint support
- No concurrency controls
- No graceful shutdown handling
Missing Version Awareness:
- No version detection capability
- No feature compatibility checking
- No version-specific option support
4. Implementation Priority
Critical (Must Have):
- Add
infoandfilescommands forpos ai hf - Add GPU control for
pos ai server - Add version detection
- Add proper error handling
High Priority:
- Add
--include/--excludepatterns - Add revision support
- Add memory context control
- Add performance tuning options
Medium Priority:
- Add cache management
- Add enhanced authentication
- Add advanced sampling
- Add advanced server configuration
Low Priority:
- Add progress metrics
- Add logging controls
- Add process monitoring
- Add integration with POS ecosystem
5. Technical Requirements
For pos ai hf:
- Enhanced parsing for new flags
- Integration with Hugging Face API
- Cache management system
- Better file pattern matching
- Improved error reporting
For pos ai server:
- Enhanced parameter parsing
- Version detection system
- GPU configuration module
- Memory management controls
- Process management system
- Configuration validation
6. Compatibility Considerations
Backward Compatibility:
- All existing commands must work unchanged
- All existing options must work unchanged
- Default behavior must be preserved
- Configuration file compatibility maintained
Breaking Changes:
- None planned
- All enhancements are additive
- No existing functionality removed
7. Testing Requirements
pos ai hf Testing:
- Model download functionality
- File pattern matching
- Revision handling
- Cache operations
- Authentication testing
pos ai server Testing:
- GPU configuration validation
- Memory parameter testing
- Performance tuning options
- Server startup/shutdown
- Version compatibility testing
This audit identifies the comprehensive gap between the current POS tools and the capabilities of the underlying Hugging Face CLI and llama.cpp server. The implementation plan will address all these gaps systematically.