Skip to content

autonomy/routines: add the drift-delta-sweep v1 class whose leaf fans to instruction-placement:delta, overengineering:delta, codebase-health:audit #3819

Description

@kyle-sexton

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 v1 row drift-delta-sweep with its own leaf, not an extension of doc-freshness-sweep (extending would change what the already-ratified identity doc-freshness-sweep/advisory authorizes 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.mjs parses every leaf's Prerequisites section into generated/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 a v1 row ships, so the row is built as v1; 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.mjs fails any file under plugins/autonomy/reference/ containing the substrings github, gitlab, bitbucket, slack, anthropic, claude, openai, copilot, cursor, or devin (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 at docs/conventions/.
  • Name no artifact path or home of any lane (no .work/, no memory_dir, no <branch-slug>, no plugin-data path, no baselines/, no state-key). The lanes resolve their own homes.
  • Backtick drift-delta-sweep in 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:

  1. Intro line: "Normative leaf of the routine catalog: the drift-delta-sweep v1 class definition ..." in the shape of the other leaves' first sentence, with the link.
  2. Purpose: the repository's installed drift lanes run only when a human remembers; the sweep runs them on a cadence and reports movement.
  3. Trigger and cadence: slot schedule; temporal signal 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 the ci-cron scheduler class. End the section with the verbatim sentence: "No vendor scheduling surface is named here; guided setup researches scheduling surfaces live."
  4. Access scope: repo. Reads the repository tree; writes through the governed queue and tracker only; no merge path. The audit lane runs without --fix.
  5. 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.
  6. Fan-out (the instruction content), three instructed invocations in this order:
    1. The instruction-placement delta lane: invoke /instruction-placement:delta (when the instruction-placement plugin 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.
    2. The enforcement-surface delta lane: invoke /overengineering:delta with unattended and two layers (when the overengineering plugin 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 with date -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.
    3. The repository drift audit lane: invoke /codebase-health:audit without --fix and with one dimension flag (when the codebase-health plugin 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's primary-sources globs; 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.
  7. Derived guardrail row: AGT judgment; R + WI output → C1; no structural or configuration change (no C4); repo access, no external content (no C5); L2 floor. Derived through the catalog's mapping rules, never hand-assigned.
  8. Prerequisites: copy tech-debt-sweep.md lines 50–69 exactly and substitute: the line "Single-posture identity:" followed by the backticked token drift-delta-sweep; the six-row axis table (Access class repo; Isolation floor L2 cited from the matrix C1 row and the unattended floor; Connector entitlements none; Connector entitlement rung n/a; the executor_class merge cap row verbatim ending "Merge policy for this identity is n/a (C1)"; Repo needs). The Repo needs cell 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 needs source_tree, documentation_corpus, tracker; the trailing sentence matches no pattern.
  9. Admission and escalation: imported by citation, as tech-debt-sweep.md does.
  10. 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.md exists and its Fan-out section names /instruction-placement:delta (with the /instruction-placement:audit bootstrap rule), /overengineering:delta (with unattended and 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.md points at it and does not duplicate it; the v1 leaves list links it; the count reads "eleven v1 classes"; 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-cron binding, 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.json is untouched.
  • The leaf's Prerequisites section has the six-row shape of tech-debt-sweep.md including the executor_class merge cap row, and node plugins/autonomy/skills/setup/scripts/generate-identity-prerequisites.mjs --check passes with "identity": "drift-delta-sweep" present in the regenerated emission and needs exactly documentation_corpus, source_tree, tracker.
  • The leaf contains no artifact path or home and none of the banned reference/ substrings; node scripts/validate-plugin-contracts.mjs passes.
  • bash plugins/autonomy/skills/setup/scripts/generate-identity-prerequisites.test.sh and node plugins/autonomy/skills/setup/scripts/resolve-prerequisites.fixtures.test.mjs pass.
  • lychee --offline --config lychee.toml passes on the leaf and routines.md (every relative anchor resolves); where lychee is not installed, the PR body says so.
  • markdownlint passes on the changed files.
  • The autonomy plugin version is 0.23.0 and the CHANGELOG has a ## [0.23.0] ### Added entry.
  • /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.md is 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.md

Absence 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:audit bootstrap 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.

Blocked by

#3809

Activity

  1. added
    agent-ready
    on Sep 6, 2026
  2. added
    needs-triage
    on Sep 6, 2026
  3. changed the title [-]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[/+] on Sep 6, 2026
  4. self-assigned this
    on Sep 6, 2026
  5. kyle-sexton commented on Sep 6, 2026

    @kyle-sexton
    MemberAuthor
    No description provided.
  6. added 2 commits that reference this issue on Sep 7, 2026
    dca74e5
    a3dc8f4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

agent-readyneeds-triage

Fields

No fields configured for Feature.

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions