Skip to content

cp-j0gw: senate-staff + public-commenter audience extension; Mechanism Library + depth toggle + Sources - #1

Open
AJBcoding wants to merge 12 commits into
mainfrom
cp-0on-ext-senate-plain-lang
Open

cp-j0gw: senate-staff + public-commenter audience extension; Mechanism Library + depth toggle + Sources#1
AJBcoding wants to merge 12 commits into
mainfrom
cp-0on-ext-senate-plain-lang

Conversation

@AJBcoding

Copy link
Copy Markdown
Owner

Summary

Successor to closed cp-0on (CSU Deans EP Tool epic). Extends the public web tool for two new audiences (senate staff / legislators, and public commenters) and adds the instructive surface the chair specified mid-flight (Mechanism Library, reading-depth toggle, Public Sources page).

Acceptance gate preserved. CSULB UNITID 110583 reproduces dean memo v10 §1 EXACTLY — Music MM, Art MFA, Theatre BA, Cinematic Arts BA, plus the new English MA fold-in (REV-2 third CSULB direct-fail).

Tests: 197/197 → 203/203 passing.

Deploy posture: This PR pushes the feature branch and waits for chair review. No Cloudflare Pages production deploy is triggered. Merging to main will trigger the Pages production build via the existing .github/workflows/deploy.yml.

What changed

Analytical updates (post-2026-04-30 corpus state)

  • English MA (CIP 23.01, n=29, −4.97%) added as third CSULB direct-fail per REV-2 narrative correction (cp-fiq8.2.2).
  • derivation_basis field on every verdict — explicit "AHEAD-published-flag-override" provenance per cp-wssr ('ppd_published_authoritative' vs 'tool_re_derived').
  • simulation_framing envelope field — every output tagged "FORWARD SIMULATION (PPD:2026); first STATS release 2027-07-01" per cp-dw65.
  • M18 panel — § 668.16(t) five-pass convergence (Loper Bright + MQD + OIRA A-4 §1/§6/§E + State Farm). Auto-triggers when any program at the institution surfaces as FAIL.

New audience surfaces

  • Mechanism Library (/learn/) — standalone instructive page surfacing all 17 panels organized into 4 topic groups, independent of any institutional check.
  • Reading-depth toggle (Brief / Standard / Detail) — localStorage-persisted, CSS-only visibility.
  • Public Sources page (/sources.html) — every primary source the tool reads or cites, with publisher / grain / verification path.
  • Comment outline (DRAFT) generator (/comment-draft.html) — Persona E surface that generates a structured markdown outline a public commenter can edit into a filed comment. Scaffolds + citations + verification recipes; never pre-written legal arguments.

Disclaimers (load-bearing)

Three layers on every page:

  1. Top-disclaimer aside above main content: "Built by educators — not attorneys, not legislative analysts. Forward simulation. Verify against primary sources before any external use."
  2. Envelope expertise_disclaimer in API + integrity-envelope render.
  3. Per-finding verification_recipe — "How to reproduce this number" block: source data file, source grain, source fields, engine reference (e.g. src/verdict.ts:derivePpdVerdict), and a step-by-step procedural list.

Plus: "Public data only · No private or institutional data leaves your browser" badge in every page header.

Bead ledger

Epic: cp-j0gw (P1, parented to closed cp-0on).

Bead Type Status
cp-j0gw.1 analytical (English MA) ✅ done
cp-j0gw.2 engine (derivation_basis) ✅ done
cp-j0gw.3 framing (simulation) ✅ done
cp-j0gw.4 persona D folded into Mechanism Library + Brief depth
cp-j0gw.5 persona E (comment outline) ✅ done
cp-j0gw.6 safety (disclaimers + recipes) ✅ done
cp-j0gw.7 content (M18) ✅ done
cp-j0gw.8 systemwide context ⏸ deferred (build pipeline change)
cp-j0gw.9 Mechanism Library ✅ done
cp-j0gw.10 depth toggle ✅ done
cp-j0gw.11 interactive widget ⏸ deferred (bonus)
cp-j0gw.12 Sources page + badge ✅ done

5-pass Ralph review applied

Per chair direction. Branch was iterated through one full 5-pass cycle:

  1. Analytical accuracy — fixed English MA, AHEAD-flag-override surfacing, simulation framing.
  2. Plain-language clarity — Mechanism Library + Brief depth open the surface for non-experts.
  3. Disclaimers + verification scaffolding — 3-layer disclaimer + per-finding recipes.
  4. Comment-basis extension — outline generator with copy/download.
  5. Integration / regression — 203/203 tests; smoke test confirms all routes resolve and API includes new envelope fields.

Snapshots committed per substantive change rather than per critique pass (cleaner ledger).

See docs/cp-j0gw-ext-changelog.md for the full pass-by-pass record.

Deferred items (post-merge follow-ups)

  • 3-cut systemwide context (cp-j0gw.8) — needs Python build pipeline to ingest the CSU systemwide-exposure CSVs as a static systemwide-cip-context.json bundle. New sub-bead recommended.
  • Interactive widget (cp-j0gw.11) — bonus item for a future iteration.
  • Persona D as a separate page — current Mechanism Library + Brief depth covers the use case; revisit after stakeholder review if a dedicated legislator-facing landing is wanted.

Test plan

  • npm test — 203/203 passing
  • npm run build:pages — dist-pages/ includes all 5 HTML pages, learn.css, learn.js, comment-draft.js
  • npm run dev smoke test — /learn.html, /sources.html, /comment-draft.html, /content/mdocs/M01.html, /content/mdocs/M18.html, /api/v1/analysis/110583 all return 200
  • CSULB acceptance gate intact — Music MM, Art MFA, English MA fail as expected; Theatre BA passes in noise band; Cinematic Arts BA NOT MEASURED
  • Lint-glossary passes against new M18 panel (no forbidden literals)
  • Chair review of plain-language voice on Mechanism Library + Comment Outline before deploy
  • Chair review of disclaimer language ("not attorneys, not legislative analysts" + "Public data only" badge)

🤖 Generated with Claude Code

AJBcoding and others added 7 commits May 5, 2026 00:14
…ULB direct-fail (cp-j0gw.1)

Per REV-2 narrative correction (cp-fiq8.2.2, 2026-05-03), AHEAD's
published per-cell flag override surfaces English MA as the third
CSULB direct-fail beyond Music MM and Art MFA. Fixture data was
already present (rows 1380-1398); test now asserts:

- verdict = FAIL (PPD-published, agrees with tool re-derivation)
- cohort_count = 29
- ep_gap_pct = -0.0497 (inside ±15% R19 noise band)
- R08 (graduate lowest-of-three) fires
- R18 (graduate loan-cap advisory) fires
- R19 (noise band) fires with gap_tool_derived provenance

Source: analyses/csulb-impact-passes/narrative.md REV-2;
senate-distribution-2026-05-04 packet.

11/11 acceptance tests pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…analysts' (cp-j0gw.3 + cp-j0gw.6)

Two new IntegrityEnvelope fields surface as load-bearing context:

1. simulation_framing (cp-j0gw.3, per cp-dw65) — every verdict is a
   FORWARD SIMULATION on AHEAD's PPD:2026 negotiator analytic file,
   not an observation of the implemented rule. First STATS release
   scheduled for 2027-07-01.

2. expertise_disclaimer (cp-j0gw.6) — explicit 'not attorneys, not
   legislative analysts' framing with 'Independently verify all
   numbers and citations against primary sources' instruction.

Surfaced via:
- src/citations.ts: SIMULATION_FRAMING + EXPERTISE_DISCLAIMER constants
- src/types.ts: IntegrityEnvelope.simulation_framing + .expertise_disclaimer
- src/engine.ts: populated in buildIntegrityEnvelope
- src/api/schema.ts: required JSON-schema fields
- web/index.html, persona-a.html, persona-b.html: new top-disclaimer
  aside above main content (yellow callout, dark-mode adapted)
- web/css/main.css: .top-disclaimer styling

Recipe block (per-finding 'How to reproduce' — second half of D6) lands
in a follow-up commit. 200/200 tests pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
….2 + cp-j0gw.6)

Two new fields on every ProgramVerdict:

1. derivation_basis (cp-j0gw.2) — explicit cp-wssr AHEAD-published-flag
   override provenance:
   - 'ppd_published_authoritative': PPD's fail_obbb_cip2_wageb carried
     the verdict (regulatory-authoritative even when count_wne_p4 < 30)
   - 'tool_re_derived': PPD published nothing; tool computed verdict
   - 'not_measured': insufficient inputs

2. verification_recipe (cp-j0gw.6) — per-finding 'How to reproduce
   this number' block: source data file, source grain, source fields,
   engine reference (src/verdict.ts:derivePpdVerdict, etc.), and a
   short procedural step list. Every recipe ends with the 'we are
   not attorneys / not legislative analysts; verify independently'
   reminder.

The recipe is structured so a reader can reproduce the finding WITHOUT
this tool — using the AHEAD codebook + the obbba_rollup engine spec
(per CIPcodes reproducibility rule: every claim cited or scripted).

Wired through:
- src/types.ts: DerivationBasis + VerificationRecipe types
- src/engine.ts: deriveDerivationBasis() + buildVerificationRecipe()
  for both measured and B16-invisible paths
- src/api/schema.ts: required JSON-schema fields
- web/js/render.js: collapsible recipe block in verdict card; envelope
  surfaces simulation_framing + expertise_disclaimer
