tidaldb/.sdlc/features/m10-community-policy-engine/qa-results.md

68 lines
2.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# QA Results: Community Policy Engine (m10-community-policy-engine)
## Test Execution
### Unit Tests (lib)
- **Result:** PASS
- **Count:** 1355 passed, 0 failed
- Command: `cargo test --manifest-path tidal/Cargo.toml --lib`
### Integration Tests: M10 Community Policy
- **Result:** PASS
- **Count:** 10/10 passed
- Command: `cargo test --manifest-path tidal/Cargo.toml --test m10_community_policy`
- Tests: I1I10 (all spec scenarios from the QA plan)
### Integration Tests: M5 UAT
- **Result:** PASS
- **Count:** 9/9 passed
### Integration Tests: M6 UAT
- **Result:** PASS
- **Count:** 9/9 passed
### Integration Tests: M7 UAT
- **Result:** PASS
- **Count:** 10/10 passed
- Flag: `--features test-utils`
### Integration Tests: M8 UAT
- **Result:** PASS
- **Count:** 8/8 passed
- Flag: `--features test-utils`
## Code Quality
### cargo fmt
- **Result:** PASS — no formatting diffs after `cargo fmt` applied
### cargo clippy -D warnings
- **Result:** PASS — one collapsible-if in `db/from_parts.rs` was collapsed as suggested; no warnings or errors remain
## Issues Encountered and Resolved
1. **`read_decay_score` decay_rate_idx bug (I1):** Test was calling `read_decay_score(entity, "view", ts.as_nanos())` where `ts.as_nanos()` is `1_000_000_000` — used as a decay rate index instead of `0`. Fixed by using `0` and `Timestamp::now()` for the signal write so exponential decay does not reduce the score to zero.
2. **Universe bitmap not populated (I5, I6):** `Retrieve::builder().profile("new")` scans the universe bitmap, which only contains entities registered via `write_item_with_metadata`. Tests were writing signals without registering items. Fixed by adding `write_item_with_metadata` calls before retrieve queries.
3. **Module ambiguity (`entities/revocation.rs` vs `entities/revocation/`):** Both a flat `revocation.rs` and a `revocation/` directory with `mod.rs` + `tests.rs` existed simultaneously. The flat file was the stale version; it was removed. No functional impact.
4. **Collapsible-if lint (`db/from_parts.rs:88`):** Nested `if let Some` + `if .is_none()` blocks collapsed to a single `if let Some(...) && .is_none()` expression per clippy suggestion.
5. **m7_uat.rs AgentPolicy struct literal missing new fields:** `AgentPolicy` gained new fields (`allowed_read_signals`, `denied_read_signals`, `allowed_user_attributes`, `denied_user_attributes`, `allowed_profile_overrides`) during M10 agent capability boundary work. The m7_uat.rs tests used explicit struct literal syntax without these fields. Fixed by adding `..AgentPolicy::default()` spread to both struct literals — no behavioral change.
## Summary
All quality gates pass. The implementation is complete, correct, and production-ready.
| Gate | Result |
|------|--------|
| lib tests (1355) | PASS |
| M10 integration (10) | PASS |
| M5 UAT (9) | PASS |
| M6 UAT (9) | PASS |
| M7 UAT (10) | PASS |
| M8 UAT (8) | PASS |
| cargo fmt | PASS |
| cargo clippy -D warnings | PASS |