Skip to content

Commit 10434e9

Browse files
committed
Add Testing section to AGENTS.md with test coverage table and CI reference
1 parent 4db5f9d commit 10434e9

1 file changed

Lines changed: 27 additions & 1 deletion

File tree

AGENTS.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,11 @@ plugins/
2222
cortex-setup/ ← CLI install + connection setup
2323
install.sh / install.ps1 / bin/install.mjs ← one-command installers
2424
tests/
25-
run-tests.ps1 ← PowerShell test runner
25+
run-tests.sh ← bash test runner (Mac/Linux)
26+
run-tests.ps1 ← PowerShell test runner (Windows)
2627
validate-install.ps1 ← install validation
28+
.github/workflows/
29+
test.yml ← CI: runs tests on macOS + Windows
2730
```
2831

2932
## Critical Rules
@@ -40,6 +43,29 @@ tests/
4043
- `execute_cortex.py` — spawns `cortex` CLI subprocess. Key behaviors: credential path blocking (`CREDENTIAL_PATTERNS`), break-on-result, `process.terminate()` cleanup. The `stdin=DEVNULL` fix prevents the subprocess from stealing terminal input — do not remove it.
4144
- `route_request.py` — scores prompts via keyword indicators and skill trigger matching. Known issue: single-word trigger matching at line 88 can produce false positives.
4245

46+
## Testing
47+
48+
CI runs on every PR and push to main via `.github/workflows/test.yml` (macOS + Windows in parallel).
49+
50+
**Run locally:**
51+
52+
```bash
53+
bash tests/run-tests.sh # Mac/Linux
54+
.\tests\run-tests.ps1 # Windows
55+
```
56+
57+
**What's covered (~23 structural checks + 75 unit tests):**
58+
59+
| Section | Checks | What it validates |
60+
|---------|--------|-------------------|
61+
| CLIs | 5 | python3, git required; cortex, snow optional (warn) |
62+
| Plugin structure | 7 | plugin.json, 3 skill dirs, 9 router scripts, test files |
63+
| Content sanity | 8 | Valid JSON, `decide()` defined, `--permission-prompt-tool` usage, session_state functions |
64+
| Unit tests | 75 | `test_envelope_policy.py` (33): RO/RW/RESEARCH/DEPLOY envelope allow/deny decisions. `test_plugin_units.py` (42): session state CRUD, credential path blocking, envelope prompt building |
65+
| Snowflake connection | 1 | connections.toml or env vars exist (warn) |
66+
67+
Tests exit non-zero on any FAIL. Missing CLIs and missing Snowflake config are non-blocking warnings.
68+
4369
## Installers
4470

4571
The three installers (`install.sh`, `install.ps1`, `bin/install.mjs`) share the same logic:

0 commit comments

Comments
 (0)