agentdir-cli 0.7.6__tar.gz → 0.7.8__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. {agentdir_cli-0.7.6/src/agentdir_cli.egg-info → agentdir_cli-0.7.8}/PKG-INFO +42 -5
  2. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/README.md +41 -4
  3. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/docs/AGENTIC_CODING.md +17 -2
  4. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/docs/INSTALL.md +119 -12
  5. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/docs/PI_PACKAGE.md +5 -3
  6. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/docs/RELEASING.md +15 -15
  7. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/docs/TECH_BRIEF.md +21 -1
  8. agentdir_cli-0.7.8/docs/releases/v0.7.7.md +57 -0
  9. agentdir_cli-0.7.8/docs/releases/v0.7.8.md +50 -0
  10. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/package.json +2 -2
  11. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/pyproject.toml +1 -1
  12. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/scripts/install.sh +3 -1
  13. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/scripts/rollback.sh +1 -1
  14. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/skills/agentdir/SKILL.md +9 -1
  15. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/src/agentdir/__init__.py +1 -1
  16. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/src/agentdir/audit.py +27 -6
  17. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/src/agentdir/capture.py +69 -6
  18. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/src/agentdir/cli.py +405 -73
  19. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/src/agentdir/context.py +7 -6
  20. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/src/agentdir/control.py +8 -5
  21. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/src/agentdir/daemon.py +4 -3
  22. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/src/agentdir/doctor.py +7 -0
  23. agentdir_cli-0.7.8/src/agentdir/environment.py +177 -0
  24. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/src/agentdir/federation.py +77 -49
  25. agentdir_cli-0.7.8/src/agentdir/fsutil.py +51 -0
  26. agentdir_cli-0.7.8/src/agentdir/hooks.py +355 -0
  27. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/src/agentdir/index.py +130 -17
  28. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/src/agentdir/mailbox.py +1 -13
  29. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/src/agentdir/memory.py +6 -1
  30. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/src/agentdir/retention.py +9 -2
  31. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/src/agentdir/review.py +21 -4
  32. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/src/agentdir/secrets.py +3 -21
  33. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/src/agentdir/sessions.py +9 -4
  34. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/src/agentdir/skills.py +90 -24
  35. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/src/agentdir/store.py +29 -4
  36. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8/src/agentdir_cli.egg-info}/PKG-INFO +42 -5
  37. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/src/agentdir_cli.egg-info/SOURCES.txt +8 -0
  38. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/tests/test_agent_first.py +77 -9
  39. agentdir_cli-0.7.8/tests/test_agent_trust.py +406 -0
  40. agentdir_cli-0.7.8/tests/test_environment.py +389 -0
  41. agentdir_cli-0.7.8/tests/test_install_script.py +14 -0
  42. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/tests/test_pi_package.py +3 -2
  43. agentdir_cli-0.7.8/tests/test_truncation.py +251 -0
  44. agentdir_cli-0.7.6/src/agentdir/hooks.py +0 -215
  45. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/LICENSE +0 -0
  46. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/MANIFEST.in +0 -0
  47. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/docs/DEMO.md +0 -0
  48. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/docs/PRD.md +0 -0
  49. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/docs/assets/agentdir-overview.png +0 -0
  50. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/docs/investigations/2026-05-12-cross-repo-ergonomics-lanes.md +0 -0
  51. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/docs/investigations/2026-05-12-rag-vector-scenarios.md +0 -0
  52. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/docs/releases/v0.1.0.md +0 -0
  53. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/docs/releases/v0.1.1.md +0 -0
  54. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/docs/releases/v0.2.0.md +0 -0
  55. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/docs/releases/v0.3.0.md +0 -0
  56. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/docs/releases/v0.3.1.md +0 -0
  57. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/docs/releases/v0.3.2.md +0 -0
  58. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/docs/releases/v0.3.3.md +0 -0
  59. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/docs/releases/v0.3.4.md +0 -0
  60. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/docs/releases/v0.4.0.md +0 -0
  61. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/docs/releases/v0.5.0.md +0 -0
  62. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/docs/releases/v0.5.1.md +0 -0
  63. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/docs/releases/v0.5.2.md +0 -0
  64. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/docs/releases/v0.5.3.md +0 -0
  65. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/docs/releases/v0.6.0.md +0 -0
  66. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/docs/releases/v0.7.0.md +0 -0
  67. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/docs/releases/v0.7.1.md +0 -0
  68. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/docs/releases/v0.7.2.md +0 -0
  69. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/docs/releases/v0.7.3.md +0 -0
  70. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/docs/releases/v0.7.4.md +0 -0
  71. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/docs/releases/v0.7.5.md +0 -0
  72. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/docs/releases/v0.7.6.md +0 -0
  73. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/examples/dogfood-session.sh +0 -0
  74. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/setup.cfg +0 -0
  75. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/src/agentdir/__main__.py +0 -0
  76. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/src/agentdir/actors.py +0 -0
  77. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/src/agentdir/artifacts.py +0 -0
  78. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/src/agentdir/envelope.py +0 -0
  79. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/src/agentdir/events.py +0 -0
  80. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/src/agentdir/git.py +0 -0
  81. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/src/agentdir/gitignore.py +0 -0
  82. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/src/agentdir/query.py +0 -0
  83. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/src/agentdir/redaction.py +0 -0
  84. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/src/agentdir/rendering.py +0 -0
  85. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/src/agentdir/replay.py +0 -0
  86. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/src/agentdir/upgrade.py +0 -0
  87. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/src/agentdir_cli.egg-info/dependency_links.txt +0 -0
  88. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/src/agentdir_cli.egg-info/entry_points.txt +0 -0
  89. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/src/agentdir_cli.egg-info/requires.txt +0 -0
  90. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/src/agentdir_cli.egg-info/top_level.txt +0 -0
  91. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/tests/test_audit.py +0 -0
  92. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/tests/test_v1_behavior.py +0 -0
  93. {agentdir_cli-0.7.6 → agentdir_cli-0.7.8}/tests/test_vector_memory.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: agentdir-cli
3
- Version: 0.7.6
3
+ Version: 0.7.8
4
4
  Summary: Local-first Maildir-inspired work mailstore for software agents
5
5
  Author: AgentDir Contributors
6
6
  License-Expression: MIT
@@ -128,7 +128,8 @@ curl -fsSL https://raw.githubusercontent.com/jstxn/agentdir/main/scripts/install
128
128
 
129
129
  The installer uses `pipx` when available. Otherwise it creates a self-contained
130
130
  virtual environment under `~/.local/share/agentdir` and links the CLI into
131
- `~/.local/bin`.
131
+ `~/.local/bin`. It does not edit Git configuration or ignore files; after
132
+ installation it prints the explicit adoption choices.
132
133
 
133
134
  Verify:
134
135
 
@@ -137,6 +138,16 @@ agentdir --version
137
138
  agentdir --help
138
139
  ```
139
140
 
141
+ Update an existing install to the latest release and refresh adoption for the
142
+ current repository:
143
+
144
+ ```bash
145
+ agentdir update
146
+ agentdir update --dry-run
147
+ ```
148
+
149
+ The older `agentdir --upgrade` interface remains supported for compatibility.
150
+
140
151
  ## Pi Package
141
152
 
142
153
  Pi users can install this repository as a Pi package so the AgentDir skill is
@@ -145,7 +156,7 @@ available automatically during coding tasks:
145
156
  Package page: [@jstxn/agentdir-pi](https://pi.dev/packages/@jstxn/agentdir-pi)
146
157
 
147
158
  ```bash
148
- pi install npm:@jstxn/agentdir-pi@0.7.6
159
+ pi install npm:@jstxn/agentdir-pi@0.7.8
149
160
  # or install directly from a local checkout / release tag:
150
161
  pi install /absolute/path/to/agentdir
151
162
  pi install git:github.com/jstxn/agentdir@<tag-or-commit>
@@ -164,6 +175,13 @@ Run once from a git repository:
164
175
  agentdir adopt
165
176
  ```
166
177
 
178
+ Coding agents use the non-interactive form below so `.agentdir/` is ignored at
179
+ the user level without creating a repository `.gitignore` change:
180
+
181
+ ```bash
182
+ agentdir adopt --gitignore user
183
+ ```
184
+
167
185
  This is intentionally boring setup. It prepares the repository once, then agents
168
186
  operate AgentDir during normal coding work:
169
187
 
@@ -191,6 +209,16 @@ instead of project instruction files:
191
209
  agentdir adopt --install-skill store --install-generic store --integration-target store
192
210
  ```
193
211
 
