Source enlisted AFSC data from the official DAFECD (versioned, as-of lookup)#51
Open
saturnflyer wants to merge 3 commits into
Open
Source enlisted AFSC data from the official DAFECD (versioned, as-of lookup)#51saturnflyer wants to merge 3 commits into
saturnflyer wants to merge 3 commits into
Conversation
Pin the toolchain to Ruby 4.0.5 and add it to the CI matrix alongside 3.3.8 and 3.4.3. Changed: Test against Ruby 4.0.5
Deterministic, offline pipeline that parses the DAFECD PDF into a verified, specialty-keyed index: record splitting, header/shredout parsing, a verification gate, and a governed title de-gluer whose output is checked to differ from the source by whitespace/case only. Requires pdf-reader (a dev dependency); never loaded by the runtime. Source PDFs are git-ignored.
9716f15 to
4580e0b
Compare
Replace the Wikipedia-derived enlisted data with the official DAF Enlisted Classification Directory (31 Oct 2025), extracted verbatim. Concrete skill-level codes now resolve, and lookups are versioned by document release date (defaulting to the latest). Added: Concrete skill-level AFSC code lookup (e.g. 1A172Y) Added: Version-aware lookup via find(code, as_of:) with effective_date Changed: Source enlisted AFSC data from the official DAFECD instead of Wikipedia
4580e0b to
1cea6af
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.
Summary
Moves the gem's enlisted AFSC data from Wikipedia-derived guesses to the authoritative DAFECD (Department of the Air Force Enlisted Classification Directory), and makes it version-aware.
.tool-versions, lockfile bundler, and CI matrix updated; suite green on 4.0.5.1A172Y, skill level7= Craftsman) now resolve. Previously only theX-placeholder form (1A1X2) worked; concrete codes returnednil.1A1X2now includes shredoutY = General, which Wikipedia lacked.find(code, as_of: date)resolves the directory in effect on a date (defaults to latest); every result carrieseffective_date. Releases are additive and independently diffable; only2025-10-31ships, structured to add future DAFECD/DAFOCD releases. Consumers can extend/override via the load path (DEC-004), including adding a whole new release.names shift from sentence-case to the directory's Title Case).Each phase was spec- and code-quality-reviewed; reviews caught (and fixed) a silent specialty-drop bug and a manifest-merge foot-gun. The anti-hallucination verification gate is real — it fails the build if a de-glued title drifts from its source.
Test plan
bundle exec rake(Minitest + StandardRB): 155 runs, 0 failures, cleanfind("1A172Y")→ name "General", specialty_name "Mobility Force Aviator", skill_level_name "Craftsman", effective_date 2025-10-31find("1A172", as_of: "2000-01-01")→ nil (predates the shipped release); invalidas_of→ clearArgumentErrorfind("11MX")(officer) andfind("8A400")(RI) unchangedruby bin/extract_afsc_from_pdf.rb "<DAFECD pdf>"(source PDFs are git-ignored; provenance indocs/plans/)Follow-ups (not in this PR)
lib/gov_codes/{pdf_extractor,claude_processor,yaml_merger}.rb) now replaced by the deterministicDafecd::*pipeline