Skip to content

Phase 0 (8/9): 'azureclaw convert' CLI skeleton (exit-3) - #42

Closed
Pal Lakatos-Toth (pallakatos) wants to merge 2 commits into
phase0/conformance-corpus-signalfrom
phase0/kubectl-convert-skeleton
Closed

Pal Lakatos-Toth (pallakatos) wants to merge 2 commits into
phase0/conformance-corpus-signalfrom
phase0/kubectl-convert-skeleton

Conversation

@pallakatos

Copy link
Copy Markdown
Collaborator

Phase 0 · azureclaw convert CLI skeleton

Adds the Commander surface for azureclaw convert ahead of Phase 2 translator work.

cli/src/commands/convert.ts

  • Flags: --file <path>, --to <clawsandbox|sandbox>, --sandbox-ref <name>, --dry-run, --allow-lossy.
  • Every successful parse exits 3 ("not yet implemented"). Invalid argv exits 2. No path exits 0.
  • Prevents scripts silently depending on a no-op — principle §0.2 Bump jsonwebtoken from 9.3.1 to 10.3.0 #1.

cli/src/cli.ts

  • New "Interop" section in the top-level help, houses convert today, will hold future interop commands.

Tests

  • 3 unit tests on parseTarget (accepts clawsandbox, sandbox, rejects others).

Security

  • docs/security-audits/2026-04-24-phase0-convert-cli-skeleton.md — surface-only audit; re-audit triggers: real YAML parse, file I/O, CR emission, --apply.

Verification

  • npm run typecheck + npm run build clean.
  • Vitest: 3 new tests pass.
  • Smoke: --help renders; all rejection paths exit with the right code.

Stack

PR 8/9 — bases on phase0/conformance-corpus-signal (PR 7).

Copilot AI and others added 2 commits April 24, 2026 22:10
Per docs/implementation-plan.md §2.2 + §6 item 13. Lock in the CLI
surface now; real translation lands Phase 2 per the mapping table in
docs/sigs-agent-sandbox-compat.md §4.

cli/src/commands/convert.ts
- Commander subcommand with --file / --to / --sandbox-ref / --dry-run /
  --allow-lossy. Targets: clawsandbox | upstream-sandbox | overlay.
- All successful parses exit 3 ('not yet implemented') with a clear
  stderr pointing at the Phase 2 mapping doc. No path exits 0 —
  prevents scripts silently depending on a no-op (principle §0.2 #8).
- parseTarget helper exported via __test for unit tests.

cli/src/commands/convert.test.ts
- 3 unit tests on parseTarget (accept all three, reject unknown,
  reject undefined).

cli/src/cli.ts
- Register convertCommand() under a new 'Interop' section. One import,
  one addCommand call. No other command affected.

docs/security-audits/2026-04-24-phase0-convert-cli-skeleton.md
- 11-section audit: no network, no secrets, no cluster writes.
  Negative-test coverage lists the two argv-reject paths + the two
  exit-2 smoke cases.

Verification
- npm run typecheck (cli):  clean
- npm run build (cli):      clean
- npx vitest run convert.test.ts: 3 passed
- node dist/index.js convert --help:   renders expected surface
- node dist/index.js convert --to bogus -f x: exit 2 as expected
- All 5 non-signoff gates: PASS

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Approved by repository maintainer for Phase 0 merge.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@pallakatos

Copy link
Copy Markdown
Collaborator Author

Closing in favor of an integrated validation on the dev branch. This branch has been merged into dev (see origin/dev) and a single dev → main PR will land once CI is green on dev. No code is lost — every commit remains on its phase0/* branch and is reachable from dev.

@pallakatos
Pal Lakatos-Toth (pallakatos) deleted the phase0/kubectl-convert-skeleton branch April 27, 2026 12:58
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