@reefclaw/openclaw-plugin 0.1.34 → 0.1.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +65 -0
- package/bridge/bridge.js +1 -1
- package/bridge/config.d.ts +8 -9
- package/bridge/config.js +39 -74
- package/bridge/gateway/heartbeat-cron.js +1 -1
- package/bridge/gateway/poller.d.ts +26 -4
- package/bridge/gateway/poller.js +19 -2
- package/bridge/heartbeat-transcript.js +25 -1
- package/bridge/providers/connector-update.d.ts +92 -10
- package/bridge/providers/connector-update.js +261 -31
- package/bridge/providers/gateway.d.ts +21 -15
- package/bridge/providers/gateway.js +67 -59
- package/bridge/providers/onboarding-commands.js +3 -3
- package/bridge/utils/skill-version.d.ts +14 -9
- package/bridge/utils/skill-version.js +38 -27
- package/config/brackets-config.js +1 -1
- package/config/plugin-config-io.d.ts +1 -1
- package/config/user-data-stream-config.js +1 -1
- package/connector-supervisor.d.ts +2 -2
- package/connector-supervisor.js +3 -3
- package/index.js +5 -5
- package/live/proposal-decision-listener.d.ts +1 -1
- package/openclaw.plugin.json +2 -2
- package/package.json +2 -2
- package/plugin-version.d.ts +1 -1
- package/plugin-version.js +3 -3
- package/release-notes.json +4 -2
- package/skills/reefclaw/SKILL.md +6 -5
- package/tools/cancel-all-orders.js +1 -1
- package/tools/create-order.js +24 -2
- package/wave9/usdm-evidence-provider.js +9 -1
package/tools/create-order.js
CHANGED
|
@@ -964,6 +964,26 @@ export async function createOrderTool(args, deps) {
|
|
|
964
964
|
}
|
|
965
965
|
return { error: `${wave9Claimed ? 'Wave 9 runtime divergence; daily event latched. ' : ''}${message}` };
|
|
966
966
|
};
|
|
967
|
+
// A refusal that touched nothing at the venue and is NOT a market divergence
|
|
968
|
+
// (an operator config gate, a size/exposure limit, the drawdown zone) hands
|
|
969
|
+
// the capability back instead of burning the day: the account is exactly as
|
|
970
|
+
// the batch projected it, so a fresh authorization for the same candidate is
|
|
971
|
+
// safe once the cause is fixed — the same contract as every other
|
|
972
|
+
// pre-mutation refusal below (mode / venue / activation / readiness /
|
|
973
|
+
// brackets). Ardi report #7 item 0: one pre-trade gate refusal latched the
|
|
974
|
+
// whole daily event and the next window was 24h away.
|
|
975
|
+
const releaseWave9BeforeMutation = (message, code) => {
|
|
976
|
+
if (wave9Lease) {
|
|
977
|
+
deps.wave9AdmissionGuard.abort(wave9Lease, code, { retryable: true, latchEvent: false });
|
|
978
|
+
wave9Lease = undefined;
|
|
979
|
+
}
|
|
980
|
+
return {
|
|
981
|
+
error: `${wave9Claimed
|
|
982
|
+
? 'Wave 9 order refused before any venue mutation; authorization released, daily event NOT latched — ' +
|
|
983
|
+
'fix the cause, then call get_wave9_status for a fresh authorization inside the entry window. '
|
|
984
|
+
: ''}${message}`,
|
|
985
|
+
};
|
|
986
|
+
};
|
|
967
987
|
// From beginEntry onward, every unexpected failure must release the
|
|
968
988
|
// in-flight capability. Explicit geometry/risk divergences still use the
|
|
969
989
|
// latching helper above; infrastructure/pure-computation throws are
|
|
@@ -1067,7 +1087,9 @@ export async function createOrderTool(args, deps) {
|
|
|
1067
1087
|
});
|
|
1068
1088
|
if (!riskCheck.allowed) {
|
|
1069
1089
|
const reasons = riskCheck.violations.map(v => v.message).join('; ');
|
|
1070
|
-
|
|
1090
|
+
// Nothing reached the venue and the account is unchanged: release the
|
|
1091
|
+
// wave9 capability rather than latching the daily event (see helper).
|
|
1092
|
+
return releaseWave9BeforeMutation(`Order REJECTED by risk gate [${riskCheck.drawdownZone} zone]: ${reasons}`, `generic_pretrade_refusal:${riskCheck.violations.map((v) => v.rule).join(',')}`);
|
|
1071
1093
|
}
|
|
1072
1094
|
// ---- Re-entry cooldown gate (mode-laddered; ships 'off') ----
|
|
1073
1095
|
// Generic NEW entries only: wave9 has its own frozen admission policy,
|
|
@@ -1201,7 +1223,7 @@ export async function createOrderTool(args, deps) {
|
|
|
1201
1223
|
// the operator approves and ProposalDecisionListener fires via this same
|
|
1202
1224
|
// tool with proposalManager omitted (which takes the real path below).
|
|
1203
1225
|
//
|
|
1204
|
-
// NOTE the listener's own fire
|
|
1226
|
+
// NOTE the listener's own fire leaves approvalMode unset (defaults to 'off')
|
|
1205
1227
|
// and no proposalManager, so it never re-enters this branch.
|
|
1206
1228
|
if (approvalMode === 'per_trade' && proposalPathWired) {
|
|
1207
1229
|
if (!argsMetadataComplete) {
|
|
@@ -90,8 +90,16 @@ export class BinanceUsdmWave9EvidenceProvider {
|
|
|
90
90
|
const fourHourBars = ohlcvRows(fourHourRaw, `${symbol} 4h`)
|
|
91
91
|
.filter((bar) => bar.time.getTime() >= fromMs && bar.time.getTime() <= eventMs)
|
|
92
92
|
.sort((left, right) => left.time.getTime() - right.time.getTime());
|
|
93
|
+
// Both window edges carry the same jitter tolerance. Binance stamps the
|
|
94
|
+
// PREVIOUS day's boundary settlement a few ms late as routinely as any
|
|
95
|
+
// other (a real 2026-09-18T00:00:00.003Z row blocked three nights of
|
|
96
|
+
// entries — Ardi report #7): with a bare `> fromMs` lower bound that row
|
|
97
|
+
// survives the filter, the list runs one settlement long, and the whole
|
|
98
|
+
// universe is refused as "partial or stale" although every expected
|
|
99
|
+
// settlement is present. A row jittered past the tolerance still fails
|
|
100
|
+
// closed below, exactly like an interior settlement would.
|
|
93
101
|
const fundingRowsInWindow = fundingRows(fundingRaw, symbol)
|
|
94
|
-
.filter((row) => row.time.getTime() > fromMs
|
|
102
|
+
.filter((row) => row.time.getTime() > fromMs + FUNDING_TIME_TOLERANCE_MS
|
|
95
103
|
&& row.time.getTime() <= eventMs + FUNDING_TIME_TOLERANCE_MS)
|
|
96
104
|
.sort((left, right) => left.time.getTime() - right.time.getTime());
|
|
97
105
|
requireExactTimes(dailyBars, expectedDaily, `${symbol} completed 1d evidence`);
|