Skip to content

fix: resolve hub signing enforcement deadlock in new repos#545

Merged
dollspace-gay merged 4 commits intodevelopfrom
fix/hub-signing-bootstrap
Apr 1, 2026
Merged

fix: resolve hub signing enforcement deadlock in new repos#545
dollspace-gay merged 4 commits intodevelopfrom
fix/hub-signing-bootstrap

Conversation

@dollspace-gay
Copy link
Copy Markdown

@dollspace-gay dollspace-gay commented Apr 1, 2026

Summary

  • Fixes a three-bug deadlock where signing enforcement permanently blocked sync in new repos: allowedSignersFile was never configured, bootstrap commits were inherently unsigned, and enforcement had no bootstrap awareness
  • Adds explicit bootstrap phase tracking (meta/bootstrap.json) with pending/complete lifecycle — enforcement blocks with actionable instructions during pending, filters bootstrap commits when complete
  • Fixes pre-existing smoke test failures: server API auth tokens, agent init --force, invalid priority, missing sync, stale counters

Test plan

  • 1688 unit tests pass (including new bootstrap module tests)
  • 159 smoke tests pass, 0 failures (down from 42 pre-existing failures)
  • Manual test: fresh repo with signing_enforcement: "enforced" → clear bootstrap pending error
  • Manual test: after crosslink trust approve → sync succeeds, enforcement active

Closes #644

🤖 Generated with Claude Code

Three bugs combined into a deadlock where signing enforcement permanently
blocked sync in new repos:

1. allowedSignersFile was never configured because configure_signing()
   only set it when the file already existed. Now creates an empty
   allowed_signers file and always configures the path, so signed commits
   are correctly classified as Invalid (untrusted) instead of Unsigned.

2. Bootstrap commits (init, key publication) are inherently unsigned but
   enforcement treated them the same as real unsigned commits. Added
   explicit bootstrap phase tracking via meta/bootstrap.json with
   "pending"/"complete" lifecycle.

3. No bootstrap awareness in enforcement. Now:
   - Pending: blocks with actionable instructions to run trust approve
   - Complete: filters bootstrap commits by message prefix
   - No state (old repos): full enforcement (backwards compat)

Also fixes pre-existing smoke test failures:
- Server API tests: capture and send Bearer auth token
- Coordination tests: use --force for agent init after crosslink init
- Update test using invalid "critical" priority to valid "high"
- Milestone test: add sync before milestone creation
- Integrity test: accept FAIL when counters exist but are stale

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@dollspace-gay dollspace-gay self-assigned this Apr 1, 2026
dollspace-gay and others added 3 commits April 1, 2026 14:42
- Convert single-arm match to if/else (clippy::single_match_else)
- Reformat long lines per rustfmt rules

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
During hub initialization, clean_dirty_state() and agent registration
commits may be unsigned. Include their message prefixes in the bootstrap
filter so they don't trip enforcement after bootstrap completion.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The init commit that creates locks.json is always unsigned (signing
isn't configured yet). The locks signature display now recognizes
bootstrap commits and reports them without a scary WARNING.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@dollspace-gay dollspace-gay merged commit bc27ada into develop Apr 1, 2026
6 checks passed
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