Skip to content

test: harden CLI and daemon status contracts - #2787

Merged
Sinity merged 8 commits into
masterfrom
feature/fanout/test-hardening
Jul 12, 2026
Merged

Sinity merged 8 commits into
masterfrom
feature/fanout/test-hardening

Conversation

@Sinity

@Sinity Sinity commented Jul 12, 2026 •

Copy link
Copy Markdown
Owner

Summary

Test-only hardening across CLI status/query, daemon health/status, and three formerly mock-heavy operator/maintenance suites.

Problem

The selected suites depended on foreign-internal mocks or omitted high-risk CLI and daemon error paths. The original PR wording overstated completion because no fresh full-suite coverage measurement establishes the Beads numeric targets.

Solution

  • Use a native source-tier ChatGPT payload plus persisted schema packages for operator inference, promotion, registry list/compare, and audit paths.
  • Use DbFactory-created archives for planner preview, dry-run, filtering, and caller-vs-ambient archive routing.
  • Exercise malformed projection input, real loopback daemon status success and malformed-snapshot recovery, daemon health JSON failure exits, expensive tier selection, and status debt rendering.

Acceptance criteria

Bead Status Evidence / residual work
polylogue-n4hb Deferred to polylogue-n4hb All three nominated files now use archive/registry infrastructure and focused tests pass. Equal-or-better coverage is not yet complete: real with-samples promotion selection and several former audit/listing edge contracts need durable infra fixtures.
polylogue-c52g Deferred to polylogue-c52g Adds query projection validation and real status success/unavailable branches. A fresh full-suite coverage report is still required before claiming the roughly 83 percent target for both CLI files.
polylogue-znwj Deferred to polylogue-znwj Adds health JSON success/error and expensive-tier branches plus status split-store/cursor rendering. A fresh full-suite coverage report is still required before claiming the daemon CLI/status targets.

Anti-vacuity

  • Operator inference exercises raw source-tier sampling, clustering, promotion, persisted manifest paths, provider-scoped/global registry enumeration, comparison, and audit. Removing these archive/registry paths changes the asserted outputs. The privacy test deliberately protects the typed normalizer only; it does not claim end-to-end generation propagation.
  • Planner tests exercise preview and dry-run against DbFactory-created empty-session debt, including a caller archive distinct from the empty ambient archive. Removing config routing or native debt counting changes row/result assertions.
  • Projection tests exercise the public parser; malformed budgets, booleans, duplicate keys, and aliases fail or normalize differently if validation changes.
  • Status tests run actual loopback HTTP routes; bypassing daemon JSON handling or liveness recovery changes their output.
  • Health tests execute the Click command’s JSON exit and expensive-tier branches; changing the error exit or tier selection fails them.

Verification

  • POLYLOGUE_PYTEST_BASETEMP_ROOT=/realm/tmp/polylogue-pytest nix develop --command devtools test tests/unit/core/test_operator_inference.py — 4 passed in 15.54s.
  • POLYLOGUE_PYTEST_BASETEMP_ROOT=/realm/tmp/polylogue-pytest nix develop --command devtools test <6 strengthened nodes> — 6 passed in 32.30s.
  • Earlier maintenance conversion verification: devtools test on the three n4hb files — 53 passed in 48.32s.
  • Ruff format/check and focused mypy passed; the current pre-push quick baseline passed.

Ref polylogue-n4hb
Ref polylogue-c52g
Ref polylogue-znwj

Replace selected foreign-internal patches with explicit dependency injection\nand seeded archive records. Cover malformed read projections, the real daemon\nstatus HTTP route, isolated health output, and status evidence rendering.\n\nRef polylogue-n4hb\nRef polylogue-c52g\nRef polylogue-znwj\n\nCo-Authored-By: Claude <[email protected]>
@coderabbitai

coderabbitai Bot commented Jul 12, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

@Sinity, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 3 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: c7d48b48-0217-4a52-bc33-ef2c15daad93

📥 Commits

Reviewing files that changed from the base of the PR and between 901825e and f586496.

📒 Files selected for processing (7)
  • tests/unit/cli/test_query_verbs_runtime.py
  • tests/unit/cli/test_status.py
  • tests/unit/core/test_operator_inference.py
  • tests/unit/daemon/test_daemon_cli.py
  • tests/unit/daemon/test_daemon_status.py
  • tests/unit/maintenance/test_planner_contract.py
  • tests/unit/maintenance/test_planner_filter_narrowing.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/fanout/test-hardening

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 added 2 commits July 12, 2026 23:22
Replace foreign-internal patch seams in the n4hb test cluster with real\nsource-tier records, the on-disk schema registry, and DbFactory-seeded archive\nmaintenance cases.\n\nRef polylogue-n4hb\n\nCo-Authored-By: Claude <[email protected]>
The real registry includes bundled v1 schemas, so promotion creates v2 and\nthe subsequent registration creates v3.\n\nRef polylogue-n4hb\n\nCo-Authored-By: Claude <[email protected]>
@Sinity
Sinity marked this pull request as ready for review July 12, 2026 21:27

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6488caa9be

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sinity and others added 4 commits July 13, 2026 00:05
Make the planner-contract test use distinct caller-supplied and ambient
archive roots so fallback-to-ambient regressions fail instead of
passing silently.

Verified: devtools test tests/unit/maintenance/test_planner_contract.py
— 41 passed; ruff format/check passed.

