Repository navigation
feat(lot-a): cold-start — multi-lang stack detection, git seeding in init, first-session report - #3
Merged
Merged
Conversation
…init, first-session report
A1: detectStacksFromManifests() in core/seed.ts — pure, testable, handles package.json/
requirements.txt/go.mod/pom.xml (adds Python, Go, Java detection).
A2: haive init now seeds draft memories from git revert/hotfix history automatically
(--seed on by default in autopilot, --no-seed to skip, --seed-limit <n>).
A3: First-session report printed at end of init and corpus summary in haive welcome.
A4: CI usage documentation added as header comment in ingest.ts.
A5: 25 new tests in core/test/seed.test.ts covering detectStacksFromManifests and
proposeSeedsFromCommits edge cases.
- seedStackPack now returns { memories, sensors } instead of number.
- memory-seed.ts updated to use new SeedPackResult type.
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Doucs91
added a commit
that referenced
this pull request
Jun 4, 2026
…it gate, tighten matcher precision Deep corpus self-test found the regex sensors (precise, deterministic) were orphaned from the commit gate: the installed hook ran only `enforce check`, which used the fuzzy anti-pattern matcher (noisy, missed the real issue). `haive eval` reported catch_rate 1.0 while real commits had zero sensor protection. Fixes: #1 Wire sensors into the gate: `runPrecommitPolicy` now runs `runSensorGate` — ALL regex sensors (any memory type, not just attempt/gotcha) on the staged diff. block sensor → error (fails gate); warn sensor → warn finding (visible, non-blocking). Excludes `.ai/`/hAIve-owned files (self-match guard), read-only + best-effort. Verified: `enforce check` now surfaces the TS no-any sensor on a `: any` diff (previously silent). #2 Tighten fuzzy precision (precommit-check.ts): a non-anchored memory whose deterministic sensor did NOT fire → info (non-violation evidence); uncorroborated semantic review floor 0.6 → 0.65. Cuts the "20 mostly-irrelevant matches for a 3-line diff" noise that trains agents to ignore the gate. #3 seed-git workaround heuristic: lookbehind/lookahead so compound feature names ("env-workaround", "workaround-registry") no longer seed a meaningless attempt; dropped FIXME/XXX from subjects. #5 memory-lint: LOW_VALUE_GUESSABLE now requires positive generic-advice evidence (looksLikeGenericAdvice) so an arbitrary-but-prose team policy isn't mislabeled (killed the UI-language-policy false positive). #6 stack packs: dedupe slug so the generated name no longer doubles the stack word. Corpus cleanup: deprecated 2 fixed/audit gotchas (lint RETIRED_ACTIVE), fixed 2 doubled stack-pack titles, deleted 1 bogus workaround seed. Effect: memory lint 4 → 1 finding; `haive eval` 97 → 100 (MRR 1.0, 0 retrieval misses), sensor catch_rate 1.0, gate precision 0.994. Tests: 531 green (core 323, mcp 124 incl. 2 new precision tests + 1 seed-git, cli 67, embeddings 17), tsc clean on all packages. Co-Authored-By: Claude Opus 4.8 <[email protected]>
This was referenced Nov 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Lot A — Onboarding & Cold-start (P0).
haive initne se termine plus sur un.ai/quasi vide. Il détecte le stack automatiquement depuis plusieurs manifestes, seed le corpus depuis l'historique git, et termine par un rapport lisible.detectStacksFromManifests()danscore/src/seed.ts— gèrepackage.json,requirements.txt,go.mod,pom.xml(Python/Go/Java ajoutés). Testable sans I/O.init:haive initlance automatiquement le seeding depuis les commitsRevert/hotfix(--seedON par défaut en autopilot,--no-seedpour désactiver,--seed-limit <n>). Idempotent (ne duplique pas).init(reverts trouvés + récurrents, packs chargés + sensors, total leçons).haive welcomeaffiche aussi un résumé corpus.haive ingestCI-ready : header commentaire avec exemples complets ESLint/SARIF, SonarQube fichier et API, dry-run, codes de sortie.core/test/seed.test.tscouvrantdetectStacksFromManifests(tous les manifestes, dédup, edge cases) etproposeSeedsFromCommits.Livrable démontrable
Fichiers modifiés (Lot A uniquement — propriété respectée)
core/src/seed.ts(nouveau)detectStacksFromManifests()pure + typescore/src/index.tsseed.js(ligne ajoutée)core/test/seed.test.ts(nouveau)cli/commands/init-stack-packs.tsStackName,seedStackPack→SeedPackResultcli/commands/init.tscli/commands/memory-seed.tsSeedPackResultcli/commands/welcome.tscli/commands/ingest.tsAucun fichier appartenant au Lot B (
dashboard.ts,prevention.ts…) ni Lot C (get-briefing.ts,sync.ts…) n'a été touché.Test plan
pnpm -r buildvertpnpm -r typecheckvertpnpm -r testvert — 265 tests core, 67 tests CLI (tous verts)seed.test.tspassent🤖 Generated with Claude Code