212
+ Adoption adapts to repos where other tools own these files. When
213
+ [rulesync](https://github.com/dyoshikawa/rulesync) generates the guidance
214
+ files, the managed rule is written to `.rulesync/rules/agentdir.md` instead so
215
+ it survives regeneration, and files with generated-file headers are never
216
+ edited without `--force`. When lefthook, husky, or pre-commit own the Git
217
+ hooks, adopt warns up front, `agentdir doctor` flags hook shims those tools
218
+ later overwrite, and `agentdir hooks install` restores them. See
219
+ [docs/INSTALL.md](docs/INSTALL.md#coexisting-with-rule-generators-and-hook-managers)
220
+ for details.
221
+
194
222
  For non-interactive installs, choose the ignore destination explicitly:
195
223
 
196
224
  ```bash
@@ -199,6 +227,10 @@ agentdir adopt --gitignore user # write the user-level Git excludes file
199
227
  agentdir adopt --gitignore none # leave ignore files unchanged
200
228
  ```
201
229
 
230
+ Generated AgentDir guidance selects `--gitignore user` by default. The plain
231
+ interactive command still prompts, and all three explicit choices remain
232
+ available.
233
+
202
234
  Undo managed setup while keeping the `.agentdir` evidence store:
203
235
 
204
236
  ```bash
@@ -212,17 +244,22 @@ Default adoption writes only local files:
212
244
 
213
245
  ```text
214
246
  <repo>/.agentdir/ # evidence, artifacts, indexes, state
215
- <repo>/.git/hooks/* # managed hook shims with backups
247
+ <repo>/.agentdir/hooks.json # installed-hook drift manifest
248
+ <active-hooks-directory>/* # managed hook shims with backups
216
249
  <repo>/AGENTS.md # generic / Codex-readable guidance
217
250
  <repo>/CLAUDE.md # Claude Code guidance
218
251
  <repo>/.github/copilot-instructions.md # Copilot guidance
219
252
  <repo>/.cursor/rules/agentdir.mdc # Cursor guidance
220
253
  <repo>/.windsurf/rules/agentdir.md # Windsurf guidance
254
+ <repo>/.rulesync/rules/agentdir.md # rulesync source, when detected
221
255
  ~/.codex/skills/agentdir/SKILL.md # Codex skill, by default
222
256
  ```
223
257
 
224
258
  Managed guidance is wrapped in AgentDir markers. Existing unmanaged content is
225
- preserved where the target format supports managed blocks.
259
+ preserved where the target format supports managed blocks. The active hooks
260
+ directory is `.git/hooks` by default and follows `core.hooksPath` or linked
261
+ worktree configuration. In rulesync repos, the source rule replaces the listed
262
+ project guidance files as the managed source of truth.
226
263
 
227
264
  ## Inspect A Session
228
265
 
@@ -95,7 +95,8 @@ curl -fsSL https://raw.githubusercontent.com/jstxn/agentdir/main/scripts/install
95
95
 
96
96
  The installer uses `pipx` when available. Otherwise it creates a self-contained
97
97
  virtual environment under `~/.local/share/agentdir` and links the CLI into
98
- `~/.local/bin`.
98
+ `~/.local/bin`. It does not edit Git configuration or ignore files; after
99
+ installation it prints the explicit adoption choices.
99
100
 
100
101
  Verify:
101
102
 
@@ -104,6 +105,16 @@ agentdir --version
104
105
  agentdir --help
105
106
  ```
106
107
 
108
+ Update an existing install to the latest release and refresh adoption for the
109
+ current repository:
110
+
111
+ ```bash
112
+ agentdir update
113
+ agentdir update --dry-run
114
+ ```
115
+
116
+ The older `agentdir --upgrade` interface remains supported for compatibility.
117
+
107
118
  ## Pi Package
108
119
 
109
120
  Pi users can install this repository as a Pi package so the AgentDir skill is
@@ -112,7 +123,7 @@ available automatically during coding tasks:
112
123
  Package page: [@jstxn/agentdir-pi](https://pi.dev/packages/@jstxn/agentdir-pi)
113
124
 
114
125
  ```bash
115
- pi install npm:@jstxn/agentdir-pi@0.7.6
126
+ pi install npm:@jstxn/agentdir-pi@0.7.8
116
127
  # or install directly from a local checkout / release tag:
117
128
  pi install /absolute/path/to/agentdir
118
129
  pi install git:github.com/jstxn/agentdir@<tag-or-commit>
@@ -131,6 +142,13 @@ Run once from a git repository:
131
142
  agentdir adopt
132
143
  ```
133
144
 
145
+ Coding agents use the non-interactive form below so `.agentdir/` is ignored at
146
+ the user level without creating a repository `.gitignore` change:
147
+
148
+ ```bash
149
+ agentdir adopt --gitignore user
150
+ ```
151
+
134
152
  This is intentionally boring setup. It prepares the repository once, then agents
135
153
  operate AgentDir during normal coding work:
136
154
 
@@ -158,6 +176,16 @@ instead of project instruction files:
158
176
  agentdir adopt --install-skill store --install-generic store --integration-target store
159
177
  ```
160
178
 
179
+ Adoption adapts to repos where other tools own these files. When
180
+ [rulesync](https://github.com/dyoshikawa/rulesync) generates the guidance
181
+ files, the managed rule is written to `.rulesync/rules/agentdir.md` instead so
182
+ it survives regeneration, and files with generated-file headers are never
183
+ edited without `--force`. When lefthook, husky, or pre-commit own the Git
184
+ hooks, adopt warns up front, `agentdir doctor` flags hook shims those tools
185
+ later overwrite, and `agentdir hooks install` restores them. See
186
+ [docs/INSTALL.md](docs/INSTALL.md#coexisting-with-rule-generators-and-hook-managers)
187
+ for details.
188
+
161
189
  For non-interactive installs, choose the ignore destination explicitly:
162
190
 
163
191
  ```bash
@@ -166,6 +194,10 @@ agentdir adopt --gitignore user # write the user-level Git excludes file
166
194
  agentdir adopt --gitignore none # leave ignore files unchanged
167
195
  ```
168
196
 
197
+ Generated AgentDir guidance selects `--gitignore user` by default. The plain
198
+ interactive command still prompts, and all three explicit choices remain
199
+ available.
200
+
169
201
  Undo managed setup while keeping the `.agentdir` evidence store:
170
202
 
171
203
  ```bash
@@ -179,17 +211,22 @@ Default adoption writes only local files:
179
211
 
180
212
  ```text
181
213
  <repo>/.agentdir/ # evidence, artifacts, indexes, state
182
- <repo>/.git/hooks/* # managed hook shims with backups
214
+ <repo>/.agentdir/hooks.json # installed-hook drift manifest
215
+ <active-hooks-directory>/* # managed hook shims with backups
183
216
  <repo>/AGENTS.md # generic / Codex-readable guidance
184
217
  <repo>/CLAUDE.md # Claude Code guidance
185
218
  <repo>/.github/copilot-instructions.md # Copilot guidance
186
219
  <repo>/.cursor/rules/agentdir.mdc # Cursor guidance
187
220
  <repo>/.windsurf/rules/agentdir.md # Windsurf guidance
221
+ <repo>/.rulesync/rules/agentdir.md # rulesync source, when detected
188
222
  ~/.codex/skills/agentdir/SKILL.md # Codex skill, by default
189
223
  ```
190
224
 
191
225
  Managed guidance is wrapped in AgentDir markers. Existing unmanaged content is
192
- preserved where the target format supports managed blocks.
226
+ preserved where the target format supports managed blocks. The active hooks
227
+ directory is `.git/hooks` by default and follows `core.hooksPath` or linked
228
+ worktree configuration. In rulesync repos, the source rule replaces the listed
229
+ project guidance files as the managed source of truth.
193
230
 
194
231
  ## Inspect A Session
195
232
 
@@ -27,6 +27,15 @@ From a git repository:
27
27
  agentdir adopt
28
28
  ```
29
29
 
30
+ For agent-driven, non-interactive setup, make the ignore destination explicit:
31
+
32
+ ```bash
33
+ agentdir adopt --gitignore user
34
+ ```
35
+
36
+ This keeps `.agentdir/` out of Git across repositories without changing a
37
+ project's tracked `.gitignore`.
38
+
30
39
  This initializes `.agentdir`, installs managed Git hook shims, installs the
31
40
  Codex skill in the user skill directory, writes broad project guidance for
32
41
  common agent tools, asks interactive users where to ignore `.agentdir/`, runs
@@ -54,7 +63,7 @@ The user should not have to operate AgentDir during a normal coding session. Onc
54
63
  Agent responsibilities:
55
64
 
56
65
  - run `agentdir work start "<task>" --emit-context` when coding work begins
57
- - run `agentdir adopt` once if the repository has not been prepared yet
66
+ - run `agentdir adopt --gitignore user` once if the repository has not been prepared yet
58
67
  - use `agentdir status` when a single health view is needed
59
68
  - emit context packs when retrieved context materially informs the work
60
69
  - record which context sources were consumed and cited when reporting lineage
@@ -87,7 +96,7 @@ agentdir memory backend list
87
96
  agentdir memory daemon status
88
97
  ```
89
98
 
90
- `agentdir memory search` rebuilds the index by default, then ranks matching envelopes and derived session summaries by vector similarity. `agentdir memory explain` shows why a hit matched. `agentdir context build` combines memory, current-session evidence, and recent session summaries into an agent-ready context pack. The raw Maildir envelopes remain the source of truth, so the memory layer can always be deleted and rebuilt.
99
+ `agentdir memory search` incrementally updates the index by default (new and deleted envelopes only; pass `--no-rebuild` to skip even that), then ranks matching envelopes and derived session summaries by vector similarity. `agentdir memory explain` shows why a hit matched. `agentdir context build` combines memory, current-session evidence, and recent session summaries into an agent-ready context pack. The raw Maildir envelopes remain the source of truth, so the memory layer can always be deleted and rebuilt.
91
100
 
92
101
  When retrieved context materially influences a plan, tool call, answer, or handoff,
93
102
  emit an auditable context pack:
@@ -157,6 +166,12 @@ agentdir run -- git diff --check
157
166
 
158
167
  `agentdir run` streams command output to the terminal and records both the call and the result. Stored output is truncated at a bounded size and common secret-like patterns are redacted in the stored envelope. AgentDir also redacts common secret-like patterns from emitted message bodies before persistence. Agents should use this automatically for commands they run as evidence.
159
168
 
169
+ When captured output is truncated, `agentdir run` prints a warning to stderr and the stored `tool.result` carries an `X-AgentDir-Truncated` header. Downstream surfaces treat the evidence as partial: `evidence` marks the row `truncated=true`, `audit session` reports a `truncated_evidence` warning, and `audit claims` downgrades claims resting on truncated successful evidence from `supported` to `partial` (which fails `--strict`). Raise the limit with `--max-capture-bytes` when full output matters for a claim.
170
+
171
+ `agentdir run` supports `--timeout <seconds>` (kills the command and records exit 124), `--session require|create|auto|<id>` to control session placement, and `--json` for a machine-readable run summary after the streamed output.
172
+
173
+ Exit codes are structured for agents: 2 = user error, 3 = state error (no root or no active session — the error message names the recovery command), 4 = missing dependency, 5 = configuration error. With `--json`, failures also print `{"success": false, "exit_code": ..., "error": ..., "error_code": ...}` to stdout. Every command accepts `--quiet` for exit-code-only checks.
174
+
160
175
  Do not wrap routine exploration commands such as `rg`, `sed`, `nl`, `cat`, `ls`, `find`, or quick read-only `git status` checks. Use plain shell commands while reading files, mapping code, or gathering low-level context. The evidence trail should capture verification, reproduced failures, important diagnostics, and final support for claims, not every glance at a file.
161
176
 
162
177
  ## Capturing Diffs As Artifacts
@@ -28,6 +28,17 @@ The installer downloads release assets anonymously with `curl`. If `curl` is
28
28
  unavailable or the download fails, it falls back to authenticated GitHub CLI
29
29
  (`gh auth login`).
30
30
 
31
+ The installer does not modify Git configuration or ignore files. It prints a
32
+ post-install command that agents can use from a repository:
33
+
34
+ ```bash
35
+ agentdir adopt --gitignore user
36
+ ```
37
+
38
+ This appends `.agentdir/` to the configured user-level Git excludes file. Use
39
+ `--gitignore project` for a repository `.gitignore` entry or `--gitignore none`
40
+ to leave ignore files unchanged.
41
+
31
42
  The installer downloads the release wheel and installs it with `pipx` when available. If `pipx` is not installed, it falls back to a self-contained virtual environment at:
32
43
 
33
44
  ```text
@@ -48,27 +59,30 @@ If `~/.local/bin` is not on PATH, add it:
48
59
  export PATH="$HOME/.local/bin:$PATH"
49
60
  ```
50
61
 
51
- ## Upgrade Existing Installs
62
+ ## Update Existing Installs
52
63
 
53
64
  From any repo where AgentDir should stay adopted:
54
65
 
55
66
  ```bash
56
- agentdir --upgrade
67
+ agentdir update
57
68
  ```
58
69
 
59
- The upgrade command resolves the latest GitHub Release, reinstalls AgentDir,
70
+ The update command resolves the latest GitHub Release, reinstalls AgentDir,
60
71
  then re-runs adoption for the current git repository. It refreshes hooks, the
61
72
  Codex skill, and broad project guidance by default, then runs `doctor`.
62
73
 
63
74
  Useful variants:
64
75
 
65
76
  ```bash
66
- agentdir --upgrade --upgrade-install-skill none
67
- agentdir --upgrade --upgrade-no-adopt
68
- agentdir --upgrade --upgrade-version v0.7.6
69
- agentdir --upgrade --upgrade-dry-run
77
+ agentdir update --install-skill none
78
+ agentdir update --no-adopt
79
+ agentdir update --version v0.7.8
80
+ agentdir update --dry-run
70
81
  ```
71
82
 
83
+ The older `agentdir --upgrade` interface and its `--upgrade-*` options remain
84
+ supported for compatibility.
85
+
72
86
  ## Verify Install
73
87
 
74
88
  ```bash
@@ -79,7 +93,7 @@ repo="$(mktemp -d)/agentdir-install-smoke"
79
93
  mkdir -p "$repo"
80
94
  git -C "$repo" init
81
95
  cd "$repo"
82
- agentdir adopt --install-skill store
96
+ agentdir adopt --install-skill store --gitignore user
83
97
  agentdir work start "install smoke" --emit-context
84
98
  agentdir run -- python3 -c "print('agentdir install smoke')"
85
99
  agentdir evidence --brief
@@ -96,13 +110,13 @@ agentdir work finish --json
96
110
  If you already have the wheel asset:
97
111
 
98
112
  ```bash
99
- AGENTDIR_WHEEL=/path/to/agentdir_cli-0.7.6-py3-none-any.whl bash scripts/install.sh
113
+ AGENTDIR_WHEEL=/path/to/agentdir_cli-0.7.8-py3-none-any.whl bash scripts/install.sh
100
114
  ```
101
115
 
102
116
  To force the virtual environment installer even when `pipx` is present:
103
117
 
104
118
  ```bash
105
- AGENTDIR_FORCE_VENV=1 AGENTDIR_WHEEL=/path/to/agentdir_cli-0.7.6-py3-none-any.whl bash scripts/install.sh
119
+ AGENTDIR_FORCE_VENV=1 AGENTDIR_WHEEL=/path/to/agentdir_cli-0.7.8-py3-none-any.whl bash scripts/install.sh
106
120
  ```
107
121
 
108
122
  ## Roll Back To The Previous Release
@@ -119,13 +133,13 @@ curl -fsSL https://raw.githubusercontent.com/jstxn/agentdir/main/scripts/rollbac
119
133
  To choose a specific release:
120
134
 
121
135
  ```bash
122
- curl -fsSL https://raw.githubusercontent.com/jstxn/agentdir/main/scripts/rollback.sh | bash -s -- v0.7.5
136
+ curl -fsSL https://raw.githubusercontent.com/jstxn/agentdir/main/scripts/rollback.sh | bash -s -- v0.7.7
123
137
  ```
124
138
 
125
139
  The equivalent manual rollback is:
126
140
 
127
141
  ```bash
128
- curl -fsSL https://raw.githubusercontent.com/jstxn/agentdir/main/scripts/install.sh | AGENTDIR_VERSION=v0.7.5 bash
142
+ curl -fsSL https://raw.githubusercontent.com/jstxn/agentdir/main/scripts/install.sh | AGENTDIR_VERSION=v0.7.7 bash
129
143
  ```
130
144
 
131
145
  ## Optional Extras
@@ -143,6 +157,34 @@ pipx inject agentdir-cli 'agentdir-cli[team]'
143
157
  `semantic` adds local embeddings and the embedded vector backend configuration
144
158
  surface. `team` adds optional shared-memory backend clients.
145
159
 
160
+ ### When The Semantic Extra Is Worth It
161
+
162
+ The default retrieval backend (`local-hybrid`) combines lexical passage
163
+ matching with lightweight hashed vectors. It needs no model download and is
164
+ usually enough when memory queries reuse the project's own vocabulary: error
165
+ strings, subsystem names, command names, file paths.
166
+
167
+ Install the `semantic` extra and opt in when retrieval quality matters more
168
+ than setup weight:
169
+
170
+ ```bash
171
+ pipx inject agentdir-cli 'agentdir-cli[semantic]'
172
+ agentdir memory embeddings configure fastembed # one-time model download
173
+ agentdir memory backend configure sqlite-vec # optional: faster large stores
174
+ ```
175
+
176
+ Reach for it when:
177
+
178
+ - queries are paraphrases rather than the recorded wording ("auth timeouts"
179
+ should match "login requests hang for 30s"),
180
+ - memory is federated across several repos with different vocabularies,
181
+ - the store has grown past tens of thousands of passages and `sqlite-vec`
182
+ lookup speed starts to matter.
183
+
184
+ Skip it for single-repo stores with recent, literally-worded memory - the
185
+ default backend retrieves those well without the model download.
186
+ `agentdir memory backend status` shows which backends are active.
187
+
146
188
  ## Store Location Scopes
147
189
 
148
190
  AgentDir stores mailboxes, artifacts, and indexes in an AgentDir root. You can choose the root explicitly or use a scope.
@@ -233,6 +275,71 @@ agentdir integrations install all --target project
233
275
  agentdir integrations doctor --json
234
276
  ```
235
277
 
278
+ ## Coexisting With Rule Generators And Hook Managers
279
+
280
+ Some repos generate their agent guidance files and Git hooks from another
281
+ source of truth. Adoption detects the common tools and adapts so managed
282
+ content is not silently wiped.
283
+
284
+ ### Rule generators (rulesync)
285
+
286
+ When a repo uses [rulesync](https://github.com/dyoshikawa/rulesync)
287
+ (`.rulesync/` or `rulesync.jsonc` present), `CLAUDE.md`, `AGENTS.md`,
288
+ `.cursor/rules/`, and friends are generated files: the next
289
+ `rulesync generate` (often wired into `pnpm rulesync`) rewrites them and drops
290
+ any managed block. `agentdir adopt` therefore writes the managed rule to the
291
+ rulesync source instead:
292
+
293
+ ```text
294
+ .rulesync/rules/agentdir.md # root: false, targets: ["*"]
295
+ ```
296
+
297
+ Run `rulesync generate` afterwards to propagate it into every generated tool
298
+ file; it now survives regeneration. The skipped generated files are listed in
299
+ the adopt output. To select the classic project-file destinations, use
300
+ `agentdir adopt --install-integrations project-files`. Existing files with
301
+ generated headers remain protected; add `--force` only when you intentionally
302
+ want to edit those files directly.
303
+
304
+ Independent of rulesync, adoption refuses to insert managed blocks into any
305
+ existing file whose header marks it as generated (`DO NOT EDIT`,
306
+ `@generated`, `generated by ...`) unless `--force` is given.
307
+
308
+ ### Git hook managers (lefthook, husky, pre-commit)
309
+
310
+ AgentDir hook shims chain whatever hook they replace, so they coexist with a
311
+ hook manager - until the manager reinstalls itself. `lefthook install` and
312
+ `pre-commit install` rewrite `.git/hooks/*` (package installs typically
313
+ trigger lefthook via a postinstall script), and husky points
314
+ `core.hooksPath` at a directory it regenerates. Any of these silently stops
315
+ AgentDir's git recording.
316
+
317
+ Adoption now defends against that:
318
+
319
+ - adopt and `agentdir hooks install` detect lefthook, husky, pre-commit, and a
320
+ configured `core.hooksPath`, and warn about the overwrite behavior up front;
321
+ - installed shims are recorded in `.agentdir/hooks.json`, and `agentdir
322
+ doctor` (also run by `status`, `adopt`, and `work finish`) warns when a
323
+ recorded shim was overwritten or removed, naming the tool that did it;
324
+ - rerunning `agentdir hooks install` restores the shims without `--force` when
325
+ the clobbering script came from a known hook manager, and chains the
326
+ manager's hook so both keep running;
327
+ - shims are installed into the hooks directory git actually consults
328
+ (`core.hooksPath` and linked worktrees included).
329
+
330
+ After a `pnpm install` or similar in a lefthook repo, either rerun
331
+ `agentdir hooks install` or let the next doctor run flag it. If the churn is
332
+ unwelcome, adopt with `--no-hooks` and rely on session recording without git
333
+ hook events, or run the recorder from the hook manager itself, e.g. in
334
+ `lefthook.yml`:
335
+
336
+ ```yaml
337
+ post-commit:
338
+ jobs:
339
+ - name: agentdir-record
340
+ run: agentdir hooks record --hook post-commit --original-exit-code 0 || true
341
+ ```
342
+
236
343
  ## Install From Source
237
344
 
238
345
  For local development:
@@ -9,7 +9,9 @@ skills/agentdir/SKILL.md
9
9
 
10
10
  The skill teaches Pi to start AgentDir sessions, wrap evidence-bearing shell
11
11
  commands, use local memory/context packs, and produce evidence-aware handoffs.
12
- It does not install the `agentdir` CLI; install AgentDir separately first.
12
+ It also tells Pi to adopt unprepared repositories with `--gitignore user`, so
13
+ the local store stays out of Git without changing project files. It does not
14
+ install the `agentdir` CLI; install AgentDir separately first.
13
15
 
14
16
  ## Install
15
17
 
@@ -34,7 +36,7 @@ pi install git:github.com/jstxn/agentdir@<tag-or-commit>
34
36
  If the npm package has been published:
35
37
 
36
38
  ```bash
37
- pi install npm:@jstxn/agentdir-pi@0.7.6
39
+ pi install npm:@jstxn/agentdir-pi@0.7.8
38
40
  ```
39
41
 
40
42
  Use `pi config` to enable or disable the bundled skill after installation.
@@ -48,7 +50,7 @@ The root `package.json` declares the Pi resources:
48
50
  "keywords": ["pi-package"],
49
51
  "pi": {
50
52
  "skills": ["./skills"],
51
- "image": "https://raw.githubusercontent.com/jstxn/agentdir/v0.7.6/docs/assets/agentdir-overview.png"
53
+ "image": "https://raw.githubusercontent.com/jstxn/agentdir/v0.7.8/docs/assets/agentdir-overview.png"
52
54
  }
53
55
  }
54
56
  ```
@@ -31,9 +31,9 @@ chmod +x dist/rollback-agentdir.sh
31
31
  Expected assets (substitute the release version):
32
32
 
33
33
  ```text
34
- dist/agentdir_cli-0.7.6-py3-none-any.whl
35
- dist/agentdir_cli-0.7.6.tar.gz
36
- dist/jstxn-agentdir-pi-0.7.6.tgz
34
+ dist/agentdir_cli-0.7.8-py3-none-any.whl
35
+ dist/agentdir_cli-0.7.8.tar.gz
36
+ dist/jstxn-agentdir-pi-0.7.8.tgz
37
37
  dist/install-agentdir.sh
38
38
  dist/rollback-agentdir.sh
39
39
  ```
@@ -41,19 +41,19 @@ dist/rollback-agentdir.sh
41
41
  ## Tag And Release
42
42
 
43
43
  ```bash
44
- git tag -a v0.7.6 -m "Release AgentDir v0.7.6"
44
+ git tag -a v0.7.8 -m "Release AgentDir v0.7.8"
45
45
  git push origin main
46
- git push origin v0.7.6
46
+ git push origin v0.7.8
47
47
 
48
- gh release create v0.7.6 \
49
- dist/agentdir_cli-0.7.6-py3-none-any.whl \
50
- dist/agentdir_cli-0.7.6.tar.gz \
51
- dist/jstxn-agentdir-pi-0.7.6.tgz \
48
+ gh release create v0.7.8 \
49
+ dist/agentdir_cli-0.7.8-py3-none-any.whl \
50
+ dist/agentdir_cli-0.7.8.tar.gz \
51
+ dist/jstxn-agentdir-pi-0.7.8.tgz \
52
52
  dist/install-agentdir.sh \
53
53
  dist/rollback-agentdir.sh \
54
54
  --repo jstxn/agentdir \
55
- --title "AgentDir v0.7.6" \
56
- --notes-file docs/releases/v0.7.6.md
55
+ --title "AgentDir v0.7.8" \
56
+ --notes-file docs/releases/v0.7.8.md
57
57
  ```
58
58
 
59
59
  Publishing the release triggers `publish.yml`, which rebuilds the sdist and
@@ -65,7 +65,7 @@ Use a disposable environment:
65
65
 
66
66
  ```bash
67
67
  tmp="$(mktemp -d)"
68
- gh release download v0.7.6 --repo jstxn/agentdir --pattern install-agentdir.sh --dir "$tmp"
68
+ gh release download v0.7.8 --repo jstxn/agentdir --pattern install-agentdir.sh --dir "$tmp"
69
69
  AGENTDIR_PREFIX="$tmp/prefix" AGENTDIR_HOME="$tmp/home" bash "$tmp/install-agentdir.sh"
70
70
  "$tmp/prefix/bin/agentdir" --help
71
71
  "$tmp/prefix/bin/agentdir" --version
@@ -79,7 +79,7 @@ mkdir -p "$repo"
79
79
  git -C "$repo" init
80
80
  printf 'release smoke\n' > "$tmp/body.txt"
81
81
  cd "$repo"
82
- "$tmp/prefix/bin/agentdir" adopt --install-skill store
82
+ "$tmp/prefix/bin/agentdir" adopt --install-skill store --gitignore user
83
83
  "$tmp/prefix/bin/agentdir" work start "release smoke" --emit-context
84
84
  "$tmp/prefix/bin/agentdir" run -- python3 -c "print('release smoke')"
85
85
  "$tmp/prefix/bin/agentdir" context build "release smoke"
@@ -101,13 +101,13 @@ tmp="$(mktemp -d)"
101
101
  AGENTDIR_PREFIX="$tmp/prefix" \
102
102
  AGENTDIR_HOME="$tmp/home" \
103
103
  AGENTDIR_FORCE_VENV=1 \
104
- AGENTDIR_WHEEL="$PWD/dist/agentdir_cli-0.7.6-py3-none-any.whl" \
104
+ AGENTDIR_WHEEL="$PWD/dist/agentdir_cli-0.7.8-py3-none-any.whl" \
105
105
  bash dist/install-agentdir.sh
106
106
 
107
107
  AGENTDIR_PREFIX="$tmp/prefix" \
108
108
  AGENTDIR_HOME="$tmp/home" \
109
109
  AGENTDIR_FORCE_VENV=1 \
110
- bash dist/rollback-agentdir.sh v0.7.5
110
+ bash dist/rollback-agentdir.sh v0.7.7
111
111
 
112
112
  "$tmp/prefix/bin/agentdir" --help
113
113
  ```
@@ -411,7 +411,7 @@ agentdir session ensure [--id <id>] [--title <title>]
411
411
  agentdir session start [--id <id>] [--title <title>]
412
412
  agentdir session current
413
413
  agentdir session end [--summary <file-or-text>]
414
- agentdir run [--session <id>] [--name <tool>] -- <command> [args...]
414
+ agentdir run [--session auto|require|create|<id>] [--name <tool>] [--timeout <seconds>] [--json] -- <command> [args...]
415
415
  agentdir emit [--root <root>] [--scope <scope>] [--session <id>] --type <type> --body <file>
416
416
  agentdir actor create [--root <root>] [--scope <scope>] <actor-id>
417
417
  agentdir send [--root <root>] [--scope <scope>] --from <actor> --to <actor> --type <type> --body <file>
@@ -487,6 +487,26 @@ The memory daemon is an opt-in warm indexer. It records process state under
487
487
  roots, and can use `watchfiles` when that extra is installed. Commands remain
488
488
  correct without the daemon because the index is still rebuildable on demand.
489
489
 
490
+ ## Exit Codes
491
+
492
+ `agentdir` commands use a small exit-code taxonomy so agents can branch on
493
+ failure class without parsing stderr:
494
+
495
+ ```text
496
+ 0 success
497
+ 1 command-specific failure result (doctor unhealthy, strict audit violations,
498
+ secrets found); agentdir run passes through the wrapped command's exit code,
499
+ with 124 reserved for --timeout kills
500
+ 2 user error: bad arguments or flags
501
+ 3 state error: not an AgentDir root, or no active session
502
+ 4 missing dependency: e.g. git repository required
503
+ 5 configuration error: unsupported store version, corrupted config
504
+ ```
505
+
506
+ With `--json`, failures also print a structured error envelope to stdout:
507
+ `{"success": false, "exit_code": <n>, "error": "...", "error_code": "<class>", "data": null}`.
508
+ All commands accept `--quiet` to suppress stdout for exit-code-only checks.
509
+
490
510
  ## 14. Implementation Recommendation
491
511
 
492
512
  The current implementation uses Python.
@@ -0,0 +1,57 @@
1
+ # AgentDir v0.7.7
2
+
3
+ AgentDir v0.7.7 makes self-updates easier to discover and keeps adoption
4
+ reliable in repositories where other tools generate agent guidance or Git
5
+ hooks.
6
+
7
+ ## Changes
8
+
9
+ - Add `agentdir update` as the canonical self-update command. It uses the
10
+ existing upgrade implementation, supports `--version`, `--repo`,
11
+ `--install-skill`, `--no-adopt`, `--no-hooks`, `--dry-run`, and `--json`, and
12
+ keeps the older `agentdir --upgrade` interface working for compatibility.
13
+ - Coexist with rulesync by installing AgentDir guidance at
14
+ `.rulesync/rules/agentdir.md` instead of editing generated tool files. Files
15
+ with generated headers are protected unless `--force` is explicitly used.
16
+ - Detect lefthook, husky, pre-commit, and `core.hooksPath`; record installed
17
+ shims in `.agentdir/hooks.json`; warn when another tool replaces them; and
18
+ safely restore known hook-manager scripts without discarding custom hooks.
19
+ - Install hooks into the directory Git actually uses, including linked
20
+ worktrees and repositories configured with `core.hooksPath`.
21
+ - Clarify the README's generated-file and active-hooks-directory layout, and
22
+ document when the optional semantic retrieval dependencies are worthwhile.
23
+
24
+ ## Install Or Update
25
+
26
+ Install from PyPI:
27
+
28
+ ```bash
29
+ uv tool install agentdir-cli
30
+ # or
31
+ pipx install agentdir-cli
32
+ ```
33
+
34
+ Update an existing installation:
35
+
36
+ ```bash
37
+ agentdir update
38
+ ```
39
+
40
+ Or use the release installer:
41
+
42
+ ```bash
43
+ curl -fsSL https://raw.githubusercontent.com/jstxn/agentdir/main/scripts/install.sh | bash
44
+ ```
45
+
46
+ Install the Pi package from npm or the release tag:
47
+
48
+ ```bash
49
+ pi install npm:@jstxn/agentdir-pi@0.7.7
50
+ pi install git:github.com/jstxn/agentdir@v0.7.7
51
+ ```
52
+
53
+ Rollback to v0.7.6 is one command:
54
+
55
+ ```bash
56
+ curl -fsSL https://raw.githubusercontent.com/jstxn/agentdir/main/scripts/rollback.sh | bash
57
+ ```