|
| 1 | +# ARCOS System — TODO (Programming-Oriented) |
| 2 | + |
| 3 | +> **Design choice**: All code in **Rust**. |
| 4 | +> **Contract-first**: All inter-component I/O is XML validated by XSD. |
| 5 | +> **Goal**: Each checklist item should map cleanly to issues/PRs. |
| 6 | +
|
| 7 | +## Core Entities (used across components) |
| 8 | +- [ ] **Project** (id, name, status, domains, versions) |
| 9 | +- [ ] **User/Session** (login, permissions) |
| 10 | +- [ ] **Message** (User↔Maestro (Orchestrator), ARCOS-Speculus, Domain Speculus, Validator, Post-Processor) |
| 11 | +- [ ] **Speculus** (ARCOS Speculus, Domain Speculus) |
| 12 | +- [ ] **Vocabulary & Rules** (Vocabulary, predefined and current project rules) |
| 13 | +- [ ] **Producer Brief** (inputs distilled for generation) |
| 14 | +- [ ] **Artifacts** (files, directories) |
| 15 | +- [ ] **Manifest** (artifact inventory / checksums) |
| 16 | +- [ ] **Validation Report** (errors/warnings, locations, suggestions) |
| 17 | +- [ ] **Focus Set** (file+section subset for retries) |
| 18 | +- [ ] **Delta Policy** (rebuild/replay constraints) |
| 19 | + |
| 20 | +--- |
| 21 | + |
| 22 | +## 1) Portal (Local App) |
| 23 | +### Entities → Concepts → Functionality |
| 24 | +**User/Session** |
| 25 | +- [ ] Auth: Username/password store (local SQLite / Postgres) and session tokens. |
| 26 | +- [ ] Roles: Basic RBAC (owner, editor, viewer). |
| 27 | + |
| 28 | +**Project** |
| 29 | +- [ ] CRUD: Create, list, update, delete projects. |
| 30 | +- [ ] Workspace: Local project directory bootstrap (config, schema refs). |
| 31 | +- [ ] Status: Display last run state (Validated / Failed / Draft). |
| 32 | + |
| 33 | +**Message** |
| 34 | +- [ ] Builder: UI to compose *New Project* / *Edit Project* messages. |
| 35 | +- [ ] XSD guardrails: Inline validation against messaging schemas with errors surfaced to UI. |
| 36 | + |
| 37 | +**Speculus (ARCOS)** |
| 38 | +- [ ] Selectors: Choose Domain specific AI agents, + Domain package (schema URIs). |
| 39 | +- [ ] Integrity: Fetch & cache schemas; verify checksums (if provided). |
| 40 | +**Speculus (Domain)** |
| 41 | +- [ ] UI: From the free form user's text, extract project's rules |
| 42 | + |
| 43 | +**Run Control** |
| 44 | +- [ ] Invoke Orchestrator: Fire-and-log request; show live run log (tail). |
| 45 | +- [ ] Attachments: Attach local files when required (e.g., initial ARCOSProject inline). |
| 46 | + |
| 47 | +**Nice to have** |
| 48 | +- [ ] Browser: Tree viewer of latest output, with quick open in external editor. |
| 49 | + |
| 50 | +--- |
| 51 | + |
| 52 | +## 2) Orchestrator |
| 53 | +### Entities → Concepts → Functionality |
| 54 | +**Message** |
| 55 | +- [ ] Router: Deserialize & dispatch requests to Speculus/Validator/Producer/Post-Processor. |
| 56 | +- [ ] Contracts: Strongly-typed Rust models bound to XSD (serde + quick-xml). |
| 57 | + |
| 58 | +**Project** |
| 59 | +- [ ] State Machine: Draft → Generated → Validated → Failed → Retrying. |
| 60 | +- [ ] Persistence: Run history with timestamps, component versions, checksums. |
| 61 | + |
| 62 | +**Speculus** |
| 63 | +- [ ] ARCOS pass: Define AI Agents to use, and domain schemas |
| 64 | +- [ ] Domain pass: Load domain-specific constraints and options. |
| 65 | + |
| 66 | +**Producer Brief** |
| 67 | +- [ ] Synthesis: Build minimal, deterministic brief (inputs, constraints, examples). |
| 68 | +- [ ] Redaction: Strip irrelevant context on retries using Focus Set. |
| 69 | + |
| 70 | +**Focus Set / Artefact Manifest** |
| 71 | +- [ ] Retry Logic: If validation fails, compute target subset & pass to Producer. |
| 72 | +- [ ] After Production, extract all files from the output.zip and create them locally in a User's space (UserID, ProjectID) |
| 73 | + |
| 74 | +**Validation Report** |
| 75 | +- [ ] Reroute: On error, send back to producer, including the report, and previous code. |
| 76 | + |
| 77 | +**Observability** |
| 78 | +- [ ] Tracing: `tracing` spans across components with run-id propagation. |
| 79 | +- [ ] Audit: Append-only log file per project. |
| 80 | + |
| 81 | +--- |
| 82 | + |
| 83 | +## 3) ARCOS-Speculus |
| 84 | +### Entities → Concepts → Functionality |
| 85 | +**Speculus (ARCOS)** |
| 86 | +- [ ] Selectors / Registry: Load Domain Schema and IA Agents from a bank of domains |
| 87 | +- [ ] Write a Purpose. |
| 88 | + |
| 89 | +**Process Expansion** |
| 90 | +- [ ] Subprojects: Support multiple producers (e.g., CodeGen, DocGen) per run. |
| 91 | +- [ ] Constraints: System-level rules (e.g., mandatory reports, packaging policy). |
| 92 | + |
| 93 | +**Messaging** |
| 94 | +- [ ] Output: Emit Maestro/Orchestrator messages, and an initial ARCOS_Project conforming to ARCOS_Project schema |
| 95 | + |
| 96 | +--- |
| 97 | + |
| 98 | +## 4) Domain Speculus |
| 99 | +### Entities → Concepts → Functionality |
| 100 | +**Vocabulary & Rules** |
| 101 | +- [ ] Load Packs: `DomainVocabularyAndRules.xml` (predefined = read-only; project rules = editable). |
| 102 | +- [ ] Integrity: Verify external domain schema checksum (if provided). |
| 103 | + |
| 104 | +**Rule Extraction** |
| 105 | +- [ ] Intent Linkage: Map user intents → candidate rules; surface dependencies. |
| 106 | +- [ ] Dependency Graph: Build DAG; detect sub-rules and cycles. |
| 107 | +- [ ] Application: Apply accepted rules to produce domain constraints. |
| 108 | + |
| 109 | +**Producer Brief (Domain)** |
| 110 | +- [ ] Domain Shaping: Extract project rules from free-form user text and serialize into ARCOS_Project update. |
| 111 | +- [ ] Sanitization: Enforce domain schema enumerations & ranges. |
| 112 | + |
| 113 | +**Messaging** |
| 114 | +- [ ] Emit Domain Speculus outputs consumable by Orchestrator/Producer, and Updated ARCOS_Project . |
| 115 | + |
| 116 | +--- |
| 117 | + |
| 118 | +## 5) Validator |
| 119 | +### Entities → Concepts → Functionality |
| 120 | +**Validation Report** |
| 121 | +- [ ] Structure: Errors, warnings, notes; file path + line/col; codes; suggestions. |
| 122 | +- [ ] Output: Emit ARCOS_Project conformity in a validation_report.xml respecting the schema. |
| 123 | + |
| 124 | +**Checks** |
| 125 | +- [ ] Schema Validation: Validate outputs against ARCOS_Project rules. |
| 126 | +- [ ] Semantic Rules: Domain rule checks (deps satisfied, uniqueness, invariants). |
| 127 | +- [ ] Cross-file: Manifest vs. disk, references resolvable, orphan files. |
| 128 | +- [ ] Policy: Enforce packaging/naming conventions. |
| 129 | + |
| 130 | +**Focus Hints** |
| 131 | +- [ ] Extraction: Identify failing files/sections to seed Focus Set. |
| 132 | + |
| 133 | +**Tooling** |
| 134 | +- [ ] Test Fixtures: Golden files; property tests for rule invariants. |
| 135 | + |
| 136 | +--- |
| 137 | + |
| 138 | +## 6) Post-Processor |
| 139 | +### Entities → Concepts → Functionality |
| 140 | +**Artifacts** |
| 141 | +- [ ] Normalization: Rename, format, layout (e.g., license headers). |
| 142 | +- [ ] Synthesis: Generate secondary artefacts (indexes, READMEs, reports). |
| 143 | + |
| 144 | +**Packaging** |
| 145 | +- [ ] Bundle: Zip vs. raw files policy; embed manifest & reports. |
| 146 | + |
| 147 | +**Reporting** |
| 148 | +- [ ] Post-Process Report: Summarize actions (added/removed/renamed), timings. |
| 149 | + |
| 150 | +**Messaging** |
| 151 | +- [ ] Response: Structured success/failure with links to outputs. |
| 152 | + |
| 153 | +**Milestone 1** |
| 154 | +- [ ] Actions: run cargo check/cargo build on generated code, |
| 155 | + capture compiler diagnostics, |
| 156 | + send structured report back to Orchestrator. |
| 157 | + |
| 158 | +--- |
| 159 | + |
| 160 | +## 7) Artefact Extractor *(Nice to have)* |
| 161 | +### Entities → Concepts → Functionality |
| 162 | +**Manifest** |
| 163 | +- [ ] Create: Enumerate files, sizes, checksums, provenance. Local UserID/ProjectID storage space ... |
| 164 | + where code will be compiled |
| 165 | +- [ ] Version: Manifest per run; link to run-id and component versions. |
| 166 | + |
| 167 | +**Delta Policy** |
| 168 | +- [ ] Compute: Changes between manifests; classify (added/removed/modified). |
| 169 | +- [ ] Apply: Rebuild requested bundle from local store deterministically. |
| 170 | + |
| 171 | +**Repro** |
| 172 | +- [ ] Rebuild: Produce output.zip solely from manifest + deltas. |
| 173 | + |
| 174 | +--- |
| 175 | + |
| 176 | +## 8) Focus Extractor *(Nice to have)* |
| 177 | +### Entities → Concepts → Functionality |
| 178 | +**Focus Set** |
| 179 | +- [ ] Derive: From validation report + manifest; map to file paths/regions. |
| 180 | +- [ ] Granularity: File-level first; region-level (line ranges) when available. |
| 181 | + |
| 182 | +**Producer Brief Integration** |
| 183 | +- [ ] Filter: Reduce inputs to only necessary context; retain dependencies. |
| 184 | + |
| 185 | +**Safety** |
| 186 | +- [ ] Guardrails: Ensure required context (schemas, shared headers) stays included. |
| 187 | + |
| 188 | +--- |
| 189 | + |
| 190 | +## 9) Producer (Shell) |
| 191 | +### Entities → Concepts → Functionality |
| 192 | +**Producer Brief** |
| 193 | +- [ ] IO: Read ARCOS+Domain brief(s) and serialize prompts. |
| 194 | + |
| 195 | +**Generation** |
| 196 | +- [ ] Callout: Invoke OpenAI; stream responses; handle multi-file boundaries. |
| 197 | +- [ ] Capture: Write files; preserve structure; detect collisions. |
| 198 | + |
| 199 | +**Zip Safety** |
| 200 | +- [ ] Auto-bundle: Zip outputs. |
| 201 | +- [ ] Integrity: Compute manifest and attach to run. |
| 202 | + |
| 203 | +**Retry Mode** |
| 204 | +- [ ] Focus: Accept Focus Set and prune context accordingly. |
| 205 | + |
| 206 | +**Hygiene** |
| 207 | +- [ ] PII/Secrets: Static scan for PII/secrets; optional user-configurable patterns. |
| 208 | + |
| 209 | +--- |
| 210 | + |
| 211 | +## Cross-Cutting (Shared crates & infra) |
| 212 | +- [ ] **arcos-common**: error types, run-id, paths, checksums. |
| 213 | +- [ ] **arcos-xml**: XSD-backed structs, (de)serialization helpers, schema loader/cache. |
| 214 | +- [ ] **arcos-io**: workspace fs ops, zipping, hashing, manifest utils. |
| 215 | +- [ ] **arcos-messaging**: generated Rust bindings for all schemas. |
| 216 | +- [ ] **config**: env + TOML; per-project overrides. |
| 217 | +- [ ] **telemetry**: `tracing`, structured logs, optional JSON export. |
| 218 | +- [ ] **testing**: fixtures, golden files, end-to-end harness (orchestrator-driven). |
| 219 | + |
| 220 | +--- |
| 221 | + |
| 222 | +## Acceptance Criteria (per component) |
| 223 | +- [ ] **Schemas enforced**: All inputs/outputs validated at boundaries. |
| 224 | +- [ ] **Determinism**: Same inputs → same outputs (manifest proves it). |
| 225 | +- [ ] **Traceability**: Every file in outputs ties to a run-id and checksum. |
| 226 | +- [ ] **Retry discipline**: Failed run produces Focus Set; next run consumes it. |
| 227 | +- [ ] **Reproducibility**: Artefact Extractor can rebuild any validated bundle. |
0 commit comments