Skip to content

Structure the confirmation-gated post workflow - #35

Merged
kriptoburak merged 1 commit into
masterfrom
codex/nlpm-command-workflow
Aug 3, 2026
Merged

Structure the confirmation-gated post workflow#35
kriptoburak merged 1 commit into
masterfrom
codex/nlpm-command-workflow

Conversation

@kriptoburak

@kriptoburak kriptoburak commented Aug 3, 2026

Copy link
Copy Markdown
Member

Summary:

  • Convert the multi-phase post command into explicit numbered steps.
  • Keep user approval before every posting tool call.
  • Add a regression test for the approval ordering.

Verification:

  • npm test
  • npm run check:reproducible
  • Current upstream nlpm-check reports clean.
  • git diff --check

This resolves the remaining valid workflow-structure note in the public NLPM audit without pre-approving the write tool or weakening confirmation.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


Summary by cubic

Structured the X post command into a clear, numbered workflow with an explicit approval gate before any xquik call. Adds a regression test to enforce the confirmation-before-post ordering.

  • Refactors
    • Rewrote commands/post.md as a 6-step flow: handle empty text and account, show details and usage, wait for approval, call xquik POST /api/v1/x/tweets, then show tweet ID and link.
    • Added a regression test to lock the approval step preceding the tool call.

Written for commit cc443be. Summary will update on new commits.

Review in cubic

Note

Structure the post command workflow with explicit confirmation gating

Rewrites commands/post.md as a numbered six-step workflow, making the confirmation gate explicit: step 4 requires user approval before step 5 calls POST /api/v1/x/tweets via the xquik MCP tool. Adds a contract test in tests/content-contract.test.mjs asserting the ## Workflow section, the approval step, and the MCP tool step are all present in the doc.

Macroscope summarized cc443be.

Summary by CodeRabbit

  • Documentation

    • Reorganized posting instructions into a clear, numbered workflow.
    • Added explicit connected-account confirmation and approval before publishing.
    • Clarified that successful posts display the tweet ID and link.
  • Tests

    • Added coverage to verify that approval is documented before posting.

@greptile-apps greptile-apps 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.

Your trial has ended. Reactivate Greptile to resume code reviews.

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The posting instructions now use an ordered workflow that confirms the X account and requests approval before calling xquik. A content-contract test verifies the workflow, approval step, and post-approval tool usage.

Changes

Posting workflow

Layer / File(s) Summary
Posting workflow and content contract
commands/post.md, tests/content-contract.test.mjs
The command documents account resolution, preview, usage disclosure, explicit approval, tweet creation, and result display. The test verifies the workflow heading, approval step, and post-approval xquik usage.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

Suggested reviewers: furkanerday

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the structured, confirmation-gated posting workflow added by the pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/nlpm-command-workflow

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

@kriptoburak
kriptoburak merged commit 692932e into master Aug 3, 2026
9 of 10 checks passed

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/content-contract.test.mjs`:
- Around line 24-26: Update the assertions in the workflow command test to
verify ordering, not just presence: ensure the explicit user approval step
appears before the xquik MCP posting step. Use position comparisons or a single
ordered regular expression while retaining the existing workflow assertions.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 96a6af6d-bcf6-4045-9636-8d4a6f5c500b

📥 Commits

Reviewing files that changed from the base of the PR and between 1916c9c and cc443be.

📒 Files selected for processing (2)
  • commands/post.md
  • tests/content-contract.test.mjs

Comment on lines +24 to +26
assert.match(command, /## Workflow/);
assert.match(command, /4\. Wait for explicit user approval\./);
assert.match(command, /5\. After approval, use the `xquik` MCP tool/);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Assert approval ordering explicitly.

These independent assertions pass even when the xquik call appears before approval. Compare the positions of the approval and posting steps, or use one ordered regular expression, so the test protects the confirmation gate.

Proposed test change
-  assert.match(command, /4\. Wait for explicit user approval\./);
-  assert.match(command, /5\. After approval, use the `xquik` MCP tool/);
+  const approvalIndex = command.indexOf("4. Wait for explicit user approval.");
+  const postIndex = command.indexOf("5. After approval, use the `xquik` MCP tool");
+  assert.ok(approvalIndex >= 0);
+  assert.ok(postIndex > approvalIndex);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
assert.match(command, /## Workflow/);
assert.match(command, /4\. Wait for explicit user approval\./);
assert.match(command, /5\. After approval, use the `xquik` MCP tool/);
assert.match(command, /## Workflow/);
const approvalIndex = command.indexOf("4. Wait for explicit user approval.");
const postIndex = command.indexOf("5. After approval, use the `xquik` MCP tool");
assert.ok(approvalIndex >= 0);
assert.ok(postIndex > approvalIndex);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/content-contract.test.mjs` around lines 24 - 26, Update the assertions
in the workflow command test to verify ordering, not just presence: ensure the
explicit user approval step appears before the xquik MCP posting step. Use
position comparisons or a single ordered regular expression while retaining the
existing workflow assertions.

@kriptoburak
kriptoburak deleted the codex/nlpm-command-workflow branch August 3, 2026 00:53
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