feat(agent): miner write-tools — local-execution action specs (#780) - #848
Conversation
Phase 2: new MCP write-tools that the miner's OWN local harness runs with its OWN GitHub creds. gittensory supplies the content; the OUTPUT is an action spec (a shell-safe command + structured inputs + the boundary note) — gittensory and this MCP package NEVER perform the write, so source and the write both stay on the miner's machine. - src/mcp/local-write-tools.ts: pure builders for open_pr, file_issue, apply_labels, post_eligibility_comment, create_branch, delete_branch. Each returns a LocalWriteActionSpec with a POSIX-single-quote-escaped command (safe to exec verbatim) + the structured inputs (so the harness can reconstruct its own invocation) + LOCAL_WRITE_BOUNDARY. - src/mcp/server.ts: register the six tools (each clearly labelled local-only) + a thin localWriteSpec wrapper. Tests: every builder (command shape, single-quote escaping, optional draft / labels / base / remote) + the MCP round-trip for all six tools. New code 100% covered; MCP discovery/output-schema meta-tests green; full suite green (2106).
|
Note Gittensory Gate skippedPR closed before full evaluation. No late first comment was created.
💰 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. |
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #848 +/- ##
=======================================
Coverage 96.66% 96.67%
=======================================
Files 106 107 +1
Lines 14495 14538 +43
Branches 5269 5274 +5
=======================================
+ Hits 14012 14055 +43
Misses 105 105
Partials 378 378 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
gittensory · advisory review Reviewed 4 changed file(s) — two independent AI reviewers. Changed files: Suggested action: ✅ Safe to merge — both reviewers found no blocking issues. Reviewer A · Suggestions
Worth double-checking
Reviewer B · Suggestions
Worth double-checking
|
Closes #780
What & why
Phase 2 (#770). New MCP write-tools the miner's own local harness runs with its own GitHub creds. Per the agreed contract: gittensory supplies the content, and the tool's output is an action spec — gittensory and this MCP package never perform the write, so source code and the write both stay on the miner's machine.
Tools
gittensory_open_pr,gittensory_file_issue,gittensory_apply_labels,gittensory_post_eligibility_comment,gittensory_create_branch,gittensory_delete_branch.Each returns a
LocalWriteActionSpec:command— a POSIX single-quote-escaped, directly-runnablegh/gitcommand (safe to exec verbatim — injection-safe against titles/bodies with quotes),inputs— the structured params, so the harness can reconstruct its own invocation instead,boundary— the local-execution contract note.How
src/mcp/local-write-tools.ts— pure, deterministic builders (no GitHub calls, no state).open_prpairs withprepare_pr_packetfor content.src/mcp/server.ts— register the six tools (each labelled local-only) + a thinlocalWriteSpecwrapper.Boundary
gittensory never touches git/GitHub here — it returns a spec the harness executes locally. The no-cloud-write boundary is preserved end to end.
Tests
Every builder (command shape, single-quote escaping, optional draft/labels/base/remote) + the MCP round-trip for all six tools. New code 100% covered; MCP discovery/output-schema meta-tests green; full suite green (2106 passed).