Skip to content

feat(autonomy): add the drift-delta-sweep v1 routine class and its leaf - #3903

Merged
kyle-sexton merged 1 commit into
mainfrom
feat/3819-drift-delta-sweep
Sep 7, 2026
Merged

kyle-sexton merged 1 commit into
mainfrom
feat/3819-drift-delta-sweep

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

Closes #3819

What

Adds an eleventh v1 routine class, drift-delta-sweep, to the autonomy routine catalog, with its own tracked definition leaf carrying the fan-out as instruction content.

Path Change
plugins/autonomy/reference/routines/drift-delta-sweep.md New leaf.
plugins/autonomy/reference/routines.md Catalog row after doc-freshness-sweep, class-parameter bullet, v1-leaves link, count ten → eleven.
plugins/autonomy/skills/setup/scripts/generate-identity-prerequisites.mjs Header comment ten → eleven v1 leaves. No logic change.
plugins/autonomy/generated/identity-prerequisites.json Regenerated (never hand-edited). Thirteen identities → fourteen.
plugins/autonomy/CHANGELOG.md New ## [0.23.0] ### Added.
plugins/autonomy/.claude-plugin/plugin.json version → 0.23.0.

The leaf fans out, in order, to /instruction-placement:delta (with the /instruction-placement:audit bootstrap), /overengineering:delta with unattended and a two-layer pair rotating on the ISO week, and /codebase-health:audit without --fix with one dimension rotating on the same week. Each invocation is presence-gated on its owning plugin and states its fallback in the same sentence; an absent or blocked lane is recorded as not run rather than silently skipped. Lanes are named by slash invocation only, with no file paths, so a relocation of any of them cannot contradict this leaf.

Sibling, not an extension

The row ships as a sibling of doc-freshness-sweep with its own leaf, not as a broadening of that class. doc-freshness-sweep/advisory is ratified admission data on org security bindings; broadening its substance would change what a ratified entry authorizes without an org re-reviewing it, and two of the three lanes are not doc freshness. The one dimension the two classes overlap on is recorded as a class parameter.

Routine instructions live in the tracked leaf, never a stored prompt, per the catalog's Instruction provenance rule.

Open question for review: the v1 status

Recorded by the planning slice (#3809) as a PR-review switch condition, carried here rather than decided:

The row ships as v1 on the class-level pattern (operators re-run report-only drift detectors on a cadence) with all three lanes built, and because the container Brief requires a leaf, which only a v1 row ships. No run record exists for these three lanes together, and the leaf says so plainly in its Precedent section. CHANGELOG [0.19.1] refused v1 for cant-fail-test-repair because its judgment portion was unbuilt; here it is built.

If review rules v1 unearned until a lane-specific run record exists, the row instead 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.

Notes

  • The autonomy README needs no change: it enumerates no leaves (it refers only to the reference/routines/ directory), so it is untouched.
  • No path under docs/topics/. The plan document lives on the contract-tier branch plan/3809-drift-delta-routine and never merges.
  • Nothing registers a surface, binding, schedule, or workflow. .github/recurring-schedule.json is untouched. The leaf names one illustrative ci-cron binding and excludes no scheduling surface.
  • lychee is installed and passes on the leaf and the catalog (52 links, 52 OK, 0 errors).
  • Version start point: the issue's files table says 0.22.30 → 0.23.0. The real base carried 0.22.32 (main moved). The landing version 0.23.0 is unchanged and is still the correct next minor, strictly greater than the base.

Verification

Every line of the issue's Sanity Checks block passes, plus:

  • node plugins/autonomy/skills/setup/scripts/generate-identity-prerequisites.mjs --check → in sync; emission holds 14 identities and drift-delta-sweep needs exactly documentation_corpus, source_tree, tracker.
  • bash plugins/autonomy/skills/setup/scripts/generate-identity-prerequisites.test.sh → Passed: 6, Failed: 0.
  • node plugins/autonomy/skills/setup/scripts/resolve-prerequisites.fixtures.test.mjs → All 22 checks passed.
  • node scripts/validate-plugin-contracts.mjs → 53 setup skills, 3 retirement manifests, 3345 plugin files checked.
  • npx markdownlint-cli2 on the changed markdown → 0 issues.
  • bash scripts/check-changelog-parity.sh --check-bump origin/main, --check, --check-preserved origin/main, --check-order → all green; 92 changelogs read newest-first, 81 headings preserved.
  • bash scripts/check-stale-base-overlap.sh --check origin/main → no overlapping paths.
  • bash scripts/check-purged-em-dashes.sh → 91 declared paths, 122 files, no em dashes.

Two independent fresh-context verifiers reviewed the change against the issue with the author's reasoning withheld. The first found one MAJOR (the mandated verbatim trigger-section sentence was soft-wrapped, so the contract's own grep failed under set -e); it was fixed by a reflow with no content change. The second, run on the rebased commit, returned no CRITICAL, MAJOR, or MINOR findings.

🤖 Generated with Claude Code

https://claude.ai/code/session_012jiwedVq2GxuzN7siXQbr4

The routine catalog had ten `v1` classes and no class that runs the
repository's installed drift lanes on a cadence, so those lanes ran only when
a human remembered to invoke them.

Adds an eleventh `v1` class, `drift-delta-sweep`, as a sibling row under Code
quality / knowledge with its own tracked leaf. The leaf carries the fan-out
instruction content per the catalog's Instruction provenance rule: the
instruction-placement delta lane (with its audit bootstrap), the
enforcement-surface delta lane (two layers rotating on the ISO week), and the
repository drift audit lane (one dimension rotating on the same week, never
with `--fix`). Each invocation is presence-gated on its owning plugin and
states its fallback in the same sentence.

It ships as a sibling of `doc-freshness-sweep` rather than an extension of it:
`doc-freshness-sweep/advisory` is ratified admission data on org security
bindings, and broadening its substance would change what a ratified entry
authorizes without an org re-reviewing it. A class parameter records the one
dimension the two classes overlap on, and that the class's substantive
prerequisites are not representable in the generated emission.

The generated `identity-prerequisites.json` is regenerated, not hand-edited;
it goes from thirteen identities to fourteen.

Closes #3819

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_012jiwedVq2GxuzN7siXQbr4
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@claude

claude Bot commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @kyle-sexton's task in 1m 4s —— View job


Security review (/review:security-review)

Scope reviewed (gh pr diff 3903): all 6 changed files —
plugins/autonomy/.claude-plugin/plugin.json, plugins/autonomy/CHANGELOG.md,
plugins/autonomy/generated/identity-prerequisites.json,
plugins/autonomy/reference/routines.md,
plugins/autonomy/reference/routines/drift-delta-sweep.md (new leaf),
plugins/autonomy/skills/setup/scripts/generate-identity-prerequisites.mjs.

Result: no security issues found.

This PR adds documentation/catalog content only — a new v1 routine-class leaf
(drift-delta-sweep.md) plus its catalog row, a regenerated JSON prerequisite
emission, a CHANGELOG entry, a plugin version bump, and a one-word header-comment
edit (ten → eleven) in an existing script. There is no executable logic
change: generate-identity-prerequisites.mjs's diff is a comment only.

