feat(research): isolate candidates and add reviewed paper promotion
This commit is contained in:
parent
26b97265c6
commit
25b5cbf481
128 changed files with 13038 additions and 1388 deletions
6
apps/stock/engine/index.d.ts
vendored
6
apps/stock/engine/index.d.ts
vendored
|
|
@ -7,3 +7,9 @@ export {
|
|||
|
||||
declare const nativeBinding: typeof import('./dist/index');
|
||||
export default nativeBinding;
|
||||
|
||||
/** Exact wrapper/native bytes captured when this module first loaded. Artifact updates require restart. */
|
||||
export declare const loadedNativeIdentity: Readonly<{
|
||||
engineWrapperSha256: string;
|
||||
engineBinarySha256: string;
|
||||
}>;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
// ESM wrapper for the native module
|
||||
import { createRequire } from 'module';
|
||||
import { createHash } from 'node:crypto';
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { dirname, join } from 'path';
|
||||
import { fileURLToPath } from 'url';
|
||||
|
||||
|
|
@ -7,7 +9,21 @@ const require = createRequire(import.meta.url);
|
|||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
|
||||
const nativeBinding = require(join(__dirname, 'dist', 'engine.node'));
|
||||
// Loaded executable identity is captured before native loading, not inferred later from disk.
|
||||
// Build artifacts must remain immutable while the process runs; updates require a restart.
|
||||
const nativePath = join(__dirname, 'dist', 'engine.node');
|
||||
const fileHash = path => createHash('sha256').update(readFileSync(path)).digest('hex');
|
||||
export const loadedNativeIdentity = Object.freeze({
|
||||
engineWrapperSha256: fileHash(__filename),
|
||||
engineBinarySha256: fileHash(nativePath),
|
||||
});
|
||||
const nativeBinding = require(nativePath);
|
||||
if (
|
||||
loadedNativeIdentity.engineWrapperSha256 !== fileHash(__filename) ||
|
||||
loadedNativeIdentity.engineBinarySha256 !== fileHash(nativePath)
|
||||
) {
|
||||
throw new Error('Native artifacts changed while loading; restart with immutable build artifacts');
|
||||
}
|
||||
|
||||
export const {
|
||||
TradingEngine,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue