Skip to content

Feature toggles silently inert under workflow path; capture is time-blind #244

Closed

Description

@Ambisphaeric

Symptoms

With extraction feature flags ON, Moments and Relevant-now render empty while distillates flow. A first-person intent with an explicit relative deadline ("provide feedback in eighteen minutes") produces no moment, no to-do, and no deadline, even though the merge-window wall-clock is already interpolated into every prompt.

Root causes

  1. Flag tangle. The direct drain path honors distill.moments / distill.index from the flag store. The workflow executor path ADDITIONALLY requires the active workflow document to contain a moments / index drain step; with no such step, extraction is off even when the flag is ON. Turning on workflow.enabled can therefore silently disable a Settings toggle. Audit distill.fields for the same disease.
  2. Extraction misses first-person intent. The typed-moment extraction template defines a commitment as "someone promised to do something"; small models return [] for first-person intent ("I need to…", "I'll…", "I have to…").
  3. Time-blind capture. Prompts receive windowStart / windowEnd but nothing instructs relative-time resolution. TodoItem has no due field, so a stated deadline is dropped even when captured.

Scope

  • Make the extraction flags authoritative across both drain paths, with a regression proving: workflow path + flag ON + no explicit step yields extraction.
  • Teach the typed-moment extraction template to include first-person commitments.
  • Add an optional, validated due (window-anchored absolute time) plus a due-provenance marker to the to-do capture path, surfaced honestly on the row.

Refs #179

Activity

  1. Ambisphaeric commented on Jul 18, 2026

    @Ambisphaeric
    OwnerAuthor

    Closing evidence — landed via PR #248, merge 605f780, main CI green

    Per acceptance criterion (relative paths, file:line + test names):

    AC1 — extraction flags authoritative across both drain paths, regression proving workflow path + flag ON + no explicit step yields extraction.

    • apps/engine/src/workflow/executor.ts — runDrain honors distill.moments / distill.index from the flag store even when the active workflow document declares no explicit moments/index drain step.
    • Regression reproducing the exact silent-inert scenario: apps/engine/src/workflow/executor.test.ts:138 runDrain: FLAG-AUTHORITATIVE — no moments/index step but the flags are ON ⇒ extraction runs (the #244 silent-inert case).
    • Authority holds both directions: :150 no step + flags OFF ⇒ no extraction; :159 a PRESENT step still re-binds the gate to its when-flag (advanced composition preserved); :123 moments/index gate independently.
    • distill.fields audited for the same disease — the fast-fields path is unaffected (each family member gates independently; family coalesces into exactly one distill call, :171).

    AC2 — teach the typed-moment extraction template to include first-person commitments.

    • apps/engine/src/distill/defaults.ts — the extract-moments commitment bullet now explicitly names first-person intent ("I need to…", "I'll…", "I have to…") while keeping the four moment kinds.
    • Test: apps/engine/src/distill/moments.test.ts:13 asserts the commitment definition names first-person intent and retains the four kinds.

    AC3 — optional validated due (window-anchored absolute time) + due-provenance marker, surfaced honestly on the row.

    • Contract: shared/contracts/src/config/todo.ts:58 due: Type.Optional(IsoTime) (server-stamped); :34 dueSource: 'model' | 'anchored'. Generated schemas committed: shared/contracts/schemas/TodoItem.json, TodoList.json, TodoProvenance.json (zero-drift gate).
    • Validation + deterministic fallback: apps/engine/src/act/due.ts:25 DUE_PAST_SLACK_MS = 60_000, :26 DUE_MAX_HORIZON_MS = 60d; RELATIVE_RE (:78) resolves plain "in N minutes/hours/days" incl. whole-number and tens+ones compound words (:28–:49) against the extraction wall-clock; a due that fails validation is dropped (nothing fabricated).
    • Tests (apps/engine/src/act/due.test.ts, 12): model ISO accepted verbatim :8; garbage ISO dropped :14; past-beyond-slack dropped :20; > 60 days dropped :25; within-slack near-past kept :30; "in eighteen minutes" :35; digits :41; compound "forty-five minutes" :47; "in 3 days" :52; out-of-horizon relative dropped :57; no deadline ⇒ no due :62; model ISO wins over a relative phrase :67.
    • Honest row: apps/client/src/surfaces/blocks/todos.ts:41 dueDecoration renders "due " only for a parseable due, no urgency dressing, user-select:none (copy stays bare task text). Test apps/client/src/surfaces/blocks/todos.test.ts:68.
    • HTTP wiring covered by apps/engine/src/api/http.test.ts.

    Gates at merge head: contracts 114 · client 636 · engine 1142; schema regen zero-drift; main CI green.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions