GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(cli): Phase 1 quick wins — env-bool crashes, remove --dry-run, one-off stub, mode-fold inversion by mikolalysenko · Pull Request #119 · SocketDev/socket-patch

Conversation

@mikolalysenko

@mikolalysenko Mikola Lysenko (mikolalysenko) commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

Stacked on #118. The four Phase-1 correctness/safety fixes from the architecture review:

  1. Env-bool parse unification — parse_bool_flag everywhere: fixes the crash class where SOCKET_SAVE_ONLY=1/SOCKET_ONE_OFF=/SOCKET_SKIP_ROLLBACK=1 aborted get/remove (and SOCKET_ALL_RELEASES= via BoolishValueParser). Adds LOCAL_ARG_ENV_VARS (with the same single-source-of-truth contract as the global list — which was missing SOCKET_STRICT), widens main's empty-var scrub to it, and adds two table-driven invariant tests that parse every env binding against its owning subcommand so the policy self-enforces. RED-verified.
  2. remove --dry-run implemented — the one mutating command that silently ignored the global --dry-run contract row ("Preview, no mutations") and deleted anyway. Preview flips would-be Removed events to Verified (the apply/vendor/repair convention); manifest removal simulated in memory so the blob sweep previews accurately. RED-verified.
  3. get --one-off fails honestly — was a silent no-op that saved to the manifest anyway; now errors 'not yet implemented' up front, mirroring rollback --one-off.
  4. Scan mode-fold inversion — ScanMode becomes the single source of truth; legacy booleans (--apply/--vendor/--redirect/--sync) fold into the enum and are never read downstream. Error strings byte-identical; legacy help text demoted to 'deprecated spelling of --mode X'. Enabler for the scan.rs module split.

Contract rows updated in step (--dry-run coverage, one-off stubs, remove events table).

Test plan

  • All touched suites green: cli_parse_* (10 files), remove_invariants (+2 RED-verified), in_process_get, get_invariants, scan_invariants, scan_sync_e2e, scan_vendor_e2e, in_process_scan, in_process_redirect, cli_scan_silent, output_modes_e2e, cli_dry_run_paths_e2e
  • cargo clippy --all-targets: zero warnings

🤖 Generated with Claude Code

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Mikola Lysenko (mikolalysenko) and others added 4 commits July 2, 2026 17:47
@mikolalysenko @claude
fix(cli): unify env-bool parsing — one parser policy, scrub covers lo…
68a19d2
…cal vars

parse_bool_flag everywhere: get --save-only/--one-off and remove
--skip-rollback had clap's default bool-from-env (SOCKET_X=1 or an
exported-but-empty var aborted the parse — same bug class fixed on
rollback/repair/unlock/vex earlier); apply --check, setup --check/--remove,
and get/scan --all-releases dropped BoolishValueParser (rejects VAR=).
SOCKET_STRICT was missing from GLOBAL_ARG_ENV_VARS despite the list's
'every env var GlobalArgs binds' contract. New LOCAL_ARG_ENV_VARS mirrors
that contract for subcommand flags; the main-run scrub and the test
harness's clean-env helper now cover both lists. Two table-driven
invariant tests parse every binding against its owning subcommand with
'', '1', 'yes', 'garbage' so the policy self-enforces (RED-verified
against the pre-fix get.rs).

Co-Authored-By: Claude Fable 5 <[email protected]>
@mikolalysenko @claude
fix(remove): implement --dry-run — preview, no mutations
a870d16
remove was the one mutating command that silently ignored the global
--dry-run (contract row: 'Preview, no mutations') and deleted anyway.
Now: lock/emit carry dry_run; the confirmation prompt is skipped (nothing
to confirm); rollback and vendor-revert run their existing dry-run modes;
the manifest removal is simulated in memory so the blob sweep previews
against the post-removal reference set; the envelope reports dryRun:true
with would-be Removed events flipped to Verified previews (the
apply/vendor/repair convention) so summary.removed stays 'entries
actually deleted'. Telemetry does not fire on previews. Contract lines
103/763 updated. +2 invariant tests (RED-verified against the old code).

Co-Authored-By: Claude Fable 5 <[email protected]>
@mikolalysenko @claude
fix(get): --one-off fails honestly instead of silently saving anyway
7c74562
The flag parsed but was never read past the --save-only conflict check —
the patch was saved to the manifest regardless, lying about persistence.
It now errors 'One-off get mode is not yet implemented' up front (before
any network/disk activity), mirroring rollback --one-off's contract.
Contract env-table row documents both stubs; the in_process_get caveat
test now pins the honest error instead of the accidental behavior.

Co-Authored-By: Claude Fable 5 <[email protected]>
@mikolalysenko @claude
refactor(scan): invert the mode fold — ScanMode is the source of truth
06a9b10
resolve_mode_flags previously folded --mode INTO the legacy booleans
(--redirect/--vendor/--apply), leaving the deprecated spellings as the
internal truth. Now the booleans fold into args.mode and are never read
past the fold; run() derives apply/vendor/hosted locals from the enum.
Error messages are byte-identical (pinned by scan_vendor_e2e). Legacy
boolean help text now says 'Deprecated spelling of --mode X'. Contract
tests updated to pin the new direction (modeless scan stays read-only,
--sync == --mode agent --prune).

Co-Authored-By: Claude Fable 5 <[email protected]>
@mikolalysenko Mikola Lysenko (mikolalysenko) mentioned this pull request Jul 2, 2026
cleanup: CLI simplify pass, correctness fixes, core dedups, scan split, docs sync (−587 net lines) #120
Merged
4 tasks done
@mikolalysenko

Mikola Lysenko (mikolalysenko) commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator Author

Superseded — combined into #120, which now targets main and contains all of this PR's commits. Closing unmerged.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mikolalysenko
Mikola Lysenko (mikolalysenko) deleted the branch refactor/cli-simplify-pass July 3, 2026 00:35
@mikolalysenko Mikola Lysenko (mikolalysenko) closed this Jul 3, 2026
@mikolalysenko
Mikola Lysenko (mikolalysenko) deleted the fix/cli-env-bool-parsing branch July 3, 2026 00:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@mikolalysenko
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.