Repository navigation
Commit afa7253
authored
Add in-memory hosted engine and napi addon (#276)
* Add in-memory hosted scan engine
Let hosts run hosted-mode patching without a working directory or
network access. The new hosted_memory engine takes a map of repository
files, finds every project root, looks up patches once across all roots
through a pluggable PatchApi provider, and returns the rewritten
lockfiles and redirect ledgers.
Lockfile inventory now reads through a ProjectView, so the same parsers
serve disk and in-memory projects; disk behavior is unchanged. The
existing scan --mode hosted path keeps using ApiClient directly, which
also implements PatchApi.
Parity tests compare the engine against the real CLI binary across npm,
pnpm, yarn, bun, pypi, cargo, composer, gem and golang fixtures. A hidden
hosted-bundle command exposes the engine for debugging.
Assisted-by: Claude Code:claude-opus-5-5
* Add napi addon for the hosted engine
Expose the in-memory hosted engine to Node as a native addon, so a
service can stream repository files into a scan session and serve patch
lookups from its own data source instead of the Socket API.
The package lives under crates/socket-patch-node/npm and is private, so
the npm release tooling does not publish it. Release builds now build
only the CLI crate, and a new CI job builds the addon and runs its Node
smoke test.
Assisted-by: Claude Code:claude-opus-5-5
* Use an External handle for addon sessions
Export the scan session as an opaque External handle plus plain
functions, not a napi class. The class wrapper's generated glue unwraps
its native pointer through an FFI out-parameter, which CodeQL reports as
a possible invalid pointer dereference. The public HostedScanSession in
index.js is unchanged; it now calls the handle functions.
Assisted-by: Claude Code:claude-opus-5-5
* Scan excluded nested Cargo projects
Keep every directory with its own Cargo.lock as a project root during
path selection. Whether a nested lock belongs to an enclosing workspace
depends on that workspace's members and exclude lists, which only the
engine can read. Crates the workspace excludes are independent projects
and are now scanned; real members still have their unused lock ignored.
Point the in-memory Pipenv warning at the pipenvMajor option, the only
input the engine reads, instead of PATH or an environment variable.
Assisted-by: Claude Code:claude-opus-5-51 parent 8c381ec commit afa7253
49 files changed
Lines changed: 9734 additions & 236 deletions
File tree
- .github/workflows
- crates
- socket-patch-cli
- src
- commands
- scan
- hosted_memory
- tests
- hosted_memory_common
- socket-patch-core/src
- api
- utils
- vendor
- lock_inventory
- socket-patch-node
- npm
- scripts
- test
- src
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
77 | 109 | | |
78 | 110 | | |
79 | 111 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
178 | | - | |
| 178 | + | |
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
182 | | - | |
| 182 | + | |
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
5 | 12 | | |
6 | 13 | | |
7 | 14 | | |
| |||
21 | 28 | | |
22 | 29 | | |
23 | 30 | | |
| 31 | + | |
24 | 32 | | |
25 | 33 | | |
26 | 34 | | |
| |||
48 | 56 | | |
49 | 57 | | |
50 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
51 | 62 | | |
52 | 63 | | |
53 | 64 | | |
| |||
65 | 76 | | |
66 | 77 | | |
67 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
68 | 85 | | |
69 | 86 | | |
70 | 87 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
30 | 32 | | |
31 | 33 | | |
32 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
| |||
0 commit comments