|
| 1 | +# capiscio-python - GitHub Copilot Instructions |
| 2 | + |
| 3 | +## ABSOLUTE RULES - NO EXCEPTIONS |
| 4 | + |
| 5 | +### 1. ALL WORK VIA PULL REQUESTS |
| 6 | +- **NEVER commit directly to `main`.** All changes MUST go through PRs. |
| 7 | + |
| 8 | +### 2. LOCAL CI VALIDATION BEFORE PUSH |
| 9 | +- Run: `pytest -v` |
| 10 | + |
| 11 | +### 3. NO WATCH/BLOCKING COMMANDS |
| 12 | +- **NEVER run blocking commands** without timeout |
| 13 | + |
| 14 | +--- |
| 15 | + |
| 16 | +## CRITICAL: Read First |
| 17 | + |
| 18 | +**Before starting work, read the workspace context files:** |
| 19 | +1. `../../.context/CURRENT_SPRINT.md` - Sprint goals and priorities |
| 20 | +2. `../../.context/ACTIVE_TASKS.md` - Active tasks |
| 21 | + |
| 22 | +--- |
| 23 | + |
| 24 | +## Repository Purpose |
| 25 | + |
| 26 | +**capiscio-python** is the Python/PyPI CLI wrapper for capiscio-core. It auto-downloads |
| 27 | +the platform-specific Go binary and passes all commands through transparently. |
| 28 | + |
| 29 | +Published to PyPI as `capiscio`. Users install via `pip install capiscio`. |
| 30 | + |
| 31 | +**This is NOT the Python SDK** — that's `capiscio-sdk-python`. |
| 32 | + |
| 33 | +**Technology Stack**: Python 3.10+, hatchling (build), rich (CLI output) |
| 34 | + |
| 35 | +**Current Version**: v2.4.0 |
| 36 | +**Default Branch:** `main` |
| 37 | + |
| 38 | +## Architecture |
| 39 | + |
| 40 | +This is a **thin passthrough wrapper**, NOT a reimplementation. All logic lives in capiscio-core. |
| 41 | + |
| 42 | +``` |
| 43 | +capiscio-python/ |
| 44 | +├── src/capiscio/ |
| 45 | +│ ├── __init__.py |
| 46 | +│ ├── cli.py # Main entry point - parses args, delegates to binary |
| 47 | +│ └── manager.py # Downloads + caches platform-specific capiscio-core binary |
| 48 | +├── tests/ # Test suite |
| 49 | +├── pyproject.toml # Package config (name: "capiscio", hatchling build) |
| 50 | +└── docs/ # Documentation |
| 51 | +``` |
| 52 | + |
| 53 | +### How It Works |
| 54 | + |
| 55 | +1. User runs `capiscio verify agent-card.json` |
| 56 | +2. `cli.py` invokes `manager.run_core()` to ensure Go binary is downloaded |
| 57 | +3. Binary is cached in OS-specific cache dir (`get_cache_dir()`) |
| 58 | +4. All args are passed through to the Go binary via `subprocess` |
| 59 | + |
| 60 | +## Quick Commands |
| 61 | + |
| 62 | +```bash |
| 63 | +pip install -e ".[dev]" # Install in dev mode |
| 64 | +pytest -v # Run tests |
| 65 | +uv sync # Sync deps with uv |
| 66 | +``` |
| 67 | + |
| 68 | +## Critical Rules |
| 69 | + |
| 70 | +- **Never add CLI logic here** — all commands belong in capiscio-core |
| 71 | +- Binary downloads use GitHub Releases from `capiscio/capiscio-core` |
| 72 | +- Platform detection: `platform.system()` + `platform.machine()` |
| 73 | +- Version must stay aligned with capiscio-core |
| 74 | +- **Don't confuse with capiscio-sdk-python** — this is the CLI wrapper, that's the SDK |
| 75 | + |
| 76 | +## Publishing |
| 77 | + |
| 78 | +PyPI publish is triggered by pushing a git tag matching `v*`. |
| 79 | +```bash |
| 80 | +git tag v2.4.1 && git push origin v2.4.1 # Triggers PyPI publish |
| 81 | +``` |
0 commit comments