gabriel / musehub public
fix BREAKING fix/226-i2-grace-period-hard-error #1 / 1
AI Agent gabriel · 2 days ago · Oct 22, 2026 · Diff

fix: I2 root-distance grace period — warning then hard error (musehub#226)

Audit: investigating musehub#226 revealed push_validator.py's I2 check was warning-only with no path to a hard error, and separately — while confirming #227's audit table claim that this validator is "wired into wire_push" — discovered IdentityPushValidator has zero production call sites at all (filed as musehub#230, deferred, scoped separately from this fix).

Design decision (confirmed via AskUserQuestion): orphaned identity nodes (no path to any human root) stay a soft warning for a 30-day grace period, covering mid-construction identities and bulk-import-then-wire-later workflows, then become a hard error — push rejected — once that grace period has elapsed with the node still orphaned. Age is measured from the identity's own registered_at timestamp.

TDD: wrote TestI2GracePeriodHardError (5 new tests) first, confirmed genuine RED via muse-dev shelf save/pop isolation (4 failed on missing `now` kwarg, 1 assertion failure). Implemented GRACE_PERIOD_DAYS=30, _parse_registered_at() helper, and now= parameter on validate(). Confirmed GREEN: 38/38 passed on tests/test_identity_push_validator.py. 5 pre-existing tests needed an explicit now=_dt(2026, 4, 21) pin since their fixture's fixed registered_at date is now >30 days before the real wall clock.

Regression: ran 15 identity/graph test files (255 tests) — 3 pre-existing failures in test_identity_repo_phase4.py::TestRemoveOrgMember (member-removal endpoint returning 403), confirmed via shelf isolation to be unrelated to this change (same failures occur with this fix shelved aside).

Co-Authored-By: Claude Sonnet 5 <[email protected]>

sha256:8e4c8bd4ea4700e122c6bebe3dba821e95ae972b0a547762415ac3e72f60ebe3 sha
+17 ~10 symbols
2 changed · 1100 in snapshot files
sha256:36e6442914443c2d0dec16538108216e30f48749f31c0372488e39b5ffd4195d snapshot
+17
symbols added
~10
symbols modified
2
files changed
1100
files in snapshot
0
dead code introduced
Semantic Changes 27 symbols
~ musehub/graph/push_validator.py .py 5 symbols added, 2 symbols modified
+ GRACE_PERIOD_DAYS variable variable GRACE_PERIOD_DAYS L42–42
+ _parse_registered_at function function _parse_registered_at L50–51
+ datetime import import datetime L35–35
+ timedelta import import timedelta L35–35
+ timezone import import timezone L35–35
~ tests/test_identity_push_validator.py .py 12 symbols added, 8 symbols modified
+ TestI2GracePeriodHardError class class TestI2GracePeriodHardError L219–279
+ test_default_now_is_real_clock_when_omitted method method test_default_now_is_real_clock_when_omitted L271–279
+ test_freshly_orphaned_node_is_warning_not_error method method test_freshly_orphaned_node_is_warning_not_error L220–230
+ test_old_but_connected_node_has_no_warning_or_error method method test_old_but_connected_node_has_no_warning_or_error L257–269
+ test_orphaned_node_past_grace_period_is_hard_error method method test_orphaned_node_past_grace_period_is_hard_error L244–255
+ test_orphaned_node_within_grace_period_is_still_warning method method test_orphaned_node_within_grace_period_is_still_warning L232–242
+ _dt function function _dt L34–35
+ agent_registered function function agent_registered L55–57
+ human_registered function function human_registered L50–52
+ datetime import import datetime L22–22
+ timedelta import import timedelta L22–22
+ timezone import import timezone L22–22
Files Changed
~2
1100 in snapshot
← Older Oldest on fix/226-i2-grace-period-hard-error
All commits
Newer → Latest on fix/226-i2-grace-period-hard-error

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:8e4c8bd4ea4700e122c6bebe3dba821e95ae972b0a547762415ac3e72f60ebe3 --body "your comment"