Skip to content

Distinguish human-typed prompts from tool results in Claude history - #68

Open
tony wants to merge 5 commits into
masterfrom
agentgrep-human-typed-prompts
Open

Distinguish human-typed prompts from tool results in Claude history#68
tony wants to merge 5 commits into
masterfrom
agentgrep-human-typed-prompts

Conversation

@tony

@tony tony commented Jun 14, 2026

Copy link
Copy Markdown
Owner

Summary

  • Fix the Claude Code adapter so prompt search no longer treats tool results and subagent output as human-typed prompts. Claude records tool_result blocks, <local-command-stdout>, the [Request interrupted] marker, and subagent transcripts as type=user messages, so a user-role turn is not reliably a typed prompt.
  • Add claude_event_is_human_authored(), which classifies a Claude project JSONL event by structure (tool_result/tool_use blocks, the toolUseResult marker, isSidechain, non-user event types, and machine-authored string content).
  • Thread the verdict through parse_claude_project_file into build_search_record(human_typed=...), which sets metadata["human_typed"]=False only for non-human turns.

This is additive: a normal record's metadata stays empty, so existing consumers and tests are unchanged — the new signal is opt-in for anything (search ranking, analytics, the in-progress insights work) that wants to filter to the user's actual asks.

On a real history sample, 397 of 436 user-role records were tool/sidechain noise rather than typed prompts; the tag makes that separable.

Test plan

  • tests/test_claude_human_typed.py — parametrized cases for string prompts, text-block prompts, tool_result/tool_use blocks, isSidechain, assistant events, <local-command-stdout>, and the list-form [Request interrupted] marker, plus the additive-metadata behavior of build_search_record.
  • ruff check, ruff format, ty check clean.
  • Existing Claude parser tests pass (the change is additive).

Goal

Idempotent completion condition for /goal. It asserts an end state, not an action: if the state already holds, the first evaluation passes and nothing is edited.

/goal Work only in the existing worktree for local branch agentgrep-human-typed-prompts, never in the shared master tree; never push, and no commit, PR or merge is part of this condition. FIRST report there: git rev-parse --abbrev-ref HEAD; git merge-base --is-ancestor master HEAD && echo ANCESTOR-OK || echo NEEDS-REBASE, which prints NEEDS-REBASE today against the local master ref; rg -n human docs/library/query-language.md, which matches nothing today while that page says the registry ships sixteen fields; and NO_COLOR=1 env -u VIRTUAL_ENV -u UV_NO_SYNC .venv/bin/python -m pytest -m "" --reruns 0 -q, moving any untracked scripts/benchmark.local.toml aside first. End state: HEAD is that branch, ANCESTOR-OK prints, that page carries a human:true|false row in the record-level field table with the field count corrected, agentgrep.query.help.query_language_fields reflects the field, pytest exits 0, and uv run ty check, uv run ruff check . and just build-docs succeed there. With the field omitted, search, grep, find, CLI JSON/NDJSON and MCP results match master because metadata stays empty for human-authored turns, and an agcur1: cursor minted before this change still parses with an unchanged payload version. Constraints: keep the signal additive - an absent metadata['human_typed'] means human-authored, and nothing may treat it as an identity, authorship-provenance or dedupe contract that #80 or #142 would have to break. Do not retire, re-version or re-encode agcur1:, and do not change offset or limit semantics; cursor evolution is separate work. Do not extend the classifier to agents the branch does not already cover, and do not filter human-authored turns by default anywhere. Or stop after 10 turns and report what remains.
  • Proofgit rev-parse --abbrev-ref HEAD && git merge-base --is-ancestor master HEAD && rg -n human docs/library/query-language.md && NO_COLOR=1 env -u VIRTUAL_ENV -u UV_NO_SYNC .venv/bin/python -m pytest -m "" --reruns 0 -q (run in that worktree)
  • Idempotence — Re-running when the branch already contains local master and the human row and corrected count are already on the page reproduces the same four reports and edits nothing.
  • Blocked by — nothing
  • Blocks — nothing hard; Insights graph similarity engine + non-gated transformers LLM defaults #69 may bundle these commits or drop them behind a capability check
  • Preserves — metadata['human_typed'] stays an additive opt-in signal, not an identity or provenance contract, so Deterministic IDs for conversations / prompts #80's content id and Durable prompt corpus and derived search indexes (ADR 0019) #142's corpus keys stay free; agcur1: keeps its payload version and offset/limit semantics, leaving cursor retirement open; default field-omitted behaviour is byte-identical to master, so no shipped result set moves.

tony added a commit that referenced this pull request Jun 14, 2026
why: PR #68 separated Claude's typed prompts from tool results, but the
same flattening happens in Codex (function_call_output) and Grok
(tool_use/tool_result), and the human/tool tag was only reachable from
the graph engine. Tagging every adapter that carries inline tool-output
and exposing it as a `human:` query field lets `agentgrep
search`/`grep` and the MCP server filter the user's real asks from tool
noise.

what:
- Add codex_event_is_human_authored() and tag Codex response_item
  records; function_call/function_call_output/reasoning are non-human.
