GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||
GeezerVison is showing github.com — Make every --json top-level error a {code, message} object (#704) by mikolalysenko · Pull Request #1027 · SocketDev/socket-patch Conversation
|
|
[agent] CI status: all checks green on 70c3229 (555 pass, 6 skipped). Fixed: CodeQL rust/cleartext-logging (the forced --id/--cve/--ghsa shape error no longer echoes the argument); remove/scan tests now assert the coded usage error on stdout under --json; json_error_shape.rs spawns via hermetic::binary_command (spawn_env_hygiene). These failed on Linux too, not only Windows. Rebased onto origin/main (CLI_CONTRACT.md rollback table conflict: kept both the new error row and main's warnings wording). macOS/sbt/mill/coverage-merge failures were runner/apt infra and passed on rerun. Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
set_error / set_error_keep_status write the top-level error as a
{code, message} object and drop any top-level errorCode. legacy_error and
print_legacy_error give scan, get and rollback the minimal
{status: "error", error: {code, message}} shape. usage_error prints a
self-enforced usage error under --json (a full envelope for envelope
commands, the legacy shape for scan/get/rollback), or Error: on stderr,
and returns 2.
Guard tests fail on a bare `return 2;` in src/commands (outside the
hidden hosted_bundle harness) and on a "status": "error" JSON literal
whose top-level error is a string or carries errorCode.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
) get: report_error takes a code (patch_fetch_failed, manifest_unreadable, manifest_write_failed, patch_no_applicable_files, offline_unsupported); the lock failure, the nested-apply run error, blob_write_failed and selection_required carry error: {code, message}; top-level errorCode is gone. The nested-apply error keeps status partial_failure. scan: one hosted emitter that requires a code (refusals, lock_held/ lock_io, patch_details_failed, reference_resolve_failed, lockfile_write_failed); discovery failure, --offline, all-batches-failed (api_batch_failed), embedded VEX failure, the vendor step and the socket.yml refusal all write the object. rollback: emit_rollback_error takes a code; manifest_not_found, manifest_invalid, manifest_unreadable, patch_not_found, path_glob_no_match, hosted_wiring_contested, vendor_ledger_missing and rollback_failed. Usage errors (exit 2) in scan, get, rollback, remove, repair, vendor and vex go through json_envelope::usage_error, so under --json they print the coded error on stdout. Breaking change to the v5.0 JSON contract. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…704) Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…704) Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…704) Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The contract's nested-apply note said the v5 shape replaced a "top-level error.code + string error pair"; the replaced pair was the top-level errorCode. Three test doc comments still described the hosted lock_held/lock_io envelope as a top-level errorCode with a string error. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
- get: the forced --id/--cve/--ghsa shape error no longer echoes the argument. With usage_error printing it, CodeQL traced a test's patch uuid into eprintln (rust/cleartext-logging). - remove/scan tests: under --json the self-enforced usage error is now the coded error on stdout, so assert it there instead of on stderr. - json_error_shape.rs spawns through hermetic::binary_command, as spawn_env_hygiene requires. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
70c3229 to
a458ba9
Compare
|
[agent] CI status: rebased onto main (05ecc6e) and force-pushed as a458ba9. One conflict, in CI: 555 checks passed, 6 skipped. The first run was cancelled partway through and I re-ran it. One check is still red: Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Resolve the CLI_CONTRACT.md and socket.yml policy test conflicts keeping
both sides: main's new hosted rows (vlt workspace roots, uv/Poetry
takeover gates, per-purl `patches`, path-flag validation) stay, with
top-level errors described as the {code, message} object. Point the new
vlt workspace-member test at error.message, fix the stale top-level
errorCode wording for eject_refused and managed_install, and note that
the pre-dispatch path-flag check, like clap's parse errors, prints
nothing on stdout under --json.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Resolve the CLI_CONTRACT.md hosted-scan paragraph conflict: keep main's
new gem refusal codes and describe lock_held / lock_io as the
error: {code, message} object.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
[agent] Merged main, CI green; ready for review. Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
bugbot run Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Stale Bugbot comment from a previous run.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
The path_glob_invalid usage error capitalized the message before handing it to usage_error, so the --json error.message was capitalized too. capitalize_first is a human-only transform: every other rollback JSON error (emit_rollback_error) and scan's path_glob_invalid keep the verbatim message. Capitalize only for the stderr line, and pin both forms in the json_error_shape test. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LD4qUfZKhg2qgt3x9vGeFf
|
bugbot run Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Stale Bugbot comment from a previous run.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Resolve the conflicts with main's staged hosted takeover. hosted.rs now
writes through main's commit_hosted_writes; its failure path keeps the
PR's {code, message} error object and reports lockfile_write_failed.
CLI_CONTRACT.md takes main's staged-takeover text and changes the hosted
lock-failure JSON back to the PR's error object (no top-level errorCode).
Co-Authored-By: Claude <[email protected]>
|
bugbot run Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Stale Bugbot comment from a previous run.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Burn-down agent: labeled Ready for review at 6eb0448.
Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Main (#1043) moved get's agent-mode engine into agent_download.rs, so the {code, message} error object is ported there: report_error takes a code, report_lock_failure and the manifest read/write failures use legacy_error, and fold_apply_failures sets the run-level error with set_error_keep_status instead of a top-level errorCode. Rollback's path_glob_invalid keeps the verbatim JSON message and uses main's ui::sentence_case for the human line. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
bugbot run Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 9a15a0b. Configure here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Main's new contract rows (workspace-lock-elsewhere, eject refusals) and the stray-member-lock test (#1095) now use the top-level error object: the rows say error.code, and the test reads error.message. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
[agent] Merged main, CI green, enqueued. Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Resolve conflicts with #1027 (--json usage errors print coded errors): keep this branch's --sync-only cross-mode wording (the legacy mode booleans are removed here) and add main's note that --json usage errors now print the coded error on stdout, in scan/mod.rs and CLI_CONTRACT.md. Co-Authored-By: Claude <[email protected]>
main (#1027) changed the --json top-level error to a {code, message} object. CLI_CONTRACT.md now uses main's `error.code` rows with this branch's Bun/vlt sentence, and the new CLI test reads error.message. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0118z8gCQpYXnzeeinQdsTEp
Resolve get.rs and rollback.rs conflicts with #1027: keep this PR's shared telemetry handle and take main's {code, message} error codes. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Resolve conflicts with #1027 ({code, message} JSON errors): keep this PR's pnpm rows in CLI_CONTRACT.md with main's top-level `error.code` wording and main's new rollback `error` row, and keep both import sets in scan/mod.rs. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Resolve the CLI_CONTRACT.md conflict with #1027 (top-level error became {code, message}): keep this branch's eject_rolled_back skipped-event row and spell the top-level error rows as `error.code`, as main now does. Per-event errorCode fields are unchanged. Co-Authored-By: Claude <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Decide: one shape for the--json top-level error (scan and get emit both a string and a {code, message} object)
There was an error while loading. Please reload this page.