Skip to content

Record a decision so the next worker can find it

Write down what was decided and why as state, then find it again without reading a conversation.

guaranteed Sessions and handoverbasicagentcontributorwrites state

Situation

A session decides something in the middle of a task: a trade-off, a refusal, a convention. The decision lives in the conversation, so the next worker either re-derives it, contradicts it, or reads the whole transcript to find it.

Scenario

setup: active-task
given:
  - 'an active task scoped to lib'
steps:
  - id: decide
    run: ['decision', 'add', 'refuse tabs in the parser', '--why', 'two encodings for one token']
    note: 'what was decided, why, and which task decided it; superseded by a later entry, never edited'
    expect:
      exit: 0
      stdout_contains: ['recorded: refuse tabs in the parser']
  - id: read-back
    run: ['decision', 'list']
    note: 'the decisions of this branch, newest first'
    expect:
      exit: 0
      stdout_contains: ['refuse tabs in the parser', 'Why: two encodings']
  - id: find-it
    run: ['search', 'tabs']
    note: 'a literal scan over the durable records, no index'
    expect:
      exit: 0
      stdout_contains: ['decision', 'match']
  - id: what-happened
    run: ['history']
    note: 'the ledger names the event and the task'
    expect:
      exit: 0
      stdout_contains: ['decision.recorded', 'task.started']
then:
  - 'a decision is one line of state with an author, a task and a reason'
  - 'nothing has to be re-explained to the next session'

Outcome

The decision is a record naming the task that made it and why; decision list reads it back, search finds it by a word, and the ledger says when it happened. A later decision supersedes it by naming it; nothing is edited.

The scenario

Executed against the real tool, in a repository prepared by active-task, every time this site is generated. What follows is not a description of what should happen; it is what happened.

given

  • an active task scoped to lib

when

  1. 1majordomus decision add refuse tabs in the parser --why two encodings for one token
  2. 2majordomus decision list
  3. 3majordomus search tabs
  4. 4majordomus history

then

  • a decision is one line of state with an author, a task and a reason
  • nothing has to be re-explained to the next session

What the tool did

Evidence of the run this page was generated from: pass, 4 step(s). Output is normalised: the repository's path, timestamps, ids and durations are placeholders; nothing else is edited.

Tested by test/cases/94_use_cases.sh, which runs every scenario and refuses a step whose recorded output is not what it produced.

  1. what was decided, why, and which task decided it; superseded by a later entry, never edited

    recorded: refuse tabs in the parser
    • exit 0
    • stdout_contains /recorded: refuse tabs in the parser/
  2. the decisions of this branch, newest first

    ## <date> — refuse tabs in the parser
    Task: t-<id>
    Head: <sha>
    Why: two encodings for one token
    Rejected: -
    Evidence: -
    Supersedes: -
    • exit 0
    • stdout_contains /refuse tabs in the parser/
    • stdout_contains /Why: two encodings/
  3. a literal scan over the durable records, no index

    decision    .ai/local/state/decisions.md:13  ## <date> — refuse tabs in the parser
    history     .ai/local/state/ledger.jsonl:3  {"ts":"<time>","event":"decision.recorded","head":"<sha>","branch":"mai
    search: 2 match(es)
    • exit 0
    • stdout_contains /decision/
    • stdout_contains /match/
  4. the ledger names the event and the task

    <time>  projections.updated -                      <head>  targets=3
    <time>  task.started        t-<id>  <head>  profile=implementation scope=lib
    <time>  decision.recorded   t-<id>  <head>  refuse tabs in the parser
    • exit 0
    • stdout_contains /decision.recorded/
    • stdout_contains /task.started/

Why the tool knows this

The chain from this page to the code: the use case names commands, rules and claims; each rule is dispatched from the registry and each claim names the test that proves it; the scenario above executed the commands. Nothing in this chain is prose about intent.

The rules that make it hold

Guarantees exercised

Related use cases

Computed from what they share: claims, rules, commands, category, applications. Nobody maintains this list.

The moments this answers

Searches the titles and descriptions of every page this site publishes.