buildlog 0.8.0__py3-none-any.whl → 0.10.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. buildlog/cli.py +491 -30
  2. buildlog/constants.py +121 -0
  3. buildlog/core/__init__.py +44 -0
  4. buildlog/core/operations.py +1189 -13
  5. buildlog/data/seeds/bragi.yaml +61 -0
  6. buildlog/llm.py +51 -4
  7. buildlog/mcp/__init__.py +51 -3
  8. buildlog/mcp/server.py +40 -0
  9. buildlog/mcp/tools.py +526 -12
  10. buildlog/seed_engine/__init__.py +2 -0
  11. buildlog/seed_engine/llm_extractor.py +121 -0
  12. buildlog/seed_engine/pipeline.py +45 -1
  13. {buildlog-0.8.0.data → buildlog-0.10.0.data}/data/share/buildlog/post_gen.py +10 -5
  14. buildlog-0.10.0.data/data/share/buildlog/template/buildlog/.gitkeep +0 -0
  15. buildlog-0.10.0.data/data/share/buildlog/template/buildlog/assets/.gitkeep +0 -0
  16. buildlog-0.10.0.dist-info/METADATA +248 -0
  17. {buildlog-0.8.0.dist-info → buildlog-0.10.0.dist-info}/RECORD +27 -22
  18. buildlog-0.8.0.dist-info/METADATA +0 -151
  19. {buildlog-0.8.0.data → buildlog-0.10.0.data}/data/share/buildlog/copier.yml +0 -0
  20. {buildlog-0.8.0.data/data/share/buildlog/template/buildlog → buildlog-0.10.0.data/data/share/buildlog/template/buildlog/.buildlog}/.gitkeep +0 -0
  21. {buildlog-0.8.0.data/data/share/buildlog/template/buildlog/assets → buildlog-0.10.0.data/data/share/buildlog/template/buildlog/.buildlog/seeds}/.gitkeep +0 -0
  22. {buildlog-0.8.0.data → buildlog-0.10.0.data}/data/share/buildlog/template/buildlog/2026-01-01-example.md +0 -0
  23. {buildlog-0.8.0.data → buildlog-0.10.0.data}/data/share/buildlog/template/buildlog/BUILDLOG_SYSTEM.md +0 -0
  24. {buildlog-0.8.0.data → buildlog-0.10.0.data}/data/share/buildlog/template/buildlog/_TEMPLATE.md +0 -0
  25. {buildlog-0.8.0.data → buildlog-0.10.0.data}/data/share/buildlog/template/buildlog/_TEMPLATE_QUICK.md +0 -0
  26. {buildlog-0.8.0.dist-info → buildlog-0.10.0.dist-info}/WHEEL +0 -0
  27. {buildlog-0.8.0.dist-info → buildlog-0.10.0.dist-info}/entry_points.txt +0 -0
  28. {buildlog-0.8.0.dist-info → buildlog-0.10.0.dist-info}/licenses/LICENSE +0 -0
buildlog/constants.py ADDED
@@ -0,0 +1,121 @@
1
+ """Shared constants for buildlog, including the CLAUDE.md integration section."""
2
+
3
+ CLAUDE_MD_BUILDLOG_SECTION = """
4
+ ## buildlog Integration
5
+
6
+ buildlog is configured as an MCP server. Use the tools below to maintain
7
+ a learning loop: write entries, extract skills, run gauntlet reviews, and
8
+ track experiments.
9
+
10
+ ### Always On: Commit -> Gauntlet -> Learn Loop
11
+
12
+ After every significant commit or feature completion:
13
+
14
+ 1. **Create/update entry**: `buildlog_entry_new(slug="what-you-built")`
15
+ 2. **Run gauntlet review**: `buildlog_gauntlet_rules()` to load rules, then review code against them
16
+ 3. **Process findings**: `buildlog_gauntlet_issues(issues=[...])` to categorize and persist learnings
17
+ 4. **Fix criticals/majors**, re-run until clean or accept risk: `buildlog_gauntlet_accept_risk(remaining_issues=[...])`
18
+ 5. **Log reward**: `buildlog_log_reward(outcome="accepted")` when work is approved
19
+
20
+ ### Skill Extraction & Promotion Workflow
21
+
22
+ 1. `buildlog_status()` — see extracted skills by category
23
+ 2. `buildlog_diff()` — see skills pending review
24
+ 3. `buildlog_promote(skill_ids=[...], target="claude_md")` — surface to agent rules
25
+ 4. `buildlog_reject(skill_ids=[...])` — mark false positives
26
+
27
+ ### Gauntlet Review Loop Workflow
28
+
29
+ 1. `buildlog_gauntlet_rules()` — load reviewer persona rules
30
+ 2. Review code against rules, collect issues
31
+ 3. `buildlog_gauntlet_issues(issues=[...])` — categorize, persist learnings, get next action
32
+ 4. If action="fix_criticals": fix and re-run
33
+ 5. If action="checkpoint_majors"/"checkpoint_minors": ask user
34
+ 6. `buildlog_gauntlet_accept_risk(remaining_issues=[...])` — accept remaining
35
+ 7. `buildlog_learn_from_review(issues=[...])` — persist learnings
36
+
37
+ ### Reward Signal / Thompson Sampling Workflow
38
+
39
+ 1. `buildlog_log_reward(outcome="accepted"|"revision"|"rejected")` — explicit feedback
40
+ 2. `buildlog_rewards()` — view reward history and statistics
41
+ 3. `buildlog_bandit_status()` — see which rules the bandit favors
42
+
43
+ ### Session Tracking & Experiment Workflow
44
+
45
+ 1. `buildlog_experiment_start(error_class="missing_test")` — begin tracked session
46
+ 2. `buildlog_log_mistake(error_class="...", description="...")` — log mistakes
47
+ 3. `buildlog_experiment_end()` — end session, calculate metrics
48
+ 4. `buildlog_experiment_metrics()` — per-session or aggregate stats
49
+ 5. `buildlog_experiment_report()` — comprehensive report
50
+
51
+ ### Tool Reference (29 tools)
52
+
53
+ **Commit & Entries:**
54
+ - `buildlog_commit(message, git_args, slug, no_entry)` — git commit with auto buildlog entry
55
+ - `buildlog_entry_new(slug, entry_date, quick)` — create entry
56
+ - `buildlog_entry_list()` — list all entries
57
+ - `buildlog_overview()` — project state at a glance
58
+
59
+ **Skill Management:**
60
+ - `buildlog_status(min_confidence="low")` — extracted skills
61
+ - `buildlog_promote(skill_ids, target="claude_md")` — promote to agent rules
62
+ - `buildlog_reject(skill_ids)` — reject false positives
63
+ - `buildlog_diff()` — pending skills
64
+ - `buildlog_distill(since, category)` — extract patterns from entries
65
+ - `buildlog_skills(since, min_frequency)` — generate skill set from entries
66
+ - `buildlog_stats(since, detailed)` — buildlog statistics and insights
67
+
68
+ **Gauntlet Review:**
69
+ - `buildlog_gauntlet_prompt(target, personas)` — generate review prompt with rules
70
+ - `buildlog_gauntlet_loop(target, personas, max_iterations, stop_at, auto_gh_issues)` — full loop config
71
+ - `buildlog_gauntlet_rules(persona, format)` — load reviewer rules
72
+ - `buildlog_gauntlet_issues(issues, iteration)` — process findings
73
+ - `buildlog_gauntlet_accept_risk(remaining_issues)` — accept risk
74
+ - `buildlog_gauntlet_list_personas()` — list available reviewer personas
75
+ - `buildlog_gauntlet_generate(source_text, persona, dry_run)` — generate rules from source text
76
+
77
+ **Review Learning:**
78
+ - `buildlog_learn_from_review(issues, source)` — persist review learnings
79
+
80
+ **Reward & Bandit:**
81
+ - `buildlog_log_reward(outcome, rules_active)` — log feedback
82
+ - `buildlog_rewards(limit)` — reward history
83
+ - `buildlog_bandit_status(context)` — bandit state
84
+
85
+ **Experiments:**
86
+ - `buildlog_experiment_start(error_class)` — start session
87
+ - `buildlog_experiment_end()` — end session
88
+ - `buildlog_log_mistake(error_class, description)` — log mistake
89
+ - `buildlog_experiment_metrics(session_id)` — metrics
90
+ - `buildlog_experiment_report()` — full report
91
+
92
+ **Project Setup:**
93
+ - `buildlog_init(no_mcp, no_claude_md)` — initialize buildlog in project
94
+ - `buildlog_update()` — update buildlog template to latest
95
+
96
+ ### When to Use Each Tool
97
+
98
+ - **At session start**: `buildlog_overview()` for context
99
+ - **During active dev**: `buildlog_entry_new()` to document work
100
+ - **After commits**: `buildlog_commit()` or `buildlog_gauntlet_prompt()` + review + `buildlog_gauntlet_issues()`
101
+ - **After review approval**: `buildlog_log_reward(outcome="accepted")`
102
+ - **For learning**: `buildlog_distill()`, `buildlog_skills()`, `buildlog_stats()`
103
+ - **For skill promotion**: `buildlog_status()` -> `buildlog_diff()` -> `buildlog_promote()`
104
+ - **To accept risk**: `buildlog_gauntlet_accept_risk()`
105
+ - **For experiments**: `buildlog_experiment_start()` -> work -> `buildlog_experiment_end()`
106
+
107
+ ### Integration with Commits
108
+
109
+ `buildlog commit -m "message"` wraps git commit and auto-logs to today's entry.
110
+
111
+ ### Reference Files
112
+
113
+ - `buildlog/.buildlog/promoted.json` — promoted skill IDs
114
+ - `buildlog/.buildlog/rejected.json` — rejected skill IDs
115
+ - `buildlog/.buildlog/review_learnings.json` — review-based learnings
116
+ - `buildlog/.buildlog/reward_events.jsonl` — reward signals
117
+ - `buildlog/.buildlog/sessions.jsonl` — session tracking
118
+ - `buildlog/.buildlog/mistakes.jsonl` — mistake tracking
119
+ - `buildlog/.buildlog/active_session.json` — current session
120
+ - `buildlog/bandit_state.jsonl` — Thompson Sampling state
121
+ """
buildlog/core/__init__.py CHANGED
@@ -1,14 +1,23 @@
1
1
  """Core operations for buildlog skill management."""
