← Back to Pull requests

feat(server): the upgrade channel on core's own entrypoint #512

Closed
unknown closed this pull request without merging on Nov 19, 2026 00:45 UTC
View on GitHub
unknown unknown commented on Nov 18, 2026 15:27 UTC
Author

What

  • traust-server db upgrade — the store's db-contract channel on core's own entrypoint: plans (names, sha256 prefixes, declared destructive reasons; exit 1 when pending), --apply runs the plan, --allow-destructive acknowledges declared destructive work. Exit 0: current, applied, or no local store yet; an empty configured database exits 1 (its deployment provisions it).

  • A store from before the channel starts on it at the head (with contracts stamp_channel): presumed current, every shipped script stamped as applied in one transaction, nothing run, nothing re-run. A local store is brought on by its first open; a configured database refuses until its deployment runs db upgrade --apply. store_status() reports it as PRE_CHANNEL.

  • The open gate's refusal and the README Store upgrades section name this command; AGENTS.md carries the operator path for agents meeting a refused store.

  • Pins traust-contracts at 122e9a4: ahead-tolerance — a database stamped beyond the shipped channel's head opens on the older pair (rollback = redeploy, the database stays forward, going forward again needs nothing). Reversal (run_downgrades) was removed upstream: it had no user.
  • The user journeys

  • Upgrade and stay: new pod refuses with the plan → db upgrade --apply (add --allow-destructive when a reason is declared) → serves.

  • Go back: redeploy the previous core + contracts image. The database stays forward; the older pair opens it (ahead stamps tolerated). No database step, ever.

  • Go forward again: stamps already say what ran — up to date. Destructive scripts are one-way doors (documented).
  • Decisions

  • The command lives where the database lives — traust-core owns the store and the contract pin; the deployment that meets the database is the traust-server container (traust#428 closed as the wrong owner).

  • Pre-channel = presumed current, stamped at the head — not verified, not re-run. A hand-changed shape is that operator's to resolve when a script refuses what does not fit.

  • Thin over the Context surface — every semantic stays in one owner.
  • Tests

    make test green at each step; Qodo passes addressed (plan-time refusals print their remedy, empty-configured exits 1, the pre-channel plan shows the stamp manifest). Smoke-tested against a genuine pre-channel store: plan → exit 1, --apply → on the channel, follow-up → up to date.

    Tracker

    Plan: 2026-11-db-upgrades-cli (traust-core). Depends on traust-contracts#180 merging first.

    Diff: 331 lines (+248 / -83) across 4 files Reviewer: gurnben Review duration: 558m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.42) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.42 · 331 lines diff across 4 files
    0.42
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.347
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #512"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 42.1% (MEDIUM) · Higher = larger blast radius
    42.1%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 16.6% · Safe to merge
    16.6%