Skip to content

feat(admin): shelf lifecycle + A2A channel admin surface - #153

Merged
jaylfc merged 2 commits into
masterfrom
feat/admin-surface
Jun 11, 2026
Merged

feat(admin): shelf lifecycle + A2A channel admin surface#153
jaylfc merged 2 commits into
masterfrom
feat/admin-surface

Conversation

@jaylfc

@jaylfc jaylfc commented Jun 11, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds 6 admin endpoints behind fail-closed token auth (403 when no server token is configured, 401 on wrong token)
  • Shelf lifecycle: POST /shelves (idempotent create), POST /shelves/{id}/archive (soft-hides vector rows via valid_to, with hidden_by marker for selective restore), POST /shelves/{id}/unarchive (restores only shelf-archive-hidden rows, never resurrects correction-superseded rows)
  • A2A channel admin: POST /a2a/admin/delete-channel (hides from channels/messages feeds), POST /a2a/admin/rename-channel (alias map for redirect + history merge), POST /a2a/admin/supersede-message (hides one message by id)
  • Admin state persisted in data/a2a-admin-state.json via atomic tmp+os.replace; the a2a_feed, a2a_channels, and a2a_send service functions consult it at query time
  • 28 new tests in tests/test_admin_surface.py; full suite 746/746 green

Test plan

  • No-token-configured returns 403 on all 6 admin routes
  • Wrong token returns 401
  • Shelf create idempotence (second create returns created=false)
  • Archive hides rows from /search (mode=bm25, vector-only path)
  • Unarchive restores exactly the shelf-archived rows
  • Unarchive does not restore rows superseded for contradiction reasons
  • expect_empty=true returns 409 when shelf has active rows
  • Channel delete hides from /a2a/channels and /a2a/messages
  • Channel rename redirects sends and merges old history into new name
  • Supersede-message hides one message from /a2a/messages feed

Adds the admin surface per the taOS#774 contract and the long-standing
A2A channel cleanup ask. Six new POST endpoints, all fail-closed behind
the configured server token (403 when no token is set).

Shelf lifecycle: POST /shelves creates or returns an existing shelf
(idempotent by shelf_id, validated against ^[a-z][a-z0-9_-]{0,62}$).
POST /shelves/{id}/archive soft-hides vector rows via valid_to with a
hidden_by:shelf-archive:<ts> metadata marker so unarchive restores only
those rows. expect_empty=true returns 409 when the shelf has active rows.
Archive/unarchive events recorded to the zero-loss archive.

A2A channel admin: delete-channel hides a channel from /a2a/channels and
/a2a/messages feeds; rename-channel adds an alias (sends to old name are
redirected, reads of new name include old history); supersede-message hides
one message by id. State persisted in data/a2a-admin-state.json via atomic
tmp+os.replace writes. The a2a_feed, a2a_channels, and a2a_send service
functions all consult the sidecar at query time.

28 new tests in tests/test_admin_surface.py. Full suite 746 tests green.
@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@jaylfc, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 36 minutes and 44 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more credits in the billing tab to continue.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f6c0c76b-c720-47c4-abdc-6035a8c4bff4

📥 Commits

Reviewing files that changed from the base of the PR and between 18068b6 and 88bf5f5.

📒 Files selected for processing (5)
  • CHANGELOG.md
  • taosmd/admin.py
  • taosmd/http_server.py
  • taosmd/service.py
  • tests/test_admin_surface.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/admin-surface

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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