Skip to content

feat(agent): CLI set-level + MCP propose-action — finish the non-dashboard #784 surfaces - #854

Merged
JSONbored merged 1 commit into
mainfrom
feat/agent-784-cli-setlevel-mcp-propose
Jun 18, 2026
Merged

feat(agent): CLI set-level + MCP propose-action — finish the non-dashboard #784 surfaces#854
JSONbored merged 1 commit into
mainfrom
feat/agent-784-cli-setlevel-mcp-propose

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Advances #784 (the remaining CLI + MCP control deliverables; the dashboard slice stays with contributor PR #831).

What & why

With the MCP read tool (#851) and the CLI maintain controls (#852) already merged, this completes the CLI and MCP control surfaces of #784:

CLI — maintain set-level <action> <level> --repo o/r

Sets the autonomy level for one action class. Read-merge-write, so it updates one class without clearing the others; validates action (review/request_changes/approve/merge/close/label) and level (observe/…/auto) against the dial. Wired into the dispatch + completion registry + maintain --help.

MCP — gittensory_propose_action(owner, repo, pullNumber, actionClass, [params])

A maintainer stages a PR action into the approval queue (#779) as auto_with_approval — it never auto-executes; a maintainer accepts/rejects it via the queue. Gated by a new requireRepoManageAccess (maintainer/owner/operator scope) — stricter than the read-only requireRepoAccess; private-token/static identities are trusted.

Scope

This is the CLI + MCP half of #784. The dashboard approval-queue panel is contributor territory (it reuses #831's AuditFeed component + touches the same shell/route files), so it's left for #831's lane. #784 stays open until that lands.

Tests

set-level (merge + validation), propose_action (stages an action idempotently, carries action params, allows an owning-maintainer session, forbids a non-maintainer session, errors when the App isn't installed). New code 100% covered; MCP discovery/output-schema meta-tests green; full suite green (2131). The MCP CHANGELOG regenerates at mcp-release time (not a per-PR gate).

…board #784 surfaces

Completes the CLI + MCP control deliverables of #784 (the dashboard slice stays
with contributor PR #831; this issue is advanced, not finished here):

CLI (packages/gittensory-mcp): maintain set-level <action> <level> --repo o/r —
read-merge-write so one autonomy class is updated without clearing the others;
validates action/level against the autonomy dial; wired into dispatch + completion
+ help.

MCP (src/mcp/server.ts): gittensory_propose_action(owner, repo, pullNumber,
actionClass, [params]) — a maintainer stages a PR action into the approval queue
(#779) as auto_with_approval; it never auto-executes (a maintainer accepts/rejects
via the queue). Gated by a new requireRepoManageAccess (maintainer/owner/operator
scope) — stricter than the read-only requireRepoAccess; private-token/static
identities trusted.

Tests: set-level merge + validation; propose stages an action (idempotent),
carries action params, allows an owning-maintainer session, forbids a
non-maintainer session, and errors when the App is not installed. New code 100%
covered; MCP meta-tests green; full suite green (2131). (MCP CHANGELOG regenerates
at mcp-release time, not per-PR.)
@dosubot dosubot Bot added the size:M label Jun 18, 2026
@ghost

ghost commented Jun 18, 2026

Copy link
Copy Markdown

Note

Gittensory Gate skipped

PR closed before full evaluation. No late first comment was created.

Signal Result Evidence Action
Gate result ⚠️ Skipped #854 is no longer open. No action.

💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.

@ghost ghost added the gittensory:reviewed label Jun 18, 2026
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@codecov

codecov Bot commented Jun 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.70%. Comparing base (41b1598) to head (575c776).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #854      +/-   ##
==========================================
+ Coverage   96.68%   96.70%   +0.01%     
==========================================
  Files         108      108              
  Lines       14621    14642      +21     
  Branches     5290     5299       +9     
==========================================
+ Hits        14137    14160      +23     
+ Misses        105      102       -3     
- Partials      379      380       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ghost

ghost commented Jun 18, 2026

Copy link
Copy Markdown

gittensory · advisory review

Reviewed 5 changed file(s) — two independent AI reviewers.

Changed files: packages/gittensory-mcp/bin/gittensory-mcp.js, src/mcp/server.ts, test/unit/mcp-automation-state.test.ts, test/unit/mcp-cli-maintain.test.ts, test/unit/support/mcp-cli-harness.ts

Suggested action:Safe to merge — both reviewers found no blocking issues.

Reviewer A · gpt-oss-120b — recommends ✅ merge
This PR adds a new MCP tool to stage PR actions for maintainer approval, extends the CLI with a set-level subcommand to adjust autonomy settings, and adds comprehensive tests for the new functionality. The changes are well‑scoped, respect existing access controls, and do not introduce forbidden public content.

Suggestions

  • Consider sanitizing the optional reason field in proposeAction to guard against accidental inclusion of forbidden public terms, even though it is internal.
  • Add a test case for the CLI set-level command when the GET request for settings fails (e.g., 404) to ensure graceful error handling.
  • Document the new gittensory_propose_action tool in the MCP API reference for future maintainers.

Worth double-checking

  • If a session without maintainer access somehow calls proposeAction, it will be rejected, but ensure that any future changes to requireRepoManageAccess keep this check strict.
  • The CLI set-level merges autonomy settings by reading then writing; concurrent updates could race – consider atomic update handling if this becomes a concern.

Reviewer B · mistral-small-3.1-24b-instruct — recommends ✅ merge
The PR adds a new MCP tool and CLI command to propose actions on PRs, including staging actions into an approval queue. The changes are well-structured, with comprehensive tests and clear documentation. The implementation respects the project's conventions and security boundaries.

Suggestions

  • Consider adding a test case for the scenario where the proposeAction function is called with invalid input parameters (e.g., invalid actionClass or missing required fields).
  • Ensure that the proposeAction function handles edge cases, such as when the repository does not exist or the user does not have the necessary permissions.
  • Review the requireRepoManageAccess function to ensure it covers all possible edge cases and security concerns.

Worth double-checking

  • Verify that the new proposeAction tool does not introduce any security vulnerabilities, especially regarding access control and input validation.
  • Ensure that the new CLI command set-level is thoroughly tested for all possible inputs and edge cases.
  • Check that the new functionality does not inadvertently expose any private or sensitive information.

@JSONbored
JSONbored merged commit 2d443a0 into main Jun 18, 2026
21 checks passed
@JSONbored
JSONbored deleted the feat/agent-784-cli-setlevel-mcp-propose branch June 18, 2026 05:12
@github-actions github-actions Bot mentioned this pull request Jun 18, 2026
12 tasks
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