Skip to content

Conversation

erikhfj
Copy link
Member

@erikhfj erikhfj commented Nov 25, 2026 •

Summary

Final pre-submission documentation sync, AI usage reflection, refreshed Lighthouse & accessibility verification log, technical doc discrepancy fixes, and recaptured UI screenshots for the 27 November delivery. Stacked on perf/133-hero-lcp-and-apache-headers (#141).

Merge order

  1. fix: #129 harden GraphQL API & PostgreSQL pool, fix review/cursor bugs, and deduplicate server helpers #136 (#129 API & PostgreSQL hardening) — already merged on main
  2. chore: #134 run Playwright E2E in CI, expand tests, and harden CI/CD deploy #137 (#134 Playwright E2E CI & test hardening) and feat: #130 support accent-insensitive album and artist search via PostgreSQL unaccent #139 (#130 accent-insensitive search) — independent on main (merge chore: #134 run Playwright E2E in CI, expand tests, and harden CI/CD deploy #137 before docs: #135 final documentation sync, AI reflection, Lighthouse/a11y log, and screenshots #142 if you want crate.spec.ts and the Playwright CI job on main first; references are tagged (#134, PR #137) in the meantime)
  3. Track B stack in exact order: feat: #131 client-side SPA routing, review Apollo cache updates, and storage resilience #138 (#131) → feat: #132 a11y/theme/UX polish, #133 hero LCP & Apache headers, and #135 final docs/screenshots #140 (#132) → perf: #133 optimize hero image/mobile LCP and configure Apache headers #141 (#133) → docs: #135 final documentation sync, AI reflection, Lighthouse/a11y log, and screenshots #142 (#135)

What was done

  • AI usage reflection, model versions, prompt examples & log fixes (docs/AI-USAGE.md, README.md):
    • Added Tools and model versions (documenting Antigravity (Gemini 4 Neon (High)), Claude Opus 5.5 (1M context) from commit 07673c8, and honestly noting unpinned CLI/web tool defaults).
    • Added 2 concrete prompt-to-revision examples (#18 dark-mode border contrast & #77 myCrate microsecond cursor precision; #129–#135 swarm audit & verification catching #132's CSP-safe theme-init.js and #134's git.ntnu.no-mirrored Action SHAs 08eba0b / b906aff / 49933ea).
    • Added Reflection: benefits, risks and limits (learning trade-offs, subtle bugs passing green CI, privacy/third-party data sharing, licensing/attribution beyond MusicBrainz).
    • Fixed log defects: line 28 ("Two rows near the top"), line 87 extra empty column, line 113 Figma design typo, added missing #74 (PR feat: #74 add composite cursor indexes #89, 2026-11-15) row, and added rows for #129–#135.
    • Kept README.md's ## AI usage section to a single line linking to docs/AI-USAGE.md.
  • Refreshed Lighthouse 13.6.0, bundle sizes & accessibility/zoom verification (docs/lighthouse-results.md, README.md, docs/architecture.md):
    • Re-ran real Lighthouse 13.6.0 against a local production preview (vite preview) + built API + PostgreSQL 18 imported with the 2,000-album MusicBrainz catalog across Discover, Album detail (/project2/album/13, Hounds of Love), and Your crate (Desktop & Mobile, Light & Dark), with an explicit comparability note vs. the 11 November 13.5.0 / /album/100030 baseline (including the Album detail desktop shift 92 → 87–88).
    • Synced exact 26 November pnpm build asset sizes (JS chunks, theme-init.js, CSS, index.html, favicon.svg, hero WebP 39.16 kB / 13.39 kB, WOFF2 fonts; max JS chunk 395,383 B <= 512,000 B) across README.md and docs/lighthouse-results.md, and linked docs/lighthouse-results.md from the README top table.
    • Logged real-browser @axe-core/playwright WCAG 2.1 A/AA checks (0 violations across 10 light/dark interactive states) and 200%/400% zoom (320 px viewport) reflow checks (0 px horizontal overflow across all 10 checks), plus honest remaining manual pre-handin items (including in-app route-change focus/announcement).
    • Updated docs/architecture.md, docs/ui-specification.md, and README.md for #131/#138 History API SPA routing + route-change <main> focus + RouteErrorBoundary stale-chunk recovery, #132 CSP-safe manual theme toggle, #129 (merged in PR fix: #129 harden GraphQL API & PostgreSQL pool, fix review/cursor bugs, and deduplicate server helpers #136) API/DB hardening, #133 Apache headers cross-reference (worded as configured, pending VM apply/DevTools check), OLED & Georgia system-serif tradeoffs, Cover Art Archive IP privacy tradeoff, and plain-HTTP course-VM transport tradeoff.
  • Fixed all 10 technical documentation discrepancies across docs/data-model.md, docs/scalability.md, docs/VM-setup.md, docs/ui-specification.md, README.md, docs/WORKFLOW.md, and AGENTS.md.
  • Recaptured all 9 UI screenshots (docs/images/*.png) against the built preview + 2,000-album MusicBrainz catalog.

Verification

  • pnpm format:check && pnpm lint && pnpm typecheck && pnpm test && pnpm build — all passed
  • git diff --check and local Markdown link check — clean
  • Lighthouse 13.6.0 (12 local production-preview runs across Discover, Album detail, Your crate — desktop & mobile, light & dark)
  • Playwright @axe-core/playwright WCAG 2.1 A/AA (10 states, 0 violations) & 200%/400% zoom / 320 px reflow checks (10 checks, 0 px overflow)
  • MusicBrainz GraphQL smoke queries verified live against local PostgreSQL 18 + 2,000-album catalog
  • Checked by a separate verifier agent

Remaining manual pre-handin checks (before 27 Nov)

  • Native screen-reader walkthrough (VoiceOver / NVDA), including focus and announcement after an in-app route change
  • Live VM deployment & smoke pass on http://it2810-19.idi.ntnu.no/project2 after merging PRs #136–#142 and applying Apache configs (docs/VM-setup.md, checking CSP in DevTools on Discover and an album page)
  • All 4 team members confirm Blackboard timesheets/descriptions and FeedbackFruits submission

Closes #135

@erikhfj erikhfj requested a review from a team as a code owner November 25, 2026 23:52
Copy link
Member

@evenkkl evenkkl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this is a big cleanup and most of it checks out. Every asset size matches the files in the repo (hero WebP 39,164 / 13,394 B, all four WOFF2 files, theme-init.js 298 B), the first-load sum of 452,615 B adds up, HOST defaults to 127.0.0.1 in server/src/index.ts, and the new screenshots show the 2,000-album catalog. I only looked at what this PR changes on top of #141.

Request changes

  1. Docs describe code that isn't in this stack yet. #142 is stacked on #141 → #140 → #138 → main. #136 and #137 are not in that chain, and both are still open:

    • docs/architecture.md §7 says the API "enforces request body size, GraphQL query depth/complexity, input length/array caps, and rate limiting … disables GraphQL introspection when NODE_ENV=production". None of that exists on this branch (no security.ts or app.ts, and nothing reads NODE_ENV). All of it comes from #136.
    • The README says CI runs "Playwright E2E" and lists crate.spec.ts. Both come from #137. On this branch ci.yml has no Playwright job and e2e/tests/ has no crate.spec.ts.

    Either merge #136 and #137 before this PR, or tag those lines with "(#129, PR #136)" and "(#134, PR #137)". Please also say the merge order in the description, so that this doesn't merge first by accident.

  2. The Apache headers and CSP are described as live. The README says Apache "applies gzip compression, immutable asset caching, and baseline HTTP security headers" and that the API runs "with NODE_ENV=production". Architecture §7 says "Production deployment enables … Content-Security-Policy". But your own pre-handin checklist says the Apache configs still need to be applied on it2810-19. The Lighthouse runs used vite preview, so the CSP has never been loaded in a browser. Please write "is configured to (see docs/VM-setup.md)", or check the live headers after deploying and keep the wording then. A quick check with DevTools open on Discover and an album page would confirm the CSP doesn't block anything.

  3. The #55 example in the AI reflection is wrong.

    • buildPrefixTsQuery doesn't exist. Prefix search is the tsQuery() helper in server/src/search/search.ts, and it builds the query in SQL (tsvector_to_array + :*), not in TypeScript.
    • The to_tsquery suggestion came from two co-students' peer reviews, not from an AI tool. The 2026-10-20 row in the same log says so.

    Since this example is meant to show AI output being corrected, please fix both points or swap in another example. The #18 half is accurate (#556055 2.5:1 → #6b766b 3.4:1 → #687d6e in #70).

  4. The #134 example cites the wrong SHA. "pinned to the commit SHAs actually mirrored on NTNU's Gitea/Actions host (9198784)": 9198784 is the head commit of PR #137, not an Action SHA. Please either drop it or cite the actual pinned SHA.

Should fix

  1. Route-change focus and the stale-chunk error boundary are still missing. Neither is fixed on this stack (App.tsx has no focus handling and no error boundary around the lazy routes). The new routing text in architecture.md and ui-specification.md doesn't claim either one, which is good. But unless #138 fixes them before hand-in, please add them as known limitations, and add "focus and announcement after an in-app route change" to the manual screen-reader checklist.

  2. The Lighthouse comparison isn't like-for-like.

    • The baseline used Lighthouse 13.5.0 and /album/100030. The new run uses 13.6.0 and /album/13.
    • Album detail desktop went from 92 to 87/88 (LCP 1.8 s → 2.3–2.5 s), and the doc doesn't mention it.
    • "82 → 98 from #133" leaves out everything else that merged between 11 and 25 Nov.

    Please say the runs aren't directly comparable, mention the Album detail drop, and write "mainly from #133". The numbers themselves look plausible. They fit Lighthouse's scoring curves (for example, Album detail mobile LCP 4.8–5.3 s → 81–83), and the 12 rows match the description.

  3. The README ## AI usage section. Our rule is that AI use is logged only in docs/AI-USAGE.md. I'd cut the README section down to one line that links to the log, without the tool list.

Non-blocking

  • Best Practices 96 is caused by /favicon.ico returning 404. Adding a favicon (an rel="icon" link in index.html) would likely make it 100.
  • Your crate mobile CLS is 0.087, close to the 0.1 limit. That's fine, but worth a look if there's time.
  • 19 files is over WORKFLOW's "a dozen files" guideline. Having the screenshots in their own commit makes it easy to review, so I'm fine with it.
  • The PR description lists "Independent review & approval by @verifier". WORKFLOW only counts approvals from the group, and AI-USAGE says AI tools did not approve PRs. Please reword it to something like "checked by a separate verifier agent" so it doesn't read as an approval.
  • I didn't verify the catalog counts (blue 66, Rock 229) against a database. Run the smoke queries once on the VM after the import.

@erikhfj erikhfj force-pushed the perf/133-hero-lcp-and-apache-headers branch from 03da34a to 629879b Compare November 26, 2026 19:40
@erikhfj erikhfj force-pushed the docs/135-final-docs-ai-log-and-delivery branch from a1266fb to ea155ef Compare November 26, 2026 19:44
@erikhfj
Copy link
Member Author

erikhfj commented Nov 26, 2026

Thanks for the super thorough review, @evenkkl! Rebased onto the updated #138 → #140 → #141 stack and addressed every requested change, should-fix, and non-blocking note in ea155ef:

  1. Cross-PR references & merge order: Tagged Playwright E2E CI / crate.spec.ts mentions in README.md with (#134, PR #137), tagged API/PostgreSQL hardening in docs/architecture.md §7 with (#129 — merged in PR #136), and updated PR docs: #135 final documentation sync, AI reflection, Lighthouse/a11y log, and screenshots #142's description with the explicit merge order and reworded "Checked by a separate verifier agent".
  2. Apache headers/CSP & NODE_ENV=production wording: Reworded README.md and docs/architecture.md to say production deployment is configured to apply Apache compression/caching/security headers and NODE_ENV=production (see docs/VM-setup.md, pending apply + browser DevTools CSP check on it2810-19).
  3. AI reflection Example 1 (docs/AI-USAGE.md): Replaced the inaccurate #55 half (both in the summary bullet and Example 1) with #77's myCrate microsecond cursor-precision fix caught during peer review (reproducing 2-of-5 skipped items inside one millisecond, switching to to_char + calendar-date validation + row-value comparison), keeping the verified #18 dark-mode border contrast example.
  4. AI reflection Example 2 (docs/AI-USAGE.md): Replaced 9198784 with the actual git.ntnu.no-mirrored Action SHAs from PR chore: #134 run Playwright E2E in CI, expand tests, and harden CI/CD deploy #137 (actions/checkout@08eba0b v4.3.0, pnpm/action-setup@b906aff v4.3.0, actions/setup-node@49933ea v4.4.0).
  5. Route-change focus & stale-chunk error boundary: Documented the new <main id="main"> focus handling and RouteErrorBoundary (landed in feat: #131 client-side SPA routing, review Apollo cache updates, and storage resilience #138) in docs/architecture.md and docs/ui-specification.md, and added "focus and announcement after an in-app route change" to the manual screen-reader checklist in docs/lighthouse-results.md.
  6. Lighthouse comparability (docs/lighthouse-results.md & README.md): Explicitly stated the 11 Nov (13.5.0, /album/100030) and 25 Nov (13.6.0, /album/13) runs are not strictly like-for-like, explicitly called out the Album detail desktop shift (92 → 87–88, LCP 1.8 s → 2.3–2.5 s), and changed attribution to "mainly from Optimize hero image/mobile LCP and configure Apache compression, caching, and security headers #133".
  7. README.md ## AI usage section: Trimmed down to a single line linking to docs/AI-USAGE.md without the tool list.
  8. Build sizes & favicon: Re-synced exact 26 Nov pnpm build sizes (including favicon.svg added in perf: #133 optimize hero image/mobile LCP and configure Apache headers #141, max JS chunk 395,383 B, first-page JS 455,305 B / 455.31 kB raw, 136.56 kB gzip) across README.md and docs/lighthouse-results.md.

Verified locally with pnpm format:check && pnpm lint && pnpm typecheck && pnpm test && pnpm build, git diff --check, and a local Markdown link check.

Copy link
Member

@evenkkl evenkkl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, all of it is addressed. I checked each fix against the code:

  • Unmerged work: #136 is now merged on main, so the "(merged in PR #136)" tag is accurate. The Playwright CI and crate.spec.ts lines are tagged #137, and the merge order in the description is clear.
  • Apache/CSP/NODE_ENV: now "configured to", with "not live until applied" and the DevTools check on the checklist. 👍
  • #77 example: matches the history. d727a9a replaced the JS Date cursor with to_char text plus calendar validation, and 8b733e8 replaced the or(...) with the row comparison. The 2-of-5 repro matches the log row.
  • Action SHAs: 08eba0b / b906aff / 49933ea are exactly what #137's ci.yml pins.
  • Focus and stale chunks: App.tsx now focuses <main> with preventScroll after route changes (and after Suspense resolves), and RouteErrorBoundary reloads once with a sessionStorage guard. The docs describe that accurately, and the SR checklist has the route-change item.
  • Lighthouse: the comparability note and the Album detail drop are in, and the new sizes add up (455,305 B first-load JS). favicon.svg is 305 B and linked in index.html.
  • README: the AI section is now a single link.

Nit (optional): In the #77 example, the EXPLAIN finding about the OR predicate was erikhfj's own (the 2026-11-05 row says "The row-comparison rewrite was mine"), not part of evenkkl's review. Splitting that sentence would keep it exact.

No AI attribution outside docs/AI-USAGE.md, and the new commit has no trailer. Approving.

@erikhfj erikhfj merged commit 9326b6d into perf/133-hero-lcp-and-apache-headers Nov 26, 2026
3 checks passed
Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants