Skip to content

Harden user-state startup-mode composition (backend-3.5.5)#359

Draft
leynos wants to merge 6 commits into
mainfrom
backend-3-5-5-harden-startup-mode-composition
Draft

Harden user-state startup-mode composition (backend-3.5.5)#359
leynos wants to merge 6 commits into
mainfrom
backend-3-5-5-harden-startup-mode-composition

Conversation

@leynos
Copy link
Copy Markdown
Owner

@leynos leynos commented May 20, 2026

Summary

  • Implements the approved execplan for backend roadmap item 3.5.5: docs/execplans/backend-3-5-5-harden-startup-mode-composition.md.
  • Hardens backend/src/server/state_builders.rs by routing user-state startup composition through an explicit private helper seam and port bundle, keeping DB-present versus fixture-fallback adapter selection deterministic as wiring evolves.
  • Strengthens startup-mode behavioural coverage with shared rstest-bdd assertions for DB-backed and fixture-backed profile, users-list, and preferences responses.
  • Records the design decision and testing convention in the backend architecture and developer guides, and marks roadmap item 3.5.5 done.

Validation

  • cargo test -p backend --test startup_mode_composition_bdd -- --nocapture
  • make check-fmt
  • make lint
  • make test
  • coderabbit review --agent after the helper-seam milestone: 0 findings.
  • coderabbit review --agent after the regression-assertion milestone: 0 findings.
  • coderabbit review --agent after the documentation milestone: 0 findings.

Notes

  • docs/users-guide.md was not updated because this change does not alter operator-visible server behaviour or user interface.
  • Property, Kani, and Verus coverage were not added because the change preserves existing startup adapter selection behaviour rather than introducing a new ranged invariant, state machine, or proof-bearing business rule.

References

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented May 20, 2026

Reviewer's Guide

Pre-implementation ExecPlan for roadmap item 3.5.5 has been substantially rewritten and tightened: it now formalises an approval gate, narrows scope to hardening user-state startup-mode composition, updates constraints/tolerances/risks, describes current code/test context more concretely, and lays out a staged implementation and validation plan without changing any production code.

File-Level Changes

Change Details Files
ExecPlan purpose, status, and observable-success criteria refocused on user-state startup-mode composition with an explicit approval gate before implementation.
  • Clarified that this PR is a pre-implementation planning change and must be approved before any code work begins.
  • Reframed the purpose around keeping DB-present vs fixture-fallback user-state adapter selection deterministic as wiring evolves.
  • Replaced earlier success criteria with ones that emphasise explicit user-state helper seams, deterministic adapter selection, and rstest/rstest-bdd coverage rather than specific prior stage labels.
docs/execplans/backend-3-5-5-harden-startup-mode-composition.md
Constraints, tolerances, risks, and ownership sections rewritten to align with current architecture guidelines, testing stack, and agent usage model.
  • Constraints now emphasise preserving hexagonal architecture invariants, keeping persistence in outbound adapters, avoiding new dependencies, and using rstest/rstest-bdd according to existing guides.
  • Tolerances now bound scope and churn (files/LOC), restrict interface and dependency changes, and add behaviour/validation/architecture tolerances for startup-mode behaviour.
  • Risks have been updated to focus on HttpStateExtraPorts defaulting, repeated db_pool branching, route-submission composition location, test flakiness with embedded Postgres, and avoiding overlap with roadmap 3.5.6.
  • Replaced the earlier multi-agent implementation roles with a narrower agent-team description that keeps this PR strictly planning-only.
docs/execplans/backend-3-5-5-harden-startup-mode-composition.md
Context, plan-of-work, validation, and artefact sections restructured into a staged, command-level implementation roadmap without introducing any code changes.
  • Expanded context to enumerate the current composition root, key helper functions, HTTP state types, existing startup-mode tests, and supporting docs that will be touched later.
  • Replaced earlier stage descriptions with new stages A–D that cover approval, helper seam introduction, behavioural regression strengthening, documentation/roadmap closure, and detailed concrete steps and commands.
  • Updated validation and acceptance to describe the required post-implementation properties (deterministic adapter selection, error/validation envelope stability, test coverage, gates, and CodeRabbit review).
  • Reworked artefact/notes, interfaces/dependencies, and idempotence/recovery sections to clarify required logs, helper-shape expectations, and how to safely rerun or correct the work once implementation starts.
docs/execplans/backend-3-5-5-harden-startup-mode-composition.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

codescene-delta-analysis[bot]

This comment was marked as outdated.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 26, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 75d0d4e6-2c19-48a0-b2d0-ca3dbdf9cb4c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch backend-3-5-5-harden-startup-mode-composition

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

codescene-delta-analysis[bot]

This comment was marked as outdated.

codescene-delta-analysis[bot]

This comment was marked as outdated.

codescene-delta-analysis[bot]

This comment was marked as outdated.

leynos added 6 commits May 26, 2026 23:15
Replace the existing backend 3.5.5 execution-plan draft with an
approval-gated plan focused on deterministic user-state startup-mode
composition.

Record the helper seams, behavioural regression scope, documentation
requirements, validation gates, Wyvern reconnaissance, and Firecrawl
research that should guide the later implementation pass.
Record that docs/users-guide.md refers to operators of the
Wildside server application, not product end users.

Narrow the planned documentation update requirement to behaviour
that is visible to server operators.
Add a private user-state port bundle in `state_builders.rs` so the
identity-bearing HTTP ports are selected through one explicit helper seam.

Record the approval, baseline gates, targeted checks, and milestone gate
evidence in the execplan before moving to behavioural hardening.
Add HTTP-boundary regression assertions that tie startup-mode
selection to current-user, users-list, and preferences evidence.
Record the 3.5.5 composition decision, BDD validation convention,
roadmap closure, and final gate evidence for the implementation.
Record the final CodeRabbit result and gate evidence in the 3.5.5 ExecPlan before publishing the branch for PR review.
@lodyai lodyai Bot force-pushed the backend-3-5-5-harden-startup-mode-composition branch from 61192f8 to 47d27ab Compare May 26, 2026 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant