@urateam/core 0.1.55 → 0.1.57
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/dist/__tests__/audit-immutability.test.js +8 -0
- package/dist/__tests__/audit-immutability.test.js.map +1 -1
- package/dist/__tests__/auth-check.test.js +130 -16
- package/dist/__tests__/auth-check.test.js.map +1 -1
- package/dist/__tests__/auth-monitor.test.js +210 -87
- package/dist/__tests__/auth-monitor.test.js.map +1 -1
- package/dist/__tests__/bec-238-repro.test.d.ts +2 -0
- package/dist/__tests__/bec-238-repro.test.d.ts.map +1 -0
- package/dist/__tests__/bec-238-repro.test.js +116 -0
- package/dist/__tests__/bec-238-repro.test.js.map +1 -0
- package/dist/__tests__/bec146-repro.test.d.ts +2 -0
- package/dist/__tests__/bec146-repro.test.d.ts.map +1 -0
- package/dist/__tests__/bec146-repro.test.js +153 -0
- package/dist/__tests__/bec146-repro.test.js.map +1 -0
- package/dist/__tests__/circuit-breaker-config.test.d.ts +2 -0
- package/dist/__tests__/circuit-breaker-config.test.d.ts.map +1 -0
- package/dist/__tests__/circuit-breaker-config.test.js +32 -0
- package/dist/__tests__/circuit-breaker-config.test.js.map +1 -0
- package/dist/__tests__/circuit-breaker-events.test.d.ts +2 -0
- package/dist/__tests__/circuit-breaker-events.test.d.ts.map +1 -0
- package/dist/__tests__/circuit-breaker-events.test.js +53 -0
- package/dist/__tests__/circuit-breaker-events.test.js.map +1 -0
- package/dist/__tests__/circuit-breaker-integration.test.d.ts +2 -0
- package/dist/__tests__/circuit-breaker-integration.test.d.ts.map +1 -0
- package/dist/__tests__/circuit-breaker-integration.test.js +192 -0
- package/dist/__tests__/circuit-breaker-integration.test.js.map +1 -0
- package/dist/__tests__/circuit-breaker-probe.test.d.ts +2 -0
- package/dist/__tests__/circuit-breaker-probe.test.d.ts.map +1 -0
- package/dist/__tests__/circuit-breaker-probe.test.js +124 -0
- package/dist/__tests__/circuit-breaker-probe.test.js.map +1 -0
- package/dist/__tests__/circuit-breaker-recover.test.d.ts +2 -0
- package/dist/__tests__/circuit-breaker-recover.test.d.ts.map +1 -0
- package/dist/__tests__/circuit-breaker-recover.test.js +52 -0
- package/dist/__tests__/circuit-breaker-recover.test.js.map +1 -0
- package/dist/__tests__/circuit-breaker-sweep.test.d.ts +2 -0
- package/dist/__tests__/circuit-breaker-sweep.test.d.ts.map +1 -0
- package/dist/__tests__/circuit-breaker-sweep.test.js +118 -0
- package/dist/__tests__/circuit-breaker-sweep.test.js.map +1 -0
- package/dist/__tests__/db-migrations.test.js +7 -3
- package/dist/__tests__/db-migrations.test.js.map +1 -1
- package/dist/__tests__/decision-artifact-schema.test.d.ts +2 -0
- package/dist/__tests__/decision-artifact-schema.test.d.ts.map +1 -0
- package/dist/__tests__/decision-artifact-schema.test.js +45 -0
- package/dist/__tests__/decision-artifact-schema.test.js.map +1 -0
- package/dist/__tests__/decisions-parser.test.d.ts +2 -0
- package/dist/__tests__/decisions-parser.test.d.ts.map +1 -0
- package/dist/__tests__/decisions-parser.test.js +59 -0
- package/dist/__tests__/decisions-parser.test.js.map +1 -0
- package/dist/__tests__/decisions-store.test.d.ts +2 -0
- package/dist/__tests__/decisions-store.test.d.ts.map +1 -0
- package/dist/__tests__/decisions-store.test.js +68 -0
- package/dist/__tests__/decisions-store.test.js.map +1 -0
- package/dist/__tests__/decisions-table-migration.test.d.ts +2 -0
- package/dist/__tests__/decisions-table-migration.test.d.ts.map +1 -0
- package/dist/__tests__/decisions-table-migration.test.js +56 -0
- package/dist/__tests__/decisions-table-migration.test.js.map +1 -0
- package/dist/__tests__/execute-stage-session-opts.test.js +2 -1
- package/dist/__tests__/execute-stage-session-opts.test.js.map +1 -1
- package/dist/__tests__/executor-issue-id.test.js +2 -1
- package/dist/__tests__/executor-issue-id.test.js.map +1 -1
- package/dist/__tests__/extract-handoff-decisions.test.d.ts +2 -0
- package/dist/__tests__/extract-handoff-decisions.test.d.ts.map +1 -0
- package/dist/__tests__/extract-handoff-decisions.test.js +26 -0
- package/dist/__tests__/extract-handoff-decisions.test.js.map +1 -0
- package/dist/__tests__/force-push-agent-branches.test.js +38 -15
- package/dist/__tests__/force-push-agent-branches.test.js.map +1 -1
- package/dist/__tests__/github-webhook.test.js +117 -0
- package/dist/__tests__/github-webhook.test.js.map +1 -1
- package/dist/__tests__/implement-template-decisions.test.d.ts +2 -0
- package/dist/__tests__/implement-template-decisions.test.d.ts.map +1 -0
- package/dist/__tests__/implement-template-decisions.test.js +41 -0
- package/dist/__tests__/implement-template-decisions.test.js.map +1 -0
- package/dist/__tests__/migrator.test.js +137 -39
- package/dist/__tests__/migrator.test.js.map +1 -1
- package/dist/__tests__/pipeline-runner.test.js +118 -0
- package/dist/__tests__/pipeline-runner.test.js.map +1 -1
- package/dist/__tests__/pm-audit-retention-step.test.js +3 -0
- package/dist/__tests__/pm-audit-retention-step.test.js.map +1 -1
- package/dist/__tests__/pm-budget-alerts.test.d.ts +14 -0
- package/dist/__tests__/pm-budget-alerts.test.d.ts.map +1 -1
- package/dist/__tests__/pm-budget-alerts.test.js +90 -18
- package/dist/__tests__/pm-budget-alerts.test.js.map +1 -1
- package/dist/__tests__/pm-budget-refused-event.test.js +2 -0
- package/dist/__tests__/pm-budget-refused-event.test.js.map +1 -1
- package/dist/__tests__/pm-budget-utc-boundary.test.d.ts +2 -0
- package/dist/__tests__/pm-budget-utc-boundary.test.d.ts.map +1 -0
- package/dist/__tests__/pm-budget-utc-boundary.test.js +128 -0
- package/dist/__tests__/pm-budget-utc-boundary.test.js.map +1 -0
- package/dist/__tests__/pm-conflict.test.js +145 -5
- package/dist/__tests__/pm-conflict.test.js.map +1 -1
- package/dist/__tests__/pm-cost-rollup-step.test.js +2 -0
- package/dist/__tests__/pm-cost-rollup-step.test.js.map +1 -1
- package/dist/__tests__/pm-promote.test.js +111 -0
- package/dist/__tests__/pm-promote.test.js.map +1 -1
- package/dist/__tests__/pm-scheduler.test.js +1 -0
- package/dist/__tests__/pm-scheduler.test.js.map +1 -1
- package/dist/__tests__/pm-sso-prune-step.test.js +2 -0
- package/dist/__tests__/pm-sso-prune-step.test.js.map +1 -1
- package/dist/__tests__/preflight-claude-auth.test.js +3 -2
- package/dist/__tests__/preflight-claude-auth.test.js.map +1 -1
- package/dist/__tests__/ralph-review-fix-regression.test.js +1 -0
- package/dist/__tests__/ralph-review-fix-regression.test.js.map +1 -1
- package/dist/__tests__/ralph.test.js +1 -0
- package/dist/__tests__/ralph.test.js.map +1 -1
- package/dist/__tests__/release-manager-qarun-query.test.d.ts +2 -0
- package/dist/__tests__/release-manager-qarun-query.test.d.ts.map +1 -0
- package/dist/__tests__/release-manager-qarun-query.test.js +233 -0
- package/dist/__tests__/release-manager-qarun-query.test.js.map +1 -0
- package/dist/__tests__/release-manager-scheduler.test.js +62 -0
- package/dist/__tests__/release-manager-scheduler.test.js.map +1 -1
- package/dist/__tests__/release-manager-slack-handler.test.js +66 -0
- package/dist/__tests__/release-manager-slack-handler.test.js.map +1 -1
- package/dist/__tests__/reproduce-bec113-pagination-warning.test.js +1 -0
- package/dist/__tests__/reproduce-bec113-pagination-warning.test.js.map +1 -1
- package/dist/__tests__/reproduce-bec62.test.js +1 -0
- package/dist/__tests__/reproduce-bec62.test.js.map +1 -1
- package/dist/__tests__/reproduce-bec91-stuck-in-progress.test.js +2 -0
- package/dist/__tests__/reproduce-bec91-stuck-in-progress.test.js.map +1 -1
- package/dist/__tests__/resolve-claude-auth.test.js +10 -8
- package/dist/__tests__/resolve-claude-auth.test.js.map +1 -1
- package/dist/__tests__/session-lazy-creation.test.js +2 -1
- package/dist/__tests__/session-lazy-creation.test.js.map +1 -1
- package/dist/__tests__/session-resolver.test.d.ts +13 -0
- package/dist/__tests__/session-resolver.test.d.ts.map +1 -0
- package/dist/__tests__/session-resolver.test.js +152 -0
- package/dist/__tests__/session-resolver.test.js.map +1 -0
- package/dist/__tests__/session-resume-fallback.test.js +2 -1
- package/dist/__tests__/session-resume-fallback.test.js.map +1 -1
- package/dist/__tests__/stage-models.test.js +3 -2
- package/dist/__tests__/stage-models.test.js.map +1 -1
- package/dist/__tests__/start-todo.test.js +29 -0
- package/dist/__tests__/start-todo.test.js.map +1 -1
- package/dist/__tests__/surgical-review-fix-prompt.test.d.ts +2 -0
- package/dist/__tests__/surgical-review-fix-prompt.test.d.ts.map +1 -0
- package/dist/__tests__/surgical-review-fix-prompt.test.js +71 -0
- package/dist/__tests__/surgical-review-fix-prompt.test.js.map +1 -0
- package/dist/__tests__/surgical-review-fix-runner.test.d.ts +2 -0
- package/dist/__tests__/surgical-review-fix-runner.test.d.ts.map +1 -0
- package/dist/__tests__/surgical-review-fix-runner.test.js +171 -0
- package/dist/__tests__/surgical-review-fix-runner.test.js.map +1 -0
- package/dist/__tests__/triage-preserve-acs.test.d.ts +2 -0
- package/dist/__tests__/triage-preserve-acs.test.d.ts.map +1 -0
- package/dist/__tests__/triage-preserve-acs.test.js +240 -0
- package/dist/__tests__/triage-preserve-acs.test.js.map +1 -0
- package/dist/__tests__/validate-run-mode.test.js +1 -0
- package/dist/__tests__/validate-run-mode.test.js.map +1 -1
- package/dist/__tests__/validate.test.js +1 -0
- package/dist/__tests__/validate.test.js.map +1 -1
- package/dist/audit/auth-error-messages.d.ts +6 -0
- package/dist/audit/auth-error-messages.d.ts.map +1 -0
- package/dist/audit/auth-error-messages.js +18 -0
- package/dist/audit/auth-error-messages.js.map +1 -0
- package/dist/audit/events.d.ts +51 -4
- package/dist/audit/events.d.ts.map +1 -1
- package/dist/audit/events.js +78 -5
- package/dist/audit/events.js.map +1 -1
- package/dist/audit/index.d.ts +1 -0
- package/dist/audit/index.d.ts.map +1 -1
- package/dist/audit/index.js +1 -0
- package/dist/audit/index.js.map +1 -1
- package/dist/db/client.d.ts.map +1 -1
- package/dist/db/client.js +20 -0
- package/dist/db/client.js.map +1 -1
- package/dist/db/decisions-store.d.ts +25 -0
- package/dist/db/decisions-store.d.ts.map +1 -0
- package/dist/db/decisions-store.js +56 -0
- package/dist/db/decisions-store.js.map +1 -0
- package/dist/db/index.d.ts +2 -2
- package/dist/db/index.d.ts.map +1 -1
- package/dist/db/index.js +2 -2
- package/dist/db/index.js.map +1 -1
- package/dist/db/migrations/postgres/008_sso.sql +9 -20
- package/dist/db/migrations/postgres/009_review_model_runs.sql +9 -18
- package/dist/db/migrations/postgres/009_sso.sql +20 -0
- package/dist/db/migrations/postgres/010_release_manager.sql +9 -38
- package/dist/db/migrations/postgres/010_review_model_runs.sql +18 -0
- package/dist/db/migrations/postgres/011_qa_run_columns.sql +9 -8
- package/dist/db/migrations/postgres/011_release_manager.sql +38 -0
- package/dist/db/migrations/postgres/012_qa_gap_issues.sql +9 -18
- package/dist/db/migrations/postgres/012_qa_run_columns.sql +8 -0
- package/dist/db/migrations/postgres/013_qa_gap_issues.sql +18 -0
- package/dist/db/migrations/postgres/013_stage_runs_cache_tokens.sql +11 -6
- package/dist/db/migrations/postgres/014_missing_indexes.sql +9 -28
- package/dist/db/migrations/postgres/014_stage_runs_cache_tokens.sql +6 -0
- package/dist/db/migrations/postgres/015_missing_indexes.sql +28 -0
- package/dist/db/migrations/postgres/015_triage_results.sql +9 -11
- package/dist/db/migrations/postgres/016_triage_results.sql +11 -0
- package/dist/db/migrations/sqlite/007_sso.sql +9 -20
- package/dist/db/migrations/sqlite/008_review_model_runs.sql +9 -18
- package/dist/db/migrations/sqlite/008_sso.sql +20 -0
- package/dist/db/migrations/sqlite/009_release_manager.sql +9 -43
- package/dist/db/migrations/sqlite/009_review_model_runs.sql +18 -0
- package/dist/db/migrations/sqlite/010_qa_run_columns.sql +9 -9
- package/dist/db/migrations/sqlite/010_release_manager.sql +43 -0
- package/dist/db/migrations/sqlite/011_qa_gap_issues.sql +9 -22
- package/dist/db/migrations/sqlite/011_qa_run_columns.sql +9 -0
- package/dist/db/migrations/sqlite/012_qa_gap_issues.sql +22 -0
- package/dist/db/migrations/sqlite/012_stage_runs_cache_tokens.sql +11 -6
- package/dist/db/migrations/sqlite/013_missing_indexes.sql +10 -28
- package/dist/db/migrations/sqlite/013_stage_runs_cache_tokens.sql +6 -0
- package/dist/db/migrations/sqlite/013_triage_results.sql +10 -11
- package/dist/db/migrations/sqlite/014_missing_indexes.sql +28 -0
- package/dist/db/migrations/sqlite/015_triage_results.sql +11 -0
- package/dist/db/migrator.d.ts +45 -2
- package/dist/db/migrator.d.ts.map +1 -1
- package/dist/db/migrator.js +113 -29
- package/dist/db/migrator.js.map +1 -1
- package/dist/db/schema.d.ts +213 -0
- package/dist/db/schema.d.ts.map +1 -1
- package/dist/db/schema.js +28 -0
- package/dist/db/schema.js.map +1 -1
- package/dist/executor/auth-check.d.ts +30 -7
- package/dist/executor/auth-check.d.ts.map +1 -1
- package/dist/executor/auth-check.js +66 -16
- package/dist/executor/auth-check.js.map +1 -1
- package/dist/executor/auth-monitor.d.ts.map +1 -1
- package/dist/executor/auth-monitor.js +48 -39
- package/dist/executor/auth-monitor.js.map +1 -1
- package/dist/executor/deep-review.d.ts.map +1 -1
- package/dist/executor/deep-review.js +14 -79
- package/dist/executor/deep-review.js.map +1 -1
- package/dist/executor/executor.d.ts +21 -0
- package/dist/executor/executor.d.ts.map +1 -1
- package/dist/executor/executor.js +42 -91
- package/dist/executor/executor.js.map +1 -1
- package/dist/executor/extract-handoff.d.ts +9 -0
- package/dist/executor/extract-handoff.d.ts.map +1 -1
- package/dist/executor/extract-handoff.js +48 -0
- package/dist/executor/extract-handoff.js.map +1 -1
- package/dist/executor/handoff.d.ts +10 -1
- package/dist/executor/handoff.d.ts.map +1 -1
- package/dist/executor/handoff.js +7 -1
- package/dist/executor/handoff.js.map +1 -1
- package/dist/executor/index.d.ts +1 -0
- package/dist/executor/index.d.ts.map +1 -1
- package/dist/executor/index.js +1 -0
- package/dist/executor/index.js.map +1 -1
- package/dist/executor/prompt/templates.d.ts +12 -1
- package/dist/executor/prompt/templates.d.ts.map +1 -1
- package/dist/executor/prompt/templates.js +64 -0
- package/dist/executor/prompt/templates.js.map +1 -1
- package/dist/executor/session-resolver.d.ts +51 -0
- package/dist/executor/session-resolver.d.ts.map +1 -0
- package/dist/executor/session-resolver.js +83 -0
- package/dist/executor/session-resolver.js.map +1 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/notifier/composite.js +1 -1
- package/dist/notifier/composite.js.map +1 -1
- package/dist/notifier/linear.d.ts +1 -1
- package/dist/notifier/linear.d.ts.map +1 -1
- package/dist/notifier/linear.js +49 -9
- package/dist/notifier/linear.js.map +1 -1
- package/dist/pipeline/run-surgical-review-fix.d.ts +29 -0
- package/dist/pipeline/run-surgical-review-fix.d.ts.map +1 -0
- package/dist/pipeline/run-surgical-review-fix.js +48 -0
- package/dist/pipeline/run-surgical-review-fix.js.map +1 -0
- package/dist/pipeline/runner.d.ts.map +1 -1
- package/dist/pipeline/runner.js +132 -36
- package/dist/pipeline/runner.js.map +1 -1
- package/dist/pm/actions/circuit-breaker-config.d.ts +13 -0
- package/dist/pm/actions/circuit-breaker-config.d.ts.map +1 -0
- package/dist/pm/actions/circuit-breaker-config.js +23 -0
- package/dist/pm/actions/circuit-breaker-config.js.map +1 -0
- package/dist/pm/actions/db-queries.d.ts +18 -0
- package/dist/pm/actions/db-queries.d.ts.map +1 -1
- package/dist/pm/actions/db-queries.js +75 -2
- package/dist/pm/actions/db-queries.js.map +1 -1
- package/dist/pm/actions/promote.d.ts +7 -0
- package/dist/pm/actions/promote.d.ts.map +1 -1
- package/dist/pm/actions/promote.js +17 -1
- package/dist/pm/actions/promote.js.map +1 -1
- package/dist/pm/actions/recover-circuit-breaker.d.ts +21 -0
- package/dist/pm/actions/recover-circuit-breaker.d.ts.map +1 -0
- package/dist/pm/actions/recover-circuit-breaker.js +47 -0
- package/dist/pm/actions/recover-circuit-breaker.js.map +1 -0
- package/dist/pm/actions/select-probe-candidates.d.ts +21 -0
- package/dist/pm/actions/select-probe-candidates.d.ts.map +1 -0
- package/dist/pm/actions/select-probe-candidates.js +81 -0
- package/dist/pm/actions/select-probe-candidates.js.map +1 -0
- package/dist/pm/actions/start-todo.d.ts +7 -0
- package/dist/pm/actions/start-todo.d.ts.map +1 -1
- package/dist/pm/actions/start-todo.js +2 -1
- package/dist/pm/actions/start-todo.js.map +1 -1
- package/dist/pm/actions/sweep-recovered-circuit-breakers.d.ts +28 -0
- package/dist/pm/actions/sweep-recovered-circuit-breakers.d.ts.map +1 -0
- package/dist/pm/actions/sweep-recovered-circuit-breakers.js +47 -0
- package/dist/pm/actions/sweep-recovered-circuit-breakers.js.map +1 -0
- package/dist/pm/actions/triage-prompt.d.ts +14 -0
- package/dist/pm/actions/triage-prompt.d.ts.map +1 -1
- package/dist/pm/actions/triage-prompt.js +52 -9
- package/dist/pm/actions/triage-prompt.js.map +1 -1
- package/dist/pm/actions/triage.d.ts.map +1 -1
- package/dist/pm/actions/triage.js +37 -24
- package/dist/pm/actions/triage.js.map +1 -1
- package/dist/pm/conflict.d.ts +2 -0
- package/dist/pm/conflict.d.ts.map +1 -1
- package/dist/pm/conflict.js +59 -9
- package/dist/pm/conflict.js.map +1 -1
- package/dist/pm/scheduler.d.ts +5 -0
- package/dist/pm/scheduler.d.ts.map +1 -1
- package/dist/pm/scheduler.js +91 -44
- package/dist/pm/scheduler.js.map +1 -1
- package/dist/pm/slack.d.ts +11 -0
- package/dist/pm/slack.d.ts.map +1 -1
- package/dist/pm/slack.js +48 -5
- package/dist/pm/slack.js.map +1 -1
- package/dist/release-manager/release-helpers.d.ts +19 -2
- package/dist/release-manager/release-helpers.d.ts.map +1 -1
- package/dist/release-manager/release-helpers.js +22 -3
- package/dist/release-manager/release-helpers.js.map +1 -1
- package/dist/release-manager/release-tick.d.ts.map +1 -1
- package/dist/release-manager/release-tick.js +20 -8
- package/dist/release-manager/release-tick.js.map +1 -1
- package/dist/release-manager/slack-handler.d.ts +6 -0
- package/dist/release-manager/slack-handler.d.ts.map +1 -1
- package/dist/release-manager/slack-handler.js +76 -1
- package/dist/release-manager/slack-handler.js.map +1 -1
- package/dist/release-manager/state.d.ts.map +1 -1
- package/dist/release-manager/state.js +25 -18
- package/dist/release-manager/state.js.map +1 -1
- package/dist/types.d.ts +238 -13
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +67 -0
- package/dist/types.js.map +1 -1
- package/dist/webhook/github-handler.d.ts +2 -2
- package/dist/webhook/github-handler.d.ts.map +1 -1
- package/dist/webhook/github-handler.js +18 -6
- package/dist/webhook/github-handler.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,38 +1,9 @@
|
|
|
1
|
-
-- BEC-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
trigger_state_json TEXT NOT NULL,
|
|
11
|
-
proposed_version TEXT,
|
|
12
|
-
fired_tag TEXT,
|
|
13
|
-
fired_sha TEXT,
|
|
14
|
-
attempt_count INTEGER NOT NULL DEFAULT 0
|
|
15
|
-
);
|
|
16
|
-
|
|
17
|
-
CREATE INDEX IF NOT EXISTS idx_release_decisions_repo_branch_decided
|
|
18
|
-
ON release_decisions(repo_url, branch, decided_at DESC);
|
|
19
|
-
|
|
20
|
-
CREATE INDEX IF NOT EXISTS idx_release_decisions_decision_decided
|
|
21
|
-
ON release_decisions(decision, decided_at);
|
|
22
|
-
|
|
23
|
-
CREATE TABLE IF NOT EXISTS release_approvals (
|
|
24
|
-
id TEXT PRIMARY KEY,
|
|
25
|
-
repo_url TEXT NOT NULL,
|
|
26
|
-
branch TEXT NOT NULL,
|
|
27
|
-
approved_at TIMESTAMPTZ NOT NULL DEFAULT now(),
|
|
28
|
-
approved_by TEXT NOT NULL,
|
|
29
|
-
consumed_at TIMESTAMPTZ,
|
|
30
|
-
consumed_by_decision_id TEXT
|
|
31
|
-
);
|
|
32
|
-
|
|
33
|
-
CREATE UNIQUE INDEX IF NOT EXISTS idx_release_approvals_unique_fresh
|
|
34
|
-
ON release_approvals(repo_url, branch, approved_by)
|
|
35
|
-
WHERE consumed_at IS NULL;
|
|
36
|
-
|
|
37
|
-
CREATE INDEX IF NOT EXISTS idx_release_approvals_repo_branch_consumed
|
|
38
|
-
ON release_approvals(repo_url, branch, consumed_at);
|
|
1
|
+
-- BEC-149: This migration was renumbered to 011_release_manager to fix cascading
|
|
2
|
+
-- prefix collision introduced when 008_sso was renumbered to 009_sso.
|
|
3
|
+
--
|
|
4
|
+
-- This file is retained for git history only. The migrator skips it based on
|
|
5
|
+
-- the POSTGRES_MIGRATION_RENAMES map in migrator.ts, which also renames any
|
|
6
|
+
-- existing "010_release_manager" entries in schema_migrations to
|
|
7
|
+
-- "011_release_manager" so that existing deployments do not re-run this migration.
|
|
8
|
+
--
|
|
9
|
+
-- Active migration: packages/core/src/db/migrations/postgres/011_release_manager.sql
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
-- BEC-134: per-model results from review-stage fanout.
|
|
2
|
+
CREATE TABLE IF NOT EXISTS review_model_runs (
|
|
3
|
+
id TEXT PRIMARY KEY,
|
|
4
|
+
stage_run_id TEXT NOT NULL REFERENCES stage_runs(id),
|
|
5
|
+
provider_id TEXT NOT NULL,
|
|
6
|
+
model_id TEXT NOT NULL,
|
|
7
|
+
status TEXT NOT NULL,
|
|
8
|
+
input_tokens INTEGER NOT NULL DEFAULT 0,
|
|
9
|
+
output_tokens INTEGER NOT NULL DEFAULT 0,
|
|
10
|
+
duration_ms INTEGER NOT NULL DEFAULT 0,
|
|
11
|
+
error_message TEXT,
|
|
12
|
+
truncated_files INTEGER NOT NULL DEFAULT 0,
|
|
13
|
+
started_at TIMESTAMPTZ,
|
|
14
|
+
completed_at TIMESTAMPTZ
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
CREATE INDEX IF NOT EXISTS idx_review_model_runs_stage_run_id
|
|
18
|
+
ON review_model_runs(stage_run_id);
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
-- BEC-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
-- BEC-149: This migration was renumbered to 012_qa_run_columns to fix cascading
|
|
2
|
+
-- prefix collision introduced when 008_sso was renumbered to 009_sso.
|
|
3
|
+
--
|
|
4
|
+
-- This file is retained for git history only. The migrator skips it based on
|
|
5
|
+
-- the POSTGRES_MIGRATION_RENAMES map in migrator.ts, which also renames any
|
|
6
|
+
-- existing "011_qa_run_columns" entries in schema_migrations to
|
|
7
|
+
-- "012_qa_run_columns" so that existing deployments do not re-run this migration.
|
|
8
|
+
--
|
|
9
|
+
-- Active migration: packages/core/src/db/migrations/postgres/012_qa_run_columns.sql
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
-- BEC-135: Release Manager agent — decision log + one-shot approvals.
|
|
2
|
+
|
|
3
|
+
CREATE TABLE IF NOT EXISTS release_decisions (
|
|
4
|
+
id TEXT PRIMARY KEY,
|
|
5
|
+
repo_url TEXT NOT NULL,
|
|
6
|
+
branch TEXT NOT NULL,
|
|
7
|
+
decided_at TIMESTAMPTZ NOT NULL DEFAULT now(),
|
|
8
|
+
decision TEXT NOT NULL,
|
|
9
|
+
reason TEXT NOT NULL,
|
|
10
|
+
trigger_state_json TEXT NOT NULL,
|
|
11
|
+
proposed_version TEXT,
|
|
12
|
+
fired_tag TEXT,
|
|
13
|
+
fired_sha TEXT,
|
|
14
|
+
attempt_count INTEGER NOT NULL DEFAULT 0
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
CREATE INDEX IF NOT EXISTS idx_release_decisions_repo_branch_decided
|
|
18
|
+
ON release_decisions(repo_url, branch, decided_at DESC);
|
|
19
|
+
|
|
20
|
+
CREATE INDEX IF NOT EXISTS idx_release_decisions_decision_decided
|
|
21
|
+
ON release_decisions(decision, decided_at);
|
|
22
|
+
|
|
23
|
+
CREATE TABLE IF NOT EXISTS release_approvals (
|
|
24
|
+
id TEXT PRIMARY KEY,
|
|
25
|
+
repo_url TEXT NOT NULL,
|
|
26
|
+
branch TEXT NOT NULL,
|
|
27
|
+
approved_at TIMESTAMPTZ NOT NULL DEFAULT now(),
|
|
28
|
+
approved_by TEXT NOT NULL,
|
|
29
|
+
consumed_at TIMESTAMPTZ,
|
|
30
|
+
consumed_by_decision_id TEXT
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
CREATE UNIQUE INDEX IF NOT EXISTS idx_release_approvals_unique_fresh
|
|
34
|
+
ON release_approvals(repo_url, branch, approved_by)
|
|
35
|
+
WHERE consumed_at IS NULL;
|
|
36
|
+
|
|
37
|
+
CREATE INDEX IF NOT EXISTS idx_release_approvals_repo_branch_consumed
|
|
38
|
+
ON release_approvals(repo_url, branch, consumed_at);
|
|
@@ -1,18 +1,9 @@
|
|
|
1
|
-
-- BEC-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
resolved_at TIMESTAMPTZ
|
|
11
|
-
);
|
|
12
|
-
|
|
13
|
-
CREATE UNIQUE INDEX IF NOT EXISTS idx_qa_gap_issues_unique_open
|
|
14
|
-
ON qa_gap_issues(repo_url, branch, workflow_path)
|
|
15
|
-
WHERE resolved_at IS NULL;
|
|
16
|
-
|
|
17
|
-
CREATE INDEX IF NOT EXISTS idx_qa_gap_issues_lookup
|
|
18
|
-
ON qa_gap_issues(repo_url, branch, workflow_path, resolved_at);
|
|
1
|
+
-- BEC-149: This migration was renumbered to 013_qa_gap_issues to fix cascading
|
|
2
|
+
-- prefix collision introduced when 008_sso was renumbered to 009_sso.
|
|
3
|
+
--
|
|
4
|
+
-- This file is retained for git history only. The migrator skips it based on
|
|
5
|
+
-- the POSTGRES_MIGRATION_RENAMES map in migrator.ts, which also renames any
|
|
6
|
+
-- existing "012_qa_gap_issues" entries in schema_migrations to
|
|
7
|
+
-- "013_qa_gap_issues" so that existing deployments do not re-run this migration.
|
|
8
|
+
--
|
|
9
|
+
-- Active migration: packages/core/src/db/migrations/postgres/013_qa_gap_issues.sql
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
-- BEC-136: QA agent — track in-flight workflow runs on the release_decisions table.
|
|
2
|
+
|
|
3
|
+
ALTER TABLE release_decisions ADD COLUMN IF NOT EXISTS qa_run_id INTEGER;
|
|
4
|
+
ALTER TABLE release_decisions ADD COLUMN IF NOT EXISTS qa_run_sha TEXT;
|
|
5
|
+
|
|
6
|
+
CREATE INDEX IF NOT EXISTS idx_release_decisions_qa_run_id
|
|
7
|
+
ON release_decisions(repo_url, branch, qa_run_id, decided_at DESC)
|
|
8
|
+
WHERE qa_run_id IS NOT NULL;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
-- BEC-136: QA agent — Linear issue idempotency for missing QA workflows.
|
|
2
|
+
|
|
3
|
+
CREATE TABLE IF NOT EXISTS qa_gap_issues (
|
|
4
|
+
id TEXT PRIMARY KEY,
|
|
5
|
+
repo_url TEXT NOT NULL,
|
|
6
|
+
branch TEXT NOT NULL,
|
|
7
|
+
workflow_path TEXT NOT NULL,
|
|
8
|
+
linear_issue_id TEXT NOT NULL,
|
|
9
|
+
filed_at TIMESTAMPTZ NOT NULL DEFAULT now(),
|
|
10
|
+
resolved_at TIMESTAMPTZ
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
CREATE UNIQUE INDEX IF NOT EXISTS idx_qa_gap_issues_unique_open
|
|
14
|
+
ON qa_gap_issues(repo_url, branch, workflow_path)
|
|
15
|
+
WHERE resolved_at IS NULL;
|
|
16
|
+
|
|
17
|
+
CREATE INDEX IF NOT EXISTS idx_qa_gap_issues_lookup
|
|
18
|
+
ON qa_gap_issues(repo_url, branch, workflow_path, resolved_at);
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
--
|
|
2
|
-
--
|
|
3
|
-
--
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
-- BEC-149: This migration was renumbered to 014_stage_runs_cache_tokens to fix
|
|
2
|
+
-- a duplicate prefix (013_qa_gap_issues and 013_stage_runs_cache_tokens shared
|
|
3
|
+
-- prefix 013 after the initial BEC-149 rename pass).
|
|
4
|
+
--
|
|
5
|
+
-- This file is retained for git history only. The migrator skips it based on
|
|
6
|
+
-- the POSTGRES_MIGRATION_RENAMES map in migrator.ts, which also renames any
|
|
7
|
+
-- existing "013_stage_runs_cache_tokens" entries in schema_migrations to
|
|
8
|
+
-- "014_stage_runs_cache_tokens" so existing deployments do not re-run this
|
|
9
|
+
-- migration.
|
|
10
|
+
--
|
|
11
|
+
-- Active migration: packages/core/src/db/migrations/postgres/014_stage_runs_cache_tokens.sql
|
|
@@ -1,28 +1,9 @@
|
|
|
1
|
-
--
|
|
2
|
-
--
|
|
3
|
-
|
|
4
|
-
--
|
|
5
|
-
--
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
--
|
|
10
|
-
-- to find runs by branch name on push/CI events.
|
|
11
|
-
CREATE INDEX IF NOT EXISTS idx_pipeline_runs_branch
|
|
12
|
-
ON pipeline_runs(branch);
|
|
13
|
-
|
|
14
|
-
-- pipeline_runs.started_at: range-scanned by pm/actions/db-queries.ts,
|
|
15
|
-
-- pm/budget.ts, audit/reader.ts, cost/csv.ts, and runner.ts on every PM tick
|
|
16
|
-
-- (60s cadence) and dashboard page load.
|
|
17
|
-
CREATE INDEX IF NOT EXISTS idx_pipeline_runs_started_at
|
|
18
|
-
ON pipeline_runs(started_at);
|
|
19
|
-
|
|
20
|
-
-- pipeline_runs.completed_at: range-scanned by pm/actions/db-queries.ts and
|
|
21
|
-
-- cost/aggregate.ts for active-run detection and cost rollup windows.
|
|
22
|
-
CREATE INDEX IF NOT EXISTS idx_pipeline_runs_completed_at
|
|
23
|
-
ON pipeline_runs(completed_at);
|
|
24
|
-
|
|
25
|
-
-- pm_approvals.issue_id: queried by approval-helpers.ts:batchFetchPendingApprovals
|
|
26
|
-
-- on every PM tick to find pending approvals for a batch of issue IDs.
|
|
27
|
-
CREATE INDEX IF NOT EXISTS idx_pm_approvals_issue_id
|
|
28
|
-
ON pm_approvals(issue_id);
|
|
1
|
+
-- BEC-149: This migration was renumbered to 015_missing_indexes to follow the
|
|
2
|
+
-- 014_stage_runs_cache_tokens renumbering (preserves monotonic prefix order).
|
|
3
|
+
--
|
|
4
|
+
-- This file is retained for git history only. The migrator skips it based on
|
|
5
|
+
-- the POSTGRES_MIGRATION_RENAMES map in migrator.ts, which also renames any
|
|
6
|
+
-- existing "014_missing_indexes" entries in schema_migrations to
|
|
7
|
+
-- "015_missing_indexes" so existing deployments do not re-run this migration.
|
|
8
|
+
--
|
|
9
|
+
-- Active migration: packages/core/src/db/migrations/postgres/015_missing_indexes.sql
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
-- 013_stage_runs_cache_tokens.sql
|
|
2
|
+
-- BEC: cache telemetry — capture prompt-cache token usage from the
|
|
3
|
+
-- Anthropic Agent SDK so we can measure hit-rate per stage.
|
|
4
|
+
|
|
5
|
+
ALTER TABLE stage_runs ADD COLUMN cache_creation_input_tokens INTEGER NOT NULL DEFAULT 0;
|
|
6
|
+
ALTER TABLE stage_runs ADD COLUMN cache_read_input_tokens INTEGER NOT NULL DEFAULT 0;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
-- Migration: BEC-187 — Add 5 missing hot-path indexes to pipeline_runs + pm_approvals
|
|
2
|
+
-- Idempotent: all statements use CREATE INDEX IF NOT EXISTS (supported since Postgres 9.5).
|
|
3
|
+
|
|
4
|
+
-- pipeline_runs.pr_url: queried on every check_suite, pull_request, and review
|
|
5
|
+
-- event in webhook/github-handler.ts to look up the run by PR URL.
|
|
6
|
+
CREATE INDEX IF NOT EXISTS idx_pipeline_runs_pr_url
|
|
7
|
+
ON pipeline_runs(pr_url);
|
|
8
|
+
|
|
9
|
+
-- pipeline_runs.branch: queried alongside pr_url in webhook/github-handler.ts
|
|
10
|
+
-- to find runs by branch name on push/CI events.
|
|
11
|
+
CREATE INDEX IF NOT EXISTS idx_pipeline_runs_branch
|
|
12
|
+
ON pipeline_runs(branch);
|
|
13
|
+
|
|
14
|
+
-- pipeline_runs.started_at: range-scanned by pm/actions/db-queries.ts,
|
|
15
|
+
-- pm/budget.ts, audit/reader.ts, cost/csv.ts, and runner.ts on every PM tick
|
|
16
|
+
-- (60s cadence) and dashboard page load.
|
|
17
|
+
CREATE INDEX IF NOT EXISTS idx_pipeline_runs_started_at
|
|
18
|
+
ON pipeline_runs(started_at);
|
|
19
|
+
|
|
20
|
+
-- pipeline_runs.completed_at: range-scanned by pm/actions/db-queries.ts and
|
|
21
|
+
-- cost/aggregate.ts for active-run detection and cost rollup windows.
|
|
22
|
+
CREATE INDEX IF NOT EXISTS idx_pipeline_runs_completed_at
|
|
23
|
+
ON pipeline_runs(completed_at);
|
|
24
|
+
|
|
25
|
+
-- pm_approvals.issue_id: queried by approval-helpers.ts:batchFetchPendingApprovals
|
|
26
|
+
-- on every PM tick to find pending approvals for a batch of issue IDs.
|
|
27
|
+
CREATE INDEX IF NOT EXISTS idx_pm_approvals_issue_id
|
|
28
|
+
ON pm_approvals(issue_id);
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
--
|
|
2
|
-
--
|
|
3
|
-
--
|
|
4
|
-
--
|
|
5
|
-
--
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
triaged_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
|
|
11
|
-
);
|
|
1
|
+
-- BEC-149: This migration was renumbered to 016_triage_results to follow the
|
|
2
|
+
-- 014_stage_runs_cache_tokens and 015_missing_indexes renumberings.
|
|
3
|
+
--
|
|
4
|
+
-- This file is retained for git history only. The migrator skips it based on
|
|
5
|
+
-- the POSTGRES_MIGRATION_RENAMES map in migrator.ts, which also renames any
|
|
6
|
+
-- existing "015_triage_results" entries in schema_migrations to
|
|
7
|
+
-- "016_triage_results" so existing deployments do not re-run this migration.
|
|
8
|
+
--
|
|
9
|
+
-- Active migration: packages/core/src/db/migrations/postgres/016_triage_results.sql
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
-- 015_triage_results.sql
|
|
2
|
+
-- BEC-223: persist triage v2 prediction at triage time so the runner Tier 6e
|
|
3
|
+
-- hook reads from DB instead of parsing the description (which gets truncated
|
|
4
|
+
-- by mapIssueToSchema at 4000 chars, slicing off the appended v2 sections for
|
|
5
|
+
-- realistic issues).
|
|
6
|
+
|
|
7
|
+
CREATE TABLE IF NOT EXISTS triage_results (
|
|
8
|
+
issue_id TEXT PRIMARY KEY,
|
|
9
|
+
v2_prediction TEXT NOT NULL DEFAULT '{}',
|
|
10
|
+
triaged_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
|
|
11
|
+
);
|
|
@@ -1,20 +1,9 @@
|
|
|
1
|
-
--
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
CREATE TABLE IF NOT EXISTS dashboard_sessions (
|
|
12
|
-
id TEXT PRIMARY KEY,
|
|
13
|
-
user_id TEXT NOT NULL REFERENCES dashboard_users(id),
|
|
14
|
-
created_at INTEGER NOT NULL,
|
|
15
|
-
expires_at INTEGER NOT NULL,
|
|
16
|
-
last_seen_at INTEGER NOT NULL
|
|
17
|
-
);
|
|
18
|
-
|
|
19
|
-
CREATE INDEX IF NOT EXISTS idx_dashboard_sessions_user_id ON dashboard_sessions(user_id);
|
|
20
|
-
CREATE INDEX IF NOT EXISTS idx_dashboard_sessions_expires_at ON dashboard_sessions(expires_at);
|
|
1
|
+
-- BEC-149: This migration was renumbered to 008_sso to fix a duplicate prefix
|
|
2
|
+
-- (007_cost_rollups and 007_sso shared prefix 007).
|
|
3
|
+
--
|
|
4
|
+
-- This file is retained for git history only. The migrator skips it based on
|
|
5
|
+
-- the SQLITE_MIGRATION_RENAMES map in migrator.ts, which also renames any
|
|
6
|
+
-- existing "007_sso" entries in schema_migrations to "008_sso" so that
|
|
7
|
+
-- existing deployments do not re-run this migration.
|
|
8
|
+
--
|
|
9
|
+
-- Active migration: packages/core/src/db/migrations/sqlite/008_sso.sql
|
|
@@ -1,18 +1,9 @@
|
|
|
1
|
-
-- BEC-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
duration_ms INTEGER NOT NULL DEFAULT 0,
|
|
11
|
-
error_message TEXT,
|
|
12
|
-
truncated_files INTEGER NOT NULL DEFAULT 0,
|
|
13
|
-
started_at INTEGER,
|
|
14
|
-
completed_at INTEGER
|
|
15
|
-
);
|
|
16
|
-
|
|
17
|
-
CREATE INDEX IF NOT EXISTS idx_review_model_runs_stage_run_id
|
|
18
|
-
ON review_model_runs(stage_run_id);
|
|
1
|
+
-- BEC-149: This migration was renumbered to 009_review_model_runs to fix cascading
|
|
2
|
+
-- prefix collision introduced when 007_sso was renumbered to 008_sso.
|
|
3
|
+
--
|
|
4
|
+
-- This file is retained for git history only. The migrator skips it based on
|
|
5
|
+
-- the SQLITE_MIGRATION_RENAMES map in migrator.ts, which also renames any
|
|
6
|
+
-- existing "008_review_model_runs" entries in schema_migrations to
|
|
7
|
+
-- "009_review_model_runs" so that existing deployments do not re-run this migration.
|
|
8
|
+
--
|
|
9
|
+
-- Active migration: packages/core/src/db/migrations/sqlite/009_review_model_runs.sql
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
-- Enterprise feature 4.1: SSO via WorkOS
|
|
2
|
+
CREATE TABLE IF NOT EXISTS dashboard_users (
|
|
3
|
+
id TEXT PRIMARY KEY,
|
|
4
|
+
email TEXT NOT NULL UNIQUE,
|
|
5
|
+
name TEXT,
|
|
6
|
+
workos_user_id TEXT,
|
|
7
|
+
created_at INTEGER NOT NULL,
|
|
8
|
+
last_login_at INTEGER
|
|
9
|
+
);
|
|
10
|
+
|
|
11
|
+
CREATE TABLE IF NOT EXISTS dashboard_sessions (
|
|
12
|
+
id TEXT PRIMARY KEY,
|
|
13
|
+
user_id TEXT NOT NULL REFERENCES dashboard_users(id),
|
|
14
|
+
created_at INTEGER NOT NULL,
|
|
15
|
+
expires_at INTEGER NOT NULL,
|
|
16
|
+
last_seen_at INTEGER NOT NULL
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
CREATE INDEX IF NOT EXISTS idx_dashboard_sessions_user_id ON dashboard_sessions(user_id);
|
|
20
|
+
CREATE INDEX IF NOT EXISTS idx_dashboard_sessions_expires_at ON dashboard_sessions(expires_at);
|
|
@@ -1,43 +1,9 @@
|
|
|
1
|
-
-- BEC-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
trigger_state_json TEXT NOT NULL,
|
|
11
|
-
proposed_version TEXT,
|
|
12
|
-
fired_tag TEXT,
|
|
13
|
-
fired_sha TEXT,
|
|
14
|
-
attempt_count INTEGER NOT NULL DEFAULT 0
|
|
15
|
-
);
|
|
16
|
-
|
|
17
|
-
-- Index for /release status: fast lookup of the most recent N decisions per (repo, branch).
|
|
18
|
-
CREATE INDEX IF NOT EXISTS idx_release_decisions_repo_branch_decided
|
|
19
|
-
ON release_decisions(repo_url, branch, decided_at DESC);
|
|
20
|
-
|
|
21
|
-
-- Index for retry sweep: find fire-pending rows.
|
|
22
|
-
CREATE INDEX IF NOT EXISTS idx_release_decisions_decision_decided
|
|
23
|
-
ON release_decisions(decision, decided_at);
|
|
24
|
-
|
|
25
|
-
CREATE TABLE IF NOT EXISTS release_approvals (
|
|
26
|
-
id TEXT PRIMARY KEY,
|
|
27
|
-
repo_url TEXT NOT NULL,
|
|
28
|
-
branch TEXT NOT NULL,
|
|
29
|
-
approved_at INTEGER NOT NULL,
|
|
30
|
-
approved_by TEXT NOT NULL,
|
|
31
|
-
consumed_at INTEGER,
|
|
32
|
-
consumed_by_decision_id TEXT
|
|
33
|
-
);
|
|
34
|
-
|
|
35
|
-
-- Partial UNIQUE: one fresh (un-consumed) approval per (repo, branch, user).
|
|
36
|
-
-- Once consumed, the row stays for audit but no longer blocks new approves.
|
|
37
|
-
CREATE UNIQUE INDEX IF NOT EXISTS idx_release_approvals_unique_fresh
|
|
38
|
-
ON release_approvals(repo_url, branch, approved_by)
|
|
39
|
-
WHERE consumed_at IS NULL;
|
|
40
|
-
|
|
41
|
-
-- Lookup index for fresh-approval check at decision time.
|
|
42
|
-
CREATE INDEX IF NOT EXISTS idx_release_approvals_repo_branch_consumed
|
|
43
|
-
ON release_approvals(repo_url, branch, consumed_at);
|
|
1
|
+
-- BEC-149: This migration was renumbered to 010_release_manager to fix cascading
|
|
2
|
+
-- prefix collision introduced when 007_sso was renumbered to 008_sso.
|
|
3
|
+
--
|
|
4
|
+
-- This file is retained for git history only. The migrator skips it based on
|
|
5
|
+
-- the SQLITE_MIGRATION_RENAMES map in migrator.ts, which also renames any
|
|
6
|
+
-- existing "009_release_manager" entries in schema_migrations to
|
|
7
|
+
-- "010_release_manager" so that existing deployments do not re-run this migration.
|
|
8
|
+
--
|
|
9
|
+
-- Active migration: packages/core/src/db/migrations/sqlite/010_release_manager.sql
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
-- BEC-134: per-model results from review-stage fanout.
|
|
2
|
+
CREATE TABLE IF NOT EXISTS review_model_runs (
|
|
3
|
+
id TEXT PRIMARY KEY,
|
|
4
|
+
stage_run_id TEXT NOT NULL REFERENCES stage_runs(id),
|
|
5
|
+
provider_id TEXT NOT NULL,
|
|
6
|
+
model_id TEXT NOT NULL,
|
|
7
|
+
status TEXT NOT NULL,
|
|
8
|
+
input_tokens INTEGER NOT NULL DEFAULT 0,
|
|
9
|
+
output_tokens INTEGER NOT NULL DEFAULT 0,
|
|
10
|
+
duration_ms INTEGER NOT NULL DEFAULT 0,
|
|
11
|
+
error_message TEXT,
|
|
12
|
+
truncated_files INTEGER NOT NULL DEFAULT 0,
|
|
13
|
+
started_at INTEGER,
|
|
14
|
+
completed_at INTEGER
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
CREATE INDEX IF NOT EXISTS idx_review_model_runs_stage_run_id
|
|
18
|
+
ON review_model_runs(stage_run_id);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
-- BEC-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
--
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
-- BEC-149: This migration was renumbered to 011_qa_run_columns to fix cascading
|
|
2
|
+
-- prefix collision introduced when 007_sso was renumbered to 008_sso.
|
|
3
|
+
--
|
|
4
|
+
-- This file is retained for git history only. The migrator skips it based on
|
|
5
|
+
-- the SQLITE_MIGRATION_RENAMES map in migrator.ts, which also renames any
|
|
6
|
+
-- existing "010_qa_run_columns" entries in schema_migrations to
|
|
7
|
+
-- "011_qa_run_columns" so that existing deployments do not re-run this migration.
|
|
8
|
+
--
|
|
9
|
+
-- Active migration: packages/core/src/db/migrations/sqlite/011_qa_run_columns.sql
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
-- BEC-135: Release Manager agent — decision log + one-shot approvals.
|
|
2
|
+
|
|
3
|
+
CREATE TABLE IF NOT EXISTS release_decisions (
|
|
4
|
+
id TEXT PRIMARY KEY,
|
|
5
|
+
repo_url TEXT NOT NULL,
|
|
6
|
+
branch TEXT NOT NULL,
|
|
7
|
+
decided_at INTEGER NOT NULL,
|
|
8
|
+
decision TEXT NOT NULL,
|
|
9
|
+
reason TEXT NOT NULL,
|
|
10
|
+
trigger_state_json TEXT NOT NULL,
|
|
11
|
+
proposed_version TEXT,
|
|
12
|
+
fired_tag TEXT,
|
|
13
|
+
fired_sha TEXT,
|
|
14
|
+
attempt_count INTEGER NOT NULL DEFAULT 0
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
-- Index for /release status: fast lookup of the most recent N decisions per (repo, branch).
|
|
18
|
+
CREATE INDEX IF NOT EXISTS idx_release_decisions_repo_branch_decided
|
|
19
|
+
ON release_decisions(repo_url, branch, decided_at DESC);
|
|
20
|
+
|
|
21
|
+
-- Index for retry sweep: find fire-pending rows.
|
|
22
|
+
CREATE INDEX IF NOT EXISTS idx_release_decisions_decision_decided
|
|
23
|
+
ON release_decisions(decision, decided_at);
|
|
24
|
+
|
|
25
|
+
CREATE TABLE IF NOT EXISTS release_approvals (
|
|
26
|
+
id TEXT PRIMARY KEY,
|
|
27
|
+
repo_url TEXT NOT NULL,
|
|
28
|
+
branch TEXT NOT NULL,
|
|
29
|
+
approved_at INTEGER NOT NULL,
|
|
30
|
+
approved_by TEXT NOT NULL,
|
|
31
|
+
consumed_at INTEGER,
|
|
32
|
+
consumed_by_decision_id TEXT
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
-- Partial UNIQUE: one fresh (un-consumed) approval per (repo, branch, user).
|
|
36
|
+
-- Once consumed, the row stays for audit but no longer blocks new approves.
|
|
37
|
+
CREATE UNIQUE INDEX IF NOT EXISTS idx_release_approvals_unique_fresh
|
|
38
|
+
ON release_approvals(repo_url, branch, approved_by)
|
|
39
|
+
WHERE consumed_at IS NULL;
|
|
40
|
+
|
|
41
|
+
-- Lookup index for fresh-approval check at decision time.
|
|
42
|
+
CREATE INDEX IF NOT EXISTS idx_release_approvals_repo_branch_consumed
|
|
43
|
+
ON release_approvals(repo_url, branch, consumed_at);
|
|
@@ -1,22 +1,9 @@
|
|
|
1
|
-
-- BEC-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
resolved_at INTEGER
|
|
11
|
-
);
|
|
12
|
-
|
|
13
|
-
-- Partial UNIQUE: at most one open gap issue per (repo, branch, workflow) at a time.
|
|
14
|
-
-- Once resolved (resolved_at IS NOT NULL), the row is preserved for audit but a new
|
|
15
|
-
-- issue can be filed for the same gap in the future.
|
|
16
|
-
CREATE UNIQUE INDEX IF NOT EXISTS idx_qa_gap_issues_unique_open
|
|
17
|
-
ON qa_gap_issues(repo_url, branch, workflow_path)
|
|
18
|
-
WHERE resolved_at IS NULL;
|
|
19
|
-
|
|
20
|
-
-- Lookup index for "is there an open gap for this (repo, branch, workflow)?" — partial too.
|
|
21
|
-
CREATE INDEX IF NOT EXISTS idx_qa_gap_issues_lookup
|
|
22
|
-
ON qa_gap_issues(repo_url, branch, workflow_path, resolved_at);
|
|
1
|
+
-- BEC-149: This migration was renumbered to 012_qa_gap_issues to fix cascading
|
|
2
|
+
-- prefix collision introduced when 007_sso was renumbered to 008_sso.
|
|
3
|
+
--
|
|
4
|
+
-- This file is retained for git history only. The migrator skips it based on
|
|
5
|
+
-- the SQLITE_MIGRATION_RENAMES map in migrator.ts, which also renames any
|
|
6
|
+
-- existing "011_qa_gap_issues" entries in schema_migrations to
|
|
7
|
+
-- "012_qa_gap_issues" so that existing deployments do not re-run this migration.
|
|
8
|
+
--
|
|
9
|
+
-- Active migration: packages/core/src/db/migrations/sqlite/012_qa_gap_issues.sql
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
-- BEC-136: QA agent — track in-flight workflow runs on the release_decisions table.
|
|
2
|
+
|
|
3
|
+
ALTER TABLE release_decisions ADD COLUMN qa_run_id INTEGER;
|
|
4
|
+
ALTER TABLE release_decisions ADD COLUMN qa_run_sha TEXT;
|
|
5
|
+
|
|
6
|
+
-- Index for collectState's qaRun lookup: fastest path for "most recent decision with non-null qa_run_id"
|
|
7
|
+
CREATE INDEX IF NOT EXISTS idx_release_decisions_qa_run_id
|
|
8
|
+
ON release_decisions(repo_url, branch, qa_run_id, decided_at DESC)
|
|
9
|
+
WHERE qa_run_id IS NOT NULL;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
-- BEC-136: QA agent — Linear issue idempotency for missing QA workflows.
|
|
2
|
+
|
|
3
|
+
CREATE TABLE IF NOT EXISTS qa_gap_issues (
|
|
4
|
+
id TEXT PRIMARY KEY,
|
|
5
|
+
repo_url TEXT NOT NULL,
|
|
6
|
+
branch TEXT NOT NULL,
|
|
7
|
+
workflow_path TEXT NOT NULL,
|
|
8
|
+
linear_issue_id TEXT NOT NULL,
|
|
9
|
+
filed_at INTEGER NOT NULL,
|
|
10
|
+
resolved_at INTEGER
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
-- Partial UNIQUE: at most one open gap issue per (repo, branch, workflow) at a time.
|
|
14
|
+
-- Once resolved (resolved_at IS NOT NULL), the row is preserved for audit but a new
|
|
15
|
+
-- issue can be filed for the same gap in the future.
|
|
16
|
+
CREATE UNIQUE INDEX IF NOT EXISTS idx_qa_gap_issues_unique_open
|
|
17
|
+
ON qa_gap_issues(repo_url, branch, workflow_path)
|
|
18
|
+
WHERE resolved_at IS NULL;
|
|
19
|
+
|
|
20
|
+
-- Lookup index for "is there an open gap for this (repo, branch, workflow)?" — partial too.
|
|
21
|
+
CREATE INDEX IF NOT EXISTS idx_qa_gap_issues_lookup
|
|
22
|
+
ON qa_gap_issues(repo_url, branch, workflow_path, resolved_at);
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
--
|
|
2
|
-
--
|
|
3
|
-
--
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
-- BEC-149: This migration was renumbered to 013_stage_runs_cache_tokens to fix
|
|
2
|
+
-- a duplicate prefix (012_qa_gap_issues and 012_stage_runs_cache_tokens shared
|
|
3
|
+
-- prefix 012 after the initial BEC-149 rename pass).
|
|
4
|
+
--
|
|
5
|
+
-- This file is retained for git history only. The migrator skips it based on
|
|
6
|
+
-- the SQLITE_MIGRATION_RENAMES map in migrator.ts, which also renames any
|
|
7
|
+
-- existing "012_stage_runs_cache_tokens" entries in schema_migrations to
|
|
8
|
+
-- "013_stage_runs_cache_tokens" so existing deployments do not re-run this
|
|
9
|
+
-- migration.
|
|
10
|
+
--
|
|
11
|
+
-- Active migration: packages/core/src/db/migrations/sqlite/013_stage_runs_cache_tokens.sql
|