Repository navigation
Lot B: visible measured value - #1
Merged
Merged
Conversation
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]>
Doucs91
added a commit
that referenced
this pull request
Jun 4, 2026
…dar leak fix, cold-start commands, dashboard value line, benchmark honesty Grounded fixes from a real dogfooding+benchmark assessment (perfect the existing). improve: - core: architecture guard test — prevention recording MUST funnel through the single shared `recordPreventionHits`; the build now fails if any source bypasses it (kills the recurring "bolted-on-N-entry-points" drift that caused two silent leaks). - core: harden `suggestSensorFromMemory` — reject degenerate tokens (numeric/line ranges like 1131-1186, file refs like enforce.ts:1131) so it never emits a nonsensical regex sensor (autogen stays warn-only). Real reproduced miss now covered by a test. - cli: fix briefing radar parent-repo git leak — only use git history when the git toplevel is at/under the project root, not when it's an ancestor (the .ai-local fixture case). - mcp: cold-start — the minimal auto-generated project context now surfaces detected run commands (test/build/lint/typecheck/dev) from package.json, the #1 non-guessable session-1 fact. add: - cli: dashboard "Value" headline — repeats blocked (30d) · high-impact memories · active policies, with an honest "cost is real; payoff is downstream" note. deprecate/clarify: - cli: benchmark `token_proxy` -> `report_tokens_est`, relabeled "report only, NOT total agent tokens" (we have real runtime telemetry now); honesty fix. deliberately NOT done (principled): default briefing stays `full` (compact would gut the proven 0->100% policy value); no redundancy auto-detector (would be unreliable — the dashboard honesty line stands in). #8 advanced-surface pruning was already shipped (verified: 14 core vs 38 advanced). Tests: core 334 / mcp 126 / cli 67 green; tsc clean. Smoke: dashboard Value line + radar leak gone. 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
haive dashboard, with--jsonpreserving a machine-readable prevention-first report.haive evalwith catch-rate and gate-precision CI gates, baseline gate precision comparison, and JSON/Markdown output.benchmark-results/roi-proxy-2026-06-03.json.Lot C coordination
briefingProofLine(events, opts)is exported from@hiveai/coreviapackages/core/src/prevention.ts. Signature:It returns a compact line such as
This harness prevented 2 repeated mistakes in the last 30 days.ornullwhen there are no events in the window. Lot C can import and wire it intoget_briefingwithout this PR touchingget-briefing.ts.Console captures
node packages/cli/dist/index.js dashboard --dir .: first value block isPrevention (caught-for-you outcome)with32 catches in 30d,9 recurrences to review, and gate precision94%.node packages/cli/dist/index.js eval --json --dir .: score97, sensor catch-rate100%, gate precision0.946.node scripts/agent-roi-benchmark.mjs: publishable claimhAIve reduced first-pass exploration by 85.3% tokens and 78.9% tool calls across 4 reproducible scenarios.Verification
pnpm -r buildpnpm -r typecheckpnpm -r testnode scripts/agent-roi-benchmark.mjs