Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -397,3 +397,19 @@ describe("formatPortfolioQueueChatResultMessage + MessageList (#6520)", () => {
expect(result.messages[0]?.content).toMatch(/Couldn't determine a portfolio-queue target/i);
});
});

// #8640: the live registration below is the ONLY portfolio release/requeue registration in the repo. The
// deleted packages/loopover-miner/lib/chat-portfolio-actions.ts was a fully-orphaned duplicate that registered
// the same handlers under the `portfolio_release` / `portfolio_requeue` UNDERSCORE names. This guard fails the
// instant that duplicate (or its underscore action names) is reintroduced anywhere the live registration runs.
describe("portfolio chat-action registration is single-sourced (#8640)", () => {
it("registers only the dotted portfolio.release/requeue names, never the deleted duplicate's underscore variant", () => {
const registry = isolatedRegistry();
registerPortfolioQueueChatActions({ registry: registry as never, evaluateGate: allowGate });
const names = registry.names();
expect(names).toContain(PORTFOLIO_QUEUE_CHAT_RELEASE_ACTION);
expect(names).toContain(PORTFOLIO_QUEUE_CHAT_REQUEUE_ACTION);
expect(names).not.toContain("portfolio_release");
expect(names).not.toContain("portfolio_requeue");
});
});
9 changes: 6 additions & 3 deletions packages/loopover-miner/lib/chat-action-registry.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
// Allowlist registry + governor-gated handler contract for chat-issued miner actions (#6519).
//
// Shared scaffolding ONLY: this module ships with ZERO registered actions. The three action-family child
// issues (portfolio release/requeue, governor pause/resume, discover/attempt) register their handlers into
// this registry -- none are added here, and the default `chatActionRegistry` instance starts empty.
// Shared scaffolding ONLY: this module ships with ZERO registered actions. The action families register their
// handlers into this registry -- none are added here, and the default `chatActionRegistry` instance starts
// empty. Governor pause/resume and discover/attempt register from packages/loopover-miner; portfolio
// release/requeue registers from apps/loopover-miner-ui (chat-portfolio-queue-actions.ts) under the
// `portfolio.release` / `portfolio.requeue` names -- #8640 deleted an orphaned duplicate of that family that
// had lived here in packages/loopover-miner under the divergent `portfolio_release` / `portfolio_requeue` names.
//
// The registration contract is the safety boundary. `register` refuses any handler that was not produced by
// `governorGatedHandler()`, and `governorGatedHandler()` routes every invocation through
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
// (vite-discover-api.ts:13-14), so the CLI has none and the route adds none.
// Re-evaluating the chokepoint here would therefore be a SECOND, competing gate on a path that already has
// one (or needs none) — exactly what those route comments rule out, and it would gate chat more strictly than
// the equivalent CLI invocation. So, like chat-governor-actions.js and chat-portfolio-actions.js, we satisfy
// the equivalent CLI invocation. So, like chat-governor-actions.js (#8640 deleted the orphaned miner-side
// chat-portfolio-actions.js; portfolio release/requeue now registers from apps/loopover-miner-ui), we satisfy
// the registry's `governorGatedHandler` brand with an allow-stage evaluateGate. Execution still stays behind
// the shared LOOPOVER_MINER_CHAT_ACTIONS flag via `dispatchChatAction`, and `evaluateGate` stays injectable.

Expand Down
100 changes: 0 additions & 100 deletions packages/loopover-miner/lib/chat-portfolio-actions.ts

This file was deleted.

178 changes: 0 additions & 178 deletions test/unit/miner-chat-portfolio-actions.test.ts

This file was deleted.

Loading