Skip to content

fix(miner): delete the orphaned portfolio chat-action duplicate - #8662

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
kai392:fix/critical-issue-orphaned-portfolio-actions
Jul 25, 2026
Merged

fix(miner): delete the orphaned portfolio chat-action duplicate#8662
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
kai392:fix/critical-issue-orphaned-portfolio-actions

Conversation

@kai392

@kai392 kai392 commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Fixes #8640

Root cause

registerPortfolioChatActions, PORTFOLIO_RELEASE_CHAT_ACTION, and PORTFOLIO_REQUEUE_CHAT_ACTION (all exported from packages/loopover-miner/lib/chat-portfolio-actions.ts) have zero non-test callers anywhere in the repo. The live portfolio release/requeue registration already exists in apps/loopover-miner-ui/src/lib/chat-portfolio-queue-actions.ts under the portfolio.release / portfolio.requeue names; the orphaned copy registered the same handlers under the divergent portfolio_release / portfolio_requeue (underscore) names.

Verifying zero non-test callers (run against this branch — empty output):

$ grep -rn "registerPortfolioChatActions\|PORTFOLIO_RELEASE_CHAT_ACTION\|PORTFOLIO_REQUEUE_CHAT_ACTION" --include=*.ts --include=*.tsx . | grep -v node_modules
(no output)

Changes

  • Delete packages/loopover-miner/lib/chat-portfolio-actions.ts and its 100%-covered test test/unit/miner-chat-portfolio-actions.test.ts in full.
  • Correct chat-action-registry.ts's header comment, which claimed all three action families register from packages/loopover-miner, to name the real location: portfolio release/requeue registers from apps/loopover-miner-ui.
  • Add a regression test in the existing apps/loopover-miner-ui chat-action suite asserting the live registration exposes only the dotted portfolio.release/portfolio.requeue names and never the deleted duplicate's portfolio_release/portfolio_requeue underscore variants — so a future reintroduction is caught immediately.

One extra, comment-only touch beyond the listed deliverables: chat-discover-attempt-actions.ts had an illustrative comment naming chat-portfolio-actions.js as a sibling example. I updated only that comment (not the registration, which the issue scopes out) so the PR leaves no dangling reference to the file it deletes.

Coverage

