ur-agent 1.22.0 → 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,63 @@
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
+
29
+ ## 1.22.1
30
+
31
+ ### Added
32
+ - **Rich task decomposition.** `src/services/agents/decomposer.ts` splits large
33
+ goals into atomic subtasks with `goal`, `filesTouched`, `risk` (low/medium/high),
34
+ `testsRequired`, and `rollbackPoint`. `ur crew create|run|plan ... --decompose`
35
+ uses it; a deterministic fallback keeps the command offline and fast, while a
36
+ headless subagent path produces structured JSON.
37
+ - **Parallel specialized subagents.** New `parallel` multi-agent pattern in
38
+ `src/services/agents/patterns.ts`: bug finder, patch writer, test writer,
39
+ security auditor, and style reviewer run concurrently, then a synthesizer
40
+ merges their outputs. Run it with
41
+ `ur pattern parallel "<task>" --execute [--dry-run]`.
42
+ - **AgentKernel abstraction.** `src/services/agents/kernel.ts` is a pure
43
+ orchestrator with seven roles: planner, executor, verifier, critic, memory,
44
+ router, and guard. `ur spec run|verify <name> --kernel` routes through kernel
45
+ stages while the legacy path stays the default.
46
+ - **Spec verification / verifier kernel role.** `ur spec verify <name>` runs
47
+ deterministic `.ur/verify.json` project gates, then a read-only deep
48
+ verification subagent that must prove compile/test/lint/diff/runtime before
49
+ `VERDICT: PASS`. Persists `.ur/specs/<name>/verification.md` and records the
50
+ result in `spec.json`.
51
+
52
+ ### Changed
53
+ - **Version bump.** Updated from 1.22.0 to 1.22.1 across `package.json`,
54
+ `bunfig.toml`, the VS Code extension manifest, and the bundled CLI.
55
+
56
+ ### Verified
57
+ - Added `test/decomposition.test.ts`, `test/parallelPattern.test.ts`, and
58
+ `test/kernel.test.ts` covering decomposition metadata, parallel pattern
59
+ workflow execution, and all seven kernel roles.
60
+
3
61
  ## 1.22.0
4
62
 
5
63
  ### Added
@@ -19,6 +77,28 @@
19
77
  - **Benchmark-style reporting.** `formatEvalReport` prints aggregate cost,
20
78
  tokens, files changed, command failures, human edits, duration, and test pass
21
79
  rate alongside the pass-rate summary.
80
+ - **Spec verification / verifier kernel role.** `ur spec verify <name>` runs
81
+ deterministic project gates from `.ur/verify.json`, then invokes a read-only
82
+ deep verification subagent that must demonstrate compile/test/lint/diff/runtime
83
+ proof before emitting `VERDICT: PASS`. Results are persisted to
84
+ `.ur/specs/<name>/verification.md` and recorded in `spec.json` so `ur spec status`
85
+ shows the latest verdict.
86
+ - **AgentKernel abstraction.** Added `src/services/agents/kernel.ts`, a pure
87
+ orchestrator with seven roles: planner, executor, verifier, critic, memory,
88
+ router, and guard. `ur spec run <name> --kernel` and
89
+ `ur spec verify <name> --kernel` route through kernel stages while the legacy
90
+ loop remains the default. `src/services/agents/kernelSpec.ts` provides
91
+ spec-to-stage adapters.
92
+ - **Rich task decomposition.** Added `src/services/agents/decomposer.ts`. `ur crew
93
+ create|run|plan ... --decompose` splits a goal into atomic subtasks with
94
+ `goal`, `filesTouched`, `risk` (low/medium/high), `testsRequired`, and
95
+ `rollbackPoint` metadata. A deterministic fallback keeps it offline and fast;
96
+ the model path asks a headless subagent for structured JSON.
97
+ - **Parallel specialized subagents.** Added `parallel` multi-agent pattern in
98
+ `src/services/agents/patterns.ts`. Bug finder, patch writer, test writer,
99
+ security auditor, and style reviewer run in parallel, then a synthesizer merges
100
+ the results. `ur pattern parallel "<task>" --execute` runs it via the workflow
101
+ executor with concurrency matching the number of parallel agents.
22
102
 
23
103
  ### Changed
24
104
  - **`makeCliEvalRunner` resets cost state per case**, reads child metrics,
@@ -32,6 +112,14 @@
32
112
  - Added `test/evalMetrics.test.ts` and `test/evalDashboard.test.ts` covering
33
113
  child metrics serialization, report aggregation, dashboard HTML rendering,
34
114
  HTML escaping, and run-metrics persistence.
115
+ - Added `test/specVerify.test.ts` covering dry-run verification, gate fast-fail,
116
+ verification record persistence, and verifier prompt construction.
117
+ - Added `test/kernel.test.ts` covering all seven kernel roles and the spec
118
+ run/verify kernel adapters.
119
+ - Added `test/decomposition.test.ts` covering deterministic decomposition, risk
120
+ heuristics, LLM-driven dry-run decomposition, and crew metadata persistence.
121
+ - Added `test/parallelPattern.test.ts` covering the `parallel` pattern stages,
122
+ workflow compilation, and dry-run execution through the workflow executor.
35
123
 
36
124
  ## 1.21.0
37
125
 
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.
@@ -124,18 +130,20 @@ as first-class subcommands in the shipped CLI.
124
130
  | --- | --- |
125
131
  | `ur` | Start an interactive terminal agent session in the current workspace. |
126
132
  | `ur -p` | Run a non-interactive prompt with text, JSON, or stream-JSON output. |
127
- | `ur spec` | Create requirements, design, and task documents under `.ur/specs/`, then run the task list. |
133
+ | `ur spec` | Create requirements, design, and task documents under `.ur/specs/`, run the task list, and verify with strict proof gates. |
128
134
  | `ur escalate` | Plan or run work with fast and oracle model tiers selected from local model capabilities. |
129
135
  | `ur arena` | Run multiple agents on the same task in isolated worktrees and surface the winning diff. |
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/`. |
137
144
  | `ur workflow` | Define, validate, graph, run, and resume declarative agent workflows. |
138
- | `ur crew` | Run a lead and worker subagent crew over a shared task board. |
145
+ | `ur crew` | Run a lead and worker subagent crew over a shared task board; `--decompose` auto-splits tasks with risk/tests/rollback metadata. |
146
+ | `ur pattern` | Run multi-agent collaboration patterns (PEER, DOE, concurrent, handoff, debate, parallel); `--execute` runs them as a workflow. |
139
147
  | `ur goal` | Track long-horizon objectives that persist across sessions. |
140
148
  | `ur repo-edit` | Build a repo edit index, plan AST-aware renames, preview patches, and apply with rollback. |
141
149
  | `ur code-index` | Build, query, or watch a local semantic code index using Ollama embeddings. |
@@ -171,6 +179,12 @@ Examples:
171
179
  ```sh
172
180
  ur spec init checkout --goal "1. add cart 2. add payment 3. add receipt"
173
181
  ur spec run checkout --all --dry-run
182
+ ur spec run checkout --all --kernel
183
+ ur spec verify checkout --kernel
184
+ ur crew create parser-crew --goal "fix the flaky parser test" --decompose --dry-run
185
+ ur crew plan parser-crew --goal "fix the flaky parser test" --decompose
186
+ ur crew run parser-crew --workers 3 --decompose --dry-run
187
+ ur pattern parallel "refactor login without changing behavior" --execute --dry-run
174
188
  ur arena "implement a debounce helper" --agents 2 --dry-run
175
189
  ur escalate run "refactor the cache layer" --force-oracle --dry-run
176
190
  ur test-first detect
@@ -179,6 +193,11 @@ ur test-first install
179
193
  ur safety check --command "rm -rf build"
180
194
  ur context-pack scan
181
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
182
201
  ur context-pack compress
183
202
  ur ci-loop --command "bun test" --max-attempts 3 --dry-run
184
203
  ur bg run "fix the flaky parser test" --worktree --dry-run
@@ -207,7 +226,9 @@ UR reads repository instructions and local runtime state from project files:
207
226
  - `.ur/safety-policy.json` configures project shell safety rules for read,
208
227
  write, execute, and network command classes.
209
228
  - `.ur/project-manifest.json` and `.ur/context/` hold architecture summaries,
210
- 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.
211
232
  - `.ur/specs/`, `.ur/artifacts/`, `.ur/automations/`, `.ur/test-first/`,
212
233
  `.ur/memory/`, and `.ur/index/` hold workflow state, review artifacts,
213
234
  scheduled jobs, failure traces, memory, and indexes.