feat(agent): make next-action recommendations repo-specific#30
Merged
JSONbored merged 6 commits intoMay 29, 2026
Merged
Conversation
Weave language fit, label overlap, queue size, and prior outcome counts into per-repo whyThisHelps / nextActions. Add publicNextActions for sanitized GitHub surfaces so counts stay private. Stop priorityFor from penalizing cleanup_first for the open_pr_pressure blocker that triggered the recommendation in the first place. Closes #16.
grnlemon
force-pushed
the
feat/decision-pack-repo-specific-recommendations
branch
from
May 29, 2026 01:19
249d779 to
71bf866
Compare
added 2 commits
May 29, 2026 03:44
recommendationText now distinguishes cleanup_existing_prs, land_existing_prs, file_issue_discovery, and maintainer-lane action kinds again (falling through to per-repo nextActions only as a last resort). whyThisHelpsFor / nextActionsFor / publicNextActionsFor gain a split-lane arm so AC #4 covers all four lanes. Drop dead code in RepoCopyContext and labelFit, unify the defensive ?. on profile.github.
Add split-lane and avoid_for_now fixtures. Add maintainer-vs-outside separation test (same outcome.openPullRequests surfaces in cleanup copy, not maintainer copy). Add end-to-end buildContributorDecisionPack test so a regression in languageSet threading fails. Replace the noop /\b8 open PR/ guard with a structural noStructuralCountLeak check applied across all 5 recommendation tiers. Tighten the orchestrator integration assertion to require per-lane phrasing. Strengthen the determinism test to also assert priorityScore and nextActions equality.
JSONbored
requested changes
May 29, 2026
JSONbored
left a comment
Owner
There was a problem hiding this comment.
PR #30 - feat(agent): make next-action recommendations repo-specific
Signal: REQUEST CHANGES
Required changes:
- Fix branch coverage drop: CI reports 94.94% branches, below 95%.
- Add tests for languageMatch false/true, labelFit empty/non-empty, publicNextActions for every recommendation type, and cleanup_first priority without open_pr_pressure penalty.
- Keep private numeric lane/share reasoning out of publicNextActions.
- Re-run validate after branch tests are added.
- Expect possible conflicts with #26 because both modify decision-pack and agent-orchestrator.
Push branches over the 95% gate (94.94 -> 95.03). New cases: - languageMatch true/false and labelFit empty/non-empty paths. - cleanup_first triggered via openPullRequests >= 3 (no open_pr_pressure blocker) still outranks pursue baseline. - scoreBlockersFor with outcome undefined exercises the nullish guards. - whyThisHelpsFor / nextActionsFor cleanup_first + watch (split lane) with outcome undefined. - withSnapshotMetadata falls back to nowIso when both generatedAt fields are absent. - publicNextActions sanitization asserted for every recommendation tier: no decimals, no share/emission/priority words, no field-name leaks.
Contributor
Author
|
Thanks for the review. Addressed each item in
Pushed to the same branch. |
5 tasks
Contributor
Author
|
@JSONbored could you please review the update again? |
…ions Signed-off-by: ghost <49853598+JSONbored@users.noreply.github.com>
Contributor
Author
|
Thank you! |
8 tasks
16 tasks
This was referenced Jul 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #16.
Summary
buildRepoDecisionnow receives the contributor'slanguageSet+labelHistoryand computes per-repolanguageMatch(fromsyncState.primaryLanguage∩profile.github.topLanguages) andlabelFit(fromrepo.registryConfig.labelMultipliers∩profile.registeredRepoActivity.dominantLabels).whyThisHelpsFor/nextActionsForrewritten as per-recommendation helpers taking aRepoCopyContext. Direct-PR copy names matching language + label overlap + queue size + prior merged count. Issue-discovery copy names the lane + open-issue count. Cleanup-first copy names the contributor's open PR count. Maintainer-lane copy uses repo-owner framing only.publicNextActionsForemits a sanitized variant (no raw counts) for GitHub-public surfaces.RepoDecision+DecisionActiongainpublicNextActions: string[]; orchestrator'spublicSafeSummarynow pulls fromdecision.publicNextActions[0].recommendationTextnow prefersaction.nextActions[0](the new per-repo copy) over the hardcoded action-kind fallback, so the API/MCP "recommendation" headline is also concrete.priorityForexempts theopen_pr_pressureblocker from thecleanup_firstpenalty calc — fixes an ordering inversion where acleanup_firstrepo with one critical blocker was outscored by a comparablepursuerepo. AC feat(scoring): add situational score projections #3 (cleanup-first outranks new work) now holds end-to-end.Acceptance criteria → coverage
whyThisHelps[0]/nextActions[0]reference repo + lane + concrete signals; asserted in fixtures for direct-PR, issue-discovery, maintainer-lane.nextActionsandpublicNextActionseven whenoutcome.openPullRequests = 8.pressure.priorityScore > pursueRepo.priorityScorewith the priorityFor fix.repoDecisions+topActionsordering (snapshot regression test).Public/private boundary
nextActions,whyThisHelps) may include raw counts (open PR count, merged PR count, open issue count, queue size).publicNextActions) deliberately omits counts and contributor history numerics; regression test asserts no digits appear inpublicNextActions[0]for issue-discovery and maintainer-lane fixtures.actionFromDecisionAction.publicSafeSummarynow sources frompublicNextActionsinstead ofnextActions, closing the prior leak path (sanitizePublicSummaryonly redacts wallet/reward words — not digits).Validation
npm run typechecknpx vitest run test/unit test/integration— 270 tests passnpx vitest run --config vitest.workers.config.ts— workers suite greennpm run changelog— refreshed CHANGELOG.md (single entry added)Safety
publicNextActionsaudited to avoid leaking countsContributorDecisionPackSchemaper-decision shape isz.record(z.unknown())— additive, no schema break)Relationship to #15 / PR #26
PR #26 (issue #15) touched
freshness/ serving helper and is on a separate branch. This PR touchesbuildRepoDecision/ per-recommendation copy /priorityFor/ orchestrator publicSafeSummary. Surfaces overlap (decision-pack.ts,agent-orchestrator.ts, the same test files) but at different functions; expect a rebase-clean merge if PR #26 lands first.Open questions for review
priorityForadjustment: I exempted theopen_pr_pressureblocker only whenrecommendation === "cleanup_first". Alternative: raise the cleanup_first base from 75 → 105 (clamped at 100) — same effect for most repos. Exemption is the more defensible choice but happy to flip.labelFitsource: I usedrepo.registryConfig.labelMultipliers ∩ profile.dominantLabels. Could also bedominantLabelsdirectly. Open to either.