feat: tag topics and lessons to CCSS focus standards; load grades 7-8 - #40
Merged
Conversation
The repo had no test infrastructure at all: rails/test_unit/railtie was commented out and test/test_helper.rb didn't exist, even though CLAUDE.md documents `bin/rails test` as the dev workflow. Enable the railtie, add the standard test_helper, and pin the .ruby-version via mise.toml so `mise use ruby@3.4.4` works out of the box. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011EqZeVdG5q6KDS1Q8sbcxu
Extend fetch_ccss_standards.rb to pull grades 4-8 (was 4-6) from the same SirFizX/standards-data source, regenerate the committed JSON as data/ccss-math-grades-4-8.json (180 standards total, up from 110), and point ccss:import at the new file. This unblocks focus-standard tagging for grade 7-8 lesson HTML, whose CCSS codes previously had no matching Standard row. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011EqZeVdG5q6KDS1Q8sbcxu
Add Engageny::FocusStandardTagger, which parses the ny-list-focusstandards markup EngageNY topic overviews carry (the same Aspose list-style class convention as ny-h1 headings, per Engageny::Importer) into CCSS codes, normalizes them to the dotted form standards.code uses (stripping any embedded cluster letter — our imported Standard rows never carry one), and creates polymorphic StandardTagging rows. Focus Standards are listed once per Topic overview in the source curriculum, not per Lesson, so the Topic is the taggable and every Lesson beneath it inherits the union of its Topic's standards. Tagging is idempotent (existing rows are never recreated), and codes with no matching Standard row (grade 7-8 codes not yet imported, cluster-only references like 5.NBT.A) are reported rather than dropped. Add standards:tag_focus, a rake task that runs the tagger over every Topic with overview HTML and prints topic/lesson tagging counts plus an unresolved-code frequency report (also written to tmp/standards_tag_focus_unresolved.txt). The real EngageNY topic-overview HTML lives only in the production database (data/engageny/grade-*-html/ is gitignored and empty in this checkout), so tests build fixtures under test/fixtures/files/ that mirror the ny-list-focusstandards markup as described in the importer. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011EqZeVdG5q6KDS1Q8sbcxu
jcasimir
force-pushed
the
feat/focus-standard-tagging
branch
from
September 13, 2026 21:27
7a8b3c5 to
eac57ab
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
This is prerequisite one of Unit 10 in the Interstandard standards-translator plan (CommonMath's lessons need CCSS tags before they can be retargeted to state codes). It closes the "Standards parsing (quick win)" todo in
plans/todos.md.Engageny::FocusStandardTagger(lib/engageny/focus_standard_tagger.rb) parses theny-list-focusstandardsmarkup out of a Topic'soverview_html— EngageNY lists Focus Standards once per topic overview, not per lesson, using the same Aspose list-style class convention asny-h1headings (seeEngageny::Importer#extract_topic_title). Codes are normalized to the dotted formstandards.codeuses (an embedded cluster letter like theAin5.NBT.A.1is stripped, since our importedStandardrows never carry one — confirmed against the existing grade 4-6 data). It creates polymorphicStandardTaggingrows on theTopicand, with the same set of standards, on everyLessonbeneath it (union of the topic's tags). It's idempotent: existing taggings are left alone.Standardrow (grade 7-8 codes that weren't imported yet, or bare cluster references like5.NBT.Athat were never imported at all) are reported, not silently dropped.lib/tasks/standards.rakeaddsstandards:tag_focus, which runs the tagger over every Topic with overview HTML and prints topic/lesson tagging counts plus an unresolved-code frequency report (also written totmp/standards_tag_focus_unresolved.txt).scripts/fetch_ccss_standards.rbnow pulls CCSS grades 4-8 (was 4-6) from the same SirFizX/standards-data source. Regenerateddata/ccss-math-grades-4-8.json(180 standards, up from 110) and pointedccss:importat it. This is what makes grade 7-8 focus-standard codes resolve once topics for those grades are imported.rails/test_unit/railtie(it was commented out) and addedtest/test_helper.rb— the repo had no test infrastructure at all despitebin/rails testbeing documented in CLAUDE.md. Pinned.ruby-versionvia amise.toml.Where the focus-standard markup actually lives
The real EngageNY HTML (
data/engageny/grade-*-html/) is gitignored and not present in this checkout — it only exists in the production database and possibly a local dev checkout. So I could not run the tagger against real data or confirm the exact DOM shape (e.g. whetherny-list-focusstandardsdecorates<p>tags per line, asny-h1does for headings, or real<ul>/<li>markup) beyond whatlib/engageny/*.rbimplies. I built the tagger and its tests (test/lib/engageny/focus_standard_tagger_test.rb,test/tasks/standards_tag_focus_test.rb) against hand-made fixtures undertest/fixtures/files/that mirror the class-on-paragraph convention documented in the importer, and used a CSS-class selector (.ny-list-focusstandards) rather than a specific tag so it matches regardless of which element carries the class.Before this ships to lessons that actually have this markup, run
bin/rails standards:tag_focusagainst a copy of the production data and check the printed counts and unresolved list — if the real markup differs from what I assumed (e.g. codes formatted differently, or not text-only), the extraction regex or CSS selector may need a quick follow-up adjustment. I'd treat that as a fast, low-risk fix rather than a blocker on merging this scaffolding.How to run
Grades 7-8 standards import (needed before those topics' codes resolve):
Post-Deploy Monitoring & Validation
bin/rails standards:tag_focusafter deploy and check the printed counts (topics tagged, lessons tagged) and the unresolved-code report.standard_taggingsandstandardsalready existed and are polymorphic/ready for this.Test plan
bin/rails test(new tests only — 10 runs, 41 assertions, 0 failures)bin/rubocopon changed files — no offensesbundle exec brakeman -q— no warnings (repo'sbin/brakeman --ensure-latestfails on version drift unrelated to this change, per known repo issue)standards:tag_focusagainst real production data once available and confirm the markup assumptions above🤖 Generated with Claude Code
https://claude.ai/code/session_011EqZeVdG5q6KDS1Q8sbcxu