Per the issue: packages/loopover-miner/** is codecov-measured, but this is a deletion-plus-comment-plus-new-assertion PR — it adds no new coverable source lines (the deleted module's lines go away, the two edits are comment-only, and the regression test lives in codecov-ignored apps/**). So codecov/patch has nothing to grade on the diff and stays net-neutral.

Validation

  • apps/loopover-miner-ui chat-action suite: 14 passed (13 existing + the new guard), on a branch rebased onto current main (ee390f51)
  • npm run typecheck clean; tsc -p packages/loopover-miner/tsconfig.json compiles cleanly with the module removed (proving nothing imported it); oxlint clean on the changed files
  • No manifest/config/drift-check references the deleted filename (grepped repo-wide)
  • git diff --check clean

@kai392
kai392 requested a review from JSONbored as a code owner July 25, 2026 23:16
@superagent-security

Copy link
Copy Markdown
Contributor

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

@codecov

codecov Bot commented Jul 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.59%. Comparing base (ee390f5) to head (4b773b9).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8662      +/-   ##
==========================================
- Coverage   93.77%   90.59%   -3.18%     
==========================================
  Files         798       98     -700     
  Lines       79475    22572   -56903     
  Branches    24082     3917   -20165     
==========================================
- Hits        74525    20449   -54076     
+ Misses       3565     1945    -1620     
+ Partials     1385      178    -1207     
Flag Coverage Δ
backend 100.00% <ø> (+4.96%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...ackages/loopover-miner/lib/chat-action-registry.ts 100.00% <ø> (ø)
...oopover-miner/lib/chat-discover-attempt-actions.ts 100.00% <ø> (ø)

... and 699 files with indirect coverage changes

registerPortfolioChatActions (packages/loopover-miner/lib/chat-portfolio-actions.ts)
had zero non-test callers: the live portfolio release/requeue registration lives
in apps/loopover-miner-ui under the portfolio.release/portfolio.requeue names,
while this orphaned copy used the divergent portfolio_release/portfolio_requeue
names. Deletes the dead module and its test, corrects the registry header comment,
and adds a regression test asserting the underscore variants are never registered.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@loopover-orb loopover-orb Bot added gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. gittensor:priority Maintainer-selected Gittensor priority — scores a 1.5x multiplier. labels Jul 25, 2026
@loopover-orb

loopover-orb Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-25 23:22:17 UTC

5 files · 1 AI reviewer · no blockers · readiness 98/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This PR deletes an orphaned duplicate portfolio chat-action registration module (`chat-portfolio-actions.ts`) along with its dedicated test file, updates two comments that referenced the deleted file/its role, and adds a regression test to the live registration (`chat-portfolio-queue-actions.ts`) asserting only the dotted `portfolio.release`/`portfolio.requeue` names are ever registered — never the deleted duplicate's underscore variants. The PR's own grep verification (zero non-test callers of the deleted exports) is consistent with what's shown: the live registration in `apps/loopover-miner-ui` is a separate, independently-implemented module with its own params validator and resolve/match logic, so the deletion removes truly dead code rather than a used dependency. The new regression test is a real, non-fabricated safeguard since it exercises the actual live registration function against real constant names.

Nits — 4 non-blocking
  • The updated `chat-action-registry.ts` header comment (lines 4-8) is now fairly dense with three separate module locations packed into one paragraph; consider a short bullet list for readability, though this is purely cosmetic.
  • The regression test added in `chat-portfolio-queue-actions.test.tsx` duplicates intent with the file's existing `describe("registerPortfolioQueueChatActions...")`-style blocks — could be folded into an existing suite instead of a new top-level `describe`, though keeping it separate does make the fix(miner): registerPortfolioChatActions is a fully-tested, fully-orphaned duplicate of the live portfolio chat-action registration #8640 intent clearer.
  • Consider whether the same underscore-name regression guard should also assert the *shape* of validators (unknown-key rejection) migrated correctly from the deleted module, since some of the deleted file's validator behavior (unknown-key rejection, non-empty-string checks) doesn't appear to have an equivalent assertion for the live module in the visible diff.
  • If `chat-portfolio-queue-resolve.ts` doesn't already have a test asserting `PORTFOLIO_QUEUE_CHAT_RELEASE_ACTION === "portfolio.release"` literally, add one so a future rename can't silently break both the registry and this new regression test's implicit assumption.

Decision drivers

  • ✅ Code review — No blockers (1 reviewer)
  • ✅ Gate result — Passing (No configured blocker found.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ✅ Linked #8640
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 149 registered-repo PR(s), 78 merged, 7 issue(s).
Contributor context ✅ Confirmed Gittensor contributor kai392; Gittensor profile; 149 PR(s), 7 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: moderate
Linked issue satisfaction

Addressed
The PR deletes chat-portfolio-actions.ts and its test file, corrects the chat-action-registry.ts header comment to name apps/loopover-miner-ui as the real portfolio registration location, and adds a regression test asserting only the dotted portfolio.release/requeue names are registered while the underscore variants are absent.

Review context
  • Author: kai392
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: Python, Cuda, JavaScript, Kotlin, Perl, TypeScript, Vue
  • Official Gittensor activity: 149 PR(s), 7 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Keep the PR focused and include validation evidence before maintainer review.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
🧪 Chat with LoopOver

Ask LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @loopover ask &lt;question&gt; answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat &lt;question&gt; answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @loopover mention with a real question is routed to the closest matching read-only command automatically — no exact syntax required.

Full command reference: https://loopover.ai/docs/loopover-commands

🧪 Experimental — new and may change.

Visual preview
Route Viewport Before (production) After (this PR's preview) Diff
/ desktop before /
before /
after /
after /
/ mobile before / (mobile)
before / (mobile)
after / (mobile)
after / (mobile)

Click any thumbnail to open the full-size screenshot. Before = production · After = this PR's preview deploy.

Scroll preview
Route Before (production) After (this PR's preview)
/ before / (scroll)
before / (scroll)
after / (scroll)
after / (scroll)

A short scroll-through clip (desktop) — click either thumbnail to open the full animation. Evidence for scroll-linked behavior a single screenshot can't show.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.

  • Re-run LoopOver review

@loopover-orb loopover-orb Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LoopOver approves — the gate is satisfied and CI is green.

@loopover-orb
loopover-orb Bot merged commit 1cc2146 into JSONbored:main Jul 25, 2026
8 checks passed
@github-actions github-actions Bot mentioned this pull request Jul 26, 2026
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. gittensor:priority Maintainer-selected Gittensor priority — scores a 1.5x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(miner): registerPortfolioChatActions is a fully-tested, fully-orphaned duplicate of the live portfolio chat-action registration

2 participants