SuperAPIAI Directory

hivelore

github.com · AI agents

Policy gate for agent-written code: briefs agents on repo-specific team rules and blocks commits that reintroduce documented mistakes via Git hooks and CI.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)

About this tool

Hivelore is the policy enforcement layer in the AI coding agent workflow framework. The general best-practice models already possess this knowledge themselves, but they cannot guess arbitrary rules specific to a team's repository, such as public IDs must be id + 100000 with the prefix AC-, the status field can only be "OK" / "KO", and never modify applied migrations. Without context, agents tend to produce changes that look clean and pass tests but violate policy. Hivelore brings this unguessable knowledge into the task and blocks commits that are about to violate it. It does not replace tests, linters, or observability; rather, it makes repository-specific knowledge that these tools cannot infer accessible, auditable, and enforceable.

Main capabilities:

  1. Context policy layer: hivelore init creates a .ai/ policy layer in the repository; agents begin each session with get_briefing, which returns condensed default context in a single MCP call and provides deeper clues ordered by task relevance. Decisions, pitfalls, failed attempts, and session notes are Markdown files anchored to the code paths they describe; anchor staleness is detected when code moves.
  2. Enforcement checks: hivelore enforce check and CI execution block unsafe states, including missing briefings, stale critical decisions, anchored anti-patterns that the diff is about to repeat, or uncaptured session knowledge.
  3. Memory sensors: some pitfall and attempt memories can carry a sensor block that scans the diff. Forms include regex (default, matches added lines), ast (ast-grep structural patterns, requires the optional @ast-grep/napi engine, and when missing is unrunnable with only a warning), and shell/test (routes its own tests as an oracle). Auto-generated sensors start as warn and are promoted to block after human review.
  4. Behavior bridging: since v0.33.0, command sensors are supported, using their own tests or invariant scripts as an oracle and rejecting the commit on non-zero exit. Each repository must explicitly enable enforcement.runCommandSensors: true. Since v0.43.0, blocking shell/test sensors must pass prove-RED, i.e. using --red-ref <pre-fix-commit> to replay the event in a temporary worktree and require the oracle to fail, recording red_proven: true. Commands run in a sanitized environmentrun in.
  5. Scaffolding: hivelore sensors scaffold <memory-id> or the MCP tool scaffold_test can generate a test skeleton from events, automatically detecting vitest / jest / pytest / go, and locating by the package that the anchor path belongs to in a monorepo; --red-ref makes the skeleton prefill examples around the symbols involved in the fix, and --style property or --style differential --reference <impl> provides lower-cost invariant expression. The skeleton remains in pending, commented state and will not automatically arm sensors.
  6. Generating patterns from fixes: sensors propose --from-fix <pre-fix-ref> mines regex and absent patterns from the fix diff, but must still pass full validation (silent on current code, triggered by erroneous code, not reversed) before it can block.
  7. Doctor and metrics: hivelore doctor reports the protected proportion of the behavioral surface for each main code area and gives suggested commands; hivelore stats outcomes lists interception records. mem_feedback supports reporting applied / rejected or corrected / verified, optionally with a commit, test report, or event reference.

Usage: run hivelore init in the repository (which also runs agent setup), writing project-level MCP configuration and recording the best available mode; in a non-interactive shell it skips global configuration and indicates how to complete it. Call the bootstrap_project MCP prompt in the AI client, and the agent analyzes the codebase and automatically writes .ai/project-context.md. Client configuration examples: Claude Code uses ~/.claude.json, Cursor uses ~/.cursor/mcp.json. Each session starts with a briefing, and applicable brief policies are injected before editing; when a policy is too long, the hook emits an undelivered instruction pointer, requiring mem_get with session_id or hivelore memory get <id> --session-id <session> to read the full policy. After upgrading, run hivelore agent setup --no-global to repair old Git hooks, then restart the AI client; you can use hivelore agent check --exercise --json to verify the integration in an isolated temporary repository, and report first-edit latency and the median/p95 durations of reads, repeated edits, and shell calls. All content is stored in .ai/ as reviewable Markdown, versioned with the code, and rm -rf .ai can undo it.

Applicable scenarios: repositories that want to use team-validated, non-obvious knowledge to constrain the behavior of AI coding agents, especially teams with recurring strategic errors such as migrations, state fields, and ID conventions. Limitations: full functional verification at the behavioral layer (test generation, LLM evaluation) remains the responsibility of the test suite; Hivelore only carries partial static intent and does not act as a runtime functional oracle; command sensors must be enabled by the repository itself; for specific versions, installation methods, and configuration details, refer to the official repository documentation.

Up/Down to navigate · Enter to open · ESC to closeBrowse all tools