@@ -26,11 +26,11 @@ duplicating entire function bodies. Reports also include schema, engine and poli
2626base/head/merge-base SHAs, and workflow PR/head/engine identity. No timestamp enters the
2727deterministic payload. Finding IDs are stable for the same input pair and engine version.
2828
29- ## Binary decisions and grouped report (schema 2 )
29+ ## Binary decisions and grouped report (schema 3 )
3030
3131The public decisions are ** ` flag ` ** and ** ` exempt ` ** . Uncertainty produces ` flag ` , with
32- the obstacle recorded in ` limitations ` . Schema and policy version ` 2 .0.0` , engine version
33- ` 0.2.0 ` , replace the earlier public ` review ` decision and flat consumer findings .
32+ the obstacle recorded in ` limitations ` . Schema and policy version ` 3 .0.0` , engine version ` 0.3.0 ` , retain binary decisions
33+ and add bounded values and explicit report truncation metadata .
3434
3535Each finding groups evidence by ** changed source file** . Several changed definitions in
3636one file remain individually available in ` changes ` . Unchanged downstream consumers do not
@@ -42,7 +42,7 @@ one finding anchored to its source, with a representative consumer and usage met
4242| ` source.before ` / ` source.after ` | Changed source path and Git blob ID, or ` null ` for addition/deletion |
4343| ` decision ` | ` flag ` if any grouped evidence requires reporting; otherwise ` exempt ` |
4444| ` category ` , ` symbol ` , ` reason ` , ` before ` , ` after ` | Representative evidence; its locations can be in an unchanged consumer of a changed token |
45- | ` categories ` | Categories of the retained direct evidence and representative consumer |
45+ | ` categories ` | Categories of all direct evidence and the changed consumer |
4646| ` changes ` | Direct definition changes in the changed file, retaining individual decisions, values and locations |
4747| ` example ` | One consumer evidence record, or ` null ` ; ` basis ` distinguishes ` changed-definition ` from ` potential-consumer ` |
4848| ` impact.before ` / ` impact.after ` | Separate counts and source locations for resolved direct references in each revision |
@@ -61,8 +61,14 @@ references do not count. Dynamic/ambiguous imports are not presented as exact us
6161Zero means no references were enumerated, not proof of no consumers. Overrides, inactive
6262variants and runtime conditions can prevent a referenced component from changing visually.
6363
64- Consumers upgrading from schema 1 must read direct evidence from ` changes ` and the optional
65- ` example ` , use ` source ` to identify the changed file, and stop expecting ` decision: review ` .
64+ Schema 3 readers must handle either literal values or a summary object containing
65+ ` $truncated ` , ` preview ` , ` sha256 ` , ` originalBytes ` , ` previewBytes ` and ` omittedBytes ` .
66+ The default preview is at most 4 KiB. Full semantic evidence is compared before presentation
67+ values are shortened; large opaque helper summaries retain full-value hashes too.
68+ ` truncation ` records the 5 MiB serialized-report limit, total/omitted findings, and total/omitted
69+ entries for sampled detail/reference lists. Sampling retains stable prefixes. The overall
70+ ` flagged ` result is computed before sampling, so an omitted finding cannot make a PR clean.
71+ Read direct evidence from ` changes ` and optional ` example ` ; use ` source ` for the changed file.
6672
6773## Architecture
6874
@@ -89,7 +95,13 @@ scripts/design-diff/
8995 source.ts Source snapshots and path/alias resolution
9096 dependencies.ts Export-aware imports and source reference counts
9197 ast.ts Babel parsing and syntax normalization
98+ refactors.ts Supported literal/refactor normalization
9299 resolve.ts Bounded expression and import resolution
100+ inputs.ts Configured file-loaded documentation inputs
101+ infrastructure.ts Rendering lockfile dependency closure
102+ report.ts Value previews and bounded JSON serialization
103+ benchmark.ts Immutable-engine historical replay
104+ benchmark/comparisons.json Frozen original/holdout comparison manifest
93105 memory.ts Bun parser-batch garbage collection
94106 tailwind.ts Pinned compiler and trusted merge convention
95107 compare.ts Stable matching and findings
@@ -147,11 +159,28 @@ through named/star re-exports and import-then-export indexes to the defining mod
147159Button edit does not implicate a file merely because it imports an unrelated Icon from the
148160same index. Changed top-level bindings and local dependents narrow the first propagation
149161step and usage counts within a multi-export file. Both revisions are considered, including
150- redirected re-exports. Module effects, side-effect imports, computed namespaces, ambiguous
151- exports, cycles and resolution limits retain conservative dependencies. Further transitive
152- module effects can still overestimate potential impact.
153-
154- The resolver reuses the export index, retains at most 128 parsed modules per revision,
162+ redirected re-exports. The module graph identifies candidates only. Actual findings require
163+ changed values, guards, referenced implementations or an explicitly unresolved imported input.
164+ Unrelated imports and dead re-exports cannot flag an unchanged expression. Object properties,
165+ destructured parameter defaults, and helper return paths are traced separately. Small immutable
166+ local literals are normalized before expression budgets, preserving supported constant hoists.
167+ The exact ` Object.entries(...).reduce ` record-map idiom is normalized to ` Object.fromEntries `
168+ only with an empty accumulator, unchanged key and no accumulator reads in the mapped value. Unknown
169+ computed namespaces, ambiguous imports, cycles and exhausted resolution remain conservative
170+ when that particular input feeds rendering. SQL tags and telemetry receivers are not standalone
171+ rendering definitions; their values can still matter if explicitly consumed by a visual input.
172+
173+ The configured ` wireServerFallback ` capability adapter traces its declared environment fields,
174+ provider factories and implementation. Its finite capability schema identifies relevant keys;
175+ unsupported dynamic schemas use ordinary conservative resolution. Whole-environment backend
176+ settings therefore do not contaminate the signup page solely through this known adapter.
177+
178+ The configured Fumadocs ` OPENAPI_SPEC_FILES ` list is parsed from Git in each revision. Listed
179+ JSON inputs are compared semantically, retaining array order and attributing changes to both
180+ the spec and configured renderer. Malformed/missing configured inputs flag with a limitation.
181+
182+ The graph reuses up to 10,000 import/export snapshots keyed by source blob, resolving their
183+ paths again for each revision. The resolver retains at most 128 parsed modules per revision,
155184and requests Bun garbage collection between parser batches. These resource controls do
156185not change evidence or decisions. The Node-based test runner uses its own garbage collector.
157186
@@ -170,7 +199,7 @@ application plugins or every postprocessor have been reproduced.
170199
171200Desktop support extracts recognized ` BrowserWindow ` appearance options, native appearance
172201setter calls and ` nativeTheme.themeSource ` assignments. Configured native
173- menu/tray/terminal-theme modules use an uncertainty fallback, including their changed dependencies ,
202+ menu/tray/terminal-theme modules use an uncertainty fallback for their own changed definitions ,
174203because embedded JXA and native operating-system rendering are not executed.
175204
176205## Movement proof and remaining limits
@@ -186,20 +215,21 @@ change the result. There is no blanket exemption for translation, margins, gaps
186215This engine is conservative, not a runtime equivalence prover:
187216
188217- Runtime data, arbitrary functions, mutable bindings, dependency cycles, parser failures,
189- unknown props and unsupported rendering syntax produce flags with limitations when affected.
218+ unknown props and unsupported rendering syntax produce flags when changed presentation evidence
219+ or a traceable unresolved rendering input changes. They are not blanket module-level triggers.
190220- Source-order matching after substantial markup edits can pair different elements. Such
191221 changes remain flagged; findings are evidence for review, not an exact DOM correspondence.
192222- Dynamic module/asset paths, inherited/conditional export maps outside the supported forms,
193223 generated source and arbitrary imperative renderers cannot be fully followed. Directly
194224 detected DOM/canvas operations and configured native rendering use uncertainty fallbacks.
195225- MDX expressions and embedded HTML scripts are flagged, without running MDX components or
196226 scripts. Plain HTML whitespace is preserved because CSS can make it meaningful.
197- - Broad dependency updates and shared runtime expressions can create false positives. All
198- lockfile changes are flagged, including changes to tooling-only dependencies. Inactive
199- variants, unused assets and an apparently inert removed class can also be flagged.
227+ - Lockfiles compare recognized rendering dependencies and their resolved transitive closure.
228+ Unrelated tooling/backend updates are clean. Unknown rendering configs/plugins still flag.
229+ Inactive variants, unused assets and an apparently inert removed class can also be flagged.
200230- Impact is a conservative approximation. Findings retain direct source changes and one
201231 consumer example instead of thousands of downstream records. Large changed definitions
202- and usage inventories can still produce substantial JSON reports .
232+ and usage inventories are sampled deterministically within the report budget .
203233- The default limits are 2 MiB per source file, 256 MiB per source snapshot, 24 resolution
204234 levels and 5,000 evaluation steps per expression. Per-file/parser/expression limits produce
205235 flags with limitations; snapshot/Git failures are operational failures, never clean results.
@@ -259,7 +289,7 @@ are whole commits, including ancillary changes, rather than only their headline
259289These comparisons validate source-policy behavior, not rendered pixels or recall over all
260290historical PRs. Screenshot capture, AI interpretation and Slack delivery are separate stages.
261291
262- ### Incremental smoke test on PR #7742
292+ ### Earlier incremental smoke test on PR #7742 (schema 2)
263293
264294Five temporary commits were created directly on ` 458a515cbed7fbcf127ce72348ff755c5308ce13 ` ,
265295each changing one existing source file. Comparing that commit with each temporary head
@@ -288,5 +318,26 @@ These are partial source-reference counts, not claims that every reference chang
288318Independent changed source files remain separate findings, and all direct definition changes
289319within each changed file are retained.
290320
291- These checks validate local engine behavior, not cloud workflow activation. They are examples,
321+ These earlier checks do not validate the revised schema 3 engine or cloud workflow activation. They are examples,
292322not a measured detection rate across all possible UI changes.
323+
324+ ## Frozen historical benchmark
325+
326+ The manifest preserves the original 120 comparisons (baseline: 108 flagged, including 39/49
327+ source-reviewed nonvisual cases) and the next 60 entries of the original SHA-256 sampling
328+ order. Holdout source-review labels were frozen before revised engine results: 37 clear
329+ visual/content, 18 nonvisual and 5 uncertain. Labels describe source edits, not rendered pixel
330+ ground truth. Corrections must be documented separately rather than rewriting frozen labels.
331+
332+ ``` sh
333+ bun --no-env-file scripts/design-diff/benchmark.ts \
334+ --engine /path/to/clean/engine-checkout --sha < immutable-engine-commit> \
335+ --manifest scripts/design-diff/benchmark/comparisons.json --output /tmp/design-benchmark
336+ ```
337+
338+ Fetch manifest commit objects beforehand; missing history fails explicitly. The runner verifies
339+ the frozen comparison commits and GitHub file sets. Cache identity includes engine SHA, trusted
340+ config, lockfile, runtime and comparison commits, with report-content verification before reuse.
341+ It records per-comparison elapsed time and peak RSS separately from deterministic reports.
342+ ` /usr/bin/time ` is required (macOS or Linux); source findings are not printed. Review original
343+ and holdout rates separately, and inspect every disagreement against the source label.
0 commit comments