René's URL Explorer Experiment


Title: test(cli): foundation for CLI-contract unit-test campaign by mikolalysenko · Pull Request #68 · SocketDev/socket-patch · GitHub

Open Graph Title: test(cli): foundation for CLI-contract unit-test campaign by mikolalysenko · Pull Request #68 · SocketDev/socket-patch

X Title: test(cli): foundation for CLI-contract unit-test campaign by mikolalysenko · Pull Request #68 · SocketDev/socket-patch

Description: Summary Foundation PR for a comprehensive unit-test campaign on the socket-patch CLI. Stacked on #67 (so it can land alongside the per-package/diff pathways work). No behavior change to the binary. Follow-up PRs will be stacked on this branch and add the actual per-command tests in parallel. Three changes: Expose the clap parser as a library so integration tests can verify the public CLI contract without spawning the binary: New crates/socket-patch-cli/src/lib.rs hosting Cli, Commands, looks_like_uuid, and parse_with_uuid_fallback (extracted from main.rs). Cargo.toml gains [lib] entry alongside the existing [[bin]]. main.rs is now a thin wrapper that delegates to the lib. De-duplicate manifest-path resolution. The same 5-line absolute-vs-relative join block was copy-pasted across apply/rollback/list/remove/repair. New helper socket_patch_core::manifest::operations::resolve_manifest_path replaces all 5 copies. 3 unit tests cover the relative/absolute/dotted cases. New crates/socket-patch-cli/CLI_CONTRACT.md documenting every subcommand, flag, default value, alias, JSON-output shape, and exit code as semver-significant surface. Spells out the bump policy (rename a flag → MAJOR; add an optional flag → MINOR; …) and how to invoke scripts/version-sync.sh afterward. A 4-line comment block above pub enum Commands points readers at it. Why now The CLI crate currently has zero unit tests under src/ — only network-dependent tests/e2e_*.rs suites gated behind --ignored. A flag rename, a default change, or a JSON key drift could land green and silently break every shipped wrapper (npm @socketsecurity/socket-patch, pypi socket-patch, cargo, prebuilt binaries). This PR lays the groundwork; the follow-up PRs will lock in every flag and helper. What lands later (stacked on this branch) 10 parallel test PRs: tests/cli-parse-main — looks_like_uuid + parse_with_uuid_fallback (the bare-UUID fallback no test guards today) tests/cli-parse-output — format_severity, color, confirm tests/cli-parse-ecosystem-dispatch — partition_purls tests/cli-parse-apply — every ApplyArgs flag + verify_status_str + result_to_json tests/cli-parse-rollback — every RollbackArgs flag + find_patches_to_rollback tests/cli-parse-get — every GetArgs flag, download visible alias, hidden --no-apply alias, detect_identifier_type, select_patches tests/cli-parse-scan — every ScanArgs flag, --batch-size default = 100 tests/cli-parse-list — every ListArgs flag + async run tests (missing/empty/populated manifest) tests/cli-parse-repair — every RepairArgs flag, gc visible alias, pin --download-mode default = file (the divergent one) tests/cli-parse-remove-setup — both RemoveArgs/SetupArgs flags + async error-path JSON shape tests Each will be a sibling PR targeting tests/cli-contract-foundation. Test plan cargo build --workspace --all-features — clean cargo clippy --workspace --all-features -- -D warnings — clean cargo test --workspace --all-features --lib — 415 unit tests pass (was 412; +3 from resolve_manifest_path tests) cargo test --workspace --all-features --no-run — all 8 e2e test binaries still compile Smoke: socket-patch download --help, socket-patch gc --help, socket-patch get --no-apply --help, bare-UUID socket-patch all behave identically to pre-refactor Assisted-by: Claude Code:claude-opus-4-7

Open Graph Description: Summary Foundation PR for a comprehensive unit-test campaign on the socket-patch CLI. Stacked on #67 (so it can land alongside the per-package/diff pathways work). No behavior change to the binary....

X Description: Summary Foundation PR for a comprehensive unit-test campaign on the socket-patch CLI. Stacked on #67 (so it can land alongside the per-package/diff pathways work). No behavior change to the binary....

Opengraph URL: https://github.com/SocketDev/socket-patch/pull/68

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:f0269d80-2278-b5d9-9abb-9008a881a839
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idA790:3BD8F2:18631CA:21920CF:6A4F232E
html-safe-nonce020ca3b921d00a13f4fd4074c8357824b69242dc05f0294ddc96ae0bb554a6b5
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNzkwOjNCRDhGMjoxODYzMUNBOjIxOTIwQ0Y6NkE0RjIzMkUiLCJ2aXNpdG9yX2lkIjoiNjU4MDIyNTI4MDM2NjgxMzk5OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacb2a5913f862758e7e21905aedcb8913a599a1946801aafd23715b33fbcd79e57
hovercard-subject-tagpull_request:3711872675
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/SocketDev/socket-patch/pull/68/files
twitter:imagehttps://avatars.githubusercontent.com/u/231686?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/231686?s=400&v=4
og:image:altSummary Foundation PR for a comprehensive unit-test campaign on the socket-patch CLI. Stacked on #67 (so it can land alongside the per-package/diff pathways work). No behavior change to the binary....
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noneb92d11c0aa4a77d54ef4af1078b6a15fb5a70a215b30c4ecf28889d5a8e656d9
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/SocketDev/socket-patch git https://github.com/SocketDev/socket-patch.git
octolytics-dimension-user_id69326764
octolytics-dimension-user_loginSocketDev
octolytics-dimension-repository_id1093661456
octolytics-dimension-repository_nwoSocketDev/socket-patch
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1093661456
octolytics-dimension-repository_network_root_nwoSocketDev/socket-patch
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release2b8f23afb982271f1b22258a94aede67a6b77760
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/SocketDev/socket-patch/pull/68/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FSocketDev%2Fsocket-patch%2Fpull%2F68%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FSocketDev%2Fsocket-patch%2Fpull%2F68%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=SocketDev%2Fsocket-patch
Reloadhttps://github.com/SocketDev/socket-patch/pull/68/files
Reloadhttps://github.com/SocketDev/socket-patch/pull/68/files
Reloadhttps://github.com/SocketDev/socket-patch/pull/68/files
Please reload this pagehttps://github.com/SocketDev/socket-patch/pull/68/files
SocketDev https://github.com/SocketDev
socket-patchhttps://github.com/SocketDev/socket-patch
Notifications https://github.com/login?return_to=%2FSocketDev%2Fsocket-patch
Fork 0 https://github.com/login?return_to=%2FSocketDev%2Fsocket-patch
Star 3 https://github.com/login?return_to=%2FSocketDev%2Fsocket-patch
Code https://github.com/SocketDev/socket-patch
Issues 1 https://github.com/SocketDev/socket-patch/issues
Pull requests 1 https://github.com/SocketDev/socket-patch/pulls
Actions https://github.com/SocketDev/socket-patch/actions
Models https://github.com/SocketDev/socket-patch/models
Security and quality 0 https://github.com/SocketDev/socket-patch/security
Insights https://github.com/SocketDev/socket-patch/pulse
Code https://github.com/SocketDev/socket-patch
Issues https://github.com/SocketDev/socket-patch/issues
Pull requests https://github.com/SocketDev/socket-patch/pulls
Actions https://github.com/SocketDev/socket-patch/actions
Models https://github.com/SocketDev/socket-patch/models
Security and quality https://github.com/SocketDev/socket-patch/security
Insights https://github.com/SocketDev/socket-patch/pulse
Sign up for GitHub https://github.com/signup?return_to=%2FSocketDev%2Fsocket-patch%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2FSocketDev%2Fsocket-patch%2Fissues%2Fnew%2Fchoose
Mikola Lysenko (mikolalysenko)https://github.com/mikolalysenko
mainhttps://github.com/SocketDev/socket-patch/tree/main
tests/cli-contract-foundationhttps://github.com/SocketDev/socket-patch/tree/tests/cli-contract-foundation
Conversation 0 https://github.com/SocketDev/socket-patch/pull/68
Commits 3 https://github.com/SocketDev/socket-patch/pull/68/commits
Checks 21 https://github.com/SocketDev/socket-patch/pull/68/checks
Files changed https://github.com/SocketDev/socket-patch/pull/68/files
Please reload this pagehttps://github.com/SocketDev/socket-patch/pull/68/files
test(cli): foundation for CLI-contract unit-test campaign https://github.com/SocketDev/socket-patch/pull/68/files#top
Show all changes 3 commits https://github.com/SocketDev/socket-patch/pull/68/files
ef0deac test(cli): comprehensive unit-test campaign for the CLI contract mikolalysenko May 20, 2026 https://github.com/SocketDev/socket-patch/pull/68/commits/ef0deacb11f25de4ff8804c2a109832d81a63bfa
99f5fc6 ci: tighten CI matrix — add macOS, release-mode tests, explicit build… mikolalysenko May 20, 2026 https://github.com/SocketDev/socket-patch/pull/68/commits/99f5fc697ec9d2229e75f0019dfab7dee0ef2c45
9950835 fix(patch): reject POSIX-style absolute paths in archive entries on W… mikolalysenko May 20, 2026 https://github.com/SocketDev/socket-patch/pull/68/commits/9950835a68dc0be742706473ff0675b510a451f0
Clear filters https://github.com/SocketDev/socket-patch/pull/68/files
Please reload this pagehttps://github.com/SocketDev/socket-patch/pull/68/files
Please reload this pagehttps://github.com/SocketDev/socket-patch/pull/68/files
ci.yml https://github.com/SocketDev/socket-patch/pull/68/files#diff-b803fcb7f17ed9235f1e5cb1fcd2f5d3b2838429d4368ae4c57ce4436577f03f
CLI_CONTRACT.md https://github.com/SocketDev/socket-patch/pull/68/files#diff-f4377a7f0221c73c8e1c3a219f5dbd8ee64094eb7786841ecea88ccd22daf130
Cargo.toml https://github.com/SocketDev/socket-patch/pull/68/files#diff-d975fab3956058ba8cc187ef25733f371f85ac13917e77e0bfa4c40c73ba5f7b
apply.rs https://github.com/SocketDev/socket-patch/pull/68/files#diff-613e6131c3d7005ade62351d4f879e7c817bafdc2f6d6fdd87e2b259bebfb9bf
get.rs https://github.com/SocketDev/socket-patch/pull/68/files#diff-ab141f0dfc26b35a483b70780ec703f5f1047866eaf1d3ccf9182fc5cdea164f
list.rs https://github.com/SocketDev/socket-patch/pull/68/files#diff-808f74b0c8422b914537c7fbdc380059d5bf4a4a60fe317d2d850a43a6448a8f
remove.rs https://github.com/SocketDev/socket-patch/pull/68/files#diff-37716ed3bf0ced8c6011d60b918d7bf9ab7b8a118ce8245507dfe9332e54b27c
repair.rs https://github.com/SocketDev/socket-patch/pull/68/files#diff-cc48894cd3c0ab1d1fbdaae98591be3e7ab527d344e47eeafb2f7c0783391c35
rollback.rs https://github.com/SocketDev/socket-patch/pull/68/files#diff-49bed4b7989d1153ce40e98f6686a0343d4aef1e9a8f241abfb0d6e006cda233
ecosystem_dispatch.rs https://github.com/SocketDev/socket-patch/pull/68/files#diff-b4621fd545be96d70879527496ba97342c59039dfb7683fbf42fdd3396dce794
lib.rs https://github.com/SocketDev/socket-patch/pull/68/files#diff-d4989724ce35f9d98a4444f57ad1c5aa8e4d19c2e55380b6cb39cf1e3139ffc8
main.rs https://github.com/SocketDev/socket-patch/pull/68/files#diff-df6d5aa728e15b07a84996ad4e4dc5ddc46be7d2a186da53c67257c729fe33e7
output.rs https://github.com/SocketDev/socket-patch/pull/68/files#diff-a8e9e4c57528b415d663dbbd39a189ef703761f0f065bca86978b5617280f110
cli_parse_apply.rs https://github.com/SocketDev/socket-patch/pull/68/files#diff-62f501ed807ac45422118697ee825821e24d6d0717739d3b98ca24a4849b8983
cli_parse_get.rs https://github.com/SocketDev/socket-patch/pull/68/files#diff-7796373957fac18901e1220f110b93b956981ba0e265a1765531dab868c4c17b
cli_parse_list.rs https://github.com/SocketDev/socket-patch/pull/68/files#diff-f4a4c970d20eb304c28cf6b43dda6cd69f77c3ec5899cb1a862487fb1a026e63
cli_parse_main.rs https://github.com/SocketDev/socket-patch/pull/68/files#diff-ba439fdf562ce2b404bb37fb7edc0e7e15ffd8aa778bcf546ceb83952ed1737d
cli_parse_remove.rs https://github.com/SocketDev/socket-patch/pull/68/files#diff-044e91597378550728a908129405a1c77da59e2da52da040bf50e65200018db6
cli_parse_repair.rs https://github.com/SocketDev/socket-patch/pull/68/files#diff-79b172dd73c7f193e00045c3d2504e4aa4f7b15d87c0b2a30319c56a9f0bb05b
cli_parse_rollback.rs https://github.com/SocketDev/socket-patch/pull/68/files#diff-c2c93f8859273c59c0ae99425d5ca5f670d97d2384d49335c431f198544ab493
cli_parse_scan.rs https://github.com/SocketDev/socket-patch/pull/68/files#diff-81e57ea8e647d6a77d9cfe62c098429ec2e8a829bd153f1c44758a13b6f1de66
cli_parse_setup.rs https://github.com/SocketDev/socket-patch/pull/68/files#diff-f31e445d27c4789742541e92cb258ed85d79d70131d5eace50ec51118eb8d632
operations.rs https://github.com/SocketDev/socket-patch/pull/68/files#diff-412872bbcaf0808c9201a327034774848091983c7a6995ca91dbff80b89d2917
package.rs https://github.com/SocketDev/socket-patch/pull/68/files#diff-ba8091efa0ef15ed7b531867f314339be01d365f32797bef73a3d2a02e7dbf9b
.github/workflows/ci.ymlhttps://github.com/SocketDev/socket-patch/pull/68/files#diff-b803fcb7f17ed9235f1e5cb1fcd2f5d3b2838429d4368ae4c57ce4436577f03f
View file https://github.com/SocketDev/socket-patch/blob/9950835a68dc0be742706473ff0675b510a451f0/.github/workflows/ci.yml
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/SocketDev/socket-patch/pull/68/{{ revealButtonHref }}
https://github.com/SocketDev/socket-patch/pull/68/files#diff-b803fcb7f17ed9235f1e5cb1fcd2f5d3b2838429d4368ae4c57ce4436577f03f
https://github.com/SocketDev/socket-patch/pull/68/files#diff-b803fcb7f17ed9235f1e5cb1fcd2f5d3b2838429d4368ae4c57ce4436577f03f
https://github.com/SocketDev/socket-patch/pull/68/files#diff-b803fcb7f17ed9235f1e5cb1fcd2f5d3b2838429d4368ae4c57ce4436577f03f
crates/socket-patch-cli/CLI_CONTRACT.mdhttps://github.com/SocketDev/socket-patch/pull/68/files#diff-f4377a7f0221c73c8e1c3a219f5dbd8ee64094eb7786841ecea88ccd22daf130
View file https://github.com/SocketDev/socket-patch/blob/9950835a68dc0be742706473ff0675b510a451f0/crates/socket-patch-cli/CLI_CONTRACT.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/SocketDev/socket-patch/pull/68/{{ revealButtonHref }}
crates/socket-patch-cli/Cargo.tomlhttps://github.com/SocketDev/socket-patch/pull/68/files#diff-d975fab3956058ba8cc187ef25733f371f85ac13917e77e0bfa4c40c73ba5f7b
View file https://github.com/SocketDev/socket-patch/blob/9950835a68dc0be742706473ff0675b510a451f0/crates/socket-patch-cli/Cargo.toml
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/SocketDev/socket-patch/pull/68/{{ revealButtonHref }}
https://github.com/SocketDev/socket-patch/pull/68/files#diff-d975fab3956058ba8cc187ef25733f371f85ac13917e77e0bfa4c40c73ba5f7b
https://github.com/SocketDev/socket-patch/pull/68/files#diff-d975fab3956058ba8cc187ef25733f371f85ac13917e77e0bfa4c40c73ba5f7b
Please reload this pagehttps://github.com/SocketDev/socket-patch/pull/68/files
Please reload this pagehttps://github.com/SocketDev/socket-patch/pull/68/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.