fix: address code-level issues from subworker audit
- Remove unused generationProfile parameter from verify runner - Integrate PluginContractRegistry into petit-runner and stateful-runner - Add deterministic hashStringToSeed to doctor (replaces Math.random()) - Create and pass CleanupManager in stateful-handler - Remove unconditional auto-registration of built-in plugin contracts (they were too aggressive; users can register via opts.pluginContracts) - Build: clean | Tests: 849 pass, 0 fail
This commit is contained in:
@@ -26,6 +26,16 @@ import { runDocsChecks } from './checks/docs.js';
|
||||
|
||||
import { renderJson } from '../../renderers/json.js';
|
||||
|
||||
// Deterministic string-to-seed hash (FNV-1a)
|
||||
function hashStringToSeed(str: string): number {
|
||||
let hash = 0x811c9dc5
|
||||
for (let i = 0; i < str.length; i++) {
|
||||
hash ^= str.charCodeAt(i)
|
||||
hash = Math.imul(hash, 0x01000193)
|
||||
}
|
||||
return Math.abs(hash >>> 0)
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Types
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -203,7 +213,7 @@ async function runPackageChecks(
|
||||
}
|
||||
|
||||
// 6. Determinism trust signal
|
||||
const testSeed = Math.floor(Math.random() * 0x7fffffff);
|
||||
const testSeed = hashStringToSeed(packageName + cwd);
|
||||
checks.push({
|
||||
name: 'determinism',
|
||||
status: 'pass',
|
||||
|
||||
Reference in New Issue
Block a user