Co-Authored-By: Claude <[email protected]>
Problem: the infrastructure conversion lost provider-scoping, scenario-grouping, and privacy-normalization assertions.\n\nWhat changed: exercise the persisted registry with a second provider and assert the operator privacy normalizer's typed defaults.\n\nRef polylogue-n4hb
Problem: the restored registry assertion fixture used a similarly shaped but incompatible JSON alias.\n\nWhat changed: use the operator request payload type so the focused test also passes the required strict type gate.\n\nRef polylogue-n4hb
Problem: status and daemon health coverage only exercised successful defaults, leaving unavailable status snapshots, nonzero health exits, and the expensive flag unpinned.\n\nWhat changed: use a loopback daemon route for malformed status recovery and assert CLI health error and tier-selection behavior.\n\nRef polylogue-c52g\nRef polylogue-znwj
@Sinity

Sinity commented Jul 12, 2026

Copy link
Copy Markdown
Owner Author

Adversarial review — iteration 1

Findings fixed:

  • polylogue-n4hb: restored provider-scoping, multi-provider scenario, and typed privacy-normalization assertions in the real source-tier/registry path (52b25cd, d058374).
  • polylogue-c52g: added a loopback malformed /api/status plus live /healthz/live route case, proving the CLI reports an unavailable snapshot rather than a stopped daemon (151bea3).
  • polylogue-znwj: added JSON error-exit and --expensive tier-selection contracts for polylogued health (151bea3).

What survived scrutiny: the caller-vs-ambient archive routing fix remains anti-vacuous; the ambient fixture is empty while the supplied config archive is seeded.

Focused verification: POLYLOGUE_PYTEST_BASETEMP_ROOT=/realm/tmp/polylogue-pytest nix develop --command devtools test <6 strengthened nodes> — 6 passed in 32.30s; Ruff and focused mypy passed.

The Beads remain open; this is an iteration record, not a closure claim.

Problem: the infra conversion did not retain manifest persistence or global registry-list assertions.\n\nWhat changed: assert persisted manifests, provider-scoped corpus output, family IDs, and global registry enumeration through real schema packages.\n\nRef polylogue-n4hb
@Sinity

Sinity commented Jul 12, 2026

Copy link
Copy Markdown
Owner Author

Adversarial review — iteration 2

Findings:

  • n4hb had lost persisted manifest, provider/scenario, family-ID, and global-list contracts. Restored the stable end-to-end subset in f586496; the source fixture cannot yet exercise matching with-samples promotion, so that residual is explicitly deferred to polylogue-n4hb.
  • The privacy test normalizes the typed payload but does not prove generation propagation. The PR anti-vacuity statement now says exactly that rather than overstating coverage.
  • c52g and znwj have useful new error and flag branches but no fresh full-suite file-level coverage report. Their numeric targets are explicitly deferred to their open Beads; the PR no longer marks them satisfied.

What survived scrutiny: the separate caller/ambient archive test remains anti-vacuous, and the real HTTP and health error/tier paths remain focused-green.

Verification: POLYLOGUE_PYTEST_BASETEMP_ROOT=/realm/tmp/polylogue-pytest nix develop --command devtools test tests/unit/core/test_operator_inference.py — 4 passed in 15.54s; current pre-push quick baseline passed.

@Sinity

Sinity commented Jul 12, 2026

Copy link
Copy Markdown
Owner Author

Adversarial review — iteration 3

No new legitimate gaps found after reviewing the current diff, full Bead ACs, PR body, and comments.

What survived scrutiny:

  • The three nominated n4hb files are infrastructure-backed, and the caller/ambient archive regression remains anti-vacuous.
  • c52g and znwj assertions protect concrete parser, HTTP/liveness recovery, Click exit, health-tier, and status-rendering branches.
  • The prior inline review is obsolete: the caller archive is now distinct from the ambient fixture root.

Borderline already disclosed: privacy normalization is tested at the normalizer boundary, not end-to-end generation forwarding; that residual remains deferred to open polylogue-n4hb. No code change was needed in this convergence iteration.

@Sinity

Sinity commented Jul 12, 2026

Copy link
Copy Markdown
Owner Author

Final acceptance-criteria matrix

Bead AC status Honest disposition
polylogue-n4hb Deferred to polylogue-n4hb All three nominated files were converted to archive/registry-backed tests and focused verification passed. Equal-or-better coverage remains incomplete for matching with-samples promotion, end-to-end privacy forwarding, and some former listing/audit edge contracts.
polylogue-c52g Deferred to polylogue-c52g Added meaningful malformed projection and daemon status success/unavailable paths. The roughly 83 percent file-level coverage target remains unmeasured without a fresh full-suite coverage report.
polylogue-znwj Deferred to polylogue-znwj Added health JSON success/error, expensive-tier selection, and status split-store/cursor branches. The requested daemon CLI/status coverage targets remain unmeasured without a fresh full-suite coverage report.

No Beads were closed or claimed. PR remains open and unmerged.

@Sinity
Sinity merged commit 19f97e3 into master Jul 12, 2026
3 of 13 checks passed
@Sinity
Sinity deleted the feature/fanout/test-hardening branch July 12, 2026 23:28
Sinity added a commit that referenced this pull request Jul 12, 2026
…803,2787,2798

013x (search-coverage, PR #2803) and g9f2 (write-model, PR #2798) fully
satisfied — closed. y8s5 (distribution, PR #2779), ttu (docs-ia, PR #2778),
kwsb (PR #2799), and n4hb/c52g/znwj (test-hardening, PR #2787) partially
satisfied — noted with disposition, left open per closure-discipline.

Co-Authored-By: Claude <[email protected]>
@Sinity

Sinity commented Oct 1, 2026

Copy link
Copy Markdown
Owner Author

Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.

Only the rows listed above are dispositioned. Held findings remain open.

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