Repository navigation
Commit f2b4d1c
authored
* feat(core): add ObservationRegistry with its spec and the Task consumer (U5c-7, split of #1991)
ObservationRegistry records per-file observation state with a completeness flag,
refuses further recording once closed, and is dropped when a task is disposed.
It lands together with the Task-side code that imports it, because the repo's own
policy asserts that a production file imported only by tests is still reported as
unused (scripts/knip-policy.test.mjs) and knip --production is a required check.
384 additions / 0 deletions across 5 paths. The mutation gate counts 25 of 500
executable lines and 15 of 400 selectors at this base.
Content ported byte-identical from #2357 (5319fe9..d6fa711).
* fix(core): answer the review nits on the observation registry unit
- observationRegistry.spec.ts: restore real timers from an afterEach on the
describe block, so a failing assertion in the fake-timer test cannot leave the
rest of the file running on fake timers.
- Task.dispose.test.ts: await the second Task's disposal in the finally block
instead of firing it and forgetting it, so teardown is deterministic and a
rejection surfaces.
- Task.ts: describe cancellationGeneration in repository terms. The run-state
kernel has no transition that clears latches.abort, so abort stays true across
resumeAfterDelegation() and only the counter keeps a cancelled run apart from
the resumed one; the guarded write the comment documents has no production
reader yet, so the comment no longer claims a comparison that does not happen.
The production change is comment-only: the mutation gate still prices 25 counted
executable lines and 15 selectors for this unit.
* reformat the transplanted cancellation-generation row to prettier style
The row advancing the cancellation generation for the disposal an unmocked abort performs was moved
onto main during the rebase, and prettier --check over the tree reported this file as not conforming
while tsc exited 0 and vitest passed 242 tests over the three touched specs, so the gap was layout and
not content. Running prettier --write on this file changed 315841 bytes into 315840 bytes over the same
non-blank line count, and every non-blank line is identical once leading, trailing and repeated
whitespace are collapsed, so nothing was added, removed, or reworded. Named rather than folded into the
replayed commit, because a formatting change made by this lane should be visible as one.
1 parent 6019370 commit f2b4d1c
3 files changed
Lines changed: 38 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
| 122 | + | |
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
| 145 | + | |
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4819 | 4819 | | |
4820 | 4820 | | |
4821 | 4821 | | |
| 4822 | + | |
| 4823 | + | |
| 4824 | + | |
| 4825 | + | |
| 4826 | + | |
| 4827 | + | |
| 4828 | + | |
| 4829 | + | |
| 4830 | + | |
| 4831 | + | |
| 4832 | + | |
| 4833 | + | |
| 4834 | + | |
| 4835 | + | |
| 4836 | + | |
| 4837 | + | |
| 4838 | + | |
| 4839 | + | |
| 4840 | + | |
| 4841 | + | |
| 4842 | + | |
| 4843 | + | |
| 4844 | + | |
| 4845 | + | |
| 4846 | + | |
| 4847 | + | |
| 4848 | + | |
| 4849 | + | |
| 4850 | + | |
| 4851 | + | |
| 4852 | + | |
4822 | 4853 | | |
4823 | 4854 | | |
4824 | 4855 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
6 | 10 | | |
7 | 11 | | |
8 | 12 | | |
| |||
25 | 29 | | |
26 | 30 | | |
27 | 31 | | |
28 | | - | |
29 | | - | |
30 | 32 | | |
31 | 33 | | |
32 | 34 | | |
| |||
0 commit comments