Repository navigation
feat: closed-scope member grants, server players and audit log - #2
Merged
Merged
Conversation
A grant may carry a closed list of command types. The agent then accepts only commands in that list and within the grant's role (role ∩ commands). Old agents reject such grants because the schema is strict, so they fail closed.
A key whose grant lists its commands may only follow server status and may change a server's state at most 6 times in 10 minutes. host.info now reports the agent's features so clients can tell whether it supports these grants.
The agent asks its own running servers for their status on localhost (Server List Ping) and adds players online/max and the MOTD to server.status. The status watcher also emits server.status.changed when the player count changes, polling every 30 seconds while someone is subscribed.
A restricted key may say, inside the signed command header, which Discord user it acts for. The agent records server start, stop and restart from any signer in a local audit log (last 5000 entries, 0600) and serves it to admins with agent.audit.list.
codebyant
marked this pull request as ready for review
December 1, 2026 23:26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Lets an owner hand a key a closed set of commands, so a bot can control servers without console, files, mods or backups access.
commands: the agent accepts onlyrole ∩ commands. Old agents reject such grants (strict schema), so they fail closed.server.statusand may change a server's state at most 6 times in 10 minutes.host.inforeportsfeatures(grant_commands,status_players,audit) so clients can tell what the agent supports.server.statusandserver.status.changedinclude players online/max and the MOTD, read with a local Server List Ping; changes in the player count are emitted while someone is subscribed.on_behalf_of). Start, stop and restart from any signer go to a local audit log (audit.jsonl, last 5000,0600), readable by admins withagent.audit.list.v1.1.0-alpha.1points at this branch for consumers.Validation
bun run lint,bun run typecheck,bun run test(581 pass),bun run check:lib.Do not merge before the end-to-end test.