@evomap/evolver-core 2.0.0-beta.9 → 2.0.1
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/dist/algo/antiDistill.js +1 -167
- package/dist/algo/bans.js +1 -33
- package/dist/algo/candidateAssembly.d.ts +7 -2
- package/dist/algo/candidateAssembly.js +1 -205
- package/dist/algo/capabilityCandidates.js +1 -136
- package/dist/algo/confidence.js +1 -196
- package/dist/algo/conversationSniffer.js +1 -149
- package/dist/algo/cycleEngine.d.ts +23 -2
- package/dist/algo/cycleEngine.js +1 -425
- package/dist/algo/cycleFailureClassifier.js +1 -112
- package/dist/algo/epigenetics.js +1 -41
- package/dist/algo/evolutionEvent.js +1 -24
- package/dist/algo/exploration.d.ts +7 -0
- package/dist/algo/exploration.js +1 -55
- package/dist/algo/geneHealth.d.ts +2 -2
- package/dist/algo/geneHealth.js +1 -16
- package/dist/algo/geneIntake.js +1 -128
- package/dist/algo/genePromotion.js +1 -53
- package/dist/algo/geneSelection.d.ts +63 -5
- package/dist/algo/geneSelection.js +1 -246
- package/dist/algo/index.d.ts +2 -0
- package/dist/algo/index.js +1 -20
- package/dist/algo/memoryGraph.js +1 -86
- package/dist/algo/mutation.js +1 -22
- package/dist/algo/orchestrator.d.ts +8 -1
- package/dist/algo/orchestrator.js +1 -75
- package/dist/algo/publishEligibility.d.ts +34 -0
- package/dist/algo/publishEligibility.js +1 -0
- package/dist/algo/solidify.js +1 -63
- package/dist/algo/strategyPresets.js +1 -61
- package/dist/algo/ucb1.d.ts +53 -0
- package/dist/algo/ucb1.js +1 -0
- package/dist/assetstore/assetSidecarRecords.d.ts +7 -2
- package/dist/assetstore/assetSidecarRecords.js +238 -0
- package/dist/assetstore/assetSidecarRecovery.js +2 -2
- package/dist/assetstore/assetStoreHealth.d.ts +6 -0
- package/dist/assetstore/assetStoreHealth.js +56 -14
- package/dist/assetstore/assetStoreStorage.d.ts +1 -1
- package/dist/assetstore/assetStoreStorage.js +27 -9
- package/dist/assetstore/assetSyncLedger.d.ts +86 -0
- package/dist/assetstore/assetSyncLedger.js +683 -4
- package/dist/assetstore/index.d.ts +1 -0
- package/dist/assetstore/index.js +1 -0
- package/dist/assetstore/localAssetStoreSnapshot.d.ts +51 -0
- package/dist/assetstore/localAssetStoreSnapshot.js +329 -0
- package/dist/assetstore/localJsonl.d.ts +4 -2
- package/dist/assetstore/localJsonl.js +89 -9
- package/dist/assetstore/provenance.d.ts +80 -4
- package/dist/assetstore/provenance.js +313 -5
- package/dist/assetstore/provider.d.ts +58 -1
- package/dist/assetstore/provider.js +97 -6
- package/dist/benchmark/antiGeneBenchmark.d.ts +2 -0
- package/dist/benchmark/antiGeneBenchmark.js +1 -251
- package/dist/benchmark/antiGeneImpact.js +1 -34
- package/dist/benchmark/antiGeneRollout.d.ts +2 -0
- package/dist/benchmark/antiGeneRollout.js +1 -268
- package/dist/benchmark/benchmark.js +1 -26
- package/dist/benchmark/evolutionThesisSolver.js +1 -41
- package/dist/benchmark/index.d.ts +2 -1
- package/dist/benchmark/index.js +1 -6
- package/dist/benchmark/selectionFlatAbstention.d.ts +152 -0
- package/dist/benchmark/selectionFlatAbstention.js +1 -0
- package/dist/benchmark/thesis.js +1 -150
- package/dist/benchmark/triggerShift.js +1 -106
- package/dist/bootstrap/envFingerprint.d.ts +9 -0
- package/dist/bootstrap/envFingerprint.js +5 -0
- package/dist/bootstrap/index.d.ts +2 -1
- package/dist/bootstrap/index.js +2 -1
- package/dist/bootstrap/v1EnvCompat.d.ts +111 -0
- package/dist/bootstrap/v1EnvCompat.js +280 -0
- package/dist/cycle/cycleTimeline.js +1 -74
- package/dist/cycle/index.js +1 -2
- package/dist/cycle/stateMachine.js +1 -25
- package/dist/events/eventArchive.d.ts +2 -0
- package/dist/events/eventArchive.js +13 -3
- package/dist/events/eventSchema.d.ts +7 -7
- package/dist/events/eventStore.d.ts +2 -0
- package/dist/events/eventStore.js +5 -1
- package/dist/events/ingest.d.ts +1 -0
- package/dist/events/ingest.js +1 -0
- package/dist/events/paths.d.ts +3 -1
- package/dist/events/paths.js +4 -0
- package/dist/events/public.d.ts +2 -2
- package/dist/events/public.js +2 -2
- package/dist/events/reports.d.ts +2 -0
- package/dist/events/reports.js +4 -0
- package/dist/exec/autoExec.d.ts +43 -2
- package/dist/exec/autoExec.js +76 -9
- package/dist/exec/autonomousCycle.d.ts +22 -4
- package/dist/exec/autonomousCycle.js +64 -13
- package/dist/exec/claudeBridge.d.ts +32 -7
- package/dist/exec/claudeBridge.js +281 -29
- package/dist/exec/prompt.js +5 -1
- package/dist/exec/runnerRegistry.d.ts +68 -26
- package/dist/exec/runnerRegistry.js +307 -72
- package/dist/exec/selfPr.js +1 -7
- package/dist/feedback/envelope.d.ts +61 -0
- package/dist/feedback/envelope.js +168 -0
- package/dist/feedback/index.d.ts +1 -0
- package/dist/feedback/index.js +1 -0
- package/dist/hooks/hooks.js +1 -0
- package/dist/hub/agentDirectory.js +1 -104
- package/dist/hub/assetCallLog.d.ts +35 -1
- package/dist/hub/assetCallLog.js +1 -72
- package/dist/hub/bindings.d.ts +8 -1
- package/dist/hub/bindings.js +1 -110
- package/dist/hub/capability.d.ts +90 -3
- package/dist/hub/capability.js +1 -1
- package/dist/hub/conversationDistiller.js +1 -264
- package/dist/hub/fake.d.ts +2 -2
- package/dist/hub/fake.js +1 -70
- package/dist/hub/hubReview.js +1 -106
- package/dist/hub/index.js +1 -11
- package/dist/hub/ingest.js +1 -15
- package/dist/hub/questionGenerator.d.ts +5 -1
- package/dist/hub/questionGenerator.js +1 -406
- package/dist/hub/reuseDecision.js +1 -127
- package/dist/hub/sanitize.js +1 -322
- package/dist/index.d.ts +3 -1
- package/dist/index.js +4 -1
- package/dist/mailbox/dispatch.d.ts +1 -1
- package/dist/mailbox/dispatch.js +22 -6
- package/dist/mailbox/envelope.d.ts +7 -1
- package/dist/mailbox/envelope.js +9 -2
- package/dist/mailbox/ipcServer.d.ts +10 -2
- package/dist/mailbox/ipcServer.js +163 -13
- package/dist/mailbox/store.d.ts +89 -3
- package/dist/mailbox/store.js +895 -41
- package/dist/material/boundary.js +1 -14
- package/dist/material/consumer.js +1 -55
- package/dist/material/emit.js +1 -52
- package/dist/material/factory.js +1 -25
- package/dist/material/index.js +1 -9
- package/dist/material/materialArchive.js +1 -466
- package/dist/material/materialStore.js +1 -69
- package/dist/material/sampling.js +1 -39
- package/dist/material/sources.js +1 -33
- package/dist/material/watermark.js +1 -76
- package/dist/ops/evolutionGraphProjection.d.ts +20 -0
- package/dist/ops/evolutionGraphProjection.js +315 -0
- package/dist/ops/index.d.ts +2 -1
- package/dist/ops/index.js +2 -1
- package/dist/ops/selfUpdate.d.ts +8 -0
- package/dist/ops/selfUpdate.js +24 -8
- package/dist/personality/drift.js +1 -106
- package/dist/personality/events.js +1 -37
- package/dist/personality/evolveOps.js +1 -93
- package/dist/personality/index.js +1 -11
- package/dist/personality/mutate.js +1 -39
- package/dist/personality/pivot.js +1 -22
- package/dist/personality/prompt.js +1 -62
- package/dist/personality/riskGate.js +1 -80
- package/dist/personality/schema.d.ts +16 -16
- package/dist/personality/schema.js +1 -119
- package/dist/personality/select.js +1 -71
- package/dist/personality/stats.js +1 -82
- package/dist/personality/store.js +1 -92
- package/dist/schema/common.js +1 -17
- package/dist/schema/evolutionGraph.d.ts +784 -0
- package/dist/schema/evolutionGraph.js +1 -0
- package/dist/schema/index.d.ts +1 -0
- package/dist/schema/index.js +1 -5
- package/dist/schema/material.js +1 -50
- package/dist/schema/problem.js +1 -45
- package/dist/schema/proofOfWork.js +1 -9
- package/dist/schema/signal.d.ts +3 -3
- package/dist/schema/signal.js +1 -19
- package/dist/signals/curriculum.d.ts +55 -0
- package/dist/signals/curriculum.js +1 -0
- package/dist/signals/cycleHistoryFromEvents.js +1 -96
- package/dist/signals/expand.d.ts +15 -1
- package/dist/signals/expand.js +1 -125
- package/dist/signals/extractor.d.ts +2 -2
- package/dist/signals/extractor.js +1 -57
- package/dist/signals/index.d.ts +3 -1
- package/dist/signals/index.js +1 -6
- package/dist/signals/metaSignals.d.ts +4 -0
- package/dist/signals/metaSignals.js +1 -158
- package/dist/signals/signalGate.js +1 -40
- package/dist/signals/taskDomain.d.ts +22 -0
- package/dist/signals/taskDomain.js +1 -0
- package/dist/signals/traceSignals.js +1 -123
- package/dist/strategy/constraintAblation.js +1 -3074
- package/dist/strategy/constraintAblationPredicates.d.ts +31 -0
- package/dist/strategy/constraintAblationPredicates.js +1 -0
- package/dist/strategy/experiment.js +1 -63
- package/dist/strategy/index.js +1 -3
- package/dist/strategy/strategyPoint.js +1 -23
- package/dist/trace/index.d.ts +3 -1
- package/dist/trace/index.js +3 -1
- package/dist/trace/learningTrace.d.ts +209 -0
- package/dist/trace/learningTrace.js +276 -0
- package/dist/trace/proxyTurns.d.ts +31 -0
- package/dist/trace/proxyTurns.js +137 -0
- package/dist/verify/sandboxRunner.d.ts +28 -0
- package/dist/verify/sandboxRunner.js +218 -19
- package/dist/verify/sandboxedValidation.d.ts +9 -0
- package/dist/verify/sandboxedValidation.js +113 -13
- package/dist/verify/validation.d.ts +11 -1
- package/dist/verify/validation.js +31 -0
- package/package.json +5 -2
|
@@ -1,61 +1 @@
|
|
|
1
|
-
// Evolution strategy presets (ported from v1 gep/strategy.js). An operator-selectable POSTURE that biases the
|
|
2
|
-
// repair/optimize/innovate/explore mix for a cycle — "harden after a big change", "repair-only emergency",
|
|
3
|
-
// "innovate when stable" — plus a repair-loop threshold. resolveStrategy is pure + fully input-driven (the
|
|
4
|
-
// caller supplies the chosen name, recent signals, and cycle count from env/state); auto-detection picks
|
|
5
|
-
// early-stabilize for the first few cycles and steady-state when saturation signals appear.
|
|
6
|
-
export const STRATEGY_PRESETS = {
|
|
7
|
-
balanced: { name: 'balanced', label: 'Balanced', description: 'Normal operation. Steady growth with stability.', repair: 0.2, optimize: 0.2, innovate: 0.5, explore: 0.1, repairLoopThreshold: 0.5 },
|
|
8
|
-
innovate: { name: 'innovate', label: 'Innovation Focus', description: 'System is stable. Maximize new features and capabilities.', repair: 0.05, optimize: 0.1, innovate: 0.8, explore: 0.05, repairLoopThreshold: 0.3 },
|
|
9
|
-
harden: { name: 'harden', label: 'Hardening', description: 'After a big change. Focus on stability and robustness.', repair: 0.4, optimize: 0.35, innovate: 0.2, explore: 0.05, repairLoopThreshold: 0.7 },
|
|
10
|
-
'repair-only': { name: 'repair-only', label: 'Repair Only', description: 'Emergency. Fix everything before doing anything else.', repair: 0.8, optimize: 0.18, innovate: 0.0, explore: 0.02, repairLoopThreshold: 1.0 },
|
|
11
|
-
'early-stabilize': { name: 'early-stabilize', label: 'Early Stabilization', description: 'First cycles. Prioritize fixing existing issues before innovating.', repair: 0.6, optimize: 0.22, innovate: 0.15, explore: 0.03, repairLoopThreshold: 0.8 },
|
|
12
|
-
'steady-state': { name: 'steady-state', label: 'Steady State', description: 'Evolution saturated. Maintain existing capabilities. Explore for new directions.', repair: 0.55, optimize: 0.25, innovate: 0.05, explore: 0.15, repairLoopThreshold: 0.9 },
|
|
13
|
-
};
|
|
14
|
-
export function strategyNames() {
|
|
15
|
-
return Object.keys(STRATEGY_PRESETS);
|
|
16
|
-
}
|
|
17
|
-
/** Saturation meta-signals that switch auto-detection to steady-state (graceful degradation). */
|
|
18
|
-
const SATURATION_SIGNALS = new Set(['force_steady_state', 'evolution_saturation']);
|
|
19
|
-
/**
|
|
20
|
-
* Meta-signals that mean "stuck repairing / failing — break out by innovating" (ported from v1 strategy.js
|
|
21
|
-
* intent: a repair loop or a high failure ratio should pivot the posture off repair toward new directions).
|
|
22
|
-
* Saturation takes precedence (it wins when both are present, matching v1's steady-state-on-saturation rule).
|
|
23
|
-
*/
|
|
24
|
-
const INNOVATE_PIVOT_SIGNALS = new Set([
|
|
25
|
-
'repair_loop_detected',
|
|
26
|
-
'force_innovation_after_repair_loop',
|
|
27
|
-
'high_failure_ratio',
|
|
28
|
-
]);
|
|
29
|
-
/**
|
|
30
|
-
* Resolve the active strategy preset. Explicit name wins (unknown → balanced). Otherwise auto-detect:
|
|
31
|
-
* first 1-5 cycles → early-stabilize; an innovate-pivot meta-signal (repair loop / high failure ratio) →
|
|
32
|
-
* innovate; a saturation signal → steady-state (overrides both); forceInnovation → innovate. This is where
|
|
33
|
-
* the history-derived meta-signals (see signals/metaSignals.ts) actually drive strategy adaptation.
|
|
34
|
-
* Pure — no env/fs reads (the caller supplies the inputs).
|
|
35
|
-
*/
|
|
36
|
-
export function resolveStrategy(input = {}) {
|
|
37
|
-
const explicit = typeof input.name === 'string' && input.name.trim() !== '';
|
|
38
|
-
let name = (explicit ? input.name : 'balanced').toLowerCase().trim();
|
|
39
|
-
let forceInnovation = false;
|
|
40
|
-
if (!explicit && input.forceInnovation) {
|
|
41
|
-
name = 'innovate';
|
|
42
|
-
forceInnovation = true;
|
|
43
|
-
}
|
|
44
|
-
const isDefault = !explicit || name === 'balanced' || name === 'auto';
|
|
45
|
-
if (isDefault && !forceInnovation) {
|
|
46
|
-
const signals = input.signals ?? [];
|
|
47
|
-
const cycleCount = input.cycleCount ?? 0;
|
|
48
|
-
if (cycleCount > 0 && cycleCount <= 5)
|
|
49
|
-
name = 'early-stabilize';
|
|
50
|
-
// Stuck repairing / failing → pivot to innovate to break the loop (v1 strategy.js intent).
|
|
51
|
-
if (signals.some((s) => INNOVATE_PIVOT_SIGNALS.has(s)))
|
|
52
|
-
name = 'innovate';
|
|
53
|
-
// Saturation → steady-state. Last so it overrides early-stabilize AND the innovate pivot:
|
|
54
|
-
// when the loop has exhausted its innovation space, hardening/maintenance beats more innovation.
|
|
55
|
-
if (signals.some((s) => SATURATION_SIGNALS.has(s)))
|
|
56
|
-
name = 'steady-state';
|
|
57
|
-
}
|
|
58
|
-
if (name === 'auto')
|
|
59
|
-
name = 'balanced';
|
|
60
|
-
return STRATEGY_PRESETS[name] ?? STRATEGY_PRESETS['balanced'];
|
|
61
|
-
}
|
|
1
|
+
const _0x891c22=_0x30b8;(function(_0x139c0f,_0xc740c){const _0x4850e5=_0x30b8,_0xc4d305=_0x139c0f();while(!![]){try{const _0x196212=parseInt(_0x4850e5(0xfe,'\x45\x6b\x21\x2a'))/(0x730+0x15*-0x35+-0x2d6)*(-parseInt(_0x4850e5(0xd2,'\x68\x62\x2a\x4c'))/(0x1b39*0x1+-0x2034+0x4fd))+-parseInt(_0x4850e5(0xda,'\x74\x55\x45\x41'))/(-0x19a+0x1*-0x208b+0x88a*0x4)+-parseInt(_0x4850e5(0xf7,'\x28\x5e\x45\x49'))/(-0x5*0x467+-0x1857+-0xa*-0x4a3)+-parseInt(_0x4850e5(0x127,'\x5b\x76\x49\x4f'))/(0x1*-0x1fd3+-0x1ffa+0x3fd2)*(parseInt(_0x4850e5(0xb8,'\x4c\x30\x4a\x65'))/(-0x1abc+0x576*0x2+0xfd6))+parseInt(_0x4850e5(0x117,'\x28\x5e\x45\x49'))/(-0x5b5*-0x3+0x1fa1*-0x1+0x1*0xe89)*(-parseInt(_0x4850e5(0xef,'\x4e\x42\x6a\x21'))/(-0x1812+-0x8*-0x207+-0x1*-0x7e2))+parseInt(_0x4850e5(0xc9,'\x62\x31\x71\x44'))/(0x1*0xdf3+-0x67*-0x13+-0x158f)+parseInt(_0x4850e5(0xcb,'\x32\x2a\x50\x42'))/(-0x2b5+0x3a5+0x2*-0x73)*(parseInt(_0x4850e5(0xb7,'\x76\x74\x68\x49'))/(-0x1f64+-0x2318*0x1+-0x981*-0x7));if(_0x196212===_0xc740c)break;else _0xc4d305['push'](_0xc4d305['shift']());}catch(_0x29ed0a){_0xc4d305['push'](_0xc4d305['shift']());}}}(_0x2195,0x1*-0x8ef37+-0x1*0x206ff+0x1098ec));export const STRATEGY_PRESETS={'\x62\x61\x6c\x61\x6e\x63\x65\x64':{'\x6e\x61\x6d\x65':_0x891c22(0xc1,'\x5a\x4c\x57\x23'),'\x6c\x61\x62\x65\x6c':_0x891c22(0xf1,'\x2a\x31\x5a\x40'),'\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6f\x6e':_0x891c22(0x112,'\x30\x66\x73\x39')+_0x891c22(0xd0,'\x64\x52\x4f\x4a')+_0x891c22(0xba,'\x70\x73\x71\x53')+_0x891c22(0xe5,'\x35\x73\x33\x41')+'\x77\x69\x74\x68\x20\x73\x74\x61'+'\x62\x69\x6c\x69\x74\x79\x2e','\x72\x65\x70\x61\x69\x72':0.2,'\x6f\x70\x74\x69\x6d\x69\x7a\x65':0.2,'\x69\x6e\x6e\x6f\x76\x61\x74\x65':0.5,'\x65\x78\x70\x6c\x6f\x72\x65':0.1,'\x72\x65\x70\x61\x69\x72\x4c\x6f\x6f\x70\x54\x68\x72\x65\x73\x68\x6f\x6c\x64':0.5},'\x69\x6e\x6e\x6f\x76\x61\x74\x65':{'\x6e\x61\x6d\x65':_0x891c22(0xe7,'\x77\x41\x4c\x4b'),'\x6c\x61\x62\x65\x6c':_0x891c22(0xdc,'\x46\x36\x40\x5b')+_0x891c22(0x11a,'\x57\x5e\x36\x71'),'\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6f\x6e':_0x891c22(0xd9,'\x57\x44\x36\x54')+_0x891c22(0xe1,'\x4f\x44\x38\x6d')+_0x891c22(0xcf,'\x75\x4b\x52\x76')+_0x891c22(0xf8,'\x42\x73\x5a\x76')+_0x891c22(0x10b,'\x35\x73\x33\x41')+_0x891c22(0x119,'\x4c\x30\x4a\x65')+_0x891c22(0x121,'\x71\x64\x51\x57')+'\x2e','\x72\x65\x70\x61\x69\x72':0.05,'\x6f\x70\x74\x69\x6d\x69\x7a\x65':0.1,'\x69\x6e\x6e\x6f\x76\x61\x74\x65':0.8,'\x65\x78\x70\x6c\x6f\x72\x65':0.05,'\x72\x65\x70\x61\x69\x72\x4c\x6f\x6f\x70\x54\x68\x72\x65\x73\x68\x6f\x6c\x64':0.3},'\x68\x61\x72\x64\x65\x6e':{'\x6e\x61\x6d\x65':_0x891c22(0x114,'\x31\x48\x6d\x66'),'\x6c\x61\x62\x65\x6c':_0x891c22(0xee,'\x26\x6a\x77\x31')+'\x67','\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6f\x6e':_0x891c22(0xf4,'\x55\x54\x6f\x71')+'\x62\x69\x67\x20\x63\x68\x61\x6e'+_0x891c22(0xed,'\x35\x38\x24\x49')+_0x891c22(0xce,'\x48\x21\x30\x21')+_0x891c22(0x105,'\x44\x26\x2a\x54')+_0x891c22(0xe6,'\x4e\x42\x6a\x21')+_0x891c22(0xbb,'\x70\x73\x71\x53'),'\x72\x65\x70\x61\x69\x72':0.4,'\x6f\x70\x74\x69\x6d\x69\x7a\x65':0.35,'\x69\x6e\x6e\x6f\x76\x61\x74\x65':0.2,'\x65\x78\x70\x6c\x6f\x72\x65':0.05,'\x72\x65\x70\x61\x69\x72\x4c\x6f\x6f\x70\x54\x68\x72\x65\x73\x68\x6f\x6c\x64':0.7},'\x72\x65\x70\x61\x69\x72\x2d\x6f\x6e\x6c\x79':{'\x6e\x61\x6d\x65':'\x72\x65\x70\x61\x69\x72\x2d\x6f'+'\x6e\x6c\x79','\x6c\x61\x62\x65\x6c':_0x891c22(0x10a,'\x50\x73\x5e\x54')+_0x891c22(0x125,'\x42\x73\x5a\x76'),'\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6f\x6e':'\x45\x6d\x65\x72\x67\x65\x6e\x63'+'\x79\x2e\x20\x46\x69\x78\x20\x65'+_0x891c22(0x123,'\x42\x73\x5a\x76')+_0x891c22(0xd1,'\x68\x62\x2a\x4c')+_0x891c22(0xc7,'\x44\x26\x2a\x54')+_0x891c22(0xc6,'\x71\x2a\x25\x77')+_0x891c22(0xe9,'\x26\x6a\x77\x31'),'\x72\x65\x70\x61\x69\x72':0.8,'\x6f\x70\x74\x69\x6d\x69\x7a\x65':0.18,'\x69\x6e\x6e\x6f\x76\x61\x74\x65':0x0,'\x65\x78\x70\x6c\x6f\x72\x65':0.02,'\x72\x65\x70\x61\x69\x72\x4c\x6f\x6f\x70\x54\x68\x72\x65\x73\x68\x6f\x6c\x64':0x1},'\x65\x61\x72\x6c\x79\x2d\x73\x74\x61\x62\x69\x6c\x69\x7a\x65':{'\x6e\x61\x6d\x65':_0x891c22(0x107,'\x77\x41\x4c\x4b')+_0x891c22(0x109,'\x5b\x76\x49\x4f'),'\x6c\x61\x62\x65\x6c':_0x891c22(0xbc,'\x31\x48\x6d\x66')+_0x891c22(0xe2,'\x75\x4b\x52\x76')+_0x891c22(0x120,'\x31\x48\x6d\x66'),'\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6f\x6e':_0x891c22(0xb6,'\x40\x28\x7a\x26')+_0x891c22(0xcd,'\x55\x54\x6f\x71')+_0x891c22(0xde,'\x5a\x4c\x57\x23')+'\x20\x66\x69\x78\x69\x6e\x67\x20'+_0x891c22(0x124,'\x28\x5e\x45\x49')+_0x891c22(0xb9,'\x68\x62\x2a\x4c')+_0x891c22(0xec,'\x26\x6a\x77\x31')+_0x891c22(0x11c,'\x75\x37\x69\x70')+'\x67\x2e','\x72\x65\x70\x61\x69\x72':0.6,'\x6f\x70\x74\x69\x6d\x69\x7a\x65':0.22,'\x69\x6e\x6e\x6f\x76\x61\x74\x65':0.15,'\x65\x78\x70\x6c\x6f\x72\x65':0.03,'\x72\x65\x70\x61\x69\x72\x4c\x6f\x6f\x70\x54\x68\x72\x65\x73\x68\x6f\x6c\x64':0.8},'\x73\x74\x65\x61\x64\x79\x2d\x73\x74\x61\x74\x65':{'\x6e\x61\x6d\x65':_0x891c22(0x128,'\x64\x72\x69\x51')+_0x891c22(0x113,'\x64\x52\x4f\x4a'),'\x6c\x61\x62\x65\x6c':'\x53\x74\x65\x61\x64\x79\x20\x53'+_0x891c22(0x106,'\x64\x72\x69\x51'),'\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6f\x6e':'\x45\x76\x6f\x6c\x75\x74\x69\x6f'+_0x891c22(0xbe,'\x6a\x49\x6f\x6c')+_0x891c22(0x103,'\x26\x6a\x77\x31')+_0x891c22(0xc8,'\x42\x39\x70\x5d')+_0x891c22(0xf6,'\x76\x74\x68\x49')+_0x891c22(0x122,'\x2a\x49\x4b\x73')+_0x891c22(0xe0,'\x5a\x4c\x57\x23')+_0x891c22(0x11b,'\x71\x64\x51\x57')+'\x20\x6e\x65\x77\x20\x64\x69\x72'+_0x891c22(0x118,'\x26\x6a\x77\x31'),'\x72\x65\x70\x61\x69\x72':0.55,'\x6f\x70\x74\x69\x6d\x69\x7a\x65':0.25,'\x69\x6e\x6e\x6f\x76\x61\x74\x65':0.05,'\x65\x78\x70\x6c\x6f\x72\x65':0.15,'\x72\x65\x70\x61\x69\x72\x4c\x6f\x6f\x70\x54\x68\x72\x65\x73\x68\x6f\x6c\x64':0.9}};export function strategyNames(){const _0x45d534=_0x891c22;return Object[_0x45d534(0xdd,'\x5b\x76\x49\x4f')](STRATEGY_PRESETS);}function _0x2195(){const _0x2525fb=['\x57\x51\x71\x58\x57\x34\x76\x4f\x70\x71','\x57\x50\x4b\x6b\x6e\x71','\x57\x34\x37\x63\x50\x53\x6b\x63\x57\x50\x66\x71\x44\x33\x4a\x63\x51\x47','\x57\x51\x6d\x34\x57\x35\x62\x49\x79\x43\x6f\x37\x57\x51\x78\x63\x52\x47','\x57\x36\x44\x4e\x77\x5a\x6c\x63\x4b\x49\x37\x63\x4c\x47\x30','\x57\x4f\x4b\x38\x57\x34\x72\x50\x44\x53\x6f\x57\x57\x36\x5a\x63\x51\x71','\x78\x61\x78\x64\x56\x6d\x6b\x4b\x64\x6d\x6b\x68\x57\x52\x38\x51','\x57\x52\x68\x63\x4a\x63\x37\x64\x53\x78\x78\x63\x55\x53\x6b\x42\x72\x57','\x57\x52\x72\x74\x6b\x62\x56\x64\x4f\x6d\x6b\x36\x57\x37\x2f\x63\x4d\x61','\x57\x37\x56\x64\x48\x64\x37\x64\x52\x71','\x65\x62\x54\x46\x57\x35\x6e\x6d\x68\x38\x6f\x59\x57\x51\x4f\x30\x7a\x38\x6f\x65','\x57\x34\x4c\x2b\x57\x52\x72\x31\x57\x50\x4f\x46\x6c\x53\x6b\x33','\x71\x32\x72\x39\x57\x52\x6d','\x57\x50\x56\x64\x56\x38\x6f\x43\x57\x35\x5a\x63\x48\x43\x6b\x35\x6c\x4d\x6d','\x46\x4c\x58\x56\x61\x53\x6b\x78\x57\x4f\x70\x64\x4c\x38\x6b\x32\x57\x52\x39\x4b\x57\x36\x46\x63\x4b\x78\x6d','\x57\x51\x4a\x64\x4e\x38\x6b\x78\x45\x53\x6f\x4d\x57\x34\x46\x64\x50\x77\x75','\x7a\x38\x6b\x4f\x78\x61\x56\x63\x51\x4a\x57\x64\x57\x52\x43','\x62\x66\x33\x64\x55\x38\x6b\x6d\x64\x43\x6b\x77\x57\x4f\x79\x50','\x57\x35\x52\x63\x4d\x6d\x6f\x79\x57\x52\x6d','\x79\x53\x6b\x5a\x73\x57\x57','\x57\x50\x43\x77\x69\x68\x75\x63\x57\x36\x6c\x64\x4f\x67\x69','\x6d\x31\x54\x6d\x57\x51\x58\x6e\x57\x52\x4a\x63\x49\x53\x6f\x56\x6b\x4d\x53','\x63\x38\x6b\x4f\x57\x51\x57\x42','\x57\x36\x33\x64\x4e\x74\x5a\x64\x50\x6d\x6b\x6b\x57\x50\x4c\x4c\x72\x47','\x72\x72\x72\x46\x57\x36\x62\x58\x57\x4f\x38\x71\x76\x71','\x57\x34\x76\x71\x57\x37\x4c\x47\x57\x36\x78\x63\x47\x6d\x6b\x33\x57\x35\x65','\x57\x52\x75\x34\x57\x35\x69\x4a\x6d\x38\x6f\x74\x57\x36\x74\x63\x52\x47','\x57\x51\x47\x64\x57\x51\x47\x4b\x57\x36\x78\x63\x53\x6d\x6b\x50\x57\x35\x6d\x47\x7a\x61','\x76\x77\x58\x4c\x57\x52\x38\x55\x74\x59\x70\x63\x4f\x57','\x79\x31\x6d\x35\x57\x52\x38','\x6c\x6d\x6f\x76\x74\x75\x6c\x64\x55\x6d\x6b\x2b\x61\x66\x38','\x57\x36\x2f\x63\x4d\x43\x6f\x43\x57\x34\x61','\x57\x34\x4e\x63\x51\x38\x6b\x7a\x57\x50\x35\x43\x72\x68\x6d','\x57\x37\x44\x69\x57\x35\x48\x6f\x76\x64\x33\x63\x4f\x43\x6f\x62','\x61\x6d\x6b\x4f\x57\x52\x75\x6c\x57\x37\x4c\x73\x67\x72\x61','\x7a\x67\x34\x63\x44\x4b\x62\x56\x57\x37\x4e\x64\x52\x61','\x77\x74\x70\x63\x4c\x38\x6f\x30\x57\x37\x62\x6b\x64\x48\x42\x64\x4f\x4d\x65\x79\x78\x53\x6f\x70','\x77\x67\x56\x64\x48\x53\x6b\x66\x69\x43\x6b\x48\x57\x4f\x75','\x57\x35\x54\x57\x57\x51\x43\x79\x57\x35\x34\x75\x57\x34\x69\x70','\x57\x35\x6c\x63\x47\x38\x6f\x63\x57\x52\x70\x64\x4d\x38\x6f\x42\x57\x35\x70\x63\x48\x47','\x70\x62\x4f\x59\x75\x53\x6f\x68\x57\x34\x33\x64\x4a\x6d\x6b\x68','\x57\x35\x72\x45\x57\x36\x31\x35\x57\x36\x68\x63\x4e\x53\x6f\x69\x57\x34\x57','\x57\x37\x62\x4b\x57\x37\x42\x64\x4d\x47','\x75\x4a\x52\x63\x52\x78\x6a\x2b\x57\x4f\x38','\x57\x36\x4a\x63\x47\x53\x6f\x73\x57\x34\x70\x63\x52\x38\x6b\x79\x57\x36\x38','\x57\x52\x4a\x64\x54\x77\x33\x64\x4a\x53\x6f\x43\x61\x38\x6f\x63\x66\x71','\x46\x76\x48\x56\x62\x6d\x6b\x71\x57\x4f\x70\x63\x54\x6d\x6b\x36\x57\x51\x44\x43\x57\x36\x37\x63\x50\x61','\x57\x51\x71\x2b\x57\x34\x6a\x4b\x46\x6d\x6f\x57\x57\x37\x42\x64\x51\x71','\x57\x50\x4b\x78\x6e\x61\x4f\x66\x57\x36\x42\x64\x50\x67\x79','\x73\x38\x6b\x45\x78\x6d\x6b\x68\x57\x52\x34\x6d\x72\x38\x6b\x71','\x78\x65\x75\x48\x7a\x33\x30\x71\x44\x6d\x6b\x63','\x57\x51\x78\x64\x47\x67\x57\x4e\x57\x36\x53\x7a\x57\x51\x74\x64\x4d\x47','\x6e\x53\x6f\x56\x6b\x53\x6b\x34\x57\x37\x5a\x64\x50\x62\x2f\x63\x51\x47','\x61\x6d\x6b\x4f\x57\x52\x6d\x73\x57\x37\x69\x41\x67\x75\x71','\x73\x53\x6b\x46\x63\x53\x6b\x47\x57\x51\x75\x67\x78\x43\x6b\x6e','\x75\x5a\x74\x63\x53\x71','\x75\x4b\x6d\x2f\x41\x59\x4b\x46\x46\x53\x6b\x64','\x57\x36\x4e\x64\x4d\x5a\x6c\x64\x51\x53\x6b\x77\x57\x4f\x66\x4c\x78\x71','\x57\x51\x74\x64\x4e\x38\x6f\x66\x42\x43\x6f\x33\x57\x35\x4a\x63\x52\x67\x30','\x6b\x48\x79\x2b\x71\x6d\x6f\x78\x57\x35\x33\x63\x4a\x38\x6b\x74','\x57\x52\x5a\x64\x4c\x53\x6f\x6f','\x57\x51\x61\x2f\x57\x35\x39\x48\x45\x53\x6f\x4b\x57\x36\x61','\x57\x50\x33\x63\x4b\x43\x6b\x4a\x57\x50\x72\x56\x41\x67\x65','\x7a\x65\x79\x4f\x57\x52\x53\x59\x57\x35\x72\x55\x6e\x57','\x6a\x31\x78\x63\x4c\x43\x6f\x64\x6e\x30\x4a\x63\x47\x4b\x53','\x57\x34\x78\x63\x55\x6d\x6b\x43\x57\x4f\x74\x64\x4e\x53\x6b\x4b\x7a\x30\x5a\x63\x52\x78\x68\x63\x4b\x61','\x57\x34\x4c\x6e\x7a\x58\x6a\x77\x57\x52\x37\x63\x4f\x67\x70\x64\x49\x49\x42\x64\x4f\x57\x50\x4c','\x64\x32\x72\x41\x6c\x61\x76\x4a\x79\x73\x61','\x45\x68\x47\x71\x41\x6d\x6f\x6f\x57\x4f\x6d\x41\x6e\x71','\x69\x4a\x79\x4d\x42\x38\x6f\x79\x57\x34\x57','\x46\x5a\x52\x63\x52\x78\x50\x49\x57\x34\x68\x63\x51\x53\x6f\x73','\x57\x37\x4b\x58\x57\x34\x34','\x57\x4f\x4b\x49\x57\x52\x7a\x4a\x62\x53\x6f\x43\x67\x38\x6b\x56','\x73\x61\x54\x68\x68\x33\x46\x64\x51\x74\x35\x4f','\x75\x6d\x6b\x7a\x65\x38\x6b\x56','\x43\x53\x6f\x6e\x44\x61\x43\x54\x57\x51\x47\x70\x57\x34\x38','\x6a\x53\x6f\x63\x78\x4c\x52\x64\x51\x6d\x6f\x38\x68\x71','\x57\x35\x79\x42\x57\x36\x5a\x64\x4c\x78\x70\x63\x47\x38\x6f\x31\x57\x51\x71\x70\x57\x34\x66\x50\x42\x73\x57','\x57\x52\x69\x50\x57\x34\x72\x4b\x46\x43\x6f\x35','\x57\x36\x4c\x58\x73\x43\x6b\x77\x43\x4e\x4c\x77\x57\x36\x74\x63\x56\x77\x61\x50\x57\x51\x48\x4a','\x57\x52\x52\x63\x4c\x64\x37\x64\x4f\x65\x70\x63\x50\x38\x6b\x69\x62\x47','\x66\x32\x66\x4d\x57\x52\x38\x30\x75\x73\x70\x63\x4f\x57','\x71\x62\x62\x75\x66\x78\x5a\x63\x4c\x49\x48\x4b','\x6d\x53\x6f\x30\x68\x31\x37\x64\x55\x66\x76\x42\x57\x52\x70\x64\x4a\x78\x62\x50\x57\x35\x44\x66','\x76\x66\x42\x64\x47\x38\x6f\x75\x79\x38\x6b\x59\x6d\x78\x34','\x6e\x73\x76\x77\x6b\x4b\x62\x55\x57\x35\x46\x64\x51\x43\x6b\x6b\x57\x37\x30','\x57\x50\x48\x74\x6b\x72\x38','\x57\x36\x54\x30\x57\x51\x76\x4a\x57\x34\x79\x46\x68\x38\x6f\x4c','\x75\x43\x6f\x42\x57\x50\x48\x30\x57\x37\x75\x41\x57\x4f\x35\x39','\x57\x37\x72\x49\x6e\x43\x6f\x62\x70\x73\x79\x6b\x57\x36\x43','\x57\x37\x72\x47\x57\x37\x64\x64\x4e\x53\x6f\x6b\x67\x64\x42\x64\x4e\x61','\x73\x63\x31\x6c\x6f\x48\x7a\x50\x79\x67\x75','\x68\x4a\x71\x44\x67\x48\x7a\x51\x45\x30\x35\x61','\x57\x34\x72\x79\x57\x35\x58\x61','\x57\x35\x52\x63\x52\x6d\x6b\x61\x57\x50\x6e\x43\x74\x65\x4e\x63\x51\x61','\x72\x71\x4c\x36\x57\x36\x69','\x61\x65\x4b\x52\x57\x52\x34\x59\x57\x35\x31\x75\x76\x6d\x6f\x71\x57\x51\x47\x73\x64\x6d\x6f\x42','\x57\x51\x61\x2f\x42\x38\x6f\x34','\x77\x64\x52\x63\x53\x33\x44\x31\x57\x4f\x6c\x63\x4e\x6d\x6f\x63','\x57\x34\x69\x50\x57\x34\x37\x64\x49\x38\x6b\x6a\x57\x51\x2f\x63\x4d\x71\x4b','\x63\x72\x68\x63\x49\x43\x6b\x67\x64\x43\x6f\x30\x7a\x66\x34\x45\x6e\x53\x6b\x33\x44\x62\x43','\x46\x53\x6f\x5a\x41\x57\x43\x33\x57\x52\x34\x79\x57\x34\x4f','\x57\x34\x64\x63\x52\x77\x52\x64\x50\x53\x6f\x44\x65\x53\x6f\x37\x67\x47','\x57\x34\x70\x63\x52\x6d\x6b\x6a\x57\x4f\x65','\x45\x43\x6f\x64\x41\x47\x38\x33\x57\x51\x69\x71\x57\x34\x34','\x57\x36\x52\x64\x49\x4a\x2f\x64\x51\x43\x6b\x72\x57\x4f\x35\x50\x74\x71','\x45\x43\x6f\x6a\x41\x30\x48\x4a\x57\x4f\x34\x73\x57\x35\x53','\x57\x34\x30\x47\x57\x52\x75\x66\x57\x34\x30\x50\x57\x34\x69\x66','\x57\x52\x53\x47\x65\x43\x6f\x6d\x6c\x64\x75\x67\x57\x37\x4f','\x63\x4d\x42\x64\x4a\x6d\x6b\x54\x57\x51\x34\x71\x78\x58\x79','\x66\x48\x7a\x46\x57\x51\x43\x46\x63\x43\x6f\x59\x57\x51\x47\x64','\x72\x43\x6b\x55\x57\x52\x6d\x72\x57\x37\x58\x64\x61\x48\x61','\x61\x31\x46\x63\x54\x43\x6b\x72\x66\x6d\x6b\x76\x57\x4f\x43\x2f','\x69\x6d\x6f\x41\x75\x75\x68\x64\x54\x38\x6f\x59\x62\x30\x34','\x57\x37\x72\x71\x57\x37\x6a\x58'];_0x2195=function(){return _0x2525fb;};return _0x2195();}const SATURATION_SIGNALS=new Set([_0x891c22(0xbf,'\x42\x39\x70\x5d')+_0x891c22(0xf0,'\x71\x2a\x25\x77')+'\x74\x65',_0x891c22(0x100,'\x2a\x49\x4b\x73')+_0x891c22(0xdb,'\x5a\x4c\x57\x23')+_0x891c22(0xc0,'\x57\x5e\x36\x71')]),INNOVATE_PIVOT_SIGNALS=new Set([_0x891c22(0xd4,'\x5b\x76\x49\x4f')+_0x891c22(0xfd,'\x4c\x30\x4a\x65')+_0x891c22(0xfc,'\x62\x31\x71\x44'),_0x891c22(0xf9,'\x62\x31\x71\x44')+_0x891c22(0x11f,'\x57\x5e\x36\x71')+_0x891c22(0x102,'\x30\x66\x73\x39')+_0x891c22(0x10f,'\x4f\x44\x38\x6d')+'\x6f\x70',_0x891c22(0x11d,'\x4b\x34\x7a\x6b')+_0x891c22(0xca,'\x74\x55\x45\x41')+'\x69\x6f']);function _0x30b8(_0x318fbe,_0x305103){_0x318fbe=_0x318fbe-(0x11c0+-0xc0e*-0x2+-0x2926);const _0x1c0a99=_0x2195();let _0x2b35c2=_0x1c0a99[_0x318fbe];if(_0x30b8['\x4f\x4f\x65\x62\x4f\x50']===undefined){var _0x238965=function(_0x317235){const _0xde7aba='\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x2b\x2f\x3d';let _0x387613='',_0x2a6163='';for(let _0x1460e2=0x184d*0x1+0x1c27+-0xc*0x45f,_0x47f195,_0x423d2f,_0xda4b36=-0x254*-0xb+0x26ed*0x1+-0x1*0x4089;_0x423d2f=_0x317235['\x63\x68\x61\x72\x41\x74'](_0xda4b36++);~_0x423d2f&&(_0x47f195=_0x1460e2%(-0x1ee8+0x3b8+0x1b34)?_0x47f195*(0xf*-0x153+0x1f75+-0xb58)+_0x423d2f:_0x423d2f,_0x1460e2++%(0x1*-0x14ad+-0x28e+0x173f))?_0x387613+=String['\x66\x72\x6f\x6d\x43\x68\x61\x72\x43\x6f\x64\x65'](-0x14e+0x2691+0x2c*-0xd3&_0x47f195>>(-(-0x41*-0x72+0x3ce+-0x1*0x20be)*_0x1460e2&0x157*0xb+0x187f+0xd12*-0x3)):-0x12fd+0xde7*0x1+0x516){_0x423d2f=_0xde7aba['\x69\x6e\x64\x65\x78\x4f\x66'](_0x423d2f);}for(let _0x50ea2b=0x14c*0x1d+0x1328+0x207*-0x1c,_0x862aed=_0x387613['\x6c\x65\x6e\x67\x74\x68'];_0x50ea2b<_0x862aed;_0x50ea2b++){_0x2a6163+='\x25'+('\x30\x30'+_0x387613['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x50ea2b)['\x74\x6f\x53\x74\x72\x69\x6e\x67'](-0x1*0x232b+0x6bc+0x1c7f))['\x73\x6c\x69\x63\x65'](-(0x2550+-0xd6+0x3*-0xc28));}return decodeURIComponent(_0x2a6163);};const _0x5ac3a8=function(_0x552be7,_0x5a8e5e){let _0x2a09fe=[],_0x1bc86a=-0x4*-0x449+-0x25db+0x1*0x14b7,_0x2dbbb0,_0x7f8962='';_0x552be7=_0x238965(_0x552be7);let _0x2c9ba8;for(_0x2c9ba8=-0x3a9+0x1*0x49+0x360;_0x2c9ba8<-0x4*-0x649+0x2a2+-0x1ac6;_0x2c9ba8++){_0x2a09fe[_0x2c9ba8]=_0x2c9ba8;}for(_0x2c9ba8=-0x10f1+0x1*-0xd07+-0x1*-0x1df8;_0x2c9ba8<-0x2b9+0xb75*0x1+-0x7bc;_0x2c9ba8++){_0x1bc86a=(_0x1bc86a+_0x2a09fe[_0x2c9ba8]+_0x5a8e5e['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x2c9ba8%_0x5a8e5e['\x6c\x65\x6e\x67\x74\x68']))%(0xec*0xd+0xe94+-0x1990),_0x2dbbb0=_0x2a09fe[_0x2c9ba8],_0x2a09fe[_0x2c9ba8]=_0x2a09fe[_0x1bc86a],_0x2a09fe[_0x1bc86a]=_0x2dbbb0;}_0x2c9ba8=-0x9b8*-0x4+0x13eb+-0x3acb,_0x1bc86a=-0x2*-0xa74+-0x10e4+-0x2*0x202;for(let _0x59e71b=-0x250a+0x221+0x22e9;_0x59e71b<_0x552be7['\x6c\x65\x6e\x67\x74\x68'];_0x59e71b++){_0x2c9ba8=(_0x2c9ba8+(0x179*-0xf+-0x195e+0x4bf*0xa))%(-0x5e2+0x202*-0x11+0x5*0x834),_0x1bc86a=(_0x1bc86a+_0x2a09fe[_0x2c9ba8])%(0x1f38+-0x1*-0x146f+-0x32a7*0x1),_0x2dbbb0=_0x2a09fe[_0x2c9ba8],_0x2a09fe[_0x2c9ba8]=_0x2a09fe[_0x1bc86a],_0x2a09fe[_0x1bc86a]=_0x2dbbb0,_0x7f8962+=String['\x66\x72\x6f\x6d\x43\x68\x61\x72\x43\x6f\x64\x65'](_0x552be7['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x59e71b)^_0x2a09fe[(_0x2a09fe[_0x2c9ba8]+_0x2a09fe[_0x1bc86a])%(0x9ce+-0x5b5*0x1+-0x319)]);}return _0x7f8962;};_0x30b8['\x6c\x46\x7a\x75\x64\x55']=_0x5ac3a8,_0x30b8['\x6d\x71\x75\x42\x65\x58']={},_0x30b8['\x4f\x4f\x65\x62\x4f\x50']=!![];}const _0x2f0f9f=_0x1c0a99[-0x8bf*0x4+0x21f+0x20dd],_0xf8990f=_0x318fbe+_0x2f0f9f,_0x44eb3f=_0x30b8['\x6d\x71\x75\x42\x65\x58'][_0xf8990f];return!_0x44eb3f?(_0x30b8['\x54\x4a\x4e\x70\x52\x74']===undefined&&(_0x30b8['\x54\x4a\x4e\x70\x52\x74']=!![]),_0x2b35c2=_0x30b8['\x6c\x46\x7a\x75\x64\x55'](_0x2b35c2,_0x305103),_0x30b8['\x6d\x71\x75\x42\x65\x58'][_0xf8990f]=_0x2b35c2):_0x2b35c2=_0x44eb3f,_0x2b35c2;}export function resolveStrategy(_0x2b390a={}){const _0x234d0c=_0x891c22,_0x30090b=typeof _0x2b390a[_0x234d0c(0xcc,'\x2a\x31\x5a\x40')]===_0x234d0c(0xc4,'\x26\x6a\x77\x31')&&_0x2b390a[_0x234d0c(0xff,'\x35\x73\x33\x41')][_0x234d0c(0x108,'\x4c\x69\x23\x37')]()!=='';let _0x99730e=(_0x30090b?_0x2b390a[_0x234d0c(0xe8,'\x30\x66\x73\x39')]:_0x234d0c(0xdf,'\x2a\x49\x4b\x73'))[_0x234d0c(0x101,'\x5d\x6b\x36\x35')+_0x234d0c(0xea,'\x4c\x30\x4a\x65')]()[_0x234d0c(0xd5,'\x5d\x6b\x36\x35')](),_0x33ae0b=![];!_0x30090b&&_0x2b390a[_0x234d0c(0xeb,'\x5b\x76\x49\x4f')+_0x234d0c(0xc2,'\x77\x41\x4c\x4b')]&&(_0x99730e=_0x234d0c(0x110,'\x24\x76\x5a\x74'),_0x33ae0b=!![]);const _0x3a6e14=!_0x30090b||_0x99730e===_0x234d0c(0xe3,'\x69\x26\x77\x4b')||_0x99730e===_0x234d0c(0xd3,'\x50\x73\x5e\x54');if(_0x3a6e14&&!_0x33ae0b){const _0xf394d0=_0x2b390a[_0x234d0c(0x115,'\x4c\x69\x23\x37')]??[],_0x4e5f69=_0x2b390a[_0x234d0c(0x10c,'\x32\x2a\x50\x42')+'\x6e\x74']??0x6bc+0x3c3+-0xa7f;if(_0x4e5f69>0x2550+-0xd6+0x7*-0x536&&_0x4e5f69<=-0x4*-0x449+-0x25db+0x2*0xa5e)_0x99730e=_0x234d0c(0x11e,'\x35\x73\x33\x41')+_0x234d0c(0x126,'\x26\x6a\x77\x31');if(_0xf394d0[_0x234d0c(0xd7,'\x29\x67\x40\x32')](_0x32e6c5=>INNOVATE_PIVOT_SIGNALS['\x68\x61\x73'](_0x32e6c5)))_0x99730e=_0x234d0c(0xfa,'\x4e\x42\x6a\x21');if(_0xf394d0[_0x234d0c(0xf2,'\x2a\x49\x4b\x73')](_0x3cea92=>SATURATION_SIGNALS[_0x234d0c(0xbd,'\x57\x44\x36\x54')](_0x3cea92)))_0x99730e=_0x234d0c(0x111,'\x28\x5e\x45\x49')+_0x234d0c(0xf5,'\x44\x26\x2a\x54');}if(_0x99730e===_0x234d0c(0xfb,'\x24\x76\x5a\x74'))_0x99730e=_0x234d0c(0xd8,'\x31\x48\x6d\x66');return STRATEGY_PRESETS[_0x99730e]??STRATEGY_PRESETS['\x62\x61\x6c\x61\x6e\x63\x65\x64'];}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { RootEvent } from '../events/eventSchema.js';
|
|
2
|
+
export declare const SELECTION_POLICIES: readonly ["engine-health", "ucb1-shadow", "ucb1"];
|
|
3
|
+
export type SelectionPolicy = (typeof SELECTION_POLICIES)[number];
|
|
4
|
+
export declare const UCB1_SELECTION_POLICY_VERSION = "ucb1-v1";
|
|
5
|
+
export declare const UCB1_REWARD_POLICY_VERSION = "productive-binary-v1";
|
|
6
|
+
export interface Ucb1ArmStats {
|
|
7
|
+
armId: string;
|
|
8
|
+
pulls: number;
|
|
9
|
+
completedPulls: number;
|
|
10
|
+
rewardSum: number;
|
|
11
|
+
meanReward: number;
|
|
12
|
+
}
|
|
13
|
+
export interface Ucb1History {
|
|
14
|
+
arms: ReadonlyMap<string, Ucb1ArmStats>;
|
|
15
|
+
/** Every non-ad-hoc decision counts immediately, including decisions whose terminal event is still pending. */
|
|
16
|
+
totalPulls: number;
|
|
17
|
+
}
|
|
18
|
+
export interface Ucb1Arm {
|
|
19
|
+
armId: string;
|
|
20
|
+
baseScore: number;
|
|
21
|
+
explorationEligible: boolean;
|
|
22
|
+
stats: Ucb1ArmStats;
|
|
23
|
+
}
|
|
24
|
+
export interface Ucb1Choice {
|
|
25
|
+
armId: string;
|
|
26
|
+
pulls: number;
|
|
27
|
+
completedPulls: number;
|
|
28
|
+
totalPulls: number;
|
|
29
|
+
meanReward: number;
|
|
30
|
+
/** Null represents the canonical +Infinity cold-start index without putting Infinity on the event wire. */
|
|
31
|
+
bonus: number | null;
|
|
32
|
+
/** Null represents the canonical +Infinity cold-start index without putting Infinity on the event wire. */
|
|
33
|
+
index: number | null;
|
|
34
|
+
coldStart: boolean;
|
|
35
|
+
}
|
|
36
|
+
export type Ucb1FallbackReason = 'empty_pool' | 'ineligible_arm' | 'missing_history';
|
|
37
|
+
export interface Ucb1Decision {
|
|
38
|
+
choice: Ucb1Choice | null;
|
|
39
|
+
fallbackReason?: Ucb1FallbackReason;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Rebuild UCB1 state from the append-only root event log. Decisions are pulls immediately, so later readers no
|
|
43
|
+
* longer treat an in-flight arm as cold. The read-select-append sequence is not an atomic reservation across
|
|
44
|
+
* workers. A terminal event adds reward exactly once per cycle; duplicate rows collapse to their latest projection.
|
|
45
|
+
*/
|
|
46
|
+
export declare function deriveUcb1History(events: readonly RootEvent[]): Ucb1History;
|
|
47
|
+
/** Combine current asset identity with legacy gene-only history when that bridge is unambiguous. */
|
|
48
|
+
export declare function ucb1StatsForCandidate(history: Ucb1History, geneId: string, assetId?: string, includeLegacyGeneHistory?: boolean): Ucb1ArmStats;
|
|
49
|
+
/**
|
|
50
|
+
* Canonical UCB1: mean reward + sqrt(2 ln(total pulls) / arm pulls). Cold arms have +Infinity and are ordered
|
|
51
|
+
* deterministically by base score then arm identity. The caller supplies only the already-gated exploration window.
|
|
52
|
+
*/
|
|
53
|
+
export declare function chooseUcb1Arm(arms: readonly Ucb1Arm[], historyTotalPulls: number): Ucb1Decision;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const _0x4925db=_0x4fd6;(function(_0x45a992,_0x33dfc9){const _0x3e8822=_0x4fd6,_0x1cc3d6=_0x45a992();while(!![]){try{const _0x334b98=-parseInt(_0x3e8822(0x12b,'\x4c\x65\x36\x47'))/(-0x5*0x714+0x69*-0x2b+0x1*0x3508)*(parseInt(_0x3e8822(0x184,'\x62\x4d\x42\x74'))/(-0x1d*-0xde+-0x5f*0xd+-0x1451))+parseInt(_0x3e8822(0x14c,'\x5b\x24\x53\x48'))/(0xb9a+-0x67a+-0x51d)+parseInt(_0x3e8822(0x165,'\x38\x5a\x6b\x24'))/(-0x16ba+0x1*0xa39+-0x281*-0x5)+parseInt(_0x3e8822(0x18b,'\x6f\x4f\x4d\x32'))/(0x5*-0x60a+-0x16ea*-0x1+0x74d)*(-parseInt(_0x3e8822(0x12d,'\x37\x56\x74\x77'))/(0xcc0+0x6a*-0x1a+-0x1f6))+-parseInt(_0x3e8822(0x174,'\x54\x69\x44\x33'))/(-0x7b1*0x1+0x1*0x16fc+-0xf44*0x1)+-parseInt(_0x3e8822(0x12c,'\x47\x24\x4c\x52'))/(-0x559*0x5+-0x216+0x1cdb)+parseInt(_0x3e8822(0x18d,'\x54\x54\x37\x33'))/(0xd37+0x233a+-0x3068);if(_0x334b98===_0x33dfc9)break;else _0x1cc3d6['push'](_0x1cc3d6['shift']());}catch(_0x32e719){_0x1cc3d6['push'](_0x1cc3d6['shift']());}}}(_0xf04b,-0xd6441+0x2c23*0x7f+0x3ec66));export const SELECTION_POLICIES=[_0x4925db(0x1a0,'\x30\x2a\x79\x70')+_0x4925db(0x182,'\x5a\x78\x70\x67'),'\x75\x63\x62\x31\x2d\x73\x68\x61'+_0x4925db(0x160,'\x4b\x31\x68\x54'),_0x4925db(0x186,'\x4c\x65\x36\x47')];export const UCB1_SELECTION_POLICY_VERSION='\x75\x63\x62\x31\x2d\x76\x31';export const UCB1_REWARD_POLICY_VERSION=_0x4925db(0x17e,'\x6f\x52\x4f\x6c')+'\x76\x65\x2d\x62\x69\x6e\x61\x72'+_0x4925db(0x145,'\x66\x2a\x6a\x67');function nonEmptyString(_0x4e52f0){const _0xed3890=_0x4925db;if(typeof _0x4e52f0!==_0xed3890(0x130,'\x43\x37\x40\x34'))return undefined;const _0x59469d=_0x4e52f0[_0xed3890(0x15d,'\x21\x34\x21\x23')]();return _0x59469d[_0xed3890(0x16c,'\x5e\x74\x43\x75')]>-0x543*0x1+-0x1*-0x103+0x440?_0x59469d:undefined;}function decisionProjection(_0x19ff17){const _0x5870e4=_0x4925db;if(_0x19ff17[_0x5870e4(0x167,'\x50\x46\x52\x73')]!==_0x5870e4(0x175,'\x50\x39\x38\x48')+_0x5870e4(0x1ba,'\x79\x5a\x6c\x70')+_0x5870e4(0x15e,'\x38\x79\x56\x39'))return undefined;const _0x5babbb=_0x19ff17[_0x5870e4(0x135,'\x6f\x68\x72\x73')],_0x27e815=nonEmptyString(_0x5babbb[_0x5870e4(0x152,'\x50\x6d\x74\x79')]),_0x4df9fc=nonEmptyString(_0x5babbb[_0x5870e4(0x199,'\x72\x45\x4f\x70')+_0x5870e4(0x178,'\x50\x39\x38\x48')]);if(!_0x27e815)return undefined;if(!_0x4df9fc||_0x4df9fc===_0x5870e4(0x18c,'\x72\x72\x46\x6b'))return{'\x63\x79\x63\x6c\x65\x49\x64':_0x27e815,'\x64\x65\x63\x69\x73\x69\x6f\x6e':null};return{'\x63\x79\x63\x6c\x65\x49\x64':_0x27e815,'\x64\x65\x63\x69\x73\x69\x6f\x6e':{'\x61\x72\x6d\x49\x64':nonEmptyString(_0x5babbb[_0x5870e4(0x161,'\x5a\x51\x63\x72')+_0x5870e4(0x136,'\x54\x54\x37\x33')])??_0x4df9fc}};}function terminalReward(_0xb929a5){const _0x5f1c4e=_0x4925db;if(_0xb929a5[_0x5f1c4e(0x17c,'\x73\x39\x7a\x28')]!==_0x5f1c4e(0x13f,'\x6f\x52\x4f\x6c')+_0x5f1c4e(0x19d,'\x41\x5e\x46\x39')&&_0xb929a5[_0x5f1c4e(0x19b,'\x61\x6d\x4c\x57')]!==_0x5f1c4e(0x1bc,'\x43\x37\x40\x34')+_0x5f1c4e(0x13b,'\x6d\x58\x28\x5b'))return null;const _0x1a46be=_0xb929a5[_0x5f1c4e(0x1a2,'\x37\x56\x74\x77')],_0x43e991=nonEmptyString(_0x1a46be[_0x5f1c4e(0x181,'\x41\x5e\x46\x39')]);if(!_0x43e991)return null;if(_0xb929a5[_0x5f1c4e(0x15c,'\x37\x56\x74\x77')]==='\x63\x79\x63\x6c\x65\x2e\x66\x61'+_0x5f1c4e(0x1af,'\x5b\x24\x53\x48')||_0x1a46be[_0x5f1c4e(0x12e,'\x6d\x58\x28\x5b')+_0x5f1c4e(0x13d,'\x5e\x7a\x62\x4e')]===![])return{'\x63\x79\x63\x6c\x65\x49\x64':_0x43e991,'\x72\x65\x77\x61\x72\x64':0x0};return{'\x63\x79\x63\x6c\x65\x49\x64':_0x43e991,'\x72\x65\x77\x61\x72\x64':0x1};}export function deriveUcb1History(_0xe28e27){const _0xfe835e=_0x4925db,_0x40a0c2=new Map();for(const _0x5b622a of _0xe28e27){if(_0xfe835e(0x1bb,'\x47\x24\x4c\x52')===_0xfe835e(0x1a3,'\x5b\x24\x53\x48')){if(_0xfb4311[_0xfe835e(0x171,'\x33\x56\x4b\x4a')])_0x18a0c6[_0xfe835e(0x180,'\x50\x46\x52\x73')](_0x25bc7d[_0xfe835e(0x158,'\x7a\x59\x23\x43')],{'\x64\x65\x63\x69\x73\x69\x6f\x6e':_0x3b499b[_0xfe835e(0x1ae,'\x5a\x51\x63\x72')]});else _0x596c28[_0xfe835e(0x16b,'\x50\x39\x38\x48')](_0x175317['\x63\x79\x63\x6c\x65\x49\x64']);}else{const _0xd9b3ed=decisionProjection(_0x5b622a);if(_0xd9b3ed){if(_0xd9b3ed[_0xfe835e(0x143,'\x4b\x47\x4b\x6b')])_0x40a0c2[_0xfe835e(0x14a,'\x79\x5a\x6c\x70')](_0xd9b3ed[_0xfe835e(0x13a,'\x62\x4d\x42\x74')],{'\x64\x65\x63\x69\x73\x69\x6f\x6e':_0xd9b3ed[_0xfe835e(0x1a7,'\x50\x46\x52\x73')]});else _0x40a0c2[_0xfe835e(0x173,'\x4b\x31\x68\x54')](_0xd9b3ed[_0xfe835e(0x166,'\x38\x79\x56\x39')]);}const _0x4cbbbf=terminalReward(_0x5b622a);if(_0x4cbbbf){const _0x48e0ca=_0x40a0c2[_0xfe835e(0x17a,'\x50\x6d\x74\x79')](_0x4cbbbf[_0xfe835e(0x151,'\x73\x39\x7a\x28')]);if(_0x48e0ca)_0x48e0ca[_0xfe835e(0x1a5,'\x38\x79\x56\x39')]=_0x4cbbbf[_0xfe835e(0x19a,'\x4b\x7a\x70\x79')];}}}const _0x4f461f=new Map();for(const _0x3f5de7 of _0x40a0c2[_0xfe835e(0x169,'\x79\x5a\x6c\x70')]()){const _0x40ce87=_0x4f461f[_0xfe835e(0x14e,'\x4b\x7a\x70\x79')](_0x3f5de7[_0xfe835e(0x1a7,'\x50\x46\x52\x73')][_0xfe835e(0x190,'\x73\x39\x7a\x28')])??{'\x70\x75\x6c\x6c\x73':0x0,'\x63\x6f\x6d\x70\x6c\x65\x74\x65\x64\x50\x75\x6c\x6c\x73':0x0,'\x72\x65\x77\x61\x72\x64\x53\x75\x6d':0x0};_0x40ce87[_0xfe835e(0x187,'\x5b\x23\x41\x6e')]+=-0x64e+0x6e4+-0x95;if(_0x3f5de7[_0xfe835e(0x1a8,'\x63\x78\x55\x71')]!==undefined){if(_0xfe835e(0x139,'\x23\x75\x75\x30')===_0xfe835e(0x1b8,'\x6f\x68\x72\x73'))_0x40ce87[_0xfe835e(0x1a1,'\x72\x21\x46\x2a')+_0xfe835e(0x157,'\x37\x56\x74\x77')]+=0x1e58+-0x1c2b*-0x1+-0x2*0x1d41,_0x40ce87[_0xfe835e(0x14d,'\x5a\x51\x63\x72')+'\x6d']+=_0x3f5de7[_0xfe835e(0x142,'\x41\x5e\x46\x39')];else{const _0x2d9146=_0x24b18a['\x67\x65\x74'](_0x2fb01b[_0xfe835e(0x12f,'\x70\x65\x4e\x29')]);if(_0x2d9146)_0x2d9146[_0xfe835e(0x1be,'\x4a\x49\x4d\x72')]=_0x21e593[_0xfe835e(0x144,'\x62\x4d\x42\x74')];}}_0x4f461f['\x73\x65\x74'](_0x3f5de7['\x64\x65\x63\x69\x73\x69\x6f\x6e']['\x61\x72\x6d\x49\x64'],_0x40ce87);}const _0x5cf41e=new Map();for(const [_0x37a234,_0x197f58]of _0x4f461f){_0x5cf41e[_0xfe835e(0x141,'\x6b\x47\x4a\x6b')](_0x37a234,{'\x61\x72\x6d\x49\x64':_0x37a234,..._0x197f58,'\x6d\x65\x61\x6e\x52\x65\x77\x61\x72\x64':_0x197f58[_0xfe835e(0x156,'\x47\x24\x4c\x52')+_0xfe835e(0x154,'\x40\x5e\x61\x41')]>-0x1e34*0x1+-0x2689+0x44bd*0x1?_0x197f58[_0xfe835e(0x1a6,'\x21\x34\x21\x23')+'\x6d']/_0x197f58[_0xfe835e(0x13c,'\x40\x5e\x61\x41')+_0xfe835e(0x157,'\x37\x56\x74\x77')]:0x1e6c+0x195c+-0x37c8});}return{'\x61\x72\x6d\x73':_0x5cf41e,'\x74\x6f\x74\x61\x6c\x50\x75\x6c\x6c\x73':_0x40a0c2['\x73\x69\x7a\x65']};}function _0x4fd6(_0x2128f9,_0x50f778){_0x2128f9=_0x2128f9-(-0x21b9+-0xca6*0x1+-0x17c5*-0x2);const _0x5be239=_0xf04b();let _0x3bd4c1=_0x5be239[_0x2128f9];if(_0x4fd6['\x46\x76\x79\x61\x58\x62']===undefined){var _0x2c292e=function(_0xa4fef){const _0x368d15='\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x2b\x2f\x3d';let _0x2dcd17='',_0x1bfae4='';for(let _0x356a8f=0x159*0x1b+0x2260+0xe27*-0x5,_0x4b7c5a,_0xfe105e,_0x4968f4=-0x13*0x4b+0xf53*-0x2+-0x7f*-0x49;_0xfe105e=_0xa4fef['\x63\x68\x61\x72\x41\x74'](_0x4968f4++);~_0xfe105e&&(_0x4b7c5a=_0x356a8f%(-0x1d*-0xd4+0x45e+0x1c5e*-0x1)?_0x4b7c5a*(-0x2*-0x108d+0x898+-0x2*0x14b9)+_0xfe105e:_0xfe105e,_0x356a8f++%(-0x2008+0x5f3*0x5+-0x1f*-0x13))?_0x2dcd17+=String['\x66\x72\x6f\x6d\x43\x68\x61\x72\x43\x6f\x64\x65'](-0x11da*-0x1+-0xdbd*0x2+-0x1*-0xa9f&_0x4b7c5a>>(-(0x16*0xa6+-0x21e+0x103*-0xc)*_0x356a8f&-0x14d8+0x1e0b*0x1+-0x92d)):-0x3e*-0x1+-0x1cd+-0x18f*-0x1){_0xfe105e=_0x368d15['\x69\x6e\x64\x65\x78\x4f\x66'](_0xfe105e);}for(let _0x127c96=0xaae+0xa2a+-0x14d8,_0x3ab88b=_0x2dcd17['\x6c\x65\x6e\x67\x74\x68'];_0x127c96<_0x3ab88b;_0x127c96++){_0x1bfae4+='\x25'+('\x30\x30'+_0x2dcd17['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x127c96)['\x74\x6f\x53\x74\x72\x69\x6e\x67'](-0x827*0x1+0x981+-0x14a))['\x73\x6c\x69\x63\x65'](-(0x2416+-0x902+-0x2b5*0xa));}return decodeURIComponent(_0x1bfae4);};const _0x4dba97=function(_0x392ff2,_0x532197){let _0x793b56=[],_0xd062e8=-0x1*0x18e9+0x5*0x448+0x381,_0x5943c5,_0x59dceb='';_0x392ff2=_0x2c292e(_0x392ff2);let _0x24a458;for(_0x24a458=0x834+-0x71d+-0x1*0x117;_0x24a458<-0x14*-0x146+-0xb*0x13d+-0xad9;_0x24a458++){_0x793b56[_0x24a458]=_0x24a458;}for(_0x24a458=0x6c4+-0xf*0x6c+0x2*-0x38;_0x24a458<0x16a7*-0x1+-0x2089+-0x3830*-0x1;_0x24a458++){_0xd062e8=(_0xd062e8+_0x793b56[_0x24a458]+_0x532197['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x24a458%_0x532197['\x6c\x65\x6e\x67\x74\x68']))%(0x2417+0x1*0xe68+-0x317f),_0x5943c5=_0x793b56[_0x24a458],_0x793b56[_0x24a458]=_0x793b56[_0xd062e8],_0x793b56[_0xd062e8]=_0x5943c5;}_0x24a458=-0x10f6+0x77+0x107f*0x1,_0xd062e8=0x4*0x971+-0x26a8+0xe4;for(let _0x4ef628=-0x11dd*0x2+0x31*-0x49+0x31b3;_0x4ef628<_0x392ff2['\x6c\x65\x6e\x67\x74\x68'];_0x4ef628++){_0x24a458=(_0x24a458+(0x527+0x2555+0x1*-0x2a7b))%(0x1*-0x77b+-0x1154+-0x19cf*-0x1),_0xd062e8=(_0xd062e8+_0x793b56[_0x24a458])%(0x5*-0x6b+-0x1f5d+0x3d4*0x9),_0x5943c5=_0x793b56[_0x24a458],_0x793b56[_0x24a458]=_0x793b56[_0xd062e8],_0x793b56[_0xd062e8]=_0x5943c5,_0x59dceb+=String['\x66\x72\x6f\x6d\x43\x68\x61\x72\x43\x6f\x64\x65'](_0x392ff2['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x4ef628)^_0x793b56[(_0x793b56[_0x24a458]+_0x793b56[_0xd062e8])%(-0x1315+-0x1339+0x274e)]);}return _0x59dceb;};_0x4fd6['\x68\x6c\x53\x44\x50\x7a']=_0x4dba97,_0x4fd6['\x47\x42\x78\x6e\x68\x71']={},_0x4fd6['\x46\x76\x79\x61\x58\x62']=!![];}const _0x1681de=_0x5be239[-0xd89+0x73*0x22+-0x1*0x1bd],_0x1a6048=_0x2128f9+_0x1681de,_0x39e306=_0x4fd6['\x47\x42\x78\x6e\x68\x71'][_0x1a6048];return!_0x39e306?(_0x4fd6['\x75\x66\x4f\x46\x57\x59']===undefined&&(_0x4fd6['\x75\x66\x4f\x46\x57\x59']=!![]),_0x3bd4c1=_0x4fd6['\x68\x6c\x53\x44\x50\x7a'](_0x3bd4c1,_0x50f778),_0x4fd6['\x47\x42\x78\x6e\x68\x71'][_0x1a6048]=_0x3bd4c1):_0x3bd4c1=_0x39e306,_0x3bd4c1;}function emptyStats(_0xc2eb1a){return{'\x61\x72\x6d\x49\x64':_0xc2eb1a,'\x70\x75\x6c\x6c\x73':0x0,'\x63\x6f\x6d\x70\x6c\x65\x74\x65\x64\x50\x75\x6c\x6c\x73':0x0,'\x72\x65\x77\x61\x72\x64\x53\x75\x6d':0x0,'\x6d\x65\x61\x6e\x52\x65\x77\x61\x72\x64':0x0};}function _0xf04b(){const _0x1b3932=['\x57\x52\x4f\x71\x6c\x43\x6f\x31\x62\x66\x52\x63\x53\x53\x6f\x37','\x57\x51\x42\x64\x55\x4c\x61\x79\x78\x66\x68\x64\x4a\x43\x6f\x2b','\x57\x50\x33\x63\x52\x38\x6b\x4f\x61\x4b\x7a\x48\x57\x36\x68\x64\x55\x43\x6b\x69\x57\x34\x53\x59\x57\x4f\x47\x4f','\x57\x52\x38\x77\x57\x4f\x4e\x63\x53\x65\x46\x64\x50\x71\x42\x63\x4a\x61','\x57\x52\x61\x64\x41\x53\x6f\x61\x57\x35\x79\x38','\x57\x4f\x33\x64\x49\x4d\x34\x50','\x57\x51\x37\x63\x52\x47\x34','\x57\x36\x4e\x64\x4b\x38\x6f\x7a\x65\x61','\x57\x35\x75\x63\x45\x38\x6b\x5a\x74\x47','\x6d\x59\x52\x63\x4d\x63\x52\x63\x48\x38\x6f\x74\x73\x6d\x6f\x72','\x57\x52\x61\x2f\x57\x51\x2f\x64\x4d\x53\x6f\x52\x43\x53\x6b\x33\x57\x51\x38','\x57\x34\x7a\x44\x57\x51\x4f\x6a\x57\x4f\x4e\x64\x4e\x62\x2f\x63\x56\x47','\x57\x35\x74\x63\x4a\x62\x57\x33\x76\x38\x6f\x69\x57\x37\x6d','\x57\x51\x53\x7a\x42\x6d\x6b\x66\x57\x34\x61','\x44\x6d\x6b\x36\x57\x52\x4b','\x45\x53\x6b\x6d\x57\x37\x6a\x74\x6e\x53\x6f\x68','\x6a\x6d\x6f\x71\x57\x52\x35\x79\x57\x35\x4a\x64\x52\x57\x43\x39','\x43\x58\x34\x68\x6c\x33\x52\x64\x4b\x38\x6b\x30\x57\x36\x75','\x57\x52\x4f\x71\x6c\x43\x6f\x31\x62\x66\x4f','\x57\x36\x78\x64\x53\x31\x37\x64\x4e\x4a\x4c\x79','\x57\x52\x53\x35\x44\x57','\x66\x43\x6b\x65\x57\x35\x74\x64\x49\x67\x74\x64\x56\x43\x6b\x74\x57\x50\x38\x45','\x57\x52\x34\x77\x57\x4f\x68\x63\x4f\x65\x46\x64\x54\x61','\x57\x51\x64\x64\x4d\x6d\x6b\x45\x57\x51\x2f\x64\x4f\x58\x6d','\x46\x38\x6f\x7a\x64\x33\x76\x33\x57\x34\x5a\x64\x55\x63\x57','\x57\x52\x75\x57\x7a\x53\x6b\x35','\x41\x43\x6b\x42\x57\x36\x48\x62','\x57\x50\x43\x38\x66\x6d\x6f\x73\x70\x33\x64\x63\x51\x6d\x6f\x41','\x79\x31\x5a\x63\x51\x48\x2f\x64\x50\x53\x6b\x74\x57\x37\x68\x63\x55\x71','\x57\x4f\x35\x44\x57\x50\x6d','\x45\x6d\x6f\x74\x61\x68\x48\x78\x57\x35\x68\x64\x54\x4a\x61','\x57\x4f\x65\x59\x57\x52\x33\x63\x49\x4e\x46\x64\x4b\x63\x78\x63\x52\x71','\x57\x37\x6d\x2b\x57\x52\x30','\x45\x48\x4f\x75','\x6c\x4b\x52\x64\x4c\x38\x6b\x34\x45\x71','\x41\x53\x6b\x56\x57\x51\x61\x58\x57\x37\x30','\x41\x43\x6b\x54\x57\x50\x42\x64\x49\x76\x75\x76\x79\x38\x6b\x68','\x43\x66\x61\x4c\x43\x43\x6b\x5a','\x57\x37\x74\x64\x52\x31\x4e\x64\x48\x5a\x38\x74\x57\x52\x39\x6f','\x57\x52\x42\x64\x4b\x43\x6f\x55\x57\x51\x46\x63\x4f\x59\x72\x63\x62\x71','\x57\x51\x64\x64\x4d\x6d\x6b\x6e\x57\x52\x56\x64\x53\x48\x69','\x57\x34\x58\x44\x57\x51\x4b\x38\x57\x4f\x4e\x64\x4b\x61\x5a\x63\x53\x47','\x57\x51\x4e\x64\x52\x66\x6d\x64\x57\x4f\x61\x6e\x61\x75\x75','\x43\x43\x6b\x58\x57\x36\x4f','\x43\x32\x2f\x64\x4a\x74\x74\x63\x49\x47','\x57\x51\x4f\x46\x57\x4f\x52\x63\x55\x4c\x79','\x45\x66\x6c\x64\x4e\x47','\x73\x74\x56\x64\x4f\x64\x75','\x69\x71\x56\x63\x48\x68\x57\x30\x62\x74\x6c\x63\x4a\x75\x6c\x63\x56\x71','\x6e\x61\x4c\x30\x66\x43\x6f\x6a\x57\x37\x74\x64\x51\x6d\x6f\x5a\x72\x43\x6b\x6e\x67\x43\x6f\x66\x6f\x57','\x57\x50\x70\x64\x4e\x31\x58\x54\x79\x43\x6f\x4f\x57\x35\x54\x31\x57\x37\x4b\x68','\x57\x36\x65\x47\x57\x52\x43\x62\x66\x72\x68\x64\x4a\x73\x38','\x77\x61\x39\x49\x77\x6d\x6b\x48\x57\x4f\x6d\x44','\x57\x36\x74\x64\x4f\x4b\x4a\x64\x47\x4a\x72\x41','\x65\x68\x78\x64\x53\x72\x79','\x71\x6d\x6b\x58\x57\x36\x6c\x64\x48\x33\x78\x64\x52\x43\x6f\x46\x57\x36\x47','\x79\x38\x6b\x35\x6e\x47','\x66\x6d\x6b\x6d\x57\x35\x42\x63\x51\x68\x56\x64\x54\x53\x6b\x6e\x57\x4f\x4b\x45\x67\x47','\x6c\x4b\x4e\x64\x50\x43\x6b\x61\x43\x43\x6f\x69\x6d\x47','\x74\x30\x52\x63\x55\x62\x74\x64\x47\x6d\x6b\x2f\x57\x36\x69','\x57\x51\x53\x41\x6e\x38\x6f\x4b\x67\x4c\x56\x63\x4c\x43\x6f\x52','\x76\x53\x6f\x39\x6e\x65\x6e\x78\x57\x36\x74\x64\x4b\x71\x43','\x41\x4d\x70\x64\x4f\x47\x78\x63\x4c\x71','\x57\x52\x5a\x64\x4d\x38\x6f\x6c\x57\x51\x6c\x63\x51\x61\x72\x73','\x57\x37\x30\x37\x57\x52\x57\x6d\x62\x48\x56\x64\x4a\x73\x38','\x57\x51\x39\x49\x57\x34\x61\x32\x57\x52\x35\x74\x7a\x43\x6f\x33','\x57\x35\x5a\x63\x54\x4c\x57\x73\x45\x57','\x45\x38\x6b\x44\x57\x36\x72\x67\x6e\x57','\x79\x43\x6b\x59\x6f\x6d\x6f\x51\x57\x52\x44\x70\x43\x74\x53','\x6f\x61\x4e\x64\x56\x75\x4a\x63\x4a\x43\x6f\x61\x57\x52\x6c\x63\x53\x74\x34\x75\x57\x37\x57\x42\x57\x35\x34','\x66\x61\x56\x64\x53\x57','\x57\x37\x6c\x64\x4d\x53\x6f\x6c\x66\x75\x52\x64\x48\x71','\x44\x6d\x6b\x4d\x57\x36\x71\x41\x57\x34\x5a\x63\x54\x43\x6b\x56\x57\x50\x79','\x57\x51\x33\x64\x48\x38\x6f\x46\x57\x51\x2f\x63\x56\x59\x4b','\x6b\x77\x4a\x63\x47\x4e\x38','\x57\x35\x2f\x64\x54\x53\x6f\x59\x69\x68\x33\x64\x50\x53\x6b\x36\x57\x37\x53','\x57\x51\x4e\x64\x53\x78\x65\x70\x57\x50\x79','\x57\x4f\x5a\x63\x4b\x77\x53\x45\x57\x35\x34','\x57\x51\x33\x64\x56\x4d\x30','\x6e\x6d\x6b\x56\x57\x4f\x43','\x6f\x53\x6f\x71\x57\x51\x44\x45\x57\x35\x37\x64\x4f\x57','\x57\x36\x31\x4f\x6f\x38\x6f\x4f\x57\x52\x2f\x64\x4b\x64\x71\x32\x74\x38\x6b\x44\x74\x6d\x6b\x67\x57\x50\x65','\x41\x43\x6f\x7a\x67\x33\x31\x32\x57\x34\x68\x64\x48\x64\x43','\x57\x51\x75\x64\x41\x71','\x75\x6d\x6f\x6a\x57\x4f\x37\x64\x54\x33\x47','\x43\x53\x6b\x2b\x6e\x38\x6f\x51\x57\x51\x65','\x57\x51\x5a\x63\x50\x71\x62\x52\x78\x53\x6f\x62\x57\x50\x69','\x45\x53\x6b\x49\x57\x51\x69\x50\x57\x36\x56\x63\x48\x67\x4f','\x44\x53\x6f\x36\x57\x34\x6c\x63\x4b\x47\x44\x34\x69\x43\x6f\x73\x57\x51\x68\x64\x55\x66\x52\x64\x56\x63\x64\x63\x50\x57','\x57\x51\x48\x44\x57\x35\x47\x51\x57\x52\x35\x66','\x57\x37\x65\x78\x76\x30\x46\x64\x4f\x4e\x65','\x7a\x76\x71\x48\x75\x53\x6b\x44\x57\x51\x4e\x63\x50\x6d\x6f\x64','\x57\x34\x64\x63\x56\x72\x61\x33\x76\x6d\x6f\x41','\x57\x37\x34\x6c\x41\x30\x52\x64\x54\x76\x75\x76','\x75\x38\x6f\x65\x57\x4f\x52\x63\x4d\x38\x6f\x68','\x78\x43\x6b\x63\x57\x35\x38\x53\x57\x36\x5a\x63\x4e\x43\x6b\x67\x57\x52\x30','\x57\x51\x33\x63\x56\x72\x62\x49\x41\x6d\x6f\x52\x57\x50\x4b\x2f','\x57\x35\x64\x63\x4c\x62\x75\x2b','\x69\x53\x6f\x68\x57\x51\x62\x75','\x7a\x6d\x6b\x6d\x57\x36\x7a\x67\x69\x43\x6f\x68','\x57\x37\x42\x64\x50\x66\x43','\x74\x43\x6b\x54\x57\x35\x6d','\x41\x6d\x6f\x7a\x61\x68\x4c\x4e\x57\x35\x68\x64\x53\x49\x79','\x6f\x63\x46\x64\x49\x43\x6b\x2f\x57\x51\x4a\x63\x56\x43\x6f\x31\x57\x36\x4b','\x42\x62\x52\x63\x52\x53\x6f\x41\x6c\x38\x6b\x72\x79\x6d\x6b\x6c\x6f\x47\x78\x63\x56\x43\x6b\x6e\x76\x6d\x6f\x30','\x43\x53\x6f\x73\x63\x68\x4c\x38','\x64\x6d\x6b\x41\x57\x35\x4a\x64\x48\x38\x6b\x67\x57\x51\x43\x34\x57\x52\x43\x6e\x65\x4b\x42\x64\x4b\x61\x34','\x41\x38\x6b\x71\x57\x36\x7a\x45\x69\x43\x6f\x51\x6d\x71','\x79\x57\x69\x75\x69\x57','\x6a\x65\x54\x43\x43\x33\x33\x64\x4b\x6d\x6b\x41\x57\x37\x4c\x46\x57\x51\x75','\x6d\x43\x6b\x52\x57\x50\x2f\x64\x4b\x4c\x75\x35','\x42\x43\x6b\x65\x57\x37\x76\x67\x70\x43\x6f\x38\x6a\x73\x34','\x57\x51\x37\x63\x54\x33\x56\x63\x56\x43\x6b\x75\x57\x34\x53','\x57\x4f\x68\x63\x48\x4d\x47\x57\x57\x34\x37\x63\x53\x61','\x45\x6d\x6b\x43\x57\x36\x4c\x45\x6e\x57','\x57\x52\x46\x64\x55\x68\x30','\x43\x53\x6b\x49\x57\x37\x71\x77\x57\x36\x5a\x63\x56\x38\x6b\x56\x57\x4f\x4f','\x57\x34\x66\x49\x57\x52\x69\x76\x57\x4f\x4e\x64\x49\x47','\x6c\x78\x68\x63\x55\x32\x76\x74\x72\x67\x31\x52','\x44\x6d\x6f\x56\x57\x51\x4e\x63\x56\x38\x6f\x52\x57\x35\x48\x41\x57\x50\x53','\x74\x43\x6b\x4e\x57\x34\x4a\x64\x49\x32\x2f\x64\x4f\x71','\x65\x43\x6b\x6d\x57\x35\x70\x63\x52\x4a\x5a\x63\x50\x38\x6f\x53\x57\x37\x4f\x4c\x65\x6d\x6b\x45\x70\x6d\x6f\x42\x57\x50\x75','\x57\x51\x37\x63\x54\x33\x74\x63\x53\x43\x6b\x74\x57\x34\x43\x6e\x57\x35\x65','\x57\x52\x65\x73\x46\x6d\x6f\x76\x57\x35\x43','\x57\x4f\x56\x63\x49\x4d\x4f\x4a\x57\x35\x2f\x63\x51\x47','\x57\x4f\x33\x63\x54\x33\x4e\x63\x56\x43\x6b\x50\x57\x34\x4f','\x57\x51\x38\x68\x7a\x71','\x46\x53\x6b\x2b\x57\x52\x75','\x46\x6d\x6b\x4a\x57\x52\x65\x50\x57\x36\x68\x63\x56\x32\x2f\x63\x47\x71','\x57\x52\x56\x63\x50\x72\x6e\x49','\x57\x34\x43\x65\x44\x57','\x43\x53\x6b\x35\x6e\x6d\x6f\x49\x57\x51\x43\x63\x79\x5a\x6d','\x75\x59\x74\x64\x54\x49\x72\x53','\x7a\x62\x34\x71','\x57\x36\x70\x64\x48\x53\x6f\x46\x67\x66\x33\x64\x51\x6d\x6b\x42','\x78\x59\x56\x64\x56\x4a\x76\x38','\x6e\x62\x78\x63\x47\x73\x6c\x63\x55\x6d\x6f\x75','\x57\x36\x52\x63\x4d\x53\x6b\x45\x57\x50\x33\x63\x4f\x49\x76\x34\x6e\x43\x6b\x63','\x62\x48\x5a\x64\x51\x53\x6b\x49\x57\x4f\x4b','\x79\x66\x4a\x64\x4b\x4e\x34','\x57\x51\x52\x64\x50\x68\x39\x62\x57\x4f\x4f','\x46\x49\x42\x64\x4f\x74\x50\x35\x42\x65\x35\x4a\x57\x35\x48\x48','\x71\x38\x6f\x74\x57\x4f\x2f\x64\x51\x32\x46\x64\x53\x6d\x6b\x50\x57\x51\x38','\x61\x68\x78\x64\x53\x62\x46\x63\x54\x57\x4e\x64\x53\x6d\x6b\x4a','\x57\x50\x76\x67\x69\x53\x6f\x59\x73\x43\x6b\x57\x57\x35\x79\x44\x77\x38\x6b\x4c','\x61\x4e\x37\x63\x53\x72\x56\x63\x49\x58\x34','\x70\x61\x56\x64\x55\x75\x46\x63\x48\x43\x6f\x6f\x57\x52\x64\x64\x4f\x74\x79\x51\x57\x36\x69\x77\x57\x36\x75\x51','\x57\x52\x70\x64\x4a\x38\x6b\x78\x57\x50\x70\x64\x50\x61','\x57\x51\x42\x63\x56\x78\x74\x63\x55\x43\x6b\x6d\x57\x34\x53\x48\x57\x35\x61','\x57\x51\x37\x63\x52\x47\x35\x6f\x78\x57','\x57\x34\x7a\x44\x57\x51\x53\x44\x57\x52\x42\x64\x4a\x71\x52\x63\x51\x71','\x57\x51\x4b\x68\x6e\x57','\x76\x48\x6e\x47\x77\x53\x6b\x77\x57\x51\x38\x6f\x57\x37\x79','\x63\x57\x68\x64\x4f\x61','\x76\x38\x6f\x41\x57\x4f\x2f\x63\x4a\x6d\x6f\x41'];_0xf04b=function(){return _0x1b3932;};return _0xf04b();}export function ucb1StatsForCandidate(_0x5a90ca,_0x2f14e6,_0x4a1861,_0x481f13=!![]){const _0x48ff6a=_0x4925db,_0x1e1e1a=_0x4a1861??_0x2f14e6,_0x43227b=_0x4a1861===undefined?[_0x2f14e6]:[...new Set([_0x4a1861,..._0x481f13?[_0x2f14e6]:[]])],_0x3c40ca=_0x43227b[_0x48ff6a(0x1b7,'\x50\x46\x52\x73')](_0x1adb65=>_0x5a90ca[_0x48ff6a(0x1b0,'\x38\x79\x56\x39')][_0x48ff6a(0x1aa,'\x5b\x24\x53\x48')](_0x1adb65))[_0x48ff6a(0x177,'\x5e\x74\x43\x75')](_0x50730b=>_0x50730b!==undefined);if(_0x3c40ca['\x6c\x65\x6e\x67\x74\x68']===-0x3d1*-0x3+-0x12f4+0x781)return emptyStats(_0x1e1e1a);const _0x2ddd0d=_0x3c40ca['\x72\x65\x64\x75\x63\x65']((_0x82275,_0x33b030)=>_0x82275+_0x33b030[_0x48ff6a(0x150,'\x6f\x52\x4f\x6c')],0x1*-0x1327+-0xd95+0x20bc),_0xa048b8=_0x3c40ca[_0x48ff6a(0x1ad,'\x4a\x49\x4d\x72')]((_0x5e8f7e,_0x284a0a)=>_0x5e8f7e+_0x284a0a[_0x48ff6a(0x189,'\x54\x69\x44\x33')+_0x48ff6a(0x170,'\x72\x21\x46\x2a')],0x23e9+-0x7e5+0xb*-0x28c),_0x189730=_0x3c40ca[_0x48ff6a(0x1a9,'\x43\x37\x40\x34')]((_0x2cf0e2,_0x5964e4)=>_0x2cf0e2+_0x5964e4[_0x48ff6a(0x196,'\x63\x78\x55\x71')+'\x6d'],0x2*-0xdd+0x3*-0x963+0x1de3);return{'\x61\x72\x6d\x49\x64':_0x1e1e1a,'\x70\x75\x6c\x6c\x73':_0x2ddd0d,'\x63\x6f\x6d\x70\x6c\x65\x74\x65\x64\x50\x75\x6c\x6c\x73':_0xa048b8,'\x72\x65\x77\x61\x72\x64\x53\x75\x6d':_0x189730,'\x6d\x65\x61\x6e\x52\x65\x77\x61\x72\x64':_0xa048b8>-0x398+0x8b*-0x1+-0x423*-0x1?_0x189730/_0xa048b8:0x16*0x55+0x2137+-0x17*0x1c3};}function finiteBaseScore(_0x4a95a8){const _0x2b9371=_0x4925db;return Number[_0x2b9371(0x132,'\x4b\x31\x68\x54')](_0x4a95a8)?_0x4a95a8:Number[_0x2b9371(0x172,'\x38\x5a\x6b\x24')+_0x2b9371(0x1b1,'\x63\x78\x55\x71')+'\x59'];}function finiteCount(_0x415984){const _0x5bb962=_0x4925db;return Number[_0x5bb962(0x1c0,'\x34\x78\x26\x77')](_0x415984)?Math[_0x5bb962(0x16e,'\x5b\x23\x41\x6e')](Number[_0x5bb962(0x1b5,'\x72\x45\x4f\x70')+_0x5bb962(0x162,'\x6b\x47\x4a\x6b')],Math[_0x5bb962(0x1c3,'\x72\x45\x4f\x70')](Math[_0x5bb962(0x179,'\x4b\x7a\x70\x79')](0x1*-0x1a39+0x20a6+0x5*-0x149,_0x415984))):0x191a+0x2580+-0x3e9a;}function finiteMeanReward(_0x4329a1){const _0x3f768f=_0x4925db;return Number[_0x3f768f(0x1bd,'\x62\x4d\x42\x74')](_0x4329a1)?Math[_0x3f768f(0x1a4,'\x50\x6d\x74\x79')](0x8ad+-0x115a+0x1*0x8ad,Math[_0x3f768f(0x1c4,'\x4c\x65\x36\x47')](0x97*-0x1+0x21*-0x109+-0x29*-0xd9,_0x4329a1)):0xe93*-0x2+0x296*-0xb+0x1ccc*0x2;}function saturatingCountSum(_0x5c1d8a,_0x3b29f8){const _0x1e19c6=_0x4925db,_0x99b1d0=finiteCount(_0x3b29f8);return _0x5c1d8a>=Number[_0x1e19c6(0x15a,'\x4b\x47\x4b\x6b')+_0x1e19c6(0x146,'\x41\x5e\x46\x39')]-_0x99b1d0?Number[_0x1e19c6(0x138,'\x5a\x51\x63\x72')+_0x1e19c6(0x197,'\x61\x6d\x4c\x57')]:_0x5c1d8a+_0x99b1d0;}export function chooseUcb1Arm(_0x58e2ab,_0x23e452){const _0x30c712=_0x4925db;if(_0x58e2ab[_0x30c712(0x14b,'\x21\x34\x21\x23')]===0x1dc5*-0x1+0x1a73+0x352)return{'\x63\x68\x6f\x69\x63\x65':null,'\x66\x61\x6c\x6c\x62\x61\x63\x6b\x52\x65\x61\x73\x6f\x6e':_0x30c712(0x16a,'\x38\x79\x56\x39')+'\x6f\x6c'};if(_0x58e2ab[_0x30c712(0x131,'\x72\x72\x46\x6b')](_0xecfbf5=>!_0xecfbf5[_0x30c712(0x17b,'\x50\x6d\x74\x79')+_0x30c712(0x1bf,'\x72\x21\x46\x2a')+_0x30c712(0x1b6,'\x6d\x58\x28\x5b')]))return{'\x63\x68\x6f\x69\x63\x65':null,'\x66\x61\x6c\x6c\x62\x61\x63\x6b\x52\x65\x61\x73\x6f\x6e':'\x69\x6e\x65\x6c\x69\x67\x69\x62'+_0x30c712(0x155,'\x7a\x59\x23\x43')};const _0x41ca94=Math[_0x30c712(0x149,'\x34\x78\x26\x77')](-0x1*0xeed+0x69d*0x3+-0x4e9,finiteCount(_0x23e452),_0x58e2ab[_0x30c712(0x1ac,'\x72\x45\x4f\x70')]((_0x26b380,_0x3728bd)=>saturatingCountSum(_0x26b380,_0x3728bd[_0x30c712(0x19e,'\x6f\x4f\x4d\x32')][_0x30c712(0x14f,'\x54\x69\x44\x33')]),0x89*-0x21+-0x21*0xa7+0x2730)),_0xdb6469=_0x58e2ab[_0x30c712(0x1b3,'\x58\x74\x57\x36')](_0x4a5c2b=>{const _0x3f5129=_0x30c712,_0x3acf80=finiteCount(_0x4a5c2b[_0x3f5129(0x176,'\x4b\x7a\x70\x79')]['\x70\x75\x6c\x6c\x73']),_0x37bf5f=finiteMeanReward(_0x4a5c2b[_0x3f5129(0x1b9,'\x50\x6d\x74\x79')][_0x3f5129(0x193,'\x70\x65\x4e\x29')+'\x72\x64']),_0x5a499e=_0x3acf80===0xb5*0x5+0x11bb*-0x1+0x9e*0x17,_0x43c4dd=_0x5a499e?null:Math[_0x3f5129(0x1c5,'\x5a\x78\x70\x67')]((0x1b*-0xa7+-0xc7e+0xd*0x251)*Math[_0x3f5129(0x194,'\x6b\x47\x4a\x6b')](_0x41ca94)/_0x3acf80),_0x4e5b56=_0x5a499e?null:_0x37bf5f+_0x43c4dd;return{'\x61\x72\x6d':_0x4a5c2b,'\x70\x75\x6c\x6c\x73':_0x3acf80,'\x6d\x65\x61\x6e\x52\x65\x77\x61\x72\x64':_0x37bf5f,'\x63\x6f\x6c\x64\x53\x74\x61\x72\x74':_0x5a499e,'\x62\x6f\x6e\x75\x73':_0x43c4dd,'\x69\x6e\x64\x65\x78':_0x4e5b56};})['\x73\x6f\x72\x74']((_0x911117,_0x30d09a)=>{const _0xb99cbe=_0x30c712;if(_0x911117[_0xb99cbe(0x19f,'\x66\x2a\x6a\x67')+'\x74']!==_0x30d09a[_0xb99cbe(0x1b4,'\x5a\x51\x63\x72')+'\x74'])return _0x911117[_0xb99cbe(0x18a,'\x72\x72\x46\x6b')+'\x74']?-(-0x15e8+0x3*0x9ff+-0x814):0x91+-0x110e+0x107e*0x1;if(_0x911117[_0xb99cbe(0x1c2,'\x23\x75\x75\x30')]!==null&&_0x30d09a[_0xb99cbe(0x159,'\x38\x5a\x6b\x24')]!==null&&_0x911117[_0xb99cbe(0x1c2,'\x23\x75\x75\x30')]!==_0x30d09a[_0xb99cbe(0x17f,'\x5a\x78\x70\x67')])return _0x30d09a[_0xb99cbe(0x147,'\x34\x78\x26\x77')]-_0x911117['\x69\x6e\x64\x65\x78'];const _0x54c6c1=finiteBaseScore(_0x911117[_0xb99cbe(0x192,'\x63\x78\x55\x71')][_0xb99cbe(0x15b,'\x73\x39\x7a\x28')+'\x65']),_0x354848=finiteBaseScore(_0x30d09a[_0xb99cbe(0x133,'\x6f\x52\x4f\x6c')][_0xb99cbe(0x16f,'\x4b\x47\x4b\x6b')+'\x65']);return _0x354848!==_0x54c6c1?_0x354848-_0x54c6c1:_0x911117[_0xb99cbe(0x15f,'\x43\x37\x40\x34')][_0xb99cbe(0x18e,'\x4a\x49\x4d\x72')][_0xb99cbe(0x18f,'\x50\x39\x38\x48')+_0xb99cbe(0x195,'\x38\x5a\x6b\x24')](_0x30d09a[_0xb99cbe(0x19c,'\x73\x39\x7a\x28')][_0xb99cbe(0x148,'\x5e\x74\x43\x75')]);}),_0x33a0a4=_0xdb6469[-0x1f42+0x1*-0x2378+-0x49*-0xea];return{'\x63\x68\x6f\x69\x63\x65':{'\x61\x72\x6d\x49\x64':_0x33a0a4[_0x30c712(0x1c1,'\x4b\x47\x4b\x6b')][_0x30c712(0x185,'\x6b\x47\x4a\x6b')],'\x70\x75\x6c\x6c\x73':_0x33a0a4[_0x30c712(0x16d,'\x38\x79\x56\x39')],'\x63\x6f\x6d\x70\x6c\x65\x74\x65\x64\x50\x75\x6c\x6c\x73':finiteCount(_0x33a0a4[_0x30c712(0x17d,'\x6f\x4f\x4d\x32')][_0x30c712(0x13e,'\x38\x79\x56\x39')][_0x30c712(0x137,'\x63\x78\x55\x71')+_0x30c712(0x183,'\x66\x2a\x6a\x67')]),'\x74\x6f\x74\x61\x6c\x50\x75\x6c\x6c\x73':_0x41ca94,'\x6d\x65\x61\x6e\x52\x65\x77\x61\x72\x64':_0x33a0a4[_0x30c712(0x1b2,'\x54\x54\x37\x33')+'\x72\x64'],'\x62\x6f\x6e\x75\x73':_0x33a0a4['\x62\x6f\x6e\x75\x73'],'\x69\x6e\x64\x65\x78':_0x33a0a4[_0x30c712(0x164,'\x5a\x51\x63\x72')],'\x63\x6f\x6c\x64\x53\x74\x61\x72\x74':_0x33a0a4[_0x30c712(0x191,'\x72\x21\x46\x2a')+'\x74']}};}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AssetSyncRecord } from './assetSyncLedger.js';
|
|
1
|
+
import type { AssetSyncInventorySegmentRecord, AssetSyncRecord, AssetSyncRunRecord } from './assetSyncLedger.js';
|
|
2
2
|
import type { ProvenanceRecord } from './provenance.js';
|
|
3
3
|
import type { ReviewRecord } from './reviewLedger.js';
|
|
4
4
|
export type AssetSidecarKind = 'provenance' | 'review' | 'asset-sync';
|
|
@@ -20,4 +20,9 @@ export declare function parseSidecarJsonl<T>(raw: string, parseRecord: (value: u
|
|
|
20
20
|
export declare function assertTrustSidecarHealthy<T>(sidecar: Extract<AssetSidecarKind, 'provenance' | 'review'>, parsed: ParsedSidecarJsonl<T>): void;
|
|
21
21
|
export declare function parseProvenanceRecord(value: unknown): ProvenanceRecord | null;
|
|
22
22
|
export declare function parseReviewRecord(value: unknown): ReviewRecord | null;
|
|
23
|
-
export declare function parseAssetSyncRecord(value: unknown): AssetSyncRecord | null;
|
|
23
|
+
export declare function parseAssetSyncRecord(value: unknown): AssetSyncRecord | null;
|
|
24
|
+
export declare const ASSET_SYNC_INVENTORY_MAX_SEGMENT_BYTES: number;
|
|
25
|
+
export type AssetSyncSidecarRecord = AssetSyncRecord | AssetSyncRunRecord | AssetSyncInventorySegmentRecord;
|
|
26
|
+
export declare function parseAssetSyncRunRecord(value: unknown): AssetSyncRunRecord | null;
|
|
27
|
+
export declare function parseAssetSyncInventorySegmentRecord(value: unknown): AssetSyncInventorySegmentRecord | null;
|
|
28
|
+
export declare function parseAssetSyncSidecarRecord(value: unknown): AssetSyncSidecarRecord | null;
|
|
@@ -62,6 +62,9 @@ export function parseProvenanceRecord(value) {
|
|
|
62
62
|
const decidedBy = stringField(record, 'decidedBy');
|
|
63
63
|
const promotedBy = stringField(record, 'promotedBy');
|
|
64
64
|
const reason = stringField(record, 'reason');
|
|
65
|
+
const frozenContentId = stringField(record, 'frozenContentId');
|
|
66
|
+
if (frozenContentId !== undefined && !/^sha256:[0-9a-f]{64}$/.test(frozenContentId))
|
|
67
|
+
return null;
|
|
65
68
|
return {
|
|
66
69
|
assetId,
|
|
67
70
|
source,
|
|
@@ -71,6 +74,7 @@ export function parseProvenanceRecord(value) {
|
|
|
71
74
|
...(decidedBy ? { decidedBy } : {}),
|
|
72
75
|
...(promotedBy ? { promotedBy } : {}),
|
|
73
76
|
...(reason ? { reason } : {}),
|
|
77
|
+
...(frozenContentId ? { frozenContentId } : {}),
|
|
74
78
|
};
|
|
75
79
|
}
|
|
76
80
|
export function parseReviewRecord(value) {
|
|
@@ -116,6 +120,10 @@ export function parseAssetSyncRecord(value) {
|
|
|
116
120
|
}
|
|
117
121
|
const logicalId = stringField(record, 'logicalId');
|
|
118
122
|
const status = stringField(record, 'status');
|
|
123
|
+
const runKey = optionalStrictString(record, 'runKey');
|
|
124
|
+
const inventoryKey = optionalStrictString(record, 'inventoryKey');
|
|
125
|
+
if (runKey === null || inventoryKey === null)
|
|
126
|
+
return null;
|
|
119
127
|
const forced = record['forced'] === true;
|
|
120
128
|
const collisionWithAssetId = stringField(record, 'collisionWithAssetId');
|
|
121
129
|
return {
|
|
@@ -125,12 +133,223 @@ export function parseAssetSyncRecord(value) {
|
|
|
125
133
|
scope,
|
|
126
134
|
syncedAt,
|
|
127
135
|
remoteAssetId,
|
|
136
|
+
...(runKey ? { runKey } : {}),
|
|
137
|
+
...(inventoryKey ? { inventoryKey } : {}),
|
|
128
138
|
...(logicalId ? { logicalId } : {}),
|
|
129
139
|
...(status ? { status } : {}),
|
|
130
140
|
...(forced ? { forced: true } : {}),
|
|
131
141
|
...(collisionWithAssetId ? { collisionWithAssetId } : {}),
|
|
132
142
|
};
|
|
133
143
|
}
|
|
144
|
+
const MAX_INVENTORY_SEGMENTS = 24;
|
|
145
|
+
const MAX_INVENTORY_ITEMS_PER_SEGMENT = 10_000;
|
|
146
|
+
const MAX_INVENTORY_STRING_LENGTH = 4096;
|
|
147
|
+
export const ASSET_SYNC_INVENTORY_MAX_SEGMENT_BYTES = 2 * 1024 * 1024;
|
|
148
|
+
export function parseAssetSyncRunRecord(value) {
|
|
149
|
+
const record = objectRecord(value);
|
|
150
|
+
if (!record || record['recordType'] !== 'run')
|
|
151
|
+
return null;
|
|
152
|
+
const runId = optionalStrictString(record, 'runId');
|
|
153
|
+
const runKey = optionalStrictString(record, 'runKey');
|
|
154
|
+
const state = optionalStrictString(record, 'state');
|
|
155
|
+
const currentTimestamp = optionalStrictString(record, 'syncedAt');
|
|
156
|
+
const legacyTimestamp = optionalStrictString(record, 'at');
|
|
157
|
+
if (!runId
|
|
158
|
+
|| !runKey
|
|
159
|
+
|| state === null
|
|
160
|
+
|| !isRunState(state)
|
|
161
|
+
|| currentTimestamp === null
|
|
162
|
+
|| legacyTimestamp === null
|
|
163
|
+
|| (currentTimestamp && legacyTimestamp && currentTimestamp !== legacyTimestamp)) {
|
|
164
|
+
return null;
|
|
165
|
+
}
|
|
166
|
+
const syncedAt = currentTimestamp ?? legacyTimestamp;
|
|
167
|
+
if (!syncedAt || Number.isNaN(Date.parse(syncedAt)))
|
|
168
|
+
return null;
|
|
169
|
+
const remoteAssetId = optionalStrictString(record, 'remoteAssetId');
|
|
170
|
+
const outcomeValue = optionalStrictString(record, 'outcome');
|
|
171
|
+
const reason = optionalStrictString(record, 'reason');
|
|
172
|
+
if (remoteAssetId === null || outcomeValue === null || reason === null)
|
|
173
|
+
return null;
|
|
174
|
+
const outcome = isRunOutcome(outcomeValue) ? outcomeValue : undefined;
|
|
175
|
+
if (outcomeValue !== undefined && !outcome)
|
|
176
|
+
return null;
|
|
177
|
+
let plan;
|
|
178
|
+
const rawPlan = record['plan'];
|
|
179
|
+
if (rawPlan !== undefined) {
|
|
180
|
+
if (!Array.isArray(rawPlan) || rawPlan.length === 0)
|
|
181
|
+
return null;
|
|
182
|
+
const normalized = rawPlan.map((entry) => typeof entry === 'string' ? entry.trim() : '');
|
|
183
|
+
if (normalized.some((entry, index) => !entry || entry !== rawPlan[index]))
|
|
184
|
+
return null;
|
|
185
|
+
if (new Set(normalized).size !== normalized.length)
|
|
186
|
+
return null;
|
|
187
|
+
plan = Object.freeze(normalized);
|
|
188
|
+
}
|
|
189
|
+
if (state === 'started' && (remoteAssetId || outcome || reason))
|
|
190
|
+
return null;
|
|
191
|
+
if (state === 'progress') {
|
|
192
|
+
if (!remoteAssetId || !outcome || plan)
|
|
193
|
+
return null;
|
|
194
|
+
if ((outcome === 'failed') !== Boolean(reason))
|
|
195
|
+
return null;
|
|
196
|
+
}
|
|
197
|
+
if (state === 'completed' && (remoteAssetId || outcome || reason || plan))
|
|
198
|
+
return null;
|
|
199
|
+
return immutableRunRecord({
|
|
200
|
+
recordType: 'run',
|
|
201
|
+
runId,
|
|
202
|
+
runKey,
|
|
203
|
+
state,
|
|
204
|
+
...(remoteAssetId ? { remoteAssetId } : {}),
|
|
205
|
+
...(outcome ? { outcome } : {}),
|
|
206
|
+
...(reason ? { reason } : {}),
|
|
207
|
+
...(plan ? { plan } : {}),
|
|
208
|
+
syncedAt,
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
export function parseAssetSyncInventorySegmentRecord(value) {
|
|
212
|
+
const record = objectRecord(value);
|
|
213
|
+
if (!record || record['recordType'] !== 'inventory_scan')
|
|
214
|
+
return null;
|
|
215
|
+
try {
|
|
216
|
+
if (Buffer.byteLength(JSON.stringify(record), 'utf8') > ASSET_SYNC_INVENTORY_MAX_SEGMENT_BYTES)
|
|
217
|
+
return null;
|
|
218
|
+
}
|
|
219
|
+
catch {
|
|
220
|
+
return null;
|
|
221
|
+
}
|
|
222
|
+
const scanId = strictBoundedString(record['scanId']);
|
|
223
|
+
const inventoryKey = strictBoundedString(record['inventoryKey']);
|
|
224
|
+
const scope = strictBoundedString(record['scope']);
|
|
225
|
+
const syncedAt = strictBoundedString(record['syncedAt']);
|
|
226
|
+
const index = record['index'];
|
|
227
|
+
const inputCursorFingerprints = parseInventoryCursorFingerprints(record['inputCursorFingerprints']);
|
|
228
|
+
const nextCursorFingerprints = parseInventoryCursorFingerprints(record['nextCursorFingerprints']);
|
|
229
|
+
const anonymousBlocked = record['anonymousBlocked'];
|
|
230
|
+
const cursorHeld = record['cursorHeld'];
|
|
231
|
+
const batchId = record['batchId'];
|
|
232
|
+
const batchIndex = record['batchIndex'];
|
|
233
|
+
const batchSize = record['batchSize'];
|
|
234
|
+
const rawItems = record['items'];
|
|
235
|
+
const hasBatchMetadata = batchId !== undefined || batchIndex !== undefined || batchSize !== undefined;
|
|
236
|
+
if (!scanId
|
|
237
|
+
|| !inventoryKey
|
|
238
|
+
|| (scope !== 'purchased' && scope !== 'published' && scope !== 'all')
|
|
239
|
+
|| !syncedAt
|
|
240
|
+
|| Number.isNaN(Date.parse(syncedAt))
|
|
241
|
+
|| !Number.isInteger(index)
|
|
242
|
+
|| index < 0
|
|
243
|
+
|| index >= MAX_INVENTORY_SEGMENTS
|
|
244
|
+
|| !inputCursorFingerprints
|
|
245
|
+
|| !nextCursorFingerprints
|
|
246
|
+
|| !Number.isInteger(anonymousBlocked)
|
|
247
|
+
|| anonymousBlocked < 0
|
|
248
|
+
|| anonymousBlocked > MAX_INVENTORY_ITEMS_PER_SEGMENT
|
|
249
|
+
|| !Array.isArray(rawItems)
|
|
250
|
+
|| rawItems.length > MAX_INVENTORY_ITEMS_PER_SEGMENT
|
|
251
|
+
|| (cursorHeld !== undefined && cursorHeld !== true)
|
|
252
|
+
|| (hasBatchMetadata && (!strictBoundedString(batchId)
|
|
253
|
+
|| !Number.isInteger(batchIndex)
|
|
254
|
+
|| !Number.isInteger(batchSize)
|
|
255
|
+
|| batchSize < 2
|
|
256
|
+
|| batchSize > MAX_INVENTORY_SEGMENTS
|
|
257
|
+
|| batchIndex < 0
|
|
258
|
+
|| batchIndex >= batchSize
|
|
259
|
+
|| index - batchIndex < 0
|
|
260
|
+
|| index + (batchSize - batchIndex) > MAX_INVENTORY_SEGMENTS))) {
|
|
261
|
+
return null;
|
|
262
|
+
}
|
|
263
|
+
if (scope === 'purchased'
|
|
264
|
+
&& (inputCursorFingerprints.published !== null || nextCursorFingerprints.published !== null))
|
|
265
|
+
return null;
|
|
266
|
+
if (cursorHeld === true
|
|
267
|
+
&& (inputCursorFingerprints.purchased !== nextCursorFingerprints.purchased
|
|
268
|
+
|| inputCursorFingerprints.published !== nextCursorFingerprints.published))
|
|
269
|
+
return null;
|
|
270
|
+
if (scope === 'published'
|
|
271
|
+
&& (inputCursorFingerprints.purchased !== null || nextCursorFingerprints.purchased !== null))
|
|
272
|
+
return null;
|
|
273
|
+
if (index === 0
|
|
274
|
+
&& (inputCursorFingerprints.purchased !== null || inputCursorFingerprints.published !== null))
|
|
275
|
+
return null;
|
|
276
|
+
const items = [];
|
|
277
|
+
const seen = new Set();
|
|
278
|
+
for (const rawItem of rawItems) {
|
|
279
|
+
const item = objectRecord(rawItem);
|
|
280
|
+
if (!item)
|
|
281
|
+
return null;
|
|
282
|
+
const remoteAssetId = strictBoundedString(item['remoteAssetId']);
|
|
283
|
+
const outcome = strictBoundedString(item['outcome']);
|
|
284
|
+
if (!remoteAssetId || !isInventoryOutcome(outcome) || seen.has(remoteAssetId))
|
|
285
|
+
return null;
|
|
286
|
+
seen.add(remoteAssetId);
|
|
287
|
+
items.push(Object.freeze({ remoteAssetId, outcome }));
|
|
288
|
+
}
|
|
289
|
+
if (items.length + anonymousBlocked > MAX_INVENTORY_ITEMS_PER_SEGMENT)
|
|
290
|
+
return null;
|
|
291
|
+
return Object.freeze({
|
|
292
|
+
recordType: 'inventory_scan',
|
|
293
|
+
scanId,
|
|
294
|
+
inventoryKey,
|
|
295
|
+
scope,
|
|
296
|
+
index: index,
|
|
297
|
+
inputCursorFingerprints,
|
|
298
|
+
nextCursorFingerprints,
|
|
299
|
+
items: Object.freeze(items),
|
|
300
|
+
anonymousBlocked: anonymousBlocked,
|
|
301
|
+
...(cursorHeld === true ? { cursorHeld: true } : {}),
|
|
302
|
+
...(hasBatchMetadata ? {
|
|
303
|
+
batchId: batchId,
|
|
304
|
+
batchIndex: batchIndex,
|
|
305
|
+
batchSize: batchSize,
|
|
306
|
+
} : {}),
|
|
307
|
+
syncedAt,
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
export function parseAssetSyncSidecarRecord(value) {
|
|
311
|
+
const record = objectRecord(value);
|
|
312
|
+
if (!record)
|
|
313
|
+
return null;
|
|
314
|
+
if (record['recordType'] !== undefined) {
|
|
315
|
+
if (record['recordType'] === 'run')
|
|
316
|
+
return parseAssetSyncRunRecord(record);
|
|
317
|
+
if (record['recordType'] === 'inventory_scan')
|
|
318
|
+
return parseAssetSyncInventorySegmentRecord(record);
|
|
319
|
+
return null;
|
|
320
|
+
}
|
|
321
|
+
return parseAssetSyncRecord(record);
|
|
322
|
+
}
|
|
323
|
+
function parseInventoryCursorFingerprints(value) {
|
|
324
|
+
const record = objectRecord(value);
|
|
325
|
+
if (!record || !Object.hasOwn(record, 'purchased') || !Object.hasOwn(record, 'published'))
|
|
326
|
+
return null;
|
|
327
|
+
const purchased = strictNullableCursorFingerprint(record['purchased']);
|
|
328
|
+
const published = strictNullableCursorFingerprint(record['published']);
|
|
329
|
+
if (purchased === undefined || published === undefined)
|
|
330
|
+
return null;
|
|
331
|
+
return Object.freeze({ purchased, published });
|
|
332
|
+
}
|
|
333
|
+
function strictNullableCursorFingerprint(value) {
|
|
334
|
+
if (value === null)
|
|
335
|
+
return null;
|
|
336
|
+
return typeof value === 'string' && /^[a-f0-9]{64}$/.test(value) ? value : undefined;
|
|
337
|
+
}
|
|
338
|
+
function strictBoundedString(value) {
|
|
339
|
+
return typeof value === 'string'
|
|
340
|
+
&& value.length <= MAX_INVENTORY_STRING_LENGTH
|
|
341
|
+
&& value.trim()
|
|
342
|
+
&& value === value.trim()
|
|
343
|
+
? value
|
|
344
|
+
: undefined;
|
|
345
|
+
}
|
|
346
|
+
function isInventoryOutcome(value) {
|
|
347
|
+
return value === 'imported'
|
|
348
|
+
|| value === 'already_local'
|
|
349
|
+
|| value === 'blocked'
|
|
350
|
+
|| value === 'failed'
|
|
351
|
+
|| value === 'pending';
|
|
352
|
+
}
|
|
134
353
|
function objectRecord(value) {
|
|
135
354
|
return value && typeof value === 'object' && !Array.isArray(value)
|
|
136
355
|
? value
|
|
@@ -139,4 +358,23 @@ function objectRecord(value) {
|
|
|
139
358
|
function stringField(value, key) {
|
|
140
359
|
const raw = value[key];
|
|
141
360
|
return typeof raw === 'string' && raw.trim() ? raw.trim() : undefined;
|
|
361
|
+
}
|
|
362
|
+
function optionalStrictString(value, key) {
|
|
363
|
+
const raw = value[key];
|
|
364
|
+
if (raw === undefined)
|
|
365
|
+
return undefined;
|
|
366
|
+
return typeof raw === 'string' && raw.trim() && raw === raw.trim() ? raw : null;
|
|
367
|
+
}
|
|
368
|
+
function immutableRunRecord(record) {
|
|
369
|
+
const plan = record.plan ? Object.freeze([...record.plan]) : undefined;
|
|
370
|
+
return Object.freeze({ ...record, ...(plan ? { plan } : {}) });
|
|
371
|
+
}
|
|
372
|
+
function isRunState(value) {
|
|
373
|
+
return value === 'started' || value === 'progress' || value === 'completed';
|
|
374
|
+
}
|
|
375
|
+
function isRunOutcome(value) {
|
|
376
|
+
return value === 'imported'
|
|
377
|
+
|| value === 'already_local'
|
|
378
|
+
|| value === 'failed'
|
|
379
|
+
|| value === 'remote_missing';
|
|
142
380
|
}
|
|
@@ -5,7 +5,7 @@ import { TextDecoder } from 'node:util';
|
|
|
5
5
|
import { canonicalize } from '../wire/index.js';
|
|
6
6
|
import { LockReleaseError } from '../util/fileLock.js';
|
|
7
7
|
import { AssetStoreReadLimitError, assertAssetStoreDirectory, createBufferDurableExclusive, fsyncDirectoryBestEffort, readRegularBuffer, regularFileFingerprint, replaceUtf8Durable, withAssetStoreLock, } from './assetStoreStorage.js';
|
|
8
|
-
import {
|
|
8
|
+
import { parseAssetSyncSidecarRecord, parseProvenanceRecord, parseReviewRecord, } from './assetSidecarRecords.js';
|
|
9
9
|
export class AssetSidecarRecoveryError extends Error {
|
|
10
10
|
reason;
|
|
11
11
|
code = 'ASSET_SIDECAR_RECOVERY_FAILED';
|
|
@@ -29,7 +29,7 @@ const SIDECAR_FILES = {
|
|
|
29
29
|
const RECORD_PARSERS = {
|
|
30
30
|
provenance: parseProvenanceRecord,
|
|
31
31
|
review: parseReviewRecord,
|
|
32
|
-
'asset-sync':
|
|
32
|
+
'asset-sync': parseAssetSyncSidecarRecord,
|
|
33
33
|
};
|
|
34
34
|
function isErrno(error, code) {
|
|
35
35
|
return typeof error === 'object' && error !== null && error.code === code;
|
|
@@ -15,6 +15,11 @@ export interface AssetStoreFileHealth {
|
|
|
15
15
|
duplicateRows: number;
|
|
16
16
|
corruptRows: number;
|
|
17
17
|
hashMismatchRows: number;
|
|
18
|
+
/**
|
|
19
|
+
* Rows that fail content-hash verification but carry an active, content-bound unverified provenance waiver.
|
|
20
|
+
* They remain untrusted and are counted separately instead of being misclassified as store corruption.
|
|
21
|
+
*/
|
|
22
|
+
unverifiedRows: number;
|
|
18
23
|
schemaInvalidRows: number;
|
|
19
24
|
unterminated: boolean;
|
|
20
25
|
reason?: UnsafeAssetStorePathReason | 'base_directory' | 'lock_unavailable' | 'read_unavailable' | 'scan_limit_exceeded';
|
|
@@ -31,6 +36,7 @@ export interface AssetStoreHealthTotals {
|
|
|
31
36
|
duplicateRows: number;
|
|
32
37
|
corruptRows: number;
|
|
33
38
|
hashMismatchRows: number;
|
|
39
|
+
unverifiedRows: number;
|
|
34
40
|
schemaInvalidRows: number;
|
|
35
41
|
unterminatedFiles: number;
|
|
36
42
|
}
|