feat: request changes on workspace review requests

SA
14m ago
+587-41

Issue for this PR

No GitHub issue: the next step of workspace review (#1685, #1716, #1751). An owner or admin can now send a member's skill, knowledge base or rule proposal back with a required comment, instead of rejecting it. The member resends it or withdraws it. Backend: AltimateAI/altimate-backend#7880.

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

  • Skills and knowledge sent back (changes_requested).
    • The member is notified once, like any decision. The TUI shows a warning toast with the reviewer and comment: "Changes requested on your skill "X" by Y — reason. Change it and send it again with altimate-code skill publish."
    • altimate-code workspace review status lists it as "changes requested by : ", with a line on how to send it again.
    • It can be withdrawn, from /rules or serve, as a waiting request can.
  • Rule proposals sent back.
    • /rules opens a sent-back proposal with "Send a new wording" (the prompt shows what the reviewer asked) and "Withdraw the proposal". A waiting proposal can be withdrawn too. A sent-back retirement can only be withdrawn.
    • A resent rule is open right away: counted, withdrawable, and in the author's sessions.
    • A pull already on its way can't bring back a proposal withdrawn or replaced from this machine, or overwrite its record (closed_locally, pruned after 10 minutes).
    • A rule the author replaced or withdrew isn't shown as closed by its reviewer.
    • Acting on a rule needs rules state pulled with the credential signed in now, the same check the list uses.
  • Claude Code and Codex sessions are told about requests sent back, in the same notice block as other decisions. Rules: "sent back for changes … (it can be reworded or withdrawn from /rules in the TUI)".
  • serve: POST /altimate/rules/:id/withdraw and POST /altimate/rules/:id/resubmit, and rule requests carry their version and actions. The extension doesn't use the rule routes yet.
  • Docs: configure/skills.md (requests sent back), configure/learn.md (rewording and withdrawing a rule from /rules).

How did you verify your code works?

  • Unit: new tests in test/altimate/workspace/review.test.ts (decision notices, status listing, host context, "rule proposals sent back for changes"), test/cli/tui/rules-requests.test.ts, test/server/altimate-rules-routes.test.ts and test/altimate/rules/my-pending.test.ts (the "closed here" race). bun run typecheck is clean, and the marker guard (analyze.ts --markers --strict) passes.
  • Wider suites: test/altimate/workspace, test/cli/tui, test/altimate/rules and the server route tests have 1,906 passing tests. One test fails, datamate_manager write that races the link, the same way it does on a clean main checkout.
  • End to end against a local backend and web app (screenshots below):
    • The owner sent back a skill and a rule. On the member's next start, one warning toast named both, with the comments.
    • workspace review status showed the sent-back skill and the resend hint. skill publish sent it again.
    • In /rules, resending the same wording was refused, and a new wording was sent for review. Withdraw closed the proposal.
  • Independent review: found the resent-rule state gap, the pull race, the account check and the retirement wording. All are fixed in the last commit.

Known limits (follow-ups)

  • Withdrawing or resending from another machine or the web isn't picked up here. This machine's /rules keeps showing the old status until that proposal leaves the open list. The same was already true for waiting proposals.
  • Sessions list sent-back rules under the "waiting for review" heading. The heading is shared with waiting proposals; the line itself says "sent back for changes".
  • A sent-back rule whose author left the workspace has no way out. It stays sent back on the server (backend follow-up).

Cost side effects

None. No new polling: sent-back requests arrive through the decision and rules pulls that already run.

Screenshots / recordings

One toast for a rule and a skill sent back/rules: a sent-back proposal
Send a new wording (shows what was asked)Sent

altimate-code workspace review status:

Your review requests in "Review e2e", newest first:
  skill "rc-naming" (new): changes requested by Local Admin: Add a second example covering mart models, then send it again.
    Change the skill, then send it again with `altimate-code skill publish` (or from your IDE).
  skill "rc-naming" (new): replaced by a newer request
  skill "kept-check" (update): approved by Local Admin

🤖 Generated with Claude Code


Summary by cubic

Owners and admins can now send a member's skill, knowledge base, or rule proposal back with a required comment instead of rejecting it. The member is notified once and can revise and resend the request, or withdraw it.

New Features

  • changes_requested status on skill and knowledge requests: a warning toast with the reviewer's comment, a "changes requested" entry in workspace review status with resend instructions, and withdrawable.
  • /rules lets an author reword a rule proposal sent back for changes or withdraw it; a waiting proposal can be withdrawn too.
  • A resent rule is open right away — counted, withdrawable, and shown in the author's sessions — and a pull already in flight won't bring back a proposal closed from this machine.
  • A sent-back rule retirement can only be withdrawn; acting on a rule requires rules state pulled with the signed-in credential.
  • Claude Code and Codex sessions get a notice for sent-back requests, and serve gains POST /altimate/rules/:id/withdraw and POST /altimate/rules/:id/resubmit for clients.
  • Docs for skills and learn configuration updated.

Summary by CodeRabbit

  • New Features
    • Rule proposals returned for changes can now be edited and resubmitted or withdrawn from the rules workflow.
    • Skills and knowledge-base requests returned for changes can be withdrawn or resubmitted. Review notices and status details show the reviewer’s reason and next steps.
  • Bug Fixes
    • Withdrawn or replaced proposals stay closed in the local list, even when an earlier sync is still in progress.