Skip to content

feat(cli): native date-range filtering for search commands #98

Description

@Flare576

Context

Discovered while building the ei-generate skill's period-scoped document types (Profile/Job Description's session-confidence facet; a new Period Performance Review type). There is no native date-range filter on any search command today.

The current workaround, verified live against production data on 2026-08-03:

  • ei quotes --recent -n 100000 returns the full quote corpus unfiltered by the similarity floor (12,464 quotes spanning Sept 2025 -> Aug 2026), and each flat result already carries timestamp -- so date-range filtering is possible client-side today, just wasteful (pulling everything to filter a slice).
  • ei facts --recent -n <large> behaves the same way; flat results carry validated_date, but that's "when validated," not "when mentioned" -- not useful for a period query on its own.
  • Topics and People are the real gap. last_mentioned/last_updated exist on the underlying type (src/core/types/data-items.ts:14, "Used for --recent sorting") and are used internally to order --recent results, but the CLI command mappers (src/cli/commands/topics.ts, people.ts) strip both fields from the flat search result before returning it. ei --id <id> on the full record does expose them -- but doing that per-candidate across thousands of topics to find "what falls in May" is impractical. The workaround: pull date-bounded quotes (real dates) and roll up their linked_items to infer topic/person involvement for the period, rather than iterating --id over every topic.

Proposal

  1. Add --since <date> / --until <date> (or --after/--before) flags to the balanced search and all typed search commands (ei, ei quotes, ei topics, ei facts, ei people), filtering on the relevant date field (timestamp for quotes, last_mentioned/last_updated for topics/facts/people) before the -n truncation -- not as a client-side afterthought requiring an inflated -n.
  2. Expose last_mentioned/last_updated in the flat topic/fact/person search result shape (not just on ei --id full-record lookup), so date-based reasoning doesn't require an extra round trip per candidate.
  3. Document the new flags in ei --help.
  4. Preserve existing --recent (sort-by-recency, no range) behavior for callers that don't specify a range.

Acceptance Criteria

  • ei <type> --since 2026-05-01 --until 2026-06-01 "query" (and the balanced ei --since ... --until ... form) filters results to the given range without requiring -n inflation as a workaround.
  • Flat search results for topics, facts, and people include their date field so period-based work doesn't require a follow-up ei --id call per candidate.
  • ei --help documents --since/--until.
  • skills/ei-generate/references/recon.md and any other skill doc currently instructing the -n-inflation workaround (the RoboBrain session-confidence facet, the Period Performance Review facet, once shipped) are updated to use the native flags instead.
  • Existing --recent behavior with no range specified is unchanged.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions