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 431b818
Browse filesBrowse the repository at this point in the historyBrowse files
Fix stale docs and comments, and the npm wrapper's schema and exit code (#1022)
* Correct two false CLI_CONTRACT claims
The rollback prompt's decline line is the shared "Cancelled; no changes
made." (ui::CANCELLED), not "Rollback cancelled.". The JSON envelope
shape is pinned by json_envelope.rs's unit tests and the commands' e2e
tests; tests/cli_parse_*.rs pin the parsed clap arguments, not the
envelope.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* Drop comments describing the deleted hosted ledger and replay
v5 hosted mode keeps no ledger, and patch/redirect has no ledger,
replay or takeover module any more. The hosted engine, the CLI hosted
flow and the staged I/O layer still described a ledger load, a
merge-then-persist, a ledger-record fallback for the gem stale-install
probe and edit ordering for a whole-ledger replay. Say what the code
does now: the vendored ledger is the only one the hosted flow loads,
the gem probe judges only this run's fetched records, and staged.rs
serves the hosted -> upstream restore.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* Fix three stale code comments
- update/release.rs: the API client is no longer timeout-free; contrast
self-update's whole-request deadlines with ApiTimeouts' connect and
per-read bounds instead.
- vex/discover/pypi_other.rs: is_socket_hosted_reference was deleted by
#572; name hosted_pypi_reference, which shares the path parser and
the origin allowlist.
- scan/policy.rs: dir_markers falls back to manifests when a directory
has no lock marker, which the in-memory engine does not do.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* Report a signal-killed CLI as 128 + signal in the npm wrapper
spawnSync gives status null when the binary dies by a signal, and the
wrapper turned that into exit 1, so Ctrl-C read as an ordinary failure.
Return 128 + the signal number, as a shell does (SIGINT 130, SIGTERM
143).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* Keep the manifest setup block in the npm schema and run its tests
- The zod PatchManifestSchema lacked the legacy setup block the Rust
manifest still parses and keeps, so validating a pre-v5 manifest
stripped it. Add SetupConfigSchema (optional exclude/manual lists).
- package.json had no files list, so the tarball shipped src/, the
tsconfig and the compiled tests. Publish only the wrapper, bundled
binaries and the compiled schema; a pack test guards the list.
- The test script called pnpm in an npm-locked package and no workflow
ran it. Use npm, and run it in the dispatch-tests job.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* Drop the hosted ledger story from the stale-install probe tests
The test helper and one test still described the merged ledger map the
deleted hosted ledger used to feed. Production now hands over only this
run's fetched records; the renamed test pins what it really checks: a
record keyed under another purl spelling still matches by uuid.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* Require the compiled schema in the npm tarball once it is built
The pack-contents test only allowlisted dist/schema files, so a files
list that dropped them would still pass. When dist/schema is built,
both manifest-schema.js and .d.ts must be in the pack list.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* Rerun the npm pack test after the schema build in CI
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: crates/socket-patch-cli/CLI_CONTRACT.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -907,7 +907,7 @@ A bare `rollback` (or a scoped one, for its scope) restores the SYSTEM to unpatc
907
907
5. **Manifest cleanup** — entries are removed ONLY for in-scope purls whose legs fully succeeded, were not-installed, or were release-variant siblings narrowed away by an attempted variant that succeeded (half a variant group never lingers — `remove` parity); drift-kept and failed purls keep their records, and a failed variant holds its whole group. A manifest record that a live hosted pin has superseded (the lockfile wires the same package release to a different patch uuid, e.g. an agent → hosted migration after the patch was replaced) and whose installed copy holds neither side of the record is not restored in place and does not fail the run: the hosted leg's lock restore and the next install unwind it, and the record leaves the manifest with the `rollback_record_superseded` warning (`remove` does the same instead of aborting before its hosted leg). A copy still holding the record's patched bytes is restored as usual. No-op removals never rewrite the file. A failed write surfaces as `manifest_write_failed` (warning + `partial_failure` exit 1; GC still runs against the unchanged manifest).
908
908
6. **GC** — blob, diff and legacy package-archive sweeps against the post-removal manifest, using the same artifact-reference policy as `remove`, retaining beforeHash blobs for (a) removed-but-not-installed entries (a crawler miss must not destroy the only local revert data — `remove` parity) and (b) EVERY entry remaining in the post-removal manifest — still-active patches (failed, drift-kept, eco-/path-excluded) keep their revert data, so a scoped or failed run never destroys the blobs a later rollback needs; only blobs referenced solely by genuinely-removed entries are swept. GC errors warn (`cleanup_failed`) and continue — they never affect the exit (repair's posture).
909
909
910
-
**Confirmation prompt.** A wet, non-preserve run with work prompts once, remove-style, composing only the clauses that apply into one English list (`a and b`, `a, b, and c`) with counted nouns: `Roll back N patches`, `remove them from the local manifest`, `delete M vendored artifacts and their ledger records`, `restore H hosted packages to the upstream registry` (e.g. `Roll back 1 patch, remove it from the local manifest, and restore 1 hosted package to the upstream registry?`) — default yes, auto-accepted under `--yes`/`--json`/non-TTY (the shared `confirm` semantics; CI unaffected). Decline prints `Rollback cancelled.` and exits 0. `--dry-run` and `--preserve-state` runs are prompt-free (they delete no local state).
910
+
**Confirmation prompt.** A wet, non-preserve run with work prompts once, remove-style, composing only the clauses that apply into one English list (`a and b`, `a, b, and c`) with counted nouns: `Roll back N patches`, `remove them from the local manifest`, `delete M vendored artifacts and their ledger records`, `restore H hosted packages to the upstream registry` (e.g. `Roll back 1 patch, remove it from the local manifest, and restore 1 hosted package to the upstream registry?`) — default yes, auto-accepted under `--yes`/`--json`/non-TTY (the shared `confirm` semantics; CI unaffected). Decline prints `Cancelled; no changes made.` (stdout) and exits 0. `--dry-run` and `--preserve-state` runs are prompt-free (they delete no local state).
911
911
912
912
### `--preserve-state` (opt-out, both `rollback` and `remove`)
913
913
@@ -1136,7 +1136,7 @@ The v3.0 legacy names `SOCKET_PATCH_PROXY_URL`, `SOCKET_PATCH_DEBUG` and `SOCKET
1136
1136
1137
1137
## JSON output shapes
1138
1138
1139
-
Every `--json` invocation emits a single JSON object that follows the **unified envelope** below. The envelope was introduced in v3.0; older per-command shapes are deprecated. See `src/json_envelope.rs` for the source of truthand `tests/cli_parse_*.rs`for snapshot tests that lock the shape.
1139
+
Every `--json` invocation emits a single JSON object that follows the **unified envelope** below. The envelope was introduced in v3.0; older per-command shapes are deprecated. See `src/json_envelope.rs` for the source of truth; its unit tests pin the serialized names, and each command's e2e tests assert the envelope it emits. The `tests/cli_parse_*.rs`files pin the parsed clap arguments, not this shape (a few, such as `cli_parse_list.rs`, also spot-check `list`'s envelope).
0 commit comments