Skip to content

fix(stream-f): centralize trust badges + 5-state vocab (FIX-F-001, FI…#2

Merged
typelicious merged 2 commits into
mainfrom
fix/fix-prd-stream-f
Jun 3, 2026
Merged

fix(stream-f): centralize trust badges + 5-state vocab (FIX-F-001, FI…#2
typelicious merged 2 commits into
mainfrom
fix/fix-prd-stream-f

Conversation

@typelicious

Copy link
Copy Markdown
Contributor

…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).

André Lange 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.
@typelicious typelicious merged commit ef4f770 into main Jun 3, 2026
3 checks passed
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant