Repository navigation
Commit 13136f7
fix(lint): liveness author warnings and the status census read ledger rows at every depth (#26379)
<!-- claude-projects-attribution: {"github_login":"os-support-ai"} -->
_Requested by **Yibo Wang** · [project
thread](https://claude.ai/code/project/chan_01BVUyyPie8gHwoPM18iABwB?thread=cmsg_01BVUyyPie8gHwoPM18iABwBXd6krbsYu1F6K7KQHMnPe9)_
Fixes #26146
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 改了什么:liveness 作者告警(`os lint`)与状态词普查,原来只读台账顶层加一层 `children`,现在读到任意深度。
- 为什么改:台账已有 41 行在第二层、2 行在第三层带 status,从未被评级;一个深层 `dead` 行或新状态词会悄悄漏过。
- 风险与回滚:今天唯一新出现的告警是仪表盘 `widgets[].chartConfig` 的 5 个已退役键(schema
本就拒收);回滚即 revert 本 PR。
- 先看:`packages/lint/src/lint-liveness-properties.ts` 的
`ledgerRows`(两处遍历共用它),再看测试文件末尾的 #26146 块。
- 两分钟验证:`pnpm --filter @objectstack/lint exec vitest run
src/lint-liveness-properties.test.ts`,预期 106 个用例全绿。
- 需要你做的:无,席位落地。
## What changes
- `packages/lint/src/lint-liveness-properties.ts`: one walk,
`ledgerRows`, yields every ledger row at every depth of `children` as a
dotted path, descendants before the row (the order the warn map was
always filled in, so finding order at depth 0 and 1 is unchanged).
`loadWarnMap` and the status census both read it, so they cannot
disagree about depth again.
- The census gains a directory seam, `ledgerStatusesIn(dir)` (module
export only, the same posture as `lintLivenessPropertiesFromLedgerDir`);
`shippedLedgerStatuses()` is that census over the shipped directory.
- Docblocks re-measured. The `:303-306` count read "423 top-level and
285 child rows carry a status, zero grandchildren do". On `origin/main`
`6390fe52` it is **528 top-level, 419 child, 41 grandchild, 2
great-grandchild**. The `WarnMap`, `loadWarnMap` and
`authorWarnedProperties` docblocks now say every depth.
- Changeset: `@objectstack/lint` patch.
## Tests
- New block at the end of `lint-liveness-properties.test.ts`:
- REAL LEDGER: `widgets.chartConfig.type` / `.xAxis` / `.yAxis` /
`.series` (dead, two levels down) are in
`authorWarnedProperties('dashboard')` and graded
`liveness-dead-property` on an unparsed stack, through the array fan-out
(the second widget authors them). The live `chartConfig.title` in the
same call stays silent.
- PLANTED: a `dead` + `authorWarn` row two levels down warns; a
`planned` + `authorWarn` row three levels down warns, while its
`planned` sibling without the opt-in stays silent (so the opt-in itself
reaches depth 3, not only the verdict).
- PLANTED: status words used only at depth 2 and depth 3 reach
`ledgerStatusesIn`; the shipped census equals
`ledgerStatusesIn(shippedLedgerDir())` and carries neither word.
- The `#16094` hint pins' `shippedRows()` / `itemAuthoring` now walk
every depth, so the newly warned deep rows are held to the same "never
the note, no tracker id" rule.
<details><summary>Test runs (head bec9f05)</summary>
- `pnpm --filter @objectstack/lint exec vitest run --maxWorkers=2
src/lint-liveness-properties.test.ts`: Test Files 1 passed, Tests 106
passed.
- `pnpm --filter @objectstack/lint typecheck && pnpm --filter
@objectstack/lint test`: exit 0, Test Files 165 passed, Tests 7383
passed, 5 skipped.
- Ablation (`scripts/ablation-replace.mjs`, mutation landed: anchor 1 to
0, blob `60014c1e09ed` to `d39fa40b0098`): `ledgerRows` limited to one
`children` level reds exactly the three new tests (3 failed, 103
passed). Restored: blob back to `60014c1e09ed`, equal to the `HEAD`
blob, `git diff HEAD` empty.
</details>
## Acceptance notes
- Seat premise 6430781250 re-measured on `6390fe52`: status rows by
depth 528 / 419 / 41 / 2; `authorWarn` at depth 2 or deeper: 0; the
card's one-liner reads `properties` where the ledgers key `props`.
- The verdict-triggered half does reach authors: `dead` warns without an
opt-in (#16094), so the 5 dead rows two levels down now warn:
`dashboard` `widgets.chartConfig.type`, `.xAxis`, `.yAxis`, `.series`,
`.aria`. Each is a retired key the schema already refuses, so only an
unparsed stack (`os lint`) reaches the warning. No other deep row warns.
Per triage 6417914269, no ledger row is regraded here.
- Serial with #26138 (draft): it edits this test file and drops rows
from `app.json` / `dashboard.json`. Text-disjoint from the hunks here
except that its new comment in the `dashboard silence` pin says the
`chartConfig.*` rows "sit two down and were never graded", which this PR
makes false; its assertions do not depend on that. Whoever lands second
merges `main` and re-measures the counts above.
- The CLI's i18n walker reads `authorWarnedProperties('translation')`;
the translation ledger has no warned row below the child level, so that
set is unchanged.
## Verification
<details><summary>Dispatch gates (head bec9f05)</summary>
- `node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack`: 64 commands; 3 paths, 206 changed lines.
- 63 exit 0. Three first answered exit 3 PREREQUISITE NOT MET
(`check-plugin-teardown-shape --self-test` on the shallow clone;
`check:docs-transcript-drift` and `check:lean-entry-closure` without
built `lint` / `objectql`); after `git fetch --unshallow` and `pnpm
--filter '@objectstack/lint...' --filter '@objectstack/objectql...'
build` each re-ran exit 0.
- NOT MEASURED: `check:dual-build-cjs-loads`, reason: it needs every
package's `dist` (a full `pnpm build`, 88 packages absent); CI's `Lint &
Repo Gates` runs it.
- `--ran` reconciliation: exit 0, "64 derived famil(ies) accounted for —
63 run, 1 NOT-MEASURED".
</details>
---
_Generated by [Claude
Code](https://claude.ai/code/session_01WGufzhxSxc27ChPLkDSKEa)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 3b480e0 commit 13136f7
3 files changed
Lines changed: 173 additions & 33 deletions
File tree
- .changeset
- packages/lint/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
| |||
1928 | 1930 | | |
1929 | 1931 | | |
1930 | 1932 | | |
1931 | | - | |
| 1933 | + | |
1932 | 1934 | | |
1933 | 1935 | | |
1934 | 1936 | | |
1935 | | - | |
1936 | | - | |
1937 | | - | |
1938 | | - | |
1939 | | - | |
| 1937 | + | |
| 1938 | + | |
| 1939 | + | |
1940 | 1940 | | |
1941 | | - | |
1942 | | - | |
1943 | | - | |
1944 | | - | |
| 1941 | + | |
| 1942 | + | |
| 1943 | + | |
1945 | 1944 | | |
| 1945 | + | |
| 1946 | + | |
| 1947 | + | |
1946 | 1948 | | |
1947 | 1949 | | |
1948 | 1950 | | |
1949 | 1951 | | |
1950 | | - | |
| 1952 | + | |
1951 | 1953 | | |
1952 | | - | |
1953 | | - | |
| 1954 | + | |
| 1955 | + | |
1954 | 1956 | | |
1955 | 1957 | | |
1956 | 1958 | | |
| |||
2150 | 2152 | | |
2151 | 2153 | | |
2152 | 2154 | | |
| 2155 | + | |
| 2156 | + | |
| 2157 | + | |
| 2158 | + | |
| 2159 | + | |
| 2160 | + | |
| 2161 | + | |
| 2162 | + | |
| 2163 | + | |
| 2164 | + | |
| 2165 | + | |
| 2166 | + | |
| 2167 | + | |
| 2168 | + | |
| 2169 | + | |
| 2170 | + | |
| 2171 | + | |
| 2172 | + | |
| 2173 | + | |
| 2174 | + | |
| 2175 | + | |
| 2176 | + | |
| 2177 | + | |
| 2178 | + | |
| 2179 | + | |
| 2180 | + | |
| 2181 | + | |
| 2182 | + | |
| 2183 | + | |
| 2184 | + | |
| 2185 | + | |
| 2186 | + | |
| 2187 | + | |
| 2188 | + | |
| 2189 | + | |
| 2190 | + | |
| 2191 | + | |
| 2192 | + | |
| 2193 | + | |
| 2194 | + | |
| 2195 | + | |
| 2196 | + | |
| 2197 | + | |
| 2198 | + | |
| 2199 | + | |
| 2200 | + | |
| 2201 | + | |
| 2202 | + | |
| 2203 | + | |
| 2204 | + | |
| 2205 | + | |
| 2206 | + | |
| 2207 | + | |
| 2208 | + | |
| 2209 | + | |
| 2210 | + | |
| 2211 | + | |
| 2212 | + | |
| 2213 | + | |
| 2214 | + | |
| 2215 | + | |
| 2216 | + | |
| 2217 | + | |
| 2218 | + | |
| 2219 | + | |
| 2220 | + | |
| 2221 | + | |
| 2222 | + | |
| 2223 | + | |
| 2224 | + | |
| 2225 | + | |
| 2226 | + | |
| 2227 | + | |
| 2228 | + | |
| 2229 | + | |
| 2230 | + | |
| 2231 | + | |
| 2232 | + | |
| 2233 | + | |
| 2234 | + | |
| 2235 | + | |
| 2236 | + | |
| 2237 | + | |
| 2238 | + | |
| 2239 | + | |
| 2240 | + | |
| 2241 | + | |
| 2242 | + | |
| 2243 | + | |
| 2244 | + | |
| 2245 | + | |
| 2246 | + | |
| 2247 | + | |
| 2248 | + | |
| 2249 | + | |
| 2250 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
74 | 96 | | |
75 | 97 | | |
76 | 98 | | |
| |||
126 | 148 | | |
127 | 149 | | |
128 | 150 | | |
129 | | - | |
| 151 | + | |
130 | 152 | | |
131 | 153 | | |
132 | 154 | | |
| |||
144 | 166 | | |
145 | 167 | | |
146 | 168 | | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
| 169 | + | |
| 170 | + | |
155 | 171 | | |
156 | 172 | | |
157 | 173 | | |
| |||
301 | 317 | | |
302 | 318 | | |
303 | 319 | | |
304 | | - | |
305 | | - | |
306 | | - | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
307 | 327 | | |
308 | 328 | | |
309 | 329 | | |
| |||
328 | 348 | | |
329 | 349 | | |
330 | 350 | | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
331 | 363 | | |
332 | | - | |
333 | 364 | | |
334 | 365 | | |
335 | 366 | | |
| |||
345 | 376 | | |
346 | 377 | | |
347 | 378 | | |
348 | | - | |
| 379 | + | |
349 | 380 | | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | 381 | | |
354 | 382 | | |
355 | 383 | | |
| |||
371 | 399 | | |
372 | 400 | | |
373 | 401 | | |
374 | | - | |
375 | | - | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
376 | 405 | | |
377 | 406 | | |
378 | 407 | | |
| |||
0 commit comments