Repository navigation
feat(lot-c): reach & feedforward — native bridge generator + haive bridges sync - #2
Merged
Merged
Conversation
…idges sync C1/C3/C6: core/bridges.ts — pure generateBridges() for 7 harness targets (Cline, Windsurf, Continue, Cody, Zed, AGENTS.md, Copilot). Each bridge embeds validated memories + block sensors — enforcement reach that memories.sh cannot match. Exported for Lot A (init.ts) integration. C2: cli/commands/bridges.ts — haive bridges sync (idempotent, marker-based) --all / --only <targets> / --max-memories / --dry-run haive bridges list shows target presence at a glance. C5: get-briefing.ts TODO hook for briefingProofLine() (Lot B interface point). C7: 27 unit + snapshot tests in core/test/bridges.test.ts. C4 (code-map symbols in get_briefing + haive briefing --symbols) was already fully implemented in the existing codebase — no changes needed. CHANGELOG: ### [Unreleased] — Lot C section added. 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 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
packages/core/src/bridges.ts: puregenerateBridges()producing native config files for 7 harness targets: Cline (.clinerules), Windsurf (.windsurfrules), Continue (.continuerules), Cody (.sourcegraph/cody-rules.md), Zed (.rules), Codex/AGENTS.md, GitHub Copilot. Each bridge embeds top validated memories + block sensors — enforcement reach thatmemories.shcannot match. Exported interface for Lot A (init.tscan callgenerateBridges()at init time).packages/cli/src/commands/bridges.ts:haive bridges sync(idempotent, marker-based,--all/--only <targets>/--max-memories/--dry-run) +haive bridges list.get_briefingMCPsymbolsparam +haive briefing --symbols). No changes needed.get-briefing.ts: documented TODO hook forbriefingProofLine()(Lot B interface point, exact insertion location + expected signature).packages/core/test/bridges.test.ts.Demo
Ownership compliance
Files touched are all owned by Lot C (as per
docs/HAIVE_COMPETITIVE_IMPLEMENTATION_PLAN.md §5):packages/core/src/bridges.ts(new)packages/core/src/index.ts(re-export,// --- Lot C ---block)packages/cli/src/commands/bridges.ts(new)packages/cli/src/index.ts(append-only,// --- Lot C ---markers)packages/mcp/src/tools/get-briefing.ts(C5 TODO comment only)CHANGELOG.md(### [Unreleased] — Lot Csection)Did NOT touch:
init.ts,dashboard.ts,prevention.ts,impact.ts,seed-git.ts,findings.ts(Lots A/B).Test plan
pnpm -r build— all packages greenpnpm -r typecheck— all packages greenpnpm -r test— 267 tests pass (27 new in bridges.test.ts)Coordination points for other lots
init.ts): can callgenerateBridges(memories, sensors, { targets: BRIDGE_TARGETS })from@hiveai/core— no init.ts edit from this lot.briefingProofLine): insertion point documented inget-briefing.tswith exact signature expectation. Once Lot B exposes the function, Lot C owner wires it with a one-liner.🤖 Generated with Claude Code