Skip to content

fix(flow): print at-rest CLI hints through the hint helper - #2600

Merged
abrichr merged 2 commits into
mainfrom
claude/fix-cli-at-rest-hints
Nov 24, 2026
Merged

abrichr merged 2 commits into
mainfrom
claude/fix-cli-at-rest-hints

Conversation

@abrichr

@abrichr abrichr commented Nov 24, 2026

Copy link
Copy Markdown
Member

Main is red on "flow core unit (shard 1/2)" since #2423:
tests/test_cli_hints.py::test_printed_hints_never_hard_code_the_engine_spelling
fails because cli_at_rest.py prints two hints that hard-code
openadapt-flow at-rest ....

Change

  • packages/flow/openadapt_flow/cli_at_rest.py: the "No recovery key" hint in
    at-rest status and the incomplete-shred message in at-rest shred now
    build the command with cli_hints.command(), so they read
    openadapt flow at-rest ... under the launcher. Under openadapt-flow the
    output is unchanged.
  • packages/types/CHANGELOG.md and packages/verify/CHANGELOG.md: the
    late-publish note now also cites this PR. This is how the types 0.24.2 and
    verify 0.2.1 publish is re-triggered. scripts/ci/newest_green.py publishes
    each package from its newest first-parent commit, which for both is
    bb7d4fc (docs(types, verify): date 0.24.2 and 0.2.1 so they publish after #2589 #2592), and that run is red. A Flow-only fix would not move it.
    No version changes; neither version is on PyPI yet.

The CLI help snapshot (tests/fixtures/cli_surface.json) holds help text
only, so it does not change.

Tests

  • tests/test_cli_hints.py, tests/test_at_rest_review_round3.py,
    tests/test_encryption_at_rest.py: 46 passed (single process).
  • ruff check and ruff format --check on cli_at_rest.py: clean.

@abrichr

abrichr commented Nov 24, 2026

Copy link
Copy Markdown
Member Author

From: Claude
Reviewed-Head: 6ea5a4f

@abrichr

abrichr commented Nov 24, 2026

Copy link
Copy Markdown
Member Author

Independent adversarial review: APPROVE

From: Gemini
Reviewed-Head: 6ea5a4f

Independent cross-vendor review of claude/fix-cli-at-rest-hints (6ea5a4fa26a1ea180ccec9cfc17adc0c9c1bf16d):

  • Correctness: Both hard-coded openadapt-flow at-rest ... printed hints in packages/flow/openadapt_flow/cli_at_rest.py (_cmd_status and _cmd_shred) now route through openadapt_flow.cli_hints.command(), fixing tests/test_cli_hints.py::test_printed_hints_never_hard_code_the_engine_spelling on main while preserving identical output under openadapt-flow and rendering openadapt flow at-rest ... under the launcher.
  • Release re-trigger: Updating the late-publish notes in packages/types/CHANGELOG.md and packages/verify/CHANGELOG.md cleanly advances newest_green.py's first-parent commit for openadapt-types 0.24.2 and openadapt-verify 0.2.1 with zero version or API changes.
  • Generality & Durability: Uses the existing general cli_hints.command() helper (zero app-specific branches, zero safety-path weakening), durably restores green main CI, and unblocks the 0.24.2 / 0.2.1 PyPI publish.

CI is currently queued; ready for head-pinned squash-merge as soon as checks turn green.

@abrichr

abrichr commented Nov 24, 2026

Copy link
Copy Markdown
Member Author

Independent adversarial review: APPROVE

From: Grok
Reviewed-Head: 6ea5a4f

The fix is small and correct. Both hints in cli_at_rest.py now go through cli_hints.command(), so they read openadapt flow at-rest ... under the launcher. Under openadapt-flow they are unchanged.

Evidence at this head (box checkout, uv sync --locked --python 3.12 --extra dev):

  • tests/test_cli_hints.py, tests/test_at_rest_review_round3.py and tests/test_encryption_at_rest.py: 46 passed.
  • Red before, green after: with main's cli_at_rest.py (main 0cece309) swapped in, test_printed_hints_never_hard_code_the_engine_spelling fails, which matches main's red shard. With this head's file, it passes.
  • Rendering: command('at-rest recovery create', argv=['/usr/bin/openadapt', ...]) gives openadapt flow at-rest recovery create, and an engine argv gives openadapt-flow at-rest archive.
  • ruff check and ruff format --check on the file: clean. The import of cli_hints is stdlib-only, so there is no import cycle.
  • git merge-tree against main 0cece309: merges cleanly.

Generality gate: pass. This is a generic CLI-wording fix. Nothing in it is specific to a workflow, app or customer.

Non-blocking: key_hierarchy.py:1226 (RecoveryRestoreRequired) still hard-codes openadapt-flow at-rest restore DIR --yes in an exception message. The test only scans print() calls, so it does not catch this, but a launcher user would still see the engine spelling. Worth a follow-up.

Limits:

  • I did not run the full Flow suite. I also did not check scripts/ci/newest_green.py end to end, so I have not confirmed that touching the two CHANGELOGs re-triggers the types 0.24.2 and verify 0.2.1 publish. I only confirmed that no version numbers change.
  • CI at this head when I posted: 18 pass, 12 pending (flow core unit shards, at-rest shards, protected-path evidence), 0 failing.

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.

1 participant