You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 82f5b00
Browse filesBrowse the repository at this point in the historyBrowse files
Bugbot on #290: the plan had the in-memory engine's path selector
apply only the built-in test/fixture ignores, because it runs before
socket.yml is read. A negation such as `!/e2e/tests/` could then
never bring those trees back in depscan, while it works on disk.
Selection is now two-phase: the caller fetches the root policy
file(s) first and passes their text to selectHostedScanPaths, which
applies the full path policy. A listed policy file that is not passed
fails closed. A new memory test covers the negation case.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: docs/design/staged-rollout.md
+15-11Lines changed: 15 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -327,8 +327,8 @@ older pinned CLI fails on a newer key by design, and the error says so.
327
327
Nested files are never read (one file per repo, as in the GitHub App).
328
328
A symlinked socket.yml is followed only if it resolves to a regular
329
329
file inside the repo root.
330
-
3. In memory, the repo root is the tree root; the file must arrive with
331
-
content (7.2). A socket.yml the tree lists but the engine never
330
+
3. In memory, the repo root is the tree root; the caller supplies the
331
+
file's content to path selection and to the session (7.2). A socket.yml the tree lists but the engine never
332
332
receives, or receives only as present-without-content (symlink,
333
333
oversize, LFS pointer, binary), is `socket_yml_invalid`, never absent.
334
334
4. `--global` / `--global-prefix` scans have no repo and ignore the file.
@@ -675,7 +675,7 @@ One-off overrides from the command line: `socket-patch scan
675
675
676
676
| Owner | Change |
677
677
|---|---|
678
-
| A | `selectHostedScanPaths` also returns root `socket.yml` / `socket.yaml` when listed, and returns the list of policy paths it selected; it applies only the **built-in** default ignores (it cannot see file contents); the session fails `socket_yml_invalid` if a selected policy path never arrives with content or arrives present-without-content |
678
+
| A | Two-phase selection so the memory engine applies the same path policy as disk. `selectHostedScanPaths` gains an option `policyFiles?: Array<{path: string, text: string} \| {path: string, missing: true}>`, one entry per root `socket.yml` / `socket.yaml` the listing contains (the both-files rule of 4.4 applies): the caller fetches those root blobs first (they are root files, known from the tree listing) and passes the content. The selector parses it with the same loader and applies the **full** path policy (defaults, `projectIgnorePaths`, `patches` lists, negations) when choosing which files to fetch, so an `ignorePaths` negation re-includes a default-ignored tree in memory exactly as on disk. If the listing has a root policy file with no matching entry, or an entry is `missing: true`, or the text is invalid, the selector returns `policyError` (never "no policy"). The session re-parses the same text and fails `socket_yml_invalid` if the policy content that arrives differs (sha256) from what the selector saw |
679
679
| A | the session applies the full policy to detected roots **before** the `max_projects` check (`hosted_memory/mod.rs:377`) |
680
680
| A | options `noSocketYml?: boolean`, `minSeverity?: "critical"\|"high"\|"medium"\|"moderate"\|"low"\|"none"` |
681
681
| A | result: session-level `policy` block (4.7) and `policyError?: {code, detail}`; on error no root is processed and no files change; `skipped[].reason` gains the `policy_*` codes |
@@ -690,11 +690,12 @@ too.
690
690
### 7.3 depscan follow-up (after A and B merge; separate PR in depscan)
691
691
692
692
1. Bump the socket-patch submodule and rebuild the addon.
693
-
2. Stream root socket.yml content from the **base** SHA for both job kinds
694
-
(for `repo` jobs that is the tree being scanned; for `pull_request`
695
-
jobs push the base-SHA blob under the policy path the engine selected).
696
-
Never let the file be dropped by the size/path caps silently: the
697
-
engine turns a missing policy blob into `policyError`.
693
+
2. Fetch the root socket.yml / socket.yaml blob from the **base** SHA
694
+
for both job kinds **before** calling `selectHostedScanPaths`, and
695
+
pass them as `policyFiles` (7.2); stream the same content to the session.
696
+
Never let the file be dropped by the size/path caps silently: a
697
+
missing or oversize policy blob is passed as `missing: true`, which the
698
+
engine turns into `policyError`.
698
699
3. Pass `inFlightPatches` (base purls in the open patch-all PR); for
699
700
`pull_request` jobs pass `maxNewPatches: "none"` and no cap.
700
701
4. New job outcome `policy_invalid` (from `policyError`): leave the
@@ -884,8 +885,9 @@ Scope:
884
885
(`discover_selected`, `scan/mod.rs:553`, and the human arm,
885
886
`mod.rs:2386-2402`); retained set computed from the recorded view and
886
887
excluded from writers.
887
-
- memory: built-in defaults in `selectHostedScanPaths`
888
-
(`hosted_memory/select.rs`); full root filter in the session before
888
+
- memory: full path policy in `selectHostedScanPaths`
889
+
(`hosted_memory/select.rs`), from the caller-supplied `policyFiles`
890
+
text (7.2, two-phase); the same root filter in the session before
889
891
`max_projects`(`hosted_memory/mod.rs:377`); `admits_purl` at
890
892
`hosted_memory/mod.rs:428-432`; severity filter before
891
893
`select_top_ranked`.
@@ -924,7 +926,9 @@ Tests:
924
926
- Parity: `tests/hosted_memory_parity.rs`gains a socket.yml fixture
925
927
(single-lockfile roots) where disk and memory filter the same roots and
926
928
packages; a memory test where the tree lists socket.yml but its content
927
-
is withheld → `policyError`.
929
+
is withheld → `policyError`; a memory test where
930
+
`ignorePaths: ["!/e2e/tests/"]` re-includes a default-ignored root, so
931
+
its lockfile is selected, fetched and patched as on disk.
928
932
- This repo's own `socket.yml` keeps working (its `projectIgnorePaths`
0 commit comments