Skip to content

feat(ci-loop): macro promotion + direction-guard digest in /improve --auto-file #1201

@akaszubski

Description

@akaszubski

Summary

Implement threshold-based promotion of recurring cross-session findings into GitHub issues within /improve --auto-file, replacing per-finding filing with macro-granularity issue creation. Add a digest artifact as the human direction-guard checkpoint.

Implementation Approach

Modify plugins/autonomous-dev/commands/improve.md STEP 5 (line 141):

  1. Call collect_cia_findings(findings_dir=<project_root>/.claude/logs/findings, window=90d) — findings_dir from git rev-parse --show-toplevel, never relative CWD
  2. Promote when (freq >= 3 AND distinct_sessions >= 2) OR (severity == error AND freq >= 2) — config constants with explicit re-evaluation gate after first 2 digest reviews
  3. Per promotion: match open issues via issue_triage_analyzer.cluster_within_tag → APPEND evidence comment if matched, else CREATE one root-cause issue with accumulated cross-session evidence
  4. Emit DIGEST: promoted/appended/held/expired counts; recurrence-after-close (finding matching CLOSED issue cluster = loud "fix didn't stick" line); match-rate alarm (<50% matched while open auto-improvement >20); findings-per-session compliance alarm (0 vs ~5 baseline = CIA emission failure); error-without-other-channel line

Tests in tests/regression/test_macro_promotion.py (7): threshold logic, append-vs-create routing, CIA-prompt-zero-filing assertion, digest required fields, recurrence-after-close, match-rate alarm, findings-per-session alarm.

Acceptance Criteria

  • /improve --auto-file promotes only threshold-crossing clusters, never per-finding
  • Promoted issues born with >=3 cross-session evidence entries (or error + >=2 freq)
  • Matched open issues receive APPEND comment instead of duplicate CREATE
  • DIGEST contains all 5 metric/alarm lines
  • Recurrence-after-close measurable in every digest
  • Thresholds documented as config constants with re-evaluation gate
  • All 7 regression tests pass

Part of macro-first plan (.claude/plans/macro-first-continuous-improvement.md). Depends on the signal-capture issue (#1200). Note: CREATE path depends on the gh-filing diagnostic issue; APPEND via gh issue comment is not blocked.
Plugin Version: 3.50.0 (c41558b)

Metadata

Metadata

Assignees

No one assigned

    Labels

    auto-improvementContinuous improvement analyst findingsenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions