Skip to content

docs(server): implementation plan for the scope switch (#580) - #581

Open
halcwb wants to merge 4 commits into
informedica:masterfrom
halcwb:docs/580-scope-switch
Open

docs(server): implementation plan for the scope switch (#580)#581
halcwb wants to merge 4 commits into
informedica:masterfrom
halcwb:docs/580-scope-switch

Conversation

@halcwb

@halcwb halcwb commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Description

Implementation plan for the scope switch (#580): the production server exposes only the MDR-accredited parts of GenPRES, all other environments the full suite, selected at runtime and enforced by the server. One trunk, no release branches.

Key points:

  • GENPRES_SCOPE=accredited|full, parsed into Settings; defaults to accredited when GENPRES_PROD=1, full otherwise; any other value stops the server at startup.
  • One shared Feature list compiled into server and client; Feature.ofCommand is total over every command family, with a test per case.
  • The gate sits in processCmd ahead of requireLoaded and returns a stable NOT_IN_SCOPE error without touching any port.
  • A new getSettings method carries scope and demo flag to the client, which filters the page list and guards UpdatePage and the pg deep link. This also repairs the dead IsDemo plumbing.
  • Stated limits: the emergency list and continuous medication pages are client-only (sheets read from Google in the browser), so they are enforced client-side only; the MCP host is not covered; the accredited set is a placeholder to be supplied from the MDR file.

Five PRs, each under 200 lines.

Author checklist

Reviewer checklist

  • The chosen approach is a good choice.
  • The sequence of steps is complete and sensible.
  • I have documented resources that may help with implementation.

🤖 Generated with Claude Code

Implementation plan for GENPRES_SCOPE=accredited|full: one shared
Feature list, a gate in the command dispatcher, a getSettings method
the client mirrors, defaults that fail towards accredited in
production. Keeps development, acceptance and production on one trunk
instead of release branches.

Refs informedica#580

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This documentation-only PR provides a phased implementation plan for runtime scope selection between accredited and full GenPRES surfaces.

  • Defines shared scope and feature contracts for client and server.
  • Places server enforcement before all command-dispatch bypasses.
  • Covers client navigation, initial-page normalization, and scope-dependent sheet loading.
  • Documents safe configuration defaults, known limits, tests, and deployment verification.

Confidence Score: 5/5

The documentation plan appears safe to merge, with no outstanding actionable findings.

The latest revision closes the prior sheet-loading lifecycle gap by moving permitted loads into the settings-resolution handler and explicitly verifying that full scope fetches both sheets. All earlier findings are resolved in the current plan.

Important Files Changed

Filename Overview
docs/implementation-plans/580-scope-switch.md Documents the complete scope-switch architecture and now ensures full-scope sheet loads begin after settings resolve.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    Env["GENPRES_SCOPE / GENPRES_PROD"] --> Settings["Validated server Settings"]
    Settings --> Gate["processCmd scope gate"]
    Command["API Command"] --> Gate
    Gate -->|Permitted| Ports["Server ports and domain logic"]
    Gate -->|Withheld| Error["NOT_IN_SCOPE"]
    Settings --> API["getSettings"]
    API --> Client["Client settings handler"]
    Client --> Pages["Filter and normalize pages"]
    Client --> Sheets["Load permitted client-side sheets"]
Loading

Reviews (3): Last reviewed commit: "docs(server): start permitted sheet load..." | Re-trigger Greptile

Comment thread docs/implementation-plans/580-scope-switch.md Outdated
Comment thread docs/implementation-plans/580-scope-switch.md Outdated
Comment thread docs/implementation-plans/580-scope-switch.md
Comment thread docs/implementation-plans/580-scope-switch.md Outdated
No compose fallback for GENPRES_SCOPE so the production derivation
holds; the scope check is the first operation in processCmd, ahead of
the four commands that bypass requireLoaded; the start page is
normalised when settings resolve; client-only sheets are not fetched
in accredited scope, with server-side routing as a named follow-up.

Refs informedica#580

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ules

The client-side sheets limit in the scope switch plan now points to
the issue that removes it, instead of an unnamed follow-up.

Refs informedica#580, informedica#582

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Comment thread docs/implementation-plans/580-scope-switch.md Outdated
With unresolved settings treated as accredited, a gated load in init
would never run. The settings-resolved handler now dispatches the
permitted client-side sheet loads and normalises the start page.

Refs informedica#580

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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