Skip to content

feat: per-directory .hivemind config (route org/workspace, opt out of capture)#302

Merged
khustup2 merged 7 commits into
mainfrom
feat/hivemind-per-directory-config
Jul 10, 2026
Merged

feat: per-directory .hivemind config (route org/workspace, opt out of capture)#302
khustup2 merged 7 commits into
mainfrom
feat/hivemind-per-directory-config

Conversation

@khustup2

@khustup2 khustup2 commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

What

Adds an in-tree .hivemind file that lets a directory tree override the global Hivemind identity — the two things people kept asking for:

  1. Route this tree's captured traces to a specific org/workspace.
  2. Opt out of capture entirely (collect: false).
// route this repo's traces to a client org/workspace
{ "orgId": "acme-corp", "workspaceId": "client-work" }

// never collect traces from this folder
{ "collect": false }

It travels with the repo like .editorconfig; a gitignored .hivemind.local handles personal overrides (the .env.local convention). A copy-ready .hivemind.example is included.

How it resolves

  • Walk up from cwd, nearest-wins (the .git/.gitconfig model, not .gitignore-style merge). .hivemind.local beats .hivemind in the same dir.
  • Precedence is the conventional env > file > login — an explicit HIVEMIND_ORG_ID / HIVEMIND_WORKSPACE_ID locks that field.

Safety by disclosure, not ceremony

No trust/allow commands. Two properties make routing safe:

  • .hivemind never carries a token — auth stays in ~/.deeplake/credentials.json, so a routing override can only ever target orgs your login already authorizes (the API rejects anything else). Worst case is misfiling into another of your own orgs, not leaking to a stranger.
  • Every session-start banner prints the effective identityorg: … (workspace: …) · routed by ./.hivemind, or capture is disabled for this directory — so a redirect is never silent.

Scope

Wired across all four agents (claude/codex/cursor/hermes): capture, session-end, session-start (placeholder + banner), and graph-push (new skipped-collect-disabled outcome). collect:false skips the placeholder write rather than adding new machinery.

Tests

  • Resolver units (tests/shared/dir-config.test.ts): walk-up, nearest-wins, .local precedence, malformed-file skip, whitelisting, collect:false, overlay, env precedence.
  • Hook wiring (capture + session-start): a real .hivemind under the mocked cwd proves the primary write path writes nothing on collect:false and builds the API against the routed org/workspace, with env > file verified end-to-end.

