← Back to Pull requests

feat: dev-only devstack server for the local research lifecycle #111

Closed
unknown closed this pull request without merging on Oct 21, 2026 16:16 UTC
View on GitHub
unknown unknown commented on Oct 20, 2026 05:46 UTC
Author

What and why


Part of #32: adds devstack, a dev-only server that runs the research lifecycle on one machine.

  • platform-api gains a non-default dev feature. devstack is declared with

  • required-features = ["dev"], so default and release builds never include it.
  • src/dev.rs (feature dev) holds the shared research wiring, DevResearchStack

  • (in-memory vault, dev key provider, snapshot commit, research-enabled query
    service with default or explicit attestation), and the startup checks. Both
    devstack and tests/research_api.rs use it, so the two cannot drift apart.
  • devstack refuses to start without DEVSTACK_ALLOW_INSECURE=1 in the process

  • environment (.env does not count), a JWT_HS256_SECRET, and a loopback
    BIND_ADDR. It logs an insecure-mode warning and a service.start audit event,
    seeds a synthetic synth-data cohort for a steward, publishes its catalog
    listing, and prints steward and researcher tokens.
  • CI: a new release-binaries job does a default-feature release build of

  • platform-api and fails if devstack is built, or can be built without dev.
  • Docs: README "Development" and "Layout", CHANGELOG.md, docs/TESTING.md, CONTRIBUTING.md.
  • Not done yet: the README's browser flow. The dev proxy (#31) isn't merged and the
    portal has no research-query form, so the README uses curl for the steward and
    researcher steps.

    <!-- What changed, and why. Link the issue or the step in docs/PROJECT_SCOPE.md. -->

    How it was tested

  • scripts/check.sh passes locally (macOS).

  • New negative tests in src/dev.rs: startup without the opt-in flag, without a

  • JWT secret, and on a non-loopback BIND_ADDR are each refused; the accepted
    cases pass.
  • devstack unit test: the seeded cohort both releases and suppresses groups

  • through the research query path.
  • All 9 tests/research_api.rs tests pass unchanged on the shared wiring, including

  • refused_attestation_charges_no_budget with DevAttestation::strict().
  • Manually: cargo build --release -p platform-api --bin devstack fails with

  • "requires the features: dev"; devstack refuses to start without the flag and
    without a secret, and starts with both.

    <!-- Tests added or changed. Name the failure paths covered. -->

    Checklist

  • [ X] scripts/check.sh passes locally

  • [ X] Every new refusal has a negative test

  • Every new security decision emits a SECURITY_AUDIT_EVENT covered by audit_coverage.rs

  • [ X] Fails closed on missing configuration, key material, or attestation

  • [ X] No new cryptographic primitives; suites stay behind their type aliases

  • [ X] Synthetic or public data only (docs/DATA_POLICY.md)

  • [ X] Docs and CHANGELOG.md updated for user-visible changes

  • [ X] Architectural decision recorded in docs/adr/ if one was made
  • Diff: 352 lines (+264 / -88) across 4 files Reviewer: abendrothj Review duration: 2070m
    All Vouch review confidence checks passed
    Residual risk 0.18 = Change Risk (0.42) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.42 · 352 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%
    56%
    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.351
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #111"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% 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.5% (MEDIUM) · Higher = larger blast radius
    42.5%
    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: 56.8% · Lower = rushed or shallow review
    56.8%
    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: 18.4% · Safe to merge
    18.4%