Skip to content

feat(query): add temporal_relation and evidence_request plan steps - #147

Open
Sidra-009 wants to merge 1 commit into
grayhatdevelopers:mainfrom
Sidra-009:feature/llm-query-planning
Open

feat(query): add temporal_relation and evidence_request plan steps#147
Sidra-009 wants to merge 1 commit into
grayhatdevelopers:mainfrom
Sidra-009:feature/llm-query-planning

Conversation

@Sidra-009

Copy link
Copy Markdown

Related issue

Related to #84

Summary

Extends the local-model query-planning path with support for temporal
relations, occurrence modes, and evidence-delivery requests, per the
examples listed in #84.

  • Adds OccurrenceMode (first / best / all) to SearchMomentsPlanStep.
  • Adds TemporalRelationPlanStep for before/after/during queries between
    two searches.
  • Adds EvidenceRequestPlanStep for requesting a board or exact
    clips/frames as evidence.
  • Adds matching opt-in flags (temporal_relations_allowed,
    evidence_requests_allowed) to QueryPlanningRequest, defaulting to
    False.
  • Updates _default_plan, _valid_plan, and GroundedQueryService.plan
    in query_service.py to accept and validate the new step types, with
    the same default-False opt-in behavior.

This is an internal, application-layer change: no CLI, HTTP, MCP, or
frontend surface calls the new parameters yet, and existing callers are
unaffected since all new parameters default to False.

Out of scope for this PR (left as follow-up per #84, to keep this PR
focused on one outcome):

  • Recording which local model and planning-rules version produced a
    plan, for reproducibility.
  • The evidence-review guardrail for generated names/biographies/
    descriptions.

Validation

uv run --no-sync ruff check .

All checks passed!

uv run --no-sync pytest tests/test_query_service.py tests/test_application.py tests/test_control_plane.py tests/test_job_contracts.py --tb=short

65 passed in 3.43s

The full pytest -q suite could not be run end-to-end locally: several
unrelated test modules fail to collect because of pre-existing missing
optional dependencies (torch, streamlit, fastapi, httpx,
cryptography, alembic, numpy, etc.) unrelated to this change, and
uv sync --extra local-worker timed out downloading torch due to a
local network issue. These gaps were present before this change as well.

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