Přeskočit na obsah

Tato stránka byla automaticky přeložena z angličtiny, jediného jazyka, ve kterém se tento web píše. Číst originál.

Nechat relaci otevřít a uzavřít, aniž by si na to kdokoli musel vzpomenout

Zapojte vlastní události relace poskytovatele a epizoda se otevře, když sezení začne, předá pracovníkovi, co zanechalo to poslední, zaznamená, co se chystá zahodit komprimace, a uzavře se záznamem pokračování vedle své obálky.

zaručeno Relace a předávkazákladníagentoperátorzapisuje stav

Situace

Záznam relace je jen tak dobrý jako disciplína, která jej otevírá. Pracovník, který má spustit session start, ho spustí, když si vzpomene, což není při sezení, které skončilo pádem, kompakcí nebo zavřením okna — a právě o těch je třeba později číst. Vrstva mezitím pojmenovává úložiště pro pracovní kontext epizody a nikdy do něj nikdo nezapsal soubor, takže čtenář nerozezná prázdné úložiště od neimplementovaného.

Scénář

setup: provider-reachable
given:
  - 'Majordomus installed, no session open, no provider hook wired'
  - 'work about to begin, which is what the compaction and end events have to describe'
steps:
  - id: unwired
    run: ['capture', 'status']
    note: 'a repository that wires nothing says so; it is never presented as an episode boundary that happens to be quiet'
    expect:
      exit: 0
      stdout_contains: ['claude-code:session +unconfigured']
  - id: install
    run: ['capture', 'install']
    note: 'one shim per event, and the entries that make the provider run them'
    expect:
      exit: 0
      stdout_contains: ['majordomus-session-start', 'majordomus-session-end', 'majordomus-session-compact']
      files_exist: ['.claude/hooks/majordomus-session-start', '.claude/hooks/majordomus-session-end', '.claude/hooks/majordomus-session-compact']
  - id: proven-by-running-it
    run: ['capture', 'status']
    note: 'verified means a synthetic payload went through the end shim and reached the command, with the mutation left out'
    expect:
      exit: 0
      stdout_contains: ['claude-code:session +verified']
  - id: open
    run: ['session', 'start']
    note: 'the open freezes the context the builder resolved into the store the layer names — as a snapshot of what this worker was told, not as its working context'
    expect:
      exit: 0
      stdout_contains: ['working context: \.ai/local/session-contexts/']
  - id: what-is-true-now
    run: ['session', 'context']
    note: 'the document, composed on this read: the episode, git now against git at the open, and what the episode has recorded since. It used to answer with the snapshot path, which is a file written before the worker had done anything'
    expect:
      exit: 0
      stdout_contains: ['^# Working context of session s-', '## Repository now', '## Recorded in this episode']
  - id: where-the-snapshot-is
    run: ['session', 'context', '--path']
    note: 'the frozen opening snapshot is still addressable by name, for a caller that wants the file rather than the answer'
    expect:
      exit: 0
      stdout_contains: ['^\.ai/local/session-contexts/2[0-9]+T[0-9]+Z--s-']
  - id: work-to-describe
    run: ['start', 'Prove the lifecycle runs itself', '--scope', 'lib']
    note: 'a checkpoint is a progress note inside a task, so the two events below have something to be about'
    expect:
      exit: 0
  - id: what-a-compaction-would-record
    run: ['checkpoint', '--derive']
    note: 'what the compaction event runs: a progress note composed from git and the ledger, because at that moment nobody is being asked anything'
    expect:
      exit: 0
      stdout_contains: ['^\.ai/local/state/checkpoints/']
  - id: what-an-end-would-write
    run: ['handover', '--derive']
    note: 'and what the end event writes when the task is still active: the sections the policy requires, derived from records that already exist, with no model called'
    expect:
      exit: 0
      stdout_contains: ['^\.ai/local/state/handovers/']
  - id: what-the-next-worker-is-handed
    run: ['handover', '--resolve']
    note: 'the record the start event quotes into the next episode, with the label that says how far to trust it'
    expect:
      exit: 0
      stdout_contains: ['Match: same_worktree_same_branch', 'Git state: exact']
  - id: close
    run: ['session', 'close']
    note: 'the shared record; the working context learns the outcome in the same document it was opened with'
    expect:
      exit: 0
      stdout_contains: ['^\.ai/repo/sessions/']
  - id: an-end-with-nothing-open
    run: ['session', 'close', '--if-none', 'ignore']
    note: 'what the provider''s end event passes: the episode may have been closed by hand, or never opened, and neither is a failure'
    expect:
      exit: 0
then:
  - 'the episode boundary exists without a worker choosing to draw it'
  - 'what the worker was told at the open is evidence rather than recollection'
  - 'the continuation record exists whether or not anybody was willing to type one'
  - 'the next episode is handed that record, with the label that says how far to trust it'
  - 'the working context stays under the ignored half of the layer and never becomes a transcript'

Výsledek

Životní cyklus řídí vlastní události providera SessionStart, PreCompact a SessionEnd. Každá je idempotentní, protože události jsou: obnovení ponechá otevřenou epizodu, konec bez otevřené epizody nezapíše nic a komprimace bez aktivní úlohy nezaznamená nic.

Otevření zmrazí, co builder kontextu vyřešil, vedle sekce pro vlastní poznámky workera, a zapíše briefing na standardní výstup — který poskytovatel přidá do kontextu, jejž se chystá sestavit. To je krok, který záznam činí čitelným, nejen zapsaným: balíček pro pokračování, který nic nenačítá, je balíček, který nikdo nečte. Zhuštění zaznamená odvozený checkpoint, protože konverzace se chystá přestat držet, co ví. Konec s úlohou stále aktivní zapíše odvozenou předávku před uzavřením obálky, takže další worker zdědí index epizody i něco, na čem může jednat.

doctor drží repozitář u zapojení tím, že provede payload přes shim, a odmítne pracovní kontext, který nese konverzaci. majordomus_continuity čte týž stav zpět přes MCP, přes HTTP a v Cockpitu, se stejnými dvěma úrovněmi a stejnými čtyřmi štítky divergence — a nikdy nezapisuje, protože životní cyklus má jediného zapisovatele.

Scénář

Provedeno proti skutečnému nástroji v repozitáři připraveném pomocí provider-reachable, při každém generování tohoto webu. To, co následuje, není popis toho, co by se mělo stát; je to to, co se stalo.

dáno

  • Majordomus nainstalován, žádná relace otevřená, žádný hook poskytovatele nezapojen
  • práce, která se chystá začít, což musí události kompakce a konce popisovat

kdy

  1. 1majordomus capture status
  2. 2majordomus capture install
  3. 3majordomus capture status
  4. 4majordomus session start
  5. 5majordomus session context
  6. 6majordomus session context --path
  7. 7majordomus start Prove the lifecycle runs itself --scope lib
  8. 8majordomus checkpoint --derive
  9. 9majordomus handover --derive
  10. 10majordomus handover --resolve
  11. 11majordomus session close
  12. 12majordomus session close --if-none ignore

pak

  • hranice epizody existuje, aniž by ji worker musel zvolit
  • to, co bylo pracovníkovi řečeno při otevření, je důkaz, ne vzpomínka
  • záznam pokračování existuje, ať ho někdo ochotně zadal, nebo ne
  • další epizoda dostane tento záznam i s označením, jak moc mu věřit
  • pracovní kontext zůstává pod ignorovanou polovinou vrstvy a nikdy se nestane přepisem

Co nástroj udělal

Důkaz běhu, ze kterého byla tato stránka vygenerována: pass, 12 kroků. Výstup je normalizovaný: cesta k repozitáři, časová razítka, identifikátory a doby trvání jsou zástupné hodnoty; nic dalšího se neupravuje.