- Tag Grok tool_use/tool_result turns with metadata["human_typed"]=False.
- Register a record-layer `human` enum field (true/false) and dispatch
  it in the query compiler: human:true keeps untagged turns, human:false
  selects tool/agent output.
- Cover the Codex detector, Grok tagging, and the human: predicate.
tony added a commit that referenced this pull request Jun 14, 2026
why: PR #68 separated Claude's typed prompts from tool results, but the
same flattening happens in Codex (function_call_output) and Grok
(tool_use/tool_result), and the human/tool tag was only reachable from
the graph engine. Tagging every adapter that carries inline tool-output
and exposing it as a `human:` query field lets `agentgrep
search`/`grep` and the MCP server filter the user's real asks from tool
noise.

what:
- Add codex_event_is_human_authored() and tag Codex response_item
  records; function_call/function_call_output/reasoning are non-human.
- Tag Grok tool_use/tool_result turns with metadata["human_typed"]=False.
- Register a record-layer `human` enum field (true/false) and dispatch
  it in the query compiler: human:true keeps untagged turns, human:false
  selects tool/agent output.
- Cover the Codex detector, Grok tagging, and the human: predicate.
@tony
tony force-pushed the agentgrep-human-typed-prompts branch from 025f037 to 22f79f3 Compare June 14, 2026 20:32
tony added a commit that referenced this pull request Jun 14, 2026
…ted transformers LLM defaults

why: The insights ladder ended at the L5 narrative summary over a single
gated Gemma model. Users had no way to see which prompts they repeat,
which past conversations resemble the one in front of them, or which
workflows are worth saving as Skills — and the only GPU summary path
required an HF token plus an accepted license. This adds the `graph`
enrichment level and makes the local-LLM backend work out of the box.

what:
- Add the `graph` level: a prompt/reply/conversation similarity network
  (sentence-transformers or model2vec embeddings, optional HDBSCAN
  archetype clustering, sqlite-vec or LanceDB IVF-PQ vector store) that
  surfaces recurring asks, forgotten-but-similar conversations, and mined
  workflows, persisted incrementally in a content-hash-keyed graph store.
- Draft reusable Skills (SKILL.md) from mined workflows, print-by-default,
  also exposed over an `insights_skills` MCP tool.
- Add a transformers/CUDA LLM backend with a non-gated default chain that
  needs no HF token: Phi-4-mini (4-bit, native phi3), SmolLM2-1.7B (fp16),
  Granite-3.3-2b (4-bit), tried in order until one loads. gemma-3-1b-it
  stays curated but gated and is no longer the default. 4-bit weights load
  through bitsandbytes NF4 behind the insights-llm-transformers-quant extra.
- Add optional conversation-summary vectors: each conversation is embedded
  by a cached LLM one-line summary instead of a prompt mean, sharpening
  forgotten-but-similar.
- Bundle the #68 human-typed prompt detection (human: query field,
  Claude/Codex authored-turn tagging) so the branch hand-tests
  self-contained; it overlaps with that PR and should be reconciled at
  merge time.
tony added a commit that referenced this pull request Jun 22, 2026
why: PR #68 separated Claude's typed prompts from tool results, but the
same flattening happens in Codex (function_call_output) and Grok
(tool_use/tool_result), and the human/tool tag was only reachable from
the graph engine. Tagging every adapter that carries inline tool-output
and exposing it as a `human:` query field lets `agentgrep
search`/`grep` and the MCP server filter the user's real asks from tool
noise.

what:
- Add codex_event_is_human_authored() and tag Codex response_item
  records; function_call/function_call_output/reasoning are non-human.
- Tag Grok tool_use/tool_result turns with metadata["human_typed"]=False.
- Register a record-layer `human` enum field (true/false) and dispatch
  it in the query compiler: human:true keeps untagged turns, human:false
  selects tool/agent output.
- Cover the Codex detector, Grok tagging, and the human: predicate.
@tony
tony force-pushed the agentgrep-human-typed-prompts branch from 22f79f3 to ca905ec Compare June 22, 2026 11:41
tony added a commit that referenced this pull request Jun 22, 2026
…ted transformers LLM defaults

why: The insights ladder ended at the L5 narrative summary over a single
gated Gemma model. Users had no way to see which prompts they repeat,
which past conversations resemble the one in front of them, or which
workflows are worth saving as Skills — and the only GPU summary path
required an HF token plus an accepted license. This adds the `graph`
enrichment level and makes the local-LLM backend work out of the box.

what:
- Add the `graph` level: a prompt/reply/conversation similarity network
  (sentence-transformers or model2vec embeddings, optional HDBSCAN
  archetype clustering, sqlite-vec or LanceDB IVF-PQ vector store) that
  surfaces recurring asks, forgotten-but-similar conversations, and mined
  workflows, persisted incrementally in a content-hash-keyed graph store.
- Draft reusable Skills (SKILL.md) from mined workflows, print-by-default,
  also exposed over an `insights_skills` MCP tool.
- Add a transformers/CUDA LLM backend with a non-gated default chain that
  needs no HF token: Phi-4-mini (4-bit, native phi3), SmolLM2-1.7B (fp16),
  Granite-3.3-2b (4-bit), tried in order until one loads. gemma-3-1b-it
  stays curated but gated and is no longer the default. 4-bit weights load
  through bitsandbytes NF4 behind the insights-llm-transformers-quant extra.
- Add optional conversation-summary vectors: each conversation is embedded
  by a cached LLM one-line summary instead of a prompt mean, sharpening
  forgotten-but-similar.
- Bundle the #68 human-typed prompt detection (human: query field,
  Claude/Codex authored-turn tagging) so the branch hand-tests
  self-contained; it overlaps with that PR and should be reconciled at
  merge time.
tony added a commit that referenced this pull request Jun 27, 2026
…ted transformers LLM defaults

why: The insights ladder ended at the L5 narrative summary over a single
gated Gemma model. Users had no way to see which prompts they repeat,
which past conversations resemble the one in front of them, or which
workflows are worth saving as Skills — and the only GPU summary path
required an HF token plus an accepted license. This adds the `graph`
enrichment level and makes the local-LLM backend work out of the box.

what:
- Add the `graph` level: a prompt/reply/conversation similarity network
  (sentence-transformers or model2vec embeddings, optional HDBSCAN
  archetype clustering, sqlite-vec or LanceDB IVF-PQ vector store) that
  surfaces recurring asks, forgotten-but-similar conversations, and mined
  workflows, persisted incrementally in a content-hash-keyed graph store.
- Draft reusable Skills (SKILL.md) from mined workflows, print-by-default,
  also exposed over an `insights_skills` MCP tool.
- Add a transformers/CUDA LLM backend with a non-gated default chain that
  needs no HF token: Phi-4-mini (4-bit, native phi3), SmolLM2-1.7B (fp16),
  Granite-3.3-2b (4-bit), tried in order until one loads. gemma-3-1b-it
  stays curated but gated and is no longer the default. 4-bit weights load
  through bitsandbytes NF4 behind the insights-llm-transformers-quant extra.
- Add optional conversation-summary vectors: each conversation is embedded
  by a cached LLM one-line summary instead of a prompt mean, sharpening
  forgotten-but-similar.
- Bundle the #68 human-typed prompt detection (human: query field,
  Claude/Codex authored-turn tagging) so the branch hand-tests
  self-contained; it overlaps with that PR and should be reconciled at
  merge time.
@tony
tony force-pushed the agentgrep-human-typed-prompts branch from ca905ec to ea37d76 Compare June 27, 2026 18:47
tony added a commit that referenced this pull request Jun 28, 2026
why: PR #68 separated Claude's typed prompts from tool results, but the
same flattening happens in Codex (function_call_output) and Grok
(tool_use/tool_result), and the human/tool tag was only reachable from
the graph engine. Tagging every adapter that carries inline tool-output
and exposing it as a `human:` query field lets `agentgrep
search`/`grep` and the MCP server filter the user's real asks from tool
noise.

what:
- Add codex_event_is_human_authored() and tag Codex response_item
  records; function_call/function_call_output/reasoning are non-human.
- Tag Grok tool_use/tool_result turns with metadata["human_typed"]=False.
- Register a record-layer `human` enum field (true/false) and dispatch
  it in the query compiler: human:true keeps untagged turns, human:false
  selects tool/agent output.
- Cover the Codex detector, Grok tagging, and the human: predicate.
@tony
tony force-pushed the agentgrep-human-typed-prompts branch from ea37d76 to 82103fc Compare June 28, 2026 17:05
tony added a commit that referenced this pull request Jun 28, 2026
…ted transformers LLM defaults

why: The insights ladder ended at the L5 narrative summary over a single
gated Gemma model. Users had no way to see which prompts they repeat,
which past conversations resemble the one in front of them, or which
workflows are worth saving as Skills — and the only GPU summary path
required an HF token plus an accepted license. This adds the `graph`
enrichment level and makes the local-LLM backend work out of the box.

what:
- Add the `graph` level: a prompt/reply/conversation similarity network
  (sentence-transformers or model2vec embeddings, optional HDBSCAN
  archetype clustering, sqlite-vec or LanceDB IVF-PQ vector store) that
  surfaces recurring asks, forgotten-but-similar conversations, and mined
  workflows, persisted incrementally in a content-hash-keyed graph store.
- Draft reusable Skills (SKILL.md) from mined workflows, print-by-default,
  also exposed over an `insights_skills` MCP tool.
- Add a transformers/CUDA LLM backend with a non-gated default chain that
  needs no HF token: Phi-4-mini (4-bit, native phi3), SmolLM2-1.7B (fp16),
  Granite-3.3-2b (4-bit), tried in order until one loads. gemma-3-1b-it
  stays curated but gated and is no longer the default. 4-bit weights load
  through bitsandbytes NF4 behind the insights-llm-transformers-quant extra.
- Add optional conversation-summary vectors: each conversation is embedded
  by a cached LLM one-line summary instead of a prompt mean, sharpening
  forgotten-but-similar.
