Add detailed file index and enhance skill documentation for autopilot, decompose, deploy, plan, and research skills. Introduce tests-only mode in decompose skill, clarify required files for deploy and plan skills, and improve prerequisite checks across skills for better user guidance and workflow efficiency.

This commit is contained in:
Oleksandr Bezdieniezhnykh
2026-03-22 16:15:49 +02:00
parent 60ebe686ff
commit 3165a88f0b
60 changed files with 6324 additions and 1550 deletions
@@ -0,0 +1,68 @@
# Module: ai_availability_status
## Purpose
Thread-safe status tracker for the AI engine lifecycle (downloading, converting, uploading, enabled, warning, error).
## Public Interface
### Enum: AIAvailabilityEnum
| Value | Name | Meaning |
|-------|------|---------|
| 0 | NONE | Initial state, not yet initialized |
| 10 | DOWNLOADING | Model download in progress |
| 20 | CONVERTING | ONNX-to-TensorRT conversion in progress |
| 30 | UPLOADING | Converted model upload in progress |
| 200 | ENABLED | Engine ready for inference |
| 300 | WARNING | Operational with warnings |
| 500 | ERROR | Failed, not operational |
### Class: AIAvailabilityStatus
| Field | Type | Description |
|-------|------|-------------|
| `status` | AIAvailabilityEnum | Current status |
| `error_message` | str or None | Error/warning details |
| Method | Signature | Description |
|--------|-----------|-------------|
| `__init__` | `()` | Sets status=NONE, error_message=None |
| `__str__` | `() -> str` | Thread-safe formatted string: `"StatusText ErrorText"` |
| `serialize` | `() -> bytes` | Thread-safe msgpack serialization `{s: status, m: error_message}` **(legacy — not called in current codebase)** |
| `set_status` | `(AIAvailabilityEnum status, str error_message=None) -> void` | Thread-safe status update; logs via constants_inf (error or info) |
## Internal Logic
All public methods acquire a `threading.Lock` before reading/writing status fields. `set_status` logs the transition: errors go to `constants_inf.logerror`, normal transitions go to `constants_inf.log`.
## Dependencies
- **External**: `msgpack`, `threading`
- **Internal**: `constants_inf` (logging)
## Consumers
- `inference` — creates instance, calls `set_status` during engine lifecycle, exposes `ai_availability_status` for health checks
- `main` — reads `ai_availability_status` via inference for `/health` endpoint
## Data Models
- `AIAvailabilityEnum` — status enum
- `AIAvailabilityStatus` — stateful status holder
## Configuration
None.
## External Integrations
None.
## Security
Thread-safe via Lock — safe for concurrent access from FastAPI async + ThreadPoolExecutor.
## Tests
None found.