Goal
Close the loop from audit to fix: when a data update lands on dev and the coverage manifests change, automatically file well-scoped issues for the newly-unsupported items so the existing ai-fix pipeline can work through them. This turns "new patch merged" into "triaged work queue" with zero manual effort.
Depends on: #67 (mod-coverage manifest) and ideally #68 (skill-stat manifest). Do not start until #67 is merged.
Background (read first)
What to build
A workflow .github/workflows/audit-triage.yml:
Trigger: push to dev, with a paths filter on audit/*.txt.
Steps:
- Check out with enough history to diff (
fetch-depth: 2 is sufficient for the pushed range; use git diff HEAD^ HEAD -- audit/ — handle the first-commit edge case by skipping).
- Parse the diff with a small script (Python is fine for workflow tooling; keep it in
tools/triage_audit_diff.py):
- Added
unsupported/partial lines in audit/mod-coverage.txt → new unsupported mod forms.
- Added lines in
audit/skill-stat-coverage.txt → new unmapped stat IDs.
- Removed lines are good news — ignore them (the manifest commit itself is the record).
- Group added mod forms into batches of at most 15 per issue (one giant issue is not actionable; per-line issues are spam). Group by shared leading keyword where easy, otherwise just chunk.
- For each batch, create an issue via
gh issue create (the default GITHUB_TOKEN with issues: write permission) with:
- Title:
Coverage: support N new unsupported mod lines (from <short-sha>) or Coverage: map N new skill stat IDs (from <short-sha>)
- Body: the exact manifest lines in a table, a pointer to
CLAUDE.md rules (ModParser changes need spec/System/TestModParser_spec.lua cases; SkillStatMap changes need --tags data to pass), and a note that src/Data/ModCache.lua must be regenerated and committed.
- Labels:
enhancement and ai-fix — applying ai-fix is what queues the fix agent.
- De-duplication guard: before creating, search existing open issues (
gh issue list --search) for the same manifest lines / short-sha and skip duplicates. The workflow must be safe to re-run.
- Rate guard: cap at 10 issues per run; if the diff would produce more, create the first 10 plus one summary issue listing the remainder (a giant upstream merge should not file 60 issues).
Acceptance criteria
- Workflow YAML passes
actionlint (or at minimum loads without syntax errors on a dummy push).
tools/triage_audit_diff.py has a unit-testable core: given two manifest texts, returns the batched issue payloads. Include a few test cases (plain python -m unittest style is fine, or a fixture-driven main; this is workflow tooling, not Lua, so the Busted suite is not required for it).
- Running the script against a synthetic diff (5 added unsupported lines) produces exactly one issue payload with the right body content.
- No issue creation happens when the manifests didn't change.
- Re-running on the same commit creates no duplicates.
Out of scope
- Changing
ai-fix.yml itself.
- Fixing any mods.
Goal
Close the loop from audit to fix: when a data update lands on
devand the coverage manifests change, automatically file well-scoped issues for the newly-unsupported items so the existingai-fixpipeline can work through them. This turns "new patch merged" into "triaged work queue" with zero manual effort.Depends on: #67 (mod-coverage manifest) and ideally #68 (skill-stat manifest). Do not start until #67 is merged.
Background (read first)
CLAUDE.mdand the "AI Workflow Escape Hatches" section ofREADME.md..github/workflows/ai-fix.yml: adding theai-fixlabel to an issue spawns an agent that implements it, runs the test suite, and opens a PR. The missing piece is generating the issues.audit/mod-coverage.txtandaudit/skill-stat-coverage.txtare committed manifests that change exactly when parser coverage or data changes.What to build
A workflow
.github/workflows/audit-triage.yml:Trigger:
pushtodev, with apathsfilter onaudit/*.txt.Steps:
fetch-depth: 2is sufficient for the pushed range; usegit diff HEAD^ HEAD -- audit/— handle the first-commit edge case by skipping).tools/triage_audit_diff.py):unsupported/partiallines inaudit/mod-coverage.txt→ new unsupported mod forms.audit/skill-stat-coverage.txt→ new unmapped stat IDs.gh issue create(the defaultGITHUB_TOKENwithissues: writepermission) with:Coverage: support N new unsupported mod lines (from <short-sha>)orCoverage: map N new skill stat IDs (from <short-sha>)CLAUDE.mdrules (ModParser changes needspec/System/TestModParser_spec.luacases; SkillStatMap changes need--tags datato pass), and a note thatsrc/Data/ModCache.luamust be regenerated and committed.enhancementandai-fix— applyingai-fixis what queues the fix agent.gh issue list --search) for the same manifest lines / short-sha and skip duplicates. The workflow must be safe to re-run.Acceptance criteria
actionlint(or at minimum loads without syntax errors on a dummy push).tools/triage_audit_diff.pyhas a unit-testable core: given two manifest texts, returns the batched issue payloads. Include a few test cases (plainpython -m unitteststyle is fine, or a fixture-driven main; this is workflow tooling, not Lua, so the Busted suite is not required for it).Out of scope
ai-fix.ymlitself.