fix(stream-f): centralize trust badges + 5-state vocab (FIX-F-001, FI…#2
Merged
Conversation
added 2 commits
June 3, 2026 11:55
…X-F-002) - Add TRUST_BADGES dict with 5-state v2 canonical labels: discovered, pending_review, verified, signed, deprecated - Add get_trust_badge() helper with legacy state normalization (audited → pending_review, claimed → verified) - Re-export from package __init__ for downstream consumers (capacium-exchange, capacium-mcp, capacium-bridge) Single source of truth prevents vocabulary drift across surfaces. Required by FIX-F-001 (centralize trust badges in capacium-models).
Closes the "17 pre-existing TrustState.AUDITED failures" technical debt flagged in launch-prd.md §10 risk register. Tests now align with the v2 5-state model from PR #1 (Trust Model v2 — 4-state unification). Changes: - TrustState.AUDITED → TrustState.PENDING_REVIEW (19 references) - "audited" string literals → "pending_review" (10 references) - ordering test: len 4 → 5, last item SIGNED → DEPRECATED - Method renames for clarity: test_transition_discovered_to_audited → test_transition_discovered_to_pending_review test_transition_audited_to_verified_(requires|with)_publisher → test_transition_pending_review_to_verified_* test_downgrade_verified_to_audited → test_downgrade_verified_to_pending_review test_downgrade_audited_to_discovered → test_downgrade_pending_review_to_discovered test_entry_criteria_audited → test_entry_criteria_pending_review - normalize_legacy_state tests updated to reflect actual mapping: "indexed" → "pending_review" (was incorrectly expecting "audited") passthrough test uses "pending_review" (since "audited" is now a mapped legacy state, not a passthrough) Verified: PYTHONPATH=src pytest tests/test_models.py → 55 passed (was collecting 0 with errors). One legacy docstring at line 223 still references "audited" as historical context — intentional. Side-finding (not in this PR): src/capacium_models/models.py has 5 datetime.utcnow() calls; FIX-G-004 missed them. Will be tracked in separate cleanup issue.
8 tasks
typelicious
added a commit
that referenced
this pull request
Jun 3, 2026
…#3) This is the v0.4.0 release commit consolidating since v0.2.0: - 5-state trust model migration (already on main via 62670bd) - TRUST_BADGES + get_trust_badge() helper (PR #2, ef4f770) - test_models.py migrated to v2 vocabulary (PR #2) - datetime.utcnow() cleanup in models.py (this commit, closes FIX-G-004 gap) Changes in this commit: - src/capacium_models/models.py: 6× datetime.utcnow() → datetime.now(timezone.utc). Extended import accordingly. Closes the FIX-G-004 completion gap that the original Stream G codemod missed. - pyproject.toml: version 0.2.0 → 0.4.0 - CHANGELOG.md: v0.4.0 entry documenting breaking changes (TrustState AUDITED removed → PENDING_REVIEW), new features (TRUST_BADGES, get_trust_badge), bug fixes (utcnow cleanup), test migration, and process notes (5-state migration commit landed without PR). Verified locally: PYTHONPATH=src pytest tests/test_models.py → 55 passed, zero utcnow DeprecationWarnings under Python 3.14. Next step (out of scope for this PR): tag v0.4.0 on main + publish to PyPI. capacium-models has no automated release workflow yet — will be handled manually or via a follow-up workflow PR. Co-authored-by: André Lange <andre.lange@typelicious.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…X-F-002)
Single source of truth prevents vocabulary drift across surfaces. Required by FIX-F-001 (centralize trust badges in capacium-models).