limn-review 0.1.123
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +110 -0
- package/README.md +133 -0
- package/dist/ai/runtime.js +535 -0
- package/dist/api/plugins/auth.js +169 -0
- package/dist/api/plugins/error-handler.js +114 -0
- package/dist/api/plugins/rate-limit.js +855 -0
- package/dist/api/plugins/security.js +321 -0
- package/dist/api/routes/activity.js +103 -0
- package/dist/api/routes/ai-runtime.js +67 -0
- package/dist/api/routes/auth.js +194 -0
- package/dist/api/routes/billing.js +209 -0
- package/dist/api/routes/bot-triage.js +1289 -0
- package/dist/api/routes/conflicts.js +730 -0
- package/dist/api/routes/contact.js +318 -0
- package/dist/api/routes/daily-brief.js +58 -0
- package/dist/api/routes/flow.js +71 -0
- package/dist/api/routes/health.js +7 -0
- package/dist/api/routes/insights.js +200 -0
- package/dist/api/routes/me.js +458 -0
- package/dist/api/routes/mentions.js +22 -0
- package/dist/api/routes/mergers.js +8 -0
- package/dist/api/routes/ml-labels.js +109 -0
- package/dist/api/routes/open-prs.js +35 -0
- package/dist/api/routes/prs.js +1633 -0
- package/dist/api/routes/reactions.js +217 -0
- package/dist/api/routes/repos.js +563 -0
- package/dist/api/routes/search.js +41 -0
- package/dist/api/routes/threads.js +118 -0
- package/dist/api/routes/timeline.js +150 -0
- package/dist/api/routes/users.js +67 -0
- package/dist/api/routes/webhooks.js +181 -0
- package/dist/api/routes/workspaces.js +322 -0
- package/dist/app.js +274 -0
- package/dist/ascii.js +19 -0
- package/dist/auth/account.js +482 -0
- package/dist/auth/crypto.js +46 -0
- package/dist/bot-triage/resolve.js +59 -0
- package/dist/cli.js +388 -0
- package/dist/coding/activity.js +80 -0
- package/dist/coding/agent.js +288 -0
- package/dist/coding/ai-fix/auto-fix.js +212 -0
- package/dist/coding/ai-fix/manager.js +370 -0
- package/dist/coding/ai-fix/persist.js +213 -0
- package/dist/coding/ai-fix/pr-context.js +58 -0
- package/dist/coding/ai-fix/prompts.js +138 -0
- package/dist/coding/ai-fix/review-seed.js +357 -0
- package/dist/coding/ai-fix/routes.js +425 -0
- package/dist/coding/git-ops.js +321 -0
- package/dist/coding/git.js +184 -0
- package/dist/coding/merge.js +262 -0
- package/dist/coding/safe-path.js +75 -0
- package/dist/coding/schema.js +43 -0
- package/dist/config.js +648 -0
- package/dist/conflict/diff.js +304 -0
- package/dist/conflict/git.js +118 -0
- package/dist/conflict/hash.js +73 -0
- package/dist/conflict/janitor.js +218 -0
- package/dist/conflict/land.js +675 -0
- package/dist/conflict/model-types.js +2 -0
- package/dist/conflict/model.js +1081 -0
- package/dist/conflict/parse.js +142 -0
- package/dist/conflict/seam.js +136 -0
- package/dist/conflict/session.js +532 -0
- package/dist/conflict/suggestion.js +398 -0
- package/dist/conflict/tokens.js +72 -0
- package/dist/data-dir.js +112 -0
- package/dist/db/actor-lanes.js +213 -0
- package/dist/db/automation-ids.js +97 -0
- package/dist/db/automation-output.js +349 -0
- package/dist/db/blast-radius-query.js +36 -0
- package/dist/db/blast-radius.js +226 -0
- package/dist/db/bot-dormancy.js +115 -0
- package/dist/db/bot-overlap.js +579 -0
- package/dist/db/bot-volume.js +722 -0
- package/dist/db/bot-window.js +35 -0
- package/dist/db/branch-queries.js +310 -0
- package/dist/db/change-shape.js +243 -0
- package/dist/db/changepoint.js +75 -0
- package/dist/db/cleanup.js +36 -0
- package/dist/db/client.js +102 -0
- package/dist/db/code-loc.js +388 -0
- package/dist/db/credits.js +79 -0
- package/dist/db/daily-brief.js +406 -0
- package/dist/db/dependency-cards.js +145 -0
- package/dist/db/erase-account.js +255 -0
- package/dist/db/export-account.js +189 -0
- package/dist/db/failing-checks.js +124 -0
- package/dist/db/file-coupling.js +197 -0
- package/dist/db/flow-detail.js +661 -0
- package/dist/db/flow-pointers.js +197 -0
- package/dist/db/flow-settings.js +67 -0
- package/dist/db/forecast.js +114 -0
- package/dist/db/line-overlap.js +81 -0
- package/dist/db/merge-queue.js +189 -0
- package/dist/db/migrate.js +17 -0
- package/dist/db/migrations/0000_purple_ben_grimm.sql +155 -0
- package/dist/db/migrations/0001_colorful_ozymandias.sql +31 -0
- package/dist/db/migrations/0002_famous_sersi.sql +9 -0
- package/dist/db/migrations/0003_clever_shinobi_shaw.sql +3 -0
- package/dist/db/migrations/0004_pale_scalphunter.sql +1 -0
- package/dist/db/migrations/0005_daffy_guardian.sql +2 -0
- package/dist/db/migrations/0006_cute_violations.sql +45 -0
- package/dist/db/migrations/0007_dark_anthem.sql +2 -0
- package/dist/db/migrations/0008_multitenant_accounts.sql +44 -0
- package/dist/db/migrations/0009_lean_bodies.sql +13 -0
- package/dist/db/migrations/0010_lean_bodies_nullable.sql +56 -0
- package/dist/db/migrations/0011_pr_diff_size.sql +10 -0
- package/dist/db/migrations/0012_findings_included_default.sql +7 -0
- package/dist/db/migrations/0013_review_routing.sql +9 -0
- package/dist/db/migrations/0014_account_last_active.sql +6 -0
- package/dist/db/migrations/0015_repos_inbox_watch.sql +9 -0
- package/dist/db/migrations/0016_repo_viewer_permission.sql +7 -0
- package/dist/db/migrations/0017_account_display_name.sql +7 -0
- package/dist/db/migrations/0018_finding_comment_kind.sql +7 -0
- package/dist/db/migrations/0019_finding_file_in_diff.sql +7 -0
- package/dist/db/migrations/0020_claude_review_cost_telemetry.sql +11 -0
- package/dist/db/migrations/0021_account_feed_last_seen.sql +7 -0
- package/dist/db/migrations/0022_ci_status_events.sql +21 -0
- package/dist/db/migrations/0023_ai_usage.sql +21 -0
- package/dist/db/migrations/0024_pr_head_ref_name.sql +6 -0
- package/dist/db/migrations/0025_account_billing.sql +7 -0
- package/dist/db/migrations/0026_ai_credit_allowance.sql +5 -0
- package/dist/db/migrations/0027_user_github_type.sql +6 -0
- package/dist/db/migrations/0028_bot_review_classification.sql +21 -0
- package/dist/db/migrations/0029_bot_mute_rules.sql +19 -0
- package/dist/db/migrations/0030_teams.sql +32 -0
- package/dist/db/migrations/0031_events_pr_idx.sql +7 -0
- package/dist/db/migrations/0032_benchmark_contributions.sql +29 -0
- package/dist/db/migrations/0033_thread_addressed_confidence.sql +9 -0
- package/dist/db/migrations/0034_thread_resolved_at.sql +6 -0
- package/dist/db/migrations/0035_pr_first_review_requested_at.sql +5 -0
- package/dist/db/migrations/0036_search_index.sql +25 -0
- package/dist/db/migrations/0037_author_indexes.sql +15 -0
- package/dist/db/migrations/0038_auto_merge_requests.sql +37 -0
- package/dist/db/migrations/0039_branch_status.sql +44 -0
- package/dist/db/migrations/0040_pr_review_decision.sql +10 -0
- package/dist/db/migrations/0041_branch_commit_detail.sql +38 -0
- package/dist/db/migrations/0042_repo_reviewers.sql +176 -0
- package/dist/db/migrations/0043_account_reviewers.sql +131 -0
- package/dist/db/migrations/0044_workspaces.sql +138 -0
- package/dist/db/migrations/0045_workspace_reviewers.sql +180 -0
- package/dist/db/migrations/0046_drop_inbox_watch.sql +25 -0
- package/dist/db/migrations/0047_ml_comment_labels.sql +40 -0
- package/dist/db/migrations/0048_ml_vendor_severity.sql +31 -0
- package/dist/db/migrations/0049_seat_pricing_repo_description.sql +21 -0
- package/dist/db/migrations/0050_users_app_slug.sql +12 -0
- package/dist/db/migrations/0051_auto_merge_queue.sql +17 -0
- package/dist/db/migrations/0052_trunk_ci_status_events.sql +43 -0
- package/dist/db/migrations/0053_automation_roles.sql +79 -0
- package/dist/db/migrations/0054_automation_vendor_kinds.sql +514 -0
- package/dist/db/migrations/0055_auto_merge_phase.sql +12 -0
- package/dist/db/migrations/0056_pr_mentions.sql +22 -0
- package/dist/db/migrations/0057_large_pr_threshold.sql +14 -0
- package/dist/db/migrations/0058_pending_mute.sql +53 -0
- package/dist/db/migrations/0059_merge_queue_state.sql +33 -0
- package/dist/db/migrations/0060_drop_my_turn_dismissals.sql +33 -0
- package/dist/db/migrations/0061_auto_merge_durable_anchors.sql +27 -0
- package/dist/db/migrations/0062_blast_radius_config.sql +21 -0
- package/dist/db/migrations/0063_repo_file_coupling.sql +33 -0
- package/dist/db/migrations/0064_pr_content_kind.sql +21 -0
- package/dist/db/migrations/0065_workspace_flow_settings.sql +13 -0
- package/dist/db/migrations/0066_review_request_events.sql +31 -0
- package/dist/db/migrations/0067_pr_security_signals.sql +86 -0
- package/dist/db/migrations/0068_my_turn_settings.sql +18 -0
- package/dist/db/migrations/0069_my_turn_dismissals.sql +41 -0
- package/dist/db/migrations/0070_claude_review_follow_up_ticket.sql +22 -0
- package/dist/db/migrations/0071_claude_review_trigger.sql +11 -0
- package/dist/db/migrations/0072_commit_message_headline.sql +13 -0
- package/dist/db/migrations/0073_claude_review_chat.sql +31 -0
- package/dist/db/migrations/0074_adopt_agentic_tables.sql +98 -0
- package/dist/db/migrations/0075_review_lens_drop_learnings.sql +15 -0
- package/dist/db/migrations/0076_claude_review_threads.sql +17 -0
- package/dist/db/migrations/0077_claude_review_ci_failures.sql +10 -0
- package/dist/db/migrations/0078_ai_fix_change_report.sql +17 -0
- package/dist/db/migrations/0079_claude_finding_story.sql +16 -0
- package/dist/db/migrations/meta/0000_snapshot.json +1116 -0
- package/dist/db/migrations/meta/0001_snapshot.json +1321 -0
- package/dist/db/migrations/meta/0002_snapshot.json +1375 -0
- package/dist/db/migrations/meta/0003_snapshot.json +1396 -0
- package/dist/db/migrations/meta/0004_snapshot.json +1416 -0
- package/dist/db/migrations/meta/0005_snapshot.json +1430 -0
- package/dist/db/migrations/meta/0006_snapshot.json +1745 -0
- package/dist/db/migrations/meta/0007_snapshot.json +1759 -0
- package/dist/db/migrations/meta/_journal.json +566 -0
- package/dist/db/migrations-pg/0000_tired_alex_power.sql +268 -0
- package/dist/db/migrations-pg/0001_dizzy_mockingbird.sql +3 -0
- package/dist/db/migrations-pg/0002_glorious_ikaris.sql +4 -0
- package/dist/db/migrations-pg/0003_melted_secret_warriors.sql +2 -0
- package/dist/db/migrations-pg/0004_numerous_triton.sql +1 -0
- package/dist/db/migrations-pg/0005_thick_blockbuster.sql +2 -0
- package/dist/db/migrations-pg/0006_majestic_dracula.sql +1 -0
- package/dist/db/migrations-pg/0007_same_human_torch.sql +2 -0
- package/dist/db/migrations-pg/0008_slimy_toxin.sql +1 -0
- package/dist/db/migrations-pg/0009_fuzzy_jubilee.sql +4 -0
- package/dist/db/migrations-pg/0010_late_hammerhead.sql +1 -0
- package/dist/db/migrations-pg/0011_happy_leech.sql +16 -0
- package/dist/db/migrations-pg/0012_woozy_captain_midlands.sql +16 -0
- package/dist/db/migrations-pg/0013_yielding_nicolaos.sql +1 -0
- package/dist/db/migrations-pg/0014_wakeful_bill_hollister.sql +2 -0
- package/dist/db/migrations-pg/0015_aspiring_black_tom.sql +1 -0
- package/dist/db/migrations-pg/0016_cute_ghost_rider.sql +30 -0
- package/dist/db/migrations-pg/0017_far_changeling.sql +24 -0
- package/dist/db/migrations-pg/0018_fancy_miss_america.sql +1 -0
- package/dist/db/migrations-pg/0019_benchmark_contributions.sql +22 -0
- package/dist/db/migrations-pg/0020_majestic_edwin_jarvis.sql +3 -0
- package/dist/db/migrations-pg/0021_green_salo.sql +1 -0
- package/dist/db/migrations-pg/0022_wise_baron_strucker.sql +1 -0
- package/dist/db/migrations-pg/0023_search_index.sql +19 -0
- package/dist/db/migrations-pg/0024_author_indexes.sql +9 -0
- package/dist/db/migrations-pg/0025_auto_merge_requests.sql +26 -0
- package/dist/db/migrations-pg/0026_branch_status.sql +32 -0
- package/dist/db/migrations-pg/0027_pr_review_decision.sql +5 -0
- package/dist/db/migrations-pg/0028_branch_commit_detail.sql +9 -0
- package/dist/db/migrations-pg/0029_repo_reviewers.sql +127 -0
- package/dist/db/migrations-pg/0030_account_reviewers.sql +77 -0
- package/dist/db/migrations-pg/0031_workspaces.sql +131 -0
- package/dist/db/migrations-pg/0032_workspace_reviewers.sql +165 -0
- package/dist/db/migrations-pg/0033_drop_inbox_watch.sql +14 -0
- package/dist/db/migrations-pg/0034_ml_comment_labels.sql +33 -0
- package/dist/db/migrations-pg/0035_ml_vendor_severity.sql +16 -0
- package/dist/db/migrations-pg/0036_seat_pricing_repo_description.sql +12 -0
- package/dist/db/migrations-pg/0037_users_app_slug.sql +9 -0
- package/dist/db/migrations-pg/0038_auto_merge_queue.sql +10 -0
- package/dist/db/migrations-pg/0039_trunk_ci_status_events.sql +27 -0
- package/dist/db/migrations-pg/0040_automation_roles.sql +63 -0
- package/dist/db/migrations-pg/0041_automation_vendor_kinds.sql +488 -0
- package/dist/db/migrations-pg/0042_auto_merge_phase.sql +8 -0
- package/dist/db/migrations-pg/0043_pr_mentions.sql +19 -0
- package/dist/db/migrations-pg/0044_large_pr_threshold.sql +6 -0
- package/dist/db/migrations-pg/0045_pending_mute.sql +26 -0
- package/dist/db/migrations-pg/0046_merge_queue_state.sql +18 -0
- package/dist/db/migrations-pg/0047_drop_my_turn_dismissals.sql +21 -0
- package/dist/db/migrations-pg/0048_auto_merge_durable_anchors.sql +27 -0
- package/dist/db/migrations-pg/0049_blast_radius_config.sql +8 -0
- package/dist/db/migrations-pg/0050_repo_file_coupling.sql +13 -0
- package/dist/db/migrations-pg/0051_pr_content_kind.sql +6 -0
- package/dist/db/migrations-pg/0052_workspace_flow_settings.sql +4 -0
- package/dist/db/migrations-pg/0053_review_request_events.sql +18 -0
- package/dist/db/migrations-pg/0054_pr_security_signals.sql +59 -0
- package/dist/db/migrations-pg/0055_my_turn_settings.sql +6 -0
- package/dist/db/migrations-pg/0056_my_turn_dismissals.sql +21 -0
- package/dist/db/migrations-pg/0057_claude_review_follow_up_ticket.sql +8 -0
- package/dist/db/migrations-pg/0058_claude_review_trigger.sql +4 -0
- package/dist/db/migrations-pg/0059_commit_message_headline.sql +3 -0
- package/dist/db/migrations-pg/0060_claude_review_chat.sql +24 -0
- package/dist/db/migrations-pg/0061_adopt_agentic_tables.sql +79 -0
- package/dist/db/migrations-pg/0062_review_lens_drop_learnings.sql +5 -0
- package/dist/db/migrations-pg/0063_claude_review_threads.sql +7 -0
- package/dist/db/migrations-pg/0064_claude_review_ci_failures.sql +4 -0
- package/dist/db/migrations-pg/0065_ai_fix_change_report.sql +9 -0
- package/dist/db/migrations-pg/0066_claude_finding_story.sql +7 -0
- package/dist/db/migrations-pg/meta/0000_snapshot.json +2137 -0
- package/dist/db/migrations-pg/meta/0001_snapshot.json +2143 -0
- package/dist/db/migrations-pg/meta/0002_snapshot.json +2170 -0
- package/dist/db/migrations-pg/meta/0003_snapshot.json +2182 -0
- package/dist/db/migrations-pg/meta/0004_snapshot.json +2188 -0
- package/dist/db/migrations-pg/meta/0005_snapshot.json +2201 -0
- package/dist/db/migrations-pg/meta/0006_snapshot.json +2207 -0
- package/dist/db/migrations-pg/meta/0007_snapshot.json +2219 -0
- package/dist/db/migrations-pg/meta/0008_snapshot.json +2226 -0
- package/dist/db/migrations-pg/meta/0009_snapshot.json +2250 -0
- package/dist/db/migrations-pg/meta/0010_snapshot.json +2256 -0
- package/dist/db/migrations-pg/meta/0011_snapshot.json +2412 -0
- package/dist/db/migrations-pg/meta/0012_snapshot.json +2528 -0
- package/dist/db/migrations-pg/meta/0013_snapshot.json +2534 -0
- package/dist/db/migrations-pg/meta/0014_snapshot.json +2547 -0
- package/dist/db/migrations-pg/meta/0015_snapshot.json +2553 -0
- package/dist/db/migrations-pg/meta/0016_snapshot.json +2774 -0
- package/dist/db/migrations-pg/meta/0017_snapshot.json +2999 -0
- package/dist/db/migrations-pg/meta/0018_snapshot.json +3020 -0
- package/dist/db/migrations-pg/meta/0020_snapshot.json +3228 -0
- package/dist/db/migrations-pg/meta/0021_snapshot.json +3234 -0
- package/dist/db/migrations-pg/meta/0022_snapshot.json +3240 -0
- package/dist/db/migrations-pg/meta/_journal.json +475 -0
- package/dist/db/ml-labels.js +1666 -0
- package/dist/db/my-turn-dismissals.js +343 -0
- package/dist/db/my-turn-settings.js +34 -0
- package/dist/db/pending-classify.js +46 -0
- package/dist/db/pending-mute.js +171 -0
- package/dist/db/pending-tabs.js +238 -0
- package/dist/db/period-metrics.js +820 -0
- package/dist/db/person-period.js +763 -0
- package/dist/db/pr-intervals.js +930 -0
- package/dist/db/pr-liveness.js +240 -0
- package/dist/db/pr-mentions.js +279 -0
- package/dist/db/pr-merge-queue-stamp.js +91 -0
- package/dist/db/queries.js +14631 -0
- package/dist/db/reaction-targets.js +94 -0
- package/dist/db/repo-activity.js +171 -0
- package/dist/db/retention.js +138 -0
- package/dist/db/review-threads-for-review.js +240 -0
- package/dist/db/run-migrations.js +24 -0
- package/dist/db/schema.pg.js +1220 -0
- package/dist/db/schema.sqlite.js +1801 -0
- package/dist/db/search.js +317 -0
- package/dist/db/security-alerts.js +218 -0
- package/dist/db/synthesis-input.js +565 -0
- package/dist/db/triage.js +320 -0
- package/dist/db/usage.js +63 -0
- package/dist/db/work-plan.js +1086 -0
- package/dist/db/working-hours.js +161 -0
- package/dist/feed/my-turn.js +122 -0
- package/dist/github/actions-logs.js +397 -0
- package/dist/github/auth.js +86 -0
- package/dist/github/branch-queries.js +229 -0
- package/dist/github/client.js +454 -0
- package/dist/github/codeowners.js +221 -0
- package/dist/github/commit-checks.js +105 -0
- package/dist/github/compare.js +110 -0
- package/dist/github/diff-anchor.js +227 -0
- package/dist/github/mutations.js +706 -0
- package/dist/github/pr-file-content.js +254 -0
- package/dist/github/pr-liveness.js +161 -0
- package/dist/github/queries.js +875 -0
- package/dist/github/rate-budget.js +129 -0
- package/dist/github/reactions.js +161 -0
- package/dist/github/reviewer-suggest.js +104 -0
- package/dist/github/team-reviewers.js +96 -0
- package/dist/index.js +184 -0
- package/dist/merge/auto-merge-runner.js +960 -0
- package/dist/ml/severity-client.js +218 -0
- package/dist/pr/detail-enricher.js +26 -0
- package/dist/pro/bind.js +302 -0
- package/dist/pro/contract.js +37 -0
- package/dist/pro/migrate.js +64 -0
- package/dist/review/agent-context.js +127 -0
- package/dist/review/agent.js +385 -0
- package/dist/review/agentic.js +59 -0
- package/dist/review/auth.js +94 -0
- package/dist/review/chat-agent.js +179 -0
- package/dist/review/claude-review/ai-ready.js +16 -0
- package/dist/review/claude-review/auto-settings.js +139 -0
- package/dist/review/claude-review/auto.js +244 -0
- package/dist/review/claude-review/chat.js +489 -0
- package/dist/review/claude-review/ci-failures.js +350 -0
- package/dist/review/claude-review/follow-up.js +310 -0
- package/dist/review/claude-review/manager.js +686 -0
- package/dist/review/claude-review/persist.js +996 -0
- package/dist/review/claude-review/prompts.js +357 -0
- package/dist/review/claude-review/routes.js +518 -0
- package/dist/review/claude-review/routing.js +61 -0
- package/dist/review/claude-review/specialists.js +190 -0
- package/dist/review/claude-review/threads.js +265 -0
- package/dist/review/claude-review/ticket.js +282 -0
- package/dist/review/clone-hygiene.js +380 -0
- package/dist/review/clone-manager.js +367 -0
- package/dist/review/llm.js +113 -0
- package/dist/review/model-options.js +48 -0
- package/dist/review/plugin-providers.js +12 -0
- package/dist/review/post-review.js +216 -0
- package/dist/review/post-seam.js +161 -0
- package/dist/review/prepare.js +168 -0
- package/dist/review/pricing.js +17 -0
- package/dist/review/schema.js +156 -0
- package/dist/review/submit-map.js +41 -0
- package/dist/review/usage.js +90 -0
- package/dist/shared/claude-review.js +335 -0
- package/dist/shared/conflict-fold.js +151 -0
- package/dist/shared/conflicts.js +30 -0
- package/dist/shared/flow-settings.js +191 -0
- package/dist/shared/index.js +8 -0
- package/dist/shared/my-turn-settings.js +238 -0
- package/dist/shared/pending-rules.js +281 -0
- package/dist/shared/product.js +54 -0
- package/dist/shared/types.js +896 -0
- package/dist/status.js +386 -0
- package/dist/sync/adaptive.js +185 -0
- package/dist/sync/app-attribution.js +66 -0
- package/dist/sync/auth-notices.js +36 -0
- package/dist/sync/backfill-ci-history.js +315 -0
- package/dist/sync/backfill-commit-headlines.js +136 -0
- package/dist/sync/backfill-pr-security.js +175 -0
- package/dist/sync/backfill-review-requests.js +97 -0
- package/dist/sync/benchmark-rollup.js +50 -0
- package/dist/sync/bot-detection.js +309 -0
- package/dist/sync/bot-resolution-markers.js +30 -0
- package/dist/sync/branch-status.js +634 -0
- package/dist/sync/classify-change-shape.js +150 -0
- package/dist/sync/commit-files.js +74 -0
- package/dist/sync/derive-thread-state.js +99 -0
- package/dist/sync/drain-review-threads.js +212 -0
- package/dist/sync/hydrate-detail.js +482 -0
- package/dist/sync/mention-scan.js +89 -0
- package/dist/sync/ml-enrichment.js +478 -0
- package/dist/sync/pr-change-signal.js +96 -0
- package/dist/sync/pr-liveness-sweep.js +139 -0
- package/dist/sync/pr-settle.js +381 -0
- package/dist/sync/refresh-pr.js +163 -0
- package/dist/sync/reparse-vendor-badges.js +495 -0
- package/dist/sync/resync-after-write.js +280 -0
- package/dist/sync/review-fingerprint.js +117 -0
- package/dist/sync/reviewer-behavior.js +103 -0
- package/dist/sync/reviewer-classify.js +503 -0
- package/dist/sync/routing-files.js +97 -0
- package/dist/sync/scheduled-jobs.js +12 -0
- package/dist/sync/scheduler.js +159 -0
- package/dist/sync/security-detect.js +521 -0
- package/dist/sync/sync-manager.js +750 -0
- package/dist/sync/sync-one-pr.js +205 -0
- package/dist/sync/sync-repo.js +400 -0
- package/dist/sync/unsettled-prs.js +506 -0
- package/dist/sync/upsert.js +1190 -0
- package/package.json +56 -0
- package/public/apple-touch-icon.png +0 -0
- package/public/assets/AiFixTab-CQP6PT5u.js +2 -0
- package/public/assets/ClaudeReviewTab-DQJ-58ZA.js +8 -0
- package/public/assets/PrBotBehaviourTab-CCnFrWbC.js +1 -0
- package/public/assets/archivo-latin-600-BN-JkNrl.woff2 +0 -0
- package/public/assets/highlight-BEHUn5zE.css +10 -0
- package/public/assets/highlight-CIIZLa6Z.js +12 -0
- package/public/assets/index-BDnYs6zg.js +73 -0
- package/public/assets/index-mCuI--RC.css +1 -0
- package/public/assets/markdown-I_JLLVAZ.js +32 -0
- package/public/assets/perfProbe-Da13EhTE.js +1 -0
- package/public/assets/tanstack-5qsxxaLe.js +17 -0
- package/public/assets/vis-C3BCkP5U.js +1280 -0
- package/public/assets/vis-ziCVehMy.css +1 -0
- package/public/favicon-16.png +0 -0
- package/public/favicon-32.png +0 -0
- package/public/favicon-48.png +0 -0
- package/public/favicon.svg +5 -0
- package/public/index.html +41 -0
- package/public-landing/apple-touch-icon.png +0 -0
- package/public-landing/assets/archivo-latin-500-BWmvx2Mg.woff2 +0 -0
- package/public-landing/assets/archivo-latin-600-BN-JkNrl.woff2 +0 -0
- package/public-landing/assets/index-CA3eEGXO.js +40 -0
- package/public-landing/assets/index-naQrQ6Fe.css +1 -0
- package/public-landing/assets/jetbrains-mono-latin-400-RruCX7RW.woff2 +0 -0
- package/public-landing/assets/newsreader-latin-400-DExrRRrN.woff2 +0 -0
- package/public-landing/assets/newsreader-latin-400-italic-b0I-AwbV.woff2 +0 -0
- package/public-landing/bots/index.html +156 -0
- package/public-landing/contact/index.html +156 -0
- package/public-landing/cookies/index.html +156 -0
- package/public-landing/demo/limn-walkthrough-poster.jpg +0 -0
- package/public-landing/demo/limn-walkthrough.cues.json +44 -0
- package/public-landing/demo/limn-walkthrough.mp4 +0 -0
- package/public-landing/favicon-16.png +0 -0
- package/public-landing/favicon-32.png +0 -0
- package/public-landing/favicon-48.png +0 -0
- package/public-landing/favicon.svg +5 -0
- package/public-landing/features/index.html +156 -0
- package/public-landing/for-developers/index.html +156 -0
- package/public-landing/for-managers/index.html +156 -0
- package/public-landing/how-it-works/index.html +156 -0
- package/public-landing/how-we-measure/index.html +156 -0
- package/public-landing/icon-192.png +0 -0
- package/public-landing/icon-512.png +0 -0
- package/public-landing/index.html +156 -0
- package/public-landing/insights/index.html +156 -0
- package/public-landing/og-image.png +0 -0
- package/public-landing/pricing/index.html +156 -0
- package/public-landing/privacy/index.html +156 -0
- package/public-landing/pro/index.html +156 -0
- package/public-landing/reviews/index.html +156 -0
- package/public-landing/robots.txt +8 -0
- package/public-landing/shots/benchmark.png +0 -0
- package/public-landing/shots/bot-roi.png +0 -0
- package/public-landing/shots/bot-settings.png +0 -0
- package/public-landing/shots/chronology.png +0 -0
- package/public-landing/shots/feed.png +0 -0
- package/public-landing/shots/flow-metrics.png +0 -0
- package/public-landing/shots/free-reports.png +0 -0
- package/public-landing/shots/pending-board.png +0 -0
- package/public-landing/shots/pending-card.png +0 -0
- package/public-landing/shots/period-report.png +0 -0
- package/public-landing/shots/pr-detail.png +0 -0
- package/public-landing/shots/pr-threads.png +0 -0
- package/public-landing/shots/reach.png +0 -0
- package/public-landing/shots/repo-rows.png +0 -0
- package/public-landing/shots/severity-findings.png +0 -0
- package/public-landing/shots/severity-strip.png +0 -0
- package/public-landing/site.webmanifest +14 -0
- package/public-landing/sitemap.xml +51 -0
- package/public-landing/terms/index.html +156 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
-- DROP `my_turn_dismissals` — the "Done" button's table, and the whole dismissal subsystem with
|
|
2
|
+
-- it. The Postgres twin is migrations-pg/0047_drop_my_turn_dismissals.sql.
|
|
3
|
+
--
|
|
4
|
+
-- ⚠ THIS IS DESTRUCTIVE AND ONE-WAY. There is no down migration and no archive: the rows are
|
|
5
|
+
-- deleted when this runs (65 of them on the author's own database). Nothing reads them — the ball
|
|
6
|
+
-- rule landed in `getMyTurn` first, so the table has already been inert for a release — but a
|
|
7
|
+
-- restore from before this migration is the only way back.
|
|
8
|
+
--
|
|
9
|
+
-- WHY IT IS GOING. Each row said "I have seen this one", written by hand because the fold could
|
|
10
|
+
-- not work it out: My Turn had no predicate for "you already acted on this PR", so a card the user
|
|
11
|
+
-- had reviewed, replied to or pushed to went on claiming their turn, and the only way to clear it
|
|
12
|
+
-- was to tell the app. That predicate now exists. THE BALL RULE — an action is owed only while
|
|
13
|
+
-- nothing the viewer has done since the last related event discharges it — is state-derived and
|
|
14
|
+
-- recomputed on every read, so a card leaves the board the moment the user does the work. The
|
|
15
|
+
-- dismissal was compensation for a missing fold, and the fold is no longer missing.
|
|
16
|
+
--
|
|
17
|
+
-- AND IT WAS THE WRONG SHAPE ANYWAY. A dismissal never expired. Press "Done" on a review request
|
|
18
|
+
-- and the request stayed dismissed while the work stayed real — the acknowledgement outlived the
|
|
19
|
+
-- fact it acknowledged. That is ticket-queue behaviour: a list you maintain by hand, kept true by
|
|
20
|
+
-- grooming it. This product's claim is the opposite one — the board is derived from GitHub, so it
|
|
21
|
+
-- is right without being tended — and a button that let a user hide a fact from themselves was
|
|
22
|
+
-- the one place the claim was false. Real evidence of this: on the author's account a PR whose
|
|
23
|
+
-- ball was genuinely back in their court stayed invisible for weeks behind a stored dismissal.
|
|
24
|
+
--
|
|
25
|
+
-- WHAT WENT WITH IT, in the same change: POST /api/my-turn/dismiss, GET /api/my-turn/done,
|
|
26
|
+
-- POST /api/my-turn/undismiss, `getCompletedDismissals`, `getActionableActivityIds` (which existed
|
|
27
|
+
-- only to tell the "Done" tab whether restoring an entry would do anything), the SPA's Done button
|
|
28
|
+
-- and the `dismissRefId` wire field. GET /api/my-turn is the only my-turn route left.
|
|
29
|
+
--
|
|
30
|
+
-- The two indexes go with the table; SQLite drops them automatically, and they are named here so
|
|
31
|
+
-- a reader diffing this against 0002_famous_sersi.sql / 0008_multitenant_accounts.sql can see that
|
|
32
|
+
-- nothing is left behind: `mtd_kind_ref_ux` (kind, ref_id) and `mtd_account_idx` (account_id).
|
|
33
|
+
DROP TABLE `my_turn_dismissals`;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
-- Two anchors the auto-merge watcher DISARMS on, moved out of process memory onto the row.
|
|
2
|
+
-- The Postgres twin is migrations-pg/0048_auto_merge_durable_anchors.sql.
|
|
3
|
+
--
|
|
4
|
+
-- WHY. Both facts lived in module-level Maps in `merge/auto-merge-runner.ts` (`pendingUpdates`,
|
|
5
|
+
-- and the retarget guard's implicit reliance on a synced column read at run time). A Map is fine
|
|
6
|
+
-- for a hint. It is not fine for a fact the watcher ends an intent on, because losing it does not
|
|
7
|
+
-- read as "I forgot" — it reads as "something unexplained happened to this branch", and the safe
|
|
8
|
+
-- response to an unexplained head move is to disarm. Under `pnpm dev` that is every file save;
|
|
9
|
+
-- in cloud it is every deploy. Measured on the author's own account, 3 of 21 intents died and a
|
|
10
|
+
-- further 2 were at risk from exactly this class of bookkeeping loss.
|
|
11
|
+
--
|
|
12
|
+
-- ⚠ BOTH ARE NULLABLE WITH NO DEFAULT, AND NULL MEANS "NOT RECORDED", NEVER A VALUE.
|
|
13
|
+
-- `expected_base_ref` is null on every row armed before this migration; the retarget guard falls
|
|
14
|
+
-- back to the synced base ref for those, which is exactly what it did before, so no already-armed
|
|
15
|
+
-- intent changes behaviour. A DEFAULT here would assert the user consented to a branch nobody
|
|
16
|
+
-- asked them about.
|
|
17
|
+
|
|
18
|
+
-- The base branch the SPA was showing when the user armed. The head pin cannot see a retarget
|
|
19
|
+
-- (PATCH pulls/{n} with a new `base` leaves head.sha alone), so consent to "merge into main"
|
|
20
|
+
-- needs its own anchor. It was being approximated by reading `pull_requests.base_ref_name` at RUN
|
|
21
|
+
-- time — a value the sync owns and may correct at any moment, at which point the watcher reports
|
|
22
|
+
-- a retarget that never happened.
|
|
23
|
+
ALTER TABLE `auto_merge_requests` ADD `expected_base_ref` text;--> statement-breakpoint
|
|
24
|
+
-- The head SHA an in-flight update-branch was issued AGAINST. GitHub's update-branch returns 202
|
|
25
|
+
-- with no handle to poll, so the head move it causes arrives on a later tick; without this the
|
|
26
|
+
-- watcher cannot tell its OWN merge commit from a human push and disarms with "the branch moved".
|
|
27
|
+
ALTER TABLE `auto_merge_requests` ADD `update_issued_against_oid` text;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
-- BLAST RADIUS reading settings (CORE, free, no AI). How aggressively to read a pull request's
|
|
2
|
+
-- REACH — the orthogonal companion to the large-PR flag's `large_pr_code_loc_threshold` (0057),
|
|
3
|
+
-- which reads its SIZE.
|
|
4
|
+
--
|
|
5
|
+
-- ONE PER-ACCOUNT SETTING, for the same reason as that one: the comparison is render-time, it
|
|
6
|
+
-- rides /api/me, and a per-workspace value would put a new "workspace not resolved yet"
|
|
7
|
+
-- null-state on four surfaces (including the vis-timeline tooltip, which is raw HTML with no
|
|
8
|
+
-- hook to read a workspace from).
|
|
9
|
+
--
|
|
10
|
+
-- ONE JSON COLUMN rather than six integer ones: the shape is `{sensitivity, surfacesOff[],
|
|
11
|
+
-- overrides?}` — a settings blob with exactly one writer (PUT /api/me/blast-radius-config, which
|
|
12
|
+
-- validates it), and nothing joins, filters or orders on any field inside it.
|
|
13
|
+
--
|
|
14
|
+
-- NULLABLE with NO default and NO backfill, exactly like 0057: NULL means "the user has never
|
|
15
|
+
-- expressed an opinion" and the SPA resolves the product defaults. Two states, so a future change
|
|
16
|
+
-- to those defaults reaches every account that never overrode them — which a backfilled blob
|
|
17
|
+
-- would freeze. ⚠ The defaults are NOT mirrored backend-side: packages/shared's BLAST_THRESHOLDS
|
|
18
|
+
-- is an 18-number table and `shared` is types-only on that side (PACKAGING), so /api/me echoes
|
|
19
|
+
-- this column RAW and the SPA's one resolver applies it.
|
|
20
|
+
-- The Postgres twin is migrations-pg/0049_blast_radius_config.sql.
|
|
21
|
+
ALTER TABLE `accounts` ADD `blast_radius_config` text;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
-- BLAST RADIUS: the per-repo CO-CHANGE index (CORE, free, no AI, no GitHub calls).
|
|
2
|
+
--
|
|
3
|
+
-- "Which files in this repository does everything else change with?" — the cross-file dependency
|
|
4
|
+
-- reading, derived ENTIRELY from data already stored (`pull_requests.files` on MERGED pull
|
|
5
|
+
-- requests). A real import graph would need file CONTENTS, i.e. a GitHub fetch per file, and the
|
|
6
|
+
-- Pending board may not fetch on mount.
|
|
7
|
+
--
|
|
8
|
+
-- DERIVED, so this table is a CACHE: dropping it loses nothing but a rebuild, and it carries no
|
|
9
|
+
-- foreign-key cascade duty of its own. It still denormalizes `account_id` like every other anchor
|
|
10
|
+
-- table, and is therefore in `accountScopedTables()`.
|
|
11
|
+
--
|
|
12
|
+
-- ⚠ IT STORES ONLY THE HUBS. A path below `hub_bar` is simply absent, so the JSON stays small
|
|
13
|
+
-- (measured: 84 paths across 7 real repositories, vs 11,651 distinct paths seen).
|
|
14
|
+
--
|
|
15
|
+
-- ⚠ `hub_bar` IS max(repo p90, an absolute floor), AND BOTH HALVES ARE LOAD-BEARING. A p90 alone
|
|
16
|
+
-- is exceeded by a tenth of paths by construction, so a repository with no coupling still
|
|
17
|
+
-- publishes "hubs": measured, a config repo produced 77 of them — eight per-environment copies of
|
|
18
|
+
-- one service's .env file. Adding the absolute floor took that repo to zero while leaving
|
|
19
|
+
-- `redis.go`, `src/renderers/WebGLRenderer.js` and `crates/bevy_render/src/lib.rs` standing.
|
|
20
|
+
-- The Postgres twin is migrations-pg/0050_repo_file_coupling.sql.
|
|
21
|
+
CREATE TABLE `repo_file_coupling` (
|
|
22
|
+
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
|
23
|
+
`account_id` integer NOT NULL,
|
|
24
|
+
`repo_id` integer NOT NULL,
|
|
25
|
+
`hub_bar` integer NOT NULL,
|
|
26
|
+
`pr_count` integer NOT NULL,
|
|
27
|
+
`hubs` text NOT NULL,
|
|
28
|
+
`built_at` integer DEFAULT (unixepoch()) NOT NULL,
|
|
29
|
+
FOREIGN KEY (`account_id`) REFERENCES `accounts`(`id`) ON UPDATE no action ON DELETE no action,
|
|
30
|
+
FOREIGN KEY (`repo_id`) REFERENCES `repos`(`id`) ON UPDATE no action ON DELETE no action
|
|
31
|
+
);
|
|
32
|
+
--> statement-breakpoint
|
|
33
|
+
CREATE UNIQUE INDEX `rfc_account_repo` ON `repo_file_coupling` (`account_id`,`repo_id`);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
-- BLAST RADIUS: what a pull request's code churn CONSISTS of (CORE, free, no AI).
|
|
2
|
+
--
|
|
3
|
+
-- Blast radius answers "how far can this reach" from the file PATHS, which is right about the
|
|
4
|
+
-- FILE and can be wrong about the CHANGE. The case: golang/go#80721, "crypto/hpke: document
|
|
5
|
+
-- sequence counter size" — one file, +4 −2, every changed line a `//` doc comment, flagged HIGH
|
|
6
|
+
-- because `crypto/` is a contract surface. `content_kind` is read from the DIFF and caps that at
|
|
7
|
+
-- medium (never at LOW — a comment in a crypto file is still a change to a file that matters).
|
|
8
|
+
--
|
|
9
|
+
-- ⚠ NULL IS "WE DID NOT LOOK", AND IT IS THE COMMON CASE BY DESIGN. Knowing this costs a REST
|
|
10
|
+
-- call per pull request, so `sync/classify-change-shape.ts` fetches it only for the narrow
|
|
11
|
+
-- population where it could change the level — measured at 26 of 1,566 open pull requests (1.7%).
|
|
12
|
+
-- No backfill: every other row stays null forever, and no reader may treat null as 'code'.
|
|
13
|
+
--
|
|
14
|
+
-- ⚠ `content_kind_sha` IS NOT OPTIONAL BOOKKEEPING. A diff read is only true of the commit it
|
|
15
|
+
-- read. Without it a "comments only" verdict survives a force-push that added a schema change,
|
|
16
|
+
-- and the level stays capped on evidence that no longer exists. Every reader compares it against
|
|
17
|
+
-- `head_sha` and treats a mismatch as null.
|
|
18
|
+
-- The Postgres twin is migrations-pg/0051_pr_content_kind.sql.
|
|
19
|
+
ALTER TABLE `pull_requests` ADD `content_kind` text;
|
|
20
|
+
--> statement-breakpoint
|
|
21
|
+
ALTER TABLE `pull_requests` ADD `content_kind_sha` text;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
-- CHRONOLOGY'S WORKING HOURS AND WAIT BUDGETS, per workspace (CORE, free, no AI).
|
|
2
|
+
--
|
|
3
|
+
-- Chronology charges every hour a pull request waits to whoever it is waiting on. Measured on a
|
|
4
|
+
-- real workspace, 73% of those hours fell outside the team's working day — a PR opened on Friday
|
|
5
|
+
-- afternoon was charged a weekend. This column holds the workspace's time zone, working days and
|
|
6
|
+
-- hours, and a budget per wait ("good" / "acceptable", in working hours).
|
|
7
|
+
--
|
|
8
|
+
-- ⚠ OVERRIDES ONLY. NULL until someone changes something, then only the fields they changed.
|
|
9
|
+
-- Every reader resolves through `resolveFlowSettings` in packages/shared/src/flow-settings.ts,
|
|
10
|
+
-- so a later change to a product default reaches every workspace that never overrode it.
|
|
11
|
+
-- No backfill: NULL is "every default", which is correct for every existing row.
|
|
12
|
+
-- The Postgres twin is migrations-pg/0052_workspace_flow_settings.sql.
|
|
13
|
+
ALTER TABLE `workspaces` ADD `flow_settings` text;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
-- REVIEW-REQUEST HISTORY (CORE, free, no AI) — for Chronology's "asked to first look".
|
|
2
|
+
--
|
|
3
|
+
-- `review_requests` holds only OUTSTANDING requests, and GitHub removes one the moment the person
|
|
4
|
+
-- reviews — so for a merged PR we could not say whether a person or a team was asked, or how long
|
|
5
|
+
-- it was from the request to anyone looking. This table keeps every ReviewRequestedEvent and
|
|
6
|
+
-- ReviewRequestRemovedEvent from the PR's timeline (the first 25 per PR).
|
|
7
|
+
--
|
|
8
|
+
-- A PR CHILD with no account_id (the review_requests precedent): deleted by deletePrSubtree AND
|
|
9
|
+
-- deleteRepo, erased through the repo loop. Immutable: upserted DO NOTHING on (pr_id, node id).
|
|
10
|
+
--
|
|
11
|
+
-- `pull_requests.review_requests_synced_at` marks a PR whose history we actually RECEIVED. NULL is
|
|
12
|
+
-- "not known", which Chronology must not read as "never requested"; it is also the one-time
|
|
13
|
+
-- backfill's worklist (sync/backfill-review-requests.ts). The GraphQL selection that feeds this was
|
|
14
|
+
-- measured at 0 extra points per page (15 → 15, rateLimit dryRun, pullRequests(first: 25)).
|
|
15
|
+
-- The Postgres twin is migrations-pg/0053_review_request_events.sql.
|
|
16
|
+
CREATE TABLE `review_request_events` (
|
|
17
|
+
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
|
18
|
+
`pr_id` integer NOT NULL,
|
|
19
|
+
`github_node_id` text NOT NULL,
|
|
20
|
+
`kind` text NOT NULL,
|
|
21
|
+
`occurred_at` integer NOT NULL,
|
|
22
|
+
`reviewer_kind` text NOT NULL,
|
|
23
|
+
`reviewer_user_id` integer,
|
|
24
|
+
`team_slug` text,
|
|
25
|
+
FOREIGN KEY (`pr_id`) REFERENCES `pull_requests`(`id`) ON UPDATE no action ON DELETE no action,
|
|
26
|
+
FOREIGN KEY (`reviewer_user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE no action
|
|
27
|
+
);
|
|
28
|
+
--> statement-breakpoint
|
|
29
|
+
CREATE UNIQUE INDEX `review_request_events_pr_node` ON `review_request_events` (`pr_id`,`github_node_id`);
|
|
30
|
+
--> statement-breakpoint
|
|
31
|
+
ALTER TABLE `pull_requests` ADD `review_requests_synced_at` integer;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
-- DEPENDENCY + SECURITY SIGNALS on a pull request (CORE, free, no AI).
|
|
2
|
+
--
|
|
3
|
+
-- Four small DERIVED columns, read at sync from the PR's own title, branch, labels and FULL
|
|
4
|
+
-- `bodyText` by `sync/security-detect.ts`:
|
|
5
|
+
-- `dependency_vendor` — the dependency/remediation tool whose OWN marker is on the PR
|
|
6
|
+
-- (`dependabot/` branch, `[Snyk] ` title, Dependabot's commands footer…).
|
|
7
|
+
-- CONTENT ONLY, never the author login: a Snyk fix opened under a
|
|
8
|
+
-- person's token still carries Snyk's marker, and the author half is
|
|
9
|
+
-- resolved on read, per workspace.
|
|
10
|
+
-- `security_fix` — 'proven' (the tool's own security marker), 'inferred' (Dependabot's
|
|
11
|
+
-- ecosystem-named group with its truncation note), or NULL.
|
|
12
|
+
-- `advisory_ids` — the advisory ids the VENDOR-SELECTED fields name (JSON array), NULL
|
|
13
|
+
-- when there are none. Never the release notes an ordinary bump quotes.
|
|
14
|
+
-- `security_checked_at` — when the classification was written. NULL is "never classified" and
|
|
15
|
+
-- is the one-shot backfill's worklist (`sync/backfill-pr-security.ts`).
|
|
16
|
+
--
|
|
17
|
+
-- ⚠ NO BODIES. Lean storage holds: the body is read in memory during the sync and only the
|
|
18
|
+
-- verdict is kept.
|
|
19
|
+
--
|
|
20
|
+
-- ⚠ THE WRITE IS THREE-STATE, and the four columns move together or not at all. GitHub types
|
|
21
|
+
-- `bodyText` String!, so a null can only be a partial response and an absent key a response that
|
|
22
|
+
-- never carried the selection — both LEARN NOTHING and write nothing. A string, even '', is a
|
|
23
|
+
-- positive statement, and the classification is written whole, NULLs included.
|
|
24
|
+
--
|
|
25
|
+
-- ⚠ DETECTION CANNOT USE `search_index`. It caps the body at 4,000 characters, and Dependabot's
|
|
26
|
+
-- security footer is the LAST line of a body that runs to 65 KB.
|
|
27
|
+
--
|
|
28
|
+
-- WHY THE `workspace_reviewers` UPDATES ARE HERE. Six automation logins (and Semgrep's per-org
|
|
29
|
+
-- `semgrep-code-<org>` App) joined the vocabulary in the same change. The stored role and kind
|
|
30
|
+
-- win over the login seed on read, so widening the vocabulary in code alone never reaches a
|
|
31
|
+
-- workspace whose Bots tab already classified these logins — the 0053/0054 precedent, with the
|
|
32
|
+
-- same three load-bearing conditions: `source <> 'manual'` (a role a PERSON chose is never
|
|
33
|
+
-- re-derived), `identity_source <> 'manual'` + `kind IN ('in_house','vendor')` (only an UNBRANDED
|
|
34
|
+
-- identity is upgraded, and never one a person named), and `label = NULL` (the label caches the
|
|
35
|
+
-- old "In-house AI" name). `[bot]` is stripped because `x` and `x[bot]` are separate `users` rows.
|
|
36
|
+
-- The Postgres twin is migrations-pg/0054_pr_security_signals.sql.
|
|
37
|
+
ALTER TABLE `pull_requests` ADD `dependency_vendor` text;
|
|
38
|
+
--> statement-breakpoint
|
|
39
|
+
ALTER TABLE `pull_requests` ADD `security_fix` text;
|
|
40
|
+
--> statement-breakpoint
|
|
41
|
+
ALTER TABLE `pull_requests` ADD `advisory_ids` text;
|
|
42
|
+
--> statement-breakpoint
|
|
43
|
+
ALTER TABLE `pull_requests` ADD `security_checked_at` integer;
|
|
44
|
+
--> statement-breakpoint
|
|
45
|
+
UPDATE `workspace_reviewers`
|
|
46
|
+
SET `role` = 'dependency'
|
|
47
|
+
WHERE `source` <> 'manual'
|
|
48
|
+
AND `author_user_id` IN (
|
|
49
|
+
SELECT `id` FROM `users` WHERE replace(lower(`github_login`), '[bot]', '') IN
|
|
50
|
+
('snyk-io', 'aikido-autofix', 'mend-for-github-com')
|
|
51
|
+
);--> statement-breakpoint
|
|
52
|
+
UPDATE `workspace_reviewers`
|
|
53
|
+
SET `role` = 'quality_check'
|
|
54
|
+
WHERE `source` <> 'manual'
|
|
55
|
+
AND `author_user_id` IN (
|
|
56
|
+
SELECT `id` FROM `users` WHERE replace(lower(`github_login`), '[bot]', '') IN ('endor-labs-pro')
|
|
57
|
+
OR lower(`github_login`) LIKE 'semgrep-code-%' OR lower(`github_login`) LIKE 'semgrepcode-%'
|
|
58
|
+
);--> statement-breakpoint
|
|
59
|
+
UPDATE `workspace_reviewers`
|
|
60
|
+
SET `role` = 'code_agent'
|
|
61
|
+
WHERE `source` <> 'manual'
|
|
62
|
+
AND `author_user_id` IN (
|
|
63
|
+
SELECT `id` FROM `users` WHERE replace(lower(`github_login`), '[bot]', '') IN
|
|
64
|
+
('step-security-bot', 'orbisai0security')
|
|
65
|
+
);--> statement-breakpoint
|
|
66
|
+
UPDATE `workspace_reviewers` SET `kind` = 'snyk', `label` = NULL
|
|
67
|
+
WHERE `identity_source` <> 'manual' AND `kind` IN ('in_house', 'vendor')
|
|
68
|
+
AND `author_user_id` IN (SELECT `id` FROM `users` WHERE replace(lower(`github_login`), '[bot]', '') IN ('snyk-io'));--> statement-breakpoint
|
|
69
|
+
UPDATE `workspace_reviewers` SET `kind` = 'aikido', `label` = NULL
|
|
70
|
+
WHERE `identity_source` <> 'manual' AND `kind` IN ('in_house', 'vendor')
|
|
71
|
+
AND `author_user_id` IN (SELECT `id` FROM `users` WHERE replace(lower(`github_login`), '[bot]', '') IN ('aikido-autofix'));--> statement-breakpoint
|
|
72
|
+
UPDATE `workspace_reviewers` SET `kind` = 'mend', `label` = NULL
|
|
73
|
+
WHERE `identity_source` <> 'manual' AND `kind` IN ('in_house', 'vendor')
|
|
74
|
+
AND `author_user_id` IN (SELECT `id` FROM `users` WHERE replace(lower(`github_login`), '[bot]', '') IN ('mend-for-github-com'));--> statement-breakpoint
|
|
75
|
+
UPDATE `workspace_reviewers` SET `kind` = 'endor', `label` = NULL
|
|
76
|
+
WHERE `identity_source` <> 'manual' AND `kind` IN ('in_house', 'vendor')
|
|
77
|
+
AND `author_user_id` IN (SELECT `id` FROM `users` WHERE replace(lower(`github_login`), '[bot]', '') IN ('endor-labs-pro'));--> statement-breakpoint
|
|
78
|
+
UPDATE `workspace_reviewers` SET `kind` = 'semgrep', `label` = NULL
|
|
79
|
+
WHERE `identity_source` <> 'manual' AND `kind` IN ('in_house', 'vendor')
|
|
80
|
+
AND `author_user_id` IN (SELECT `id` FROM `users` WHERE lower(`github_login`) LIKE 'semgrep-code-%' OR lower(`github_login`) LIKE 'semgrepcode-%');--> statement-breakpoint
|
|
81
|
+
UPDATE `workspace_reviewers` SET `kind` = 'step_security', `label` = NULL
|
|
82
|
+
WHERE `identity_source` <> 'manual' AND `kind` IN ('in_house', 'vendor')
|
|
83
|
+
AND `author_user_id` IN (SELECT `id` FROM `users` WHERE replace(lower(`github_login`), '[bot]', '') IN ('step-security-bot'));--> statement-breakpoint
|
|
84
|
+
UPDATE `workspace_reviewers` SET `kind` = 'orbisai', `label` = NULL
|
|
85
|
+
WHERE `identity_source` <> 'manual' AND `kind` IN ('in_house', 'vendor')
|
|
86
|
+
AND `author_user_id` IN (SELECT `id` FROM `users` WHERE replace(lower(`github_login`), '[bot]', '') IN ('orbisai0security'));
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
-- MY TURN SETTINGS (CORE, free, no AI) + the MENTION CLOCK.
|
|
2
|
+
--
|
|
3
|
+
-- accounts.my_turn_settings: the reader's My Turn types, type order and ranking weights, stored as
|
|
4
|
+
-- OVERRIDES ONLY. NULL = the product defaults, so a later change to a default reaches everyone who
|
|
5
|
+
-- never changed it (the 0062 blast_radius_config rule). No default, no backfill. Resolved by
|
|
6
|
+
-- packages/shared resolveMyTurnSettings; written only by PUT /api/me/my-turn-settings.
|
|
7
|
+
--
|
|
8
|
+
-- pr_mentions.mentioned_at / mentioned_by_user_id: WHEN a person last @-mentioned the viewer on the
|
|
9
|
+
-- PR, and who. The My Turn mention card clears when the viewer acts AFTER this moment, which needs
|
|
10
|
+
-- the moment. NULL until the mention scanner's next tick restamps every row (sync/mention-scan.ts);
|
|
11
|
+
-- no backfill here, because the scanner re-derives the whole set every tick anyway. A NULL row
|
|
12
|
+
-- produces no card.
|
|
13
|
+
-- The Postgres twin is migrations-pg/0055_my_turn_settings.sql.
|
|
14
|
+
ALTER TABLE `accounts` ADD `my_turn_settings` text;
|
|
15
|
+
--> statement-breakpoint
|
|
16
|
+
ALTER TABLE `pr_mentions` ADD `mentioned_at` integer;
|
|
17
|
+
--> statement-breakpoint
|
|
18
|
+
ALTER TABLE `pr_mentions` ADD `mentioned_by_user_id` integer;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
-- MY TURN DISMISSALS (CORE, free, both modes) — "take this off my plate for now".
|
|
2
|
+
--
|
|
3
|
+
-- ⚠ THE SAME TABLE NAME AS THE ONE 0060 DROPPED, AND NOT THE SAME CONTRACT. 0060's table backed a
|
|
4
|
+
-- "Done" button whose rows NEVER EXPIRED: press it on a review request and the request stayed
|
|
5
|
+
-- hidden while the work stayed real — on the author's account a PR whose ball was genuinely back
|
|
6
|
+
-- in their court sat invisible for weeks. Read 0060's header before touching this; everything it
|
|
7
|
+
-- objected to is answered here by what the row does NOT decide:
|
|
8
|
+
--
|
|
9
|
+
-- • it holds ONE timestamp. `getMyTurn` hides a dismissed subject's items only while each item's
|
|
10
|
+
-- own clock is at or before `dismissed_at`; anything that happens LATER shows again, alone;
|
|
11
|
+
-- • a subject with NO My Turn item at all (you acted, it closed, the request was withdrawn)
|
|
12
|
+
-- DISCHARGES its row, so a later summons starts fresh instead of arriving already dismissed.
|
|
13
|
+
--
|
|
14
|
+
-- So a dismissal never outlives the thing it dismissed. The ball rule still decides what is on the
|
|
15
|
+
-- plate; this only lets the reader set one item down until something new happens to it.
|
|
16
|
+
--
|
|
17
|
+
-- ONE ROW PER SUBJECT — a pull request (`pr_id`) or, for a red default branch, a repository
|
|
18
|
+
-- (`repo_id`); exactly one is set. Never per card: a PR can hold several My Turn jobs, and
|
|
19
|
+
-- dismissing the one on screen must not surface the next one behind it.
|
|
20
|
+
--
|
|
21
|
+
-- Both ids arrive in a request path, so tenancy is STRUCTURAL: composite FKs against
|
|
22
|
+
-- `(id, account_id)`. `repos_id_account` already exists (0042); `pull_requests_id_account` is new
|
|
23
|
+
-- here and exists only as that parent key (`id` is the primary key, so it is never a lookup). A
|
|
24
|
+
-- composite FK with a NULL member is not checked (MATCH SIMPLE), which is what lets one table carry
|
|
25
|
+
-- both subject kinds. The Postgres twin is migrations-pg/0056_my_turn_dismissals.sql.
|
|
26
|
+
CREATE UNIQUE INDEX IF NOT EXISTS `pull_requests_id_account` ON `pull_requests` (`id`,`account_id`);
|
|
27
|
+
--> statement-breakpoint
|
|
28
|
+
CREATE TABLE IF NOT EXISTS `my_turn_dismissals` (
|
|
29
|
+
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
|
30
|
+
`account_id` integer NOT NULL,
|
|
31
|
+
`pr_id` integer,
|
|
32
|
+
`repo_id` integer,
|
|
33
|
+
`dismissed_at` integer NOT NULL,
|
|
34
|
+
FOREIGN KEY (`account_id`) REFERENCES `accounts`(`id`) ON UPDATE no action ON DELETE cascade,
|
|
35
|
+
CONSTRAINT `my_turn_dismissals_pr_account_fk` FOREIGN KEY (`pr_id`,`account_id`) REFERENCES `pull_requests`(`id`,`account_id`) ON UPDATE no action ON DELETE cascade,
|
|
36
|
+
CONSTRAINT `my_turn_dismissals_repo_account_fk` FOREIGN KEY (`repo_id`,`account_id`) REFERENCES `repos`(`id`,`account_id`) ON UPDATE no action ON DELETE cascade
|
|
37
|
+
);
|
|
38
|
+
--> statement-breakpoint
|
|
39
|
+
CREATE UNIQUE INDEX IF NOT EXISTS `my_turn_dismissals_account_pr` ON `my_turn_dismissals` (`account_id`,`pr_id`);
|
|
40
|
+
--> statement-breakpoint
|
|
41
|
+
CREATE UNIQUE INDEX IF NOT EXISTS `my_turn_dismissals_account_repo` ON `my_turn_dismissals` (`account_id`,`repo_id`);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
-- CLAUDE REVIEW: FOLLOW-UP ON THE PREVIOUS REVIEW + THE OPTIONAL USER STORY (local-only feature).
|
|
2
|
+
--
|
|
3
|
+
-- claude_reviews.ticket: the user story or task the run was given ({title, description,
|
|
4
|
+
-- acceptanceCriteria, criteria[]}, criteria = the server's AC1..n split). Written at QUEUE time,
|
|
5
|
+
-- so a failed or cancelled run still prefills the panel on the next run.
|
|
6
|
+
-- claude_reviews.ticket_assessment: the server-validated assessment against it (each criterion
|
|
7
|
+
-- answered exactly once; one Claude skipped is 'not_checked').
|
|
8
|
+
-- claude_reviews.follow_up: what this run found about the PREVIOUS succeeded review's findings
|
|
9
|
+
-- (addressed / partly / not / no longer applies / not checked) + that review's id and head.
|
|
10
|
+
-- claude_review_findings.prior_finding_id: the previous-review finding this one RE-RAISES. A SOFT
|
|
11
|
+
-- reference with NO FK: it always points at a finding of the SAME PR, and retention.ts +
|
|
12
|
+
-- deleteRepo delete a PR's findings in one statement, so an FK would only add delete-ordering risk.
|
|
13
|
+
--
|
|
14
|
+
-- All four are nullable with no backfill: an older run simply has none of them.
|
|
15
|
+
-- The Postgres twin is migrations-pg/0057_claude_review_follow_up_ticket.sql.
|
|
16
|
+
ALTER TABLE `claude_reviews` ADD `ticket` text;
|
|
17
|
+
--> statement-breakpoint
|
|
18
|
+
ALTER TABLE `claude_reviews` ADD `ticket_assessment` text;
|
|
19
|
+
--> statement-breakpoint
|
|
20
|
+
ALTER TABLE `claude_reviews` ADD `follow_up` text;
|
|
21
|
+
--> statement-breakpoint
|
|
22
|
+
ALTER TABLE `claude_review_findings` ADD `prior_finding_id` integer;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
-- CLAUDE REVIEW: WHO STARTED THE RUN (local-only feature).
|
|
2
|
+
--
|
|
3
|
+
-- claude_reviews.trigger: 'manual' (a person pressed Review) or 'auto' (the per-workspace auto
|
|
4
|
+
-- review sweeper in the Pro plugin started it for a newly opened human PR). NOT NULL DEFAULT
|
|
5
|
+
-- 'manual', so every existing row reads as what it was: a click.
|
|
6
|
+
--
|
|
7
|
+
-- It is a CORE column, not a plugin table, because a CORE read needs it: `getUnactionedClaudeReviews`
|
|
8
|
+
-- carries it to the My Turn "Claude review ready" card, which labels an AUTO run "Auto review".
|
|
9
|
+
-- The row is core-owned already; a side table would be a second place to join for one enum.
|
|
10
|
+
-- The Postgres twin is migrations-pg/0058_claude_review_trigger.sql.
|
|
11
|
+
ALTER TABLE `claude_reviews` ADD `trigger` text DEFAULT 'manual' NOT NULL;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
-- MY TURN "PUSHED SINCE": THE FIRST LINE OF EACH COMMIT MESSAGE.
|
|
2
|
+
--
|
|
3
|
+
-- commits.message_headline: GitHub's `messageHeadline` (the subject line), at most 200 chars.
|
|
4
|
+
-- The "Pushed since" card on the Pending board lists what was pushed after your last action, and
|
|
5
|
+
-- the board may not fetch on mount, so the line has to be stored.
|
|
6
|
+
--
|
|
7
|
+
-- It is NOT `message`. `message` is the full body, lean-gated (never fetched or stored unless
|
|
8
|
+
-- PERSIST_BODIES=true) and hydrated on demand for PR detail. The headline is one short line and is
|
|
9
|
+
-- fetched on EVERY walk, in both storage modes. It is written only when GitHub sent it; NULL means
|
|
10
|
+
-- "not synced yet", never "empty" (the backfill in sync/backfill-commit-headlines.ts fills open
|
|
11
|
+
-- PRs after a walk).
|
|
12
|
+
-- The Postgres twin is migrations-pg/0059_commit_message_headline.sql.
|
|
13
|
+
ALTER TABLE `commits` ADD `message_headline` text;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
-- CLAUDE REVIEW CHAT (local-only feature): one row per chat message about one succeeded review —
|
|
2
|
+
-- a general thread (`finding_id` NULL) and one thread per finding. The transcript the model sees
|
|
3
|
+
-- is rebuilt SERVER-SIDE from these rows each turn. Never carried across reviews.
|
|
4
|
+
--
|
|
5
|
+
-- `review_id` arrives in a request path, so tenancy is STRUCTURAL: a composite FK against
|
|
6
|
+
-- claude_reviews(id, account_id), whose parent key `claude_reviews_id_account` is new here (`id` is
|
|
7
|
+
-- the primary key, so it is never a lookup). Both delete paths (deleteRepo, retention's
|
|
8
|
+
-- deletePrSubtree) and eraseAccountData delete these rows explicitly, before their parents.
|
|
9
|
+
-- The Postgres twin is migrations-pg/0060_claude_review_chat.sql.
|
|
10
|
+
CREATE UNIQUE INDEX IF NOT EXISTS `claude_reviews_id_account` ON `claude_reviews` (`id`,`account_id`);
|
|
11
|
+
--> statement-breakpoint
|
|
12
|
+
CREATE TABLE IF NOT EXISTS `claude_review_chat_messages` (
|
|
13
|
+
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
|
14
|
+
`account_id` integer NOT NULL,
|
|
15
|
+
`review_id` integer NOT NULL,
|
|
16
|
+
`finding_id` integer,
|
|
17
|
+
`role` text NOT NULL,
|
|
18
|
+
`content` text NOT NULL,
|
|
19
|
+
`model` text,
|
|
20
|
+
`cost_usd` real,
|
|
21
|
+
`input_tokens` integer,
|
|
22
|
+
`output_tokens` integer,
|
|
23
|
+
`created_at` integer DEFAULT (unixepoch()) NOT NULL,
|
|
24
|
+
FOREIGN KEY (`account_id`) REFERENCES `accounts`(`id`) ON UPDATE no action ON DELETE cascade,
|
|
25
|
+
FOREIGN KEY (`finding_id`) REFERENCES `claude_review_findings`(`id`) ON UPDATE no action ON DELETE cascade,
|
|
26
|
+
CONSTRAINT `crcm_review_account_fk` FOREIGN KEY (`review_id`,`account_id`) REFERENCES `claude_reviews`(`id`,`account_id`) ON UPDATE no action ON DELETE cascade
|
|
27
|
+
);
|
|
28
|
+
--> statement-breakpoint
|
|
29
|
+
CREATE INDEX IF NOT EXISTS `crcm_thread_idx` ON `claude_review_chat_messages` (`review_id`,`finding_id`,`id`);
|
|
30
|
+
--> statement-breakpoint
|
|
31
|
+
CREATE INDEX IF NOT EXISTS `crcm_account_idx` ON `claude_review_chat_messages` (`account_id`);
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
-- ADOPT THE AGENTIC TABLES INTO CORE (Claude Review memory + AI Fix), and give each workspace its
|
|
2
|
+
-- auto-review switch. Claude Review, review memory and AI Fix moved from the private plugin into
|
|
3
|
+
-- core (free, local-only); their two tables move with them. The Postgres twin is
|
|
4
|
+
-- migrations-pg/0061_adopt_agentic_tables.sql.
|
|
5
|
+
--
|
|
6
|
+
-- ⚠ ADOPTED IN PLACE, NEVER RENAMED. On an install where the plugin already created them
|
|
7
|
+
-- (plugin migrations 0001 / 0002 / 0003 / 0024) every CREATE below is a no-op and the rows stay as
|
|
8
|
+
-- they are. On a fresh or plugin-less install this creates them. The DDL is the plugin's FINAL
|
|
9
|
+
-- shape, minus the eight dormant `resolved_*` / `resolve_error` columns of plugin 0003 (AI Fix's
|
|
10
|
+
-- removed rebase artifact): nothing declares or reads them, and an adopted table that still carries
|
|
11
|
+
-- them reads identically. Same types, same defaults, same index names, and NO foreign keys — SQLite
|
|
12
|
+
-- cannot add one to an existing table without a rebuild, so a fresh and an adopted install would
|
|
13
|
+
-- otherwise differ. Tenancy is query-layer (every read filters account_id) plus verify:isolation;
|
|
14
|
+
-- no id in either table arrives in a request body.
|
|
15
|
+
--
|
|
16
|
+
-- ⚠ THE PLUGIN'S OWN COPIES OF THIS DDL WERE STRIPPED IN THE SAME CHANGE (plugin 0001's
|
|
17
|
+
-- review_learnings half, 0002's ai_fixes half, 0003 and 0024 entirely). Core migrations run BEFORE
|
|
18
|
+
-- the plugin binds, so on a fresh SQLite install core creates the full ai_fixes first — and the
|
|
19
|
+
-- plugin's bare `ALTER TABLE ai_fixes ADD COLUMN` would throw "duplicate column", which drops the
|
|
20
|
+
-- WHOLE plugin to OSS mode silently.
|
|
21
|
+
--
|
|
22
|
+
-- Known gap: an install whose plugin stopped before 0024 (pre-apiVersion 19) keeps an ai_fixes
|
|
23
|
+
-- without comment_targets/comment_verdicts — SQLite has no ADD COLUMN IF NOT EXISTS. No such
|
|
24
|
+
-- install is known; the pg twin adds them idempotently.
|
|
25
|
+
CREATE TABLE IF NOT EXISTS `review_learnings` (
|
|
26
|
+
`id` integer PRIMARY KEY AUTOINCREMENT,
|
|
27
|
+
`account_id` integer NOT NULL,
|
|
28
|
+
`repo_id` integer NOT NULL,
|
|
29
|
+
`pr_id` integer NOT NULL,
|
|
30
|
+
`source_review_id` integer NOT NULL,
|
|
31
|
+
`finding_id` integer,
|
|
32
|
+
`head_sha` text NOT NULL,
|
|
33
|
+
`kind` text NOT NULL,
|
|
34
|
+
`path` text,
|
|
35
|
+
`dir_path` text,
|
|
36
|
+
`ext` text,
|
|
37
|
+
`category` text,
|
|
38
|
+
`claude_verdict` text,
|
|
39
|
+
`user_verdict` text,
|
|
40
|
+
`claude_title` text,
|
|
41
|
+
`claude_text` text,
|
|
42
|
+
`user_text` text,
|
|
43
|
+
`posted_comment_kind` text,
|
|
44
|
+
`dedupe_key` text NOT NULL,
|
|
45
|
+
`created_at` integer NOT NULL DEFAULT (unixepoch())
|
|
46
|
+
);
|
|
47
|
+
--> statement-breakpoint
|
|
48
|
+
CREATE UNIQUE INDEX IF NOT EXISTS `rl_account_dedupe` ON `review_learnings` (`account_id`,`dedupe_key`);
|
|
49
|
+
--> statement-breakpoint
|
|
50
|
+
CREATE INDEX IF NOT EXISTS `rl_account_repo_category` ON `review_learnings` (`account_id`,`repo_id`,`category`);
|
|
51
|
+
--> statement-breakpoint
|
|
52
|
+
CREATE INDEX IF NOT EXISTS `rl_account_repo_dir` ON `review_learnings` (`account_id`,`repo_id`,`dir_path`);
|
|
53
|
+
--> statement-breakpoint
|
|
54
|
+
CREATE INDEX IF NOT EXISTS `rl_account_source_review` ON `review_learnings` (`account_id`,`source_review_id`);
|
|
55
|
+
--> statement-breakpoint
|
|
56
|
+
CREATE INDEX IF NOT EXISTS `rl_account_repo_created` ON `review_learnings` (`account_id`,`repo_id`,`created_at`);
|
|
57
|
+
--> statement-breakpoint
|
|
58
|
+
CREATE TABLE IF NOT EXISTS `ai_fixes` (
|
|
59
|
+
`id` integer PRIMARY KEY AUTOINCREMENT,
|
|
60
|
+
`account_id` integer NOT NULL,
|
|
61
|
+
`repo_id` integer NOT NULL,
|
|
62
|
+
`pr_id` integer NOT NULL,
|
|
63
|
+
`source_review_id` integer,
|
|
64
|
+
`base_sha` text NOT NULL,
|
|
65
|
+
`status` text NOT NULL,
|
|
66
|
+
`model` text NOT NULL,
|
|
67
|
+
`seed` text NOT NULL,
|
|
68
|
+
`prompt` text,
|
|
69
|
+
`summary` text,
|
|
70
|
+
`commit_message` text,
|
|
71
|
+
`patch` text,
|
|
72
|
+
`files_changed` text,
|
|
73
|
+
`cost_usd` real,
|
|
74
|
+
`input_tokens` integer,
|
|
75
|
+
`output_tokens` integer,
|
|
76
|
+
`num_turns` integer,
|
|
77
|
+
`error` text,
|
|
78
|
+
`pushed_branch` text,
|
|
79
|
+
`pushed_pr_number` integer,
|
|
80
|
+
`pushed_pr_url` text,
|
|
81
|
+
`pushed_at` integer,
|
|
82
|
+
`created_at` integer NOT NULL DEFAULT (unixepoch()),
|
|
83
|
+
`finished_at` integer,
|
|
84
|
+
`comment_targets` text,
|
|
85
|
+
`comment_verdicts` text
|
|
86
|
+
);
|
|
87
|
+
--> statement-breakpoint
|
|
88
|
+
CREATE INDEX IF NOT EXISTS `af_account_pr_created` ON `ai_fixes` (`account_id`,`pr_id`,`created_at`);
|
|
89
|
+
--> statement-breakpoint
|
|
90
|
+
CREATE INDEX IF NOT EXISTS `af_account_status` ON `ai_fixes` (`account_id`,`status`);
|
|
91
|
+
--> statement-breakpoint
|
|
92
|
+
-- AUTO CLAUDE REVIEW, PER WORKSPACE (moved off the plugin's pro_workspace_settings, plugin 0036).
|
|
93
|
+
-- NULL/0 = off. `auto_review_enabled_at` is when it was last switched ON: the sweeper reviews only
|
|
94
|
+
-- PRs OPENED at or after it. The plugin's migration 0037 copies existing values across — a core
|
|
95
|
+
-- statement naming pro_workspace_settings would fail on every install that never had the plugin.
|
|
96
|
+
ALTER TABLE `workspaces` ADD `auto_review_enabled` integer;
|
|
97
|
+
--> statement-breakpoint
|
|
98
|
+
ALTER TABLE `workspaces` ADD `auto_review_enabled_at` integer;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
-- CLAUDE REVIEW: A FINDING'S LENS, AND REVIEW MEMORY DELETED.
|
|
2
|
+
--
|
|
3
|
+
-- claude_review_findings.lens: which specialist angle raised the finding — 'design', 'tests',
|
|
4
|
+
-- 'impact', 'accessibility', 'security' or 'performance' — set on deep (worktree) reviews, where
|
|
5
|
+
-- the lead agent may consult up to five specialist sub-agents. NULL is a general finding, and every
|
|
6
|
+
-- older row is NULL (no backfill).
|
|
7
|
+
--
|
|
8
|
+
-- review_learnings is DROPPED. Review memory (capture of what the reader did with each finding,
|
|
9
|
+
-- the "past reviews" panel and the prompt block built from it) was removed: it never improved a
|
|
10
|
+
-- review. Adopted into core by 0074; the plugin's own DDL for it was already stripped, so nothing
|
|
11
|
+
-- recreates it. DROP TABLE takes its five rl_* indexes with it.
|
|
12
|
+
-- The Postgres twin is migrations-pg/0062_review_lens_drop_learnings.sql.
|
|
13
|
+
ALTER TABLE `claude_review_findings` ADD `lens` text;
|
|
14
|
+
--> statement-breakpoint
|
|
15
|
+
DROP TABLE IF EXISTS `review_learnings`;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
-- CLAUDE REVIEW: OTHER REVIEWERS' THREADS, AND THE COMMENT HALF OF THE AUTO RE-REVIEW KEY.
|
|
2
|
+
--
|
|
3
|
+
-- claude_reviews.thread_assessments (JSON array): every OTHER open review thread on the PR when the
|
|
4
|
+
-- run loaded it — comments from people and from other review bots, never Limn's own posted
|
|
5
|
+
-- findings (the follow-up covers those) — with Claude's two answers per thread: is the comment
|
|
6
|
+
-- right (valid / partly_valid / not_valid / unclear) and has the code dealt with it (addressed /
|
|
7
|
+
-- partly_addressed / not_addressed / unclear), plus 'not_checked' written only by the server.
|
|
8
|
+
-- NULL on every older row (the wire reads it as "did not assess threads"; no backfill).
|
|
9
|
+
--
|
|
10
|
+
-- claude_reviews.comments_through (unix seconds): the newest qualifying review-thread comment the
|
|
11
|
+
-- run saw. The auto-review sweeper re-reviews the same head when a newer one arrives (after the
|
|
12
|
+
-- same 5-minute settle as a moved head). NULL ⇒ the row's created_at stands in, so a deploy does
|
|
13
|
+
-- not re-review every PR that already has comments.
|
|
14
|
+
-- The Postgres twin is migrations-pg/0063_claude_review_threads.sql.
|
|
15
|
+
ALTER TABLE `claude_reviews` ADD `thread_assessments` text;
|
|
16
|
+
--> statement-breakpoint
|
|
17
|
+
ALTER TABLE `claude_reviews` ADD `comments_through` integer;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
-- CLAUDE REVIEW: FAILED CI ON THE REVIEWED HEAD.
|
|
2
|
+
--
|
|
3
|
+
-- claude_reviews.ci_failures (JSON object): the head's CI state when the run looked
|
|
4
|
+
-- ({ state, checkCount, failures[] }) and, per failing check, what Claude found — cause,
|
|
5
|
+
-- explanation, category (code / test / flaky_or_infra / config / unclear), the related files and
|
|
6
|
+
-- whether it can be fixed in the pull request — or 'not_checked' written only by the server (no
|
|
7
|
+
-- Actions log, the log could not be read, over the cap, or Claude did not report on it).
|
|
8
|
+
-- NULL on every older row (the wire reads it as "did not look at CI"; no backfill).
|
|
9
|
+
-- The Postgres twin is migrations-pg/0064_claude_review_ci_failures.sql.
|
|
10
|
+
ALTER TABLE `claude_reviews` ADD `ci_failures` text;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
-- AI FIX: TWO ENTRY POINTS, A PER-CHANGE REPORT, AND WHO STARTED THE RUN.
|
|
2
|
+
--
|
|
3
|
+
-- ai_fixes.trigger (text): 'manual' | 'auto' — 'auto' is the auto-review agent calling
|
|
4
|
+
-- startReviewFix. NULL on older rows reads as 'manual'.
|
|
5
|
+
-- ai_fixes.review_items (JSON AiFixReviewItem[]): seed 'review' only — every item of the Claude
|
|
6
|
+
-- review the run was given, each with the ref the agent must cite (F1, P1, T1, S1-AC2, S1-M1, C1)
|
|
7
|
+
-- and `included: false` for the ones left out for the prompt budget. Written at insert.
|
|
8
|
+
-- ai_fixes.change_report (JSON AiFixChangeReport): the agent's per-file report (what changed, why,
|
|
9
|
+
-- which refs) plus the refs it deliberately did not fix, validated server-side. Written on success.
|
|
10
|
+
-- All nullable, no backfill. The removed 'comments' seed's comment_targets / comment_verdicts stay
|
|
11
|
+
-- (old rows keep their data; nothing reads them).
|
|
12
|
+
-- The Postgres twin is migrations-pg/0065_ai_fix_change_report.sql.
|
|
13
|
+
ALTER TABLE `ai_fixes` ADD `trigger` text;
|
|
14
|
+
--> statement-breakpoint
|
|
15
|
+
ALTER TABLE `ai_fixes` ADD `review_items` text;
|
|
16
|
+
--> statement-breakpoint
|
|
17
|
+
ALTER TABLE `ai_fixes` ADD `change_report` text;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
-- USER-STORY RESULTS BECOME FINDINGS.
|
|
2
|
+
--
|
|
3
|
+
-- Every acceptance criterion a Claude Review judged not met / partly met, and every "Not done"
|
|
4
|
+
-- item of its user-story assessment, is now a normal row of claude_review_findings, made by the
|
|
5
|
+
-- server from the reconciled assessment (review/claude-review/ticket.ts `storyFindingsFrom`) — so
|
|
6
|
+
-- it posts, rewords, ignores and is followed up exactly like any other finding. The per-ticket
|
|
7
|
+
-- "Post as comment" is retired (an old row's stored `posted` record is ignored on read).
|
|
8
|
+
--
|
|
9
|
+
-- claude_review_findings.story_index (integer): the ticket's 0-based position on the run.
|
|
10
|
+
-- claude_review_findings.story_ref (text): the criterion's ref ('AC2') or a not-done item's ('M1').
|
|
11
|
+
-- Both NULL on an ordinary finding. Nullable, no backfill: older reviews keep their story results
|
|
12
|
+
-- in the stories section only.
|
|
13
|
+
-- The Postgres twin is migrations-pg/0066_claude_finding_story.sql.
|
|
14
|
+
ALTER TABLE `claude_review_findings` ADD `story_index` integer;
|
|
15
|
+
--> statement-breakpoint
|
|
16
|
+
ALTER TABLE `claude_review_findings` ADD `story_ref` text;
|