Skip to content

feat(lot-c): reach & feedforward — native bridge generator + haive bridges sync - #2

Merged
Doucs91 merged 1 commit into
developfrom
feature/reach
Jun 3, 2026
Merged

Doucs91 merged 1 commit into
developfrom
feature/reach

Conversation

@Doucs91

@Doucs91 Doucs91 commented Jun 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • C1/C3/C6 — packages/core/src/bridges.ts: pure generateBridges() 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 that memories.sh cannot match. Exported interface for Lot A (init.ts can call generateBridges() at init time).
  • C2 — packages/cli/src/commands/bridges.ts: haive bridges sync (idempotent, marker-based, --all / --only <targets> / --max-memories / --dry-run) + haive bridges list.
  • C4 — Already fully implemented in the existing codebase (get_briefing MCP symbols param + haive briefing --symbols). No changes needed.
  • C5 — get-briefing.ts: documented TODO hook for briefingProofLine() (Lot B interface point, exact insertion location + expected signature).
  • C7 — 27 unit + per-target snapshot tests in packages/core/test/bridges.test.ts.

Demo

haive bridges sync --all
# => creates .clinerules, .windsurfrules, .continuerules, .sourcegraph/cody-rules.md,
#    .rules, AGENTS.md, .github/copilot-instructions.md
#    each with memories block + block sensors section

haive bridges list
# => shows target presence / absence

haive briefing --symbols PaymentService
# => already works: localises PaymentService from code-map, no grep needed

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 C section)

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 green
  • pnpm -r typecheck — all packages green
  • pnpm -r test — 267 tests pass (27 new in bridges.test.ts)
  • hAIve enforcement gate 100% on commit + push

Coordination points for other lots

  • Lot A (init.ts): can call generateBridges(memories, sensors, { targets: BRIDGE_TARGETS }) from @hiveai/core — no init.ts edit from this lot.
  • Lot B (briefingProofLine): insertion point documented in get-briefing.ts with exact signature expectation. Once Lot B exposes the function, Lot C owner wires it with a one-liner.

🤖 Generated with Claude Code

…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
Doucs91 merged commit 6a2769f into develop Jun 3, 2026
3 of 5 checks passed
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant