Skip to content

fix(cli): repair thirteen of master's red CLI tests - #4420

Merged
Sinity merged 4 commits into
masterfrom
fix/root-help-marker-row
Aug 29, 2026
Merged

Sinity merged 4 commits into
masterfrom
fix/root-help-marker-row

Conversation

@Sinity

@Sinity Sinity commented Aug 29, 2026 •

Copy link
Copy Markdown
Owner

Summary

Repairs eight of master's nineteen red CLI tests — the four help/alias ones and
four fixture/expectation ones — by fixing what they were reporting. Together
with #4419 (five delete-path tests) the selection goes 19 → 6.

Problem and solution

Root help omitted find. ROOT_COMMAND_ROLE_SECTIONS declares it first
among the search workflows, but format_commands skips any entry
get_command cannot resolve — and find is the query marker the dispatcher
consumes, deliberately not a registered command. Help taught
find QUERY then ACTION in prose while omitting find from the list of
commands it introduces. A declared marker help now renders the row through
Click's own short-help derivation, so it truncates on the same column budget as
its neighbours. find stays out of cli.commands; dispatch and completion are
unchanged.

context rendered blank. _LazyCommand.get_short_help_str does not import
the module — staying lazy is the point — so a lazily-registered command shows
whatever short help the registration table declares. context declared none.

fable-packet --format lacked the -f alias the flag-alias contract
requires.

ops reset --index raised instead of refusing. _archive_index_targets
resolved .index-active-pointer and only then refused to touch a managed
generation. A pointer naming a target outside the archive root — the state the
clone hardening rejects — therefore produced ArchiveLocationError rather than
the refusal written for exactly that case. The refusal reads the pointer's
presence, never its target, so it now runs first.

Two fixtures placed a managed generation outside the archive root, a layout
the archive no longer permits. They now sit under .index-generations/, which
still keeps them out of the root's top-level index.db — the distinction those
tests exist to prove.

One relative-time expectation was measured against the wall clock: "16w ago" for a fixed 2026-05-02 timestamp went red as the distance grew to 17
weeks. The clock is now frozen at what the expectation describes.

Verification

uv run pytest tests/unit/cli -p no:randomly   # 6 failed, 2865 passed
uv run devtools verify --quick                # exit 0

Master fails 19 in that selection.

Snapshots were regenerated, not hand-edited. The only content change is
context gaining its description; the find row matches the text the snapshot
already expected.

Residual

Six failures remain, deliberately untouched and classified on polylogue-4g1is:
three depend on ambient environment (a live daemon, a real pty, a database
path), and two are policy questions — cost estimate status (polylogue-e60z5)
and whether a tiny --max-tokens budget should clip inside every segment or
drop and account for one. Correcting those tests to match current output would
encode whichever behaviour happens to exist, so they are left red.

The three help modules pass in a fixed order but one fails under
pytest-randomly when run together — a pre-existing isolation defect, not a
help-rendering one.

`ROOT_COMMAND_ROLE_SECTIONS` declares `find` first among the search workflows,
but the renderer skipped it because `get_command` returns None: `find` is the
query marker the dispatcher consumes, not a registered command. Root help
therefore taught `find QUERY then ACTION` in prose while omitting it from the
list of commands it introduces. The row is now rendered from a declared marker
help, sharing the same column budget as the commands beside it. `find` is
still absent from `cli.commands`, so completion and dispatch are unchanged.

`context` is registered lazily, and `_LazyCommand.get_short_help_str`
deliberately does not import the module, so a lazily-registered command with no
declared short help renders a blank description. `context` had none.

`ops insights fable-packet --format` was missing the `-f` alias the flag-alias
contract requires.

Verification: pytest tests/unit/cli -p no:randomly — 10 failed, down from 19
on master; the nine repaired are the four help/alias tests here and the five
delete-path tests fixed in #4419. devtools verify --quick — exit 0.

Residual: the help snapshot tests pass in a fixed order but one fails under
pytest-randomly when all three help modules run together, which is a
pre-existing isolation defect, not a help-rendering one. The remaining ten CLI
failures are unrelated and tracked on polylogue-4g1is.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_014BQsaB1NBY8mTR6yZByfMA
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-08-29T15:14:34.094973Z 17163e1 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Aug 29, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: af396aab-5b40-4907-bb10-b0abb35cfe4c


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sinity and others added 3 commits August 29, 2026 16:58
`test_select_row_from_summary_uses_query_result_display_contract` asserted
`relative_time == "16w ago"` for a fixed 2026-05-02 timestamp measured against
the wall clock, so it was correct when written and went red as the distance
grew to 17 weeks. The clock is now frozen at 2026-08-22, which is what the
recorded expectation describes.

Verification: pytest tests/unit/cli/test_select.py -p no:randomly — 21 passed;
devtools verify --quick — exit 0.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_014BQsaB1NBY8mTR6yZByfMA
`_archive_index_targets` resolved `.index-active-pointer` and only then
refused to touch a managed generation. A pointer naming a target outside the
archive root — the state the clone hardening now rejects — therefore raised
`ArchiveLocationError` instead of the refusal written for exactly that case,
so `ops reset --index` reported an internal error rather than telling the
operator to promote a replacement. The refusal reads the pointer's presence,
never its target, so it now runs first.

The session-reset fixture placed its active generation outside the archive
root, a layout the archive no longer permits; it now sits under
`.index-generations/`, where managed generations live. The test still proves
that reset follows the pointer rather than the root-level index.db.

Verification: pytest tests/unit/cli -p no:randomly — 7 failed, 2864 passed,
down from 19 failures on master; devtools verify --quick — exit 0.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_014BQsaB1NBY8mTR6yZByfMA
The fixture placed its index generation beside the archive root, a layout the
clone hardening now refuses, so the test raised `ArchiveLocationError` before
reaching what it asserts. The generation now sits under `.index-generations/`,
which still keeps it out of the root's top-level `index.db` — the distinction
the test exists to prove.

Verification: pytest tests/unit/cli -p no:randomly — 6 failed, 2865 passed,
down from 19 failures on master; devtools verify --quick — exit 0.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_014BQsaB1NBY8mTR6yZByfMA
@Sinity Sinity changed the title fix(cli): list the find marker and describe context in root help fix(cli): repair thirteen of master's red CLI tests Aug 29, 2026
@Sinity
Sinity merged commit 0ffd12c into master Aug 29, 2026
3 checks passed
@Sinity
Sinity deleted the fix/root-help-marker-row branch August 29, 2026 15:33
Sinity added a commit that referenced this pull request Aug 29, 2026
## Summary

Repairs eight of master's nineteen red CLI tests — the four help/alias
ones and
four fixture/expectation ones — by fixing what they were reporting.
Together
with #4419 (five delete-path tests) the selection goes 19 → 6.

## Problem and solution

**Root help omitted `find`.** `ROOT_COMMAND_ROLE_SECTIONS` declares it
first
among the search workflows, but `format_commands` skips any entry
`get_command` cannot resolve — and `find` is the query marker the
dispatcher
consumes, deliberately not a registered command. Help taught
`find QUERY then ACTION` in prose while omitting `find` from the list of
commands it introduces. A declared marker help now renders the row
through
Click's own short-help derivation, so it truncates on the same column
budget as
its neighbours. `find` stays out of `cli.commands`; dispatch and
completion are
unchanged.

**`context` rendered blank.** `_LazyCommand.get_short_help_str` does not
import
the module — staying lazy is the point — so a lazily-registered command
shows
whatever short help the registration table declares. `context` declared
none.

**`fable-packet --format`** lacked the `-f` alias the flag-alias
contract
requires.

**`ops reset --index` raised instead of refusing.**
`_archive_index_targets`
resolved `.index-active-pointer` and only then refused to touch a
managed
generation. A pointer naming a target outside the archive root — the
state the
clone hardening rejects — therefore produced `ArchiveLocationError`
rather than
the refusal written for exactly that case. The refusal reads the
pointer's
presence, never its target, so it now runs first.

**Two fixtures placed a managed generation outside the archive root**, a
layout
the archive no longer permits. They now sit under `.index-generations/`,
which
still keeps them out of the root's top-level `index.db` — the
distinction those
tests exist to prove.

**One relative-time expectation** was measured against the wall clock:
`"16w
ago"` for a fixed 2026-05-02 timestamp went red as the distance grew to
17
weeks. The clock is now frozen at what the expectation describes.

## Verification

uv run pytest tests/unit/cli -p no:randomly # 6 failed, 2865 passed
    uv run devtools verify --quick                # exit 0

Master fails 19 in that selection.

Snapshots were regenerated, not hand-edited. The only content change is
`context` gaining its description; the `find` row matches the text the
snapshot
already expected.

## Residual

Six failures remain, deliberately untouched and classified on
polylogue-4g1is:
three depend on ambient environment (a live daemon, a real pty, a
database
path), and two are policy questions — cost estimate status
(polylogue-e60z5)
and whether a tiny `--max-tokens` budget should clip inside every
segment or
drop and account for one. Correcting those tests to match current output
would
encode whichever behaviour happens to exist, so they are left red.

The three help modules pass in a fixed order but one fails under
`pytest-randomly` when run together — a pre-existing isolation defect,
not a
help-rendering one.

