Skip to content

Record a decision as data, and prove the tool cannot accept it for you

Read the decisions a repository holds, validate the whole set in one command, and watch the tool refuse to write the one status only a person may write.

guaranteed Repository knowledgebasicmaintaineragentwrites state

Situation

The decisions a repository lives by were made in conversations that are gone by the next morning, and the only record is a paragraph in a chat log nobody can find. The reasoning is lost first, so six months later the code looks arbitrary and somebody quietly undoes it.

Scenario

setup: adr-related
given:
  - 'Majordomus installed, with one decision proposed and committed'
  - 'discovery is over the tracked tree, so a decision git does not hold is not yet part of the layer'
steps:
  - id: what-was-decided
    run: ['adr', 'list']
    note: 'one line per decision: identity, status, date, title'
    expect:
      exit: 0
      stdout_contains: ['adr-0001', 'proposed']
  - id: the-record-itself
    run: ['adr', 'show', 'adr-0001']
    note: 'the path, then the file as written: the provenance says the tool derived it'
    expect:
      exit: 0
      stdout_contains: ['schema: adr/v1', 'origin: extracted', 'file:docs/d']
  - id: the-set-is-sound
    run: ['adr', 'check']
    note: 'identities, statuses, supersession and every reference, in one pass'
    expect:
      exit: 0
      stdout_contains: ['every identity unique']
  - id: what-it-put-in-force
    run: ['adr', 'show', 'adr-0001']
    note: 'related is the forward edge: the rule the decision declares, the file it reaches'
    expect:
      exit: 0
      stdout_contains: ['related:', 'rule:majordomus.adr-integrity']
  - id: the-graph-reads-it-backwards
    run: ['knowledge', 'edges', '--type', 'declares']
    note: 'the same fact as an edge, with the front-matter key that stated it as provenance; nothing wrote the reverse direction down'
    expect:
      exit: 0
      stdout_contains: ['adr:adr-0001', 'rule:majordomus.adr-integrity', 'related.0']
  - id: what-a-change-reaches
    run: ['adr', 'affected']
    note: 'the same edges read from a change set: which decisions this work touches. A clean tree reaches nothing, and the exit code never says a decision stopped holding'
    expect:
      exit: 0
      stdout_contains: ['no decision names anything this change set touches']
  - id: not-yours-to-choose
    run: ['adr', 'propose', 'A decision that accepts itself', '--status', 'accepted']
    note: 'the refusal that matters: a tool that can write accepted turns its inference into repository truth'
    expect:
      exit: 15
      stdout_contains: ['not yours to choose']
  - id: evidence-must-resolve
    run: ['adr', 'propose', 'A decision derived from a file nobody has', '--from', 'file:docs/nosuch']
    note: 'an extracted record without evidence is an assertion, and is refused as one'
    expect:
      exit: 2
      stdout_contains: ['names a path that does not exist']
then:
  - 'a reference a decision makes is validated where its type says the target lives'
  - 'the reverse direction is the graph read backwards, never a second list'
  - 'a change set names the decisions it reaches; whether they still hold is a person to read, not an exit code'
  - 'a decision is one validated file under .ai/repo/adrs/, discovered as data'
  - 'no invocation of the tool writes status accepted'

Outcome

The decision is a file with an identity nothing else claims, the evidence it came from, and a status that says plainly whether a person has accepted it. The tool proposes; only a person accepts, and the command line has no way to say otherwise.

The scenario

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

given

  • Majordomus installed, with one decision proposed and committed
  • discovery is over the tracked tree, so a decision git does not hold is not yet part of the layer

when

  1. 1majordomus adr list
  2. 2majordomus adr show adr-0001
  3. 3majordomus adr check
  4. 4majordomus adr show adr-0001
  5. 5majordomus knowledge edges --type declares
  6. 6majordomus adr affected
  7. 7majordomus adr propose A decision that accepts itself --status accepted
  8. 8majordomus adr propose A decision derived from a file nobody has --from file:docs/nosuch

