feat: /sessions import subcommand with --source/--since filters (F4.4, Task 2.6.1) #14
Notifications
Due Date
No due date set.
Blocks
#16 feat: /sessions analyze subcommand with dominant-topic analyser (F4.4, Task 3.1.3)
terraphim/agent-tasks
Reference: terraphim/agent-tasks#14
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem Statement
The session-search spec (F4.4) requires an explicit
/sessions importsubcommand with--sourceand--sinceflags. TodaySessionsSubcommand(crates/terraphim_agent/src/repl/commands.rs:156) has noImportvariant. Imports happen implicitly via theListhandler's "auto-imports if cache is empty" path. This prevents users from:claude-code, excludingcursor)--since 2026-01-01)Upstream: spec section F4.4, Phase 2 Task 2.6.1.
Acceptance Criteria
SessionsSubcommand::Import { source: Option<String>, since: Option<String>, until: Option<String>, limit: Option<usize>, incremental: bool }/sessions import,/sessions import --source claude-code,/sessions import --since 2026-01-01,/sessions import --incrementalConnectorRegistry+SessionServicewith the correctImportOptions(connector already exposessince/until/limit/incremental)--source Xfilters to the connector whosesource_id()matches X; unknown source returnsExitCode::ERROR_USAGERobotResponse { success, data: { imported_total, by_source: { claude-code: n, cursor: m, ... } } }repl/commands.rsfor the three flag permutationstests/sessions_import.rsthat imports the bundled fixturescargo test -p terraphim_agent --features repl-sessionspassescargo clippy -p terraphim_agent --features repl-sessions -- -D warningspassesProposed Approach
terraphim_agent(commands.rs, handler.rs),terraphim_sessions(minor: exposeImportOptions::with_since/with_untilstring parsers if not present)--since/--untilas RFC3339 orYYYY-MM-DDviajiff::civil::Date::parserobot/docs.rsso/robot schemas sessions.importand/robot examples sessions.importsurface itDependencies
Verification
Scope
Single PR. ~200-300 lines across parser + handler + docs + tests.
Session Summary
Agent: product-owner (Lux persona)
Date: 2026-04-24
Outcome: SUCCESS -- 3 issues created, deps wired, spec coverage ~93% to ~95%.
Issues created (terraphim/agent-tasks)
What Worked
gtr ready/gtr triagereturn404 /api/swagger./api/v1/repos/OWNER/REPO/issues?state=open&limit=50&type=issuesgives full backlog with labels.terraphim/terraphim-aiGitea repo. Direct API check returned 404 for that repo. Those runs produced phantom references; runs 09-10 correctly identifiedterraphim/agent-tasksas the real tracker.SessionsSubcommandenum directly atcrates/terraphim_agent/src/repl/commands.rs:156to confirm Import/Expand/Analyze variants were truly missing.--body-filewith pre-written markdown in/tmpavoided KG-hook mangling of inline issue bodies.What Failed (avoid next time)
#14 blocked-by #13contradicting #14's body.gitea-robothas noremove-depcommand; had to delete via direct APIDELETE /api/v1/repos/OWNER/REPO/issues/N/dependencieswith{"index":M,"owner":"...","repo":"..."}body. Lesson: re-read body beforeadd-dep.gtr readyandgtr triagebroken (HTTP 404/api/swagger). PageRank unavailable; used judgement ranking.Key Decisions
terraphim/agent-tasks, NOT anyterraphim-aiGitea repo (non-existent under this token). CLAUDE.md referencesterraphim-aibut the actual agent-task tracker isagent-tasks./sessions cluster(F5.2) and timeline concept-trend rollup to respect max-3 rule. Run-17 candidates.Reference
/opt/ai-dark-factory/reports/roadmap-20260424.md(Run 16 appended at top)docs/specifications/terraphim-agent-session-search-spec.mdv1.2.0