feat: Plan 10 PR A — bootstrap registry seed + is_bootstrap derivation - #32
Conversation
- migration 015: bootstrap_issuers.removed_from_registry_at (explicit removal state) - seedManifest: curated root-of-truth (VeriLink, Whimsy, OpenCode, Claude Agent SDK, OpenAI Agents SDK) with fixed vrl:p ids and committed public keys - bootstrapSeeder: idempotent transactional upsert (insert-only mutable columns), is_bootstrap derivation excluding removed/zero-weight rows - seed-bootstrap CLI gated by BOOTSTRAP_SEED=1; npm run seed:bootstrap - PATCH /v1/admin/bootstrap-issuers: remove_from_registry support; weight/removal re-derive is_bootstrap in the same transaction - graph loader excludes removed/zero-weight roots - integration tests: idempotent rerun with exact identities, PATCH removal survives rerun, root-weight write-through (GraphRoot.weight vs trust_weight), zero-weight exclusion, seed gate
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 39 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughAdds a transactional bootstrap issuer seed manifest and CLI, persists registry removal state, re-derives ChangesBootstrap registry lifecycle
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Operator
participant AdminAPI
participant BootstrapRepository
participant PostgreSQL
participant GraphLoader
Operator->>AdminAPI: PATCH bootstrap issuer
AdminAPI->>BootstrapRepository: update current_weight or remove_from_registry
BootstrapRepository->>PostgreSQL: update registry state in transaction
BootstrapRepository->>PostgreSQL: derive issuers.is_bootstrap
PostgreSQL-->>BootstrapRepository: return updated issuer metadata
BootstrapRepository-->>AdminAPI: return bootstrap issuer
GraphLoader->>PostgreSQL: load active positive-weight roots
PostgreSQL-->>GraphLoader: return eligible graph roots
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@control-plane/migrations/015_bootstrap_removal/migration.sql`:
- Around line 6-7: After the ALTER TABLE statement, add a set-based UPDATE of
issuers.is_bootstrap using the same active-registry predicate as
deriveIsBootstrap, so existing rows are recalculated immediately under the new
removed_from_registry_at semantics. Preserve the migration’s existing schema
change and avoid relying on a later seed or PATCH operation.
In `@control-plane/src/domains/bootstrap/bootstrapSeeder.ts`:
- Around line 30-54: Update the bootstrap seeding flow around the client.query
inserts to read existing conflicting principals and principal_keys within the
same transaction before creating bootstrap_issuers. Reject and abort the
transaction when entity_kind, name, public_key_raw, or key_hash differs from the
manifest, rather than allowing ON CONFLICT DO NOTHING to continue; preserve
idempotent success for matching rows. Add an integration test that preloads a
conflicting bootstrap-k1 key and verifies no registry root is created.
In `@control-plane/src/domains/bootstrap/seedManifest.ts`:
- Around line 50-71: Remove the OpenCode, Claude Agent SDK, and OpenAI Agents
SDK entries from the SEED_ISSUERS bootstrap manifest in seedManifest.ts,
including their placeholder public keys; leave verified issuer entries unchanged
so these records are not seeded as bootstrap registry roots.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 211e3d59-4ea0-4062-a335-8bf51511af9d
📒 Files selected for processing (9)
control-plane/migrations/015_bootstrap_removal/migration.sqlcontrol-plane/package.jsoncontrol-plane/src/__tests__/integration/bootstrap-seed.test.tscontrol-plane/src/domains/bootstrap/bootstrapRepository.tscontrol-plane/src/domains/bootstrap/bootstrapSeeder.tscontrol-plane/src/domains/bootstrap/seedManifest.tscontrol-plane/src/domains/graph/attestationGraphLoader.tscontrol-plane/src/routes/admin.tscontrol-plane/src/scripts/seed-bootstrap.ts
- migration 015: recalculate is_bootstrap for existing rows under the new removed_from_registry_at semantics (no reliance on later seed/PATCH) - seeder: abort the transaction when an existing principal/key conflicts with the manifest (entity_kind, name, public_key_raw, key_hash); idempotent success for matching rows - manifest: drop OpenCode / Claude Agent SDK / OpenAI Agents SDK placeholder entries — only verified issuers are seeded as roots - test: conflicting bootstrap-k1 key aborts seed and creates no registry root
|
@coderabbitai review |
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@control-plane/src/__tests__/integration/bootstrap-seed.test.ts`:
- Around line 185-218: Update the rollback test around seedBootstrapRegistry to
target a later entry in SEED_ISSUERS, while still inserting the conflicting key
for that entry. After the expected conflict rejection, query bootstrap_issuers
using an earlier manifest entry’s principal ID and assert no registry root
exists, proving earlier inserts were rolled back.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 17cf230c-afff-49e7-a076-23f3efd400dd
📒 Files selected for processing (4)
control-plane/migrations/015_bootstrap_removal/migration.sqlcontrol-plane/src/__tests__/integration/bootstrap-seed.test.tscontrol-plane/src/domains/bootstrap/bootstrapSeeder.tscontrol-plane/src/domains/bootstrap/seedManifest.ts
Target a later manifest entry for the conflicting key and assert no registry root exists for earlier entries either (transaction rollback).
|
@coderabbitai review |
|
@coderabbitai review
Plan 10 PR A (design §13 step 14): idempotent bootstrap registry seed +
is_bootstrapderivation.bootstrap_issuers.removed_from_registry_at— explicit removal state so seed reruns never reinstate staff-removed issuers.seedManifest.ts: curated root-of-truth (VeriLink Bootstrap, Whimsy, OpenCode, Claude Agent SDK, OpenAI Agents SDK) with fixedvrl:p:ids and committed Ed25519 public keys (no private keys in repo).bootstrapSeeder.ts: transactional, insert-only upsert (mutable registry columns never overwritten);is_bootstrapderived = registry member, not removed, weight > 0.npm run seed:bootstrap, gated byBOOTSTRAP_SEED=1(CI/prod cannot auto-seed)./v1/admin/bootstrap-issuers: newremove_from_registry; weight steps and removal re-deriveis_bootstrapin the same transaction.GraphRoot.weightreflects PATCHedcurrent_weight,trust_weightstays 1.0); zero-weight root excluded; seed gate enforced.Verified:
tsc --noEmit, 148 unit + 60 integration (incl. 5 new) + 54 dashboard tests pass.Summary by CodeRabbit
New Features
Bug Fixes
Tests