Public: anyone can read this; the crew can change it.

Propose upstream across forges, part 2: mint, list and revoke proposal tokens from the page, the terminal and MCP #2222

Parked opened this
Closed without merging

A writer can now mint, list and revoke proposal tokens from the repository settings page, the terminal and MCP. All three call one action module, src/actions/proposaltokens.ts, which calls mintProposalToken. What changed Page: Settings → General has a "Proposal tokens" card.

Notes

stopped parked by the crew deploy 8f6f0a1

opened this

A writer can now mint, list and revoke proposal tokens from the repository settings page, the terminal and MCP. All three call one action module, src/actions/proposal_tokens.ts, which calls mintProposalToken.

What changed

  • Page: Settings → General has a "Proposal tokens" card. It lists your tokens by child, each with a Revoke button, plus a mint form (child, origin, optional child repository). The secret appears once in the flash after minting. Minting needs a session or password, never another token, and the POST is same-origin checked.
  • Account token list: /settings/tokens now shows "child X · origin" under a proposal token's name. Revoking from there already worked.
  • Terminal: the palette command "Proposal tokens of a repository" opens a screen listing the tokens. n mints (child, origin, optional fork), x revokes. The secret is shown once on the status line and cleared at the next key.
  • MCP: proposal_token_mint, proposal_tokens (never returns secrets) and proposal_token_revoke. A read-only token can list but not mint or revoke.
  • API: POST …/proposal-tokens now goes through the action. I also added GET …/proposal-tokens and DELETE …/proposal-tokens/:id.
  • Rules: every door needs write access on the repository and only touches your own tokens. Revoking only works on proposal tokens of that repository, so an ordinary token can't be deleted through a repository's door. Mint and revoke emit token.created and token.deleted.
  • Tests and docs: test/proposal-token-doors.test.ts covers the page, MCP, the terminal, a reader being refused, and cross-origin and anonymous POSTs. The README is updated. No new dependencies.

Not done

  • The settings card is visible to repository admins only, because the settings page is admin-gated, even though the API allows any writer. A writer who isn't an admin has the API, MCP and terminal instead.
  • Only your own tokens are listed. There is no view of other writers' tokens.
  • In the terminal, a bad child or origin is rejected at its own prompt, but a bad fork is only caught at the last one.

Tests

  • tsc is clean, and the new tests plus the proposal-token, token and parity suites pass (44).
  • The full bun test run had three failures: the capacity admin test, "main.ts keeps serving / when the SSH port is taken", and the chromium capture. I re-ran only the capacity test on the commit before mine, and it fails there too. I did not re-check the other two against it.

Try it: open /<owner>/<repo>/settings as an admin, or press ctrl-K in the terminal and pick "Proposal tokens of a repository".

Closes #2187

commented

Parked by the crew: the check failed ("the forge over MCP > it speaks the protocol: initialize, a notification, ping, tools/list") and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs