agentdir-cli 0.8.0__tar.gz → 0.10.0__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 (124) hide show
  1. {agentdir_cli-0.8.0/src/agentdir_cli.egg-info → agentdir_cli-0.10.0}/PKG-INFO +161 -14
  2. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/README.md +160 -13
  3. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/docs/AGENTIC_CODING.md +81 -20
  4. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/docs/INSTALL.md +26 -14
  5. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/docs/PI_PACKAGE.md +2 -2
  6. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/docs/PRD.md +74 -9
  7. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/docs/RELEASING.md +16 -16
  8. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/docs/TECH_BRIEF.md +67 -14
  9. agentdir_cli-0.10.0/docs/investigations/2026-08-19-agentdir-read-loop-dogfood.md +1690 -0
  10. agentdir_cli-0.10.0/docs/investigations/2026-09-21-jev-evaluation.md +204 -0
  11. agentdir_cli-0.10.0/docs/investigations/2026-09-21-jev-integration.md +260 -0
  12. agentdir_cli-0.10.0/docs/releases/v0.10.0.md +57 -0
  13. agentdir_cli-0.10.0/docs/releases/v0.9.0.md +51 -0
  14. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/examples/dogfood-session.sh +1 -1
  15. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/package.json +2 -2
  16. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/pyproject.toml +1 -1
  17. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/scripts/install.sh +2 -2
  18. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/scripts/rollback.sh +1 -1
  19. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/skills/agentdir/SKILL.md +18 -7
  20. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/src/agentdir/__init__.py +1 -1
  21. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/src/agentdir/audit.py +183 -16
  22. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/src/agentdir/capture.py +11 -1
  23. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/src/agentdir/cli.py +332 -19
  24. agentdir_cli-0.10.0/src/agentdir/context.py +1015 -0
  25. agentdir_cli-0.10.0/src/agentdir/context_expansion.py +1498 -0
  26. agentdir_cli-0.10.0/src/agentdir/context_projection.py +132 -0
  27. agentdir_cli-0.10.0/src/agentdir/context_repository.py +555 -0
  28. agentdir_cli-0.10.0/src/agentdir/context_review.py +500 -0
  29. agentdir_cli-0.10.0/src/agentdir/context_selection.py +875 -0
  30. agentdir_cli-0.10.0/src/agentdir/control.py +1701 -0
  31. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/src/agentdir/doctor.py +39 -3
  32. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/src/agentdir/federation.py +2 -2
  33. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/src/agentdir/fsutil.py +6 -4
  34. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/src/agentdir/hooks.py +102 -6
  35. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/src/agentdir/index.py +66 -20
  36. agentdir_cli-0.10.0/src/agentdir/jev.py +180 -0
  37. agentdir_cli-0.10.0/src/agentdir/locking.py +48 -0
  38. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/src/agentdir/memory.py +273 -36
  39. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/src/agentdir/rendering.py +60 -0
  40. agentdir_cli-0.10.0/src/agentdir/review.py +1024 -0
  41. agentdir_cli-0.10.0/src/agentdir/sessions.py +614 -0
  42. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/src/agentdir/skills.py +75 -16
  43. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/src/agentdir/store.py +1 -1
  44. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0/src/agentdir_cli.egg-info}/PKG-INFO +161 -14
  45. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/src/agentdir_cli.egg-info/SOURCES.txt +20 -0
  46. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/tests/test_agent_first.py +659 -5
  47. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/tests/test_agent_trust.py +11 -0
  48. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/tests/test_audit.py +252 -3
  49. agentdir_cli-0.10.0/tests/test_context_concurrency.py +683 -0
  50. agentdir_cli-0.10.0/tests/test_context_expansion.py +1080 -0
  51. agentdir_cli-0.10.0/tests/test_context_federation.py +437 -0
  52. agentdir_cli-0.10.0/tests/test_context_protocol.py +949 -0
  53. agentdir_cli-0.10.0/tests/test_context_review.py +904 -0
  54. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/tests/test_environment.py +2 -1
  55. agentdir_cli-0.10.0/tests/test_evidence_classification.py +433 -0
  56. agentdir_cli-0.10.0/tests/test_fsutil.py +21 -0
  57. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/tests/test_install_script.py +1 -1
  58. agentdir_cli-0.10.0/tests/test_jev.py +220 -0
  59. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/tests/test_pi_package.py +12 -4
  60. agentdir_cli-0.10.0/tests/test_vector_memory.py +1473 -0
  61. agentdir_cli-0.10.0/tests/test_worktrees.py +638 -0
  62. agentdir_cli-0.8.0/src/agentdir/context.py +0 -655
  63. agentdir_cli-0.8.0/src/agentdir/control.py +0 -746
  64. agentdir_cli-0.8.0/src/agentdir/review.py +0 -305
  65. agentdir_cli-0.8.0/src/agentdir/sessions.py +0 -245
  66. agentdir_cli-0.8.0/tests/test_vector_memory.py +0 -713
  67. agentdir_cli-0.8.0/tests/test_worktrees.py +0 -138
  68. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/LICENSE +0 -0
  69. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/MANIFEST.in +0 -0
  70. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/docs/DEMO.md +0 -0
  71. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/docs/assets/agentdir-overview.png +0 -0
  72. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/docs/investigations/2026-05-12-cross-repo-ergonomics-lanes.md +0 -0
  73. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/docs/investigations/2026-05-12-rag-vector-scenarios.md +0 -0
  74. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/docs/releases/v0.1.0.md +0 -0
  75. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/docs/releases/v0.1.1.md +0 -0
  76. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/docs/releases/v0.2.0.md +0 -0
  77. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/docs/releases/v0.3.0.md +0 -0
  78. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/docs/releases/v0.3.1.md +0 -0
  79. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/docs/releases/v0.3.2.md +0 -0
  80. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/docs/releases/v0.3.3.md +0 -0
  81. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/docs/releases/v0.3.4.md +0 -0
  82. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/docs/releases/v0.4.0.md +0 -0
  83. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/docs/releases/v0.5.0.md +0 -0
  84. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/docs/releases/v0.5.1.md +0 -0
  85. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/docs/releases/v0.5.2.md +0 -0
  86. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/docs/releases/v0.5.3.md +0 -0
  87. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/docs/releases/v0.6.0.md +0 -0
  88. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/docs/releases/v0.7.0.md +0 -0
  89. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/docs/releases/v0.7.1.md +0 -0
  90. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/docs/releases/v0.7.2.md +0 -0
  91. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/docs/releases/v0.7.3.md +0 -0
  92. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/docs/releases/v0.7.4.md +0 -0
  93. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/docs/releases/v0.7.5.md +0 -0
  94. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/docs/releases/v0.7.6.md +0 -0
  95. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/docs/releases/v0.7.7.md +0 -0
  96. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/docs/releases/v0.7.8.md +0 -0
  97. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/docs/releases/v0.8.0.md +0 -0
  98. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/setup.cfg +0 -0
  99. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/src/agentdir/__main__.py +0 -0
  100. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/src/agentdir/actors.py +0 -0
  101. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/src/agentdir/artifacts.py +0 -0
  102. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/src/agentdir/claims.py +0 -0
  103. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/src/agentdir/daemon.py +0 -0
  104. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/src/agentdir/envelope.py +0 -0
  105. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/src/agentdir/environment.py +0 -0
  106. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/src/agentdir/events.py +0 -0
  107. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/src/agentdir/git.py +0 -0
  108. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/src/agentdir/gitignore.py +0 -0
  109. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/src/agentdir/mailbox.py +0 -0
  110. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/src/agentdir/query.py +0 -0
  111. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/src/agentdir/redaction.py +0 -0
  112. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/src/agentdir/replay.py +0 -0
  113. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/src/agentdir/retention.py +0 -0
  114. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/src/agentdir/secrets.py +0 -0
  115. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/src/agentdir/upgrade.py +0 -0
  116. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/src/agentdir_cli.egg-info/dependency_links.txt +0 -0
  117. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/src/agentdir_cli.egg-info/entry_points.txt +0 -0
  118. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/src/agentdir_cli.egg-info/requires.txt +0 -0
  119. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/src/agentdir_cli.egg-info/top_level.txt +0 -0
  120. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/tests/test_claim_polarity.py +0 -0
  121. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/tests/test_header_folding.py +0 -0
  122. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/tests/test_structured_claims.py +0 -0
  123. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/tests/test_truncation.py +0 -0
  124. {agentdir_cli-0.8.0 → agentdir_cli-0.10.0}/tests/test_v1_behavior.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: agentdir-cli
