Session type: Code session. Single wave, one commit. State when written: Wave 63 complete. ~4045 tests pass (0 failed, 2 skipped). 120 modules (ceiling: 125 β ).
| Task | Status |
|---|---|
CloudDB.read_tenant_compliance_history(tenant_id) β day-bucketed [{date, score, grade}] sorted ASC |
β |
_db_read_tenant_compliance_history() helper in api.py (SQLite + in-memory fallback) |
β |
GET /cloud/tenants/{tenant_id}/compliance-history endpoint |
β |
tests/test_squash_w63.py β 16 tests (CloudDBΓ8, APIΓ8), all passing |
β |
| Task | Status |
|---|---|
CloudDB.read_tenant_compliance_score(tenant_id) β score 0β100 + grade A/B/C/D/F |
β |
_db_read_tenant_compliance_score() helper in api.py (SQLite + in-memory fallback) |
β |
GET /cloud/tenants/{tenant_id}/compliance-score endpoint |
β |
tests/test_squash_w62.py β 16 tests (20 collected), all passing |
β |
| Task | Status |
|---|---|
CloudDB.read_tenant_summary(tenant_id) β composes 4 per-tenant reads |
β |
_db_read_tenant_summary() helper in api.py (SQLite + in-memory fallback) |
β |
GET /cloud/tenants/{tenant_id}/summary endpoint |
β |
tests/test_squash_w61.py β 16/16 passing |
β |
| Task | Status |
|---|---|
CloudDB.read_drift_events(tenant_id) |
β |
CloudDB.read_tenant_policy_stats(tenant_id) |
β |
_db_read_drift_events/policy_stats() helpers in api.py |
β |
GET /cloud/tenants/{id}/drift-events endpoint |
β |
GET /cloud/tenants/{id}/policy-stats endpoint |
β |
tests/test_squash_w60.py β 16/16 passing |
β |
Fix: _C NameError in server.py (hoisted import) |
β |
| Fix: server.py line count gate (4743 β€ ceiling) | β |
| Task | Status |
|---|---|
CloudDB.delete_tenant(tenant_id) β cascade DELETE tenants + all data tables |
β |
TenantUpdateRequest Pydantic model (optional name / plan / contact_email) |
β |
_db_delete_tenant() helper β in-memory pop Γ 5 stores + CloudDB cascade |
β |
PATCH /cloud/tenant/{tenant_id} β delta-merge, 404 for unknown, updates updated_at |
β |
DELETE /cloud/tenant/{tenant_id} β 204 No Content, 404 for unknown, cascade-clears all data |
β |
tests/test_squash_w59.py β 15/15 passing (CloudDBΓ5, PATCHΓ5, DELETEΓ5) |
β |
| Task | Status |
|---|---|
CloudDB.read_inventory(tenant_id) |
β |
CloudDB.read_vex_alerts(tenant_id) |
β |
CloudDB.read_policy_stats() (cross-tenant aggregate) |
β |
_db_read_inventory/vex_alerts/policy_stats() helpers in api.py |
β |
GET /cloud/tenants/{id}/inventory endpoint |
β |
GET /cloud/tenants/{id}/vex-alerts endpoint |
β |
GET /cloud/policy-stats endpoint |
β |
tests/test_squash_w58.py β 16/16 passing |
β |
| AQLM lm_eval validation |
| Task | Status |
|---|---|
squish/cli.py mixed_attn calibration fix (outlier_threshold=100.0) |
β |
AQLM loader wired (compressed_loader.py lines 660-691, W56) |
β |
POST /drift-check REST endpoint in squish/squash/api.py |
β |
squish/squash/cloud_db.py β SQLite write-through backend |
β |
| All 5 api.py CloudDB write points wired | β |
tests/test_squash_w57.py β 20/20 passing |
β |
| AQLM lm_eval validation |
Still pending. Run before any AQLM-dependent work. Waiver format documented in prior waves.
Purpose: Add GET /cloud/compliance-overview β an aggregate view across all registered tenants showing platform-wide compliance health. This closes the read-only reporting layer started in W58 before moving to write/mutation endpoints.
W62 answers βwhat is this tenant's current posture?β W63 answers βhow has this tenant's posture evolved?β W64 answers βhow is the entire platform doing right now?β
Response shape:
{
"total_tenants": 12,
"compliant_tenants": 9,
"non_compliant_tenants": 3,
"average_score": 82.4,
"top_at_risk": [
{"tenant_id": "acme", "score": 41.0, "grade": "D"},
{"tenant_id": "globex", "score": 53.5, "grade": "C"},
{"tenant_id": "initech", "score": 61.0, "grade": "C"}
]
}compliant_tenants= count where score β₯ 80.0 (grade A or B).non_compliant_tenants= count where score < 80.0.average_score= mean of all per-tenant scores;0.0when no tenants exist.top_at_risk= up to 3 tenants sorted ascending by score (worst first).- Empty platform (no tenants) β
{total_tenants: 0, compliant_tenants: 0, non_compliant_tenants: 0, average_score: 0.0, top_at_risk: []}.
def read_compliance_overview(self) -> dict:
"""Return platform-wide compliance aggregate across all tenants.
Returns: {total_tenants, compliant_tenants, non_compliant_tenants,
average_score, top_at_risk: [{tenant_id, score, grade}, ...]}.
compliant = score >= 80.0 (grade A or B).
top_at_risk = up to 3 lowest-scoring tenants, sorted ascending.
"""Pattern: fetch all tenant IDs from the tenants table, call read_tenant_compliance_score() for each, aggregate. For SQLite this is a small loop (bounded by tenant count, not event count).
Insertion point: after read_tenant_compliance_history() and before delete_tenant().
GET /cloud/compliance-overview
- No path parameter β cross-tenant aggregate.
- Returns HTTP 200 always (empty response for no tenants).
- Backed by
_db_read_compliance_overview()helper + in-memory fallback.
In-memory fallback: iterate _tenants.keys(), call _db_read_tenant_compliance_score() for each, aggregate counts + scores, sort by score for at_risk.
Insertion point (helper): after _db_read_tenant_compliance_history() and before # ββ Cloud auth helpers.
Insertion point (endpoint): after cloud_get_tenant_compliance_history and before def _result_to_dict.
TestCloudDBComplianceOverview (8 tests):
test_returns_dictβ result is a dicttest_empty_platform_all_zerosβ no tenants β zeros, empty top_at_risktest_single_tenant_compliantβ freshly-upserted tenant (100.0 score) β compliant_tenants=1test_single_tenant_non_compliantβ inject policy failures β non_compliant_tenants=1test_total_count_correctβ 3 tenants β total_tenants=3test_average_score_is_floatβ average_score is a floattest_top_at_risk_sorted_ascendingβ 3 tenants, different scores β worst firsttest_top_at_risk_capped_at_threeβ 5 tenants β len(top_at_risk) β€ 3
TestCloudAPIComplianceOverviewEndpoint (8 tests):
test_200_responseβ GET returns 200test_response_has_required_keysβ all 5 keys presenttest_empty_platformβ no tenants β zero counts, empty top_at_risktest_total_tenants_countβ inject 2 tenants β total_tenants=2test_compliant_countβ 2 tenants, no failures β compliant_tenants=2test_average_score_nonzero_with_tenantsβ 2 tenants β average_score > 0test_top_at_risk_is_listβ top_at_risk is a listtest_no_path_parameterβ endpoint accessible at/cloud/compliance-overview
Total: 16 new tests. Suite target: ~4061 passing after W64.
- Tests:
python3 -m pytest tests/ --tb=no -qβ 0 failures.tests/test_squash_w64.pyincluded, 16 tests passing. - Memory: No new in-memory structures introduced.
- CLI: No new CLI flags.
- CHANGELOG: Wave 64 entry prepended in
CHANGELOG.md. - Module count: β€ 125 (no new production module, test file only).
| File | W64 Action |
|---|---|
squish/squash/cloud_db.py |
Add read_compliance_overview() (aggregate loop over all tenants) |
squish/squash/api.py |
Add _db_read_compliance_overview() helper + GET /cloud/compliance-overview endpoint |
tests/test_squash_w64.py |
New file β 16 tests (CloudDBΓ8, APIΓ8) |
CHANGELOG.md |
Prepend Wave 64 entry |
SQLite path: CloudDB.read_compliance_overview() fetch all IDs:
with self._lock:
rows = self._conn.execute("SELECT tenant_id FROM tenants").fetchall()Loop calling self.read_tenant_compliance_score(tid) for each, then aggregate.
Compliant threshold: score >= 80.0. Define as module-level constant _COMPLIANCE_THRESHOLD = 80.0 in cloud_db.py if not already present.
test_single_tenant_non_compliant (CloudDB): inject rows into policy_stats with explicit pass_count < total_count via db._conn.execute() β append_policy_stat auto-derives from the payload, so direct SQL is required.
_rate_window.clear() must appear in setup_method for all API tests to prevent 429 bleed.
| Model | Format | arc_easy | Notes |
|---|---|---|---|
| Qwen2.5-1.5B | INT4 AWQ g=32 (squish) | 70.8% | W42 canonical baseline |
| Qwen2.5-1.5B | INT3 g=32 | 67.2% | β3.4pp; "efficient" tier; below 72% gate |
| Qwen2.5-1.5B | AQLM | β PENDING | Pre-work gate, carries forward |
| Qwen2.5-1.5B | INT2 naive | ~29% | Incoherent β never ship |
| gemma-3-1b/4b | INT3 | β15β16pp | UNSAFE β do not recommend |
| Qwen3-4B | INT3 | β14.8pp | UNSAFE |
| Qwen3-8B | INT3 | β7.8pp | Coherent but large delta |
- squash module path:
squish/squash/ - server.py ceiling: 4743 lines β W64 routes live in
squash/api.py, no server.py changes needed