- Bundle the #68 human-typed prompt detection (human: query field,
  Claude/Codex authored-turn tagging) so the branch hand-tests
  self-contained; it overlaps with that PR and should be reconciled at
  merge time.
tony added a commit that referenced this pull request Jun 28, 2026
why: PR #68 separated Claude's typed prompts from tool results, but the
same flattening happens in Codex (function_call_output) and Grok
(tool_use/tool_result), and the human/tool tag was only reachable from
the graph engine. Tagging every adapter that carries inline tool-output
and exposing it as a `human:` query field lets `agentgrep
search`/`grep` and the MCP server filter the user's real asks from tool
noise.

what:
- Add codex_event_is_human_authored() and tag Codex response_item
  records; function_call/function_call_output/reasoning are non-human.
- Tag Grok tool_use/tool_result turns with metadata["human_typed"]=False.
- Register a record-layer `human` enum field (true/false) and dispatch
  it in the query compiler: human:true keeps untagged turns, human:false
  selects tool/agent output.
- Cover the Codex detector, Grok tagging, and the human: predicate.
@tony
tony force-pushed the agentgrep-human-typed-prompts branch from 82103fc to 8486ee4 Compare June 28, 2026 17:46
tony added a commit that referenced this pull request Jun 28, 2026
…ted transformers LLM defaults

why: The insights ladder ended at the L5 narrative summary over a single
gated Gemma model. Users had no way to see which prompts they repeat,
which past conversations resemble the one in front of them, or which
workflows are worth saving as Skills — and the only GPU summary path
required an HF token plus an accepted license. This adds the `graph`
enrichment level and makes the local-LLM backend work out of the box.

what:
- Add the `graph` level: a prompt/reply/conversation similarity network
  (sentence-transformers or model2vec embeddings, optional HDBSCAN
  archetype clustering, sqlite-vec or LanceDB IVF-PQ vector store) that
  surfaces recurring asks, forgotten-but-similar conversations, and mined
  workflows, persisted incrementally in a content-hash-keyed graph store.
- Draft reusable Skills (SKILL.md) from mined workflows, print-by-default,
  also exposed over an `insights_skills` MCP tool.
- Add a transformers/CUDA LLM backend with a non-gated default chain that
  needs no HF token: Phi-4-mini (4-bit, native phi3), SmolLM2-1.7B (fp16),
  Granite-3.3-2b (4-bit), tried in order until one loads. gemma-3-1b-it
  stays curated but gated and is no longer the default. 4-bit weights load
  through bitsandbytes NF4 behind the insights-llm-transformers-quant extra.
- Add optional conversation-summary vectors: each conversation is embedded
  by a cached LLM one-line summary instead of a prompt mean, sharpening
  forgotten-but-similar.
- Bundle the #68 human-typed prompt detection (human: query field,
  Claude/Codex authored-turn tagging) so the branch hand-tests
  self-contained; it overlaps with that PR and should be reconciled at
  merge time.
tony added a commit that referenced this pull request Jul 4, 2026
why: PR #68 separated Claude's typed prompts from tool results, but the
same flattening happens in Codex (function_call_output) and Grok
(tool_use/tool_result), and the human/tool tag was only reachable from
the graph engine. Tagging every adapter that carries inline tool-output
and exposing it as a `human:` query field lets `agentgrep
search`/`grep` and the MCP server filter the user's real asks from tool
noise.

what:
- Add codex_event_is_human_authored() and tag Codex response_item
  records; function_call/function_call_output/reasoning are non-human.
- Tag Grok tool_use/tool_result turns with metadata["human_typed"]=False.
- Register a record-layer `human` enum field (true/false) and dispatch
  it in the query compiler: human:true keeps untagged turns, human:false
  selects tool/agent output.
- Cover the Codex detector, Grok tagging, and the human: predicate.
@tony
tony force-pushed the agentgrep-human-typed-prompts branch from 8486ee4 to 72a6470 Compare July 4, 2026 12:24
tony added a commit that referenced this pull request Jul 4, 2026
…ted transformers LLM defaults

why: The insights ladder ended at the L5 narrative summary over a single
gated Gemma model. Users had no way to see which prompts they repeat,
which past conversations resemble the one in front of them, or which
workflows are worth saving as Skills — and the only GPU summary path
required an HF token plus an accepted license. This adds the `graph`
enrichment level and makes the local-LLM backend work out of the box.

what:
- Add the `graph` level: a prompt/reply/conversation similarity network
  (sentence-transformers or model2vec embeddings, optional HDBSCAN
  archetype clustering, sqlite-vec or LanceDB IVF-PQ vector store) that
  surfaces recurring asks, forgotten-but-similar conversations, and mined
  workflows, persisted incrementally in a content-hash-keyed graph store.
- Draft reusable Skills (SKILL.md) from mined workflows, print-by-default,
  also exposed over an `insights_skills` MCP tool.
