@foldrun/core 1.4.0 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/scan.js +9 -0
- package/package.json +1 -1
- package/src/scan.ts +9 -0
package/dist/src/scan.js
CHANGED
|
@@ -646,6 +646,13 @@ function ignored(ig, rule, line) {
|
|
|
646
646
|
/** Installed and built code: someone else's files, and a crypto library's
|
|
647
647
|
* constants are not this workspace's keys. */
|
|
648
648
|
const VENDORED = /(?:^|\/)(?:node_modules|\.venv|venv|site-packages|__pycache__|vendor|dist|build|\.next)\//;
|
|
649
|
+
/** What a run leaves in an agent's folder — the Claude CLI's `.cache/` logs,
|
|
650
|
+
* package caches — and copies back with it. Nobody wrote these, so they are
|
|
651
|
+
* not checked as prompts or code; they are still searched for credentials,
|
|
652
|
+
* since a key in a log here is a key in the workspace (seen live on
|
|
653
|
+
* 17 Oct 2026: zero-width characters in a CLI MCP log, reported as hidden
|
|
654
|
+
* text). */
|
|
655
|
+
const RUNTIME_WRITTEN = /(?:^|\/)(?:\.cache|\.npm|\.local|\.pnpm-store|\.yarn|\.foldrun)\//;
|
|
649
656
|
/** Text files only — a PNG read as UTF-8 is noise to every rule here. */
|
|
650
657
|
function isText(f) {
|
|
651
658
|
return !VENDORED.test(f.path) && !f.content.slice(0, 8000).includes("\u0000") && !/\.(?:png|jpe?g|gif|webp|ico|pdf|zip|gz|woff2?|ttf|mp[34]|mov|wasm)$/i.test(f.path);
|
|
@@ -679,6 +686,8 @@ export function scanFiles(files, options = {}) {
|
|
|
679
686
|
const lines = f.content.split(/\r?\n/);
|
|
680
687
|
ignoresByFile.set(f.path, readIgnores(f, lines, push));
|
|
681
688
|
scanSecrets(f, lines, push);
|
|
689
|
+
if (RUNTIME_WRITTEN.test(f.path))
|
|
690
|
+
continue;
|
|
682
691
|
scanContent(f, lines, push);
|
|
683
692
|
scanSupplyChain(f, lines, push);
|
|
684
693
|
const schema = schemaKindOf(f.path);
|
package/package.json
CHANGED
package/src/scan.ts
CHANGED
|
@@ -729,6 +729,14 @@ type Push = (rule: string, file: string, line: number | undefined, text: string,
|
|
|
729
729
|
* constants are not this workspace's keys. */
|
|
730
730
|
const VENDORED = /(?:^|\/)(?:node_modules|\.venv|venv|site-packages|__pycache__|vendor|dist|build|\.next)\//;
|
|
731
731
|
|
|
732
|
+
/** What a run leaves in an agent's folder — the Claude CLI's `.cache/` logs,
|
|
733
|
+
* package caches — and copies back with it. Nobody wrote these, so they are
|
|
734
|
+
* not checked as prompts or code; they are still searched for credentials,
|
|
735
|
+
* since a key in a log here is a key in the workspace (seen live on
|
|
736
|
+
* 17 Oct 2026: zero-width characters in a CLI MCP log, reported as hidden
|
|
737
|
+
* text). */
|
|
738
|
+
const RUNTIME_WRITTEN = /(?:^|\/)(?:\.cache|\.npm|\.local|\.pnpm-store|\.yarn|\.foldrun)\//;
|
|
739
|
+
|
|
732
740
|
/** Text files only — a PNG read as UTF-8 is noise to every rule here. */
|
|
733
741
|
function isText(f: ScanFile): boolean {
|
|
734
742
|
return !VENDORED.test(f.path) && !f.content.slice(0, 8000).includes("\u0000") && !/\.(?:png|jpe?g|gif|webp|ico|pdf|zip|gz|woff2?|ttf|mp[34]|mov|wasm)$/i.test(f.path);
|
|
@@ -763,6 +771,7 @@ export function scanFiles(files: ScanFile[], options: ScanOptions = {}): ScanFin
|
|
|
763
771
|
const lines = f.content.split(/\r?\n/);
|
|
764
772
|
ignoresByFile.set(f.path, readIgnores(f, lines, push));
|
|
765
773
|
scanSecrets(f, lines, push);
|
|
774
|
+
if (RUNTIME_WRITTEN.test(f.path)) continue;
|
|
766
775
|
scanContent(f, lines, push);
|
|
767
776
|
scanSupplyChain(f, lines, push);
|
|
768
777
|
|