2
2
 
3
3
  from buildlog.core.operations import (
4
+ CommitResult,
5
+ CreateEntryResult,
4
6
  DiffResult,
5
7
  EndSessionResult,
6
8
  GauntletAcceptRiskResult,
9
+ GauntletGenerateResult,
10
+ GauntletLoopConfigResult,
7
11
  GauntletLoopResult,
12
+ GauntletPromptResult,
13
+ GauntletRulesResult,
14
+ InitResult,
8
15
  LearnFromReviewResult,
16
+ ListEntriesResult,
9
17
  LogMistakeResult,
10
18
  LogRewardResult,
11
19
  Mistake,
20
+ OverviewResult,
12
21
  PromoteResult,
13
22
  RejectResult,
14
23
  ReviewIssue,
@@ -19,22 +28,33 @@ from buildlog.core.operations import (
19
28
  SessionMetrics,
20
29
  StartSessionResult,
21
30
  StatusResult,
31
+ UpdateResult,
32
+ commit,
33
+ create_entry,
22
34
  diff,
23
35
  end_session,
24
36
  find_skills_by_ids,
25
37
  gauntlet_accept_risk,
38
+ gauntlet_generate,
39
+ gauntlet_loop_config,
26
40
  gauntlet_process_issues,
41
+ generate_gauntlet_prompt,
27
42
  get_bandit_status,
28
43
  get_experiment_report,
44
+ get_gauntlet_rules,
45
+ get_overview,
29
46
  get_rewards,
30
47
  get_session_metrics,
48
+ init_buildlog,
31
49
  learn_from_review,
50
+ list_entries,
32
51
  log_mistake,
33
52
  log_reward,
34
53
  promote,
35
54
  reject,
36
55
  start_session,
37
56
  status,
57
+ update_buildlog,
38
58
  )
39
59
 
40
60
  __all__ = [
@@ -58,6 +78,11 @@ __all__ = [
58
78
  # Gauntlet loop
59
79
  "GauntletLoopResult",
60
80
  "GauntletAcceptRiskResult",
81
+ # Entry & overview
82
+ "GauntletRulesResult",
83
+ "OverviewResult",
84
+ "CreateEntryResult",
85
+ "ListEntriesResult",
61
86
  "status",
62
87
  "promote",
63
88
  "reject",
@@ -76,4 +101,23 @@ __all__ = [
76
101
  # Gauntlet loop operations
77
102
  "gauntlet_process_issues",
78
103
  "gauntlet_accept_risk",
104
+ # Entry & overview operations
105
+ "get_gauntlet_rules",
106
+ "get_overview",
107
+ "create_entry",
108
+ "list_entries",
109
+ # P0: Gauntlet loop
110
+ "CommitResult",
111
+ "GauntletPromptResult",
112
+ "GauntletLoopConfigResult",
113
+ "commit",
114
+ "generate_gauntlet_prompt",
115
+ "gauntlet_loop_config",
116
+ # P2: Nice-to-have
117
+ "GauntletGenerateResult",
118
+ "InitResult",
119
+ "UpdateResult",
120
+ "gauntlet_generate",
121
+ "init_buildlog",
122
+ "update_buildlog",
79
123
  ]