- web/css/main.css: .verification-recipe + .derivation-basis styling

5 new acceptance tests covering: every measured CSULB verdict has
ppd_published_authoritative basis, Music MM recipe maps to PPD field
list and engine module, Cinematic Arts BA invisible-program recipe
references IPEDS cross-check.

203/203 tests pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…nce (cp-j0gw.7)

New auto-triggered M-doc surfaces the load-bearing senate-packet
finding: the proposed § 668.16(t) institution-level escalation
design must answer FIVE independent legal frames, each
independently sufficient:

  1. Statutory authority (Loper Bright + major-questions canon)
  2. Problem statement (OIRA Circular A-4 § 1)
  3. Alternatives review (OIRA Circular A-4 § 6)
  4. Uncertainty analysis (OIRA Circular A-4 § E)
  5. Reasoned decisionmaking (Motor Vehicle Mfrs. v. State Farm)

Auto-fires when any program at the institution surfaces as FAIL
(that is the trigger condition the § 668.16(t) machinery escalates
from). For CSULB this fires for Music MM, Art MFA, English MA.

Source: analyses/phase-2-nprm-audit/REPORT.md § 2; senate-distribution
2026-05-04 packet § 2 ("Five-pass convergence on § 668.16(t)").

Wired through:
- content/mdocs/M18.html — 5-section panel using glossary-clean voice
  ('institution-level escalation pathway' substitutes for forbidden
  literal 'cascade' per design.v6 §13)
- content/citations.json — M18#FIVE-PASS-CONVERGENCE anchor
- src/citations.ts — M_DOCS.M18
- src/panels.ts — auto-trigger when any FAIL verdict; per-program
  attribution adds M18 to FAIL drilldowns
- src/api/contract.ts — PANEL_IDS (now 17) + AUTO_TRIGGERED_PANELS (9)
- 4 test sites updated for new panel count

Includes per-panel disclaimer footer: 'Written by educators, not
attorneys or legislative analysts. Verify every statutory citation,
case citation, and OIRA-Circular reference against primary source.'

203/203 tests pass. Lint-glossary clean.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… (cp-j0gw.9 + .10 + .12)

Three additions per chair direction (this-evening message): the site
must teach the rule independently of running a check, must let
readers control depth, and must make the public-data provenance
visible everywhere.

cp-j0gw.9 — Mechanism Library (web/learn.html + web/js/learn.js):
  • Standalone /learn/ page surfaces every M-doc panel as instructive
    content, organized into 4 topic groups:
      1. How the rule works (M01, M03, M04, M07)
      2. What happens when a program fails (M05, M06, M18, M07)
      3. Data quality and verdict edges (M12, M13, M14)
      4. Reading and learning more (M02, M08, M09, M10, M11, M15, M17)
  • Loads each panel HTML inline via fetch.
  • Independent of any institutional check — pure learning surface.

cp-j0gw.10 — Reading-depth toggle (Brief / Standard / Detail):
  • Brief = .mdoc-summary only (1-paragraph TLDR per panel).
  • Standard = + .mdoc-mechanism (how-it-works walk).
  • Detail = + .mdoc-citations + .mdoc-footer (full citations +
    per-panel disclaimer).
  • Persisted to localStorage; defaults to Standard.
  • CSS-only visibility (body[data-depth=...] selectors over
    .mdoc-summary / .mdoc-mechanism / .mdoc-citations / .mdoc-footer).
  • No M-doc HTML changes required — uses the existing structure.

cp-j0gw.12 — Public Sources page + badge:
  • web/sources.html — full inventory of every primary source the
    tool reads or cites (PPD:2026 file 112908, IPEDS C-survey,
    OBBBA Public Law 119-21, NPRM FR 2026-07666, OIRA Circular A-4,
    Loper Bright, State Farm, plus the tool's own MIT-licensed repo).
  • Each source: publisher, grain, what the tool reads from it,
    verification path, primary-source URL where applicable.
  • Green 'Public data only · No private or institutional data leaves
    your browser' badge in every page header (index, persona-a,
    persona-b, learn, sources).
  • Header nav links Mechanism Library + Sources from every page.

Build script unchanged (recursively copies web/) — new pages flow
through automatically. dist-pages/ verified to include all 5 HTML
pages, learn.css, learn.js.

203/203 tests pass.

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

New /comment-draft.html page generates a structured outline a public
commenter can edit into a filed comment. CRITICAL: scaffolds only —
the tool does NOT write substantive arguments; the reader supplies
those.

