Skip to content

feat(session-close): detect self-improve-worthy signals (Phase 8.7)#41

Merged
bborbe merged 1 commit into
masterfrom
feature/self-improve-nudge
Jul 1, 2026
Merged

feat(session-close): detect self-improve-worthy signals (Phase 8.7)#41
bborbe merged 1 commit into
masterfrom
feature/self-improve-nudge

Conversation

@bborbe

@bborbe bborbe commented Jul 1, 2026

Copy link
Copy Markdown
Owner

What

Adds Phase 8.7 to /vault-cli:session-close — the friction-scoring sibling of Phase 8's reflect detection. When the session shows tooling friction, session-close now nudges /coding:self-improve, exactly the way it already nudges /vault-cli:reflect for knowledge.

Why

/coding:self-improve (just shipped in the coding plugin) reviews a session and proposes ≤2 durable improvements to commands/agents/rules. Without a nudge it rots unused — discoverability is the whole reason Phase 8 exists for reflect. This wires the parallel signal.

Design

  • Suggest-only, never auto-run — same contract as reflect (never auto-self-improve added to the Phase 9 guard).
  • Separate signal set: reflect = durable knowledge; self-improve = tooling friction (general corrections, repeated instructions, misfired commands, rule violations, uncovered manual workflows). Scored independently; threshold ≥ 3.
  • Phase 9 wiring: mode 2 broadened to "reflect and/or self-improve"; outstanding-list gains a parallel item.

Files

  • commands/session-close.md — Phase 8.7 + Phase 9 wiring + inline-description accuracy
  • CHANGELOG.md## Unreleased feat bullet

Depends on /coding:self-improve (bborbe/coding#64, merged).

Adds the friction-scoring sibling of Phase 8's reflect detection.
Scores general behavior corrections, repeated instructions, misfired
commands/agents, documented-rule violations, and manual multi-step
workflows with no command. At score >=3, surfaces a suggest-only
/coding:self-improve nudge in Phase 9 (mode 2 + outstanding list).
Never auto-runs -- mirrors the reflect contract. Reflect captures
durable knowledge; self-improve captures tooling friction.
@bborbe bborbe marked this pull request as ready for review July 1, 2026 15:43

@ben-s-pull-request-reviewer ben-s-pull-request-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I've completed the review. Here's my analysis:

Files changed (from the PR): CHANGELOG.md and commands/session-close.md

Key findings:

  1. ❌ CRITICAL — Version alignment violation: CHANGELOG.md has ## v0.94.0 at the top, but both .claude-plugin/plugin.json and .claude-plugin/marketplace.json still show "version": "0.93.0". Per CLAUDE.md, all four version strings MUST always equal. This will fail make precommit's check-versions.

  2. ✅ Phase 8.7 scoring threshold (score ≥ 3) — correctly implemented in lines 294–310. Five signals with weights (+2, +2, +1, +1, +1) and threshold ≥ 3.

  3. ✅ Reflect and self-improve are separate — Phase 8 (reflect, lines 207–228) and Phase 8.7 (self-improve, lines 294–310) score independently. No cross-contamination.

  4. ✅ Suggest-only contract upheld — Line 296: "suggest-only — never auto-run"; line 310: "Do NOT run /coding:self-improve from here. Only surface the suggestion."

  5. ✅ Mode 2 wording — Line 339: "reflect and/or self-improve signals fired" — correctly handles cases where only one fired.

  6. ✅ Mode 3 self-improve item — Line 362: correctly appended as a parallel outstanding item.

  7. ⚠️ No test coverage — Phase 8.7 scoring logic (signal weights + threshold) has no test file. This is a command/skill markdown file, not Go code, so it can't be unit-tested directly — the scoring behavior would only be verified via scenario testing.

{
  "verdict": "request-changes",
  "summary": "Phase 8.7 self-improve detection is correctly implemented with proper suggest-only contract and independent scoring. However, a critical version alignment violation must be fixed before merge: CHANGELOG.md declares v0.94.0 but plugin JSON files still show 0.93.0.",
  "comments": [
    {
      "file": "CHANGELOG.md",
      "line": 1,
      "severity": "critical",
      "message": "Version mismatch: CHANGELOG.md top entry is '## v0.94.0' but .claude-plugin/plugin.json and .claude-plugin/marketplace.json both show version '0.93.0'. These four version strings must match per CLAUDE.md MANDATORY version alignment. Update plugin.json and marketplace.json to '0.94.0' (both metadata.version and plugins[0].version), then run 'make precommit' to verify."
    },
    {
      "file": "commands/session-close.md",
      "line": 308,
      "severity": "minor",
      "message": "Phase 8.7 scoring logic has no test coverage. The five-signal weighted scoring (score ≥ 3 threshold) cannot be verified automatically. Consider scenario-testing the self-improve nudge output under various signal combinations, or adding a comment in the source noting this is tested via scenario/smoke tests only."
    }
  ],
  "concerns_addressed": [
    "correctness: Phase 8.7 scoring threshold is score >= 3 — correctly implemented in lines 294-310",
    "correctness: reflect and self-improve scored independently — separate phases with no cross-contamination (Phase 8 vs 8.7)",
    "security: design contract suggest-only, never auto-run — confirmed at lines 296 and 310",
    "security: never auto-self-improve guard — confirmed, Phase 9 only surfaces the suggestion, never invokes it",
    "correctness: Phase 9 mode 2 wording 'reflect and/or self-improve' — correctly handles partial signals at line 339",
    "correctness: mode 3 outstanding list self-improve item — correctly appended at line 362",
    "tests: no test files modified — Phase 8.7 is command markdown (not testable via unit tests); scoring verified via doc review"
  ]
}

@bborbe bborbe merged commit 8812aec into master Jul 1, 2026
1 check passed
@bborbe bborbe deleted the feature/self-improve-nudge branch July 1, 2026 15:48
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.

1 participant