diff --git a/docs/product-technical-gap-baseline.md b/docs/product-technical-gap-baseline.md
index e65883463..22809b362 100644
--- a/docs/product-technical-gap-baseline.md
+++ b/docs/product-technical-gap-baseline.md
@@ -19,7 +19,7 @@
## 3. General Architecture Gaps
- **DB Architecture**: Ensure PostgreSQL is strictly used (no file DBs), 3rd normal form is maintained, and Hot Partitions are handled. DB locks must be managed (or use read/write replicas).
- **Zotero Integration**: Papers and standards referenced by TEPP must be synced via Local Zotero API (http://localhost:23119/api/) and cited using APA 7th edition in docstrings.
-- **Testing**: We need actual testing of Psychometrics (Fast-MLSIRM parameter calibration, RMSE of estimates, Fixed-Item Parameter Calibration, CAT) against synthetic/demo data.
+- **Testing**: Partially resolved -- CAT recovery is now real and tested via `tests/test_fast_mlsirm_cat_recovery.py`, which simulates responses from known true item parameters and person thetas and verifies the actual adaptive-testing value proposition via `fast_mlsirm.cat_simulate_polytomous` (Dodd, De Ayala & Koch, 1995): a mean of ~8.7 of 40 items reaches accuracy (RMSE ~0.40, correlation ~0.91) -- not just "it runs," but "it recovers theta using substantially fewer items than the full bank," the property that actually distinguishes CAT from full-bank testing. GRM (Samejima 1969) and GPCM (Muraki 1993) parameter-recovery tests -- `fast_mlsirm` ships no polytomous simulator, so both formulas need to be implemented directly, matching `PolytomousFit`'s documented parameterization -- are in flight in still-open PRs #451 (`tests/test_fast_mlsirm_grm_recovery.py`) and #452 (`tests/test_fast_mlsirm_gpcm_recovery.py`) and not yet merged. Still open: Fixed-Item Parameter Calibration (Kim, 2006 FIPC -- `period_report.py` uses this for later periods, untested; check `link_fixed_item_parameters`/`fixed_item_calibration_diagnostics` for the real two-stage simulation this needs).
- **Security & Compliance**: PII masking cannot break the system. Need SOC 2 and CSAP compliance alternatives to blind PII masking.
- **LLM Orchestration**: Ensure ALL LLM calls route through `contextual-orchestrator` utilizing API keys (BYTEZ, NVIDIA, OPENROUTER, OPENAI) with auto model discovery and optimal reasoning effort allocation (Fugu/Conductor/TRINITY research).
diff --git a/frontend/src/App.test.tsx b/frontend/src/App.test.tsx
index 7462abd2c..9582ae69e 100644
--- a/frontend/src/App.test.tsx
+++ b/frontend/src/App.test.tsx
@@ -28,19 +28,25 @@ beforeEach(() => {
afterEach(() => {
vi.unstubAllGlobals();
+ window.sessionStorage.clear();
+ window.localStorage.clear();
});
describe("App, unauthenticated", () => {
it("shows a login button that starts the real OIDC redirect", async () => {
+ window.history.replaceState({}, "", "/?post=abc#details");
render();
const button = screen.getByRole("button", { name: /log in/i });
await userEvent.click(button);
expect(signinRedirect).toHaveBeenCalledTimes(1);
expect(signinRedirect).toHaveBeenCalledWith(
expect.objectContaining({
- state: expect.objectContaining({ returnUrl: expect.stringMatching(/^\//) }),
+ state: expect.objectContaining({ returnUrl: "/?post=abc#details" }),
}),
);
+ // Persisted as a fallback in case the OIDC state round-trip is dropped
+ // (see oidcReturnUrl.ts's restoreOidcReturnUrl, consumed in main.tsx).
+ expect(window.sessionStorage.getItem("lineageweave.oidc.returnUrl")).toBe("/?post=abc#details");
});
});
diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx
index 6fba0dd41..1b5b351ab 100644
--- a/frontend/src/App.tsx
+++ b/frontend/src/App.tsx
@@ -4610,7 +4610,8 @@ export default function App({ showLabPanels = false }: { showLabPanels?: boolean