feat(miner): add config-gated chat action-dispatch scaffolding - #6542
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6542 +/- ##
==========================================
+ Coverage 95.81% 95.82% +0.01%
==========================================
Files 589 592 +3
Lines 47049 47169 +120
Branches 14962 14989 +27
==========================================
+ Hits 45079 45199 +120
Misses 1176 1176
Partials 794 794
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-16 13:08:03 UTC
Review summary Nits — 5 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk 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.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 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.
|
62eab3a to
2eee81b
Compare
2eee81b to
48d1618
Compare
Adds the shared, disabled-by-default dispatch layer that any chat-issued miner action must route through, ahead of the three action-family child issues (portfolio release/requeue, governor pause/resume, discover/attempt). Two new modules under packages/loopover-miner/lib/: - chat-action-dispatch.js: the single dispatch entry point. Checks the LOOPOVER_MINER_CHAT_ACTIONS flag first (fail closed: on only for the exact enable value), rejects unknown actions, and runs the registered params-validator before invoking a handler. It adds no second safety check of its own -- the fail-closed enforcement stays in the engine chokepoint reached via governor-chokepoint.js. - chat-action-registry.js: the allowlist registry plus a governorGatedHandler() factory. Registration structurally rejects any handler not produced by that factory, so a chat action can never bypass the Governor chokepoint. Ships with zero actions registered. Both files are outside src/**, so they are not Codecov patch-gated; every branch is still covered by hand (flag-off short-circuit, unknown-action, params-validator pass/fail/throw, wrapped-accepted vs unwrapped-rejected, and an empty-registry regression guard). Closes JSONbored#6519
48d1618 to
b6bb59f
Compare
Summary
packages/loopover-miner/lib/chat-action-dispatch.js— the single dispatch entry point. Checks theLOOPOVER_MINER_CHAT_ACTIONSflag first (fail closed: enabled only for the exact enable value; unset/empty/true/1/ENABLEDall read as off), rejects unknown actions, and runs the action's registered params-validator before invoking its handler. It adds no second safety check — the fail-closed enforcement stays inpackages/loopover-engine/src/governor/chokepoint.ts, reached throughpackages/loopover-miner/lib/governor-chokepoint.js.packages/loopover-miner/lib/chat-action-registry.js— the allowlist registry plus agovernorGatedHandler()factory. Registration structurally rejects any handler not produced by that factory (a private, non-forgeable brand), so a chat action can never register a handler that bypasses the Governor chokepoint. Ships with zero actions registered.vite-*-api.tsis added, and the chokepoint files (chokepoint.ts,governor-chokepoint.js,pretooluse-hook.js) are only called — never modified.apps/loopover-miner-ui/**is untouched.*.d.tscompanions follow the existing directory convention (every siblinglib/*.js— includinglocal-store.js,governor-chokepoint.js,portfolio-queue.js— ships one; roottsc --noEmitrequires them).Scope
type(scope): short summaryConventional Commit format.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Closes #6519).Validation
git diff --checknpm run typechecknpm run test:coverage— new tests pass; the two new files sit outsidesrc/**so they are notcodecov/patch-gated, but every branch is covered by hand: 100% statements / branches / functions / lines on both files (measured unsharded over the two new suites).npm run test:miner-pack— package file allowlist accepts the four newlib/files.npm run miner:env-reference:check— no drift (the flag is read via a computed member access, not a trackedenv.NAMEreference).npm audit --audit-level=moderate— 0 vulnerabilities.evaluateGovernorChokepointGatedefault path, and an empty-registry regression guard.If any required check was skipped, explain why:
ui:lint/ui:typecheck/ui:build),test:mcp-pack,test:workers, andui:openapi:checkare not affected — this change adds two plain library modules underpackages/loopover-miner/lib/with no UI, MCP, worker, or OpenAPI surface.Safety
UI Evidence
Not applicable — no UI, frontend, docs, or extension changes. This is a backend-only library module under
packages/loopover-miner/lib/.Notes
PreToolUsepath.Closes #6519