3
- Version: 0.8.0
3
+ Version: 0.10.0
4
4
  Summary: Local-first Maildir-inspired work mailstore for software agents
5
5
  Author: AgentDir Contributors
6
6
  License-Expression: MIT
@@ -55,6 +55,23 @@ Engineers should not have to manually start sessions, wrap commands, collect
55
55
  evidence, or maintain agent memory by hand. Once a repository is adopted, the
56
56
  agent operates AgentDir in the background and leaves behind a useful trail.
57
57
 
58
+ ## Featured: Use Jev with Your Own Key
59
+
60
+ [![Jev: Bring your own key](https://img.shields.io/badge/Jev-Bring_your_own_key-2563eb?style=flat-square)](https://docs.typesafe.ai/introduction)
61
+
62
+ Get your API key from [TypeSafe](https://console.typesafe.ai), then run this in
63
+ your project's Bash terminal:
64
+
65
+ ```bash
66
+ read -rsp "Your Jev API key: " TYPESAFE_API_KEY
67
+ printf '\n'
68
+ export TYPESAFE_API_KEY
69
+ agentdir memory reranker configure jev
70
+ ```
71
+
72
+ Launch your coding agent from that terminal. This opt-in feature sends redacted
73
+ context to Jev. [Details and limits](#optional-jev-context-filtering).
74
+
58
75
  ## Why AgentDir Exists
59
76
 
60
77
  Agentic engineering has a trust gap.
@@ -81,7 +98,7 @@ AgentDir gives those answers a local, durable home.
81
98
  | Replayable sessions | Inspect the task, decisions, commands, outputs, blockers, summaries, and handoffs after the fact. |
82
99
  | Local-first storage | Records live in the repo-local `.agentdir` directory by default. No hosted service is required. |
83
100
  | Rebuildable memory | Raw event files are the source of truth. SQLite search and memory indexes can be rebuilt. |
84
- | Context lineage | Agents can emit context packs, then record which retrieved sources were consumed or cited. |
101
+ | Context lineage | Agents review a bounded briefing, then record which sources were used, dismissed, skipped, or cited. |
85
102
  | Cross-repo memory | Explicitly registered AgentDir roots can be searched together without moving canonical records. |
86
103
  | Secret-aware persistence | Common secret-like patterns are redacted before storage, with scan and cleanup commands for older records. |
87
104
 
@@ -107,10 +124,12 @@ Use AgentDir only when you want the trail.
107
124
  The agent handles the recording surface:
108
125
 
109
126
  ```bash
110
- agentdir work start "fix checkout failure" --emit-context
127
+ agentdir work start "fix checkout failure"
128
+ agentdir work context --expand 1
129
+ agentdir work context --use 1 --reason "prior checkout pattern informs the plan"
111
130
  agentdir run -- pytest -q
112
131
  agentdir audit session
113
- agentdir work finish --json
132
+ agentdir work finish --json --brief
114
133
  ```
115
134
 
116
135
  ## Install
@@ -160,7 +179,7 @@ available automatically during coding tasks:
160
179
  Package page: [@jstxn/agentdir-pi](https://pi.dev/packages/@jstxn/agentdir-pi)
161
180
 
162
181
  ```bash
163
- pi install npm:@jstxn/agentdir-pi@0.8.0
182
+ pi install npm:@jstxn/agentdir-pi@0.10.0
164
183
  # or install directly from a local checkout / release tag:
165
184
  pi install /absolute/path/to/agentdir
166
185
  pi install git:github.com/jstxn/agentdir@<tag-or-commit>
@@ -183,7 +202,7 @@ Coding agents use the non-interactive form below so `.agentdir/` is ignored at
183
202
  the user level without creating a repository `.gitignore` change:
184
203
 
185
204
  ```bash
186
- agentdir adopt --gitignore user
205
+ agentdir adopt --if-needed --gitignore user
187
206
  ```
188
207
 
189
208
  This is intentionally boring setup. It prepares the repository once, then agents
@@ -275,6 +294,19 @@ fragmenting into one store per branch.
275
294
  Each worktree still keeps its own active session, so parallel agents in
276
295
  different worktrees do not overwrite each other.
277
296
 
297
+ Agents should probe the resolved store instead of checking whether the current
298
+ checkout contains a physical `.agentdir`:
299
+
300
+ ```bash
301
+ agentdir root --require --quiet
302
+ ```
303
+
304
+ A zero exit means the local or shared store is ready. Exit 3 means the agent can
305
+ run `agentdir adopt --if-needed --gitignore user`. In a restricted linked
306
+ worktree that cannot write the shared Git hooks directory, it can retry with
307
+ `--no-hooks`; adoption preflights the hook target before creating the store or
308
+ writing guidance files.
309
+
278
310
  Two cases keep a store inside the worktree instead:
279
311
 
280
312
  ```bash
@@ -299,6 +331,12 @@ agentdir replay
299
331
  agentdir memory search "checkout failure"
300
332
  ```
301
333
 
334
+ Without `--session`, the review commands use the active session when one
335
+ exists, then fall back to the latest completed session for the current
336
+ worktree. `status` keeps `session.current` reserved for active work and reports
337
+ the historical projection separately as `session.latest` and
338
+ `evidence.session_id`.
339
+
302
340
  For final-answer support:
303
341
 
304
342
  ```bash
@@ -345,9 +383,11 @@ The important property is recoverability: deleting the derived index does not
345
383
  destroy the session. AgentDir can rebuild from the envelope store.
346
384
 
347
385
  The agent-facing report surface is JSON. `agentdir report final --format json`
348
- and `agentdir work finish --json` include an `agent_handoff` object with
349
- verification evidence, failed evidence, claim support, context lineage, known
350
- gaps, and recommended next agent actions.
386
+ and `agentdir work finish --json` include the full forensic report. Agents can
387
+ use `agentdir work finish --json --brief` to receive just the compact handoff,
388
+ Git state, health, and ended-session metadata. Both shapes include an
389
+ `agent_handoff` object with verification evidence, failed evidence, claim
390
+ support, context lineage, known gaps, and recommended next actions.
351
391
 
352
392
  ## Unique Capabilities
353
393
 
@@ -380,6 +420,11 @@ Recording a family again replaces its earlier claim, so a check re-run after a
380
420
  fix supersedes rather than accumulates. Claiming a failure honestly is
381
421
  `acknowledged` and does not count against the audit.
382
422
 
423
+ Tool evidence remains append-only. When a newer result in the same evidence
424
+ family passes, earlier failures remain available as historical and resolved
425
+ evidence, while strict session audit and the agent handoff report only failures
426
+ whose family is still failing.
427
+
383
428
  A claim made in error can be withdrawn:
384
429
 
385
430
  ```bash
@@ -428,7 +473,52 @@ and checked against evidence like any other.
428
473
 
429
474
  ### Context Packs
430
475
 
431
- Agents can package retrieved context into auditable source manifests:
476
+ `work start` retrieves, persists, and prints a bounded briefing by default, with
477
+ numbered sources, excerpts, source classes, and match quality. `--no-context`
478
+ skips retrieval but still persists a zero-source opt-out marker, so a new task
479
+ cannot inherit an older task's context. The agent must then record one honest
480
+ decision:
481
+
482
+ ```bash
483
+ # when the preview looks useful but is too short:
484
+ agentdir work context --expand 1
485
+ agentdir work context --expand 1 --page 2
486
+ # then record the decision:
487
+ agentdir work context --use 1 --reason "prior failure constrains the repair"
488
+ # or, when the briefing does not help:
489
+ agentdir work context --none-relevant --reason "only generic build logs matched"
490
+ # after a restart or lost output:
491
+ agentdir work context --show
492
+ ```
493
+
494
+ `work finish` keeps every non-empty briefing in the session open until the agent
495
+ records used sources, no relevant context, or an explicit skipped review. A
496
+ newer pack cannot hide an older pending pack. Status, audits, and handoffs
497
+ report the funnel as retrieved, presented, reviewed, used, dismissed, pending,
498
+ and cited, including invalid cite-before-use lineage. Lower-level consumption
499
+ of omitted sources is reported separately so `used` never exceeds `reviewed`.
500
+ Citation remains optional and separate from use. Printed review commands are
501
+ bound to the displayed pack, so reopening an older briefing cannot accidentally
502
+ decide a newer one.
503
+
504
+ Briefing excerpts are labeled previews. `work context --expand <number>` reads
505
+ the retained canonical source through the same pack-local number without making
506
+ a review decision. Output is redacted and capped to 4096 UTF-8 bytes per page;
507
+ plain and JSON output identify integrity (`verified`, `legacy_unverified`,
508
+ `changed`, or `unavailable`) and extent (`full`, `bounded`, or
509
+ `stored_excerpt`). Digest drift or an unavailable federated root returns only
510
+ the immutable, redacted manifest preview rather than presenting changed text as
511
+ historical truth.
512
+
513
+ While the pack-owning session is active, a successful canonical expansion emits
514
+ one idempotent, metadata-only receipt. The source body is never copied into the
515
+ receipt or searchable memory. Expansion remains optional and never changes the
516
+ terminal decision or blocks `work finish`; audits, status, and handoffs report
517
+ expanded-before-decision, expanded-after-decision, and used-without-prior-
518
+ expansion counts. Retained ended or archived packs can still be read directly,
519
+ but historical reads do not append new receipts or re-enter active search.
520
+
521
+ The lower-level context interface remains available for explicit packs:
432
522
 
433
523
  ```bash
434
524
  agentdir context build "checkout failure" --emit
@@ -437,8 +527,18 @@ agentdir context cite --pack <pack-id>
437
527
  agentdir audit context --pack <pack-id>
438
528
  ```
439
529
 
440
- This does not prove a model paid attention, but it does make cooperative agent
441
- behavior visible.
530
+ Consuming every presented source through the lower-level interface completes a
531
+ compatibility review. A partial legacy consume can finish with a visible
532
+ `compatibility_partial` warning rather than forcing false consumption. A
533
+ terminal `work context` decision cannot be changed by a later lower-level
534
+ consume. Session-scoped lifecycle locking makes pack creation linearize before
535
+ the finish audit; an emitter that loses the race to an ended session is rejected.
536
+ Manifest digests, creation-event identities, decision integrity headers, and
537
+ source references are validated before lineage can be certified.
538
+
539
+ AgentDir cannot prove model attention. It can show what was presented, the
540
+ agent's reasoned decision, which sources were actually used, and whether those
541
+ used sources were later cited.
442
542
 
443
543
  ### Local Agent Memory
444
544
 
@@ -452,8 +552,55 @@ agentdir memory explain "release evidence"
452
552
  agentdir context build "release evidence" --emit
453
553
  ```
454
554
 
455
- Optional semantic extras exist, but the default path does not require a vector
456
- database or external embedding service.
555
+ Retrieval mode defaults to `auto`. Without optional dependencies it keeps the
556
+ built-in local hybrid path. When FastEmbed is installed and configured for the
557
+ store, the same `work start`, `context build`, `memory search`, and
558
+ `memory explain` commands automatically fuse semantic and lexical scores while
559
+ preserving both components in JSON output. Explicit `--retrieval` modes remain
560
+ available for diagnostics and comparisons.
561
+
562
+ ### Optional Jev Context Filtering
563
+
564
+ Jev can filter and rank local context for `work start` and `context build` after
565
+ retrieval, before source diversification. It is disabled by default and needs
566
+ no extra Python dependencies. Opt in separately for each store:
567
+
568
+ ```bash
569
+ agentdir memory reranker configure jev
570
+ # Supply TYPESAFE_API_KEY (or JEV_API_KEY) through your process environment.
571
+ agentdir work start "make database migrations safe to roll back"
572
+
573
+ # Restore fully local context selection.
574
+ agentdir memory reranker configure none
575
+ ```
576
+
577
+ Enabling this sends the task (up to 2048 UTF-8 bytes) and up to 20 local
578
+ candidate passages (subject plus passage, up to 1024 bytes each) to
579
+ `https://api.typesafe.ai/v1/systemone`. Common secret patterns and the configured
580
+ API key are redacted before sending; redaction does not anonymize proprietary
581
+ material. Keys are read only from the environment, never saved in configuration;
582
+ AgentDir does not automatically load `.env` files. Review
583
+ [TypeSafe's data handling](https://docs.typesafe.ai/models) before opting in.
584
+ Federated/group context always uses local selection, even when Jev is enabled.
585
+
586
+ The evaluated `jev-1.13.0` model and relevance cutoff of 0.7 are pinned. A
587
+ successful response filters the shortlist and suppresses unscored recent
588
+ summaries, while preserving source tiers, diversity limits, original retrieval
589
+ scores, current evidence, and the agent's review requirement. Derived session
590
+ summaries are not sent for scoring. Missing credentials, request failures,
591
+ malformed responses, or the three-second worker deadline retain local selection
592
+ and report a fallback reason. There are no retries. Work-start locking stays
593
+ intact; a request may add up to the worker deadline to that locked operation.
594
+
595
+ Context JSON and persisted manifests include `reranking` metadata: status,
596
+ model, rubric version, cutoff, candidate identities and sanitized-text hashes,
597
+ scores, usage, and latency. Each surviving source also has `rerank_score`;
598
+ `memory_score` remains the original local score. Reviewing a saved pack or
599
+ rebuilding the index makes no Jev request. `memory search` and `memory explain`
600
+ continue to describe local retrieval. Jev scores are advisory and cannot verify
601
+ evidence or mark a source read, used, or cited. The
602
+ [synthetic evaluation](docs/investigations/2026-09-21-jev-evaluation.md) motivates
603
+ this opt-in feature; validation on real session history is still needed.
457
604
 
458
605
  ### Federated Memory
459
606
 
@@ -22,6 +22,23 @@ Engineers should not have to manually start sessions, wrap commands, collect
22
22
  evidence, or maintain agent memory by hand. Once a repository is adopted, the
23
23
  agent operates AgentDir in the background and leaves behind a useful trail.
24
24
 
25
+ ## Featured: Use Jev with Your Own Key
26
+
27
+ [![Jev: Bring your own key](https://img.shields.io/badge/Jev-Bring_your_own_key-2563eb?style=flat-square)](https://docs.typesafe.ai/introduction)
28
+
29
+ Get your API key from [TypeSafe](https://console.typesafe.ai), then run this in
30
+ your project's Bash terminal:
31
+
32
+ ```bash
33
+ read -rsp "Your Jev API key: " TYPESAFE_API_KEY
34
+ printf '\n'
35
+ export TYPESAFE_API_KEY
36
+ agentdir memory reranker configure jev
37
+ ```
38
+
39
+ Launch your coding agent from that terminal. This opt-in feature sends redacted
40
+ context to Jev. [Details and limits](#optional-jev-context-filtering).
41
+
25
42
  ## Why AgentDir Exists
26
43
 
27
44
  Agentic engineering has a trust gap.
@@ -48,7 +65,7 @@ AgentDir gives those answers a local, durable home.
48
65
  | Replayable sessions | Inspect the task, decisions, commands, outputs, blockers, summaries, and handoffs after the fact. |
49
66
  | Local-first storage | Records live in the repo-local `.agentdir` directory by default. No hosted service is required. |
50
67
  | Rebuildable memory | Raw event files are the source of truth. SQLite search and memory indexes can be rebuilt. |
51
- | Context lineage | Agents can emit context packs, then record which retrieved sources were consumed or cited. |
68
+ | Context lineage | Agents review a bounded briefing, then record which sources were used, dismissed, skipped, or cited. |
52
69
  | Cross-repo memory | Explicitly registered AgentDir roots can be searched together without moving canonical records. |
53
70
  | Secret-aware persistence | Common secret-like patterns are redacted before storage, with scan and cleanup commands for older records. |
54
71
 
@@ -74,10 +91,12 @@ Use AgentDir only when you want the trail.
74
91
  The agent handles the recording surface:
75
92
 
76
93
  ```bash
77
- agentdir work start "fix checkout failure" --emit-context
94
+ agentdir work start "fix checkout failure"
95
+ agentdir work context --expand 1
96
+ agentdir work context --use 1 --reason "prior checkout pattern informs the plan"
78
97
  agentdir run -- pytest -q
79
98
  agentdir audit session
80
- agentdir work finish --json
99
+ agentdir work finish --json --brief
81
100
  ```
82
101
 
83
102
  ## Install
@@ -127,7 +146,7 @@ available automatically during coding tasks:
127
146
  Package page: [@jstxn/agentdir-pi](https://pi.dev/packages/@jstxn/agentdir-pi)
128
147
 
129
148
  ```bash
130
- pi install npm:@jstxn/agentdir-pi@0.8.0
149
+ pi install npm:@jstxn/agentdir-pi@0.10.0
131
150
  # or install directly from a local checkout / release tag:
132
151
  pi install /absolute/path/to/agentdir
133
152
  pi install git:github.com/jstxn/agentdir@<tag-or-commit>
@@ -150,7 +169,7 @@ Coding agents use the non-interactive form below so `.agentdir/` is ignored at
150
169
  the user level without creating a repository `.gitignore` change:
151
170
 
152
171
  ```bash
153
- agentdir adopt --gitignore user
172
+ agentdir adopt --if-needed --gitignore user
154
173
  ```
155
174
 
156
175
  This is intentionally boring setup. It prepares the repository once, then agents
@@ -242,6 +261,19 @@ fragmenting into one store per branch.
242
261
  Each worktree still keeps its own active session, so parallel agents in
243
262
  different worktrees do not overwrite each other.
244
263
 
264
+ Agents should probe the resolved store instead of checking whether the current
265
+ checkout contains a physical `.agentdir`:
266
+
267
+ ```bash
268
+ agentdir root --require --quiet
269
+ ```
270
+
271
+ A zero exit means the local or shared store is ready. Exit 3 means the agent can
272
+ run `agentdir adopt --if-needed --gitignore user`. In a restricted linked
273
+ worktree that cannot write the shared Git hooks directory, it can retry with
274
+ `--no-hooks`; adoption preflights the hook target before creating the store or
275
+ writing guidance files.
276
+
245
277
  Two cases keep a store inside the worktree instead:
246
278
 
247
279
  ```bash
@@ -266,6 +298,12 @@ agentdir replay
266
298
  agentdir memory search "checkout failure"
267
299
  ```
268
300
 
301
+ Without `--session`, the review commands use the active session when one
302
+ exists, then fall back to the latest completed session for the current
303
+ worktree. `status` keeps `session.current` reserved for active work and reports
304
+ the historical projection separately as `session.latest` and
305
+ `evidence.session_id`.
306
+
269
307
  For final-answer support:
270
308
 
271
309
  ```bash
@@ -312,9 +350,11 @@ The important property is recoverability: deleting the derived index does not
312
350
  destroy the session. AgentDir can rebuild from the envelope store.
313
351
 
314
352
  The agent-facing report surface is JSON. `agentdir report final --format json`
315
- and `agentdir work finish --json` include an `agent_handoff` object with
316
- verification evidence, failed evidence, claim support, context lineage, known
317
- gaps, and recommended next agent actions.
353
+ and `agentdir work finish --json` include the full forensic report. Agents can
354
+ use `agentdir work finish --json --brief` to receive just the compact handoff,
355
+ Git state, health, and ended-session metadata. Both shapes include an
356
+ `agent_handoff` object with verification evidence, failed evidence, claim
357
+ support, context lineage, known gaps, and recommended next actions.
318
358
 
319
359
  ## Unique Capabilities
320
360
 
@@ -347,6 +387,11 @@ Recording a family again replaces its earlier claim, so a check re-run after a
347
387
  fix supersedes rather than accumulates. Claiming a failure honestly is
348
388
  `acknowledged` and does not count against the audit.
349
389
 
390
+ Tool evidence remains append-only. When a newer result in the same evidence
391
+ family passes, earlier failures remain available as historical and resolved
392
+ evidence, while strict session audit and the agent handoff report only failures
393
+ whose family is still failing.
394
+
350
395
  A claim made in error can be withdrawn:
351
396
 
352
397
  ```bash
@@ -395,7 +440,52 @@ and checked against evidence like any other.
395
440
 
396
441
  ### Context Packs
397
442
 
398
- Agents can package retrieved context into auditable source manifests:
443
+ `work start` retrieves, persists, and prints a bounded briefing by default, with
444
+ numbered sources, excerpts, source classes, and match quality. `--no-context`
445
+ skips retrieval but still persists a zero-source opt-out marker, so a new task
446
+ cannot inherit an older task's context. The agent must then record one honest
447
+ decision:
448
+
449
+ ```bash
450
+ # when the preview looks useful but is too short:
451
+ agentdir work context --expand 1
452
+ agentdir work context --expand 1 --page 2
453
+ # then record the decision:
454
+ agentdir work context --use 1 --reason "prior failure constrains the repair"
455
+ # or, when the briefing does not help:
456
+ agentdir work context --none-relevant --reason "only generic build logs matched"
457
+ # after a restart or lost output:
458
+ agentdir work context --show
459
+ ```
460
+
461
+ `work finish` keeps every non-empty briefing in the session open until the agent
462
+ records used sources, no relevant context, or an explicit skipped review. A
463
+ newer pack cannot hide an older pending pack. Status, audits, and handoffs
464
+ report the funnel as retrieved, presented, reviewed, used, dismissed, pending,
465
+ and cited, including invalid cite-before-use lineage. Lower-level consumption
466
+ of omitted sources is reported separately so `used` never exceeds `reviewed`.
467
+ Citation remains optional and separate from use. Printed review commands are
468
+ bound to the displayed pack, so reopening an older briefing cannot accidentally
469
+ decide a newer one.
470
+
471
+ Briefing excerpts are labeled previews. `work context --expand <number>` reads
472
+ the retained canonical source through the same pack-local number without making
473
+ a review decision. Output is redacted and capped to 4096 UTF-8 bytes per page;
474
+ plain and JSON output identify integrity (`verified`, `legacy_unverified`,
475
+ `changed`, or `unavailable`) and extent (`full`, `bounded`, or
476
+ `stored_excerpt`). Digest drift or an unavailable federated root returns only
477
+ the immutable, redacted manifest preview rather than presenting changed text as
478
+ historical truth.
479
+
480
+ While the pack-owning session is active, a successful canonical expansion emits
481
+ one idempotent, metadata-only receipt. The source body is never copied into the
482
+ receipt or searchable memory. Expansion remains optional and never changes the
483
+ terminal decision or blocks `work finish`; audits, status, and handoffs report
484
+ expanded-before-decision, expanded-after-decision, and used-without-prior-
485
+ expansion counts. Retained ended or archived packs can still be read directly,
486
+ but historical reads do not append new receipts or re-enter active search.
487
+
488
+ The lower-level context interface remains available for explicit packs:
399
489
 
400
490
  ```bash
401
491
  agentdir context build "checkout failure" --emit
@@ -404,8 +494,18 @@ agentdir context cite --pack <pack-id>
404
494
  agentdir audit context --pack <pack-id>
405
495
  ```
406
496
 
407
- This does not prove a model paid attention, but it does make cooperative agent
408
- behavior visible.
497
+ Consuming every presented source through the lower-level interface completes a
498
+ compatibility review. A partial legacy consume can finish with a visible
499
+ `compatibility_partial` warning rather than forcing false consumption. A
500
+ terminal `work context` decision cannot be changed by a later lower-level
501
+ consume. Session-scoped lifecycle locking makes pack creation linearize before
502
+ the finish audit; an emitter that loses the race to an ended session is rejected.
503
+ Manifest digests, creation-event identities, decision integrity headers, and
504
+ source references are validated before lineage can be certified.
505
+
506
+ AgentDir cannot prove model attention. It can show what was presented, the
507
+ agent's reasoned decision, which sources were actually used, and whether those
508
+ used sources were later cited.
409
509
 
410
510
  ### Local Agent Memory
411
511
 
@@ -419,8 +519,55 @@ agentdir memory explain "release evidence"
419
519
  agentdir context build "release evidence" --emit
420
520
  ```
421
521
 
422
- Optional semantic extras exist, but the default path does not require a vector
423
- database or external embedding service.
522
+ Retrieval mode defaults to `auto`. Without optional dependencies it keeps the
523
+ built-in local hybrid path. When FastEmbed is installed and configured for the
524
+ store, the same `work start`, `context build`, `memory search`, and
525
+ `memory explain` commands automatically fuse semantic and lexical scores while
526
+ preserving both components in JSON output. Explicit `--retrieval` modes remain
527
+ available for diagnostics and comparisons.
528
+
529
+ ### Optional Jev Context Filtering
530
+
531
+ Jev can filter and rank local context for `work start` and `context build` after
532
+ retrieval, before source diversification. It is disabled by default and needs
533
+ no extra Python dependencies. Opt in separately for each store:
534
+
535
+ ```bash
536
+ agentdir memory reranker configure jev
537
+ # Supply TYPESAFE_API_KEY (or JEV_API_KEY) through your process environment.
538
+ agentdir work start "make database migrations safe to roll back"
539
+
540
+ # Restore fully local context selection.
541
+ agentdir memory reranker configure none
542
+ ```
543
+
544
+ Enabling this sends the task (up to 2048 UTF-8 bytes) and up to 20 local
545
+ candidate passages (subject plus passage, up to 1024 bytes each) to
546
+ `https://api.typesafe.ai/v1/systemone`. Common secret patterns and the configured
547
+ API key are redacted before sending; redaction does not anonymize proprietary
548
+ material. Keys are read only from the environment, never saved in configuration;
549
+ AgentDir does not automatically load `.env` files. Review
550
+ [TypeSafe's data handling](https://docs.typesafe.ai/models) before opting in.
551
+ Federated/group context always uses local selection, even when Jev is enabled.
552
+
553
+ The evaluated `jev-1.13.0` model and relevance cutoff of 0.7 are pinned. A
554
+ successful response filters the shortlist and suppresses unscored recent
555
+ summaries, while preserving source tiers, diversity limits, original retrieval
556
+ scores, current evidence, and the agent's review requirement. Derived session
557
+ summaries are not sent for scoring. Missing credentials, request failures,
558
+ malformed responses, or the three-second worker deadline retain local selection
559
+ and report a fallback reason. There are no retries. Work-start locking stays
560
+ intact; a request may add up to the worker deadline to that locked operation.
561
+
562
+ Context JSON and persisted manifests include `reranking` metadata: status,
563
+ model, rubric version, cutoff, candidate identities and sanitized-text hashes,
564
+ scores, usage, and latency. Each surviving source also has `rerank_score`;
565
+ `memory_score` remains the original local score. Reviewing a saved pack or
566
+ rebuilding the index makes no Jev request. `memory search` and `memory explain`
567
+ continue to describe local retrieval. Jev scores are advisory and cannot verify
568
+ evidence or mark a source read, used, or cited. The
569
+ [synthetic evaluation](docs/investigations/2026-09-21-jev-evaluation.md) motivates
570
+ this opt-in feature; validation on real session history is still needed.
424
571
 
425
572
  ### Federated Memory
426
573