Outline structure:
  1. Header (institution + date + reader-notice disclaimer)
  2. Findings (failing / noise-band / not-measured programs)
  3. Mechanism context (citations to relevant M-doc panels)
  4. Suggested topics for substantive comment (scaffolds with
     [bracketed prompts] for the reader to fill in)
  5. Verification recipes (per-failing-program 'how to reproduce
     this number' from the engine output)
  6. References (primary sources cited above)

Outline is generated from the existing /api/v1/analysis/{unitid}
endpoint — no new server logic. Uses the verification_recipe field
landed in cp-j0gw.6.

UI affordances: 'Copy as Markdown' button (clipboard API),
'Download .md' button (Blob + download attr).

Disclaimers stated three times in the output: top reader-notice
(forward simulation, not legal advice), per-section guidance
(scaffolds not arguments), and end-of-document (verify every
citation; not a filed position of any institution).

Landing page (web/index.html) extended with two new persona-cards:
'Read about the rule before checking anything' (links Mechanism
Library) and 'Build a public comment outline' (links this page).
Header nav adds 'Comment outline (DRAFT)' entry.

203/203 tests pass. dist-pages build verified.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Pass 5 (regression) caught one issue from the smoke test: learn.js
used '././../content/mdocs/...' which would 404 in the dist-pages
build (where content/ is alongside web/ outputs at root, not one
level up). Fixed to './content/mdocs/...' which resolves correctly
in both dev-server (which serves /content/* from <repo>/content/*)
and production.

Also adds docs/cp-j0gw-ext-changelog.md — full sub-bead ledger,
5-pass Ralph review summary, deferred items, and acceptance-gate
verification record.

Smoke test confirms (npm run dev, port 8787):
  ✓ /learn.html, /sources.html, /comment-draft.html: 200
  ✓ /content/mdocs/M01.html, /content/mdocs/M18.html: 200
  ✓ /api/v1/analysis/110583: returns 194 programs with
    derivation_basis + verification_recipe; envelope carries
    simulation_framing + expertise_disclaimer; auto-panels =
    [M01, M03, M04, M05, M07, M12, M13, M14, M18].

203/203 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
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 and others added 3 commits May 5, 2026 04:42
Two bugs + a re-bucket:

BUGS
- M07 was listed in two groups (1 + 2). Removed from group 1.
- M07's label in group 1 said "Who's in the test" — wrong; M07 is
  about disclosures. Fixed by removing it from group 1.
- M02 (earnings numerator) was stranded in "Reading and learning
  more" but is a foundational mechanic. Moved to group 1.

REBUCKET (still 4 groups for visual scannability)
1. How the rule works:                     M01, M02, M03, M04
2. What happens when a program fails:      M05, M06, M07, M08, M18
3. Edge cases, timing, and who's hit hardest: M12, M13, M14
4. Process, appeals, and authority:        M09, M10, M11, M15, M17

Group 3 was renamed (was "Data quality and verdict edges") to better
describe its actual contents — M13 (calendar dates) is timing not
data-quality, and M14 (named populations) is impact not data-quality.
M12 (NOT MEASURED) is the data-quality core; M13 + M14 are the
adjacent edge cases that complete the bucket.

Group 4 was renamed (was "Reading and learning more" — a grab bag)
to "Process, appeals, and authority" — three sub-themes that share a
post-verdict / institutional-procedure orientation. M02 and M08 were
extracted (M02 to group 1, M08 to group 2 with the other graduate-
loan consequence material).

No M-doc HTML changes; no engine changes. Pure web/learn.html edit.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…tion pathway' fragments

Glossary-substitution artifact. The earlier cp-j0gw.7 lint pass ran
'cascade' -> 'institution-level escalation pathway' globally, but the
panel's original text already had 'institution-level cascade' in five
places. The substitution doubled the prefix:

  'institution-level cascade' -> 'institution-level institution-level
                                   escalation pathway'

Visible to any reader of M18 in /learn/. Pure text bug — no semantic
or structural change to the panel. Glossary lint already clean. 203/203
tests pass.

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

Glossary lint scan with --content-and-web scope (broader than the
regression test, which only lints content/mdocs/) caught three
violations on the cp-j0gw extension surface:

1. src/engine.ts:69,85,414,422 — verification_recipe used 'OPEID6'
   in source_grain and step text. Replaced with 'institution
   identifier' (the v6 §17 glossary substitute) and 'your
   institution' in step prose.

2. web/sources.html:44,46 — Grain field and Verify step on the AHEAD
   PPD source-card used 'OPEID6'. Replaced with 'institution'.

3. web/js/comment-draft.js:122 — comment-outline scaffold prose
   used 'institution-level cascade design'. Replaced with
   'institution-level escalation design'.

Formal NPRM/RIA cite names (e.g. 'STATS NPRM — Federal Register
2026-07666') retained because they are primary-source titles, not
prose; the existing M-doc panels follow the same convention.

203/203 tests pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@AJBcoding
AJBcoding force-pushed the cp-0on-ext-senate-plain-lang branch from 773321c to 0993045 Compare May 5, 2026 12:09
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>
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