- Add a transformers/CUDA LLM backend with a non-gated default chain that
  needs no HF token: Phi-4-mini (4-bit, native phi3), SmolLM2-1.7B (fp16),
  Granite-3.3-2b (4-bit), tried in order until one loads. gemma-3-1b-it
  stays curated but gated and is no longer the default. 4-bit weights load
  through bitsandbytes NF4 behind the insights-llm-transformers-quant extra.
- Add optional conversation-summary vectors: each conversation is embedded
  by a cached LLM one-line summary instead of a prompt mean, sharpening
  forgotten-but-similar.
- Bundle the #68 human-typed prompt detection (human: query field,
  Claude/Codex authored-turn tagging) so the branch hand-tests
  self-contained; it overlaps with that PR and should be reconciled at
  merge time.
tony added a commit that referenced this pull request Jul 5, 2026
why: PR #68 separated Claude's typed prompts from tool results, but the
same flattening happens in Codex (function_call_output) and Grok
(tool_use/tool_result), and the human/tool tag was only reachable from
the graph engine. Tagging every adapter that carries inline tool-output
and exposing it as a `human:` query field lets `agentgrep
search`/`grep` and the MCP server filter the user's real asks from tool
noise.

what:
- Add codex_event_is_human_authored() and tag Codex response_item
  records; function_call/function_call_output/reasoning are non-human.
- Tag Grok tool_use/tool_result turns with metadata["human_typed"]=False.
- Register a record-layer `human` enum field (true/false) and dispatch
  it in the query compiler: human:true keeps untagged turns, human:false
  selects tool/agent output.
- Cover the Codex detector, Grok tagging, and the human: predicate.
@tony
tony force-pushed the agentgrep-human-typed-prompts branch from 72a6470 to 77e1d72 Compare July 5, 2026 12:57
tony added a commit that referenced this pull request Jul 18, 2026
…ted transformers LLM defaults

why: The insights ladder ended at the L5 narrative summary over a single
gated Gemma model. Users had no way to see which prompts they repeat,
which past conversations resemble the one in front of them, or which
workflows are worth saving as Skills — and the only GPU summary path
required an HF token plus an accepted license. This adds the `graph`
enrichment level and makes the local-LLM backend work out of the box.

what:
- Add the `graph` level: a prompt/reply/conversation similarity network
  (sentence-transformers or model2vec embeddings, optional HDBSCAN
  archetype clustering, sqlite-vec or LanceDB IVF-PQ vector store) that
  surfaces recurring asks, forgotten-but-similar conversations, and mined
  workflows, persisted incrementally in a content-hash-keyed graph store.
- Draft reusable Skills (SKILL.md) from mined workflows, print-by-default,
  also exposed over an `insights_skills` MCP tool.
- Add a transformers/CUDA LLM backend with a non-gated default chain that
  needs no HF token: Phi-4-mini (4-bit, native phi3), SmolLM2-1.7B (fp16),
  Granite-3.3-2b (4-bit), tried in order until one loads. gemma-3-1b-it
  stays curated but gated and is no longer the default. 4-bit weights load
  through bitsandbytes NF4 behind the insights-llm-transformers-quant extra.
- Add optional conversation-summary vectors: each conversation is embedded
  by a cached LLM one-line summary instead of a prompt mean, sharpening
  forgotten-but-similar.
- Bundle the #68 human-typed prompt detection (human: query field,
  Claude/Codex authored-turn tagging) so the branch hand-tests
  self-contained; it overlaps with that PR and should be reconciled at
  merge time.
tony added a commit that referenced this pull request Jul 19, 2026
why: PR #68 separated Claude's typed prompts from tool results, but the
same flattening happens in Codex (function_call_output) and Grok
(tool_use/tool_result), and the human/tool tag was only reachable from
the graph engine. Tagging every adapter that carries inline tool-output
and exposing it as a `human:` query field lets `agentgrep
search`/`grep` and the MCP server filter the user's real asks from tool
noise.

what:
- Add codex_event_is_human_authored() and tag Codex response_item
  records; function_call/function_call_output/reasoning are non-human.
- Tag Grok tool_use/tool_result turns with metadata["human_typed"]=False.
- Register a record-layer `human` enum field (true/false) and dispatch
  it in the query compiler: human:true keeps untagged turns, human:false
  selects tool/agent output.
- Cover the Codex detector, Grok tagging, and the human: predicate.
@tony
tony force-pushed the agentgrep-human-typed-prompts branch from 0469bb0 to f9bacf2 Compare July 19, 2026 00:34
tony added a commit that referenced this pull request Jul 19, 2026
…ted transformers LLM defaults

why: The insights ladder ended at the L5 narrative summary over a single
gated Gemma model. Users had no way to see which prompts they repeat,
which past conversations resemble the one in front of them, or which
workflows are worth saving as Skills — and the only GPU summary path
required an HF token plus an accepted license. This adds the `graph`
enrichment level and makes the local-LLM backend work out of the box.

what:
- Add the `graph` level: a prompt/reply/conversation similarity network
  (sentence-transformers or model2vec embeddings, optional HDBSCAN
  archetype clustering, sqlite-vec or LanceDB IVF-PQ vector store) that
  surfaces recurring asks, forgotten-but-similar conversations, and mined
  workflows, persisted incrementally in a content-hash-keyed graph store.
