Work-Block Attendance & Outcome Fact Capture #28
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 explicit work-block outcome logging (
POST /v1/captureswithkind: "outcome"andlife capture --input -), capturing user-reported attendance and execution facts (attended,completed,missed,partial,unknown) into SQLitelife_events(evidence_class: "user_report") without mutating Radicale CalDAV VEVENT components or inferring task completion.Background & Technical Rationale
Calendar systems and productivity applications frequently commit a critical epistemic error: they conflate the passage of time on a clock with human action. When a scheduled 90-minute focus block expires, naive systems assume the user worked on the task, or worse, automatically mark the linked task as finished.
Life strictly enforces an empirical timeline contract:
VEVENTcomponents support onlySTATUS: TENTATIVE,STATUS: CONFIRMED, andSTATUS: CANCELLED. There is no standard iCalendarCOMPLETEDstatus for calendar events. Any attempt to write a completion status to a VEVENT either corrupts the CalDAV resource or introduces proprietary, non-interoperable fields.life_eventswithevidence_class: "user_report".qualifies_career_floor: true), never an unreviewed model inference.Exact Technical References & Specifications
1. Domain Entities & Time/Work Outcomes (
docs/technical/domain-model.md)Section:
## Entities(lines 7–18):Section:
## Time and work outcomes(lines 41–42):2. Workflows Specification (
docs/technical/workflows.md)Section:
## Lifecycle and review(line 36):Section:
## Personal policy defaults(line 44):3. CLI and API Route & Payloads (
docs/technical/cli-api.md)Section:
## Command-to-route table(line 40):Section:
## Command payloads and results(lines 87, 102):4. Database Schema & Append-Only Triggers (
docs/technical/timeline-consistency.md)Section:
## Illustrative schema(lines 37–62):5. Verification Scenario W13 (
docs/technical/verification.md)Section:
## Workflow scenarios(line 27):What to build
1. Domain Outcome Data Types (
src/domain/timeline/outcome.rs)WorkBlockOutcome:400 Bad Request(code: "invalid_input").OutcomePayload:item_id: String (references scheduled VEVENT item or related task).outcome:WorkBlockOutcome.occurred_at: Optional ISO-8601 instant string (when the block took place).actual_minutes: Optional non-negative integer (self-reported actual duration in minutes; 0 represents explicitly observed zero effort, while null denotes unknown duration).qualifies_career_floor: Optional boolean (explicit user assertion; default false).reason: Optional explanatory string (e.g., "Interrupted by incident triage").2. Event Linkage Validator (
src/domain/timeline/linkage.rs)item_idin local projection or live Radicale store:collection_id,uid, and optionalrecurrence_idto establish persistent linkage.event_linkage_unverifiedwarning in the response.3. Timeline Event Insertion (
src/storage/timeline_repo.rs)life_eventsrow:event_id: Unique prefixed ID (evt_out_...).dedupe_key: Derived fromoperation_id(op_cap_...:fact:outcome).schema_version:1.kind:"work_block_outcome".evidence_class:"user_report".recorded_at: Current UTC ISO-8601 timestamp.occurred_at: The user-reportedoccurred_ator null.actor:"user".source:"cli_api".collection_id: Target collection ID.uid: Target item UID.after_json: Serialized JSON payload containing:reason: The user-provided reason string.provenance_json: Client identity and request context.operation_id: Current operation ID.life_events.VEVENTremains untouched;VTODOremains untouched).4. Axum Capture Route & CLI Command (
src/api/captures.rs,src/cli/capture.rs)POST /v1/captures:life capture --input - [--operation-id KEY] [--json]Acceptance Criteria
life_eventsand modifies nothing (verifying Scenario W13).missed) inserts a new row intolife_eventswithkind: "work_block_outcome"andevidence_class: "user_report"(Scenario W13).VEVENTobject is completely untouched; no proprietary completion status is written to CalDAV (Scenario W13).completedfor a work block linked to aVTODOtask leaves the task status unchanged (NEEDS-ACTION), proving decoupled task lifecycle."done","failed") returns400 Bad Requestwith codeinvalid_input.event_idand durableoperation_id.actual_minutesaccepts 0 to record explicitly reported zero effort (e.g. for missed blocks), while null denotes unknown duration.Notes
record_fact_operation(oneoperationsrow + onelife_eventsappend in one transaction); the route performs reads only, and byte-level non-mutation is asserted for both the VEVENT and its linked VTODO.DTENDcan never enterafter_jsonas an actual end;actual_minutes: 0is an explicit zero.#17's refusal fixture was narrowed tocorrection(still covered; that is #29's kind).Blocked by
Issue #028: Work-Block Attendance & Outcome Fact Captureto Work-Block Attendance & Outcome Fact Capture