ur-agent 1.22.1 → 1.22.2

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.22.2
4
+
5
+ ### Added
6
+ - **Lifecycle hooks.** Added six new hook events in `src/entrypoints/sdk/coreTypes.ts`
7
+ and `src/entrypoints/sdk/coreSchemas.ts`: `BeforeEdit`, `AfterEdit`,
8
+ `BeforeCommand`, `AfterCommand`, `BeforeCommit`, and `OnFailure`. Dispatchers
9
+ in `src/utils/hooks.ts` run them around file edits, shell commands, git commits,
10
+ and failure paths. Call sites are wired in `FileEditTool`, `BashTool`,
11
+ `PowerShellTool`, `toolExecution.ts`, and `query.ts`. Hooks are advisory by
12
+ default and can block actions or append project memory.
13
+ - **Persistent project memory.** Extended `TaskMemoryKind` in
14
+ `src/services/context/projectContextManifest.ts` with `architecture`,
15
+ `preference`, `attempt`, `accepted`, and `rejected`. Entries now support
16
+ `status`, `rationale`, `alternativeTo`, `supersedesId`, `scope`, and `source`
17
+ metadata. `ur context-pack remember` accepts the new kinds and metadata flags.
18
+
19
+ ### Changed
20
+ - **Compressed context** now includes sections for all memory kinds, including the
21
+ new project-memory categories.
22
+
23
+ ### Verified
24
+ - Added `test/lifecycleHooks.test.ts` covering the new `HOOK_EVENTS` literals and
25
+ Zod schema validation.
26
+ - Added `test/projectMemory.test.ts` covering append/read/compress/summarize for
27
+ the new memory categories and metadata.
28
+
3
29
  ## 1.22.1
4
30
 
5
31
  ### Added
package/README.md CHANGED
@@ -38,7 +38,13 @@ handing work off to other tools or agents when needed.
38
38
  AST-aware rename plans, patch previews, and rollback-safe multi-file apply.
39
39
  - **Permission and context control.** Use `ur safety` and `ur context-pack` to
40
40
  inspect command risk, initialize project safety policy, summarize repository
41
- architecture, and preserve task decisions, constraints, commands, and diffs.
41
+ architecture, and preserve task decisions, constraints, commands, diffs,
42
+ architecture decisions, preferred commands, failed attempts, accepted patterns,
43
+ and rejected approaches.
44
+ - **Lifecycle hooks.** Configure `BeforeEdit`, `AfterEdit`, `BeforeCommand`,
45
+ `AfterCommand`, `BeforeCommit`, and `OnFailure` hooks in `.ur/hooks.json` or
46
+ `UR.md` to run custom commands when the agent edits files, runs shell commands,
47
+ commits, or hits a failure.
42
48
  - **Verification and provenance.** Use `ur test-first`, the built-in verifier,
43
49
  `/verify`, `.ur/verify.json`, `ur artifacts`, `ur claim-ledger`, and `/trace`
44
50
  to make results easier to inspect.
@@ -130,7 +136,8 @@ as first-class subcommands in the shipped CLI.
130
136
  | `ur ci-loop` | Run a build or test command, hand failures to a fix agent, and retry with a bounded budget. |
131
137
  | `ur test-first` | Detect the project stack, run compile/test/lint commands, store failure traces, and install edit-time verify gates. |
132
138
  | `ur safety` | Inspect or initialize project shell safety policy and evaluate command risk before execution. |
133
- | `ur context-pack` | Write project architecture context, task memory, and compressed context under `.ur/`. |
139
+ | `ur context-pack` | Write project architecture context, task memory, and compressed context under `.ur/`. Supports memory kinds `decision`, `constraint`, `command`, `diff`, `note`, `architecture`, `preference`, `attempt`, `accepted`, and `rejected`. |
140
+ | `ur hooks` | Configure lifecycle hooks (`BeforeEdit`, `AfterEdit`, `BeforeCommand`, `AfterCommand`, `BeforeCommit`, `OnFailure`) via settings files. |
134
141
  | `ur bg` | Run and manage detached local background agents with optional worktrees and PR creation. |
135
142
  | `ur worktree` | List, inspect, and clean up UR agent worktrees. |
136
143
  | `ur automation` | Store and run project-local scheduled automation specs under `.ur/automations/`. |
@@ -186,6 +193,11 @@ ur test-first install
186
193
  ur safety check --command "rm -rf build"
187
194
  ur context-pack scan
188
195
  ur context-pack remember --decision "Use package scripts before ad hoc commands"
196
+ ur context-pack remember --architecture "Repository pattern for data access" --status accepted --rationale "Testability"
197
+ ur context-pack remember --preference "Use bun test over jest"
198
+ ur context-pack remember --accepted "Use p-map for bounded concurrency" --scope project
199
+ ur context-pack remember --rejected "Switch to esbuild" --alternative-to "Keep bun bundle"
200
+ ur context-pack remember --attempt "Tried Deno runtime" --status superseded
189
201
  ur context-pack compress
190
202
  ur ci-loop --command "bun test" --max-attempts 3 --dry-run
191
203
  ur bg run "fix the flaky parser test" --worktree --dry-run
@@ -214,7 +226,9 @@ UR reads repository instructions and local runtime state from project files:
214
226
  - `.ur/safety-policy.json` configures project shell safety rules for read,
215
227
  write, execute, and network command classes.
216
228
  - `.ur/project-manifest.json` and `.ur/context/` hold architecture summaries,
217
- task memory, compressed context, and command/constraint decisions.
229
+ task memory, compressed context, and project memory including architecture
230
+ decisions, preferred commands, failed attempts, accepted patterns, and rejected
231
+ approaches.
218
232
  - `.ur/specs/`, `.ur/artifacts/`, `.ur/automations/`, `.ur/test-first/`,
219
233
  `.ur/memory/`, and `.ur/index/` hold workflow state, review artifacts,
220
234
  scheduled jobs, failure traces, memory, and indexes.