Skip to content

cp-j0gw.11: interactive M01 cohort-floor demo widget - #2

Open
AJBcoding wants to merge 2 commits into
mainfrom
polecat/obsidian/cp-j0gw.11
Open

cp-j0gw.11: interactive M01 cohort-floor demo widget#2
AJBcoding wants to merge 2 commits into
mainfrom
polecat/obsidian/cp-j0gw.11

Conversation

@AJBcoding

Copy link
Copy Markdown
Owner

Summary

Adds an interactive demo widget for M01 — Cohort visibility cascade. Drag a slider between 16 (AHEAD count_wne_p4 single-window) and 30 (OBBBA statutory floor, NPRM § 668.403(d)(1)) and watch ~12 illustrative programs flip between MEASURED and NOT MEASURED. Demonstrates the cp-wssr AHEAD-published-flag override for the 16 ≤ n < 30 gap.

Files

New

  • web/widgets/cohort-floor-demo.html — standalone page (mobile viewport, public-data badge, top-disclaimer aside, breadcrumb back to index).
  • web/widgets/cohort-floor-demo.js — vanilla ES module. Exports computeVerdict / summarizeAt / detectFlips for unit testing; auto-wires the slider on DOMContentLoaded.
  • web/widgets/cohort-floor-demo.d.ts — TypeScript declarations matching the web/js/*.d.ts pattern.
  • web/widgets/cohort-floor-demo.css — page-specific styling, with inline copies of the public-data-badge and top-disclaimer rules so the page is self-contained on main.
  • tests/ui/cohort-floor-demo.test.ts — 12 unit tests covering the verdict-flip computation and the AHEAD-published-flag override.

Modified

  • web/index.html — adds a third persona-card linking to the demo.

Spec compliance (per cp-j0gw.11)

  • Slider range 16 ↔ 30 (cp-wssr methodology)
  • ~12 illustrative programs, synthetic completer counts, labeled "illustrative" on the page
  • Real-time recompute; counters show measured / AHEAD-override / not-measured at each floor
  • Caption: AHEAD count_wne_p4 is single-window; OBBBA's 30-floor is for the pooled cohort; cp-wssr override honors verdicts in the gap
  • No LLM at request time; no analytics; no external tracking
  • Public data only — synthetic numbers labeled as illustrative
  • Mobile-readable; viewport meta tag; touch + keyboard slider
  • Top-disclaimer aside + public-data badge in header (mirrored from learn.html)
  • Cites M01 + cp-wssr in panel footer
  • vitest unit test for the verdict-flip computation logic

Outstanding

The bead also asked for a link from web/learn.html in the M01 area. learn.html lives only on cp-0on-ext-senate-plain-lang, not on main. The chair should add that link when the senate-plain-lang branch merges; the widget itself is self-contained and accessible from the index persona-card.

Verification

  • npm test209 passed (209) (197 baseline on main + 12 new).
  • npm run typecheck → clean.

Test plan

  • Open web/widgets/cohort-floor-demo.html directly in a browser; confirm slider works on mouse + touch + keyboard arrow keys.
  • Move slider from 30 → 16; verify counts shift, with AHEAD-override pill visible at floor=30 for programs with n in [16, 30).
  • Verify mobile (375px viewport): page reflows, slider remains operable.
  • Verify dark-mode rendering of public-data-badge and top-disclaimer (system preference).

Refs: cp-j0gw.11 · parent epic cp-j0gw

Adds a standalone, mobile-readable widget that lets readers drag a slider
between 16 and 30 and watch which illustrative programs flip between
MEASURED and NOT MEASURED. Demonstrates M01 (cohort-visibility cascade)
without any institutional data.

New files
- web/widgets/cohort-floor-demo.html — standalone page; mirrors the
  top-disclaimer + public-data-badge patterns from web/learn.html on
  cp-0on-ext-senate-plain-lang.
- web/widgets/cohort-floor-demo.js  — vanilla ES module. Exports
  computeVerdict / summarizeAt / detectFlips for unit testing; auto-wires
  the slider on DOMContentLoaded.
- web/widgets/cohort-floor-demo.d.ts — type declarations matching the
  existing web/js/*.d.ts pattern.
- web/widgets/cohort-floor-demo.css  — page-specific styling, including
  inline copies of the public-data-badge + top-disclaimer rules so the
  page stays self-contained on main (where css/learn.css does not yet
  exist).
- tests/ui/cohort-floor-demo.test.ts — 12 unit tests for the verdict-flip
  computation, including the cp-wssr AHEAD-published-flag override.

Modified
- web/index.html — adds a third persona-card linking to the demo.

Spec hooks
- Slider 16↔30 (cp-wssr methodology range).
- 12 illustrative programs, synthetic completer counts, labeled
  "illustrative" on the page.
- Caption cites M01 + cp-wssr + NPRM § 668.403(d)(1) + HEA § 454(c)(4)(A).
- No external requests, no analytics, no LLM at request time.
- Mobile viewport meta tag + touch/keyboard slider.

Tests: 209/209 passing (197 baseline on main + 12 new). typecheck clean.

Note: the bead requested a link from web/learn.html; that file lives only
on cp-0on-ext-senate-plain-lang, not on main. Chair to add the learn.html
link when that branch merges.

Refs: cp-j0gw.11
AJBcoding added a commit that referenced this pull request May 5, 2026
Updates the Status section from "pre-implementation" to:
- v1 (cp-0on epic) shipped 2026-04-30 with 197/197 tests
- v1.1 (cp-j0gw extension) in PR review as of 2026-05-05 with
  pointer to docs/cp-j0gw-ext-changelog.md and the 3 stacked PRs
  (#1 main, #2 widget, #3 systemwide)

Adds new Routes table covering:
  /, /persona-a, /persona-b, /learn/, /sources, /comment-draft,
  /widgets/cohort-floor-demo, /api/v1/...

Each route tagged with its primary audience so a reader can find
the right entry point without spelunking the codebase.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
AJBcoding added a commit that referenced this pull request May 5, 2026
…hair review #2)

Four refinements to the cp-j0gw.8 systemwide-context one-liner per
chair recommendation:

BUGS (build script)
- data/build/build_systemwide_context.py: collapse runs of whitespace
  in cip4_title (source CSVs arrive with double spaces inside titles
  like "English Language and Literature  General"). Renders cleanly
  now: "English Language and Literature General".
- Empty title now stored as "" (not literal "(unknown)"); the UI
  omits the parenthetical entirely when missing rather than
  rendering "CIP 5006 ()".
- Side effect: CIP 5006 now correctly resolves to "Film/Video and
  Photographic Arts" — earlier "(empty)" appearance was an artifact
  of the unified-exposure CSV ordering, not a true gap.

UI REFINEMENTS (web/js/render.js)
- Gate on n_unique_campuses >= 2: when only one CSU campus surfaces
  this CIP, the line "across 1 of 22 campuses" reads as false
  comfort. Suppress the systemwide-context line entirely in that case
  (no "systemwide context" if only the one institution shows it).
- Source line now hyperlinks to /sources.html ("public data sources")
  instead of monospaced corpus path. Drives readers to the central
  provenance page; better UX.
- Title fragment guarded: omit the parenthetical when title is
  empty/whitespace.

Wording approved as-is in chair review:
- "shows N exposure cells" — neutral, ties to senate-packet terminology
- "of 22 CSU campuses" — correct denominator (1 campus has zero
  exposure cells; "of 23" would falsely imply otherwise)
- A/C/D/E breakdown order — matches senate packet exactly

content/systemwide-cip-context.json regenerated from the patched
build script. 212/212 tests pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
AJBcoding added a commit that referenced this pull request May 5, 2026
…hair review #2)

Four refinements to the cp-j0gw.8 systemwide-context one-liner per
chair recommendation:

BUGS (build script)
- data/build/build_systemwide_context.py: collapse runs of whitespace
  in cip4_title (source CSVs arrive with double spaces inside titles
  like "English Language and Literature  General"). Renders cleanly
  now: "English Language and Literature General".
- Empty title now stored as "" (not literal "(unknown)"); the UI
  omits the parenthetical entirely when missing rather than
  rendering "CIP 5006 ()".
- Side effect: CIP 5006 now correctly resolves to "Film/Video and
  Photographic Arts" — earlier "(empty)" appearance was an artifact
  of the unified-exposure CSV ordering, not a true gap.

UI REFINEMENTS (web/js/render.js)
- Gate on n_unique_campuses >= 2: when only one CSU campus surfaces
  this CIP, the line "across 1 of 22 campuses" reads as false
  comfort. Suppress the systemwide-context line entirely in that case
  (no "systemwide context" if only the one institution shows it).
- Source line now hyperlinks to /sources.html ("public data sources")
  instead of monospaced corpus path. Drives readers to the central
  provenance page; better UX.
- Title fragment guarded: omit the parenthetical when title is
  empty/whitespace.

Wording approved as-is in chair review:
- "shows N exposure cells" — neutral, ties to senate-packet terminology
- "of 22 CSU campuses" — correct denominator (1 campus has zero
  exposure cells; "of 23" would falsely imply otherwise)
- A/C/D/E breakdown order — matches senate packet exactly

content/systemwide-cip-context.json regenerated from the patched
build script. 212/212 tests pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
AJBcoding added a commit that referenced this pull request May 5, 2026
Adds three new sections to the changelog reflecting the 2026-05-05
evening polecat-return wave and chair-review track:

1. "Stacked PR record" — table of all 5 PRs (#1-#5) with branches,
   beads, authors, and post-merge test counts. Suggested chair
   merge order: #1 -> #3 -> #2 -> #4 -> #5.

2. Sub-bead ledger refreshed: cp-j0gw.8, .11, .13, .14, .15 all
   marked done with PR pointers; cp-j0gw.16 deferred until preview
   URL is live.

3. "Chair-review track applied" — the 4 reviews iterated inline this
   evening (#1 disclaimers approved, #2 systemwide refined, #3
   groupings applied, #4 prose skipped + bug fix shipped). #5
   comment-outline review not yet run.

4. "Smoke-stack record" — verifies all 5 PRs merge cleanly in order
   with one trivial conflict (web/index.html persona-card stack).
   Final stacked test count: 249/249. Production lint scan caught
   3 dean-facing literal violations (OPEID6 + cascade) in PR #1's
   surfaces; fixed in commit 0993045. PR #2 (obsidian widget) has
   one analogous "cascade" literal in link text — surfaced as
   follow-up note.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@AJBcoding

Copy link
Copy Markdown
Owner Author

Lint follow-up note (no merge block)

While smoke-stacking PRs #1#5 in a temp worktree, the broader-scope lint (npx tsx scripts/lint-glossary.ts content web — wider than the regression test, which only scans content/mdocs/) caught one forbidden-literal violation in this PR:

web/widgets/cohort-floor-demo.html:95
  term:    "cascade"
  reason:  design.v6 §13 — dean-facing UI must not contain this literal.
  context: …<a class="m01-link" href="../learn.html">M01 — Cohort visibility cascade</a> for the full mechanism…

The glossary forbids the literal "cascade" in dean-facing prose; the M-doc identifier M01-cohort-visibility-cascade is internal-only. Suggested fix is a 1-line edit in the link text — e.g. "M01 — Cohort visibility expansion" or "M01 — The cohort-expansion rule" (matches the existing M01 panel header in web/learn.html).

This does not block merge — the regression test (scripts/lint-glossary.test.ts) only scans content/mdocs/, so the violation does not fail CI. But it ships in production HTML, so worth a 1-line follow-up commit.

PR #1 had three analogous violations (OPEID6 + cascade) on its own surfaces; fixed in commit 0993045 on cp-0on-ext-senate-plain-lang. Same fix pattern works here.

Stacking record (all 5 PRs merged in order on a temp branch):

Step Branch added Tests passing
1 cp-0on-ext-senate-plain-lang (PR #1) 203
2 cp-j0gw-8-systemwide-context (PR #3) 212
3 polecat/obsidian/cp-j0gw.11 (PR #2) 212
4 cp-j0gw.14-r19-suppressed-earnings-annotation (PR #4) 228
5 cp-j0gw.15-plain-lang-explainers (PR #5) 249

Full record in docs/cp-j0gw-ext-changelog.md on PR #1.

🤖 Posted by Claude Code on behalf of crew/anthonybyrnes.

design.v6 §13 forbids the literal "cascade" in dean-facing UI surfaces.
Two surfaces in the cp-j0gw.11 widget commit tripped the linter:

- web/widgets/cohort-floor-demo.html footer link text
  "M01 — Cohort visibility cascade" → "M01 — The cohort-expansion rule"
  (matches the existing M01 panel header in web/learn.html on
  cp-0on-ext-senate-plain-lang).
- web/index.html persona-card body
  "the cohort-visibility cascade" → "the cohort-expansion rule"
  (same substitute).

Verification:
- npx tsx scripts/lint-glossary.ts content web → no violations
- npm test → 209/209 passing on this branch
AJBcoding added a commit that referenced this pull request May 5, 2026
Stacked PR record updated:
- 6 PRs now open (added PR #6, quartz batch-2 explainers M04/M07/M14)
- PR #2 carries obsidian's cp-j0gw.17 lint fix (commit 38e236c)
- Final stacked test count: 270/270
- Suggested chair merge order: #1 -> #3 -> #2 -> #4 -> #5 -> #6
- Broader lint scan: 0 OPEID6/cascade violations remaining; only
  formal cite names (STATS NPRM, RIA Table 3.19) kept per M-doc
  convention.

Sub-bead ledger: cp-j0gw.17 + cp-j0gw.18 marked done with PR pointers.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant