Skip to content

feat: Plan 10 PR C — de-emphasis signal + counterfactual removal report - #34

Merged
messagesgoel-blip merged 2 commits into
mainfrom
feat/bootstrap-cold-start-pr-c
Aug 15, 2026
Merged

feat: Plan 10 PR C — de-emphasis signal + counterfactual removal report#34
messagesgoel-blip merged 2 commits into
mainfrom
feat/bootstrap-cold-start-pr-c

Conversation

@messagesgoel-blip

Copy link
Copy Markdown
Collaborator

Plan 10 PR C — De-emphasis signal + counterfactual removal report

Depends on: PR A (#32) + PR B (#33, merged)

Changes

deEmphasisService.ts — Three core capabilities:

  1. Contribution split — bootstrap vs organic weighted contribution over trailing 30 days. Bootstrap-origin attestations excluded from organic count (decision 6). Independent organic issuers counted by distinct (owner_tenant_id, entity_kind) provenance. 30-day window continuity check.

  2. Counterfactual removal reportcomputeCounterfactualRemovalReport(rootId, targetWeight): loads current graph, overrides root weight to requested target (0, 0.5, etc.), re-runs VeriRank via gRPC (no write), compares per-principal scores against serving tenant's active policy threshold. Report bound to {targetWeight, graphVersion}; validateReportFreshness rejects stale/mismatched reports.

  3. Readiness gate — all conditions must hold: ≥3 independent organic issuers, ≥80% organic contribution, continuous 30-day window, no principal drops below serving tenant threshold.

RouteGET /v1/admin/bootstrap/de-emphasis (staff): returns contribution split + per-candidate readiness + counterfactual report.

Tests (6, skip without trust engine)

  • 2 vs 3 independent organic issuers flips readiness
  • 79% vs 80% organic contribution flips readiness
  • Window shorter than 30 continuous days → not ready
  • Root removal drops principal below threshold → not ready
  • Partial (0.5) and full (0) removal targets produce correct reports
  • Stale graph version report is rejected

Plan decisions covered

  • Decision 6: bootstrap-origin excluded from organic contribution even after registry removal
  • Decision 8: manual + metric-gated, target-weight aware, graph-version bound, no auto-apply

Acceptance criteria met

  • GET /v1/admin/bootstrap/de-emphasis returns contribution split + per-candidate counterfactual
  • Ready flags match the ≥3 issuers / ≥80% / 30-day / threshold rules
  • De-emphasis steps require de_emphasis_reason + approved_by (PR A)
  • No automatic de-emphasis (read-only signal)

- deEmphasisService: compute bootstrap vs organic weighted contribution over
  trailing 30 days; count independent organic issuers by distinct
  (owner_tenant_id, entity_kind) provenance; check 30-day window continuity
- counterfactual removal report: load graph, override root weight to requested
  target (0 or 0.5), re-run VeriRank via gRPC (no write), compare per-principal
  scores against serving tenant active policy threshold; bind report to
  {targetWeight, graphVersion}; validateReportFreshness rejects stale/mismatched
- readiness gate: >=3 independent organic issuers, >=80% organic contribution,
  continuous 30-day window, no principal drops below threshold; all conditions
  must hold for ready=true
- GET /v1/admin/bootstrap/de-emphasis (staff): returns contribution split +
  per-candidate readiness + counterfactual report
- integration tests (6, skipped without trust engine): 2 vs 3 independent
  issuers, 79% vs 80% organic, window continuity, threshold drop, partial vs
  full removal, stale graph version rejection
@cursor

cursor Bot commented Aug 15, 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

@messagesgoel-blip

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 15, 2026

Copy link
Copy Markdown

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: 5 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: c43ed516-43b1-403f-bec7-6d96b756cc9b

📥 Commits

Reviewing files that changed from the base of the PR and between 853434a and 24d9c2e.

📒 Files selected for processing (3)
  • control-plane/src/__tests__/integration/bootstrap-de-emphasis.test.ts
  • control-plane/src/domains/bootstrap/deEmphasisService.ts
  • control-plane/src/routes/admin.ts

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

@coderabbitai

coderabbitai Bot commented Aug 15, 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 7f911ab into main Aug 15, 2026
6 checks passed
@messagesgoel-blip
messagesgoel-blip deleted the feat/bootstrap-cold-start-pr-c branch August 15, 2026 03:43
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