v0.7.2: ECC compat + dogfooding bridge#25
Conversation
* internal/ecc/ — parser + discovery + migrate over the upstream affaan-m/everything-claude-code corpus. Sampled against the threecorp fork (1080 instincts / 49 skills / 6 agents / 116 commands across 4 projects). * internal/cli/ecc.go — `bough ecc import [--dry-run|--apply] [--root <path>] [--kinds instinct,skill,agent,command] [--json]`. Default root = ~/.local/share/ecc-homunculus. * Quality-gate dispatch — internal/cli/hook.go reads .bough.yaml's quality_gates: section, matches each gate against (event, tool, file_path, repo) of the incoming hook, and runs them via internal/qualitygate. PostToolUse + Edit on *.go now triggers `nix develop -c make test-short` if the operator declared that gate. * Catalog filter — INSTINCTS.md / MEMORY.md / README.md skip silently instead of cluttering the soft-errors list. * Tolerant parser — frontmatter-less instincts demote to silent skip rather than soft error (= early-format ECC files). * Version bumps — bough-mcp-server + bough-plugin-memory-mem0 → v0.7.2. CHANGELOG + ROADMAP entries. Tested end-to-end against the live corpus: 1072 instincts / 48 skills / 6 agents / 116 commands migrate to InstinctCandidate / CapabilityArtifact rows with provenance + dedupe keys populated. The ECC → memory backend Store loop is deferred to v0.8 (= P4 memory backend integration) so v0.7.2 stays read-only and the operator can git-diff every projected row before any persist.
| // current event. Configuration absence is a hard non-error: a | ||
| // monorepo with no gates declared sees no behaviour change. | ||
| func dispatchQualityGates(c *cobra.Command, event string, payload []byte) { | ||
| cfgPath := os.Getenv("BOUGH_CONFIG") |
There was a problem hiding this comment.
Retrospective review finding (confirmed still-live at HEAD v0.15.0 — this function is unchanged since this PR, having survived the v0.9 architecture reset): cfgPath is resolved as a bare cwd-relative .bough.yaml (or $BOUGH_CONFIG), never through resolveMonorepoRoot/resolveConfigPath like every sibling dispatcher in this file (e.g. resolveObserverConfig, fixed for the identical bug class in commit 487ea4c). Per this file's own documented ECC model, every sub-repo/worktree session pools into one monorepo project, so bough hook handle ordinarily runs with cwd inside e.g. <root>/extremo-api/, not at <root> itself — from there the bare `os.Stat(".bough.yaml")" always misses the canonical config, so no quality gate ever ran except when the hook happened to fire with cwd exactly at the monorepo root. Fixed in PR #110.
| // fields fall through as the empty string so an unmatcher matcher | ||
| // still wildcards correctly. | ||
| func buildMatchContext(event string, payload []byte) qualitygate.MatchContext { | ||
| mc := qualitygate.MatchContext{Event: event} |
There was a problem hiding this comment.
Retrospective review finding (confirmed still-live at HEAD v0.15.0 — this function is unchanged since this PR): buildMatchContext never populates qualitygate.MatchContext.Repo, so a gate's on_repo: matcher (config.QualityGateCfg.OnRepo, documented and schema-validated since v0.7.1, see internal/qualitygate/qualitygate.go's Gate.Match) always compares against the empty string and can never match. This is a dead feature from day one — any operator who scoped a gate to one sub-repo via on_repo: silently got a gate that never runs. Fixed in PR #110, which adds a repoNameFromCwd helper (deriving the sub-repo name from cwd relative to the resolved monorepo root, handling both the worktrees/ and legacy .worktrees/ layouts) and threads it through into MatchContext.Repo.
fix: retrospective review fixes for merged PR #25
Summary
v0.7.2 = "ECC compat + dogfooding bridge" — reads the upstream affaan-m/everything-claude-code corpus so a project with 300+ pre-existing artifacts lands in bough's schemas without re-running the evolve pipeline.
internal/ecc/parses + discovers + migrates ECC instincts / skills / agents / commands.bough ecc import [--dry-run|--apply] [--root <path>] [--kinds ...] [--json]. Default root =~/.local/share/ecc-homunculus.bough hook handle(= deferred from v0.7.1 P1.5). PostToolUse + Edit on*.gotriggers operator-declared gates via.bough.yaml'squality_gates:section.bough-mcp-server+bough-plugin-memory-mem0→ v0.7.2.Verified
End-to-end against the live local corpus:
All 4 projects (extremo / extremo-db / extremo-api / claude) parse cleanly; 9 soft errors are early-format catalog files and one unquoted-colon SKILL.md (will fix in v0.7.3).
Deferred
Test plan
go test ./internal/ecc/...— parser + discover + migrate (8 tests pass)go test ./internal/cli/...— ECC CLI integration