Skip to content

Remove inbound removal endpoint; converge membership on boot#129

Merged
AquiGorka merged 2 commits into
mainfrom
chore/remove-removal-notify-push
Jun 24, 2026
Merged

Remove inbound removal endpoint; converge membership on boot#129
AquiGorka merged 2 commits into
mainfrom
chore/remove-removal-notify-push

Conversation

@AquiGorka

Copy link
Copy Markdown
Contributor

What

Removes the inbound POST /api/v1/council/removed notice endpoint added in #127 (it inverted the pull model and added an unauthenticated inbound surface), and moves removal-honouring fully onto the pull path.

How

Removed:

  • src/core/service/council-notify/ (handle-removal.ts + its test)
  • tests/integration/http/council-removed.test.ts
  • the POST /council/removed route; buildCouncilRouter is an empty router again.

Pull-path verification (with the endpoint gone):

  • Watcher demotes on provider_removed → REJECTED via deactivateMembership — already true, unchanged.
  • Bundle submission refuses a removed membership — already true: resolveChannelContext throws "no active membership" via getActiveForPp (channel-resolver.ts:108), unchanged.
  • Boot converge-by-query for MEMBERSHIP was MISSING — only channel-status converged on boot; a removal during downtime relied on retention-bound event replay. Added convergeMembershipStatusesOnBoot: on boot, query each council's authoritative /public/provider/membership-status and demote on 404 via the same deactivateMembership path. Env-free + unit-tested. This is the sibling of the existing channel-status boot convergence — pull direction (provider→council), no inbound surface.

Tests

Full suite locally on pinned deno 2.8.2: fmt --check, lint, check src/main.ts, CI pay-test job (116), test:unit (132, incl. 4 new boot-converge tests), test:integration (99) — all green.

local-dev lifecycle e2e (deploy → pay → on-chain remove_provider) against this branch: passed (exit 0). On provider (re)boot the membership is demoted ACTIVE→REJECTED via the boot converge-by-query (proven by the live DB transition; the on-chain watcher start even failed on the restart, so the converge backstop alone demoted it — exactly its purpose), with no notify endpoint in the path; post-demotion there are 0 active memberships so the bundle gate refuses new submissions.

Version: 0.9.4 → 0.9.5 (standalone bump commit).

Coordination

Lands with council-platform (removes the outbound push) and provider-stack (removes the matching inbound endpoint).

The council→provider push (POST /api/v1/council/removed) inverted the
pull model and added an unauthenticated inbound surface. Remove it and
move removal-honouring fully onto the pull path.

Removed:
- src/core/service/council-notify/ (handle-removal.ts + its test)
- tests/integration/http/council-removed.test.ts
- the POST /council/removed route; buildCouncilRouter is empty again.

Pull-path verification (with the endpoint gone):
- Watcher already demotes to REJECTED on provider_removed
  (deactivateMembership) — unchanged.
- Bundle submission already refuses a removed membership: resolveChannel
  context throws "no active membership" via getActiveForPp — unchanged.
- Boot converge-by-query for MEMBERSHIP was MISSING (only channel-status
  converged on boot; a removal during downtime relied on retention-bound
  event replay). Added convergeMembershipStatusesOnBoot: on boot, query
  each council's authoritative membership-status and demote on 404 via the
  same deactivateMembership path. Env-free + unit-tested.
@AquiGorka AquiGorka force-pushed the chore/remove-removal-notify-push branch from d315cbe to 2f83be5 Compare June 24, 2026 11:02
@AquiGorka AquiGorka merged commit c2cfaf6 into main Jun 24, 2026
7 checks passed
@AquiGorka AquiGorka deleted the chore/remove-removal-notify-push branch June 24, 2026 11:17
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