---------

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Sinity added a commit that referenced this pull request Aug 29, 2026
…#4425)

## Summary

Correcting my own change in #4420. That fixture built the copy shape —
real
durable files with only the index pointing away — which
`archive_identity`
refuses, because such a pointer resolves into the archive the copy was
made
from. I moved the index inside the root to make it pass, which fixed the
symptom and removed the external index the test exists for.

An out-of-root pointer is admitted as a symlink farm: every durable tier
is a
symlink out alongside the index. The fixture now builds that, so the
test is
about an external index again.

Anti-vacuity: make any durable tier a real file and the pointer is
refused
with `active index pointer target is outside configured archive root`,
which
is the copy-versus-farm distinction the production code draws.

Verification: pytest the named test — passes; devtools verify --quick —
exit 0.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_014BQsaB1NBY8mTR6yZByfMA

Related: polylogue-cqv1a records the same guard colliding with the
reindex canary's split-root contract.

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Sinity added a commit that referenced this pull request Sep 1, 2026
## Summary

Repairs eight of master's nineteen red CLI tests — the four help/alias
ones and
four fixture/expectation ones — by fixing what they were reporting.
Together
with #4419 (five delete-path tests) the selection goes 19 → 6.

## Problem and solution

**Root help omitted `find`.** `ROOT_COMMAND_ROLE_SECTIONS` declares it
first
among the search workflows, but `format_commands` skips any entry
`get_command` cannot resolve — and `find` is the query marker the
dispatcher
consumes, deliberately not a registered command. Help taught
`find QUERY then ACTION` in prose while omitting `find` from the list of
commands it introduces. A declared marker help now renders the row
through
Click's own short-help derivation, so it truncates on the same column
budget as
its neighbours. `find` stays out of `cli.commands`; dispatch and
completion are
unchanged.

**`context` rendered blank.** `_LazyCommand.get_short_help_str` does not
import
the module — staying lazy is the point — so a lazily-registered command
shows
whatever short help the registration table declares. `context` declared
none.

**`fable-packet --format`** lacked the `-f` alias the flag-alias
contract
requires.

**`ops reset --index` raised instead of refusing.**
`_archive_index_targets`
resolved `.index-active-pointer` and only then refused to touch a
managed
generation. A pointer naming a target outside the archive root — the
state the
clone hardening rejects — therefore produced `ArchiveLocationError`
rather than
the refusal written for exactly that case. The refusal reads the
pointer's
presence, never its target, so it now runs first.

**Two fixtures placed a managed generation outside the archive root**, a
layout
the archive no longer permits. They now sit under `.index-generations/`,
which
still keeps them out of the root's top-level `index.db` — the
distinction those
tests exist to prove.

**One relative-time expectation** was measured against the wall clock:
`"16w
ago"` for a fixed 2026-05-02 timestamp went red as the distance grew to
17
weeks. The clock is now frozen at what the expectation describes.

## Verification

uv run pytest tests/unit/cli -p no:randomly # 6 failed, 2865 passed
    uv run devtools verify --quick                # exit 0

Master fails 19 in that selection.

Snapshots were regenerated, not hand-edited. The only content change is
`context` gaining its description; the `find` row matches the text the
snapshot
already expected.

## Residual

Six failures remain, deliberately untouched and classified on
polylogue-4g1is:
three depend on ambient environment (a live daemon, a real pty, a
database
path), and two are policy questions — cost estimate status
(polylogue-e60z5)
and whether a tiny `--max-tokens` budget should clip inside every
segment or
drop and account for one. Correcting those tests to match current output
would
encode whichever behaviour happens to exist, so they are left red.

The three help modules pass in a fixed order but one fails under
`pytest-randomly` when run together — a pre-existing isolation defect,
not a
help-rendering one.

---------

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Sinity added a commit that referenced this pull request Sep 1, 2026
…#4425)

## Summary

Correcting my own change in #4420. That fixture built the copy shape —
real
durable files with only the index pointing away — which
`archive_identity`
refuses, because such a pointer resolves into the archive the copy was
made
from. I moved the index inside the root to make it pass, which fixed the
symptom and removed the external index the test exists for.

An out-of-root pointer is admitted as a symlink farm: every durable tier
is a
symlink out alongside the index. The fixture now builds that, so the
test is
about an external index again.

Anti-vacuity: make any durable tier a real file and the pointer is
refused
with `active index pointer target is outside configured archive root`,
which
is the copy-versus-farm distinction the production code draws.

Verification: pytest the named test — passes; devtools verify --quick —
exit 0.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_014BQsaB1NBY8mTR6yZByfMA

Related: polylogue-cqv1a records the same guard colliding with the
reindex canary's split-root contract.

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
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