Repository navigation
Commit db39664
authored
🤖 refactor: usage, goal and timing services take the workspace FIFO from SessionLocks (#7379)
## Summary
The session usage, goal and timing services take the workspace FIFO from
`SessionLocks`. It is PR 7 of phase 4. Lock keys and order do not
change: the Node layer gives today's `workspaceFileLocks`.
## Order
- Plan order: PR 7 comes after PR 6, with PR 8 (#7354), and before PR 9.
- Landing order: PR 7 lands on main as its own PR, after PR 9 (#7372),
before PR 8 (#7354) and PR 5 (#7355) (recorded as a phase 4 plan note).
- Why: PR 7 needs PR 9's `historyService.locks`, which has merged. It
uses no code from PR 8 or PR 5.
## Implementation
- `sessionUsageService.ts` (8 calls) and `workspaceGoalService.ts` (29
calls): `fileLocks` is a getter that returns
`historyService.locks.workspaceFiles`. A memory or foreign-holder layer
reaches these writes too. The getter reads at each use, not at
construction, so tests that pass a partial `HistoryService` need no
edit.
- `sessionTimingService.ts` (4 calls): `new SessionTimingService(config,
telemetry, locks = nodeSessionLocks)`. `desktop.ts` keeps its call.
- `desktop.ts` and `core.ts` do not change.
## Validation
All on the head (`c7cacdb5db`, this diff on main `4770fa63e0`):
- `bun test` of `sessionUsageService*.test.ts`,
`workspaceGoalService*.test.ts`, `sessionTimingService.test.ts` and
`sessionLocks/`: 324 pass, 0 fail. The test files pass with no edit. The
call record fixture is unchanged.
- `make static-check`, `make lint-eslint`: pass.
- `make test`: 27753 pass, 0 fail in the main run, and every other run
passes.
- Tripwire (`scripts/perf/loopTestBaseline.ts --runs 3 --base
origin/main`): 0 trips.
- `make crap-check`: PASS, 0 violations. `make mutate-check`: PASS, 0
mutants in scope.
## Risks
- None for behavior: in the app, `historyService.locks.workspaceFiles`
and the default are the same `workspaceFileLocks` map.
---
_Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking:
`high` • Cost: `$122.03`_
<!-- mux-attribution: model=anthropic:claude-opus-5-5 thinking=high
costs=122.03 -->1 parent 06fe1fb commit db39664
3 files changed
Lines changed: 28 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
163 | 164 | | |
164 | 165 | | |
165 | 166 | | |
166 | | - | |
| 167 | + | |
| 168 | + | |
167 | 169 | | |
168 | 170 | | |
169 | 171 | | |
| |||
181 | 183 | | |
182 | 184 | | |
183 | 185 | | |
184 | | - | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
185 | 191 | | |
186 | 192 | | |
| 193 | + | |
187 | 194 | | |
188 | 195 | | |
189 | 196 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
230 | | - | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
231 | 238 | | |
232 | 239 | | |
233 | 240 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
609 | 609 | | |
610 | 610 | | |
611 | 611 | | |
612 | | - | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
613 | 620 | | |
614 | 621 | | |
615 | 622 | | |
| |||
0 commit comments