Skip to content

fix(api): refresh payment and ledger query filters - #102

Merged
thebrandonlucas merged 1 commit into
masterfrom
fix/current-api-filters-current
Oct 23, 2026
Merged

thebrandonlucas merged 1 commit into
masterfrom
fix/current-api-filters-current

Conversation

@sbddesign

@sbddesign sbddesign commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Payment and ledger commands lack query filters exposed by the current public API. Refresh the bundled snapshot and generated references.

Command Added flags
payments list --check-only true or --check-only false (omission includes both)
wallets ledger list WALLET_ID --event-type adjustment (omit for payment entries), --start-date, --end-date

Filters persist across cursor and offset pages. Tests cover omission, both boolean values, invalid values, and multi-page adjustment date filters.

Validation: formatting, Clippy with warnings denied, cargo-machete, full cargo test --locked (143 unit and 126 integration tests), and contract coverage check pass. Whole-package CRAP passes: maximum 19.604615 (wait_for_payment); zero functions at or above 20. Measured 634 functions; 180 functions have zero instrumented lines and remain unmeasured. Scope includes src, build.rs, and tests, using cargo-llvm-cov 0.8.5 and Knots 1.16.0.

Companions: agent skills #10, docs #36. Both target released v0.2.0 and retain direct API fallbacks. These changes are unreleased; no release, merge, deployment, or live payment is included.

Replacement companion: #103. Each PR is independent.

Replaces #99 without rewriting published history. Based on master 8dfa4ee; retains master changelog entries. Original evidence: WORK_LOGS/CLI_RELEASE_SYNC_2026_10_22.md. Fresh integrated validation replaces the old-head results.

Origin: Buzz engineering channel b25e2e33-fcbe-4db7-a726-9a6f7eb4df67, thread 20a1cc5bc38385cb798c5464afeb605cfabb38b8011d14f18219c9f2e42179e4.

Self-review confirms the diff contains only this feature against current master. No live service/payment acceptance or local cross-platform run. CodeRabbit approval is pending; no human review wanted label.

@sbddesign

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@sbddesign sbddesign left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Replacement diff comparison completed against master 8dfa4eedf6fc803d16f798aa3b47f838614b89c4.

For filters #102 (fe97bbe950f1e88c52cb9d0b25b1305c9bfc80d8), compared the replacement tree with git merge-tree --write-tree 8dfa4ee 25eba704. For promotion #103 (16c08ee5fc893d24a19307766653109a1f4a59b7), compared with the merge-tree of 8dfa4ee and 3b0917a. Both comparisons have no differences outside CHANGELOG.md. Each changelog retains master's entries and inserts only its feature entry. Range-diff confirms preservation of the corrected filter guidance and regression.

No new finding from this comparison. The #99 command-contract finding remains closed in #102: omit --event-type for payment entries; explicit payment is rejected. Reviewed the intervening master changes in affected CLI/HTTP paths; no new conflict with the reviewed filter or promotion behavior was identified.

This is a comparison with prior reviews, not a fresh exhaustive review or independent rerun of replacement-head tests/CRAP. Vance records fresh integrated validation in WORK_LOGS/CLI_RELEASE_SYNC_REPLACEMENTS_2026_10_22.md; my independent full-package validation applies to old #99 at 25eba704. CI completion and current-head CodeRabbit approval remain separate gates.

Docs #36 and skills #10 companion descriptions now point to #102/#103. Their released v0.2.0 fallbacks remain unchanged. Both CLI features remain unreleased.

@tee8z tee8z left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved fe97bbe against master 8dfa4ee. Both new filters match the snapshot and backend origin/master c4ca979:

  • check_only is Option<bool> on PaymentParams, and the CLI accepts only true or false. It is offered only on payments list, which is the only public endpoint that takes it. The cursor test shows that it is repeated on every page, which the backend's cursor encoding requires.
  • event_type is a closed set with the single value adjustment, as is the backend's LedgerEventType. Any other value is rejected with exit 2, and a test covers it.
  • No flag is removed or renamed, and src/ is unchanged. The new docs/commands.md column matches the snapshot.

Nonblocking:

  • The description lists --start-date and --end-date as new on wallets ledger list, but the base snapshot already has both. Only event_type is new. The CHANGELOG line is correct.
  • scripts/check-coverage.py builds the new "Query flags" column with its own copy of the flag aliases and the stream_token exclusion from query_flag and is_credential in src/registry.rs. The check compares the doc only with the script's own output, so a new alias in registry.rs would leave the reference wrong. Please note the coupling in both places, or emit the flags from the registry. The description does not mention this change to the generator.
  • docs/guides/wallets.md:41 still says that the ledger lists "every credit, hold, capture, and release", and it does not mention --event-type adjustment, which only requests.md documents.
  • In payment_check_filter_is_optional_and_survives_cursor_pages, the --check-only invalid rejection is inside the for value loop, so it runs three times.

Validation on this head, in nix develop: cargo fmt --check, cargo clippy --locked --all-targets -- -D warnings, cargo machete --with-metadata, cargo test --locked (143 unit, 126 integration) and python3 scripts/check-coverage.py passed. CRAP: 634 measured functions, none at or above 20, highest wait_for_payment at 19.60; 180 functions were unmeasured. CI is green.

@thebrandonlucas
thebrandonlucas merged commit e134cf1 into master Oct 23, 2026
7 checks passed
@thebrandonlucas
thebrandonlucas deleted the fix/current-api-filters-current branch October 23, 2026 12:08
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.

3 participants