Skip to content
Apothem
アーキテクチャ

インストールワークフロー

apothem install、update、uninstall がエンドツーエンドでどのように動作するか。

インストールフロー

flowchart TD
    accTitle: Apothem install workflow
    accDescr: Top-down flowchart of the apothem install command from CLI invocation through adapter lookup, profile load, adapter install call, native config write, and a follow-up apothem verify check that the operator runs.
    A[apothem install --harness X] --> B[Resolve adapter through registry]
    B --> C[Load and validate profile YAML<br/>before writes]
    C --> D[Adapter.install(profile, project)]
    D --> E[Write native config and support cohorts]
    E --> F[Operator runs: apothem verify --harness X]
    F --> G{All checks pass?}
    G -- yes --> H[Done]
    G -- no --> I[Report failures]

更新フロー

apothem update --harness X の実行時:

  1. ~/.config/apothem/profile.yaml または --profile PATH を読み込んで検証します。
  2. 選択したハーネスまたは all を中央レジストリを通じて解決します。
  3. 最初の書き込みの前に、完全なマテリアライズ計画を検証します。
  4. Adapter.update(profile, project=...) を呼び出します。
  5. 作成済み、更新済み、変更なし、スキップ、警告、エラーの結果を報告します。

アンインストールフロー

apothem uninstall --harness X の実行時:

  1. Adapter.uninstall() を呼び出します。
  2. アダプターは自身が書き込んだファイルのみを削除します。共有プロファイル YAML と、無関係なオペレーター作成ファイルには手を付けません。
  3. 共有の作業ディレクトリにあるメモリ、コンテキスト、学習ストアは、このハーネスがそこに インストールされた最後のハーネスである場合に、バックアップしたうえで削除 されます。削除は、インストール時に記録された場所で行われます。plans/ ディレクトリは決して削除されません。

スコープ解決

各アダプターは自身の固定インストールルートに書き込みます。ユーザースコープの アダプターはユーザーホームに、プロジェクトスコープのアダプターはプロジェクト ローカルに書き込みます。CLI は --scope フラグを公開しません。プロジェクト スコープのアダプターには --project <path> が必要です。プロジェクトスコープの アダプターのうち 7 つは、プロジェクトファイルを書き込む前に、~/.agents/skills/ や ~/.config/apothem/ などの共有フォルダーもユーザーホームに書き込み、--project は それらの書き込み先を変更しません。 install リファレンス にそれらが列挙されています。各書き込み先は site/content/docs/harnesses/<harness>.mdx に文書化されています。

エラー処理

インストール/更新操作は、書き込みの前に検証し、置き換えの前に既存の一致するターゲットをバックアップし、共有された発見ディレクトリでは Apothem が管理する子エントリのみをマージします。--dry-run は同じ検証を実行し、各書き込みが得るはずだった結果(created や updated など)を、ディレクトリやファイルを作成せずに返します。

Reversibility (backup and rollback)

Every install pass is reversible. Replaced bytes are captured into the Apothem backup root and the pass is recorded in the harness ledger under a ULID install id; apothem rollback selects a recorded pass and restores those captured backups.

%% provenance: hand-authored %%
%% verified: 2026-07-06 %%
%% cross-reference: this page's Error handling section (back up before replace); /docs/cli-reference/rollback %%
flowchart LR
    accTitle: Apothem backup and rollback lifecycle
    accDescr: At install time each replaced target's prior bytes are captured into the Apothem backup root and the pass is recorded in the harness ledger under a ULID install id. The rollback command selects a recorded install pass by latest or install-id, restores every captured backup from the backup root, and appends a rollback record to the ledger.
    subgraph Install
        direction TB
        I1["Back up existing targets<br/>before replacement"] --> I2["Apothem backup root"]
        I1 --> I3["Ledger install record<br/>ULID install-id"]
    end
    subgraph Rollback
        direction TB
        R1["Select install pass<br/>--last or --install-id ULID"] --> R2["Restore captured backups<br/>from the backup root"]
        R2 --> R3["Append rollback record<br/>to the harness ledger"]
    end
    I2 -.->|captured bytes| R2
    I3 -.->|resolves pass| R1

On this page