|
| 1 | +# Phase 4A sparkctl Planning Handbook |
| 2 | + |
| 3 | +## 1. Product Identity |
| 4 | +- **Repository Name:** `Antigravity-CompText-sparkctl` |
| 5 | +- **CLI Binary Name:** `sparkctl` |
| 6 | + |
| 7 | +## 2. Phase 4 Purpose |
| 8 | +Transition the individual package extraction, validation, and operational context commands into a single cohesive CLI utility (`sparkctl`) to simplify workflow diagnostic audits and record-keeping operations. |
| 9 | + |
| 10 | +## 3. Strict Scope |
| 11 | +- Implement a unified CLI interface wrapping standard packaging and validation subcommands. |
| 12 | +- Preserve all existing Phase 1, 2, and 3 Rust validation rules and logic. |
| 13 | +- Target commands must execute offline and output clean, structured, and parseable summaries. |
| 14 | +- Prefer dry-run and validation check reporting behavior before performing execution or write actions. |
| 15 | + |
| 16 | +## 4. Forbidden Scope |
| 17 | +- **No Git Destructive Actions:** Do not stage, delete, revert, or force-push commits. |
| 18 | +- **No GitHub Writes:** Do not perform git push or alter remotes configurations. |
| 19 | +- **No Network Access:** All calculations and checks must run 100% offline. |
| 20 | +- **No Directory Escapes:** Do not scan directories outside the sandbox workspace root. |
| 21 | +- **No Advanced Integrations:** Do not add MCP server integrations, RAG systems, embeddings, vector databases, or LLM wrappers. |
| 22 | +- **No Compliance Certifications:** Do not claim compatibility with official SPARK schemas or compliance with the EU AI Act. |
| 23 | + |
| 24 | +## 5. Recommended CLI Command Surface |
| 25 | +- `sparkctl doctor`: Diagnoses toolchain setup, workspace folders, schemas, and git layout. |
| 26 | +- `sparkctl rust-validate`: Triggers Cargo formatting, check, clippy, and integration tests pipeline. |
| 27 | +- `sparkctl spark-demo`: Executes E2E package compress, inspect, verification, and adversarial suite run. |
| 28 | +- `sparkctl context-all`: Sequences context-build, context-render, and context-validate actions on target package and schema sidecars. |
| 29 | +- `sparkctl handoff-check`: Verifies Git staging cleanliness and remote status readiness in dry-run mode. |
| 30 | + |
| 31 | +## 6. Implementation Phases |
| 32 | +1. **Phase 4A: Planning Handbook:** Define structure and boundaries (Current Phase). |
| 33 | +2. **Phase 4B: Code Packaging & CLI Renaming:** Rename crate binary to `sparkctl`, register unified subcommands interface. |
| 34 | +3. **Phase 4C: Commands Implementation:** Port existing scripts and validations into the registered `sparkctl` functions. |
| 35 | +4. **Phase 4D: E2E Verification & Handoff:** Final validation and snapshot reporting. |
| 36 | + |
| 37 | +## 7. Safety & Git Boundaries |
| 38 | +- The tool must execute exclusively inside the sandbox root directory. |
| 39 | +- File system mutations must be restricted to the `artifacts/` folder. |
| 40 | +- Staging commands must use explicit file paths. Wildcards are strictly prohibited. |
| 41 | + |
| 42 | +## 8. Validation Checklist |
| 43 | +Before completion, the following checks must run successfully: |
| 44 | +```bash |
| 45 | +cargo fmt --all --check |
| 46 | +cargo check |
| 47 | +cargo test |
| 48 | +cargo clippy -- -D warnings |
| 49 | +sparkctl doctor |
| 50 | +sparkctl rust-validate |
| 51 | +sparkctl spark-demo |
| 52 | +sparkctl context-all -i ../artifacts/spark/extraction.spkg -s ../schemas/genehmigung_v1.json |
| 53 | +sparkctl handoff-check |
| 54 | +``` |
| 55 | + |
| 56 | +## 9. Validation Claims and Assurances |
| 57 | +- Offline behavior was deterministic in the validated test scope. |
| 58 | +- Configured leak checks passed in the validated scope. |
| 59 | +- No blocking risks found in the validated scope. |
| 60 | + |
| 61 | +## 10. Stop Conditions |
| 62 | +Stop execution and report `blocked` if: |
| 63 | +- Commands require external webhooks or network calls. |
| 64 | +- Verification requires importing external crate libraries with native system dependencies. |
| 65 | +- Changes necessitate structural changes to the validated operational context json model schema. |
| 66 | + |
| 67 | +## 11. Return Format for Phase 4B Implementation |
| 68 | +```text |
| 69 | +PHASE: Phase 4B sparkctl implementation |
| 70 | +STATUS: success | blocked |
| 71 | +COMMANDS_RUN: |
| 72 | +- ... |
| 73 | +FILES_CHANGED: |
| 74 | +- ... |
| 75 | +SPARKCTL_STATUS: |
| 76 | +- ... |
| 77 | +RISKS: |
| 78 | +- ... |
| 79 | +NEXT: |
| 80 | +- Phase 4C implementation only after approval |
| 81 | +``` |
0 commit comments