Skip to content

feat: Plan 10 PR A — bootstrap registry seed + is_bootstrap derivation - #32

Merged
messagesgoel-blip merged 3 commits into
mainfrom
feat/bootstrap-cold-start-pr-a
Aug 11, 2026
Merged

feat: Plan 10 PR A — bootstrap registry seed + is_bootstrap derivation#32
messagesgoel-blip merged 3 commits into
mainfrom
feat/bootstrap-cold-start-pr-a

Conversation

@messagesgoel-blip

@messagesgoel-blip messagesgoel-blip commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

@coderabbitai review

Plan 10 PR A (design §13 step 14): idempotent bootstrap registry seed + is_bootstrap derivation.

  • Migration 015: 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 fixed vrl:p: ids and committed Ed25519 public keys (no private keys in repo).
  • bootstrapSeeder.ts: transactional, insert-only upsert (mutable registry columns never overwritten); is_bootstrap derived = registry member, not removed, weight > 0.
  • CLI: npm run seed:bootstrap, gated by BOOTSTRAP_SEED=1 (CI/prod cannot auto-seed).
  • PATCH /v1/admin/bootstrap-issuers: new remove_from_registry; weight steps and removal re-derive is_bootstrap in the same transaction.
  • Graph loader: excludes removed/zero-weight roots.
  • Tests (5 integration): idempotent rerun with exact manifest identities; PATCH removal clears flag and survives rerun; root-weight write-through (GraphRoot.weight reflects PATCHed current_weight, trust_weight stays 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

    • Added a curated bootstrap registry with seeded issuer identities and provenance details.
    • Added a controlled command to initialize bootstrap registry data safely and idempotently.
    • Added support for removing bootstrap issuers from the registry.
    • Removal status is preserved and reflected in issuer metadata.
  • Bug Fixes

    • Graph roots now include only active, positively weighted bootstrap issuers.
    • Repeated seeding preserves existing registry settings and avoids duplicates.
  • Tests

    • Added coverage for seeding, removal persistence, weight propagation, conflict handling, and execution safeguards.

- 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
@cursor

cursor Bot commented Aug 11, 2026

Copy link
Copy Markdown

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-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 39 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 498b2f7c-7693-4fc8-9d68-a15865475ae4

📥 Commits

Reviewing files that changed from the base of the PR and between 21b9d95 and 3cce0a4.

📒 Files selected for processing (1)
  • control-plane/src/__tests__/integration/bootstrap-seed.test.ts

Walkthrough

Adds a transactional bootstrap issuer seed manifest and CLI, persists registry removal state, re-derives is_bootstrap, filters graph roots by active positive registry membership, and adds integration coverage.

Changes

Bootstrap registry lifecycle

Layer / File(s) Summary
Manifest and transactional seeding
control-plane/src/domains/bootstrap/seedManifest.ts, control-plane/src/domains/bootstrap/bootstrapSeeder.ts
Defines two seeded issuers and inserts their principals, issuers, keys, and registry rows idempotently. Derives is_bootstrap from active positive-weight registry membership.
Seed command and execution gate
control-plane/src/scripts/seed-bootstrap.ts, control-plane/package.json
Adds the seed:bootstrap command. The script requires BOOTSTRAP_SEED=1, validates configuration, runs seeding, logs counts, and closes the pool.
Registry removal persistence
control-plane/migrations/015_bootstrap_removal/migration.sql, control-plane/src/domains/bootstrap/bootstrapRepository.ts, control-plane/src/routes/admin.ts
Stores removed_from_registry_at. The admin PATCH flow validates and persists remove_from_registry, then re-derives bootstrap state in one transaction.
Graph filtering and integration coverage
control-plane/src/domains/graph/attestationGraphLoader.ts, control-plane/src/__tests__/integration/bootstrap-seed.test.ts
Excludes removed or non-positive-weight roots. Tests cover identity matching, idempotent seeding, removal persistence, weight propagation, conflict handling, root exclusion, and execution gating.

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
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 55.56% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main changes: adding the bootstrap registry seed and deriving is_bootstrap.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/bootstrap-cold-start-pr-a

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 1e7c56c and 3c7ee53.

📒 Files selected for processing (9)
  • control-plane/migrations/015_bootstrap_removal/migration.sql
  • control-plane/package.json
  • control-plane/src/__tests__/integration/bootstrap-seed.test.ts
  • control-plane/src/domains/bootstrap/bootstrapRepository.ts
  • control-plane/src/domains/bootstrap/bootstrapSeeder.ts
  • control-plane/src/domains/bootstrap/seedManifest.ts
  • control-plane/src/domains/graph/attestationGraphLoader.ts
  • control-plane/src/routes/admin.ts
  • control-plane/src/scripts/seed-bootstrap.ts

Comment thread control-plane/migrations/015_bootstrap_removal/migration.sql
Comment thread control-plane/src/domains/bootstrap/bootstrapSeeder.ts
Comment thread control-plane/src/domains/bootstrap/seedManifest.ts Outdated
- 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
@messagesgoel-blip

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
⚠️ Action not completed

Already reviewed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 3c7ee53 and 21b9d95.

📒 Files selected for processing (4)
  • control-plane/migrations/015_bootstrap_removal/migration.sql
  • control-plane/src/__tests__/integration/bootstrap-seed.test.ts
  • control-plane/src/domains/bootstrap/bootstrapSeeder.ts
  • control-plane/src/domains/bootstrap/seedManifest.ts

Comment thread control-plane/src/__tests__/integration/bootstrap-seed.test.ts Outdated
Target a later manifest entry for the conflicting key and assert no registry
root exists for earlier entries either (transaction rollback).
@messagesgoel-blip

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@messagesgoel-blip
messagesgoel-blip merged commit 46d0ba7 into main Aug 11, 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