Repository navigation
Description
Parent
Refs #3803
Agent Brief
Type: Feature
Summary: A new v1 routine class drift-delta-sweep in the autonomy routine catalog, whose tracked leaf names the instruction-placement delta, overengineering delta, and codebase-health audit skills as its fan-out.
Amended 2026-09-06 (planning slice #3809). The planning slice settled the extend-versus-sibling decision: a sibling
v1rowdrift-delta-sweepwith its own leaf, not an extension ofdoc-freshness-sweep(extending would change what the already-ratified identitydoc-freshness-sweep/advisoryauthorizes without an org re-reviewing it, and would misfile two non-doc lanes under a doc-freshness class). The criteria below replace the original ones. Everything a worker needs is in this body; the plan document lives on a contract-tier branch (plan/3809-drift-delta-routine,docs/topics/drift-delta-routine/PLAN.md) and never merges. Two chain facts drove the reshaping: (1)plugins/autonomy/skills/setup/scripts/generate-identity-prerequisites.mjsparses every leaf'sPrerequisitessection intogenerated/identity-prerequisites.json, which CI checks with--check; (2) nothing in this repository executes a routine's instructions (the runner is design-only), so the leaf is the instruction artifact an org's handler points at, and no surface, binding, schedule, or workflow is created here. The container Brief's constraint "Routine instruction content lives in the tracked leaf" presupposes a leaf, which only av1row ships, so the row is built asv1; a PR-review switch condition on that status is recorded at the end of this body.
Current behavior:
The routine catalog has ten v1 classes and no class that runs the repository's installed drift lanes on a cadence. The three drift skills run only when a human remembers to invoke them.
Desired behavior:
The catalog gains an eleventh v1 class, drift-delta-sweep, with a tracked leaf that carries the fan-out instruction content. The catalog row points at the leaf and does not duplicate its content.
Files (this PR touches the autonomy plugin only), in this order inside the PR: leaf → catalog → generator comment → regenerate → changelog + version:
| Path | Change |
|---|---|
plugins/autonomy/reference/routines/drift-delta-sweep.md |
New leaf (content contract below). |
plugins/autonomy/reference/routines.md |
Catalog row under Code quality / knowledge, directly after the doc-freshness-sweep row: | drift-delta-sweep | AGT | R + WI | repo | C1 | v1 |. One class-parameter bullet (exact text below) appended to "Class parameters". Add - [drift-delta-sweep](routines/drift-delta-sweep.md) to the "v1 leaves" list after doc-freshness-sweep. Change "ten v1 classes" to "eleven v1 classes" (the only occurrence in the plugin). |
plugins/autonomy/skills/setup/scripts/generate-identity-prerequisites.mjs |
Header comment "ten v1 routine definition leaves" becomes "eleven v1 routine definition leaves". No logic change. |
plugins/autonomy/generated/identity-prerequisites.json |
Regenerate by running the generator with no arguments. Never hand-edit. The emission goes from thirteen identities to fourteen. |
plugins/autonomy/CHANGELOG.md |
New ## [0.23.0] section with ### Added. |
plugins/autonomy/.claude-plugin/plugin.json |
version 0.22.30 → 0.23.0 (minor; in-CHANGELOG precedents 0.17.0, nine new classes, and 0.19.0, a new section on every leaf). |
plugins/autonomy/README.md |
No change: it enumerates no leaves. Say so in the PR body. |
Do not edit docs/adr/0011-*.md or CHANGELOG history that says "ten": those are historical records. The PR carries no path under docs/topics/.
Leaf content contract (drift-delta-sweep.md):
Hard rules for the whole file:
- Org-agnostic and vendor-agnostic.
scripts/validate-plugin-contracts.mjsfails any file underplugins/autonomy/reference/containing the substringsgithub,gitlab,bitbucket,slack,anthropic,claude,openai,copilot,cursor, ordevin(case-insensitive), and any fleet token. So never write "Claude Code", "GitHub", or${CLAUDE_PLUGIN_ROOT}in this file. - Every cross-plugin reference names the plugin (never a marketplace), is presence-gated at the invocation ("when the
<plugin>plugin is installed"), and states the fallback in the same sentence. Restate what the leaf needs; do not point atdocs/conventions/. - Name no artifact path or home of any lane (no
.work/, nomemory_dir, no<branch-slug>, no plugin-data path, nobaselines/, nostate-key). The lanes resolve their own homes. - Backtick
drift-delta-sweepin prose. - Exclude no scheduling surface. The leaf states facts and one illustrative binding.
Sections, in this order, all H2, mirroring plugins/autonomy/reference/routines/tech-debt-sweep.md:
- Intro line: "Normative leaf of the routine catalog: the
drift-delta-sweepv1 class definition ..." in the shape of the other leaves' first sentence, with the link. Purpose: the repository's installed drift lanes run only when a human remembers; the sweep runs them on a cadence and reports movement.Trigger and cadence: slotschedule;temporalsignal through the trigger-dispatch adapter; suggested cadence weekly, org-bindable. Then the run predicate as a fact: the two delta lanes compare and capture only when the executing session resolves a branch identity (a branch checkout, or a logical ref the runner supplies) and finds its memory-tier home persisted across runs; a run without them still reports, compares nothing, and says so. Then one illustrative binding, not a fixed requirement: a scheduled job on the CI-orchestration home whose runner restores that home and checks out the branch, which guided setup records as theci-cronscheduler class. End the section with the verbatim sentence: "No vendor scheduling surface is named here; guided setup researches scheduling surfaces live."Access scope:repo. Reads the repository tree; writes through the governed queue and tracker only; no merge path. The audit lane runs without--fix.Output contract: one advisory report per run with one section per lane, a coverage line (which layers and which dimension this cycle walked), and a "lanes not run" section naming each absent or blocked lane and why; work items through the governed queue for movement needing authorial judgment. State that the report is the evidence the class keeps its own place on the enforcement surface with. State that a catalog routine's handler runs no work and enqueues one signal onto a tracker-held governed queue item, so the durable record is the queue item (the recurring-work-item shape the enforcement-surface lane's own guidance prefers) minted by a scheduled tick, which is itself an enforcement-surface item the report must justify.Fan-out(the instruction content), three instructed invocations in this order:- The instruction-placement delta lane: invoke
/instruction-placement:delta(when theinstruction-placementplugin is installed; absent, record the lane as not run). It owns what moved in the instruction-placement findings since its last run. Bootstrap rule: when it reports no prior artifact, invoke/instruction-placement:audit(read-only; its only write is its own findings artifact) so the next cycle has a baseline, and record the cycle as a bootstrap. - The enforcement-surface delta lane: invoke
/overengineering:deltawithunattendedand two layers (when theoverengineeringplugin is installed; absent, record the lane as not run). It owns what moved in the enforcement surface since its last run. Layer pair index = (ISO week − 1) mod 5, week read withdate -u +%V: 0 =agent-hooks agent-instructions, 1 =repo-hooks vcs-hooks, 2 =ci-lanes gate-scripts, 3 =satellite-workflows branch-protection, 4 =forge-apps external-integrations. Stateless; a 53-week year repeats one pair, which the coverage line records. The report carries the lane's coverage line. - The repository drift audit lane: invoke
/codebase-health:auditwithout--fixand with one dimension flag (when thecodebase-healthplugin is installed; absent, record the lane as not run). It owns the full drift pass over docs, config, code, and architecture claims and is a full pass, never a delta. Dimension index = (ISO week − 1) mod 4: 0 =--docs-only, 1 =--config-only, 2 =--code-only, 3 =--arch-only. Before invoking, read the audit's tracked config and expand that dimension'sprimary-sourcesglobs; where the config resolves no targets for the dimension, or the expanded list exceeds twenty files (the audit's confirm threshold, which an unattended session cannot answer), do not invoke the audit and record the lane as not run with the dimension and the file count. Keep its checklist in-response; take no persist offer.
- The instruction-placement delta lane: invoke
Derived guardrail row:AGTjudgment;R + WIoutput →C1; no structural or configuration change (noC4); repo access, no external content (noC5);L2floor. Derived through the catalog's mapping rules, never hand-assigned.Prerequisites: copytech-debt-sweep.mdlines 50–69 exactly and substitute: the line "Single-posture identity:" followed by the backticked tokendrift-delta-sweep; the six-row axis table (Access classrepo;Isolation floorL2cited from the matrixC1row and the unattended floor;Connector entitlementsnone;Connector entitlement rungn/a; theexecutor_classmerge cap row verbatim ending "Merge policy for this identity is n/a (C1)";Repo needs). TheRepo needscell is exactly, on one line: "repository source tree; documentation corpus; tracker binding when filing work items through the work-item tracker seam. The class's substantive prerequisites, three optional sibling plugins present and a run that resolves a branch identity and persists its memory-tier home, are not representable in the generated emission". The generator recognizes only fixed phrases; those three yield needssource_tree,documentation_corpus,tracker; the trailing sentence matches no pattern.Admission and escalation: imported by citation, astech-debt-sweep.mddoes.Precedent: the proven manual pattern at class level is the operator-run cadence pass over report-only drift detectors (report-only drift-watch rows in a consumer's recurring schedule; the enforcement-surface lane's own recurring-wiring guidance). Say plainly that no run record exists yet for these three lanes together.
Class-parameter bullet (exact text, appended to routines.md "Class parameters"):
- **`drift-delta-sweep` and `doc-freshness-sweep` are distinct classes.** `doc-freshness-sweep`
judges whether prose still describes its subject; `drift-delta-sweep` runs the repository's
installed drift lanes and reports their movement. Its repository-drift-audit lane is a full pass
whose documentation dimension overlaps `doc-freshness-sweep`; an org enabling both accepts that
one dimension is covered twice. The class's substantive prerequisites, three optional sibling
plugins present and a run that resolves a branch identity and persists its memory-tier home
across cycles, are not representable in the generated prerequisite emission, so a `supported`
verdict for this identity over-reports; the leaf states the predicate and the routine binding
owns satisfying it.Acceptance criteria (amended 2026-09-06):
- The leaf
plugins/autonomy/reference/routines/drift-delta-sweep.mdexists and itsFan-outsection names/instruction-placement:delta(with the/instruction-placement:auditbootstrap rule),/overengineering:delta(withunattendedand the two-layer rotation table), and/codebase-health:audit(without--fix, with the dimension rotation table and the pre-invocation target check), each presence-gated with a stated fallback. - The routine's instruction content lives in the leaf; the catalog row in
routines.mdpoints at it and does not duplicate it; the v1 leaves list links it; the count reads "elevenv1classes"; the class-parameter bullet above is present verbatim. - The leaf states the run predicate as a fact (branch identity; memory-tier home persisted across runs), gives the CI-orchestration scheduled job as an illustrative
ci-cronbinding, excludes no surface, and ends its trigger section with the verbatim "No vendor scheduling surface is named here; guided setup researches scheduling surfaces live." Nothing registers a surface, binding, schedule, or workflow;.github/recurring-schedule.jsonis untouched. - The leaf's
Prerequisitessection has the six-row shape oftech-debt-sweep.mdincluding theexecutor_classmerge cap row, andnode plugins/autonomy/skills/setup/scripts/generate-identity-prerequisites.mjs --checkpasses with"identity": "drift-delta-sweep"present in the regenerated emission and needs exactlydocumentation_corpus,source_tree,tracker. - The leaf contains no artifact path or home and none of the banned
reference/substrings;node scripts/validate-plugin-contracts.mjspasses. -
bash plugins/autonomy/skills/setup/scripts/generate-identity-prerequisites.test.shandnode plugins/autonomy/skills/setup/scripts/resolve-prerequisites.fixtures.test.mjspass. -
lychee --offline --config lychee.tomlpasses on the leaf androutines.md(every relative anchor resolves); where lychee is not installed, the PR body says so. -
markdownlintpasses on the changed files. - The autonomy plugin version is
0.23.0and the CHANGELOG has a## [0.23.0]### Addedentry. -
/skill-quality:check: not applicable, no SKILL.md is touched (amended 2026-09-06). - The autonomy README needs no change (it enumerates no leaves); the PR body says so.
routines.mdis the reference doc listing routines and is updated as above. - The PR carries no path under
docs/topics/.
Sanity Checks (run from the repository root; every line must pass after the change; the presence lines all fail on the unmodified tree):
set -e
LEAF=plugins/autonomy/reference/routines/drift-delta-sweep.md
CAT=plugins/autonomy/reference/routines.md
GEN=plugins/autonomy/generated/identity-prerequisites.json
test -f "$LEAF"
grep -q '^| drift-delta-sweep | AGT | R + WI | repo | C1 | v1 |$' "$CAT"
grep -q 'routines/drift-delta-sweep.md' "$CAT"
grep -q 'eleven `v1` classes' "$CAT"
grep -q 'eleven v1' plugins/autonomy/skills/setup/scripts/generate-identity-prerequisites.mjs
node plugins/autonomy/skills/setup/scripts/generate-identity-prerequisites.mjs --check
grep -q '"identity": "drift-delta-sweep"' "$GEN"
grep -q 'Single-posture identity: `drift-delta-sweep`' "$LEAF"
grep -q '`executor_class` merge cap' "$LEAF"
grep -q '^## Fan-out' "$LEAF"
grep -q '/instruction-placement:delta' "$LEAF"
grep -q '/instruction-placement:audit' "$LEAF"
grep -q '/overengineering:delta' "$LEAF"
grep -q '/codebase-health:audit' "$LEAF"
grep -q 'without `--fix`' "$LEAF"
grep -q 'ci-cron' "$LEAF"
grep -q 'No vendor scheduling surface is named here' "$LEAF"
grep -qi 'is installed' "$LEAF"
grep -qi 'persisted across' "$LEAF"
grep -qi 'branch identity' "$LEAF"
grep -qi 'coverage line' "$LEAF"
if grep -qiE 'github|gitlab|bitbucket|slack|anthropic|claude|openai|copilot|cursor|devin|melodic' "$LEAF"; then echo "banned token in leaf"; exit 1; fi
if grep -qE 'CLAUDE_PLUGIN_DATA|\.work/|memory_dir|<branch-slug>|state-key|baselines/|spine-baseline' "$LEAF"; then echo "leaf names an artifact path"; exit 1; fi
grep -q '"version": "0.23.0"' plugins/autonomy/.claude-plugin/plugin.json
grep -q '^## \[0.23.0\]' plugins/autonomy/CHANGELOG.md
bash plugins/autonomy/skills/setup/scripts/generate-identity-prerequisites.test.sh
node plugins/autonomy/skills/setup/scripts/resolve-prerequisites.fixtures.test.mjs
node scripts/validate-plugin-contracts.mjs
lychee --offline --config lychee.toml "$LEAF" "$CAT"
npx markdownlint-cli2 "$LEAF" "$CAT" plugins/autonomy/CHANGELOG.mdAbsence checks use the if grep -q ...; then exit 1; fi form: a bare ! grep -q does not abort under set -e, and grep -c exits 1 on zero matches.
Out of scope:
- Changing what any of the three fanned-out skills detect or report, or editing any of their files.
- A cloud schedule routine; any surface, binding, schedule, or workflow registration.
- Adding a fourth lane to the fan-out (the
/instruction-placement:auditbootstrap is the first lane's own bootstrap, not a fourth lane). - Extending the generator's need vocabulary (deferred).
PR-review switch condition recorded by the planning slice: the row ships as v1 on the class-level pattern (operators re-run report-only drift detectors on a cadence; this repository's recurring schedule carries two such rows), with all three lanes built, and because the container Brief requires a leaf. No run record exists for these three lanes together. CHANGELOG [0.19.1] refused v1 for cant-fail-test-repair because its judgment portion was unbuilt; here it is built. If PR review rules v1 unearned until a lane-specific run record exists, the row files as join: proven recurring manual pattern with no leaf, which makes this slice's leaf criteria and the container's criterion 2 unsatisfiable as written; the slice then returns to decompose, and the cheapest run record is a recurring-schedule row for this repository. A human may pre-empt this on #3809's closing comment.
Activity
[-]autonomy/routines: doc-freshness-sweep fans to instruction-placement:delta, overengineering:delta, codebase-health:audit[/-][+]autonomy/routines: add the drift-delta-sweep v1 class whose leaf fans to instruction-placement:delta, overengineering:delta, codebase-health:audit[/+]kyle-sexton commentedon Sep 6, 2026
feat(autonomy): add the drift-delta-sweep v1 routine class and its leaf
feat(autonomy): add the drift-delta-sweep v1 routine class and its le…