feat(scoring): model branch eligibility for issue PRs#178
Conversation
JSONbored
left a comment
There was a problem hiding this comment.
@MkDev11 This needs a rebase before review can move forward. The branch conflicts with current main in the MCP CLI/package files, src/api/routes.ts, and src/signals/local-branch.ts.
The feature direction still makes sense, but the post-MCP-release code has moved enough that I cannot evaluate the branch eligibility behavior that would actually land. Please rebase and rerun the full gate.
d0f009a to
7af62ea
Compare
@JSONbored please check the update again |
JSONbored
left a comment
There was a problem hiding this comment.
@MkDev11 thanks for rebasing this. The earlier conflict blocker looks resolved now.
A few notes:
- The branch eligibility signal is carried through scoring preview, local branch analysis, API/OpenAPI, MCP server, and CLI output.
- The public packet tests still protect against leaking scoreability/reward/trust-style language into public-safe copy.
- CI is green and the merge-tree is clean against current
main.
No code changes requested from this pass.
|
Documentation Updates 1 document(s) were updated by changes in this PR: MCP & Agent IntegrationView Changes@@ -261,6 +261,16 @@
```sh
gittensory-mcp analyze-branch --login yourlogin --json
```
+
+You can optionally pass branch eligibility metadata to model linked-issue assumptions:
+
+```sh
+gittensory-mcp analyze-branch --login yourlogin \
+ --branch-eligibility eligible \
+ --json
+```
+
+The `--branch-eligibility` flag accepts `eligible`, `ineligible`, or `unknown`. Related optional flags include `--branch-eligibility-source`, `--branch-eligibility-reason`, `--branch-eligibility-checked-at`, and `--branch-eligibility-stale`. These flags model branch eligibility for issue-solving PR assumptions in scoring previews.
Or from an MCP client, call `gittensory_preflight_current_branch` with your login:
@@ -531,7 +541,7 @@
| Command | Key Flags | Purpose |
|---------|-----------|---------|
-| `gittensory-mcp analyze-branch` | `--login`, `--repo`, `--base`, `--pending-merged-prs`, `--expected-open-prs`, `--projected-credibility`, `--scenario-note`, `--validation` | Full branch analysis: summary, top action, workspace intelligence, score blockers, preflight status |
+| `gittensory-mcp analyze-branch` | `--login`, `--repo`, `--base`, `--branch-eligibility eligible\|ineligible\|unknown`, `--pending-merged-prs`, `--expected-open-prs`, `--projected-credibility`, `--scenario-note`, `--validation` | Full branch analysis: summary, top action, workspace intelligence, score blockers, preflight status |
| `gittensory-mcp preflight` | Same as above | PR readiness focus: preflight status, PR packet, workspace intelligence |
#### Agent Commands (copilot-only)
@@ -591,7 +601,7 @@
**`gittensory_preview_local_pr_score`**
- **Purpose:** Request a private scoring preview for local diff metadata
-- **Input:** All fields from `localDiffShape` plus optional `sourceTokenScore`, `totalTokenScore`, `sourceLines`, `credibility`, `projectedCredibility`, PR state fields, and `scenarioNotes`
+- **Input:** All fields from `localDiffShape` plus optional `sourceTokenScore`, `totalTokenScore`, `sourceLines`, `credibility`, `projectedCredibility`, PR state fields, `scenarioNotes`, and `branchEligibility` (object with `status`, `source`, `reason`, `checkedAt`, `stale`)
- **Output:** Score estimate with scenario breakdowns, setup guidance if scorer is missing
- **Use case:** Get a private score estimate before opening a PR [[23]](https://github.com/JSONbored/gittensory/blob/1e7506f4c5226d0b9b5da8fcd219309d84bacfcd/packages/gittensory-mcp/bin/gittensory-mcp.js#L212-L219)
@@ -626,6 +636,7 @@
- Optional: `cwd`, `repoFullName`, `baseRef`, `headRef`, `branchName`, `title`, `body`, `labels`, `linkedIssues`
- Scenario fields: `pendingMergedPrCount`, `expectedOpenPrCountAfterMerge`, `projectedCredibility`, `scenarioNotes`
- Validation: array of `{ command, status, summary?, durationMs?, exitCode? }` objects
+- Branch eligibility: optional `branchEligibility` object with `status` ("eligible" | "ineligible" | "unknown"), `source`, `reason`, `checkedAt`, and `stale` fields — models branch eligibility for issue-solving PR assumptions when the standard issue mode is used
**`gittensory_preflight_current_branch`** — PR readiness: preflight status, workspace intelligence, PR packet [[29]](https://github.com/JSONbored/gittensory/blob/1e7506f4c5226d0b9b5da8fcd219309d84bacfcd/packages/gittensory-mcp/bin/gittensory-mcp.js#L290-L305)
|
Summary
Scope
CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm run actionlintnpm run typechecknpm run test:coveragenpm run test:workersnpm run build:mcpnpm run test:mcp-packnpm run ui:openapi:checknpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderateIf any required check was skipped, explain why:
npm run test:cipassed locally. Coverage: statements 98.94%, branches 97.02%, functions 97.83%, lines 99.49%.Safety
Notes
branchEligibilityinput and privatebranchEligibilityresult metadata.