Repository navigation
fix(cold-storage): reject unrecognized CLI arguments in llm-cold-storage.sh - #6344
Closed
vaibhavsrv wants to merge 1 commit into
Closed
vaibhavsrv wants to merge 1 commit into
vaibhavsrv wants to merge 1 commit into
Conversation
Collaborator
|
Thanks for this contribution. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Why this matters
In
ods/scripts/llm-cold-storage.sh, CLI argument parsing evaluated the first argument using a fallback wildcard*)pattern that unconditionally invokeddo_archive true(dry-run archive). When a caller supplied an unknown option, an invalid flag, or a misspelling (e.g.--excute,--statuss,--unknown-flag), the script silently executed a dry-run scan and exited with code 0 instead of flagging invalid usage.This change explicitly handles the empty string
""as the default no-argument dry-run mode and updates the wildcard*)branch to reject unrecognized arguments with an informative error message and a non-zero exit code (1). Valid CLI options (--execute,--restore <name>,--restore-all,--status,--help, and no arguments) remain unchanged.Validation
bash ods/scripts/llm-cold-storage.sh --unknown-flagon the unpatched script silently triggered a dry-run scan and exited 0.ods/tests/test_llm_cold_storage_cli_args.pyvalidates that unrecognized flags and typos exit 1 with anERROR: Unrecognized argumentdiagnostic,--helpand no-argument scans exit 0, and missing arguments to--restorefail cleanly with exit 1.Overlap check
Risk / AI disclosure
AI-assisted investigation, implementation and CLI regressions. This strengthens CLI argument validation in llm-cold-storage.sh without modifying retention logic or filesystem operations. Independent human review and platform/runtime qualification remain gates. No running configuration, deployment or upstream merge changed.
Follow-up integration evidence
Composed with #6341 at 3df0a85 without conflicts. Production and test diffs passed together; cold storage and model management checks remain intact.
Backlog composition was local-only (production/test diffs, excluding workflow/Makefile wiring); it is not an upstream merge or independent human approval. Declared live-review gates remain open.