then

  • a reference a decision makes is validated where its type says the target lives
  • the reverse direction is the graph read backwards, never a second list
  • a change set names the decisions it reaches; whether they still hold is a person to read, not an exit code
  • a decision is one validated file under .ai/repo/adrs/, discovered as data
  • no invocation of the tool writes status accepted

What the tool did

Evidence of the run this page was generated from: pass, 8 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. one line per decision: identity, status, date, title

    adr-0001   proposed    <date>  The registry is the one canonical declaration
    • exit 0
    • stdout_contains /adr-0001/
    • stdout_contains /proposed/
  2. the path, then the file as written: the provenance says the tool derived it

    .ai/repo/adrs/0001-the-registry-is-the-one-canonical-declaration.md
    
    ---
    schema: adr/v1
    id: adr-0001
    kind: adr
    title: The registry is the one canonical declaration
    status: proposed
    related:
      - rule:majordomus.adr-integrity
      - file:docs/d
    date: <date>
    tags:
      - architecture
    provenance:
      origin: extracted
      derived_from:
        - file:docs/d
    ---
    
    # 1. The registry is the one canonical declaration
    
    ## Context
    
    What forced the decision. Derived from:  file:docs/d.
    
    ## Decision
    
    The registry is the one canonical declaration
    
    ## Alternatives rejected
    
    What else was considered, and why it was not taken.
    
    ## Consequences
    
    What this costs, what it forecloses, and what now has to be true.
    • exit 0
    • stdout_contains /schema: adr/v1/
    • stdout_contains /origin: extracted/
    • stdout_contains /file:docs/d/
  3. identities, statuses, supersession and every reference, in one pass

    examined 1 decision(s) in .ai/repo/adrs/
    every identity unique, every status known, every reference resolves
    0 identities added here, measured against main and every other ref
    • exit 0
    • stdout_contains /every identity unique/
  4. related is the forward edge: the rule the decision declares, the file it reaches

    .ai/repo/adrs/0001-the-registry-is-the-one-canonical-declaration.md
    
    ---
    schema: adr/v1
    id: adr-0001
    kind: adr
    title: The registry is the one canonical declaration
    status: proposed
    related:
      - rule:majordomus.adr-integrity
      - file:docs/d
    date: <date>
    tags:
      - architecture
    provenance:
      origin: extracted
      derived_from:
        - file:docs/d
    ---
    
    # 1. The registry is the one canonical declaration
    
    ## Context
    
    What forced the decision. Derived from:  file:docs/d.
    
    ## Decision
    
    The registry is the one canonical declaration
    
    ## Alternatives rejected
    
    What else was considered, and why it was not taken.
    
    ## Consequences
    
    What this costs, what it forecloses, and what now has to be true.
    • exit 0
    • stdout_contains /related:/
    • stdout_contains /rule:majordomus.adr-integrity/
  5. the same fact as an edge, with the front-matter key that stated it as provenance; nothing wrote the reverse direction down

    declares        adr:adr-0001                                   rule:majordomus.adr-integrity                  .ai/repo/adrs/0001-the-registry-is-the-one-canonical-declaration.md:related.0
    knowledge edges: 1 in scope all, type declares
    INFO knowledge   . — the schema check was not asked for (MAJORDOMUS_KNOWLEDGE_SCHEMA=unasked), so no file was checked against the schema of its kind
    • exit 0
    • stdout_contains /adr:adr-0001/
    • stdout_contains /rule:majordomus.adr-integrity/
    • stdout_contains /related.0/
  6. the same edges read from a change set: which decisions this work touches. A clean tree reaches nothing, and the exit code never says a decision stopped holding

    adr affected: no decision names anything this change set touches
    • exit 0
    • stdout_contains /no decision names anything this change set touches/
  7. the refusal that matters: a tool that can write accepted turns its inference into repository truth

    majordomus: adr propose: the status is not yours to choose; a proposed decision is accepted by a person editing the record
    • exit 15
    • stdout_contains /not yours to choose/
  8. an extracted record without evidence is an assertion, and is refused as one

    majordomus: adr propose: reference "file:docs/nosuch" names a path that does not exist
    • exit 2
    • stdout_contains /names a path that does not exist/

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.