Full suite green except pre-existing env-only failures (tree-sitter-python not installed → graph/*; flush-memory network timeout) — both untouched here. Bundles are gitignored (built at pack time), so the diff is source + tests + README.

Summary by CodeRabbit

  • New Features
    • Added per-directory .hivemind / .hivemind.local config to route org/workspace identity and optionally disable capture (collect:false).
    • Cloud sync now skips when the resolved directory disables collection.
  • Bug Fixes
    • Capture, session setup, and session summary flows now consistently honor directory-level opt-outs and routing, including cwd-aware resolution.
  • Documentation
    • Documented .hivemind format, precedence/overlay rules, and interaction with global settings.
  • Tests
    • Added/updated filesystem-backed tests for parsing/resolution and capture gating.
  • Chores
    • Added .hivemind.local to .gitignore and included an example config file.

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds .hivemind and .hivemind.local per-directory configuration for routing and collection opt-out. Resolution is integrated into graph pushing, capture hooks, session lifecycle hooks, Pi, user disclosures, documentation, and filesystem-backed tests.

Changes

Per-directory configuration and collection controls

Layer / File(s) Summary
Configuration contract and resolution
src/dir-config.ts, .hivemind.example, .gitignore, README.md, tests/shared/dir-config.test.ts
Defines discovery, parsing, routing overlays, environment precedence, collection opt-out, examples, documentation, and unit coverage.
Graph collection gating
src/graph/deeplake-push.ts, src/commands/graph.ts
Adds the skipped-collect-disabled outcome and reports directory-level graph collection skips.
Capture entrypoint gating
src/hooks/shared/dir-gate.ts, src/hooks/*/capture.ts, src/hooks/capture.ts
Resolves configuration from each hook’s working directory and skips disabled collection.
Session lifecycle routing and disclosure
src/hooks/session-start.ts, src/hooks/session-end.ts, src/hooks/codex/*, src/hooks/cursor/*, src/hooks/hermes/*
Applies routed configuration, gates table and placeholder writes, and reports effective identity or opt-out status.
Pi extension routing
harnesses/pi/extension-source/hivemind.ts
Applies directory routing and collection gates across Pi session-start, capture, message, tool-result, and shutdown handlers.
Hook integration coverage
tests/claude-code/*, tests/codex/*, tests/cursor/*, tests/hermes/*, tests/pi/*
Tests directory opt-out, routed identities, API construction, context disclosure, environment overrides, and capture gating.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant SessionStartHook
  participant resolveDirConfig
  participant DeeplakeApi
  participant additionalContext
  SessionStartHook->>resolveDirConfig: resolve configuration from session cwd
  resolveDirConfig-->>SessionStartHook: effective config and collect state
  SessionStartHook->>DeeplakeApi: ensure tables and create placeholder when enabled
  SessionStartHook->>additionalContext: report routed identity or collection opt-out
Loading

Possibly related PRs

Suggested reviewers: efenocchi, kaghni

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 22.22% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main change: per-directory .hivemind routing and capture opt-out.
Description check ✅ Passed The description covers the feature, resolution rules, safety, scope, and tests, though it doesn't follow the template headings exactly.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/hivemind-per-directory-config

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

khustup2 added 2 commits July 10, 2026 01:29
… capture)

Add an in-tree `.hivemind` file that overlays the global identity for
sessions launched under a directory tree — either to route captured
traces to a specific org/workspace, or to opt out of capture entirely
(`collect: false`). Travels with the repo like `.editorconfig`; a
gitignored `.hivemind.local` handles personal overrides (`.env.local`
convention).

Resolution (src/dir-config.ts): walk up from cwd, nearest-wins (not
.gitignore-style merge), `.hivemind.local` beats `.hivemind` in the same
dir. Precedence is the conventional env > file > login — an explicit
HIVEMIND_ORG_ID / HIVEMIND_WORKSPACE_ID locks that field.

Safety by disclosure, not ceremony: the file never carries a token
(auth stays in credentials.json), so routing can only target orgs the
login already authorizes; and every session-start banner prints the
effective org/workspace (+ "routed by ..." / "capture disabled here"),
so a redirect is never silent. No trust/allow commands.

Wired across all agents (claude/codex/cursor/hermes): capture,
session-end, session-start placeholder + banner, and graph-push
(new skipped-collect-disabled outcome). `collect:false` skips the
placeholder write entirely rather than adding new machinery.

Tests: dir-config resolver units (walk-up, nearest-wins, .local
precedence, malformed skip, collect:false, overlay, env precedence) +
capture/session-start hook wiring proving the primary write path honors
opt-out (no writes) and routing (API built against the routed
org/workspace), with env precedence verified end-to-end.
@khustup2 khustup2 force-pushed the feat/hivemind-per-directory-config branch from 3b69a8d to b5a7f1a Compare July 10, 2026 01:29

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (1)
src/hooks/capture.ts (1)

84-94: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider extracting the dir-config gating into a shared helper.

The load-base → resolveDirConfig → early-return-on-collect:false pattern is now duplicated verbatim across capture.ts, codex/capture.ts, cursor/capture.ts, and hermes/capture.ts. A shared helper (e.g. in src/hooks/shared/) that takes (cwd, agentLabel) and returns either a resolved Config or null (after logging) would remove this 4x duplication and prevent future drift — which already happened once (see the cursor/capture.ts comment on its cwd fallback).

♻️ Sketch of a shared helper
// src/hooks/shared/dir-gate.ts
export function resolveOrSkip(base: Config, cwd: string, agent: string, log: (m: string) => void): Config | null {
  const resolved = resolveDirConfig(base, cwd || process.cwd());
  if (!resolved.collect) {
    log(`capture disabled for cwd=${cwd || "?"} via ${resolved.found?.path}`);
    return null;
  }
  return resolved.config;
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/hooks/capture.ts` around lines 84 - 94, Extract the duplicated
base-config loading and directory gating into a shared helper under
src/hooks/shared, such as resolveOrSkip, accepting cwd, agent label, and logger
and returning the resolved Config or null. Update capture.ts, codex/capture.ts,
cursor/capture.ts, and hermes/capture.ts to use it, preserving consistent cwd
fallback, disabled-capture logging, and early returns.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/graph/deeplake-push.ts`:
- Around line 77-88: Thread the resolved working directory through pushSnapshot:
add a cwd field to PushDeps, use it instead of process.cwd() when calling
resolveDirConfig in pushSnapshot, and pass runBuildCommand’s resolved cwd when
invoking pushSnapshot. Update any affected dependency construction and tests.

In `@src/hooks/codex/session-start-setup.ts`:
- Around line 78-87: Gate the entire backend write block in the session-start
setup handler, including ensureTable(), ensureSessionsTable(), and
createPlaceholder(), on both dirRes.collect and captureEnabled. Add a distinct
log branch explaining setup was skipped because HIVEMIND_CAPTURE=false, while
preserving the existing collect:false skip reason.

In `@src/hooks/cursor/session-start.ts`:
- Around line 220-229: Update the identity resolution in the session-start hook
so effOrg and effWs are derived from dirRes?.config ?? baseConfig, falling back
to credentials only when neither config exists, regardless of routed status.
Apply this correction to the identityLine banner and the corresponding logic in
the other session-start hook, while preserving routing and capture-disabled
messaging.

---

Nitpick comments:
In `@src/hooks/capture.ts`:
- Around line 84-94: Extract the duplicated base-config loading and directory
gating into a shared helper under src/hooks/shared, such as resolveOrSkip,
accepting cwd, agent label, and logger and returning the resolved Config or
null. Update capture.ts, codex/capture.ts, cursor/capture.ts, and
hermes/capture.ts to use it, preserving consistent cwd fallback,
disabled-capture logging, and early returns.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 4336d579-715a-4a16-a53f-41c8f9060d72

📥 Commits

Reviewing files that changed from the base of the PR and between e42b7bc and 7bbbd30.

📒 Files selected for processing (21)
  • .gitignore
  • .hivemind.example
  • README.md
  • src/commands/graph.ts
  • src/dir-config.ts
  • src/graph/deeplake-push.ts
  • src/hooks/capture.ts
  • src/hooks/codex/capture.ts
  • src/hooks/codex/session-start-setup.ts
  • src/hooks/codex/stop.ts
  • src/hooks/cursor/capture.ts
  • src/hooks/cursor/session-end.ts
  • src/hooks/cursor/session-start.ts
  • src/hooks/hermes/capture.ts
  • src/hooks/hermes/session-end.ts
  • src/hooks/hermes/session-start.ts
  • src/hooks/session-end.ts
  • src/hooks/session-start.ts
  • tests/claude-code/capture-hook.test.ts
  • tests/claude-code/session-start-hook.test.ts
  • tests/shared/dir-config.test.ts

Comment thread src/graph/deeplake-push.ts
Comment thread src/hooks/codex/session-start-setup.ts Outdated
Comment on lines +220 to +229
// Disclose the EFFECTIVE identity (after any `.hivemind` overlay).
const routed = !!(dirRes?.found && dirRes.collect && baseConfig &&
(dirRes.config.orgId !== baseConfig.orgId || dirRes.config.workspaceId !== baseConfig.workspaceId));
const effOrg = routed ? (dirRes!.config.orgName ?? dirRes!.config.orgId) : (creds?.orgName ?? creds?.orgId);
const effWs = routed ? dirRes!.config.workspaceId : (creds?.workspaceId ?? "default");
const identityLine = dirRes && !dirRes.collect
? `Deeplake capture is disabled for this directory (${dirRes.found?.path}); memory search still uses org: ${effOrg}`
: `Logged in to Deeplake as org: ${effOrg} (workspace: ${effWs})${routed ? ` · routed by ${dirRes?.found?.path}` : ""}`;
const baseContext = creds?.token
? `${context}\nLogged in to Deeplake as org: ${creds.orgName ?? creds.orgId} (workspace: ${creds.workspaceId ?? "default"})${versionNotice}`
? `${context}\n${identityLine}${versionNotice}`

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Display the resolved identity, not raw credentials.

When HIVEMIND_ORG_ID or HIVEMIND_WORKSPACE_ID overrides login values, routed is false and this banner uses stale creds values, while Line 163 sends requests using dirRes.config. Derive effOrg and effWs from dirRes?.config ?? baseConfig regardless of whether routing changed. Apply the same correction in src/hooks/session-start.ts Lines 308-318.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/hooks/cursor/session-start.ts` around lines 220 - 229, Update the
identity resolution in the session-start hook so effOrg and effWs are derived
from dirRes?.config ?? baseConfig, falling back to credentials only when neither
config exists, regardless of routed status. Apply this correction to the
identityLine banner and the corresponding logic in the other session-start hook,
while preserving routing and capture-disabled messaging.

@khustup2 khustup2 requested a review from efenocchi July 10, 2026 01:31
- Extract shared resolveCaptureConfig() helper (src/hooks/shared/dir-gate.ts),
  removing the 4x-duplicated load-base -> resolveDirConfig -> skip-on-collect
  pattern across claude/codex/cursor/hermes capture hooks.
- deeplake-push: thread the build cwd through PushDeps.cwd instead of
  process.cwd(), so `hivemind graph build --cwd ../repo` resolves the target
  tree's `.hivemind` (not the invocation dir).
- codex session-start setup: gate the whole write block (ensure DDL +
  placeholder) on captureEnabled && collect, with a distinct HIVEMIND_CAPTURE=
  false log — matching the claude hook.
- session-start banners: show the effective (resolved) org/workspace so an env
  override (HIVEMIND_ORG_ID/WORKSPACE_ID) is reflected, falling back to creds
  only when no config exists.
- Tests updated to the new behavior.
@efenocchi

Copy link
Copy Markdown
Collaborator

@khustup2 I'd check Pi and openclaw as well

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/hooks/shared/dir-gate.ts`:
- Around line 20-23: Use the same effective cwd passed to resolveDirConfig in
the disabled-capture log within the relevant directory-gating function: compute
or retain cwd || process.cwd() once, pass it to resolveDirConfig, and
interpolate that resolved path instead of cwd || "?".
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 88241ad0-0198-4577-b6cf-743b51959918

📥 Commits

Reviewing files that changed from the base of the PR and between b5a7f1a and 0a5169d.

📒 Files selected for processing (15)
  • src/commands/graph.ts
  • src/graph/deeplake-push.ts
  • src/hooks/capture.ts
  • src/hooks/codex/capture.ts
  • src/hooks/codex/session-start-setup.ts
  • src/hooks/cursor/capture.ts
  • src/hooks/cursor/session-start.ts
  • src/hooks/hermes/capture.ts
  • src/hooks/hermes/session-start.ts
  • src/hooks/session-start.ts
  • src/hooks/shared/dir-gate.ts
  • tests/claude-code/session-start-hook.test.ts
  • tests/codex/codex-session-start-setup-hook.test.ts
  • tests/cursor/cursor-session-start-hook.test.ts
  • tests/hermes/hermes-session-start-hook.test.ts
🚧 Files skipped from review as they are similar to previous changes (6)
  • src/hooks/hermes/capture.ts
  • tests/claude-code/session-start-hook.test.ts
  • src/hooks/session-start.ts
  • src/graph/deeplake-push.ts
  • src/hooks/cursor/session-start.ts
  • src/hooks/hermes/session-start.ts

Comment thread src/hooks/shared/dir-gate.ts Outdated
…sion

Emanuele flagged pi/openclaw on PR #302. openclaw has no per-project
filesystem cwd (it's a channel gateway, cwd=homedir sentinel), so
`.hivemind` — a per-directory concept — doesn't apply there. pi IS a
local coding agent with a real cwd, so it does.

Pi ships as raw .ts with no shared-module imports, so add a compact
inline mirror of src/dir-config.ts (findHivemindDir + applyDirConfig,
walk-up nearest-wins, `.hivemind.local` beats `.hivemind`, env > file
precedence). Apply it on every capture path — input, tool_result,
message_end, session_shutdown — skipping capture on `collect:false` and
routing to the resolved org/workspace otherwise. session_start gates
table setup on collect and discloses the effective identity (routed /
capture-disabled) in the injected context.

Tests: source-text assertions (matching the file's existing style) that
the resolver exists, env precedence is honored, all 4 capture paths gate
on collect + reassign to routed creds, and session_start gates + discloses.
@khustup2

Copy link
Copy Markdown
Contributor Author

@efenocchi good call. Wired pi (harnesses/pi/extension-source/hivemind.ts) — it's a local agent with a real cwd, so it now honors .hivemind on every capture path (input / tool_result / message_end / session_shutdown) plus session_start gating + disclosure. Since pi ships as raw .ts with no shared imports, it carries a compact inline mirror of dir-config.ts (nearest-wins, .local beats committed, env > file), covered by source-text tests.

openclaw I left out on purpose: it's a channel gateway with no per-project filesystem cwd (cwd: homedir() sentinel, see index.ts), and .hivemind is a per-directory concept — there's no project dir to place one in. Routing/opt-out for openclaw would go through global creds/env, not .hivemind. Shout if you'd rather I handle it differently.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@harnesses/pi/extension-source/hivemind.ts`:
- Around line 128-139: Environment pins are only used to block directory
overrides, not applied as effective credentials. Update loadCreds() to merge
HIVEMIND_ORG_ID and HIVEMIND_WORKSPACE_ID into the returned creds before
applyDirConfig() runs, while preserving existing credential values when the
variables are unset and retaining the existing precedence behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: e0ff3e91-5d4c-4e15-908e-4b7086051fef

📥 Commits

Reviewing files that changed from the base of the PR and between 0a5169d and e1086f4.

📒 Files selected for processing (2)
  • harnesses/pi/extension-source/hivemind.ts
  • tests/pi/pi-extension-source.test.ts

Comment thread harnesses/pi/extension-source/hivemind.ts
- dir-config: read HIVEMIND_ORG_ID/WORKSPACE_ID as LITERAL process.env.X
  accesses instead of an aliased `env = process.env` default param. The
  alias reached the openclaw bundle (via deeplake-push -> dir-config) as a
  bare `process.env` substring, tripping ClawHub's env-harvesting scan
  ("Audit openclaw bundle" CI step). Literals are stubbed to `undefined`
  by the openclaw esbuild `define`; tests inject via an `envOverride` arg.
- dir-gate: log the resolved cwd (cwd || process.cwd()), not `?`, when the
  hook passes an empty cwd.
- pi: fold env into creds (env > file > login) so the env lock reflects an
  actually-applied value and pi matches the other agents' precedence,
  rather than referencing HIVEMIND_ORG_ID without honoring it.
@khustup2

Copy link
Copy Markdown
Contributor Author

@efenocchi fixed 🙏

openclaw CI failure ("Audit openclaw bundle" step): my dir-config.ts used env = process.env as a default param — an alias that reached the openclaw bundle via deeplake-push → dir-config as a bare process.env substring, tripping ClawHub's env-harvesting scan. Switched to literal process.env.HIVEMIND_ORG_ID/WORKSPACE_ID reads (which the openclaw esbuild define stubs to undefined); tests inject via an envOverride arg. Verified locally: audit:openclaw --criticals-only → 0 critical.

CodeRabbit minors:

  • dir-gate.ts: log the resolved cwd (cwd || process.cwd()) instead of ? on empty cwd.
  • pi: it referenced HIVEMIND_ORG_ID for the lock but never folded env into creds — now folds env (env > file > login), so pi matches the other agents' precedence and the lock reflects an applied value.
  • The cursor "display resolved identity" comment was already addressed in the earlier review pass (uses effConfig = dirRes?.config ?? baseConfig).

Green locally (typecheck + touched suites).

@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Coverage Report

Scope: files changed in this PR. Enforced threshold: 90% per metric (per file via vitest.config.ts).

Status Category Percentage Covered / Total
🔴 Lines 89.02% (🎯 90%) 1005 / 1129
🔴 Statements 88.10% (🎯 90%) 1118 / 1269
🟢 Functions 95.88% (🎯 90%) 93 / 97
🔴 Branches 80.07% (🎯 90%) 699 / 873
File Coverage — 16 files changed
File Stmts Branches Functions Lines
src/commands/graph.ts 🔴 72.4% 🔴 60.4% 🟢 95.2% 🔴 71.8%
src/dir-config.ts 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0%
src/graph/deeplake-push.ts 🟢 96.2% 🔴 84.4% 🔴 83.3% 🟢 96.2%
src/hooks/capture.ts 🟢 95.2% 🔴 82.7% 🟢 100.0% 🟢 100.0%
src/hooks/codex/capture.ts 🟢 97.2% 🔴 84.2% 🟢 100.0% 🟢 100.0%
src/hooks/codex/session-start-setup.ts 🟢 100.0% 🔴 79.2% 🟢 100.0% 🟢 100.0%
src/hooks/codex/stop.ts 🟢 96.1% 🔴 83.3% 🟢 100.0% 🟢 98.5%
src/hooks/cursor/capture.ts 🟢 91.9% 🔴 88.3% 🟢 100.0% 🟢 95.9%
src/hooks/cursor/session-end.ts 🟢 90.0% 🔴 82.6% 🟢 100.0% 🟢 95.2%
src/hooks/cursor/session-start.ts 🟢 98.6% 🔴 82.4% 🔴 88.9% 🟢 100.0%
src/hooks/hermes/capture.ts 🔴 84.9% 🔴 82.5% 🟢 100.0% 🔴 87.0%
src/hooks/hermes/session-end.ts 🟢 90.3% 🔴 83.3% 🟢 100.0% 🟢 95.5%
src/hooks/hermes/session-start.ts 🟢 98.4% 🔴 81.8% 🔴 85.7% 🟢 100.0%
src/hooks/session-end.ts 🟢 90.2% 🔴 81.3% 🟢 100.0% 🟢 94.9%
src/hooks/session-start.ts 🟢 98.9% 🟢 93.3% 🟢 100.0% 🟢 98.8%
src/hooks/shared/dir-gate.ts 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0%

Generated for commit 65682e4.

khustup2 added 2 commits July 10, 2026 06:33
- Add a capture test exercising resolveCaptureConfig's `cwd || process.cwd()`
  fallback (empty cwd) — brings src/hooks/shared/dir-gate.ts to 100% branch.
- Register src/dir-config.ts and src/hooks/shared/dir-gate.ts in the per-file
  coverage thresholds (branches 90), per the repo convention for new files.
My .hivemind additions to cursor/hermes session-start added banner-
routing / collect:false / effConfig branches that their existing tests
didn't exercise, dropping branch coverage below the 80% per-file gate
(CI "Run tests with coverage"). Add routing / opt-out / env-precedence
tests to both (mirroring the claude session-start coverage), restoring
cursor to 83.8% and hermes to 81.8% branches.
@khustup2 khustup2 merged commit 9990f7a into main Jul 10, 2026
10 checks passed
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.

2 participants