Reviewed the new leaf specifically for the concerns this lane cares about, since
it defines unattended fan-out behavior for an autonomous agent:

  • No injection surface. The fan-out invokes fixed slash commands
    (/instruction-placement:delta, /overengineering:delta unattended,
    /codebase-health:audit) with a rotation index computed from date -u +%V mod
    a fixed table size, not from any external or attacker-influenced input.
    (drift-delta-sweep.md#L98-L119)
  • No merge/mutation path. The leaf is explicit that the repo-drift-audit lane
    runs without --fix and that no lane in the fan-out prepares or applies a
    repository change, keeping the class at the L2 unattended floor / C1 output
    with security-binding as the executor_class merge cap.
    (drift-delta-sweep.md#L36-L40,
    #L138-L142)
  • Presence-gating fails closed. Each of the three lanes is gated on its
    owning plugin's presence and falls back to "record as not run" rather than
    silently proceeding or degrading to a broader/less-safe action.
    (drift-delta-sweep.md#L82-L119)
  • generated/identity-prerequisites.json is derived, non-executable data
    (access class repo, no connector entitlements) and matches what the leaf and
    generator script describe — no discrepancy that would cause a supported
    verdict to over-grant access.

No GitHub Actions files, secrets/token handling, auth/access-control code, or
injection-relevant surfaces (command, SQL, path, template) are touched by this
PR, so there is nothing in this lane's remit to flag.

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Last security-reviewed head: dca74e543cf7c41e9b4b043033b5765de9782c8f. On the next push, the relevance gate compares only the commits since this SHA; delete this comment to force a full re-review.

@kyle-sexton
kyle-sexton enabled auto-merge (squash) September 7, 2026 03:28
@claude

claude Bot commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @kyle-sexton's task in 6m 13s —— View job


Code review complete

  • Gather context (diff, changed files, CLAUDE.md/AGENTS.md conventions)
  • Invoke /review:code-review per instructions
  • Post findings as inline comments where anchorable
  • Post summary comment

Reviewed per plugins/review/skills/code-review/SKILL.md (correctness + maintainability, security scoped to the dedicated lane). Scope: the 6 changed files (new leaf, catalog edit, generated JSON, plugin.json, CHANGELOG, generator comment).

What I independently checked (not just re-stating the PR's own claims):

  • Generated JSON is actually derived correctly. I hand-simulated generate-identity-prerequisites.mjs's regex-based extraction (needsFromProse, parseConnectorEntitlements, parseConnectorRung, firstBacktick) against the new leaf's ## Prerequisites table and confirmed the emitted drift-delta-sweep entry (needs = documentation_corpus, source_tree, tracker; access/isolation/connector fields) matches what the script would produce, and that alphabetical placement between doc-freshness-sweep/docs-change and duplicate-detection-sweep is correct. I could not run the script myself (node/git fetch aren't in this lane's allowed tools), so I couldn't execute --check, but the static derivation checks out.
  • Every cross-reference resolves. All anchors the leaf cites (guardrails.md#the-matrix, guardrails/isolation-ladder.md#unattended-floor, trigger-dispatch.md#executor-surface-classes, binding-seam.md#resolution-ladder, routines.md#access-to-prerequisites, guardrails/admission-policy.md) exist at the stated headings.
  • The fan-out's factual claims about the three consumed plugins check out, cross-read against their skills: /instruction-placement:delta's documented "no prior artifact → route to full audit" behavior (skills/delta/SKILL.md:80-82), /overengineering:delta's ten layer tokens and unattended argument (skills/delta/SKILL.md:2-3), and /codebase-health:audit's "~20 files → confirm scope" cost gate that an unattended session can't clear (skills/audit/context/discovery-method.md:50).
  • Catalog/leaf consistency: the new row's AGT | R + WI | repo | C1 | v1 cell matches the leaf's own derivation walk; the "eleven v1 classes" / "fourteen identities" counts in routines.md, the generator comment, and the CHANGELOG all match what's actually in reference/routines/ (11 files) and the generated JSON (14 "identity" entries).
  • plugin.json version: 0.22.32 → 0.23.0 is a valid next-minor bump and matches the CHANGELOG's newest entry.

One finding posted inline (drift-delta-sweep.md, lines 77–89): the leaf states the /overengineering:delta layer-pair rotation ((ISO week − 1) mod 5) is even except in a 53-week year. It isn't — 52 mod 5 = 2, so an ordinary 52-week year already splits 11/11/10/10/10 across the five pairs. Minor, doesn't block, but it's a factual claim in a normative leaf that a later coverage-line audit could be misled by.

Nothing else rose to the "a careful senior reviewer would block" bar. The v1-vs-join classification question the PR author raises as an open question in the description is a design/policy call for a human reviewer, not a code-review finding, so I left it alone.

Per the skill's rules, I didn't re-verify the author's claimed local tool runs (markdownlint-cli2, check-changelog-parity.sh, check-purged-em-dashes.sh, the two fresh-context verifier passes) myself — this lane's allowed tools don't include node/bash script execution outside gh, so those remain author-claimed and unverified by me.
· branch

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

PR body contract — issue linkage

This PR body does not yet satisfy the issue-linkage contract:

  • Missing a "## Summary" section. Describe what this PR changes and why, in a sentence or two.
  • Missing a "## Fix" section. State the concrete change and how it addresses the problem.
  • Missing a "## Related" section. List related PRs, ADRs, or decision-log entries this PR does not close.

Edit the body and this comment updates itself on the next run.

@kyle-sexton
kyle-sexton merged commit a3dc8f4 into main Sep 7, 2026
3 checks passed
@kyle-sexton
kyle-sexton deleted the feat/3819-drift-delta-sweep branch September 7, 2026 03:31
Comment on lines +77 to +88
enforcement surface since its own last run. The layer pair rotates on the ISO week number,
read with `date -u +%V`; the pair index is (ISO week − 1) mod 5:

| Pair index | Layers |
|---|---|
| 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` |

The rotation is stateless — a function of the week alone — so a 53-week year repeats one

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: the "53-week year" framing understates how uneven the rotation already is.

(ISO week − 1) mod 5 over an ordinary 52-week year already splits unevenly: pair indices 0 and 1 land on 11 weeks each (weeks 1,6,…,51 and 2,7,…,52), while indices 2–4 land on only 10 weeks each. That's true every year, not only in a 53-week year — a 53-week year just adds one more hit to whichever index week 53 falls on. The sentence "so a 53-week year repeats one pair" reads as though evenness is the normal case and the leap week is the exception, which isn't what the arithmetic does.

Since this leaf explicitly wants the coverage line to record rotation fairness (## Output contract), the inaccurate premise could mislead whoever audits that coverage claim later. Consider rephrasing to state plainly that the 5-way split over a ~52-week year is inherently uneven (2 pairs get 11 hits, 3 get 10), independent of the 53rd-week case.

Fix this →

Comment on lines +77 to +88
enforcement surface since its own last run. The layer pair rotates on the ISO week number,
read with `date -u +%V`; the pair index is (ISO week − 1) mod 5:

| Pair index | Layers |
|---|---|
| 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` |

The rotation is stateless — a function of the week alone — so a 53-week year repeats one

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: the "53-week year" framing understates how uneven the rotation already is.

(ISO week − 1) mod 5 over an ordinary 52-week year already splits unevenly: pair indices 0 and 1 land on 11 weeks each (weeks 1,6,…,51 and 2,7,…,52), while indices 2–4 land on only 10 weeks each. That's true every year, not only in a 53-week year — a 53-week year just adds one more hit to whichever index week 53 falls on. The sentence "so a 53-week year repeats one pair" reads as though evenness is the normal case and the leap week is the exception, which isn't what the arithmetic does.

Since this leaf explicitly wants the coverage line to record rotation fairness (## Output contract), the inaccurate premise could mislead whoever audits that coverage claim later. Consider rephrasing to state plainly that the 5-way split over a ~52-week year is inherently uneven (2 pairs get 11 hits, 3 get 10), independent of the 53rd-week case.

[Fix this →](https://claude.ai/code?q=Fix%20the%20rotation-fairness%20claim%20in%20plugins%2Fautonomy%2Freference%2Froutines%2Fdrift-delta-sweep.md%20around%20lines%2088-89%20on%20branch%20feat%2F3819-drift-delta-sweep.%20The%20sentence%20%22The%20rotation%20is%20stateless%20%E2%80%94%20a%20function%20of%20the%20week%20alone%20%E2%80%94%20so%20a%2053-week%20year%20repeats%20one%20pair%2C%20which%20the%20coverage%20line%20records.%22%20incorrectly%20implies%20the%20mod-5%20pair%20rotation%20is%20even%20except%20in%2053-week%20years.%20In%20fact%20a%20plain%2052-week%20year%20already%20splits%20unevenly%3A%20pair%20indices%200%20and%201%20get%2011%20weeks%20each%2C%20indices%202-4%20get%2010%20weeks%20each%2C%20because%2052%20is%20not%20divisible%20by%205.%20Reword%20the%20sentence%20to%20state%20the%20uneven%205-way%20split%20plainly%20instead%20of%20attributing%20it%20only%20to%20the%2053rd%20week.">Fix this →

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Claude has reviewed this PR 1 time. The lane skips further automatic reviews after 5; deleting this comment resets the count.

@kyle-sexton kyle-sexton mentioned this pull request Sep 7, 2026
4 tasks
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.

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

1 participant