Repository navigation
ci: enforce bundle byte budgets and record persistence sizes - #387
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PRs now enforce 330,000 raw bytes and 100,000 gzip bytes for the production plugin in the existing Test job. Both size reports appear in the job summary. The persistence report and temporary Obsidian write recorder give later persistence work a repeatable baseline.
The bundle measures 307,131 raw bytes and 97,161 gzip bytes with Node 22 gzip level 9. The v2 stress fixture has 50 feeds, 2,000 history entries, 200 saved episodes, and 721 episode copies. It measures 5,593,476 compact bytes and 5,813,212 bytes in Obsidian's two-space JSON format. Persistence has no gate yet. The collection breakdown, repeated-snapshot accounting, GUID overhead, and method are in the baseline.
Verification
Production
npm run sizepasses. A valid JavaScript copy with an added random-data comment fails through the same CLI without changing rootmain.js.All six local checks passed with Node 22.23.2 and npm 10.9.8.
Tests verify boundary and independent gzip failures, exact UTF-8 accounting, the frozen NPR feed against the production parser, a lossless v2 codec round-trip, and recorder success/failure/restoration. Five size measurements produced identical results with zero errors. No timing claims.
Real Obsidian 1.13.7 on Linux/Xvfb used this worktree's isolated vault.
count:writes -- start|report|stoprecorded zero writes in one 60-second idle window. Saving the large fixture throughsaveSettingsStrictrecorded one completed write, zero failures, and 5,813,212 bytes, equal to the persisted file size. An unrelated vault write counted zero. Original settings and disk data were restored, the recorder removed,dev:errorswas empty, and the instance stopped. After the master merge, plugin-disable verification confirmed incomplete counts with successful recorder removal and adapter restoration. Feed metadata came from https://feeds.npr.org/510289/podcast.xml; no media was downloaded.Release impact
None. No production source, schema, API, dependencies, versions, or required check names change. Obsidian discards adapter failures inside
writeJson; the recorder observes adapter rejection directly. Failure propagation is tracked for PERS1 in #385.Note
Add CI bundle byte budgets, persistence size reporting, and data.json write recording
npm run size(size.mjs) which checksmain.jsagainst fixed budgets of 330,000 raw bytes and 100,000 level-9 gzip bytes, exiting nonzero on overage or bad artifactsnpm run size:data(persistence-size.mjs) which reports compact/pretty persistence sizes from a synthetic 50-feed v2 fixture and validates optional-field candidates are additive onlynpm run count:writes(write-counts.mjs) to start, report, and stop an exact PodNotes data.json write recorder in the Obsidian E2E processsizeandsize:dataafter the build, failing the job on a nonzero resultMacroscope summarized cb246e3.