You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(governance): add external attestations envelope and veip poc (#89)
This PR introduces external attestation envelope support and the VEIP (Verifiable Execution and Integrity Protocol) synthetic proof-of-concept, vendors RFC 8785 JCS canonicalization, addresses POAM security findings, and tightens test and documentation standards.
@@ -143,20 +144,28 @@ dump the full environment, and mask any credential-shaped value before logging
143
144
### Test Execution: Always Use `uv run`
144
145
145
146
This project is managed with [`uv`](https://docs.astral.sh/uv/) (see `uv.lock`
146
-
and `pyproject.toml`). All pytest invocations must be prefixed with `uv run`.
147
-
Never invoke `pytest` or `python -m pytest` directly without the `uv run`
148
-
prefix — doing so bypasses the project's locked, reproducible environment.
147
+
and `pyproject.toml`). All test and verification invocations must be prefixed with `uv run`.
148
+
Never invoke `pytest`, `python`, or `python -m pytest` directly without the `uv run`
149
+
prefix — doing so bypasses the project's locked, reproducible virtual environment.
150
+
151
+
When running tests in parallel with `pytest-xdist` (`-n auto`), always launch
152
+
the test suite with `--dist=loadfile` to ensure proper test file isolation across workers.
149
153
150
154
Correct:
151
155
```bash
152
156
uv run pytest
153
-
uv run python -m pytest --cov=src --cov-report=term-missing
157
+
uv run pytest tests/ -m "local or unit" -n auto --dist=loadfile --tb=short
158
+
uv run pytest tests/test_tls_enforcement.py -v
159
+
uv run pytest --cov=src --cov-report=term-missing
160
+
uv run python proof/model.py
154
161
```
155
162
156
163
Incorrect (do not suggest):
157
164
```bash
158
165
pytest
159
166
python -m pytest
167
+
pytest -n auto # Missing --dist=loadfile and uv run prefix
168
+
python proof/model.py
160
169
```
161
170
162
171
This applies to all agents, contributors, and CI documentation examples.
@@ -271,6 +280,16 @@ When modifying STPA source files:
271
280
272
281
---
273
282
283
+
## Documentation Standards
284
+
285
+
Because CAGE is an illustrative reference architecture and not a live production deployment, all repository documentation must strictly adhere to the following principles:
286
+
287
+
-**No Internal Operational Tracking:** Do not add or maintain documents that track specific internal deployments, incidents, or team progress (e.g., active POAM trackers, rollback procedures for specific migrations, internal implementation status).
288
+
-**Illustrative Patterns Only:** Documents that describe operational procedures (like key rotation, deployment rules, or compensating controls) must clearly include a "Reference Architecture Note" stating they are illustrative templates for adopters.
289
+
-**Maintainer Independence:** Documentation should be written for an external adopter to adapt, devoid of maintainer-specific internal cloud project names, timestamps, or specific ticket tracking.
290
+
291
+
---
292
+
274
293
## Answering Questions About This Repository
275
294
276
295
When explaining repository concepts, reference the authoritative source
@@ -299,24 +318,50 @@ When asked about secrets or credentials:
299
318
300
319
## Tool-Specific Configuration
301
320
302
-
This file is the single source of truth for agent/contributor standards,
303
-
following the tool-agnostic `AGENTS.md` convention. Some AI coding assistants
304
-
additionally support mode-specific instruction routing; where used, those
305
-
configurations point back to this file rather than duplicating its content:
321
+
This file is the single authoritative source of truth for agent and contributor standards,
322
+
following the open, tool-agnostic `AGENTS.md` convention.
306
323
307
-
| Tool | Location | Purpose |
324
+
All modern AI coding assistants consume `AGENTS.md` natively at the repository root:
325
+
326
+
| Assistant / Tool | Ingestion Path | Behavior |
308
327
|---|---|---|
309
-
| Roo Code |`.roo/rules/`, `.roo/rules-<mode>/`| Per-mode (Code/Debug/Ask/Architect) instruction routing; each file is a thin pointer into the relevant section(s) of this document. |
328
+
|**Antigravity**|`AGENTS.md`| Ingested natively as global project instructions and behavioral rules. |
329
+
|**Roo Code / Cline**|`AGENTS.md`| Ingested automatically into all modes (Code, Architect, Debug, Ask). |
If you use a different AI coding assistant that supports a project-instructions
312
-
file (e.g. a tool reading `CLAUDE.md`, `.cursorrules`, or
313
-
`.github/copilot-instructions.md`), point it at this file rather than
314
-
introducing a parallel, divergent copy of these standards.
332
+
If you use a tool that requires a legacy configuration filename (e.g. `CLAUDE.md`, `.cursorrules`, or `.github/copilot-instructions.md`), create a thin symlink or pointer pointing directly back to this file rather than maintaining a divergent copy of these standards.
315
333
316
334
---
317
335
318
336
## Test Execution
319
337
338
+
### Local and Unit Suite (Offline)
339
+
340
+
The canonical way to run the full local and unit test suite across multiple workers:
341
+
342
+
```bash
343
+
uv run pytest tests/ -m "local or unit" -n auto --dist=loadfile --tb=short
344
+
```
345
+
Always launch the test suite with `--dist=loadfile` to ensure proper test file isolation across workers.
346
+
347
+
### Targeted Test Commands Reference
348
+
349
+
| Scope / Purpose | Canonical Command |
350
+
|---|---|
351
+
|**Single test file**|`uv run pytest tests/test_tls_enforcement.py -v`|
352
+
|**Specific test method**|`uv run pytest tests/test_tls_enforcement.py::TestTlsProtocolStandards::test_default_client_context_minimum_version -v`|
353
+
|**Adversarial / Red-team unit tests**|`uv run pytest tests/red_team/ -m "red_team and not integration" -v`|
354
+
|**US Federal region posture**|`CAGE_DEPLOYMENT_REGION=US_FED uv run pytest tests/ -m us_fed -v`|
355
+
|**EU ECB region posture**|`CAGE_DEPLOYMENT_REGION=EU_ECB uv run pytest tests/ -m eu_ecb -v`|
356
+
|**APAC MAS region posture**|`CAGE_DEPLOYMENT_REGION=APAC_MAS uv run pytest tests/ -m apac_mas -v`|
357
+
|**No-Direct-Bind BFS model proof**|`uv run python proof/model.py && uv run pytest tests/test_no_direct_bind_proof.py -v`|
358
+
|**Distributed CBF formal proof**|`uv run python -m proof.distributed_cbf_model && uv run pytest proof/distributed_cbf_model.py -v`|
359
+
|**Static analysis & formatting**|`uv run ruff check . && uv run ruff format --check .`|
-`tests/test_tls_enforcement.py` — Gateway TLS enforcement test suite: unit assertions for NIST SP 800-52 Rev. 2 TLS 1.2+ protocol minimums, OIDC JWKS `verify=True` transport security, and Linkerd mTLS manifest annotations (`test(compliance)`, closes POAM-2026-011)
15
+
-`docs/operations/KEY_ROTATION.md` — Cryptographic key management & rotation guide: documented rotation cadences for Cloud KMS HSM keys (90-day), HMAC routing seal secrets (30-day), and Linkerd mTLS certs with zero-downtime procedures and emergency revocation runbooks (`docs(operations)`, closes POAM-2026-012)
16
+
-`deployment/k8s/` manifests — Pinned third-party container image tags: `openpolicyagent/opa:0.68.0-static`, `redis/redis-stack-server:7.4.0-v1`, and `anchore/syft:v1.10.0` across deployment manifests (`feat(infra)`, closes POAM-2026-013)
17
+
-`AGENTS.md` — Parallel test isolation standards: added mandatory `--dist=loadfile` flag requirement and targeted test command reference matrix (`docs(tests)`)
-`src/gateway/governance/routing_seal.py` — HMAC Routing Seal v2: 4-tuple format `<expire_hex>.<action_slug>.<record_hash_hex>.<hmac_hex>` binding SHA-256 evidence record hash with fail-closed actuator enforcement (`feat(governance)`)
16
20
-`src/gateway/governance/cbf.py` — Strict replication rollback & cold-start epoch seed: synchronous Redis `WAIT` verification with fail-closed automatic rollback on replica timeout, plus `_fetch_initial_fence_epoch_sync()` startup seeding (`feat(governance)`)
0 commit comments