Skip to content

docs(cli): add parser migration guardrails#2860

Open
sjinks wants to merge 1 commit into
trunkfrom
pltfrm-2357-add-migration-guardrail-checklist-item-defaultparser
Open

docs(cli): add parser migration guardrails#2860
sjinks wants to merge 1 commit into
trunkfrom
pltfrm-2357-add-migration-guardrail-checklist-item-defaultparser

Conversation

@sjinks
Copy link
Copy Markdown
Member

@sjinks sjinks commented May 29, 2026

Description

Document parser migration guardrails for short-option equals syntax and parser-backed option defaults. This captures compatibility details that should stay explicit during future CLI parser work.

Changelog Description

Changed

  • Documented CLI parser migration guardrails for short-option equals syntax and parser-backed option defaults.

Pull request checklist

New release checklist

Steps to Test

  1. Review the migration checklist additions in AGENTS.md.
  2. Review the preserved compatibility note in docs/COMMANDER-MIGRATION.md.
  3. Run npm run format:check.

## Purpose and Context

PLTFRM-2357 tracks a follow-up from a VIP CLI 4.0.1 parser
compatibility incident. The migration guidance should explicitly call
out argument shapes that previously relied on implicit args/mri behavior.

## Key Changes

- Document short-option equals normalization for value-taking aliases.
- Document post-parse default handling for parser-backed options.
- Note the regression test that guards the compatibility contract.

## Impact and Considerations

This is a documentation-only change. It does not change CLI runtime
behavior or release packaging.

## Testing and Validation

Ran `npm run format:check`.

Refs PLTFRM-2357
Copilot AI review requested due to automatic review settings May 29, 2026 16:18
@github-actions
Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@sonarqubecloud
Copy link
Copy Markdown

@sjinks sjinks self-assigned this May 29, 2026
@sjinks sjinks requested a review from a team May 29, 2026 16:20
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This documentation-only PR adds guardrails for future CLI parser migration work, focusing on preserving option parsing compatibility during Commander-related refactors.

Changes:

  • Documents short-option equals normalization behavior.
  • Documents post-parse default application for parser-backed options.
  • Adds the same migration guardrails to the agent-facing contributor guide.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
docs/COMMANDER-MIGRATION.md Adds preserved compatibility behavior for short-option equals syntax and tracked defaults.
AGENTS.md Adds parser migration guardrails for future agents working on CLI parser changes.

Comment thread AGENTS.md
- Watch shared state: current implementation mutates a global; ensure new parser avoids cross-command bleeding when multiple command instances run in-process (tests/CLI wrappers).
- Login guardrails in `vip.js` let certain commands bypass auth; preserve equivalent shortcuts or add explicit non-interactive flags for CI.
- Normalize short-option equals syntax: rewrite `-x=value` to `-x value` before parsing for short options that expect values; track which short options take values to avoid breaking boolean flags that should remain flag-only.
- Apply tracked defaults after parsing: when an option has both a default and a custom parser function, apply the default only when `opts[optionName] === undefined` after the parser runs, so that explicit values and defaults maintain parity with the parser contract (see test `parses short options using equals syntax without prefixing values` in `__tests__/lib/cli/command.js`).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants