Expand description
Exact-duplicate prompt detection.
One detector, deliberately: prompts are grouped by text_hash and nothing
else. No embeddings, no fuzzy matching, and therefore no false positives —
every group warden reports is a byte-identical prompt you really did send
more than once.
prompts/ is the only place prompt text lives, so this is the one read path
that opens it. The join back to events/ (via the shared scanner) is what
supplies the timestamp and project a PromptRecord deliberately does not
carry, and it is also what makes --since and --project apply here.
Structs§
- Detection
- The result of a scan: the repeated prompts worth acting on, and a count of what was set aside.
- Duplicate
Group - One set of byte-identical prompts.
Enums§
- Action
- What warden suggests doing about a repeated prompt.
Constants§
- MIN_
OCCURRENCES - How many times a prompt must appear before it is worth reporting.
Functions§
- detect
- Find every prompt sent more than once in the window.
- draft
- The
SKILL.mda--draftprints. Returned as a string: the scope is explicit that warden does not write it anywhere. - format_
age 2d ago,5h ago,just now— coarse on purpose; the point is recency, not precision.- group_
id - The id a user types at
warden suggest --draft <id>. Deterministic — same hash, same id, always — so an id printed by one run still resolves in the next. Distinct fromreports::short_id, which only truncates for display.