Skip to content

docs: audit aelfrice hook injection (refs #220) - #278

Merged
robotrocketscience merged 1 commit into
mainfrom
docs/issue-220-hook-injection-audit-v2
Apr 29, 2026
Merged

docs: audit aelfrice hook injection (refs #220)#278
robotrocketscience merged 1 commit into
mainfrom
docs/issue-220-hook-injection-audit-v2

Conversation

@robotrocketscience

Copy link
Copy Markdown
Owner

Audit + characterisation of the two hook paths that inject aelfrice belief context into live sessions: UserPromptSubmit (per-prompt) and PreToolUse on Grep/Glob (per-tool-call). No code changes; the doc proposes three bounded tuning recommendations.

Replaces the previous PR (#268) which had an unrelated private project codename baked into one of its commits; even after redaction at tip, scoped history-scan still saw it in the PR's incoming range. This branch starts from main with one clean commit.

Closes #220. Refs #272.

Audit + characterisation of the two hook paths that inject aelfrice
belief context into live sessions: UserPromptSubmit (per-prompt) and
PreToolUse on Grep/Glob (per-tool-call). No code changes.

Documents query construction, retrieval layers invoked, token budgets,
relevance-filter mismatch, corpus-path resolution, and proposes three
bounded tuning recommendations.

Supersedes the previous PR #268 branch which carried an unrelated
private project codename in two lines and could not pass history-scan
even after the codename was redacted from the tip.

Closes #220.
@robotrocketscience

Copy link
Copy Markdown
Owner Author

Review: nearly clean — one fixup needed.

Line numbers drift in the recommendations against current src/:

Claim Doc says Actual (src/)
_escape_fts5_query in store.py 219 294
db_path in cli.py 214 230
_l1_hits in retrieval.py 646 732
_extract_query in hook_search_tool.py 496 496 ✓

Looks like the audit was written against installed package line numbers (site-packages/aelfrice/) rather than src/. Since the doc is forward-pointing (recs #1, #3 cite specific line ranges), readers applying the recs will miss the target. Either re-anchor to src/ or drop the line N and just point at the function name.

Otherwise: technical claims hold (verified _escape_fts5_query whitespace-tokenises and quote-wraps; the OR-keyword AND-trap is real), CI green, no discretion hits, the audit is the most thorough characterisation of the injection paths I've seen.

Push the line-number fix and this is mergeable. Dropping review label.

@robotrocketscience robotrocketscience removed the review-Kulili PR coordination mutex label Apr 29, 2026
@robotrocketscience
robotrocketscience merged commit 1612300 into main Apr 29, 2026
8 checks passed
@robotrocketscience
robotrocketscience deleted the docs/issue-220-hook-injection-audit-v2 branch April 29, 2026 01:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author-Gylf PR coordination mutex

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[debug] Audit aelfrice hook injection — UserPromptSubmit + PreToolUse on Grep/Glob

1 participant