Skip to content

Add the Community Packs migration skill - #371

Open
felickz wants to merge 6 commits into
mainfrom
add-community-packs-migration-skill
Open

felickz wants to merge 6 commits into
mainfrom
add-community-packs-migration-skill

Conversation

@felickz

@felickz felickz commented Nov 25, 2026 •

Copy link
Copy Markdown

Agent assessment

Self-reported assessment, not an independent review.

Assessed revision: eadc0eda16ae5d5572d0642654e2174617c4523c

Dimension Assessment Rationale
Change confidence 8/10 ↑ 184 offline tests pass (python -m unittest discover -s . -p "test_*.py" in the scripts directory).
↑ The scripts were run for real during the Rust migration work (plan, check, measure, scan, the onboarding report, scan timing, the scan trigger, tracker updates, the scan database download), and each fix found that way has a test.
↑ Scans of the 26 files for internal references, local paths, e-mail addresses, credentials, em or en dashes and the abbreviation that the skill forbids found nothing.
↑ The repository's Prettier check (npm run format:check) passes on this commit. It failed on the first commit, and the fix changes formatting only (the text is identical).
↓ Analyze (c-cpp) fails on this pull request with "No source files found" from the C++ autobuilder. The repository has no C/C++ code, main passes, and the skill touches no C/C++ file, so I did not change anything for it, but I did not find out why other pull requests skip or pass it.
↓ The skill depends on state outside the repository (GitHub organization settings, a Community Packs checkout, CodeQL CLI 2.27.5, a Windows layout) that no check here exercises.
↓ One finding about the Rust Iron fallback is written down as open, and no Copilot code review has run on this pull request (none was requested).

Summary

Adds the community-packs-migration skill under .github/skills/community-packs-migration/. It moves a gap-issue query or data extension model from a Copilot pull request in this repository into CodeQL Community Packs as a neutral, tested, reviewable pull request, then checks that the released query finds what it was written for and that the scans did not get much slower. It runs in a local, human-gated session and is not meant for the cloud agent.

What it covers

  • SKILL.md: the rules that cost the most when missed, setup, the workflow from reading the gap issue to timing the scans after the release, and how to hand a unit to the Copilot coding agent in the Community Packs repository (and what that agent has and lacks).
  • references/migration-guide.md: the contract. Layout, ids and metadata, security grade versus audit grade, what makes a query run (the pack in the configs, a suite that selects it), data extensions, tests, the quality bar, performance risk, a fallback by name for calls that have no target, disclosure, the human gate, tooling.
  • references/verify-detection.md: after the release. Predict the result locally, enable the language, point the scan at the pack, count alerts, read the scan database when an expected alert is missing, and time the scans before and after.
  • references/worker-brief.md: the operating rules for one delegated worker.
  • scripts/: the tools and their offline tests. community_packs_migrate.py (plan, prepare, apply, check, measure, scan), community_packs_corpus.py, community_packs_onboard.py, tracker_action.py, verify_alerts.py, scan_database.py, scan_timing.py, trigger_scans.py, rule_value.py, gap_overlap.py, default_setup_languages.py and enable_workflows.browser.js.

Rules it enforces

Nothing public without a human's approval, neutral public text, no pack version changes, one pull request per gap issue opened as a draft, a merged query does not run until a config names its pack and a suite selects it, the user-level CodeQL config hidden for every local gate, Copilot code review read in full, cost judged with measure, and passing tests are not proof of detection.

Evidence

  • 184 offline tests pass.
  • The check, measure and scan gates and the onboarding report ran on real Community Packs pull requests (Actions and Rust units). The checks the skill gained along the way each came from a miss: the config and suite gates, the call resolution check on the scan database, the signature check of scan.
  • The 26 files contain no internal repository names, local paths, e-mail addresses or credentials, and no em or en dashes.

Notes

  • The only change is inside .github/skills/community-packs-migration/. The commits are signed.
  • One finding about the Rust Iron fallback (leaving a flow to the standard query only when its analysis reaches it) is written down as open in the guide. It is being fixed in the Community Packs pull request that carries the fallback, and the guide will be updated when that lands.

felickz and others added 5 commits November 25, 2026 13:48
Turn a gap-issue prototype into a neutral, tested Community Packs pull request, and check afterwards that the released query finds what it was written for.

