Skip to content

feat(agent): add risk-adjusted action portfolio - #219

Merged
JSONbored merged 7 commits into
JSONbored:mainfrom
mkdev5:feat/risk-adjusted-action-portfolio
Jun 2, 2026
Merged

feat(agent): add risk-adjusted action portfolio#219
JSONbored merged 7 commits into
JSONbored:mainfrom
mkdev5:feat/risk-adjusted-action-portfolio

Conversation

@mkdev5

@mkdev5 mkdev5 commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add a risk-adjusted action portfolio to contributor decision packs, grouped into cleanup, wait, direct PR, issue-discovery, avoid, and maintainer-lane buckets.
  • Surface portfolio data through API/OpenAPI and scoped agent run/context payloads.
  • Cover deterministic ranking, scenario projections, legacy snapshot fallback, and public/private sanitizer boundaries.

Closes #94

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 (aim for 98%+ branch coverage locally so CI variance does not fail near the threshold)
  • npm run test:workers
  • 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:

  • None. npm run test:ci passed end to end. Local coverage summary: statements 99.02%, branches 97.06%, functions 98.11%, lines 99.62%.

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session changes include negative-path tests.
  • API/OpenAPI/MCP behavior is updated and tested where needed.
  • UI changes use live API data or real empty/error/loading states, not production mock/demo fallbacks.
  • Visible UI changes include screenshots or a short recording.
  • Public docs/changelogs are updated where needed; changelogs are only edited for release-prep PRs.

Notes

  • API/OpenAPI contract: ContributorDecisionPack now includes actionPortfolio; the UI OpenAPI artifact was regenerated.
  • Agent contract: planner run/context payloads include a repo-scoped portfolio for selected decisions.
  • No visible UI behavior changed; screenshots are not applicable.
  • No changelog update, per CONTRIBUTING.md guidance for ordinary feature PRs.

@mkdev5
mkdev5 requested a review from JSONbored as a code owner June 2, 2026 00:30
@dosubot dosubot Bot added the size:L label Jun 2, 2026

@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.

@MkDev11 the portfolio grouping is a useful direction, and the deterministic buckets make the decision pack easier to reason about.

A few notes:

  • CI is green on the branch.
  • The branch is now stale against current main.
  • Conflicts are in src/services/agent-orchestrator.ts and test/unit/decision-pack.test.ts.
  • It also touches apps/gittensory-ui/public/openapi.json; the frontend-touch screenshot rule still needs to be satisfied with actual evidence.

Required changes:

  • Resolve the current merge conflicts.
  • Re-run OpenAPI generation/checks after the conflict fix.
  • Attach screenshot/recording evidence for the frontend-touched surface, or remove the frontend artifact change if it is unnecessary.

Validation expected:

  • Re-run npm run test:ci.
  • Confirm portfolio, orchestrator, and decision-pack tests pass after the rebase.

Resolve conflicts in agent-orchestrator.ts and decision-pack.test.ts by
keeping both the action-portfolio additions (this branch) and the
evidence-graph additions (main) on the context snapshot payload and the
determinism test.
@mkdev5
mkdev5 force-pushed the feat/risk-adjusted-action-portfolio branch from cd6fa61 to d99f4a3 Compare June 2, 2026 06:54
@mkdev5
mkdev5 requested a review from JSONbored June 2, 2026 06:55
@mkdev5

mkdev5 commented Jun 2, 2026

Copy link
Copy Markdown
Contributor Author

@JSONbored fixed the conflicts

@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.

@MkDev11 please fix merge conflicts.

mkdev11 and others added 3 commits June 2, 2026 12:20
@JSONbored
JSONbored dismissed their stale review June 2, 2026 16:41

@MkDev11 no current code changes requested. The branch is clean, CI is green, and the old conflict blocker appears resolved.

@JSONbored
JSONbored merged commit a26727a into JSONbored:main Jun 2, 2026
4 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in gittensory - v1 roadmap Jun 2, 2026
@github-actions github-actions Bot mentioned this pull request Jun 2, 2026
12 tasks
@JSONbored JSONbored added gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. and removed feature gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. 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): add risk-adjusted opportunity portfolio planning

2 participants