Skip to content

LEAN_SCRIPTS/LEAN_TESTS duplicated between sync_plugin.py and claims_audit.py — single source of truth #74

Description

@wesleysimplicio

Single source of truth for the lean mirror sets — LEAN_SCRIPTS/LEAN_TESTS duplicated between sync_plugin.py and claims_audit.py

Problem

The "lean set" (which scripts/tests ship into the plugin/ and simplicio_loop/_bundle/ mirrors) is hard-coded twice: in scripts/sync_plugin.py and again in scripts/claims_audit.py. Editing one and forgetting the other makes the two mirror checks silently disagree — the syncer copies one set, the auditor validates another, and drift passes the gate.

Evidence

  • scripts/sync_plugin.py:45-47LEAN_SCRIPTS (hierarchical_planner, cross_agent_wiki), LEAN_TESTS (_selfrun, test_loop_e2e, test_cross_agent_wiki).
  • scripts/claims_audit.py:142,145 — the same names independently hard-coded for the parity checks.

Failure scenario

Add a third runtime script to the bundle by editing sync_plugin.py only → sync_plugin copies it, claims_audit check 4/5 never validates it → a later stale copy of that script ships in the wheel while the gate stays green (compounds with the one-directional bundle-parity issue).

Proposed fix

Extract one constant module (e.g. scripts/mirror_manifest.py or a small MIRROR_MANIFEST dict importable by both) declaring: lean scripts, lean tests, hook lean set, and the mirrored subtrees. sync_plugin.py and claims_audit.py both import it. Add a test asserting both consumers resolve identical sets (trivially true after the refactor, but pins the contract against future re-duplication).

Acceptance criteria

  • One declaration of the lean sets, imported by both sync_plugin.py and claims_audit.py.
  • Behavior identical: python3 scripts/sync_plugin.py --check and python3 scripts/check.py green with no mirror changes.
  • Contract test present.

Metadata

Metadata

Assignees

No one assigned

    Labels

    qualityQuality gates / verification

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions