feat(session-close): detect self-improve-worthy signals (Phase 8.7)#41
Conversation
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.
There was a problem hiding this comment.
I've completed the review. Here's my analysis:
Files changed (from the PR): CHANGELOG.md and commands/session-close.md
Key findings:
-
❌ CRITICAL — Version alignment violation:
CHANGELOG.mdhas## v0.94.0at the top, but both.claude-plugin/plugin.jsonand.claude-plugin/marketplace.jsonstill show"version": "0.93.0". Per CLAUDE.md, all four version strings MUST always equal. This will failmake precommit'scheck-versions. -
✅ 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.
-
✅ 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.
-
✅ Suggest-only contract upheld — Line 296: "suggest-only — never auto-run"; line 310: "Do NOT run
/coding:self-improvefrom here. Only surface the suggestion." -
✅ Mode 2 wording — Line 339: "reflect and/or self-improve signals fired" — correctly handles cases where only one fired.
-
✅ Mode 3 self-improve item — Line 362: correctly appended as a parallel outstanding item.
-
⚠️ 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"
]
}
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:reflectfor 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
never auto-self-improveadded to the Phase 9 guard).Files
commands/session-close.md— Phase 8.7 + Phase 9 wiring + inline-description accuracyCHANGELOG.md—## Unreleasedfeat bulletDepends on
/coding:self-improve(bborbe/coding#64, merged).