Skip to content

feat(agent): feed aggregate outcome quality into confidence - #332

Merged
JSONbored merged 2 commits into
JSONbored:mainfrom
Lobster-0429:feat/outcome-quality-confidence
Jun 3, 2026
Merged

feat(agent): feed aggregate outcome quality into confidence#332
JSONbored merged 2 commits into
JSONbored:mainfrom
Lobster-0429:feat/outcome-quality-confidence

Conversation

@Lobster-0429

Copy link
Copy Markdown
Contributor

Summary

  • Feed aggregate repo outcome quality into recommendation confidence in the agent orchestrator
  • aggregateOutcomeQuality() classifies a repo's outside-contributor merge rate into five signals: strong (≥60%), weak (30–60%), high_risk (≤30%), sparse (<5 decided PRs), absent
  • confidenceForDecisionPack() now lowers confidence to "low" for high-risk outcomes and "medium" for weak outcomes; sparse/absent are advisory (no confidence impact, but assumption added)
  • decisionPackEvidence() gains a new aggregate_outcome_quality evidence source with signal-appropriate freshness, warnings, and assumptions — all in the private payload, never in public card text

Closes #304

Scope

  • This PR is focused and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked an issue, or this is small enough that the summary explains why an issue is not needed.

Validation

  • git diff --check
  • npm run actionlint
  • npm run typecheck
  • npm run test:coverage locally; global coverage stays at or above 97% for lines, statements, functions, and branches (Statements 99.08%, Branches 97.1%, Functions 98.37%, Lines 99.66%)
  • npm run test:workers (running in CI — passes on Linux; local Windows environment has pre-existing UV_HANDLE_CLOSING failures in mcp-cli.test.ts unrelated to this change)
  • npm run build:mcp
  • npm run test:mcp-pack
  • npm run ui:openapi:check
  • npm run ui:lint
  • npm run ui:typecheck
  • npm run ui:build
  • npm audit --audit-level=moderate
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries

If any required check was skipped, explain why:

  • Full test:ci chain (actionlint, build:mcp, UI checks) not run locally as they require additional tooling (actionlint binary, UI build chain); these run in CI and are unaffected by the two changed files (src/services/agent-orchestrator.ts, test/unit/agent-orchestrator.test.ts)
  • mcp-cli.test.ts has 12 pre-existing Windows-platform failures (UV_HANDLE_CLOSING assertion in libuv) present on main before this branch; unrelated to these changes

Safety

Introduce aggregate outcome quality signals from repo outcome patterns
into recommendation confidence and evidence in the agent orchestrator.

- Add `aggregateOutcomeQuality()` helper that classifies a repo's
  outside-contributor merge rate as strong (≥60%), weak (30–60%),
  high_risk (≤30%), sparse (<5 decided PRs), or absent
- Feed the signal into `confidenceForDecisionPack()`: high-risk lowers
  to "low", weak lowers to "medium"; sparse and absent are advisory only
- Thread the result into `decisionPackEvidence()` as a new
  `aggregate_outcome_quality` evidence source with per-signal freshness,
  warnings (high-risk/weak), and assumptions (sparse/absent)
- Expose `aggregateOutcomeQuality` via `__agentOrchestratorInternals`
- Add tests for all five signal branches, public sanitizer, and evidence
  shape; all private aggregate quality stays out of public card text

Closes JSONbored#304

@JSONbored JSONbored left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

@web-dev0521 this is ready from my pass.

A few notes:

  • Folding aggregate repo outcome quality into private recommendation evidence makes sense.
  • The confidence lowering for weak/high-risk outcomes is conservative.
  • The public card sanitizer assertion is the right guardrail.

No code changes requested.

Validation expected:

  • Keep the current green CI.

@dosubot dosubot Bot added the lgtm label Jun 3, 2026
@JSONbored
JSONbored merged commit 430976f into JSONbored:main Jun 3, 2026
4 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in gittensory - v1 roadmap Jun 3, 2026
@github-actions github-actions Bot mentioned this pull request Jun 4, 2026
12 tasks
@JSONbored JSONbored added gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. and removed feature labels Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

feat(agent): feed aggregate outcome quality into confidence

2 participants