The skill holds the migration guide and worker brief, the migration and corpus scripts, a tracker helper that edits only the Action column, and a read-only check that tells whether each linked AI scan finding is now covered by a released rule and counts the alerts of that rule.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 4124a708-0b20-41df-a2e2-c945fbf86752
…ration skill

- community_packs_onboard.py reports, and with --apply fixes, the pack lines in the
  CCP configs and the audit suite that make a merged query run. check fails a query
  that the suite for its group does not select and a language pack that no config
  names. --published finds config lines that name a suite or pack the latest
  release lacks.
- scan_timing.py compares the code scanning job times before and after a release and
  explains the pairs that got slower from the job logs. trigger_scans.py starts the
  scans with empty commits.
- measure reports a cost class, the CCP naming replaces the old abbreviation, and
  tracker_action.py counts recorded actions.
- Notes from the first Rust release: timing, detections, and the call resolution
  limit of the Iron prelude that a test fixture hid.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 4124a708-0b20-41df-a2e2-c945fbf86752
…ure check

Add scan_database.py, which downloads the database of a code scanning analysis
and lists the calls of a file with their targets (Rust), with tests. It
replaces the curl and scratch query snippets of the verify guide.

Add the guide section "A fallback for calls that have no target": match only
calls without a target in files that use the library, a source by the shape
of the API, steps and the encoding exclusion, one reported path, the test
pattern (glob only fixture, premise test, other framework file, negative
cases, mutation checks) and the QL gotchas of rust-all 0.2.26.

Record the Iron fix and its result on the scan database, add to the rules that
the fix is checked on that database before the pull request opens, and write
down what the coding agent of the CCP repository has (the pinned CodeQL CLI,
packs and stubs) and lacks (the CodeQL Development MCP server), and when to
hand a unit to it.

Fix the scan gate: read the signature from the commit header instead of
git log %G?, which says N for an SSH signature that this machine cannot verify
and called every 1Password signed commit unsigned. Tests added.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 4124a708-0b20-41df-a2e2-c945fbf86752
Record what Copilot code review found in the fallback pull request (an encoder
match by substring, and the resolved sinks that a fallback source also needs),
the bindingset gotcha, and the learn run that writes a compile error into the
.expected file.

Correct the Rust CI note: Rust runs as a single slice since pull request 259, so
a pull request may change several test directories, and a pull request that
changes a file other than a query runs all of the language's tests (17 minutes
for Rust). Fix the hand-off section of SKILL.md to match.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 4124a708-0b20-41df-a2e2-c945fbf86752
…tral test pattern

Record that a clause which leaves a flow to the standard query by the class of
its source is wrong when a call without a target lies between the modelled
source and the sink, with the two facts that were checked (the sink of a data
extension row is a flow summary node, and the standard query's configuration is
not in a library) and the fixture trap (taint stops at a resolved call that has
no summary). The fix itself is still open in the pull request, so the guide says so.

Use a neutral pattern in a unit test of scan_database.py.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 4124a708-0b20-41df-a2e2-c945fbf86752
def is_ours(query: dict, ours: list[str]) -> bool:
"""A query matches a rule id, a pack relative path, a file name without the extension, or the end of the path."""
path = query["path"]
return any(token in (query.get("rule"), path, path.rsplit("/", 1)[-1]) or path.endswith("/" + token) for token in ours)
facts: dict = {"setup_languages": None, "analyzed": None, "config_file": None}
try:
facts["setup_languages"] = gh_json(f"repos/{owner}/{repo}/code-scanning/default-setup").get("languages")
except (RuntimeError, json.JSONDecodeError):
try:
analyses = gh_lines(f"repos/{owner}/{repo}/code-scanning/analyses?tool_name=CodeQL&per_page=100")
facts["analyzed"] = {a.get("category") or "" for a in analyses}
except (RuntimeError, json.JSONDecodeError):
try:
values = gh_json(f"repos/{owner}/{repo}/properties/values")
facts["config_file"] = next((p["value"] for p in values if p["property_name"] == CONFIG_PROPERTY), None)
except (RuntimeError, json.JSONDecodeError, TypeError):
The repository checks "**/*.{yml,yaml,md}" with Prettier 3.8.4 and the check
failed on four files of the skill. Run prettier --write on them. The text is
unchanged: only table alignment, list markers and spacing differ.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 4124a708-0b20-41df-a2e2-c945fbf86752
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.

2 participants