- Draft reusable Skills (SKILL.md) from mined workflows, print-by-default,
  also exposed over an `insights_skills` MCP tool.
- Add a transformers/CUDA LLM backend with a non-gated default chain that
  needs no HF token: Phi-4-mini (4-bit, native phi3), SmolLM2-1.7B (fp16),
  Granite-3.3-2b (4-bit), tried in order until one loads. gemma-3-1b-it
  stays curated but gated and is no longer the default. 4-bit weights load
  through bitsandbytes NF4 behind the insights-llm-transformers-quant extra.
- Add optional conversation-summary vectors: each conversation is embedded
  by a cached LLM one-line summary instead of a prompt mean, sharpening
  forgotten-but-similar.
- Bundle the #68 human-typed prompt detection (human: query field,
  Claude/Codex authored-turn tagging) so the branch hand-tests
  self-contained; it overlaps with that PR and should be reconciled at
  merge time.
tony added a commit that referenced this pull request Jul 19, 2026
why: PR #68 separated Claude's typed prompts from tool results, but the
same flattening happens in Codex (function_call_output) and Grok
(tool_use/tool_result), and the human/tool tag was only reachable from
the graph engine. Tagging every adapter that carries inline tool-output
and exposing it as a `human:` query field lets `agentgrep
search`/`grep` and the MCP server filter the user's real asks from tool
noise.

what:
- Add codex_event_is_human_authored() and tag Codex response_item
  records; function_call/function_call_output/reasoning are non-human.
- Tag Grok tool_use/tool_result turns with metadata["human_typed"]=False.
- Register a record-layer `human` enum field (true/false) and dispatch
  it in the query compiler: human:true keeps untagged turns, human:false
  selects tool/agent output.
- Cover the Codex detector, Grok tagging, and the human: predicate.
@tony
tony force-pushed the agentgrep-human-typed-prompts branch from f9bacf2 to 4565da0 Compare July 19, 2026 01:39
tony added a commit that referenced this pull request Jul 19, 2026
…ted transformers LLM defaults

why: The insights ladder ended at the L5 narrative summary over a single
gated Gemma model. Users had no way to see which prompts they repeat,
which past conversations resemble the one in front of them, or which
workflows are worth saving as Skills — and the only GPU summary path
required an HF token plus an accepted license. This adds the `graph`
enrichment level and makes the local-LLM backend work out of the box.

what:
- Add the `graph` level: a prompt/reply/conversation similarity network
  (sentence-transformers or model2vec embeddings, optional HDBSCAN
  archetype clustering, sqlite-vec or LanceDB IVF-PQ vector store) that
  surfaces recurring asks, forgotten-but-similar conversations, and mined
  workflows, persisted incrementally in a content-hash-keyed graph store.
- Draft reusable Skills (SKILL.md) from mined workflows, print-by-default,
  also exposed over an `insights_skills` MCP tool.
- Add a transformers/CUDA LLM backend with a non-gated default chain that
  needs no HF token: Phi-4-mini (4-bit, native phi3), SmolLM2-1.7B (fp16),
  Granite-3.3-2b (4-bit), tried in order until one loads. gemma-3-1b-it
  stays curated but gated and is no longer the default. 4-bit weights load
  through bitsandbytes NF4 behind the insights-llm-transformers-quant extra.
- Add optional conversation-summary vectors: each conversation is embedded
  by a cached LLM one-line summary instead of a prompt mean, sharpening
  forgotten-but-similar.
- Bundle the #68 human-typed prompt detection (human: query field,
  Claude/Codex authored-turn tagging) so the branch hand-tests
  self-contained; it overlaps with that PR and should be reconciled at
  merge time.
tony added a commit that referenced this pull request Jul 19, 2026
why: PR #68 separated Claude's typed prompts from tool results, but the
same flattening happens in Codex (function_call_output) and Grok
(tool_use/tool_result), and the human/tool tag was only reachable from
the graph engine. Tagging every adapter that carries inline tool-output
and exposing it as a `human:` query field lets `agentgrep
search`/`grep` and the MCP server filter the user's real asks from tool
noise.

what:
- Add codex_event_is_human_authored() and tag Codex response_item
  records; function_call/function_call_output/reasoning are non-human.
- Tag Grok tool_use/tool_result turns with metadata["human_typed"]=False.
- Register a record-layer `human` enum field (true/false) and dispatch
  it in the query compiler: human:true keeps untagged turns, human:false
  selects tool/agent output.
- Cover the Codex detector, Grok tagging, and the human: predicate.
@tony
tony force-pushed the agentgrep-human-typed-prompts branch from 4565da0 to cb74de1 Compare July 19, 2026 17:03
tony added a commit that referenced this pull request Jul 19, 2026
…ted transformers LLM defaults

why: The insights ladder ended at the L5 narrative summary over a single
gated Gemma model. Users had no way to see which prompts they repeat,
which past conversations resemble the one in front of them, or which
workflows are worth saving as Skills — and the only GPU summary path
required an HF token plus an accepted license. This adds the `graph`
enrichment level and makes the local-LLM backend work out of the box.

