Skip to content

fix: self-learning system — thresholds, single toggle, frontmatter, --reset#173

Merged
dean0x merged 2 commits intomainfrom
fix/self-learning-system
Apr 6, 2026
Merged

fix: self-learning system — thresholds, single toggle, frontmatter, --reset#173
dean0x merged 2 commits intomainfrom
fix/self-learning-system

Conversation

@dean0x
Copy link
Copy Markdown
Owner

@dean0x dean0x commented Apr 6, 2026

Summary

  • Raise promotion thresholds from 3 observations/24h to 5 observations/7-day spread — prevents premature artifact creation from short work bursts
  • Single on/off toggle — hook presence in settings.json is the ONLY control, removed dual-state enabled field from learning.json
  • Fix duplicate frontmatterstripLeadingFrontmatter() in json-helper.cjs + no-frontmatter prompt instruction (belt-and-suspenders)
  • Add devflow learn --reset — removes all self-learning artifacts + log + transient state with confirmation prompt
  • Prompt quality tweaks — quality rules section, body-only templates, project-specific focus
  • Cleanup — removed 7 stale skills + 2 commands + learning log from this project

Test plan

  • Build passes (39 skills, 11 agents, 17 plugins)
  • Tests pass (601/601 — 9 new tests added by self-review)
  • Confidence formula verified: count=4→0.80, count=5→0.95 with REQUIRED_OBSERVATIONS=5
  • Temporal spread: 7-day requirement enforced in process-observations
  • stripLeadingFrontmatter handles edge cases (no frontmatter, nested dashes, empty)
  • --reset confirms before deleting, acquires lock, releases on all paths
  • session-end-learning defaults gracefully when learning.json missing
  • No dual-state leak: --enable/--disable/--configure/init never write enabled to config

Dean Sharon added 2 commits April 6, 2026 09:47
- Extract magic number 0.33 into INITIAL_CONFIDENCE constant in json-helper.cjs
- Fix inaccurate SYNC comment in learn.ts (batch_size is not in background-learning)
- Add tests for stripLeadingFrontmatter via create-artifacts (duplicate frontmatter bug fix)
- Add tests for cleanSelfLearningArtifacts (new learning-cleanup.ts utility)
…-reset

- Raise promotion thresholds: 5 observations + 7-day spread (was 3/24h)
- Single on/off toggle: hook presence in settings.json only (no learning.json enabled field)
- Fix duplicate frontmatter: stripLeadingFrontmatter + no-frontmatter prompt instruction
- Add `devflow learn --reset` for artifact + log + state cleanup
- Add quality rules to background-learning prompt
- Update CLAUDE.md to reflect new thresholds and mechanism
- Remove existing self-learning artifacts from this project
- New shared utility: learning-cleanup.ts
@dean0x dean0x merged commit 8e3750b into main Apr 6, 2026
4 checks passed
@dean0x dean0x deleted the fix/self-learning-system branch April 6, 2026 07:01
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