Skip to content

Add typed action approval executor#15

Open
ThinkOffApp wants to merge 1 commit into
mainfrom
ether/typed-action-executor
Open

Add typed action approval executor#15
ThinkOffApp wants to merge 1 commit into
mainfrom
ether/typed-action-executor

Conversation

@ThinkOffApp

Copy link
Copy Markdown
Owner

Adds the typed /actions/* approval lane for broad CodeWatch-button-gated actions.

What:

  • POST /actions/request validates structured action requests and creates a normal approval intent.
  • GET /actions/{nonce} returns typed action status/receipt.
  • First executor: merge_pr for allowlisted ThinkOffApp repos only (antfarm, xfor, codewatch-site) with base main validation.
  • Deny/expire/failure receipts are recorded; approval triggers executor from the daemon side.

Validation performed locally:

  • node --check src/confirmations.mjs
  • Local HTTP smoke test: request -> pending receipt -> deny -> denied receipt.

Note: I could not write the live /Users/petrus/ide-agent-kit checkout from the family user, so this is a reviewable PR for the live MacBook/daemon checkout to pull.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a0133e918e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/confirmations.mjs
throw new Error(`action nonce already exists: ${nonce}`);
}
const prompt = actionPrompt(normalized);
const intentId = await createIntent({

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Register actions before announcing approval

When the announcement publishes an actionable approval message, createIntent waits for announce before this function inserts the action into actions. If the user taps Approve while the announcement is still in flight, decideIntent finds no action for that intent and only marks the intent decided; after this call resumes, the action is stored as pending and the executor never runs, so GET /actions/{nonce} stays pending until expiry. Register the action before exposing the approval, or reconcile immediately if the intent was already decided.

Useful? React with 👍 / 👎.

Comment thread src/confirmations.mjs

function expireAction(nonce, { receiptsPath } = {}) {
const action = actions.get(nonce);
if (!action || TERMINAL_ACTION_STATUSES.has(action.status)) return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Only expire actions that are still pending

After approval, runApprovedAction changes the status to running, but this expiry check only skips terminal states. If expires_at arrives while gh pr view/gh pr merge is still running, the timer or status endpoint records an expired receipt even though the action was already approved and may later flip to merged or failed, corrupting the action audit trail. Expiry should be limited to actions whose status is still pending.

Useful? React with 👍 / 👎.

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