Move the audit-sessions epoch, positive-int and store-dir helpers into census.py

Aperta Adatta ai principianti
#15,539 5 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
76/100
Tipo di issue
Refactoring
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python, shell
Ambito
tooling

Direzione di ricerca

Inizia da plugins/session-flow/skills/audit-sessions/scripts/census.py, poi esamina le definizioni degli helper indicati e i relativi punti di chiamata in collect.py, friction_scan.py, sweep.py e audit-friction/scripts/friction.py. Mantieni il tipo argparse condiviso denominato _positive affinché il testo dell’errore CLI resti identico e conserva census.store_dir invariato. Il lavoro è completato quando ogni helper compare una sola volta in census.py, gli script li usano, gli import inutilizzati sono rimossi e viene aggiunto il frammento di patch richiesto.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Agent Brief

Type: Task
Summary: Move the audit-sessions epoch and positive-int helpers into census.py and drop the duplicate store_dir (part of restructuring pass #14802).

Current behavior:

  • _epoch is defined three times: plugins/session-flow/skills/audit-sessions/scripts/collect.py:183-190, friction_scan.py:85-92 and sweep.py:595-602.
  • The argparse type _positive is defined three times: collect.py:1010-1014, sweep.py:699-703 and plugins/session-flow/skills/audit-friction/scripts/friction.py:614-618.
  • store_dir is defined in census.py:69-70 and again in collect.py:167-168.

All four scripts already import census.

Desired behavior:
census.py holds one epoch helper and one positive-int argparse type, and the four scripts call them in place of their copies. collect.py calls census.store_dir and its own store_dir is deleted. Imports left unused are dropped.

Files:

  • plugins/session-flow/skills/audit-sessions/scripts/census.py
  • plugins/session-flow/skills/audit-sessions/scripts/collect.py
  • plugins/session-flow/skills/audit-sessions/scripts/friction_scan.py
  • plugins/session-flow/skills/audit-sessions/scripts/sweep.py
  • plugins/session-flow/skills/audit-friction/scripts/friction.py
  • a new patch fragment in .changes/session-flow/: ### Changed, "Internal restructuring, no behavior change."

Key interfaces:

  • argparse names the type function in its error for a non-integer value (invalid _positive value: 'abc'), so the shared type's __name__ stays _positive and every CLI's error text stays byte-identical.
  • census.store_dir is unchanged.

Acceptance criteria:

  • The epoch helper, the positive-int type and store_dir each exist once, in census.py, and the four scripts use them.
  • Behavior is unchanged: the same outputs, exit codes and printed results for the same inputs, including argparse errors.
  • 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 and 15 hand-edited files.
  • scripts/run-ruff.sh check passes on the changed files.
  • The pytest suites in audit-sessions/scripts/tests/ and audit-friction/scripts/, and audit-friction.test.sh, pass.
  • ci-status is green.

Out of scope:

  • Other session-flow helpers, other duplication, eval cases, fixtures, and skill and agent text.
Lingua principale
Shell
Stelle
22
Fork
2
Merge medio
1h 18m
PR unite (30g)
975

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di melodic-software/claude-code-plugins

Tutte le issue di melodic-software/claude-code-plugins

Issue simili

Altre issue su Shell/Bash

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.