Repository navigation
feat(hooks): add v1.8 passive capture, bounded briefings, and multi-client hook CLI - #350
Coding-Dev-Tools wants to merge 10 commits into
Conversation
…lient hook CLI Adds engraphis.hooks + engraphis.hooks_cli (engraphis hooks install|briefing|capture) supporting Claude Code, Cursor, and Command Code with fail-closed secret rejection, normalized-hash workspace dedupe, and external poisoning provenance.
…NL unwrapping, BOM/control-char hardening) Unpacks resolve_workspace dict in hooks_cli, unwraps Claude Code message JSONL blocks, bounds hook busy_timeout to 500ms, falls back on unregistered repo, strips control chars before secret scan, and adds CLI/BOM/Cursor tests.
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 06c55504c2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…, and CodeQL gates Register engraphis-hooks in scripts/smoke_entry_points.py, remove em dashes from docs/designs/v1.8-passive-capture-and-hooks.md, rename the non-sensitive counter local variable in engraphis/hooks.py to clear CodeQL py/clear-text-logging-sensitive-data, and regenerate the SHA-256 bound offline benchmark evidence artifact and charts.
…closed on missing provenance Resolve installed hooks to the sibling engraphis-hooks wrapper or the absolute engraphis/hooks_cli.py file path (never adding CWD to sys.path), refuse symlinked settings/backup paths with O_CREAT|O_EXCL atomic backup creation, fail closed in build_session_briefing when provenance is missing, and refresh offline evidence.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ad37888a5a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…neural embedder on queryless hooks Address all 4 review findings: respect explicit max_chars < 120, fall back to workspace recall on ValidationError for unregistered repos, skip embed_model load on queryless SessionStart briefings, and guard embed_dim=None.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9568de37cf
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…ure security Register Cursor passive capture on afterAgentResponse with workspace_roots cwd fallback and uninstall cleanup for legacy stop entries; reject shell metacharacters and quote hook commands via shlex/list2cmdline; pin hook MemoryService strictly offline (extractor/graph_extractor/retention_supervisor=none, DeterministicQueryPlanner, read_only=True for briefing); bound stdin/file/transcript reads with O_NOFOLLOW and gate hook-mode stdin on isatty; check parent symlinks; short-circuit capture before opening service when no durable candidates exist; narrow Cursor entry matching; classify noop/quarantined/secret results accurately; refresh evidence and add regression tests.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
2-Agent Review & Optimization Summary (
|
The `briefing` command opened Store(read_only=True), which requires a checkpointed database (mode=ro&immutable=1) and raises whenever the MCP server or dashboard holds an active WAL. During a live coding session `--hook-mode` swallowed that error into an empty briefing and the manual CLI exited 1, so SessionStart context silently vanished. `_is_missing_local_db()` already prevents creating a database on disk, so open read-write instead. Deduplication scanned every active row in the workspace, ignoring repo and scope. A fact captured in repo "billing" therefore suppressed the same invariant in repo "checkout", even though checkout cannot recall billing. Restrict the scan to the same repo plus workspace-wide rows, resolving the repo name to its id. Also: * `extract_durable_candidates` truncated to max_candidates before deduplication and secret filtering, so repeated tail lines could starve genuinely new candidates. Accept a wider scan pool and cap accepted writes at max_candidates instead. * `briefing` parsed up to 64 KiB of transcript JSONL on every SessionStart only to discard the text. Add read_transcript=False so only the cwd/repo hints are extracted. * Widen the Windows shell metacharacter guard to include ", !, ;, $ and the backtick, which cmd.exe interprets even inside list2cmdline quoting.
`.git-commit-msg.tmp` was picked up by `git add -A` in the previous commit. It is a local scratch file and does not belong in the tree.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
1 similar comment
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
`tests/test_benchmark_evidence.py` hashes every `.py` under `engraphis/` and `eval/`, so the hooks and hooks_cli changes invalidated the committed registry artifact and failed the whole Python matrix. Export a new immutable artifact and repoint the test constants, README prefix, BENCHMARKS.md name/sha, and the fixture-suite digest. The SVGs and PNGs were regenerated from the new artifact so their embedded provenance matches.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Summary
Implements Release 1 (
v1.8) Slice 1A for zero-friction coding-agent memory adoption:docs/designs/v1.8-passive-capture-and-hooks.mdengraphis/hooks.py):build_session_briefing()routing empty queries viarecall_proactive()(with unregistered-repo fallback to workspace memories) and scoped queries viarecall(..., include_untrusted=False).extract_durable_candidates()andstage_passive_capture()with control-character stripping beforeengraphis.core.secretsfail-closed rejection/redaction, normalized-hash dedupe across active/pending/quarantined rows, and Claude Code JSONLmessageunwrapping +stop_hook_activeloop guard.~/.claude/settings.json), Cursor (.cursor/hooks.json,version: 1flat lists), and Command Code (~/.commandcode/settings.json, preserving legacycc-engraphis-session-start).engraphis/hooks_cli.py, wired intoscripts/entry.py+pyproject.tomlasengraphis hooks/engraphis-hooks):engraphis/so target repos with./scripts/cannot shadow hook execution.resolve_workspace()dict cleanly, bounds--hook-modeSQLitebusy_timeoutto500ms, forwards fullsettingsservice parameters, and short-circuits missing DBs on read-only briefings without creating empty files.engraphis/core/poisoning.py): Registers"passive-hook"inEXTERNAL_SOURCES(review_state="pending",prompt_eligible=False).Verification
pytest tests/test_hooks_and_passive_capture.py tests/test_poisoning.py tests/test_secret_hygiene.py tests/test_secrets_edge_cases.py tests/test_session_start_hook.py tests/test_install_cc_hook.py-> 126 passed, 3 skipped (Windows POSIX-only skips;10/10new tests pass)ruff check engraphis/hooks.py engraphis/hooks_cli.py engraphis/core/poisoning.py scripts/entry.py tests/test_hooks_and_passive_capture.py-> All checks passedpyrighton changed module/test files -> 0 errorsast.parse(..., feature_version=(3, 9))) -> 5/5 passed