what:
- Add the `graph` level: a prompt/reply/conversation similarity network
  (sentence-transformers or model2vec embeddings, optional HDBSCAN
  archetype clustering, sqlite-vec or LanceDB IVF-PQ vector store) that
  surfaces recurring asks, forgotten-but-similar conversations, and mined
  workflows, persisted incrementally in a content-hash-keyed graph store.
- Draft reusable Skills (SKILL.md) from mined workflows, print-by-default,
  also exposed over an `insights_skills` MCP tool.
- Add a transformers/CUDA LLM backend with a non-gated default chain that
  needs no HF token: Phi-4-mini (4-bit, native phi3), SmolLM2-1.7B (fp16),
  Granite-3.3-2b (4-bit), tried in order until one loads. gemma-3-1b-it
  stays curated but gated and is no longer the default. 4-bit weights load
  through bitsandbytes NF4 behind the insights-llm-transformers-quant extra.
- Add optional conversation-summary vectors: each conversation is embedded
  by a cached LLM one-line summary instead of a prompt mean, sharpening
  forgotten-but-similar.
- Bundle the #68 human-typed prompt detection (human: query field,
  Claude/Codex authored-turn tagging) so the branch hand-tests
  self-contained; it overlaps with that PR and should be reconciled at
  merge time.
tony added a commit that referenced this pull request Jul 19, 2026
why: PR #68 separated Claude's typed prompts from tool results, but the
same flattening happens in Codex (function_call_output) and Grok
(tool_use/tool_result), and the human/tool tag was only reachable from
the graph engine. Tagging every adapter that carries inline tool-output
and exposing it as a `human:` query field lets `agentgrep
search`/`grep` and the MCP server filter the user's real asks from tool
noise.

what:
- Add codex_event_is_human_authored() and tag Codex response_item
  records; function_call/function_call_output/reasoning are non-human.
- Tag Grok tool_use/tool_result turns with metadata["human_typed"]=False.
- Register a record-layer `human` enum field (true/false) and dispatch
  it in the query compiler: human:true keeps untagged turns, human:false
  selects tool/agent output.
- Cover the Codex detector, Grok tagging, and the human: predicate.
@tony
tony force-pushed the agentgrep-human-typed-prompts branch from cb74de1 to c720583 Compare July 19, 2026 23:10
tony added a commit that referenced this pull request Jul 19, 2026
…ted transformers LLM defaults

why: The insights ladder ended at the L5 narrative summary over a single
gated Gemma model. Users had no way to see which prompts they repeat,
which past conversations resemble the one in front of them, or which
workflows are worth saving as Skills — and the only GPU summary path
required an HF token plus an accepted license. This adds the `graph`
enrichment level and makes the local-LLM backend work out of the box.

what:
- Add the `graph` level: a prompt/reply/conversation similarity network
  (sentence-transformers or model2vec embeddings, optional HDBSCAN
  archetype clustering, sqlite-vec or LanceDB IVF-PQ vector store) that
  surfaces recurring asks, forgotten-but-similar conversations, and mined
  workflows, persisted incrementally in a content-hash-keyed graph store.
- Draft reusable Skills (SKILL.md) from mined workflows, print-by-default,
  also exposed over an `insights_skills` MCP tool.
- Add a transformers/CUDA LLM backend with a non-gated default chain that
  needs no HF token: Phi-4-mini (4-bit, native phi3), SmolLM2-1.7B (fp16),
  Granite-3.3-2b (4-bit), tried in order until one loads. gemma-3-1b-it
  stays curated but gated and is no longer the default. 4-bit weights load
  through bitsandbytes NF4 behind the insights-llm-transformers-quant extra.
- Add optional conversation-summary vectors: each conversation is embedded
  by a cached LLM one-line summary instead of a prompt mean, sharpening
  forgotten-but-similar.
- Bundle the #68 human-typed prompt detection (human: query field,
  Claude/Codex authored-turn tagging) so the branch hand-tests
  self-contained; it overlaps with that PR and should be reconciled at
  merge time.
tony added a commit that referenced this pull request Aug 1, 2026
why: PR #68 separated Claude's typed prompts from tool results, but the
same flattening happens in Codex (function_call_output) and Grok
(tool_use/tool_result), and the human/tool tag was only reachable from
the graph engine. Tagging every adapter that carries inline tool-output
and exposing it as a `human:` query field lets `agentgrep
search`/`grep` and the MCP server filter the user's real asks from tool
noise.

what:
- Add codex_event_is_human_authored() and tag Codex response_item
  records; function_call/function_call_output/reasoning are non-human.
- Tag Grok tool_use/tool_result turns with metadata["human_typed"]=False.
- Register a record-layer `human` enum field (true/false) and dispatch
  it in the query compiler: human:true keeps untagged turns, human:false
  selects tool/agent output.
- Cover the Codex detector, Grok tagging, and the human: predicate.
@tony
tony force-pushed the agentgrep-human-typed-prompts branch from c720583 to 4c8e4e5 Compare August 1, 2026 18:24
tony added a commit that referenced this pull request Aug 1, 2026
…ted transformers LLM defaults

why: The insights ladder ended at the L5 narrative summary over a single
gated Gemma model. Users had no way to see which prompts they repeat,
which past conversations resemble the one in front of them, or which
workflows are worth saving as Skills — and the only GPU summary path
required an HF token plus an accepted license. This adds the `graph`
enrichment level and makes the local-LLM backend work out of the box.

what:
- Add the `graph` level: a prompt/reply/conversation similarity network
  (sentence-transformers or model2vec embeddings, optional HDBSCAN
  archetype clustering, sqlite-vec or LanceDB IVF-PQ vector store) that
  surfaces recurring asks, forgotten-but-similar conversations, and mined
  workflows, persisted incrementally in a content-hash-keyed graph store.
- Draft reusable Skills (SKILL.md) from mined workflows, print-by-default,
  also exposed over an `insights_skills` MCP tool.
- Add a transformers/CUDA LLM backend with a non-gated default chain that
  needs no HF token: Phi-4-mini (4-bit, native phi3), SmolLM2-1.7B (fp16),
  Granite-3.3-2b (4-bit), tried in order until one loads. gemma-3-1b-it
  stays curated but gated and is no longer the default. 4-bit weights load
  through bitsandbytes NF4 behind the insights-llm-transformers-quant extra.
- Add optional conversation-summary vectors: each conversation is embedded
  by a cached LLM one-line summary instead of a prompt mean, sharpening
  forgotten-but-similar.
- Bundle the #68 human-typed prompt detection (human: query field,
  Claude/Codex authored-turn tagging) so the branch hand-tests
  self-contained; it overlaps with that PR and should be reconciled at
  merge time.
tony added 4 commits August 9, 2026 07:11
why: Claude Code records tool results and subagent output as type=user
messages, so prompt search/grep — and any consumer that treats a user-role
turn as a typed prompt — sees pasted command output, git-status dumps, and
subagent reports as if the user had typed them.

what:
- Add claude_event_is_human_authored(): classify a Claude project JSONL
  event by structure. tool_result/tool_use content blocks, the
  toolUseResult marker, isSidechain transcripts, non-user event types, and
  machine-authored string content (slash-command stdout/caveat, the
  interrupt marker) are not human-authored.
- Thread the verdict through parse_claude_project_file into
  build_search_record(human_typed=...), which records
  metadata["human_typed"]=False only for non-human turns. The change is
  additive: a normal record's metadata stays empty, so existing consumers
  and tests are unaffected.
why: PR #68 separated Claude's typed prompts from tool results, but the
same flattening happens in Codex (function_call_output) and Grok
(tool_use/tool_result), and the human/tool tag was only reachable from
the graph engine. Tagging every adapter that carries inline tool-output
and exposing it as a `human:` query field lets `agentgrep
search`/`grep` and the MCP server filter the user's real asks from tool
noise.

what:
- Add codex_event_is_human_authored() and tag Codex response_item
  records; function_call/function_call_output/reasoning are non-human.
- Tag Grok tool_use/tool_result turns with metadata["human_typed"]=False.
- Register a record-layer `human` enum field (true/false) and dispatch
  it in the query compiler: human:true keeps untagged turns, human:false
  selects tool/agent output.
- Cover the Codex detector, Grok tagging, and the human: predicate.
…eyed agents

why: Only Claude, Codex (JSONL), and Grok distinguished user-typed prompts
from tool/assistant output flattened into the prompt stream. The remaining
adapters left every turn untagged, so the human: query field and any
downstream cleaning saw tool output as if the user had typed it. The Codex
*legacy* rollout path was a gap too: it parsed the same response_item shapes
as the JSONL path but never tagged them.

what:
- Add the shared candidate_is_human_typed() helper (role in USER_ROLES) and
  wire it into the role-keyed parsers: Gemini (chat + legacy), Cursor-CLI
  transcripts, Cursor-IDE state.vscdb, and Pi sessions.
- Tag OpenCode message rows by their joined role (non-user -> human_typed=False).
- Tag the Codex legacy rollout path with codex_event_is_human_authored, closing
  the gap vs the JSONL path.
- Antigravity (protobuf / prompt-only stores) carries no role marker to filter
  on, so it stays untagged by design.
- Cover the shared helper and the Cursor-CLI assistant path with tests.
why: The human: distinction was queryable from the CLI but not over MCP — the
search tool had no way to keep user-typed prompts or isolate tool output.

what:
- Add an optional human ("true"|"false") parameter to the MCP search tool and
  SearchRequestModel; "true" keeps user-typed turns, "false" keeps tool/agent
  output, omitted keeps both.
- Thread it through the page cursor so paginated human-filtered searches stay
  consistent.
@tony
tony force-pushed the agentgrep-human-typed-prompts branch from 4c8e4e5 to 1425bdb Compare August 9, 2026 12:12
why: The docs extension must expose the same search schema as the
live MCP tool. Otherwise, generated reference docs omit supported
filters.

what:
- Mirror the optional human author filter and its exact description.
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.

1 participant