You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(billing): refund/revocation webhooks + Polar ID tracking + MCP role gate (#25)
* feat(billing): refund/revocation webhooks + Polar ID tracking + MCP role gate
* fix(billing): restore _polar_order_id body after merge resolution
* fix: remove blanket member gate (per-tool roles), reject trialing in seat-sync route
* fix(lint): remove duplicate function definitions (ruff F811) + fix trialing seat-update guard
- mcp_server.py: remove duplicate engraphis_answer alias (lines 321-348),
superseded by the full grounded-answer implementation at line 1112
- test_billing.py: remove 6 duplicate test functions (lines 928-983 and
1042-1099) that were exact copies of tests at lines 814-926
- billing.py: fix subscription.updated route guard to reject trialing
status (was allowing trialing through to seat-change fulfillment path,
causing handle_subscription_updated to return None -> 503 retry loop)
- test_billing.py: align assertion with corrected route message
Fixes 9 ruff F811 errors + 2 pre-existing test failures.
All 100 tests pass, ruff clean.
* fix(lint): remove duplicate revoke_by_subscription/revoke_by_order (ruff F811)
The rebase introduced duplicate definitions of revoke_by_subscription (line 459)
and revoke_by_order (line 482) that shadow the more complete versions at lines
531/557 which use context managers and have better docstrings. Remove the
simpler first pair.
Fixes remaining 2 ruff F811 errors in license_registry.py.
* test: add invite_url to team-invite test payloads + missing-invite_url rejection test
* fix(lint): remove remaining duplicate definitions (ruff F811)
- webhooks.py: removed duplicate _extract_subscription_id/_extract_order_id
- license_registry.py: removed blank line from duplicate removal
- mcp_server.py: removed duplicate engraphis_answer tool registration
- test_cloud_license.py: align test payloads with optional invite_url
* fix(mcp): restore engraphis_answer tool registration
The duplicate removal accidentally removed both copies. Restoring the
tool definition that tests expect (test_mcp_server.py, test_agent_connect_mcp.py).
* fix: make invite_url required in team-invite endpoint (test_team_invite_relay_rejects_missing_invite_url expects 400)
* test: add invite_url to all team-invite test payloads (server now requires it)
* test: add invite_url to remaining team-invite payloads (non-team, revoked, daily-cap, queue-failure, idempotency, refund-sanitized)
* fix(billing,mcp): address Codex review — claim_webhook 3-state, order-first revocation, complete_webhook, restore engraphis_answer alias
* fix(merge): deduplicate colliding live edges in merge_workspaces + invite_url tests
- merge_workspaces step 3: check partial unique index before relabeling
source edges; on collision, merge edge_supports into survivor and
expire the duplicate (bi-temporal history preserved)
- test_merge_deduplicates_colliding_live_edges: explicit entity/edge IDs,
verifies one survivor with merged supports + expired duplicate
- test_cloud_license: invite_url added to all team-invite POST bodies;
regression test for missing invite_url (400 + no queue + cap preserved);
7 hostile invite_url attack vectors in parametrized test
* fix(service): relabel expired collision edge to target workspace on merge
* fix(lint): resolve E501 line-too-long in test_workspace_ops.py (ruff)
* fix(merge): merge survivor provenance with transferred edge supports
When a workspace merge finds a duplicate live edge, the source edge's
supports are copied to the survivor but the survivor's provenance
memory_ids were left unchanged. Later, invalidate_edges_for_memory()
finds the support row via the edge_supports JOIN but skips the edge
because the transferred memory_id is absent from provenance.memory_ids.
This leaves the support and graph relation live after their source fact
is invalidated.
Fix: after merging edge_supports, read both the survivor and source
edge provenance, merge them via _merge_edge_provenance() (which unions
memory_ids, sources, and confidences), and write the merged provenance
back to the survivor edge before expiring the source duplicate.
Addresses P1 Codex review finding on PR #25.
* fix(tests): remove duplicate test_merge_deduplicates_colliding_live_edges (F811)
The feature branch carried an older expire-based version of this test
that conflicts with the DELETE-based dedup now on main. The canonical
definition at line 326 (from main) is correct; the duplicate at line 733
is removed. Fixes ruff F811 and the core-floor test failure.
---------
Co-authored-by: sentinel-bot <sentinel@coding-dev-tools.bot>
Co-authored-by: Coding-Dev-Tools <coding-dev-tools@users.noreply.github.com>
Co-authored-by: Hermes Pre-PR Reviewer <agent@cowork-ops.local>
0 commit comments