Skip to content

feat(mcp): agent-native pre-submission self-check as a general product (#693) - #712

Merged
JSONbored merged 1 commit into
mainfrom
feat/agent-native-self-check
Jun 14, 2026
Merged

feat(mcp): agent-native pre-submission self-check as a general product (#693)#712
JSONbored merged 1 commit into
mainfrom
feat/agent-native-self-check

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

What

Lets any AI coding agent on any repo run "will this PR pass the gate?" from the repo's public .gittensory.yml — no Gittensor account needed (#693, Pillar 6).

  • buildPredictedGateVerdict is now pack-aware (policy-pack-pluggable gate (gittensor + oss-anti-slop packs) #692): under the oss-anti-slop pack it drops the confirmed-contributor gate (blocks any author, mirroring gateCheckPolicy); under gittensor it keeps it. The verdict surfaces pack. Backward-compatible — default pack is gittensor, so existing behavior is unchanged (the existing feat(miner): pre-submission gate prediction on the local branch (self-gate) #688 neutral-for-non-confirmed test still holds).
  • New MCP tool gittensory_predict_gate — the agent-native surface: given a planned PR ({login, owner, repo, title, body?, labels?, linkedIssues?}), it loads the public manifest + cached repo/issues/PRs and returns the predicted verdict. Self-scoped via requireContributorAccess (a session can only predict for its own login). Works on an app-installed-but-unregistered (non-Gittensor) repo under oss-anti-slop.

Acceptance (#693)

non-gittensor repo + agent run the self-check via MCP; verdict matches what the maintainer's gate would compute.

✅ Under oss-anti-slop, the verdict blocks any author (matches the real oss-anti-slop gate); under gittensor, a non-confirmed contributor stays neutral (matches the real gittensor gate). Both via MCP, computed from public config only.

Why

The two-sided general product from Pillar 6: the maintainer installs the gate (#692), the agent calls the MCP self-check here. Output is public-safe (sanitized, basis public_config). Builds entirely on the #688 predicted-gate engine + the #692 pack — no new gate logic.

Tests

  • predicted-gate.test.ts: pack-aware prediction — oss-anti-slop blocks a self-declared non-confirmed contributor; gittensor keeps it neutral; runs on an app-installed-but-unregistered repo record; pack surfaced + defaults to gittensor.
  • mcp-predict-gate.test.ts: tool returns a verdict from public config on an unregistered repo (oss-anti-slop → failure), minimal-args path, and self-scope rejection ("authenticated GitHub login").
  • 97% coverage gate green; workers tests + git diff --check + ui:openapi:check pass.

Advances Pillar 6 (#704). Closes #693. Remaining: #694 (funnel non-gittensor adopters → gittensor miners).

#693)

Lets any AI coding agent on ANY repo run "will this PR pass the gate?" from the
repo's PUBLIC .gittensory.yml — no Gittensor account needed.

- `buildPredictedGateVerdict` is now pack-aware (#692): under the `oss-anti-slop`
  pack it drops the confirmed-contributor gate (blocks any author, mirroring
  gateCheckPolicy); under `gittensor` it keeps it. The verdict surfaces `pack`.
  Backward-compatible — default pack is gittensor, so existing behavior is
  unchanged.
- New MCP tool `gittensory_predict_gate` (the agent-native surface): given a
  planned PR, loads the public manifest + cached repo/issues/PRs and returns the
  predicted verdict. Self-scoped via requireContributorAccess. Works on an
  app-installed-but-unregistered (non-Gittensor) repo under `oss-anti-slop`.

Acceptance: a non-Gittensor repo + agent run the self-check via MCP and the
verdict matches what the maintainer's gate would compute (oss-anti-slop blocks
any author; gittensor stays neutral for a non-confirmed contributor).

Tests: pack-aware prediction (oss-anti-slop blocks a non-confirmed author;
gittensor stays neutral; unregistered-repo-record path), MCP tool (verdict from
public config on an unregistered repo; minimal-args path; self-scope rejection).
97% coverage gate green; workers tests pass.
@ghost

ghost commented Jun 14, 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 #712 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 14, 2026
@superagent-security

Copy link
Copy Markdown
Contributor

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

@ghost

ghost commented Jun 14, 2026

Copy link
Copy Markdown

gittensory · advisory review

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

Suggested action: 🛠️ Request changes. (reviewers split: request changes / merge) Address the suggestions below before merging.

Reviewer A · gpt-oss-120b — recommends 🛠️ request changes
This PR adds a new MCP tool for agents to predict Gittensory gate outcomes based on public config and makes the gate verdict logic pack‑aware. The changes include schema definitions, server registration, implementation, and corresponding tests.

Suggestions

  • Define predictGateShape and predictGateOutputSchema as Zod objects (e.g. z.object({ ... })) rather than plain objects, so z.infer works and the server receives proper schemas.
  • Update the registerTool calls to pass the Zod object schemas after fixing them.
  • Consider adding a unit test for the error case when requireContributorAccess blocks a different login (already covered, but ensure the error message is stable).

Worth double-checking

  • TypeScript compilation will fail because the current schema objects are not Zod schemas.
  • If the schema fix is not applied, the tool may not validate inputs correctly at runtime.

Reviewer B · nemotron-3-120b-a12b — recommends ✅ merge
This PR adds a new MCP tool gittensory_predict_gate for agent-native pre-submission self-checks, allowing users to predict whether a planned PR would pass a repo's Gittensory gate using only public configuration. The implementation includes input/output schemas, a new server method, pack-aware logic in the gate verdict function, and comprehensive unit tests. The changes respect the public/private boundary by using sanitized outputs and avoid forbidden terms. The code is clean, well-tested, and follows existing patterns.

Suggestions

  • Consider adding a test case for the gittensor pack with a confirmed contributor to ensure the gate behaves as expected (though existing tests cover non-confirmed contributor).
  • The blockers and warnings fields in predictGateOutputSchema use z.unknown(); if the internal structure is known (array of objects with code/message), a more specific schema could improve type safety (though not required for correctness).
  • Ensure PREDICTED_GATE_NOTE constant (used in verdict) is verified to not contain any forbidden terms (though likely safe as it's reused from existing gate logic).

@ghost ghost added the gittensory-review label Jun 14, 2026
@JSONbored
JSONbored merged commit ffe2417 into main Jun 14, 2026
10 checks passed
@JSONbored
JSONbored deleted the feat/agent-native-self-check branch June 14, 2026 12:01
@github-project-automation github-project-automation Bot moved this from Todo to Done in gittensory - v1 roadmap Jun 14, 2026
@github-actions github-actions Bot mentioned this pull request Jun 14, 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

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

agent-native pre-submission self-check as a general product

1 participant