Skip to content

fix(cold-storage): reject unrecognized CLI arguments in llm-cold-storage.sh - #6344

Closed
vaibhavsrv wants to merge 1 commit into
Osmantic:public-betafrom
vaibhavsrv:fix/cold-storage-reject-unrecognized-args
Closed

vaibhavsrv wants to merge 1 commit into
Osmantic:public-betafrom
vaibhavsrv:fix/cold-storage-reject-unrecognized-args

Conversation

@vaibhavsrv

Copy link
Copy Markdown
Contributor

Why this matters

In ods/scripts/llm-cold-storage.sh, CLI argument parsing evaluated the first argument using a fallback wildcard *) pattern that unconditionally invoked do_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

  • Baseline reproduction: Executing bash ods/scripts/llm-cold-storage.sh --unknown-flag on the unpatched script silently triggered a dry-run scan and exited 0.
  • Post-fix verification: Running ods/tests/test_llm_cold_storage_cli_args.py validates that unrecognized flags and typos exit 1 with an ERROR: Unrecognized argument diagnostic, --help and no-argument scans exit 0, and missing arguments to --restore fail cleanly with exit 1.
  • Telemetry: Cold storage suites: 4 passed. New-test PyCompile, ShellCheck, and diff checks pass; new regressions wired into Linux CI.

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.

@Lightheartdevs

Copy link
Copy Markdown
Collaborator

Thanks for this contribution. public-beta was promoted into main on 2026-09-24 and no longer receives changes, so we're closing pull requests that target it. This isn't a judgment on the change itself. If it's still needed, please rebase onto main and open a focused PR. See #7253 for details and the contribution policy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants