Next Action CLI & Advisory Provenance #24
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
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?
Summary
Implement the user-facing CLI command
life nextand REST API endpointPOST /v1/next, providing structured, top-3 task recommendations with strictly separated factual constraints, semantic judgments, unknown attributes, and model provenance. Enforce the inviolable invariant that recommendations are strictly read-only and advisory, performing zero calendar writes.Background & Technical Rationale
The
life nextcommand is the primary entry point for a user deciding what actionable task to focus on right now. It orchestrates the policy filter (#022), the multi-criteria lexicographic ranker (#023), and the Jev advisory scoring adapter (#021).The interaction model enforces foundational architectural and usability invariants:
life nextorPOST /v1/nextperforms ZERO writes to Radicale or SQLite.life task complete <ID> --etag <ETAG> --operation-id <OP_ID>).item_id: Authoritative task identifier (itm_...).title: Task summary string.deadline: Nullable tagged date or instant ({"kind": "date", "value": "2030-04-12"}).factual_reasons: Array of objective constraints (e.g."Fits 90m window","Matches unmet weekday career floor").semantic_reasons: Array of Jev score assessments (e.g."alignment.v1 score 8.4/10: Strongly aligned with career goals").unknowns: Array of missing attributes (e.g.["estimated_minutes"]).judgment_provenance: Evaluation metadata (model: "jev-1.13.0",evaluated_at: "<ISO8601>").status: "ok"withcandidates: [].{"code": "no_eligible_tasks", "message": "All 8 active tasks exceed the 45m window duration"}).--json): Strict, structured JSON payload matching the API schema for consumption by AI agents or shell scripts.Exact Technical References & Specifications
CLI & API Route Contract
From
docs/technical/cli-api.md(lines 43, 57, 71, 90):life next --window 90m --energy mediumwindowas positive duration (e.g.,90m,2h),energy(low|medium|high); optionalarea.candidateswithitem_id,factual_reasons,semantic_reasons,unknowns,judgment_provenance.low/medium/high. Temporal values follow tagged date/instant representations.judgment_unavailable,unknown_estimate,incomplete_calendar.Workflow & Policy Defaults Contract
From
docs/technical/workflows.md(lines 27, 44–50):Verification Scenario W07
From
docs/technical/verification.md(line 21):Illustrative JSON Response Payload
What to Build
1.
src/api/routes/next.rs— Axum API Route"90m"\rightarrow 90,"2h"\rightarrow 120) into minutes. Rejects negative or unparseable durations asinvalid_input.incomplete_calendarand note in candidate unknowns that free capacity cannot be confirmed with certainty (docs/technical/jev.md:41).CalendarClient.filter_candidate_tasks(#022), enforcing known capacity, hard timing (planned_start <= now), and energy constraints.rank_candidates(#023) with Jev scores fromJevService(#021).NextApiResponseinside standard JSON response envelope.2.
src/cli/commands/next.rs— CLI Subcommandlife next:/v1/next.3.
src/cli/formatters/next.rs— Human Terminal View4. Integration Tests (
tests/next_action_e2e.rs)life next --window 90m --energy medium --json.unknowns.Acceptance Criteria
life next --window 90m --energy medium --jsonreturns HTTP 200 OK with up to 3 structured candidates (Scenario W07).unknownsand not claimed to fit with certainty.incomplete_calendarwarning and avoids confident capacity claims (Scenario W07,docs/technical/jev.md:41).judgment_unavailable.life nextperforms zero writes to Radicale or SQLite.Notes
excluded[]explains an empty candidate list instead of returning a bare empty array;consideredstates truncation.src/api/next.rs) plus asserted empirically.Blocked by
Issue #024: Next Action CLI & Advisory Provenanceto Next Action CLI & Advisory Provenance