Skip to content

fix: specs correctness and comprehensive test coverage#12

Draft
Koan-Bot wants to merge 3 commits into
atoomic:masterfrom
Koan-Bot:koan.atoomic/specs-fixes-and-tests
Draft

fix: specs correctness and comprehensive test coverage#12
Koan-Bot wants to merge 3 commits into
atoomic:masterfrom
Koan-Bot:koan.atoomic/specs-fixes-and-tests

Conversation

@Koan-Bot

@Koan-Bot Koan-Bot commented Mar 25, 2026

Copy link
Copy Markdown
Contributor

What

Fix two bugs in API specs and add 41 tests for previously untested core functionality.

Why

  • prokect_id typo in Network specs silently broke server-side filtering by project ID
  • Compute v2_1 had a delete section using getfromid type, generating a GET method for what should be a DELETE — dead code that would misbehave if ever wired up
  • The specs method generation system and Listable filtering logic (including regex) had zero test coverage

How

  1. Fixed typo prokect_idproject_id in Network v2 specs
  2. Removed the broken delete spec from Compute v2_1 (the real delete_server in Compute.pm handles deletion correctly with floating IP cleanup)
  3. Added t/specs-and-filtering.t with 41 tests covering: regex/multi-criteria/empty filtering, getfromid response unwrapping, query_filters_for validation, Routes dispatch, and error handling

Testing

Full test suite passes: 7 files, 64 tests (was 23 before this PR).

🤖 Generated with Claude Code


Quality Report

Changes: 3 files changed, 415 insertions(+), 11 deletions(-)

Code scan: clean

Tests: passed (OK)

Branch hygiene: clean

Generated by Kōan post-mission quality pipeline

Koan-Bot and others added 3 commits March 25, 2026 06:48
The ports query filter spec listed 'prokect_id' instead of 'project_id',
preventing server-side filtering by project ID from working.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The delete section defined a 'delete_server_from_uid' method using
'getfromid' type, which generates a GET request — not a DELETE. This
method was also unreachable through Routes (not registered in the
route table), making it dead code that would behave incorrectly if
ever wired up.

The actual delete_server method in Compute.pm handles deletion with
proper floating IP cleanup and is the correct implementation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add 41 tests covering previously untested functionality:

- Listable regex filtering (single match, multi match, no match)
- Multi-criteria filtering with AND semantics
- Filtering resilience when fields are missing on candidates
- getfromid single-key response unwrapping behavior
- getfromid multi-key response passthrough
- Specs query_filters_for validation (valid, invalid, mixed keys)
- query_filters_for edge cases (odd args, empty, unknown routes)
- Network service server-side query filter propagation
- Routes::list_all() coverage
- Error handling in query_filters_for

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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