drift-sweep
Skill1 starsChanged 3 months agoMITView on GitHub
CURRENTLY DORMANT (named honestly — the scripts/foundry_drift_sweep.py engine this skill drives was retired and does not ship; this file is design intent for a re-implementation, not a live procedure). Advisory batch drift-suspect sweep — given a base->head system-state snapshot pair (from the system-state snapshot tool), lists every AUTHORIZED contract whose frozen system_grounding block (or, for atoms predating it, its spec body) still references a schema/module identifier the migration DROPPED or RENAMED. ADVISORY, NOT a merge gate — not part of the merge floor (ci.yml + btb-gates), is not a branch-protection required status, opens no grounding source itself. Trigger to sweep the AUTHORIZED-contract corpus for stale schema references after a migration lands.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- Vladick-Pick/business-ontologytheir own version, first seen Jul 15, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- Vladick-Pick/business-ontology★ 3same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository71 other files it gives its agents.
- AGENTS.mdAGENTS.md
- llms.txtllms.txt
- amendSkill
- auditSkill
- authorize-releaseSkill
- authorizeSkill
- certify-localSkill
- certify-stagingSkill
- coherence-checkSkill
- command-deckSkill
- contextSkill
- cut-releaseSkill
- dashboards-as-codeSkill
- data-tier-cutoverSkill
- decommission-gateSkill
- deploy-statusSkill
- dispatchSkill
- doctorSkill
- env-hygieneSkill
- extract-specSkill
- fleetSkill
- grounding-conformanceSkill
- id-applySkill
- id-architectSkill
- id-baselineSkill
- id-discoverSkill
- id-documentSkill
- id-driftSkill
- id-impactSkill
- id-implementSkill
- id-importSkill
- id-planSkill
- id-promoteSkill
- id-reviewSkill
- id-rollbackSkill
- id-simulateSkill
- id-syncSkill
- id-testSkill
- id-validateSkill
- id-verifySkill
- indexSkill
- infra-sandboxed-applySkill
- initSkill
- intakeSkill
- learn-captureSkill
- learn-distillSkill
- merge-when-greenSkill
- mode-autonomousSkill
- mode-interactiveSkill
- modeSkill
- post-upgradeSkill
- releaseSkill
- relockSkill
- report-citation-graphSkill
- reposSkill
- research-captureSkill
- research-firstSkill
- revertSkill
- sd-debugSkill
- sd-discoverSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 93
When either snapshot has grounding_configured: false (no schema surface to diff) the sweep emits zero drift-suspects and exits 0 — never a …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
/foundry:drift-sweep
An operator/agent ADVISORY sweep that names the whole batch of frozen atoms a schema/module
migration just invalidated, instead of letting each one be rediscovered one at a time, weeks apart,
at its own build. It is the batch-level, schema-coherence analogue of
/foundry:coherence-check (which covers citations): same advisory posture, same tri-state
fail-closed exit, same fresh-walk-every-run discipline — the missing dimension is schema
identifiers instead of citations.
DORMANT: the engine below (
scripts/foundry_drift_sweep.py) does not ship — the command is design intent for a re-implementation, not a runnable verb today.
python3 "${CLAUDE_PLUGIN_ROOT}/scripts/foundry_drift_sweep.py" \
--base /path/to/base-snapshot.json \
--head /path/to/head-snapshot.json \
--corpus-root "$CLAUDE_PROJECT_DIR" # default: $CLAUDE_PROJECT_DIR or cwdInput — a base->head snapshot PAIR (host-side, HOW obtained is a wiring concern)
The sweep takes two already-built snapshots from the system-state snapshot tool
(foundry_system_snapshot.build_system_snapshot() results — {schema_version, schema_grounded,
module_grounded, grounding_configured, entities, modules, signature}) as JSON files. It opens
no grounding source itself and does no git plumbing — how the caller obtains the base
(pre-migration) and head (post-migration) snapshots (e.g. re-resolving the same grounding block
at two different migration-history points) is an operational wiring concern, not this sweep's.
What counts as a candidate (schema-delta vocabulary)
A dropped/renamed candidate identifier is one present in the base snapshot and absent from the head snapshot, over the grounded dimensions:
- table — a base
entitieskey absent from head. - column — a base
<entity>::<column>absent from head. - module — a base
modulesmember absent from head.
A RENAME is observed as a drop of the old identifier — the new name appears as an addition, which is never a candidate (only disappearances are). An identifier present in both, or added only in head, is never a candidate.
The back-reference scan
For each candidate identifier, the sweep scans every AUTHORIZED contract in the corpus
(AUTHORIZED per foundry_authz) for that identifier:
- Primary — the
system_groundingblock (written by the system_grounding validators): a whole-string match against each artifact'sidentifier. - Fallback — the spec body, when an AUTHORIZED atom carries no
system_groundingblock (it predates the block): a whole-identifier-token grep — the candidate must be bounded by a non-identifier character (or start/end of text) on both sides over the identifier class[A-Za-z0-9_.:]. Candidatevehiclematches the tokenvehiclebut nevervehicles(suffix continuation),vehicle_parts(suffix continuation), ordealer_vehicle(prefix continuation) — a partial overlap is not a hit.
DRAFT (non-AUTHORIZED) atoms are always excluded, even when they reference the identifier.
Output — a worklist naming EVERY affected atom (deterministic JSON on stdout)
{
"provenance": {"corpus_root": "/abs/root", "source": "fresh-walk", "error": null},
"candidates": ["public.vehicles", "public.vehicles::vin", ...], // sorted
"drift_suspects": [
{"spec_ref": "specs/features/.../feat-x.md", "identifier": "public.vehicles",
"hit_via": "system_grounding"}
],
"counts": {"candidates": N, "drift_suspects": M}
}drift_suspects entries are the pinned field set {spec_ref, identifier, hit_via} —
hit_via ∈ {"system_grounding", "spec_body"} — sorted ascending by (spec_ref, identifier). A
single sweep lists every affected atom, not one at a time.
Tri-state, fail-CLOSED exit (LOAD-BEARING)
0— ran, zero drift-suspects.1— ran, ≥1 drift-suspect. This is ADVISORY only — a worklist / re-audit nudge, never a veto.2— operational failure: a malformed/unreadable snapshot input, a missing/mis-resolved corpus root, or the corpus walk raising — including an unreadable/corrupt AUTHORIZED contract encountered mid-walk. A scan error is a HARD stop, never a silent skip to a partial0/1worklist.
Unconfigured no-op
When either snapshot has grounding_configured: false (no schema surface to diff) the sweep
emits zero drift-suspects and exits 0 — never a false signal for an adopter with no schema
source configured. This holds for both asymmetric permutations (base configured / head not,
and vice-versa).
Venue boundary — ADVISORY, NOT a merge gate
This sweep is NOT part of the merge floor:
- It does NOT run as part of the merge floor (
.github/workflows/ci.yml+btb-gates— the bespokefoundry-merge-gate.pythis line originally named was retired; the boundary principle carries over to whatever embodies the floor). - It is NOT a branch-protection required status.
- It emits a signal / re-audit nudge — it does NOT rewrite frozen specs or re-authorize them (that disposition is the operator's, via re-audit).
The enforcement floors live elsewhere in the reality-grounding gate: the review-time
grounding-reconciliation check catches the divergence at each atom's own review; the
merge-time grounding-reconciliation check, foundry_reconcile.py) was designed to reconcile
mechanical drift at each atom's own merge, but its original call site — the deleted bespoke merge
gate — no longer exists, and it is not currently wired into ci.yml/btb-gates (a sweep finding,
flagged honestly here, not fixed in this pass). This atom is the batch early warning at
migration-merge time regardless: a single sweep names the whole affected batch instead of waiting
weeks for each to be rediscovered independently.
Anti-patterns
- Promoting exit
1into a required merge status. It is advisory by contract; do not wire this sweep into the merge floor (ci.yml + btb-gates) or a branch-protection required check. - Treating a mid-walk read/parse error as a partial
0/1. An unreadable/corrupt AUTHORIZED contract hit during the walk is a hard stop (exit2), never a silent skip. - Substring matching in the spec-body fallback. The match is a whole-identifier token
(
\b-style, over[A-Za-z0-9_.:]) — a partial overlap (vehiclesforvehicle) is never a hit. - Opening a grounding source or doing git plumbing inside the engine. The sweep is host-side, snapshot-pair-in; obtaining the base/head pair is the caller's wiring concern.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

