Skip to content

Generate the plugin-cache-versions reader copies from lib/ #15685

Description

@kyle-sexton

Agent Brief

Type: Task
Summary: Move the plugin-cache-version reader that harness-ops and disk-hygiene keep identical by hand into lib/, so scripts/sync-shared-copies.sh generates both plugin copies (part of restructuring pass #14622).

Current behavior:
plugins/harness-ops/lib/plugin_cache_versions.py and plugins/disk-hygiene/lib/plugin_cache_versions.py are kept byte-identical by hand; both are blob 1bb33df4, 110 lines. scripts/cross-plugin-source-registry.txt:586-591 registers them with "No dedicated check", names the harness-ops file as the canonical, and says to "copy it into plugins/disk-hygiene/lib/ to fix a drift failure". The module's docstring says it "is carried byte-identical by every plugin that uses it" (:13-14). Each caller imports it by module name from its own plugin's lib/: plugins/harness-ops/skills/audit-install-state/scripts/install_state.py:48-52 and plugins/disk-hygiene/skills/clean/scripts/deep_inventory.py:41-45.

Desired behavior:
The canonical moves with git mv to lib/plugin_cache_versions.py, so history follows it. Two rows in scripts/shared-copies.txt, lib/plugin_cache_versions.py plugins/harness-ops/lib/plugin_cache_versions.py and the same for plugins/disk-hygiene/lib/, register both copies, and scripts/sync-shared-copies.sh regenerates them at their current paths. Each copy differs from the canonical only by the 2-line GENERATED header before the docstring, the .py form at plugins/harness-ops/lib/spawn_noise.py:1-2 (rows scripts/shared-copies.txt:21-22). The registry entry (:586-591) says "Dedicated check: scripts/sync-shared-copies.sh --check" and gains the cluster line lib/plugin_cache_versions.py -> plugins/*/lib/plugin_cache_versions.py, as lib/spawn_noise.py has (:183-188). The docstring sentence at :13-14 says the plugin copies are generated from lib/plugin_cache_versions.py.

Dependencies: this item appends to scripts/shared-copies.txt; if another change appending there lands first, rebase on it.

Files:

  • lib/plugin_cache_versions.py (moved from plugins/harness-ops/lib/; docstring sentence only)
  • scripts/shared-copies.txt
  • scripts/cross-plugin-source-registry.txt
  • plugins/harness-ops/lib/plugin_cache_versions.py (generated)
  • plugins/disk-hygiene/lib/plugin_cache_versions.py (generated)
  • a new patch fragment in .changes/harness-ops/ and one in .changes/disk-hygiene/: ### Changed, "Internal restructuring, no behavior change."

Key interfaces:

  • Both callers keep importing the copy in their own plugin's lib/ at its current path, and the module's code, names and return values are unchanged.
  • No canonical stays inside a plugin: a canonical without a header beside a copy with one would read as drifted.
  • plugins/harness-ops/skills/audit-install-state/SKILL.md:177-178 and plugins/disk-hygiene/skills/clean/reference/scan-flags.md:83 name the plugin-relative path, which does not move, and the two plugin copies stay identical to each other; neither file changes.

Acceptance criteria:

  • The canonical lives at lib/plugin_cache_versions.py, both plugin copies are generated by scripts/sync-shared-copies.sh, and the registry entry names that check.
  • Behavior is unchanged: the same outputs, exit codes and printed results for the same inputs.
  • The diff edits only the listed files and the lines of a test that assert on them when the change breaks that assertion.
  • The pull request stays within 400 changed lines, not counting the moved canonical and regenerated copies, and 15 hand-edited files.
  • scripts/sync-shared-copies.sh --check and scripts/check-cross-plugin-source-drift.sh --check pass.
  • plugins/harness-ops/skills/audit-install-state/scripts/install_state.test.sh and plugins/disk-hygiene/skills/clean/scripts/deep_inventory.test.sh pass.
  • ci-status is green.

Out of scope:

  • The module's code, the callers, test code and assertions, other duplication, eval cases, fixtures, and skill and agent text.

Activity

  1. added
    status: ready
    on Nov 12, 2026
  2. added theissue type on Nov 12, 2026
  3. removed
    status: ready
    on Nov 12, 2026
  4. melodic-automation-lanes commented on Nov 12, 2026

    @melodic-automation-lanes
    Contributor

    {"v":1,"actor_id":337595936,"title_sha256":"1d23d629952ce5b6f11691622fb2050fa4ad912fafc08a50286fba0d8016b34d","body_sha256":"7e09688941e4aa49a69349aab4cb3ca1d861f33098f8a5312a2749b11e1230cf"}

  5. github-actions commented on Nov 12, 2026

    @github-actions
    Contributor
    No description provided.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    Work status

    needs-triage

    Priority

    low

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions