B6: config + doctor + init + self-update (+ v0.6.16 PATH probe carry-forward) - #125
Conversation
|
Claude finished @thrillmot's task in 3m 55s —— View job 🐛 Clud Bug reviewThis round: 1 critical · 1 minor · 0 resolved from prior · 0 still open Found: 1 🔴 / 1 🟡 / 0 🟣 Per-skill scan
🔴 [critical-issues-only]: Non-atomic write in Reasoning
🟡 [evidence-based-review]: ReasoningThe 2-second context timeout bounds wall-clock time, not bytes — a fast connection to a misbehaving server can buffer many MB before the timer fires. Wrapping the body with Skills referenced: [critical-issues-only, evidence-based-review, respect-existing-conventions] |
🐛 Clud Bug reviewThis round: 1 critical · 1 minor · 0 resolved from prior · 0 still open Found: 1 🔴 / 1 🟡 / 0 🟣 Per-skill scan
Critical findings🔴 [critical-issues-only]: SaveMap truncates config file before write completes — any I/O error leaves config empty (internal/config/config.go:232). Reasoning
Minor findings🟡 [evidence-based-review]: httpGetJSON reads unbounded response body — a fast connection can buffer many MB before the 2s context fires (internal/doctor/doctor.go:139). Reasoning
Skills referenced: [critical-issues-only, evidence-based-review, respect-existing-conventions] |
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
|
Claude finished @thrillmot's task in 2m 5s —— View job Review complete
SummaryThe two new commits ( No new issues introduced by the new commits. |
…ous scoped missed them)
|
Claude finished @thrillmot's task in 1m 49s —— View job Review complete
The three new commits after the original B6 commit are test-determinism fixes ( No new issues introduced. |
🐛 Clud Bug reviewThis round: 0 critical · 0 minor · 0 resolved from prior · 2 still open Found: 0 🔴 / 0 🟡 / 0 🟣 Per-skill scan
Skills referenced: [critical-issues-only, evidence-based-review, respect-existing-conventions] |
|
Claude finished @thrillmot's task in 1m 38s —— View job Review (fix-push)
Both prior issues are fixed cleanly. No new issues introduced by commit |
🐛 Clud Bug reviewThis round: 0 critical · 0 minor · 2 resolved from prior · 0 still open Found: 0 🔴 / 0 🟡 / 0 🟣 Per-skill scan
Skills referenced: [critical-issues-only, evidence-based-review, respect-existing-conventions] |
Status after second pushGo tests pass on all 3 matrices (ubuntu/macos × go1.22/1.24). The 6 pytest failures are pre-existing — same set fails on clud-bug findings addressed in commit
Both threads auto-resolved after the second clud-bug review pass. |
Workflow-template audit tests substitute `__version__` into expected pip-install pin; main is at 0.6.16, this branch was at 0.6.14, all 3 audit-test assertions fail pre-existingly on every Go PR opened against v1-go-rewrite (B5 #124, B6 #125, future waves). 20/20 tests in `tests/test_v0_2_1_audit_fixes.py` pass locally with the bump. Once merged, re-running CI on B5 #124 + B6 #125 unblocks both for auto-merge. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: thrillmot <thrillmot@users.noreply.github.com>
# Conflicts: # .claude/worktrees/agent-a6c88d2dd73054cdc # docs/file-structure.md # docs/timeline.md
|
Claude finished @thrillmot's task in 1m 22s —— View job Review (fix-push)
The two new commits after the last review pass are purely a Python version bump rebase ( |
🐛 Clud Bug reviewThis round: 0 critical · 0 minor · 0 resolved from prior · 0 still open Found: 0 🔴 / 0 🟡 / 0 🟣 Per-skill scan
Skills referenced: [critical-issues-only, evidence-based-review, respect-existing-conventions] |
# Conflicts: # docs/file-structure.md # docs/timeline.md # internal/cli/root.go
|
Claude finished @thrillmot's task in 4m 2s —— View job Review (fix-push)
The two new commits merge the B5 skill CLI into B6: |
🐛 Clud Bug reviewThis round: 0 critical · 0 minor · 0 resolved from prior · 0 still open Found: 0 🔴 / 0 🟡 / 0 🟣 Per-skill scan
Skills referenced: [critical-issues-only, evidence-based-review, respect-existing-conventions] |
Carries the v0.6.16 Python release's B2/B3/B4 deltas into the Go rewrite so the Go binary has byte-identical parity with Python v0.6.16. B6 (PR #125) already shipped the PATH probe + commit-msg hook — this PR addresses the three remaining waves. ## Summary - **B2 (post-merge hook body)** — Go body absorbs the v0.6.16 HEAD-vs-origin skip block that replaced v0.6.15's blanket default-branch skip. Local merges that introduce new commits (multi-branch self-heal case) now correctly trigger regen instead of being silently skipped. Byte-identical to Python via `TestPostMergeBody_ByteIdenticalToPython`. - **B3 (multi-branch self-heal regression tests)** — New `internal/timeline/merge_driver_test.go` ports the three v0.6.16 Python tests: - `TestMergeDriverSelfHealsTwoConcurrentBranches` - `TestMergeDriverSelfHealsThreeConcurrentBranches` - `TestMergeDriverSelfHealsSquashMerge` All three use `exec.Command` against real `git` + `logmind` binaries (no mocks). Gated by `//go:build integration` since the merge driver shells out to `logmind`. CI must install the binary first: `go install ./cmd/logmind && go test -tags=integration ./internal/timeline/...`. - **B4 (AGENTS.md templates)** — Embedded full template bumped v5→v6 + slim variant v7-pointer→v8-pointer with REQUIRED-framing heading + DO-NOT-git-commit blockquote that pairs with the v0.6.16 commit-msg hook. `inserter.matchingTemplate` accepts both old and new markers so existing repos refresh into the new body without manual intervention. ## Cross-binary parity contract Python source-of-truth files (`src/logmind/core/gitattributes.py`, `src/logmind/templates/AGENTS.md.template`, `src/logmind/templates/AGENTS.md.slim.template`) on this branch were also overwritten with v0.6.16 content so the existing byte-identical-to-Python parity tests can compare against the same shape. Without this the parity helpers (`TestPostMergeBody_ByteIdenticalToPython`, `TestTemplates_ByteIdenticalToPython`) would fail because they shell to in-tree `src/logmind`. ## Verification ```bash go test ./... PYENV_VERSION=3.11.8 go test -tags=integration ./internal/timeline/... ``` All Go tests green. ## Subtle gotcha: PYENV_VERSION must propagate into git hooks The integration tests need every subprocess to inherit `PYENV_VERSION` so git's post-merge hook resolves `logmind` to the right Python binary. Without it, the pyenv shim resolves to "system" Python which may have an older `logmind` installed locally (observed 0.3.4) → hook regen produces wrong format → assertions fail. Documented in the `testEnv()` helper's doc comment. ## Test plan - [x] Unit tests pass: `go test ./...` - [x] Integration tests pass: `PYENV_VERSION=3.11.8 go test -tags=integration ./internal/timeline/...` - [x] Post-merge hook body byte-identical vs Python v0.6.16 - [x] AGENTS.md templates byte-identical vs Python v0.6.16 - [ ] Cross-binary diff harness deferred until B6 (#125) merges and Go `init` command exists 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: thrillmot <thrillmot@users.noreply.github.com>
Summary
Wave B6 lands the foundation that makes
brew install logmind && logmind inita working install. Replaces the pip-distribution path with four Go-native commands.Commands shipped
logmind config list | get <key> | set <key> <value>— reads/writes.logmind/config.ymlwith dot-notation paths + Python-style type coercion (true/false→ bool, digits → int, etc.). Insertion-ordered YAML round-trip preserves key order acrosssetoperations.logmind doctor [--json] [--offline] [--exit-zero]— probes workflow drift, AGENTS.md block versions, .gitattributes merge-driver state, hook drift (post-merge, post-rewrite, commit-msg v0.6.16+), and PATH-resolution drift (v0.6.16 carry-forward — surfaces tokenomics-recurrence root cause at doctor time). PyPI probe is best-effort with 2s timeout.logmind init [--no-git] [--agents <list>] [--all-agents] [--github-actions/--no-github-actions]— scaffolds docs/, .logmind/config.yml, AGENTS.md slim block, per-agent stubs, all 4 GitHub workflows (verbatim frominternal/templates/github/), .gitignore + .gitattributes blocks, post-merge/post-rewrite/commit-msg hooks, first decision log entry. Refresh-mode no-op when re-run on an already-initialised repo.logmind self-update— refreshes AGENTS.md block, per-agent stub marker bodies, and hooks (post-merge + post-rewrite + commit-msg) from the running binary.v0.6.16 carry-forward
internal/doctor.probePathResolution()— ports Python_probe_path_resolution(). Reportscurrentwhen PATHlogmind --versionmatches running binary;stalewhen versions differ (marker includes both versions + conflicting path for one-glance remediation);missingwhen no logmind on PATH;markerlesswhen --version is unparseable.internal/hooks.BuildCommitMsgBody()+InstallCommitMsg()— v0.6.16 commit-msg hook (warns on[skip-logmind]subjects).logmind initchooses one based on skills.sh availability).Byte-identical parity status
End-to-end harness comparing
PYENV_VERSION=3.11.8 logmind init --no-git(v0.6.14) vs./logmind-go init --no-gitagainst fresh empty dirs:Files byte-identical:
.logmind/config.yml,docs/decisions-archive.md,docs/timeline.md, AGENTS.md, .gitignore, .gitattributes, .github/workflows/check-decisions.yml, .github/workflows/logmind-self-update.yml.Documented deltas (acceptable for B6):
docs/decisions.md— differs only by timestamp (%Y-%m-%d %H:%M).docs/file-structure.md— differs only by repo-root directory name (run-dependent)..github/workflows/regen-timeline.yml+check-doc-links.yml— differ only by thepip install \"logmind==X.Y.Z\"pin (Go usesversion.Versionconstant1.0.0-dev; Python pinned0.6.14). Expected and correct — each binary pins its own version.logmind config listYAML indent — Go'syaml.v3indents sequence items one level deeper than PyYAML (- itemvs- item). Both parse equivalently; the on-diskconfig.yml.templateis shipped verbatim frominternal/templates/, so the actual install file is byte-identical — only the liveconfig listre-emit differs.Scope trims (tracked for follow-up PRs)
logmind init --configure-github— requires GitHub API auth + ruleset POST flow. Surfaces a Note in init output; users currently applythrillmade/protocol/rulesets/canonical-v1.jsonmanually.logmind init --with-skdd— requires Node.js subprocess. Surfaces a Note in init output; users runnpx clud-bug@latest initafterlogmind init.logmind init --install-hook— surfaces a Note pointing atlogmind install-hook(already shipped in B2).logmind init --skill-install yes— surfaces a Note pointing at thenpx skills addcommand.clud-bugtool status (reads.claude/skills/.clud-bug.json),check_stale_derived_docs_warning(Phase-D divergence detection),check_clud_bug_skill_usage_integration(v0.6.6 upload-step gate),LOGMIND_AUTO_REGEN_PATsecret probe.These don't block downstream propagation — the core init+config+doctor+self-update flow works end-to-end against a fresh repo today.
Test plan
go test ./...all green (37 new tests across config, doctor, init, self-update)go vet ./...cleango build ./cmd/logmindproduces a working binarylogmind doctor --jsonround-trips a downstream-parseable shape with the same field names as Python (project_root,tools,overall,network_used,suggestions,installed_version,latest_version,workflows,drift)logmindshell scripts on a temp PATHCarry-forward verification
internal/doctor.probePathResolutionreportsstalewhen fake binary's --version differs fromversion.Version; marker contains both versions + binary pathinternal/hooks.BuildCommitMsgBodybody matches Python_build_commit_msg_hook_bodyexactlyinternal/hooks.InstallCommitMsgwrites to.git/hooks/commit-msgwith 0o755 perms + version markerinternal/doctorreportscommit-msg hookrow with appropriate drift category🤖 Generated with Claude Code