Testováno v test/cases/94_use_cases.sh, který spouští každý scénář a odmítne krok, jehož zaznamenaný výstup není tím, co vyprodukoval.

  1. repozitář, který nic nezapojuje, to říká; nikdy se nepředstavuje jako hranice epizody, která je náhodou tichá

    agents                 unsupported  none        as above: a convention hands nothing to anything.
    agents:session         unsupported  none        not a product but a class of tools defined by the file they read (agents.md). A convention has no process and no events; the concrete tool's own entry in this file is what says what it can do.
    bb                     unsupported  none        same search, same date, same caveat: nothing published hands a prompt to an external command before the model runs. Because bb runs Claude Code and Codex as child processes, each child's own prompt hook fires underneath it — the coverage is the agent's, never bb's.
    bb:session             unsupported  none        no conversation-lifecycle hook is published. Searched <date>: getbb.app; github.com/get-bb/bb docs/ (25 files), plugins/ (31 plugins), README.md; docs/configuration.md ('Repository worktree hooks') and docs/cli-guide-and-skill.md document only .bb-env-setup.sh / .bb-env-teardown.sh, which fire on environment provisioning and removal. docs/provider-plugin-api.md names an internal system/interaction/lifecycle event stream with no external-command contract. The @get-bb/plugin-sdk surface is rendered in-app and not published, so this is an absence of documentation, not a documented absence. ADR 0024 reached the same conclusion: the agent bb runs keeps the hook.
    claude-code            unconfigured hook        .claude/settings.json does not exist (run: majordomus capture install)
    claude-code:session    unconfigured hooks       .claude/settings.json does not exist (run: majordomus capture install)
    codex                  unadapted    hook        the provider documents a prompt event and this distribution ships no adapter for it — https://learn.chatgpt.com/docs/hooks — UserPromptSubmit, 'Runs when a user submits a prompt, before model invocation, and can block the prompt'; the raw text arrives as `prompt` (not `prompt_text`, as Claude Code sends it). Verified <date>.
    codex:session          unadapted    hooks       the provider documents session events and this distribution ships no adapter for them — https://learn.chatgpt.com/docs/hooks (canonical; developers.openai.com/codex/hooks 308-redirects to it) — SessionStart (source: startup, resume, clear, compact), SessionEnd, PreCompact and PostCompact; PreCompact can block with continue:false. Configured in ~/.codex/hooks.json or an inline [hooks] table in .codex/config.toml. Verified <date>. The `notify` key is NOT this: https://learn.chatgpt.com/docs/config-file/config-advanced says it fires 'whenever Codex emits supported events (currently only agent-turn-complete)' — after a turn, never at a session boundary.
    gemini                 unadapted    hook        the provider documents a prompt event and this distribution ships no adapter for it — https://github.com/google-gemini/gemini-cli/blob/main/docs/hooks/reference.md — BeforeAgent, 'Fires after a user submits a prompt, but before the agent begins planning'; the raw text arrives as `prompt`. BeforeModel fires later, on the assembled request. Verified <date>.
    gemini:session         unadapted    hooks       the provider documents session events and this distribution ships no adapter for them — https://github.com/google-gemini/gemini-cli/blob/main/docs/hooks/reference.md and https://geminicli.com/docs/hooks/ — SessionStart (source: startup, resume, clear), SessionEnd (reason: exit, clear, logout, prompt_input_exit, other), PreCompress (trigger: auto, manual). Configured as a hooks block in settings.json. Tracker github.com/google-gemini/gemini-cli/issues/9070 'Comprehensive Hooking System' is closed, 34 of 34. Verified <date>. Two caveats an adapter must carry: the CLI does not wait for SessionEnd, and PreCompress is advisory and cannot block.
    generic                unsupported  none        no vendor documentation is involved: a worker with no convention of its own exposes no event, and the MCP connection cannot stand in. An MCP server receives initialize, tool calls and notifications; the person's prompt is never among them, in any version of the protocol (modelcontextprotocol.io/specification). Declared none rather than left blank so that no surface can imply otherwise.
    generic:session        unconfigured connection  bin/majordomus-mcp does not exist, so no client can start the shared server whose connection is the boundary
    (no adapter)           n/a          this tool ships no capture adapter for: agents bb codex gemini generic; they read the model and lose the automation
    • exit 0
    • stdout_contains /claude-code:session +unconfigured/
  2. jeden shim na událost a záznamy, které přimějí poskytovatele je spouštět

    INFO capture     .claude/hooks/majordomus-capture — written and made executable (inline)
    INFO capture     .claude/hooks/majordomus-session-start — written and made executable (inline)
    INFO capture     .claude/hooks/majordomus-session-end — written and made executable (inline)
    INFO capture     .claude/hooks/majordomus-session-compact — written and made executable (inline)
    INFO capture     .claude/skills/majordomus-handover — written; the provider loads it at its next start
    INFO capture     .claude/skills/majordomus-brief — written; the provider loads it at its next start
    INFO capture     .claude/settings.json — written with the UserPromptSubmit, SessionStart, SessionEnd, PreCompact hook(s)
    • exit 0
    • stdout_contains /majordomus-session-start/
    • stdout_contains /majordomus-session-end/
    • stdout_contains /majordomus-session-compact/
    • file_exists .claude/hooks/majordomus-session-start
    • file_exists .claude/hooks/majordomus-session-end
    • file_exists .claude/hooks/majordomus-session-compact
  3. ověřeno znamená, že syntetický payload prošel koncovým shimem a dorazil k příkazu, s vynechanou mutací

    agents                 unsupported  none        as above: a convention hands nothing to anything.
    agents:session         unsupported  none        not a product but a class of tools defined by the file they read (agents.md). A convention has no process and no events; the concrete tool's own entry in this file is what says what it can do.
    bb                     unsupported  none        same search, same date, same caveat: nothing published hands a prompt to an external command before the model runs. Because bb runs Claude Code and Codex as child processes, each child's own prompt hook fires underneath it — the coverage is the agent's, never bb's.
    bb:session             unsupported  none        no conversation-lifecycle hook is published. Searched <date>: getbb.app; github.com/get-bb/bb docs/ (25 files), plugins/ (31 plugins), README.md; docs/configuration.md ('Repository worktree hooks') and docs/cli-guide-and-skill.md document only .bb-env-setup.sh / .bb-env-teardown.sh, which fire on environment provisioning and removal. docs/provider-plugin-api.md names an internal system/interaction/lifecycle event stream with no external-command contract. The @get-bb/plugin-sdk surface is rendered in-app and not published, so this is an absence of documentation, not a documented absence. ADR 0024 reached the same conclusion: the agent bb runs keeps the hook.
    claude-code            verified     hook        .claude/hooks/majordomus-capture is wired, and a synthetic payload through it produced one record and its rendering
    claude-code:session    verified     hooks       .claude/hooks/majordomus-session-start, .claude/hooks/majordomus-session-end, .claude/hooks/majordomus-session-compact are wired, and a synthetic payload through the end shim reached the command
    codex                  unadapted    hook        the provider documents a prompt event and this distribution ships no adapter for it — https://learn.chatgpt.com/docs/hooks — UserPromptSubmit, 'Runs when a user submits a prompt, before model invocation, and can block the prompt'; the raw text arrives as `prompt` (not `prompt_text`, as Claude Code sends it). Verified <date>.
    codex:session          unadapted    hooks       the provider documents session events and this distribution ships no adapter for them — https://learn.chatgpt.com/docs/hooks (canonical; developers.openai.com/codex/hooks 308-redirects to it) — SessionStart (source: startup, resume, clear, compact), SessionEnd, PreCompact and PostCompact; PreCompact can block with continue:false. Configured in ~/.codex/hooks.json or an inline [hooks] table in .codex/config.toml. Verified <date>. The `notify` key is NOT this: https://learn.chatgpt.com/docs/config-file/config-advanced says it fires 'whenever Codex emits supported events (currently only agent-turn-complete)' — after a turn, never at a session boundary.
    gemini                 unadapted    hook        the provider documents a prompt event and this distribution ships no adapter for it — https://github.com/google-gemini/gemini-cli/blob/main/docs/hooks/reference.md — BeforeAgent, 'Fires after a user submits a prompt, but before the agent begins planning'; the raw text arrives as `prompt`. BeforeModel fires later, on the assembled request. Verified <date>.
    gemini:session         unadapted    hooks       the provider documents session events and this distribution ships no adapter for them — https://github.com/google-gemini/gemini-cli/blob/main/docs/hooks/reference.md and https://geminicli.com/docs/hooks/ — SessionStart (source: startup, resume, clear), SessionEnd (reason: exit, clear, logout, prompt_input_exit, other), PreCompress (trigger: auto, manual). Configured as a hooks block in settings.json. Tracker github.com/google-gemini/gemini-cli/issues/9070 'Comprehensive Hooking System' is closed, 34 of 34. Verified <date>. Two caveats an adapter must carry: the CLI does not wait for SessionEnd, and PreCompress is advisory and cannot block.
    generic                unsupported  none        no vendor documentation is involved: a worker with no convention of its own exposes no event, and the MCP connection cannot stand in. An MCP server receives initialize, tool calls and notifications; the person's prompt is never among them, in any version of the protocol (modelcontextprotocol.io/specification). Declared none rather than left blank so that no surface can imply otherwise.
    generic:session        unconfigured connection  bin/majordomus-mcp does not exist, so no client can start the shared server whose connection is the boundary
    (no adapter)           n/a          this tool ships no capture adapter for: agents bb codex gemini generic; they read the model and lose the automation
    • exit 0
    • stdout_contains /claude-code:session +verified/
  4. otevření zmrazí kontext, který builder převedl, do úložiště, které vrstva jmenuje — jako snímek toho, co bylo tomuto pracovníkovi řečeno, ne jako jeho pracovní kontext

    session s-<id> opened at <time> (head <head>)
    working context: .ai/local/session-contexts/<time>--s-<id>.md
    next: majordomus plan next; majordomus context; majordomus session close when the episode ends
    • exit 0
    • stdout_contains /working context: \.ai/local/session-contexts//
  5. dokument složený při tomto čtení: epizoda, git nyní proti gitu při otevření a to, co epizoda od té doby zaznamenala. Dříve odpovídal cestou ke snímku, což je soubor zapsaný dřív, než worker cokoli udělal

    # Working context of session s-<id>
    
    Composed now, from this episode's record, from git, and from the ledger lines this
    episode wrote. It is not stored and is not a snapshot: every read recomposes it.
    
    ## Episode
    
    - session: s-<id>
    - opened: <time> by hand
    - task: none (profile none)
    - opening snapshot: .ai/local/session-contexts/<time>--s-<id>.md
    - briefing: exact at <head>
    
    ## Repository now
    
    - branch: main
    - head: <head>
    - working tree: dirty
    - this episode: 0 commit(s), 0 file(s) changed
    
    ## Recorded in this episode
    
    What the worker itself put on the record. These are the three commands that write
    here; nothing infers an entry from a diff, and a section with nothing in it means
    nothing was recorded, not that nothing happened.
    
    ### Progress notes
    
    None. `majordomus checkpoint` records what this episode is doing and why, and is
    what puts a note of the worker's own into this context and into the closed record.
    
    ### Decisions
    
    None. `majordomus decision add "<what>" --why "<why>"` records one; nothing infers a decision from a diff.
    
    ### Open questions
    
    None. `majordomus question add "<question>"` opens one, and `question resolve` closes it.
    
    ### Continuation records
    
    None. `majordomus handover` writes the record the next worker starts from.
    
    ## The repository's own context
    
    Not repeated here: `majordomus context` resolves it, now, against the current tree.
    What this episode was told at its open is under `## Context at open` in .ai/local/session-contexts/<time>--s-<id>.md.
    • exit 0
    • stdout_contains /^# Working context of session s-/
    • stdout_contains /## Repository now/
    • stdout_contains /## Recorded in this episode/
  6. zmrazený úvodní snapshot je stále adresovatelný jménem, pro volajícího, který chce soubor, ne odpověď

    .ai/local/session-contexts/<time>--s-<id>.md
    • exit 0
    • stdout_contains /^\.ai/local/session-contexts/2[0-9]+T[0-9]+Z--s-/
  7. checkpoint je poznámka o postupu uvnitř úlohy, takže dvě události níže mají o čem být

    started t-<id>  profile=implementation  scope=lib
    next: majordomus context; checkpoint every 15m; majordomus check before claiming anything
    • exit 0
  8. co spouští událost zhutnění: poznámka o postupu složená z gitu a účetní knihy, protože v tu chvíli se nikoho nic neptá

    .ai/local/state/checkpoints/<time>--main--<head>--<hash>.md
    • exit 0
    • stdout_contains /^\.ai/local/state/checkpoints//
  9. a co zapíše událost konce, když je úloha stále aktivní: sekce, které politika vyžaduje, odvozené ze záznamů, které už existují, bez volání modelu

    .ai/local/state/handovers/<time>--main--<head>--<hash>.md
    • exit 0
    • stdout_contains /^\.ai/local/state/handovers//
  10. záznam, který událost start cituje do další epizody, se štítkem, který říká, nakolik mu věřit

    Handover: .ai/local/state/handovers/<time>--main--<head>--<hash>.md
    Match: same_worktree_same_branch
    Git state: exact
    Created: <time> (<age> ago)
    Task: t-<id>
    Freshness: fresh — <age> ago
    ---
    
    # Objective
    
    Prove the lifecycle runs itself
    
    Profile implementation. Declared scope: lib.
    
    # Current State
    
    On main at <head>, working tree dirty.
    
    2 file(s) changed since the task started:
    
    - .claude/
    - .majordomus/
    
    Recorded in this episode: 1 checkpoint(s), 0 decision(s), 0 question(s) opened, 0 handover(s).
    
    The newest checkpoint (<age> ago), quoted whole:
    
    > At <head> on main, working tree dirty; 2 file(s) changed since the task started.
    > Derived, not authored: `majordomus checkpoint --derive`.
    
    # Next Action
    
    Run `majordomus context` for the briefing this record is a projection of, then `majordomus check` to see whether the task is consistent with its scope and state.
    
    # Decisions
    
    None recorded in this checkout.
    
    # Reasoning
    
    No reasoning was recorded for this task.
    
    # Open Questions
    
    None. Nothing on this branch is blocking acceptance.
    
    # Verification
    
    Not run by this record. Nothing here asserts a test result; `majordomus finish --verify-command` is what records one.
    
    ---
    
    Derived by `majordomus handover --derive` from the task record, the ledger, git and the open questions. It asserts nothing that is not in one of those, and no model wrote it.
    • exit 0
    • stdout_contains /Match: same_worktree_same_branch/
    • stdout_contains /Git state: exact/
  11. sdílený záznam; pracovní kontext se o výsledku dozví ve stejném dokumentu, se kterým byl otevřen

    majordomus: session close: knowledge derived: knowledge derive: 0 written, 0 unchanged, 0 skipped for episode s-<id>
    .ai/repo/sessions/<time>--s-<id>--main--<head>--<hash>.md
    • exit 0
    • stdout_contains /^\.ai/repo/sessions//
  12. co předá koncová událost poskytovatele: epizoda mohla být uzavřena ručně nebo nikdy otevřena a ani jedno není selhání

    • exit 0

Proč to nástroj ví

Řetězec od této stránky ke kódu: případ užití jmenuje příkazy, pravidla a tvrzení; každé pravidlo se dispatchuje z registru a každé tvrzení jmenuje test, který ho dokazuje; scénář výše provedl příkazy. Nic v tomto řetězci není text o záměru.

Přes MCP se ke stejné vrstvě dostanete přes majordomus_continuity (povrch MCP).

Pravidla, díky nimž platí

Uplatněné záruky

Související případy užití

Vypočteno z toho, co sdílejí: tvrzení, pravidla, příkazy, kategorie, aplikace. Tento seznam nikdo neudržuje.

Prohledává názvy a popisy všech stránek, které tento web publikuje.