Implement phased modernization infrastructure for transitioning from multi-page legacy routing to SPA portal-shell architecture, plus post-delivery hardening fixes for policy loading, fallback consistency, and governance drift detection. Key changes: - Add route contract enrichment with scope/visibility/compatibility policies - Canonical 302 redirects from legacy direct-entry to /portal-shell/ routes - Asset readiness enforcement and runtime fallback retirement for in-scope routes - Shared feature-flag helpers (env > config > default) replacing duplicated _to_bool - Defensive copy for lru_cached policy payloads preventing mutation corruption - Unified retired-fallback response helper across app and blueprint routes - Frontend/backend route-contract cross-validation in governance gates - Shell CSS token fallback values for routes rendered outside shell scope - Local-safe .env.example defaults with production recommendation comments - Legacy contract fallback warning logging and single-hop redirect optimization Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2.1 KiB
2.1 KiB
MODIFIED Requirements
Requirement: Portal SHALL provide a SPA shell driven by Vue Router
The portal frontend SHALL use a single SPA shell entry and Vue Router to render in-scope page modules without iframe embedding. In-scope routes for this phase SHALL include the governed report routes and admin surfaces /admin/pages and /admin/performance, while deferred routes (/tables, /excel-query, /query-tool, /mid-section-defect) are explicitly excluded from this phase contract.
Scenario: In-scope route renders through shell governance
- WHEN a user navigates to an in-scope shell-governed route
- THEN the route SHALL resolve through Vue Router with shell contract metadata
- THEN the shell SHALL render the corresponding module/target without iframe fallback
Scenario: Admin route appears as governed target
- WHEN an admin user opens shell navigation
- THEN
/admin/pagesand/admin/performanceSHALL be exposed as governed navigation targets per access policy
Scenario: Deferred route is excluded from this phase route-governance requirement
- WHEN phase-level shell-governance compliance is evaluated
- THEN
/tables,/excel-query,/query-tool, and/mid-section-defectSHALL be treated as deferred and excluded from pass/fail criteria for this phase
Requirement: Existing route contracts SHALL remain stable in SPA mode
Migration to the shell-first SPA model SHALL preserve route/query compatibility for in-scope routes while introducing canonical shell routing policy and explicit compatibility handling.
Scenario: Canonical shell path behavior for in-scope routes
- WHEN a user opens an in-scope report route via canonical shell path
- THEN route behavior and query semantics SHALL remain compatible with established baseline behavior
Scenario: Compatibility policy for direct route entry
- WHEN a user opens an in-scope report route via direct non-canonical entry
- THEN the system SHALL apply explicit compatibility policy (preserve behavior or compatibility redirect) without breaking route semantics