Metadata-Version: 2.4
Name: spec-probe
Version: 0.1.7
Summary: Verify C/C++ modules implement functional requirements from spec (LangGraph + LLM)
Author: taikt
License-Expression: MIT
Project-URL: Homepage, https://github.com/taikt/spec-probe
Project-URL: Documentation, https://github.com/taikt/spec-probe/blob/main/QUICKSTART.md
Project-URL: Repository, https://github.com/taikt/spec-probe
Project-URL: Issues, https://github.com/taikt/spec-probe/issues
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: langgraph>=0.2
Requires-Dist: langchain-core>=0.3
Requires-Dist: langchain-openai>=0.2
Requires-Dist: pydantic>=2.0
Requires-Dist: pydantic-settings>=2.0
Requires-Dist: loguru>=0.7
Requires-Dist: python-dotenv>=1.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: httpx>=0.27
Requires-Dist: requests>=2.31
Requires-Dist: markitdown>=0.1
Requires-Dist: mammoth>=1.8
Requires-Dist: atlassian-python-api>=3.40
Requires-Dist: markdown>=3.5
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
Provides-Extra: rag
Requires-Dist: langchain-community>=0.3; extra == "rag"
Requires-Dist: langchain-huggingface>=0.1; extra == "rag"
Requires-Dist: sentence-transformers>=3.0; extra == "rag"
Requires-Dist: faiss-cpu>=1.8; extra == "rag"
Dynamic: license-file

# spec-probe

Check code against functional requirements in a spec (`.md` / `.docx` / `.pdf`). Use **VS Code Copilot** chat (`/spec-cover`, …) or the **`spec-probe`** CLI.

---

## Install

```bash
pip install spec-probe
spec-probe-skill --vscode
```


| Step                        | What it does                                                                      |
| ----------------------------- | ----------------------------------------------------------------------------------- |
| `pip install spec-probe`    | Python package + CLI only                                                         |
| `spec-probe-skill --vscode` | Skills →`~/.copilot/skills/`, config + **`.venv`** under `~/.config/spec-probe/` |

Python ≥ 3.11. **Reload VS Code** after `spec-probe-skill`.

Optional: `sudo apt install ripgrep` (faster search on Linux).

---

## Configure

Edit files in `~/.config/spec-probe/`:

### 1. API Keys & LLM (`.env`)

The default `config.json` uses **GitHub Copilot** (`gpt-6-luna`, `gemini-3.8-flash`) for search, rescue, and final review jobs, and **Exacode** for other pipeline jobs.

#### GitHub Copilot Token

To obtain and save your token automatically via GitHub Device Flow:

```bash
spec-probe-copilot-login
```

1. Open the URL shown in terminal: `https://github.com/login/device`
2. Enter the 8-character user code and click **Authorize GitHub Copilot**.
3. The token is automatically saved to `COPILOT_GITHUB_TOKEN` in `~/.config/spec-probe/.env`.
4. Verify your setup:
   ```bash
   spec-probe-copilot-test
   ```

*Alternative methods:*
- **GitHub CLI (`gh`)**: If already authenticated via `gh auth login`, `spec-probe` automatically falls back to `gh auth token`. You can also run:
  ```bash
  spec-probe-copilot-login --token "$(gh auth token)"
  ```
- **Manual `.env`**: Set directly in `~/.config/spec-probe/.env`:
  ```bash
  COPILOT_GITHUB_TOKEN="gho_xxxxxxxxxxxxxxxxxxxx"
  ```

#### Exacode (OpenAI-compatible internal gateway)

Set in `~/.config/spec-probe/.env`:

```bash
EXACODE_API_KEY=your_key_here
EXACODE_BASE_URL=https://api.example.com/exacode/v1
```

### 2. Paths (`config.yaml`)

Specify **absolute** paths:

```yaml
input:
  module_path: /abs/path/to/your/app
  spec_path: /abs/path/to/spec.md
  related_modules:
    paths:
      - /abs/path/to/other/service
```

---

## Codegraph (optional)

Needs Node.js.

```bash
spec-probe-codegraph /abs/path/to/module
```

With `related_modules`, index the **monorepo root**. After big changes: `codegraph sync /abs/path/to/monorepo-root`.

---

## Chat workflow (VS Code Copilot)


| Step         | In chat                                            |
| -------------- | ---------------------------------------------------- |
| Pack         | `/spec-pack`                                       |
| Explore spec | *parse spec summary* / *list section …*           |
| Verify       | *verify FR …* / *check requirement:* (paste text) |
| Report file  | *write report* (after verify)                      |
| Audit        | `/spec-audit`                                      |

Large spec: parse → a few FRs or one section → verify. Verify/check → chat only; ask for a report when you need files.

---

## CLI (optional)

```bash
spec-probe verify --module /abs/app --spec /abs/spec.md --fr FR-001
spec-probe check "The module shall …"
spec-probe parse --spec /abs/spec.md --summary
```

Paths default from `~/.config/spec-probe/config.yaml` when omitted.

---

## License

MIT — see [LICENSE](LICENSE). Maintainers: [docs/PYPI.md](docs/PYPI.md).
