Skip to content

test: Repair four CLI-surface tests and file the rest as product defects - #5041

Merged
Sinity merged 4 commits into
masterfrom
triage/cli-output
Sep 14, 2026
Merged

Sinity merged 4 commits into
masterfrom
triage/cli-output

Conversation

@Sinity

@Sinity Sinity commented Sep 14, 2026

Copy link
Copy Markdown
Owner

Triage of the CLI-output share of the 58 failures from the first complete
full-corpus run (job 650). Only 4 of 18 were test problems. The other 14 are
product defects, now on beads.

The lead I was given was wrong, and that mattered

I was told the two convergence debt: assertions were almost certainly asserting
a surface deliberately removed by #5027. They are not stale. The renderer
still emits Convergence debt: at cli/commands/status.py:363/:454/:460, and
the convergence_debt table survives across ~20 modules.

Both tests die before any convergence rendering — on the daemon refusal.
Reproduced without pytest, same workspace both ways:

POLYLOGUE_DAEMON_URL=http://127.0.0.1:1 → "Daemon: running / Status snapshot: unavailable"
(unset)                                 → "Daemon: not running / No archive found."

Fixing polylogue-2d8oq should turn them green with no test change.
Recorded on that bead so it is not re-derived.

Fixed (4)

Test Class Cause
test_query_composition_laws TEST-INFRA The _daemon_delete_route double returned authorization_token; #4867 renamed the contract to authorization_refs. Every other double was already migrated — including the one this test's docstring says it mirrors.
test_paths::test_archive_override_unifies_… STALE-TEST #4955 moved reset behind maintenance.reset; the test asserted the deleted in-process bypass. Now asserts the refusal and that the override still reaches the read-only preview.
test_plain_cli_snapshots::test_json_analyze_snapshot STALE-TEST Snapshot updated — scoped to the single node, recording the terminal outcome field the envelope now carries.
test_maintenance_registration::test_blob_conservation_json_… ORDER-DEPENDENT Verified: passes alone and in a 74-test cross-file selection; fails at directory scope and in the corpus.

Not fixed — 14 product defects, on beads

  • 7 → polylogue-2d8oq (existing): basic_usage_cli ×3, json_envelope_contract ×2, test_json_status_snapshot, test_terminal_snapshots, test_convergence_surface_contract.
  • 5 → polylogue-jih4s (filed): read-only query verbs take an exclusive maintenance ownership lock and mint an auth token into the archive root. Regression from perf: preserve pytest width and share wire receipts #4867.
  • 1 → polylogue-kjy0a (filed): ops status publishes converged: false with reason: "ready" on a pristine empty archive. daemon_status.py:158-162 derives ready and summary from different predicates, and omits determinate — so the converged-vs-unknown collapse from polylogue-bp12n.1 is still live on this path.
  • 1 → polylogue-uf7un (filed): daemon and direct find disagree on the resolved root filter.

#4867 again

1d901ec73 now accounts for 12 of these 18 — 7 via 2d8oq, 5 via jih4s — on
top of the five clusters already attributed to it on polylogue-7lhl5.

Verification

devtools test tests/unit/cli   3040 collected, 12 not-green — every one on a filed bead
devtools verify --quick        15/15 gates, exit 0

One snapshot updated, justified above. No test was written that agrees a
nonexistent daemon is running.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DYUNBGoE652b3nfmq3CtqK

Sinity and others added 4 commits September 14, 2026 07:22
`_daemon_delete_route` in test_query_composition_laws still returned
`authorization_token`, the key `_delete_authorization_refs` read before
1d901ec (#4867) renamed the authorization contract off one-time tokens
onto durable refs. The production reader
(`polylogue/cli/archive_query.py:2198-2211`) now accepts only
`authorization_refs` / `authorization_ref`, so the apply leg refused with
"daemon returned an invalid delete authorization" and the cardinality law
never ran.

Every other double in the suite was already migrated --
test_verb_cardinality.py:820, which this one's docstring says it mirrors,
and test_query_exec_laws.py:2625 -- so this was the single straggler.

Anti-vacuity: `_delete_authorization_refs` still refuses a count mismatch
against the prepared id set, and restoring the `authorization_token` key
makes the test red again.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01DYUNBGoE652b3nfmq3CtqK
`ops reset --blob --yes` no longer deletes in-process: 6be5d2f (#4955),
"Delete CLI direct-writer bypasses and prove daemon sole write authority",
moved the deletion behind the `maintenance.reset` operation, so with no
daemon the verb refuses and exits 1. The test still asserted the removed
bypass (exit 0 plus an in-process deletion).

What this test actually owns is the archive-root override, so it now
asserts the override where it is still observable: the read-only preview
the CLI renders before lowering the intent must name the overridden blob
root, and the refusal must be a refusal -- nothing deleted behind it.

Anti-vacuity: if the override stopped reaching the reset preview the blob
path assertion goes red, and reintroducing a CLI direct-writer reset
bypass makes the refusal assertions red.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01DYUNBGoE652b3nfmq3CtqK
`analyze --format json` now carries the `outcome` envelope field that
CLAUDE.md declares for every row-bearing envelope, decided once at the
operation boundary (`surfaces/outcome.py`, cabba8f / #4810).

The new value is correct rather than a regression: the sibling
`test_json_facets_snapshot` baseline in this same file already carries an
identical `{"state": "ok", "reason": null, "detail": {}}` block and passes,
so `analyze` was the envelope missing the declared field, not the one
growing an undeclared one.

Regenerated with syrupy `--snapshot-update` scoped to this single node so
no other baseline in the file was rewritten.

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

`test_blob_conservation_json_returns_failure_for_a_failed_census` passed
alone and failed inside any wider selection. Two compounding causes.

The command calls `archive_root()` (maintenance/_blob_conservation.py:19)
before the stubbed census runs, and the test pinned no root, so resolution
depended on whatever a previously executed test left in the environment.

That failure was then invisible: `CliRunner().invoke` catches exceptions by
default and reports `exit_code == 1` with empty output, which is exactly
what the test's first assertion expects. The status assertion passed for the
wrong reason and the run died one line later on
`json.loads('')` -> JSONDecodeError. `catch_exceptions=False` makes
`exit_code == 1` mean the command's own `Exit(1)` again.

Verification: tests/unit/cli (3040 tests) -- green before this change only
when the file ran alone, green at directory scope after it.

Anti-vacuity unchanged and now load-bearing: returning directly after the
JSON output, instead of raising `Exit(1)`, still makes the test red.

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

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Sep 14, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 2feb6423-8a6b-4514-ae4e-561661c7fc9c

📥 Commits

Reviewing files that changed from the base of the PR and between 9545818 and 381ef1b.

📒 Files selected for processing (4)
  • tests/unit/cli/__snapshots__/test_plain_cli_snapshots.ambr
  • tests/unit/cli/test_maintenance_registration.py
  • tests/unit/cli/test_paths.py
  • tests/unit/cli/test_query_composition_laws.py

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
Sinity merged commit 6b60dcf into master Sep 14, 2026
3 checks passed
@Sinity
Sinity deleted the triage/cli-output branch September 14, 2026 05:30
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