Repository navigation
feat(cli): store_scripts follow-ups: per-reason warning, --no-store-scripts, owner-only files #1268 - #1305
Closed
nc9 wants to merge 4 commits into
Closed
feat(cli): store_scripts follow-ups: per-reason warning, --no-store-scripts, owner-only files #1268#1305nc9 wants to merge 4 commits into
nc9 wants to merge 4 commits into
Conversation
… owner-only db files, bound docs #1268 Signed-off-by: Nik Cubrilovic <[email protected]>
Signed-off-by: Nik Cubrilovic <[email protected]>
… link cache too; docs wording #1268 Signed-off-by: Nik Cubrilovic <[email protected]>
…ts check (CodeQL file-system-race) #1268 Signed-off-by: Nik Cubrilovic <[email protected]>
Contributor
Author
|
Landed in v0.0.143 as nik |
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.
Fixes #1268
Each acceptance criterion:
storeCrawlScriptsreturnsskippedByReason;skippedScriptsWarning(apps/cli/src/audit/store-scripts.ts) lists each reason with its count and what applies: too-large and total-cap name theirstore_scripts_*setting, memory-cap and time-budget say they are fixed bounds (and never tell you to raise a size setting), plus not-javascript and store-error.docs/configuration/storage.mdxstates the time overshoot (about 20 s: a request in flight runs to its 15 s timeout, then decode), the memory overshoot (up to 10 bodies in flight, the fetch concurrency) and roughly 3x RSS for non-Latin1 bundles.fetchScriptContentscall with its own counters, and sharing would mean threading one bound through the resource checker. The docs now say it does not share the 256 MB or 120 s bounds (the AC allows this).--no-store-scripts. Turnsstore_scripts = trueoff for one run (storeScripts: falsethroughmergeOptionsToConfig); in the flag table, bash/zsh/fish completions.content-store.dband project databases, plus-waland-shm, arechmod 0600after the schema (newrestrictToOwner,@squirrelscan/crawler/file-mode); existing files are tightened on open. Docs state it and that FAT-like file systems ignore it.Tests
apps/cli/tests/audit/store-scripts-1255.test.ts: warning text per reason (unit),--no-store-scriptswith the config on stores nothing (real CLI), content store and project db plus side files have no group/other bits after an audit (real CLI).packages/config/tests/store-scripts-config-1255.test.tstitle. 558 related CLI tests and the config test pass; apps/cli format, lint, tsgo and crawler tsgo clean;make validatepasses.Not in scope: #1280 (store_scripts changing audit results). The docs paragraph that says findings can differ with the option on is untouched for it.
Skill (
squirrelscan/skills): no change needed. CHANGELOG under## [Unreleased]/ Fixed. Branched from main separately from #1302 (both touchpackages/crawler/src/storage/sqlite.tsinit, a small textual conflict is possible, and both add a### Fixedblock to the CHANGELOG).Review follow-ups: the database file is now created 0600 before the first open (so it never exists wider), the folders squirrel creates for them are 0700, link-cache.db gets the same, and the docs say 'file systems without POSIX modes (Windows, FAT)'.
Compose note (merge order #1302 -> #1305 -> #1310)
Conflicts with #1302 after it lands, and their resolution:
CHANGELOG.md: keep both### Fixedbullets under one block.packages/crawler/package.json: keep both exports,./sqlite-openand./file-mode.apps/cli/src/crawler/storage/content-store.ts,link-cache.tsandpackages/crawler/src/storage/sqlite.tsimports:import type { Database } from "bun:sqlite", thenopenSqliteandenableWalfromsqlite-open, thenrestrictToOwnerandOWNER_ONLY_DIR_MODEfromfile-mode. In eachgetDb/initcallrestrictToOwner(path)BEFOREopenSqlite(path)andenableWal.