Skip to content

feat: Python SDK packaging, API filtering standard, audit guide, ticketing integration - #751

Merged
Ayinkx merged 4 commits into
AyinkxLab:mainfrom
johnvin489-cloud:feat/phase12-sdk-filters
Nov 22, 2026
Merged

Ayinkx merged 4 commits into
AyinkxLab:mainfrom
johnvin489-cloud:feat/phase12-sdk-filters

Conversation

@johnvin489-cloud

Copy link
Copy Markdown
Contributor

Summary

Four Phase 11/12 items: Python SDK packaging and gate coverage, a filtering/sorting standard for the public v1 API, an audit and compliance guide, and a ticketing integration that opens a Jira or Linear issue when a high-risk finding is acknowledged.

Closes #656
Closes #648
Closes #642
Closes #630

What changed

#656 Python SDK packaging

  • sdk/python/ already existed on main (typed client, API-key auth, configurable base URL, structured errors, mock-server tests); this commit adds the missing packaging/gate coverage instead of duplicating the client.
  • New tests/test_sdk_packaging.py asserts installable pyproject metadata, __version__ consistency, zero runtime dependencies, and the documented pip install -e sdk/python path.
  • sdk/python/README.md now lists the repo gate commands; root ruff/black/pytest already cover the SDK.

#648 Filtering and sorting standard

  • New app/api/filtering.py: per-resource whitelists, sort/order with a documented default (id desc), deterministic id tie-break, structured rejection of unknown fields and unsupported combinations.
  • Applied to app/api/v1.py projects and reviews; usage rejects unsupported parameters.
  • Cursor pagination stays limited to sort=id and returns a structured error otherwise.
  • docs/api-filtering.md, linked from the v1 and API docs.

#642 Audit and compliance guide

  • docs/audit-compliance-guide.md consolidates what is audited, retention and purge, legal hold and deletion, evidence export, and what the evidence pack does and does not certify. It links the existing integrity, retention, classification, evidence and admin-action docs rather than restating them.
  • tests/test_audit_compliance_guide.py checks every documented flask audit command against the real Click tree and the documented endpoints against the URL map, so the guide cannot drift.

#630 Ticketing for security events

  • app/services/security_tickets.py: Jira and Linear providers, credentials stored encrypted through app/services/integration_credentials.py, bounded title/description (200/4000 chars) and a capped 16 KiB request body.
  • app/models/security_ticket.py + migration a3b4c5d6e7f8 with unique (workspace_id, finding_id) and (provider, external_key) constraints for idempotent retries.
  • Wired to PATCH /reviews/api/reviews/findings/<id>: acknowledging a critical/high finding creates or reuses the ticket; a delivery failure rolls the acknowledgement back.
  • New catalog code bad_gateway (502); docs/security-ticketing.md.

Verification

python -m ruff check .                         -> All checks passed
python -m black --check .                      -> 551 files unchanged
pytest (sdk packaging, sdk api, api v1, audit guide, security tickets,
        addressed findings, error catalog)     -> 90 passed
flask --app wsgi db heads                      -> a3b4c5d6e7f8 (head)

Limitations

  • Linear has no native idempotency header; the durable link plus an embedded deterministic key prevent duplicates, but a crash between Linear creating the issue and the link committing could still leave one duplicate on retry.
  • Ticketing is configured through the service (owner only); no admin UI/API route was in scope.
  • Custom sort with a cursor is rejected by design.
  • The full suite was not run (two pre-existing budget/usage-ledger failures on main). tests/test_openapi_generation.py fails on this base for an unrelated case-mismatch in scripts/generate_openapi.py and was left untouched.

@vercel

vercel Bot commented Nov 22, 2026

Copy link
Copy Markdown

@johnvin489-cloud is attempting to deploy a commit to the Ayinkx Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Nov 22, 2026

Copy link
Copy Markdown

@johnvin489-cloud Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Ayinkx
Ayinkx merged commit 3af8957 into AyinkxLab:main Nov 22, 2026
14 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants