From 077ec7289360459e9585a6c0d67b0d64feceb14d Mon Sep 17 00:00:00 2001 From: Seongho Bae Date: Sun, 23 Aug 2026 13:46:48 +0000 Subject: [PATCH 01/17] fix: restore login typecheck and non-identifying gap baseline Unauthenticated login no longer mounts Admin settings with an undefined token, so tsc -b succeeds on protected main. Login persists a validated OIDC return URL through the existing helpers. The gap baseline is rewritten without identifying record identifiers and bound to the current PR and issue inventory. --- .../2.12.7-login-tsc-and-gap-baseline.md | 11 + docs/product-technical-gap-baseline.md | 289 ++++++++++++++++-- frontend/src/App.test.tsx | 14 + frontend/src/App.tsx | 4 +- 4 files changed, 292 insertions(+), 26 deletions(-) create mode 100644 CHANGELOG.d/2.12.7-login-tsc-and-gap-baseline.md diff --git a/CHANGELOG.d/2.12.7-login-tsc-and-gap-baseline.md b/CHANGELOG.d/2.12.7-login-tsc-and-gap-baseline.md new file mode 100644 index 000000000..d887cbaa6 --- /dev/null +++ b/CHANGELOG.d/2.12.7-login-tsc-and-gap-baseline.md @@ -0,0 +1,11 @@ +# Unauthenticated login no longer breaks the frontend typecheck + +- Login uses the existing OIDC return-URL helpers so a validated path, + query, and fragment survive the SSO round-trip and persist to the + session/local storage fallback consumed by the callback. +- The unauthenticated shell no longer mounts Admin settings with an + undefined access token. That mismatch failed `tsc -b` on protected + `main` and on every PR that inherited the login path. +- Restores a non-identifying product/technical gap baseline bound to the + current PR and issue inventory (ADR 0001). Identifying post identifiers + must not return to this file. diff --git a/docs/product-technical-gap-baseline.md b/docs/product-technical-gap-baseline.md index e65883463..32b92d9e4 100644 --- a/docs/product-technical-gap-baseline.md +++ b/docs/product-technical-gap-baseline.md @@ -1,26 +1,267 @@ # Product & Technical Gap Baseline -## 1. Known Parsing & Frontend Display Gaps -- **Footnote Parsing**: `post=00505695-3e61-1fd1-83c5-263f88a9e77a` fails to recognize footnotes (li/oi level errors). -- **Table Parsing**: `post=00505695-3e61-1fd1-80c6-86bb61c8ddc5` completely fails at parsing tables. -- **Indentation**: Incorrect indentation rendering in `post=00505695-7571-1fd1-83c3-d521b187ad5b` and `post=00505695-3e61-1fd1-83c0-497b3c1c455e`. -- **Image/Table OCR**: `post=00505695-7571-1fd1-83dd-3d22a61a5734` fails text recognition for tables inside images, markdown parsing fails, and image OCR description is too shallow for Ontology & Semantics. -- **Math/Superscripts**: `post=00505695-9612-1fe1-83a7-e30153323f25` fails to parse superscripts like m^3 properly. Needs strict Ontology grammar for math formulas. -- **Missing UI Elements**: DAG (Directed Acyclic Graph) view is currently missing from the frontend for `post=00505695-7571-1fd1-83c5-895ed333cdbc`. - -## 2. LLM Extraction & Knowledge Graph Gaps -- **Multiple Project Extraction**: (Resolved) LLM prompt updated to request key_events as objects with project_name, separating events correctly. -- **5W1H Missing**: (Resolved) LLM prompt updated to explicitly request 5W1H evidence items in the JSON output array. -- **R&R and Keyman Missing**: (Resolved) LLM prompt updated to explicitly instruct using actual stated names rather than collective titles. -- **Entity Resolution / Searxng**: Abbreviations like "한전" and "한국전력" are not mapped properly using Searxng and KG corroboration. -- **Meso-level Team Mapping**: (Resolved) Checked extraction logic; `team` mapping logic is present and correct, but LLM needed better explicit instruction which is covered by R&R resolution. -- **Base64 Image Omni-modal**: Current text-only embedding fails on images. Omni-modal LLM processing is required for images to capture layout, font size, colors, and spatial meaning. - -## 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. -- **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). - -*This document is continuously updated by the hourly automated agent loop.* +> Audit snapshot: 2026-08-23 22:40 KST. This repository records synthetic +> fixtures and aggregate, non-identifying runtime evidence only. Open PRs and +> local checks are not protected-default-branch release evidence. +> Identifying post identifiers, organization names, and production record keys +> must never appear in this file. + +## 1. Exact-head and governance evidence + +The protected default branch was +`ef6f5a5ffcb467bd935dc1e53acc0029669b0bd7` when this baseline was refreshed. +The live queue contained 52 open PRs and 19 open issues. No independently +approved current head was available for a protected squash-merge. Branch +protection / rulesets continue to require independent exact-head review; +the authenticated GitHub identity that authors these PRs cannot self-approve. + +This exact-head repairs two protected-main defects that currently poison +every downstream PR: + +1. Unauthenticated login rendered `AdminPanel` with an undefined access token, + so `tsc -b` failed on `main` and on any PR that did not also rewrite the + login path. Login now uses the existing OIDC return-URL helpers and does + not mount admin settings before authentication. +2. The in-tree gap baseline on `main` had regressed to identifying post + identifiers. This rewrite restores the non-identifying contract (ADR 0001) + and binds gaps to the current PR/issue inventory. + +Recent protected-default-branch evidence: + +| PR | Result | Evidence boundary | +| ---: | --- | --- | +| #347 | merged as `ef6f5a5ffcb467bd935dc1e53acc0029669b0bd7` | Korean UI standards on the current protected head | +| ContextualWisdomLab/.github #1248 | merged as `9ad0ad50409561292b424d6f35a95d670a277e77` | central Strix scope repair is available to subsequent reruns | + +The organization scheduler is the single review/repair control plane. Its +hourly heartbeat satisfies the hourly loop requirement without a duplicate +repository-local GitHub Actions scheduler. + +Figma design-system boundary (ADR 0002): File ID `1Su3lDRmiZdcUs47t1QwIX`. +The file is a safe, empty design-system boundary; popup/Event Lineage frames +are not yet present. Do not copy source-organization cover content into this +repository. Storybook, `ui-ux-pro-max-skill`, and Anti-Slop-UI remain the +scene and edge-case inventory for repeated web objects. + +## 2. User-visible capability baseline + +Substantially present on protected `main`: + +- PostgreSQL-backed import, normalized provenance, cutoff-aware analysis runs, + source revisions, lineage reconstruction, and explicit unavailable states. +- Authenticated workspace navigation, post detail, localized summaries, 5W1H, + R&R/Keyman, evidence citations, chat, organization hierarchy, and lineage DAG + (`frontend/src/LineageDag.tsx` is on `main`; the old “DAG view missing” + baseline entry is stale). +- Semantic paragraph/list/table/image-region units that preserve source and + provenance instead of flattening a record into one body string. +- Contextual-orchestrator boundaries for adjudication, extraction, summaries, + chat, embeddings, and VISION; null channels remain unavailable and are + dropped from score fusion. +- W3C PROV-O projection through normalized provenance tables, with the + knowledge graph retained as an explicit navigation projection. +- Keyverse/Keycloak OIDC, RankWeave fusion port, TEPP measurement client, + ThreadWeave tree assembly. + +These statements describe source capability, not authenticated production +corpus acceptance or protected release. + +## 3. Current open PR inventory (bind gaps to heads) + +Heads below are queue evidence, not protected-main release evidence. Recheck +SHA, checks, unresolved threads, and independent approval immediately before +any merge claim. Do not self-approve, force-push, or transfer stale review +evidence across heads. + +### 3.1 Merge-blocking and shared-gate repairs + +| PR | Intent | Gap it closes when merged | +| ---: | --- | --- | +| #426 | Frontend build repair + published ontology Pages | Shared `tsc` gate and public ontology publication (overlaps this head’s login fix; Pages remain on #426) | +| this head | Login `tsc` + non-identifying baseline | Unblocks frontend checks on PRs that rebase onto `main`; restores ADR 0001 baseline | +| #429 | `/healthz` routes to the liveness probe | Operability: liveness vs settings mix-up | +| #428 | `migrate.sh` whitelist catch-up | Deploy: migrations silently skipped | +| #393 | Detach provider parse error context | Honest orchestrator failure, not a poisoned parse | +| #383 | Reader-safe OTel server diagnostics | Issue #361: generic 503 must still preserve diagnostics | +| #474 | Rename buyer-facing terminology + login return | Operator/workspace copy; do not use “Buyer” for internal objects | +| #436 | AdminPanel coverage | Frontend coverage 100% bar for admin settings | +| #439 | LineageDag tests and stories | Storybook inventory for DAG edge cases | + +### 3.2 User-visible product surfaces + +| PR | Intent | Related issue / ADR | +| ---: | --- | --- | +| #258 | Workspace evidence board and source-grounded ontology | Critical; CHANGES_REQUESTED historically | +| #355 | Naruon event projection contract | Issues #336, #338 | +| #349 | Bounded ontology and provenance explorer | Issue #341 | +| #387 | Persist and explain Event Lineage channel evidence | Issue #274 | +| #484 | Allen interval relations on Event Lineage edges | Temporal modeling; Allen (1983) | +| #480 | Bind corroborated SKOS org aliases to one catalog row | SKOS exact-match / altLabel | +| #482 | SKOS companion caption on organization chips | Same SKOS catalog | +| #492 | Ontology namespace compatibility map | Issue #372 | +| #405 | Persisted image-region locations | VISION region provenance | +| #427 | Quantity superscripts in post bodies | Formula / unit display | +| #481 | Persist leftover LSIRM interaction-map coordinates | fast-mlsirm leftover pairs | +| #485 | Land leftover pair clicks on the named Post quality criterion | Same leftover surface | +| #490 | Wire remaining ADR 0133–0137 surfaces | Consolidated product stack | +| #392 | Source context and project-safe summary hints | Board source-detail state | +| #434 | Wire adjudication client into corpus-wide rebuild | Issue #289 | + +### 3.3 Ask Agent stack (issues #358–#363, #269–#272) + +| PR | Intent | +| ---: | --- | +| #415 | Korean relative-time expressions in Global Ask | +| #418 | Merged `lineage_graph` for every cited post | +| #419 | Cite persisted image evidence for cited posts | +| #421 | Playwright harness for Ask Agent capabilities | +| #422 | ADRs for Ask Agent temporal / lineage / evidence goal | + +### 3.4 Scientific measurement recovery (must remain true-parameter tests) + +| PR | Intent | +| ---: | --- | +| #451 | GRM parameter-recovery (RMSE vs true parameters) | +| #452 | GPCM parameter-recovery | +| #453 | CAT parameter-recovery | +| #454 | FIPC parameter-recovery | +| #468 | Bind fast-mlsirm, Keyverse, orchestrator, and TEPP | +| #417 | TEPP topic-lineage consumption boundary (TRSL-TM + CHRONOS/TDT) | + +### 3.5 Gap-baseline documentation queue (superseded by this file) + +PRs #368, #440–#450, #442–#450, #455, #463, #479 rewrite slices of this +baseline. Once this non-identifying inventory lands on protected `main`, +those docs-only heads should be closed as superseded rather than merged as +conflicting rewrites. Do not merge an identifying baseline over this file. + +## 4. Open issues (product acceptance remaining on `main`) + +| Issue | User-visible gap | Active PR | +| ---: | --- | --- | +| #79 | Milestone 2: port verified direct-PostgreSQL analysis into the protected architecture | #87 / analysis-run registry on `main`; remaining runtime bridge | +| #87 | Milestone 2.1 normalized runtime-analysis schema bridge | related analysis-run work | +| #269 | Authenticated Global Ask MCP browser-safe and admission-bounded | Ask stack | +| #271 | Evidence-honest knowledge-cutoff scope on Global Ask | Ask stack | +| #272 | Verify Global Ask KG/ontology/semantic claims with public SearXNG evidence | Ask stack | +| #274 | Persist and explain Event Lineage channel evidence | #387 | +| #277 | TEPP: persist accepted receipts, poll completed results, keep measurement authority distinct | #468, #417 | +| #280 | Full project-lifecycle history and handover intervals | #284 | +| #284 | Authoritative lifecycle ingestion and idempotent reconciliation | #284 | +| #289 | Activate the optional lineage LLM channel through a bounded asynchronous rebuild | #434 | +| #336 | Replace pseudo-CalDAV feed with a Naruon-owned calendar projection | #355 | +| #338 | Evidence-bounded email/project lineage contract for Naruon consumption | #355 | +| #341 | Heterogeneous ontology and provenance explorer separate from Event Lineage | #349 | +| #358 | Batch reauthorize persisted post-Ask evidence without N+1 queries | Ask stack | +| #359 | Centralize Global Ask session storage access | Ask stack | +| #361 | Preserve server diagnostics behind generic orchestrator 503 responses | #383 | +| #362 | Roll back rejected Global Ask turn atomically instead of poisoning the session | Ask stack | +| #363 | Continue ontology neighborhoods beyond the bounded source window | Ask / ontology | +| #372 | Reconcile lowercase and repository-case public namespace IRIs | #492, #426 Pages | + +## 5. Open product and technical gaps + +| Gap | Current evidence | Acceptance requirement | +| --- | --- | --- | +| Protected release | 52 PRs open; no independent current-head approval; frontend `tsc` broken on `main` until this head (or #426) merges | Terminal exact-head checks, no unresolved threads, independent OpenCode/Strix/Noema approval, protected squash-merge SHA | +| Shared frontend gate | Unauthenticated `AdminPanel` + unused OIDC helpers failed `tsc -b` on `main` | This head or #426 on protected `main`; subsequent PRs rebase and stay green without duplicating the login patch | +| Identifying baseline regression | `main` gap file listed real post identifiers | This non-identifying rewrite on protected `main` (ADR 0001) | +| Authorized-corpus runtime | Repository tests use synthetic fixtures; private records remain outside git | Authenticated runtime validation returning only aggregate, non-identifying evidence | +| Image understanding | Region, OCR, and description work exists across active heads (#405, #419) | Orchestrator-backed rendered workflow, original/derived asset provenance, and honest unsupported states | +| Semantic source rendering | Paragraph, table, list, formula, and indentation work exists across stacks (#394, #427, #448–#450) | Authenticated browser evidence that semantic units render without authoring-layout artifacts | +| Calendar / Naruon | Pseudo-CalDAV remains on `main`; #355 carries the projection contract | Naruon-owned projection, issue #336/#338 acceptance, no invented events | +| SKOS organization aliases | Catalog binding and chip caption live on #480 / #482 | One catalog row per corroborated org; companion caption is hint-only until bound | +| Event Lineage evidence | Channel evidence and Allen relations live on #387 / #484 | Persist channel scores, explain them in the popup, never invent a fused score | +| Scientific measurement | TEPP and fast-mlsirm adapters present or under review | Persisted accepted envelopes, calibration/recovery RMSE, no invented theta | +| Accessibility and responsive UX | Unit coverage exists for major surfaces; Storybook inventory incomplete | Keyboard, screen-reader, mobile, and authenticated Playwright acceptance on the exact release head | +| Design tokens and repeated objects | Token extraction started (`CHANGELOG.d` badge-color tokens); Figma file is empty of product frames | Tokens in CSS + Storybook stories for board, popup, DAG, Ask, calendar, forms, charts | +| External integrations | Search, Zotero, calendar, Keyverse, orchestrator, RankWeave, ThreadWeave, TEPP, disksage, wardnet | Provider conformance, failure/reconciliation behavior, and provenance-bearing integration evidence | +| MSA / modular reuse | LineageWeave must run standalone and as a consumer of org packages | Do not reimplement RankWeave/TEPP/orchestrator/ThreadWeave/Keyverse; fix upstream and PR there | +| Release quality | Local focused/full suites have passed on individual PR heads | Repository-wide coverage, docstrings, Storybook, security, browser, and release evidence on one exact head | +| PII | Masking would paralyze the product; ADR 0001 forbids identifying artifacts in git | ABAC + authorized runtime; synthetic fixtures in git; no mask-in-place that drops names the operator must read | +| Database | PostgreSQL, 3NF, snake_case ≥ two words, hot-partition and lock policy | No file DBs; read/write split if lock management fails; whitelist every migration | + +## 6. UI-UX acceptance inventory (must be defined, reviewed, applied, audited) + +Each item needs a Storybook scene, an edge-case story, and an automated check +before a commercial release claim. Figma File ID `1Su3lDRmiZdcUs47t1QwIX`. + +| Dimension | Current | Gap | +| --- | --- | --- | +| Accessibility | Partial labels/roles on board, popup, login | WCAG 2.2 AA on login, board, popup, Ask, calendar, admin; focus order; live regions | +| Touch & Interaction | Click-first popup and lists | 44px targets, swipe/escape to dismiss popup, no hover-only actions | +| Performance | Board caps and hint render limits exist | Interaction-to-next-paint on board search, DAG, Ask; no N+1 (#358) | +| Style Selection | Korean UI standards merged (#347) | Tokenized light/dark; Anti-Slop-UI density; no decorative noise | +| Layout & Responsive | Desktop popup shell | 402px-class phone layout; stacked GNB; readable DAG | +| Typography & Color | Badge tokens extracted | Contrast on badges, links, error/status; no raw hex in components | +| Animation | Minimal | Reduced-motion; no blocking animation on evidence open | +| Forms & Feedback | Login, Ask, tickets, admin brand | Inline validation, next-action copy, unavailable vs failed distinction | +| Navigation Patterns | Board / customers / calendar / Ask / admin | Deep-link post + OIDC return URL (this head); bookmarkable Ask | +| Charts & Data | Period reports, leftover pairs, Rankings, DAG | Honest empty/unavailable; no invented theta; Storybook chart states | + +## 7. Ecosystem leverage order + +Reuse before rebuild. Consume these ContextualWisdomLab packages in this order +of leverage; open connector PRs there when the defect is upstream: + +1. **contextual-orchestrator** — every LLM/VISION/embedding call (Fugu / Conductor / TRINITY routing). Never a raw provider SDK. +2. **Keyverse** — OIDC issuer, JWKS, tenant principals. +3. **RankWeave** — fused scores and rankings; never invent a fused score or theta. +4. **TEPP** — calibrated measurement; persist receipts; no local reimplementation. +5. **fast-mlsirm** — GRM/GPCM/CAT/FIPC recovery tests (#451–#454) must stay true-parameter RMSE. +6. **ThreadWeave** — tree assembly. +7. **Naruon** — calendar and email/project lineage projection (#336, #338, #355). +8. **disksage / wardnet** — storage and network policy as needed. +9. **ContextualWisdomLab/.github** — required review workflows (OpenCode, Strix, Noema). If stacked PRs miss central review, fix the org workflow, not a local bypass. + +## 8. Evidence boundaries + +- Never add a real record, title, name, identifier, screenshot, log, benchmark + artifact, or documentation example to this repository. +- Attendance or co-occurrence is not responsibility, project, customer, or + affiliation evidence. Preserve uncertainty and provenance. +- Missing transport, model capability, accepted envelope, or persistence is + unavailable or failed evidence, never a placeholder result. +- Local green tests, bot statuses, auto-merge, and warning-only checks do not + prove a protected merge. +- Re-fetch base/head SHAs, checks, review threads, approvals, rulesets, and the + merge SHA immediately before any lifecycle claim. +- Do not self-approve. Independent OpenCode / Strix / Noema review is required. +- Do not force-push. Do not treat GitHub Checks duration as a blocker; repair + the failing check instead. +- `COPILOT_GITHUB_TOKEN` is not used. + +## 9. Next acceptance loop + +1. Land this head (login `tsc` + non-identifying baseline) or #426 so the + shared frontend gate is green on protected `main`. +2. Request independent exact-head review; squash-merge only after that review + and current checks. Enable auto-merge rather than waiting as a blocker. +3. Re-fetch every open head, latest checks, unresolved threads, and independent + reviews before any merge claim. Close superseded docs-only gap PRs after + this file is on `main`. +4. Merge smallest shared-gate repairs next (#429, #428, #393, #436, #439) + when independently approved. +5. Advance user-visible gaps in leverage order: Event Lineage evidence (#387 / + #274), Naruon calendar (#355 / #336), SKOS aliases (#480 / #482), ontology + explorer (#349 / #341), Ask Agent (#415–#422 / #358–#363). +6. Keep psychometric tests as true-parameter recovery (RMSE), never fixture + tautologies. +7. Run frontend lint/test/build/Storybook, backend tests, and authenticated + browser/accessibility checks on the exact candidate release head. +8. Fix only evidence-backed failures and repeat the protected merge gate. + +## 10. Spec pointers (derive, do not fork) + +- Product/architecture: `ARCHITECTURE.md`, `AGENTS.md`, `CLAUDE.md` +- Research grounding: ADR 0084, `docs/lineage-bi-research-notes.md` +- Demo identity: ADR 0001 +- Figma boundary: ADR 0002 (File ID `1Su3lDRmiZdcUs47t1QwIX`) +- Orchestrator / paper-grounded models: ADR 0015, ADR 0076 (Fugu, TRINITY, Conductor) +- Ontology / PROV-O / SKOS: ADR 0004, ADR 0011, issue #372 +- Analysis runs / TEPP: ADR 0013–0023, issue #79 / #277 +- Calendar / Naruon: issues #336 / #338, PR #355 +- Ask Agent: issues #269–#272, #358–#363 + +Citations in doctoring and ADRs use APA 7th. Do not invent a heuristic where +the papers leave the decision undecided. diff --git a/frontend/src/App.test.tsx b/frontend/src/App.test.tsx index 7462abd2c..4b9e13cd6 100644 --- a/frontend/src/App.test.tsx +++ b/frontend/src/App.test.tsx @@ -3,6 +3,7 @@ import userEvent from "@testing-library/user-event"; import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; import App from "./App"; import { setLocale } from "./i18n"; +import { OIDC_RETURN_URL_STORAGE_KEY } from "./oidcReturnUrl"; const signinRedirect = vi.fn(); const signoutRedirect = vi.fn(); @@ -28,11 +29,22 @@ beforeEach(() => { afterEach(() => { vi.unstubAllGlobals(); + try { + window.sessionStorage.removeItem(OIDC_RETURN_URL_STORAGE_KEY); + } catch { + // jsdom storage may be unavailable in some test hosts. + } + try { + window.localStorage.removeItem(OIDC_RETURN_URL_STORAGE_KEY); + } catch { + // jsdom storage may be unavailable in some test hosts. + } }); describe("App, unauthenticated", () => { it("shows a login button that starts the real OIDC redirect", async () => { render(); + expect(screen.queryByRole("heading", { name: /admin settings/i })).toBeNull(); const button = screen.getByRole("button", { name: /log in/i }); await userEvent.click(button); expect(signinRedirect).toHaveBeenCalledTimes(1); @@ -41,6 +53,8 @@ describe("App, unauthenticated", () => { state: expect.objectContaining({ returnUrl: expect.stringMatching(/^\//) }), }), ); + expect(window.sessionStorage.getItem(OIDC_RETURN_URL_STORAGE_KEY)).toMatch(/^\//); + expect(window.localStorage.getItem(OIDC_RETURN_URL_STORAGE_KEY)).toMatch(/^\//); }); }); 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
- {destination === "admin" ? : null}