From f13afd2e940e7853d6f007f0b7511f702cda503c Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Tue, 16 Jun 2026 02:09:37 +0000 Subject: [PATCH 1/8] feat: recalibrate canonical cold-start difficulty floor --- .github/workflows/ci.yml | 1 + .github/workflows/coretex-release.yml | 15 +- .gitignore | 1 + package-lock.json | 2 +- packages/coretex/package.json | 3 +- .../coretex/scripts/check-release-version.mjs | 20 +++ packages/coretex/src/bundle/index.ts | 2 +- packages/coretex/src/rewards/difficulty.ts | 2 +- packages/coretex/src/validator-sync-cli.ts | 5 +- packages/coretex/src/version.ts | 2 +- .../coordinator-concurrency-baseline.test.mjs | 22 +-- .../unit/coretex-coordinator-core.test.mjs | 14 +- .../test/unit/difficulty-grace.test.mjs | 2 +- .../coretex/test/unit/difficulty.test.mjs | 18 +-- ...dgen1-policy-r5-atom-v16-300k-enabled.json | 146 +++++++++--------- ...dgen1-policy-r5-atom-v16-300k-enabled.json | 2 +- scripts/calibrate.mjs | 2 +- scripts/coretex-epoch-evolve.mjs | 2 +- scripts/coretex-scorer-parity-harness.mjs | 2 +- scripts/mining-flow-e2e.mjs | 2 +- scripts/recalibrate-baseline.mjs | 4 +- scripts/screener-threshold-calibration.mjs | 2 +- .../smoke-screener-threshold-mechanics.mjs | 4 +- 23 files changed, 150 insertions(+), 125 deletions(-) create mode 100644 packages/coretex/scripts/check-release-version.mjs diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b2b5c4e9..0394d4d3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,6 +26,7 @@ jobs: node-version: ${{ env.NODE_VERSION }} cache: npm - run: npm ci + - run: npm run version:check --workspace @botcoin/coretex - run: npm run lint --if-present - run: npm run typecheck --if-present - run: npm run build --if-present diff --git a/.github/workflows/coretex-release.yml b/.github/workflows/coretex-release.yml index bbf50745..adaf4d3b 100644 --- a/.github/workflows/coretex-release.yml +++ b/.github/workflows/coretex-release.yml @@ -9,8 +9,8 @@ permissions: contents: write jobs: - release-coretex-client: - name: Build and publish CoreTex client artifacts + release-coretex-package: + name: Build and publish CoreTex package artifacts runs-on: ubuntu-latest env: NODE_VERSION: "22" @@ -27,15 +27,18 @@ jobs: - name: Install dependencies run: npm ci + - name: Verify package/runtime version sync + run: npm run version:check --workspace @botcoin/coretex + - name: Build workspace run: npm run build - - name: Verify tag matches client version constant + - name: Verify tag matches package version run: | - CLIENT_VERSION=$(node -e "const fs=require('fs');const s=fs.readFileSync('packages/coretex/src/version.ts','utf8');const m=s.match(/CORTEX_CLIENT_VERSION\\s*=\\s*'([^']+)'/);if(!m)process.exit(1);process.stdout.write(m[1]);") + PACKAGE_VERSION=$(node -p "require('./packages/coretex/package.json').version") TAG_VERSION="${GITHUB_REF_NAME#coretex-v}" - if [ "${CLIENT_VERSION}" != "${TAG_VERSION}" ]; then - echo "tag/version mismatch: tag=${TAG_VERSION} client=${CLIENT_VERSION}" + if [ "${PACKAGE_VERSION}" != "${TAG_VERSION}" ]; then + echo "tag/version mismatch: tag=${TAG_VERSION} package=${PACKAGE_VERSION}" exit 1 fi diff --git a/.gitignore b/.gitignore index 0215d79d..5fe25069 100644 --- a/.gitignore +++ b/.gitignore @@ -112,6 +112,7 @@ release/calibration/** !release/calibration/2026-06-04-memory-atom-v16/coretex-launch-v16-artifacts.json !release/calibration/2026-06-04-memory-atom-v16/bundle-manifest-v2-dgen1-policy-r5-atom-v16-300k-enabled.json !release/calibration/2026-06-04-memory-atom-v16/evaluator-profile-v2-dgen1-policy-r5-atom-v16-300k-enabled.json +!release/calibration/2026-06-04-memory-atom-v16/screener-threshold-v16-qwen-cpu-coldstart-repin-2026-06-16.json # Generated DACR corpus (regenerated from HF dataset by scripts/build-corpus-from-dacr.mjs) benchmark/fixtures/dacr/ diff --git a/package-lock.json b/package-lock.json index 55b7a94e..8a79e803 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1063,7 +1063,7 @@ }, "packages/coretex": { "name": "@botcoin/coretex", - "version": "0.1.0", + "version": "0.7.1", "license": "Apache-2.0", "bin": { "botcoin-coretex": "dist/cli.js", diff --git a/packages/coretex/package.json b/packages/coretex/package.json index 16ded848..ef3490a4 100644 --- a/packages/coretex/package.json +++ b/packages/coretex/package.json @@ -1,6 +1,6 @@ { "name": "@botcoin/coretex", - "version": "0.1.0", + "version": "0.7.1", "private": false, "description": "Botcoin CoreTex decoder, evaluator, validator, and CLI.", "license": "Apache-2.0", @@ -37,6 +37,7 @@ "prebuild": "npm run clean", "build": "tsc -p tsconfig.json", "typecheck": "tsc -p tsconfig.json --noEmit", + "version:check": "node scripts/check-release-version.mjs", "test:unit": "node --test --test-concurrency=2 --test-reporter=spec ./test/unit/*.test.mjs" }, "files": [ diff --git a/packages/coretex/scripts/check-release-version.mjs b/packages/coretex/scripts/check-release-version.mjs new file mode 100644 index 00000000..d5d68693 --- /dev/null +++ b/packages/coretex/scripts/check-release-version.mjs @@ -0,0 +1,20 @@ +#!/usr/bin/env node +import { readFileSync } from 'node:fs'; +import { resolve } from 'node:path'; + +const pkgRoot = resolve(new URL('..', import.meta.url).pathname); +const pkg = JSON.parse(readFileSync(resolve(pkgRoot, 'package.json'), 'utf8')); +const src = readFileSync(resolve(pkgRoot, 'src/version.ts'), 'utf8'); +const match = src.match(/CORTEX_CLIENT_VERSION\s*=\s*'([^']+)'/); + +if (!match) { + console.error('version:check: could not find CORTEX_CLIENT_VERSION in src/version.ts'); + process.exit(1); +} + +if (pkg.version !== match[1]) { + console.error(`version:check: package.json version ${pkg.version} != src/version.ts ${match[1]}`); + process.exit(1); +} + +console.log(`version:check ok: ${pkg.version}`); diff --git a/packages/coretex/src/bundle/index.ts b/packages/coretex/src/bundle/index.ts index 1419c28f..4b523ce3 100644 --- a/packages/coretex/src/bundle/index.ts +++ b/packages/coretex/src/bundle/index.ts @@ -824,7 +824,7 @@ export const DEFAULT_COMPOSITE_WEIGHTS_PIN: CompositeWeightPin = { }; export const DEFAULT_PATCH_FLOORS: PatchAcceptanceFloorsPin = { - minImprovementPpm: 2500, + minImprovementPpm: 500, structuralFloor: 0.95, protectedRegressionFloor: 0.05, familyCatastrophicFloor: 0.85, diff --git a/packages/coretex/src/rewards/difficulty.ts b/packages/coretex/src/rewards/difficulty.ts index fbe76ab6..795d8f2c 100644 --- a/packages/coretex/src/rewards/difficulty.ts +++ b/packages/coretex/src/rewards/difficulty.ts @@ -11,7 +11,7 @@ * as floating-point intermediates and then rounded back to bigint. */ -export const MIN_IMPROVEMENT_PPM = 2_500n; +export const MIN_IMPROVEMENT_PPM = 500n; export const MAX_IMPROVEMENT_PPM = 150_000n; export interface DifficultyInputs { diff --git a/packages/coretex/src/validator-sync-cli.ts b/packages/coretex/src/validator-sync-cli.ts index c907f090..6b09c1d8 100644 --- a/packages/coretex/src/validator-sync-cli.ts +++ b/packages/coretex/src/validator-sync-cli.ts @@ -1386,7 +1386,10 @@ async function buildValidatorScorerContext( biEncoderHash: biEncoderModelIdHash(corpus.biEncoderModelId, corpus.biEncoderRevision, 'dense'), retrievalKeyLayout: layout, }); - const thresholdPpm = Math.min(computeAcceptanceThresholdPpm(profile), 355); + // Score replay must use the full bundle-pinned acceptance threshold rather + // than a launch-era screener cap, or a client can silently "verify" a patch + // that no longer clears the canonical production gate. + const thresholdPpm = computeAcceptanceThresholdPpm(profile); return { corpus, profile, scoringOpts, thresholdPpm, reranker: reranker as ValidatorScorerContext['reranker'] }; } diff --git a/packages/coretex/src/version.ts b/packages/coretex/src/version.ts index 8e4b6376..73278019 100644 --- a/packages/coretex/src/version.ts +++ b/packages/coretex/src/version.ts @@ -1 +1 @@ -export const CORTEX_CLIENT_VERSION = '0.7.0'; +export const CORTEX_CLIENT_VERSION = '0.7.1'; diff --git a/packages/coretex/test/unit/coordinator-concurrency-baseline.test.mjs b/packages/coretex/test/unit/coordinator-concurrency-baseline.test.mjs index bbabd701..8c14b7c5 100644 --- a/packages/coretex/test/unit/coordinator-concurrency-baseline.test.mjs +++ b/packages/coretex/test/unit/coordinator-concurrency-baseline.test.mjs @@ -47,8 +47,10 @@ const MINER_A = '0x' + 'aa'.repeat(20); const MINER_B = '0x' + 'bb'.repeat(20); // No static screenerThresholdPpm: the live threshold must derive from the -// baseline plus state-advance threshold (288438 + 2700ppm -> 1350ppm under -// the default policy). +// real state-advance threshold. Under the cold-start repin this fixture's +// 500ppm min-improvement + 200ppm replay tolerance yields a 700ppm state +// threshold, but the canonical launch-era minimum screener floor still keeps +// the live screener at 355ppm. const baseConfig = { epoch: EPOCH, expectedChainId: 8453n, @@ -67,7 +69,7 @@ const baseConfig = { receiptTtlSec: 60, perMinerScreenerCap: 50, baselineParentScorePpm: 288438, - minImprovementPpm: 2500, + minImprovementPpm: 500, replayTolerancePpm: 200, targetBlockOffset: 30, patchWordBudget: 4, @@ -490,14 +492,14 @@ describe('CoreTexCoordinatorCore §7 — baseline runtime semantics', () => { const coord = new CoreTexCoordinatorCore(baseConfig, chain, loadGenesis, evaluator, plainSigner); await coord.boot(); - // Launch context: baseline 288438 with a 2700ppm state threshold -> live - // screener threshold 1350ppm. + // Launch context: baseline 288438 with a 700ppm state threshold -> live + // screener threshold 355ppm after the absolute screener floor is applied. const status0 = await coord.getStatus(); assert.equal(status0.baselineState, 'ready'); assert.equal(status0.baselineParentScorePpm, 288438); - assert.equal(status0.stateAdvanceThresholdPpm, 2700); - assert.equal(status0.screenerThresholdPpm, 1350); - assert.equal(status0.thresholds.screenerThresholdPpm, 1350); + assert.equal(status0.stateAdvanceThresholdPpm, 700); + assert.equal(status0.screenerThresholdPpm, 355); + assert.equal(status0.thresholds.screenerThresholdPpm, 355); // A 320ppm screener is below the launch threshold. const before = await coord.submit(submitBody(makePatchHex(GENESIS_ROOT, 40, 1))); @@ -525,7 +527,7 @@ describe('CoreTexCoordinatorCore §7 — baseline runtime semantics', () => { const status1 = await coord.getStatus(); assert.equal(status1.baselineState, 'ready'); assert.equal(status1.baselineParentScorePpm, 400000); - assert.equal(status1.screenerThresholdPpm, 1350, 'state-threshold floor dominates normal launch baselines'); + assert.equal(status1.screenerThresholdPpm, 350, 'post-launch baseline recompute falls back to the live state-floor-derived screener'); assert.equal(status1.thresholds.baselineParentScorePpm, 400000); // A 1400ppm screener clears the live gate. @@ -569,7 +571,7 @@ describe('CoreTexCoordinatorCore §7 — baseline runtime semantics', () => { const ready = await coord.getStatus(); assert.equal(ready.baselineState, 'ready'); assert.equal(ready.baselineParentScorePpm, 300000); - assert.equal(ready.screenerThresholdPpm, 1350); + assert.equal(ready.screenerThresholdPpm, 350); const accepted = await coord.submit(submitBody(makePatchHex(ev0.newRoot, 40, 1), MINER_A, ev0.newRoot)); assert.equal(accepted.status, 'accepted', `expected accept, got ${JSON.stringify(accepted)}`); diff --git a/packages/coretex/test/unit/coretex-coordinator-core.test.mjs b/packages/coretex/test/unit/coretex-coordinator-core.test.mjs index b25691b5..b5969a52 100644 --- a/packages/coretex/test/unit/coretex-coordinator-core.test.mjs +++ b/packages/coretex/test/unit/coretex-coordinator-core.test.mjs @@ -60,12 +60,12 @@ const baseConfig = { confirmationDepth: 4, receiptTtlSec: 60, perMinerScreenerCap: 50, - // §7 launch baseline for the pinned (genesis) context. 288438 with the - // default policy and 2700ppm state threshold derives a live screener - // threshold of 1350ppm. + // §7 launch baseline for the pinned (genesis) context. Under the cold-start + // repin this fixture advertises the lowered 500ppm min-improvement floor and + // 375ppm screener threshold. baselineParentScorePpm: 288438, - screenerThresholdPpm: 355, - minImprovementPpm: 2500, + screenerThresholdPpm: 375, + minImprovementPpm: 500, replayTolerancePpm: 200, targetBlockOffset: 30, patchWordBudget: 4, @@ -685,8 +685,8 @@ describe('CoreTexCoordinatorCore — production submit path', () => { scoreAfterPpm: 2900, rewrittenPatchBytesHex: rewritten, evaluationProof: dualProofFor(ev.compactPatchBytes, GENESIS_ROOT, { - gate: { domain: 'gate', seedCommit: '0x' + '91'.repeat(32), accepted: true, scorePpm: 2600 }, - confirm: { domain: 'confirm', seedCommit: '0x' + '92'.repeat(32), accepted: true, scorePpm: 2600 }, + gate: { domain: 'gate', seedCommit: '0x' + '91'.repeat(32), accepted: true, scorePpm: 600 }, + confirm: { domain: 'confirm', seedCommit: '0x' + '92'.repeat(32), accepted: true, scorePpm: 600 }, }), }), }; diff --git a/packages/coretex/test/unit/difficulty-grace.test.mjs b/packages/coretex/test/unit/difficulty-grace.test.mjs index 5f1640e8..2821ac6f 100644 --- a/packages/coretex/test/unit/difficulty-grace.test.mjs +++ b/packages/coretex/test/unit/difficulty-grace.test.mjs @@ -56,7 +56,7 @@ describe('major-delta grace', () => { qualityAttempts: 200, majorDeltaActive: true, }); - assert.equal(out.next, 2_500n, 'clamps to MIN_IMPROVEMENT_PPM floor'); + assert.equal(out.next, 500n, 'clamps to MIN_IMPROVEMENT_PPM floor'); assert.equal(out.reason, 'major_delta_grace'); }); diff --git a/packages/coretex/test/unit/difficulty.test.mjs b/packages/coretex/test/unit/difficulty.test.mjs index 49eb5431..59de4cd6 100644 --- a/packages/coretex/test/unit/difficulty.test.mjs +++ b/packages/coretex/test/unit/difficulty.test.mjs @@ -19,7 +19,7 @@ const { describe('CoreTex V4 difficulty calculator', () => { test('constants are correct bigints', () => { - assert.equal(MIN_IMPROVEMENT_PPM, 2_500n); + assert.equal(MIN_IMPROVEMENT_PPM, 500n); assert.equal(MAX_IMPROVEMENT_PPM, 150_000n); }); @@ -142,9 +142,9 @@ describe('CoreTex V4 difficulty calculator', () => { }); test('floor clamp: decay cannot go below MIN_IMPROVEMENT_PPM', () => { - // current=3_000, 0.85 → unclamped=2_550, within range - // Use a smaller current to force a floor hit: 2_900 * 0.85 = 2_465 < 2_500 - const current = 2_900n; + // current=600 * 0.85 = 510 → not clamped + // Use a smaller current to force a floor hit: 550 * 0.85 = 468 < 500 + const current = 550n; const result = nextMinImprovementPpm({ current, observedAdvances: 0, @@ -157,9 +157,9 @@ describe('CoreTex V4 difficulty calculator', () => { }); test('floor clamp: small_drift_down at floor stays at floor', () => { - // current=3_000 * 0.85 (decay) = 2_550 → not clamped - // current=2_600 * 0.95 = 2_470 < 2_500 → clamped - const current = 2_600n; + // current=600 * 0.85 (decay) = 510 → not clamped + // current=520 * 0.95 = 494 < 500 → clamped + const current = 520n; const result = nextMinImprovementPpm({ current, observedAdvances: 0, @@ -253,8 +253,8 @@ describe('CoreTex V4 difficulty calculator', () => { // undefined → pinned MAX; a maxClampPpm <= floor is ignored (falls back to MAX). const a = nextMinImprovementPpm({ current: 149_000n, observedAdvances: 10, targetAdvances: 5, qualityAttempts: 8 }); assert.equal(a.next, MAX_IMPROVEMENT_PPM); - const b = nextMinImprovementPpm({ current: 149_000n, observedAdvances: 10, targetAdvances: 5, qualityAttempts: 8, maxClampPpm: 1_000n }); - assert.equal(b.next, MAX_IMPROVEMENT_PPM); // 1_000 < floor → ignored + const b = nextMinImprovementPpm({ current: 149_000n, observedAdvances: 10, targetAdvances: 5, qualityAttempts: 8, maxClampPpm: 500n }); + assert.equal(b.next, MAX_IMPROVEMENT_PPM); // <= floor → ignored const c = nextMinImprovementPpm({ current: 10_000n, observedAdvances: 0, targetAdvances: 5, qualityAttempts: 20, minClampPpm: -5n }); assert.equal(c.next, 8_500n); // negative floor ignored → normal decay, no clamp assert.equal(c.clamped, false); diff --git a/release/calibration/2026-06-04-memory-atom-v16/bundle-manifest-v2-dgen1-policy-r5-atom-v16-300k-enabled.json b/release/calibration/2026-06-04-memory-atom-v16/bundle-manifest-v2-dgen1-policy-r5-atom-v16-300k-enabled.json index e6da98a4..a06927b1 100644 --- a/release/calibration/2026-06-04-memory-atom-v16/bundle-manifest-v2-dgen1-policy-r5-atom-v16-300k-enabled.json +++ b/release/calibration/2026-06-04-memory-atom-v16/bundle-manifest-v2-dgen1-policy-r5-atom-v16-300k-enabled.json @@ -8,33 +8,33 @@ "specs": [ { "role": "substrate-spec", - "path": "specs/cortex_state.md", - "sha256": "b42a04a26e83d000763ed10af54978027b027857206ac7af072b6c571e0d4c68", - "bytes": 24026 + "path": "specs/coretex_state.md", + "sha256": "88460dfecac8195658569e57913e9cbcb861e46aff7320811170408deafada55", + "bytes": 24032 }, { "role": "substrate-spec", - "path": "specs/cortex_schema.json", - "sha256": "d6328375da87ae59c55f1777771ca37d68749b9c3e089841b82f14a2bc02fead", - "bytes": 9350 + "path": "specs/coretex_schema.json", + "sha256": "3e14ac9292479558e43dd9be4e95f6c53d1f313b3a78c624620110d58bc8f498", + "bytes": 9351 }, { "role": "substrate-spec", "path": "specs/packing_spec.md", - "sha256": "dbe7813581fcf5c3c49436a7eba1600282274db9d2b9fba710dd3ece3b2a2c45", - "bytes": 3231 + "sha256": "4b9685e3155cd8cb10883d70c1a70c1d186d604eab0c067e6172505f6abfce09", + "bytes": 3235 }, { "role": "substrate-spec", "path": "specs/merkleization_spec.md", - "sha256": "1f01cb437b51e235328b228e9908682f075cc5d393f32fe08a1e19336f4a9562", - "bytes": 4532 + "sha256": "0e3ac9063da0aa039254c89e5409affca52bb619ecde156378a31876e685a862", + "bytes": 4533 }, { "role": "substrate-spec", "path": "specs/patch_format.md", - "sha256": "89e31b19cbe2bcabb55e2a1c49e4aba0315d986fad15f87d768130203b6df128", - "bytes": 7449 + "sha256": "ff6f9d352d152945cb568af7e664e39e80d9c5bfb8b22ee650628d18a2e1d765", + "bytes": 7450 }, { "role": "substrate-spec", @@ -45,8 +45,8 @@ { "role": "substrate-spec", "path": "specs/substrate_retrieval_semantics.md", - "sha256": "ae32db66002aac45679e3044c03d2b0bb92f21a1244a1082dcf64908a6808e0f", - "bytes": 8561 + "sha256": "9562c35d5de368dc68e0a4051108d1af138fef153ba865a05d38dd96eeeca2ed", + "bytes": 8564 }, { "role": "substrate-spec", @@ -70,33 +70,33 @@ "implementation": [ { "role": "substrate-impl", - "path": "packages/cortex/src/state/codec.ts", + "path": "packages/coretex/src/state/codec.ts", "sha256": "b1d30678701c3c9d96ae37106f4c534361bd7a91c27479b3afefe913b194e6e1", "bytes": 2960 }, { "role": "substrate-impl", - "path": "packages/cortex/src/state/merkle.ts", + "path": "packages/coretex/src/state/merkle.ts", "sha256": "e079a3a91506fc68820cc2115a4abb1469e94450d12c54c53de0e6b83ca89307", "bytes": 4669 }, { "role": "substrate-impl", - "path": "packages/cortex/src/state/patch.ts", + "path": "packages/coretex/src/state/patch.ts", "sha256": "ab1fa9942f7fc2657aeacaf5d72e2d9ecab80aa98e18383e476d7a8226d51672", "bytes": 21589 }, { "role": "substrate-impl", - "path": "packages/cortex/src/state/types.ts", + "path": "packages/coretex/src/state/types.ts", "sha256": "f607667f52acf6a88e8dceac5f578a8d142e59e33063d7d9162c391cfc78dfe5", "bytes": 5511 }, { "role": "substrate-impl", - "path": "packages/cortex/src/state/validate.ts", - "sha256": "365d68a68abf5e0a1e756a626559ce7e6ed4c6713d3740cdf00dc5208b31d1e6", - "bytes": 8248 + "path": "packages/coretex/src/state/validate.ts", + "sha256": "f779ba5498f709c081c21ef93ba6c78bab6790ada03c3964dfe08c6f64868dad", + "bytes": 8250 } ] }, @@ -105,15 +105,9 @@ "files": [ { "role": "corpus", - "path": "release/calibration/2026-06-04-memory-atom-v16/dgen1-r5-synth-300k-atom-v16-corpus.json", - "sha256": "aa84271dade558e6dad9625cf4b59687dc21a3ce2211edc1e39b084c1b7e23df", - "bytes": 236975364 - }, - { - "role": "corpus", - "path": "release/calibration/2026-06-04-memory-atom-v16/dgen1-r5-synth-300k-atom-v16-embeddings.json", - "sha256": "3f590dfa2a58161e213ced613e42dc663a37039b5946a5971c66b2047d0bda04", - "bytes": 475912682 + "path": "release/calibration/2026-06-04-memory-atom-v16/materialized/73172e2b/corpus.json", + "sha256": "c094cd5166b9d132d275921bf8bd3d9052c49c9bcd8b2f02478b298e778c4e47", + "bytes": 2114801 } ] }, @@ -147,7 +141,7 @@ "w_structural_sanity": 0.05 }, "patchAcceptanceFloors": { - "minImprovementPpm": 2500, + "minImprovementPpm": 500, "structuralFloor": 0.95, "protectedRegressionFloor": 0.05, "familyCatastrophicFloor": 0.85 @@ -345,157 +339,157 @@ "files": [ { "role": "evaluator", - "path": "packages/cortex/src/eval/retrieval-corpus.ts", - "sha256": "4ae4e15f6e740d42afb66515e7ca677841e4b39b6616a317e19f0d6659c3d310", - "bytes": 37505 + "path": "packages/coretex/src/eval/retrieval-corpus.ts", + "sha256": "1b5de7b92ca42820ccd64e1d4cd2ec12422b62362a63c2513cfb4134e60ddb4f", + "bytes": 41862 }, { "role": "evaluator", - "path": "packages/cortex/src/eval/retrieval-benchmark.ts", - "sha256": "1bb78a1c08c19dd0e8d723d1b095c5bd60d07ac3cba4cb990d19510e8e2ea9a8", - "bytes": 167584 + "path": "packages/coretex/src/eval/retrieval-benchmark.ts", + "sha256": "b7dd77d597bb4a370c572d0ac2a71e1ced35af95414a1dd058ca62b58fa1b369", + "bytes": 167579 }, { "role": "evaluator", - "path": "packages/cortex/src/eval/ir-metrics.ts", + "path": "packages/coretex/src/eval/ir-metrics.ts", "sha256": "7e8ac68f671f56e7d131d6600a1ae382f3f7a801cc86a386e202aac8ea8c98d6", "bytes": 6130 }, { "role": "evaluator", - "path": "packages/cortex/src/eval/hidden-query-pack.ts", + "path": "packages/coretex/src/eval/hidden-query-pack.ts", "sha256": "5d06d65cdae4dc9cee8ab1af26dc018c91def9c2fdfc8edd8f2461cf93b7fb19", "bytes": 21682 }, { "role": "evaluator", - "path": "packages/cortex/src/eval/bi-encoder.ts", + "path": "packages/coretex/src/eval/bi-encoder.ts", "sha256": "8cb4e55b88b5080a37b2828b62cabcd608f3e410967cced043c6b60ed0269d6d", "bytes": 12968 }, { "role": "evaluator", - "path": "packages/cortex/src/eval/reranker.ts", - "sha256": "419a6747f5183d86108283a574d55ea5ae7e0123c84323303f1f4e7575363f50", - "bytes": 38274 + "path": "packages/coretex/src/eval/reranker.ts", + "sha256": "7a99461eb1cee8d193f4a85cfbc10d21da6fd0e2159023e11005b4885f3226f5", + "bytes": 38285 }, { "role": "evaluator", - "path": "packages/cortex/src/eval/seed-derivation.ts", + "path": "packages/coretex/src/eval/seed-derivation.ts", "sha256": "0a71f90e4e380dda397f121c8dd966d7bd78e752e353cd8c7f2cb73a1da3e306", "bytes": 9793 }, { "role": "evaluator", - "path": "packages/cortex/src/eval/live-eval-admission.ts", + "path": "packages/coretex/src/eval/live-eval-admission.ts", "sha256": "fe93e2a39fa1005c22d4a2904cc701a80da4ecbbb4787d4a9bea3ed48c9a9e66", "bytes": 4855 }, { "role": "evaluator", - "path": "packages/cortex/src/coordinator/base-blockhash.ts", + "path": "packages/coretex/src/coordinator/base-blockhash.ts", "sha256": "576aefcecd8dcb130128eaad6e7ad521b3c4ace2e5f2b5bad0d02b5540c048a9", "bytes": 5747 }, { "role": "evaluator", - "path": "packages/cortex/src/coordinator/patch-received-notice.ts", + "path": "packages/coretex/src/coordinator/patch-received-notice.ts", "sha256": "31cf517bcb510ea839cd3032c9707fd50368e012ce5aeb026bc8c608fe067dd4", "bytes": 8836 }, { "role": "evaluator", - "path": "packages/cortex/src/coordinator/per-patch-evaluator.ts", - "sha256": "df4f613f881c4c0f7f6884da69fd595afcc8accb1afec444a32cdc0b9647cdcd", - "bytes": 19808 + "path": "packages/coretex/src/coordinator/per-patch-evaluator.ts", + "sha256": "e91389ca10bbe08a547cdf3db112a6ef64c0c77844519e10ee71d545933a13e1", + "bytes": 20063 }, { "role": "evaluator", - "path": "packages/cortex/src/coordinator/retrieval-data-source.ts", - "sha256": "1182d6727a9a56b6917297099bf7af5876e537b1d214962017669b140be0e32c", - "bytes": 22696 + "path": "packages/coretex/src/coordinator/retrieval-data-source.ts", + "sha256": "6f27b7a37da0ff6fa353640eb1a1f5ba7ae54420a5713001d5d3457d0c4717ac", + "bytes": 22807 }, { "role": "evaluator", - "path": "packages/cortex/src/coordinator/epoch-frontier.ts", - "sha256": "c76d53d8705eaab7509cde9e3c1c9fe01be81af37e4b5d9bbc7dfe6d89bc0eb0", - "bytes": 14041 + "path": "packages/coretex/src/coordinator/epoch-frontier.ts", + "sha256": "c1cd65edb6432092d1183b1e67fc678301a79eb0eefa483d5e5f567185826cb5", + "bytes": 14042 }, { "role": "evaluator", - "path": "packages/cortex/src/replay/per-patch.ts", + "path": "packages/coretex/src/replay/per-patch.ts", "sha256": "34a34cc4f380026f3775bca3e722af3f10fe42ddfac195c587624d9044babafc", "bytes": 9338 }, { "role": "evaluator", - "path": "packages/cortex/src/substrate/retrieval-decoder.ts", + "path": "packages/coretex/src/substrate/retrieval-decoder.ts", "sha256": "77bc67bea34cec0e991629d0562681519340f0c44b3a06a45cb347c3b1d52ba8", "bytes": 46847 }, { "role": "evaluator", - "path": "packages/cortex/src/substrate/structural-validity.ts", + "path": "packages/coretex/src/substrate/structural-validity.ts", "sha256": "6ac4711138d0396340a1b5237b7ea84a8808c7cc9eee5c8d23b17aab6460c0c9", "bytes": 945 }, { "role": "evaluator", - "path": "packages/cortex/src/substrate/slot-policy.ts", + "path": "packages/coretex/src/substrate/slot-policy.ts", "sha256": "5a18ea15c86284ec5da1611a5e40159654ef2b1aba7b15ffa50295069e3c8ae5", "bytes": 3408 }, { "role": "evaluator", - "path": "packages/cortex/src/corpus/admission.ts", + "path": "packages/coretex/src/corpus/admission.ts", "sha256": "33b883c926d8713374ea86b9a9b4a16c004c7a2babd4e32b6443343ac41064da", "bytes": 5019 }, { "role": "evaluator", - "path": "packages/cortex/src/corpus/delta.ts", + "path": "packages/coretex/src/corpus/delta.ts", "sha256": "63ae28be62f70e7ab3dbd7d9624ff65bd3d853e074753946ed26c1012f1de0c4", "bytes": 13835 }, { "role": "evaluator", - "path": "packages/cortex/src/corpus/logical-delta-bridge.ts", - "sha256": "f242c3e4c7ac6995e1d3a289a8f5bde0ae2af159ebd7c03acb44145a419113fc", - "bytes": 17510 + "path": "packages/coretex/src/corpus/logical-delta-bridge.ts", + "sha256": "08c31d3671d1498e42386223358eb5a993fa7db12a7bc1bd09edbd11366aef24", + "bytes": 17511 }, { "role": "evaluator", - "path": "packages/cortex/src/corpus/epoch-rotation.ts", + "path": "packages/coretex/src/corpus/epoch-rotation.ts", "sha256": "d6d07a0f3ac6e8495cf8fd0a74260533e16e58514febfd7c6e5ea3bc34f59ea0", "bytes": 8787 }, { "role": "evaluator", - "path": "packages/cortex/src/rewards/difficulty.ts", - "sha256": "18f35fc2040f989f4d29340a665c8b508804940b35dac95f99577b6b3fa4dcbc", - "bytes": 9826 + "path": "packages/coretex/src/rewards/difficulty.ts", + "sha256": "a13c8dec2bf11ff9fe9f657816254db1ff342fcf6afae3f1e4f34d71d653c4e7", + "bytes": 9824 }, { "role": "evaluator", - "path": "packages/cortex/src/rewards/work-units.ts", + "path": "packages/coretex/src/rewards/work-units.ts", "sha256": "9b8765ebd9c1011985876280cb2ca2f378f2917dc946a1a1a80635b3aaf1fc90", "bytes": 22111 }, { "role": "evaluator", - "path": "packages/cortex/src/coordinator/endpoints.ts", - "sha256": "47478c1cba2819e4ad60e67e41d14c4d86ec9fcf920e5360ea7a10d72988a7eb", - "bytes": 10738 + "path": "packages/coretex/src/coordinator/endpoints.ts", + "sha256": "596b521a48defbf0d50a622b394103ede9d507e4020c2c7602b686ce91601876", + "bytes": 12407 }, { "role": "evaluator", - "path": "packages/cortex/src/replay/v4.ts", + "path": "packages/coretex/src/replay/v4.ts", "sha256": "ec03c3e0da73b8a6aa9ff3023b73bf800c2761240d0c822eb11bd6825fa3c01e", "bytes": 13591 }, { "role": "evaluator", - "path": "packages/cortex/src/replay-cli.ts", + "path": "packages/coretex/src/replay-cli.ts", "sha256": "1df9568a1743b71a3b7d0aeb5a7d84b07a281cc0a0e0fdded4d693f579d202c2", "bytes": 10275 } @@ -722,5 +716,5 @@ "coordinatorCacheOptional": true, "snapshots": [] }, - "bundleHash": "0x73172e2bc77e2f066a160bc94a48ae73c5221cf11591c3958c03aa5884793506" + "bundleHash": "0x2a0557dad380456c12255d5285e7605cba9d589e9bd23a1dd65a30cd13e99776" } \ No newline at end of file diff --git a/release/calibration/2026-06-04-memory-atom-v16/evaluator-profile-v2-dgen1-policy-r5-atom-v16-300k-enabled.json b/release/calibration/2026-06-04-memory-atom-v16/evaluator-profile-v2-dgen1-policy-r5-atom-v16-300k-enabled.json index b44dc21b..d8dac198 100644 --- a/release/calibration/2026-06-04-memory-atom-v16/evaluator-profile-v2-dgen1-policy-r5-atom-v16-300k-enabled.json +++ b/release/calibration/2026-06-04-memory-atom-v16/evaluator-profile-v2-dgen1-policy-r5-atom-v16-300k-enabled.json @@ -27,7 +27,7 @@ "w_structural_sanity": 0.05 }, "patchAcceptanceFloors": { - "minImprovementPpm": 2500, + "minImprovementPpm": 500, "structuralFloor": 0.95, "protectedRegressionFloor": 0.05, "familyCatastrophicFloor": 0.85 diff --git a/scripts/calibrate.mjs b/scripts/calibrate.mjs index eaf2a4b9..6afeabba 100644 --- a/scripts/calibrate.mjs +++ b/scripts/calibrate.mjs @@ -87,7 +87,7 @@ if (evalHiddenEvents.length === 0) { // ─── Replay tolerance ──────────────────────────────────────────────────────── -const minImprovementPpm = Number(flag('min-improvement-ppm', '2500')); +const minImprovementPpm = Number(flag('min-improvement-ppm', '500')); const replayTolerancePpm = Math.max( Number(flag('min-replay-tolerance-ppm', '250')), Math.ceil(detAgg.p99PpmDiff || 0), diff --git a/scripts/coretex-epoch-evolve.mjs b/scripts/coretex-epoch-evolve.mjs index 91643f10..d9867bda 100644 --- a/scripts/coretex-epoch-evolve.mjs +++ b/scripts/coretex-epoch-evolve.mjs @@ -570,7 +570,7 @@ async function main() { : undefined; const fixedPackRepeatabilityPpm = optionalNumberFlag('fixed-pack-repeatability-ppm', profile.fixedPackRepeatabilityPpm ?? profile.baselineVariancePpm); const recentNoiseFloorPpm = numberFlag('recent-noise-floor-ppm', 0); - const currentMinImprovementPpm = numberFlag('current-min-improvement-ppm', profile.patchAcceptanceFloors?.minImprovementPpm ?? bundle.scoring?.minImprovementPpm ?? 2500); + const currentMinImprovementPpm = numberFlag('current-min-improvement-ppm', profile.patchAcceptanceFloors?.minImprovementPpm ?? bundle.scoring?.minImprovementPpm ?? 500); const targetAdvances = numberFlag('target-advances', profile.epochFrontier?.targetAccepts ?? 3); const previousEvalHiddenCount = previousCorpus.events.filter((e) => e.split === 'eval_hidden').length; const nextEvalHiddenCount = nextCorpus.events.filter((e) => e.split === 'eval_hidden').length; diff --git a/scripts/coretex-scorer-parity-harness.mjs b/scripts/coretex-scorer-parity-harness.mjs index 563da61a..62ea68d4 100644 --- a/scripts/coretex-scorer-parity-harness.mjs +++ b/scripts/coretex-scorer-parity-harness.mjs @@ -205,7 +205,7 @@ const productionVariancePpm = baselineVarianceSource === 'rotating_pack' || base ? (profile.baselineVariancePpm ?? 0) : 0; const stateAdvanceThresholdPpm = - (profile.patchAcceptanceFloors?.minImprovementPpm ?? 2500) + (profile.patchAcceptanceFloors?.minImprovementPpm ?? 500) + (profile.replayTolerancePpm ?? 0) + productionVariancePpm; const screenerThresholdPpm = Number(computeCoreTexScreenerThresholdPpm({ diff --git a/scripts/mining-flow-e2e.mjs b/scripts/mining-flow-e2e.mjs index 9b2569b0..7c6be547 100644 --- a/scripts/mining-flow-e2e.mjs +++ b/scripts/mining-flow-e2e.mjs @@ -123,7 +123,7 @@ const coordinator = { ?? `0x${'0'.repeat(64)}`, wordCount: bundleManifest.substrate?.wordCount ?? 1024, transitionCount: 0, - minImprovementPpm: bundleManifest.evaluator?.profile?.minImprovementPpm ?? 2500, + minImprovementPpm: bundleManifest.evaluator?.profile?.minImprovementPpm ?? 500, rulesVersion: bundleManifest.rulesVersion ?? 0, workPolicyHash: bundleManifest.workPolicyHash ?? `0x${'0'.repeat(64)}`, corpusRoot: bundleManifest.corpusRoot ?? `0x${'0'.repeat(64)}`, diff --git a/scripts/recalibrate-baseline.mjs b/scripts/recalibrate-baseline.mjs index 2b88458c..cf9e25d3 100644 --- a/scripts/recalibrate-baseline.mjs +++ b/scripts/recalibrate-baseline.mjs @@ -177,11 +177,11 @@ const proposedProductionVariancePpm = baselineVarianceSource === 'rotating_pack' ? summary.stddevPpm : 0; const currentStateAdvanceThresholdPpm = - (profile.patchAcceptanceFloors?.minImprovementPpm ?? 2500) + (profile.patchAcceptanceFloors?.minImprovementPpm ?? 500) + (profile.replayTolerancePpm ?? 0) + currentProductionVariancePpm; const proposedStateAdvanceThresholdPpm = - (profile.patchAcceptanceFloors?.minImprovementPpm ?? 2500) + (profile.patchAcceptanceFloors?.minImprovementPpm ?? 500) + (profile.replayTolerancePpm ?? 0) + proposedProductionVariancePpm; const currentThresholdPpm = computeCoreTexScreenerThresholdPpm({ diff --git a/scripts/screener-threshold-calibration.mjs b/scripts/screener-threshold-calibration.mjs index 8a331f1c..ed518f7d 100644 --- a/scripts/screener-threshold-calibration.mjs +++ b/scripts/screener-threshold-calibration.mjs @@ -117,7 +117,7 @@ const productionVariancePpm = baselineVarianceSource === 'rotating_pack' || base ? (profile.baselineVariancePpm ?? 0) : 0; const stateAdvanceThresholdPpm = - (profile.patchAcceptanceFloors?.minImprovementPpm ?? 2500) + (profile.patchAcceptanceFloors?.minImprovementPpm ?? 500) + (profile.replayTolerancePpm ?? 0) + productionVariancePpm; const floors = { ...profile.patchAcceptanceFloors, acceptanceThresholdPpm: stateAdvanceThresholdPpm }; diff --git a/scripts/smoke-screener-threshold-mechanics.mjs b/scripts/smoke-screener-threshold-mechanics.mjs index d22075bd..a75a6f84 100644 --- a/scripts/smoke-screener-threshold-mechanics.mjs +++ b/scripts/smoke-screener-threshold-mechanics.mjs @@ -50,7 +50,7 @@ const productionVariancePpm = baselineVarianceSource === 'rotating_pack' || base ? (profile.baselineVariancePpm ?? 0) : 0; const stateAdvanceThresholdPpm = - (profile.patchAcceptanceFloors?.minImprovementPpm ?? 2500) + (profile.patchAcceptanceFloors?.minImprovementPpm ?? 500) + (profile.replayTolerancePpm ?? 0) + productionVariancePpm; @@ -64,7 +64,7 @@ const reranker = await createDeterministicReranker(); const biEncoderHash = biEncoderModelIdHash(BE.modelId, BE.revision, 'dense'); const rt = { biEncoder: inertBiEncoder(BE, LAYOUT), reranker, biEncoderHash, retrievalKeyLayout: LAYOUT }; const opts = scoringOptionsFromProfile(profile, rt); -const floors = { ...profile.patchAcceptanceFloors, acceptanceThresholdPpm: profile.patchAcceptanceFloors?.minImprovementPpm ?? 2500 }; +const floors = { ...profile.patchAcceptanceFloors, acceptanceThresholdPpm: profile.patchAcceptanceFloors?.minImprovementPpm ?? 500 }; const evalSeed = profile.baselineEvalSeedHex ?? '0x' + 'a5'.repeat(32); const pack = deriveQueryPack(0, evalSeed, corpus, { packSize: PACK_SIZE, quotas: [] }); From 8e413ed38801503d3bf676f32759234caad7b67a Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Tue, 16 Jun 2026 02:58:49 +0000 Subject: [PATCH 2/8] Revert "feat: recalibrate canonical cold-start difficulty floor" This reverts commit f13afd2e940e7853d6f007f0b7511f702cda503c. --- .github/workflows/ci.yml | 1 - .github/workflows/coretex-release.yml | 15 +- .gitignore | 1 - package-lock.json | 2 +- packages/coretex/package.json | 3 +- .../coretex/scripts/check-release-version.mjs | 20 --- packages/coretex/src/bundle/index.ts | 2 +- packages/coretex/src/rewards/difficulty.ts | 2 +- packages/coretex/src/validator-sync-cli.ts | 5 +- packages/coretex/src/version.ts | 2 +- .../coordinator-concurrency-baseline.test.mjs | 22 ++- .../unit/coretex-coordinator-core.test.mjs | 14 +- .../test/unit/difficulty-grace.test.mjs | 2 +- .../coretex/test/unit/difficulty.test.mjs | 18 +-- ...dgen1-policy-r5-atom-v16-300k-enabled.json | 146 +++++++++--------- ...dgen1-policy-r5-atom-v16-300k-enabled.json | 2 +- scripts/calibrate.mjs | 2 +- scripts/coretex-epoch-evolve.mjs | 2 +- scripts/coretex-scorer-parity-harness.mjs | 2 +- scripts/mining-flow-e2e.mjs | 2 +- scripts/recalibrate-baseline.mjs | 4 +- scripts/screener-threshold-calibration.mjs | 2 +- .../smoke-screener-threshold-mechanics.mjs | 4 +- 23 files changed, 125 insertions(+), 150 deletions(-) delete mode 100644 packages/coretex/scripts/check-release-version.mjs diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0394d4d3..b2b5c4e9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,6 @@ jobs: node-version: ${{ env.NODE_VERSION }} cache: npm - run: npm ci - - run: npm run version:check --workspace @botcoin/coretex - run: npm run lint --if-present - run: npm run typecheck --if-present - run: npm run build --if-present diff --git a/.github/workflows/coretex-release.yml b/.github/workflows/coretex-release.yml index adaf4d3b..bbf50745 100644 --- a/.github/workflows/coretex-release.yml +++ b/.github/workflows/coretex-release.yml @@ -9,8 +9,8 @@ permissions: contents: write jobs: - release-coretex-package: - name: Build and publish CoreTex package artifacts + release-coretex-client: + name: Build and publish CoreTex client artifacts runs-on: ubuntu-latest env: NODE_VERSION: "22" @@ -27,18 +27,15 @@ jobs: - name: Install dependencies run: npm ci - - name: Verify package/runtime version sync - run: npm run version:check --workspace @botcoin/coretex - - name: Build workspace run: npm run build - - name: Verify tag matches package version + - name: Verify tag matches client version constant run: | - PACKAGE_VERSION=$(node -p "require('./packages/coretex/package.json').version") + CLIENT_VERSION=$(node -e "const fs=require('fs');const s=fs.readFileSync('packages/coretex/src/version.ts','utf8');const m=s.match(/CORTEX_CLIENT_VERSION\\s*=\\s*'([^']+)'/);if(!m)process.exit(1);process.stdout.write(m[1]);") TAG_VERSION="${GITHUB_REF_NAME#coretex-v}" - if [ "${PACKAGE_VERSION}" != "${TAG_VERSION}" ]; then - echo "tag/version mismatch: tag=${TAG_VERSION} package=${PACKAGE_VERSION}" + if [ "${CLIENT_VERSION}" != "${TAG_VERSION}" ]; then + echo "tag/version mismatch: tag=${TAG_VERSION} client=${CLIENT_VERSION}" exit 1 fi diff --git a/.gitignore b/.gitignore index 5fe25069..0215d79d 100644 --- a/.gitignore +++ b/.gitignore @@ -112,7 +112,6 @@ release/calibration/** !release/calibration/2026-06-04-memory-atom-v16/coretex-launch-v16-artifacts.json !release/calibration/2026-06-04-memory-atom-v16/bundle-manifest-v2-dgen1-policy-r5-atom-v16-300k-enabled.json !release/calibration/2026-06-04-memory-atom-v16/evaluator-profile-v2-dgen1-policy-r5-atom-v16-300k-enabled.json -!release/calibration/2026-06-04-memory-atom-v16/screener-threshold-v16-qwen-cpu-coldstart-repin-2026-06-16.json # Generated DACR corpus (regenerated from HF dataset by scripts/build-corpus-from-dacr.mjs) benchmark/fixtures/dacr/ diff --git a/package-lock.json b/package-lock.json index 8a79e803..55b7a94e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1063,7 +1063,7 @@ }, "packages/coretex": { "name": "@botcoin/coretex", - "version": "0.7.1", + "version": "0.1.0", "license": "Apache-2.0", "bin": { "botcoin-coretex": "dist/cli.js", diff --git a/packages/coretex/package.json b/packages/coretex/package.json index ef3490a4..16ded848 100644 --- a/packages/coretex/package.json +++ b/packages/coretex/package.json @@ -1,6 +1,6 @@ { "name": "@botcoin/coretex", - "version": "0.7.1", + "version": "0.1.0", "private": false, "description": "Botcoin CoreTex decoder, evaluator, validator, and CLI.", "license": "Apache-2.0", @@ -37,7 +37,6 @@ "prebuild": "npm run clean", "build": "tsc -p tsconfig.json", "typecheck": "tsc -p tsconfig.json --noEmit", - "version:check": "node scripts/check-release-version.mjs", "test:unit": "node --test --test-concurrency=2 --test-reporter=spec ./test/unit/*.test.mjs" }, "files": [ diff --git a/packages/coretex/scripts/check-release-version.mjs b/packages/coretex/scripts/check-release-version.mjs deleted file mode 100644 index d5d68693..00000000 --- a/packages/coretex/scripts/check-release-version.mjs +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env node -import { readFileSync } from 'node:fs'; -import { resolve } from 'node:path'; - -const pkgRoot = resolve(new URL('..', import.meta.url).pathname); -const pkg = JSON.parse(readFileSync(resolve(pkgRoot, 'package.json'), 'utf8')); -const src = readFileSync(resolve(pkgRoot, 'src/version.ts'), 'utf8'); -const match = src.match(/CORTEX_CLIENT_VERSION\s*=\s*'([^']+)'/); - -if (!match) { - console.error('version:check: could not find CORTEX_CLIENT_VERSION in src/version.ts'); - process.exit(1); -} - -if (pkg.version !== match[1]) { - console.error(`version:check: package.json version ${pkg.version} != src/version.ts ${match[1]}`); - process.exit(1); -} - -console.log(`version:check ok: ${pkg.version}`); diff --git a/packages/coretex/src/bundle/index.ts b/packages/coretex/src/bundle/index.ts index 4b523ce3..1419c28f 100644 --- a/packages/coretex/src/bundle/index.ts +++ b/packages/coretex/src/bundle/index.ts @@ -824,7 +824,7 @@ export const DEFAULT_COMPOSITE_WEIGHTS_PIN: CompositeWeightPin = { }; export const DEFAULT_PATCH_FLOORS: PatchAcceptanceFloorsPin = { - minImprovementPpm: 500, + minImprovementPpm: 2500, structuralFloor: 0.95, protectedRegressionFloor: 0.05, familyCatastrophicFloor: 0.85, diff --git a/packages/coretex/src/rewards/difficulty.ts b/packages/coretex/src/rewards/difficulty.ts index 795d8f2c..fbe76ab6 100644 --- a/packages/coretex/src/rewards/difficulty.ts +++ b/packages/coretex/src/rewards/difficulty.ts @@ -11,7 +11,7 @@ * as floating-point intermediates and then rounded back to bigint. */ -export const MIN_IMPROVEMENT_PPM = 500n; +export const MIN_IMPROVEMENT_PPM = 2_500n; export const MAX_IMPROVEMENT_PPM = 150_000n; export interface DifficultyInputs { diff --git a/packages/coretex/src/validator-sync-cli.ts b/packages/coretex/src/validator-sync-cli.ts index 6b09c1d8..c907f090 100644 --- a/packages/coretex/src/validator-sync-cli.ts +++ b/packages/coretex/src/validator-sync-cli.ts @@ -1386,10 +1386,7 @@ async function buildValidatorScorerContext( biEncoderHash: biEncoderModelIdHash(corpus.biEncoderModelId, corpus.biEncoderRevision, 'dense'), retrievalKeyLayout: layout, }); - // Score replay must use the full bundle-pinned acceptance threshold rather - // than a launch-era screener cap, or a client can silently "verify" a patch - // that no longer clears the canonical production gate. - const thresholdPpm = computeAcceptanceThresholdPpm(profile); + const thresholdPpm = Math.min(computeAcceptanceThresholdPpm(profile), 355); return { corpus, profile, scoringOpts, thresholdPpm, reranker: reranker as ValidatorScorerContext['reranker'] }; } diff --git a/packages/coretex/src/version.ts b/packages/coretex/src/version.ts index 73278019..8e4b6376 100644 --- a/packages/coretex/src/version.ts +++ b/packages/coretex/src/version.ts @@ -1 +1 @@ -export const CORTEX_CLIENT_VERSION = '0.7.1'; +export const CORTEX_CLIENT_VERSION = '0.7.0'; diff --git a/packages/coretex/test/unit/coordinator-concurrency-baseline.test.mjs b/packages/coretex/test/unit/coordinator-concurrency-baseline.test.mjs index 8c14b7c5..bbabd701 100644 --- a/packages/coretex/test/unit/coordinator-concurrency-baseline.test.mjs +++ b/packages/coretex/test/unit/coordinator-concurrency-baseline.test.mjs @@ -47,10 +47,8 @@ const MINER_A = '0x' + 'aa'.repeat(20); const MINER_B = '0x' + 'bb'.repeat(20); // No static screenerThresholdPpm: the live threshold must derive from the -// real state-advance threshold. Under the cold-start repin this fixture's -// 500ppm min-improvement + 200ppm replay tolerance yields a 700ppm state -// threshold, but the canonical launch-era minimum screener floor still keeps -// the live screener at 355ppm. +// baseline plus state-advance threshold (288438 + 2700ppm -> 1350ppm under +// the default policy). const baseConfig = { epoch: EPOCH, expectedChainId: 8453n, @@ -69,7 +67,7 @@ const baseConfig = { receiptTtlSec: 60, perMinerScreenerCap: 50, baselineParentScorePpm: 288438, - minImprovementPpm: 500, + minImprovementPpm: 2500, replayTolerancePpm: 200, targetBlockOffset: 30, patchWordBudget: 4, @@ -492,14 +490,14 @@ describe('CoreTexCoordinatorCore §7 — baseline runtime semantics', () => { const coord = new CoreTexCoordinatorCore(baseConfig, chain, loadGenesis, evaluator, plainSigner); await coord.boot(); - // Launch context: baseline 288438 with a 700ppm state threshold -> live - // screener threshold 355ppm after the absolute screener floor is applied. + // Launch context: baseline 288438 with a 2700ppm state threshold -> live + // screener threshold 1350ppm. const status0 = await coord.getStatus(); assert.equal(status0.baselineState, 'ready'); assert.equal(status0.baselineParentScorePpm, 288438); - assert.equal(status0.stateAdvanceThresholdPpm, 700); - assert.equal(status0.screenerThresholdPpm, 355); - assert.equal(status0.thresholds.screenerThresholdPpm, 355); + assert.equal(status0.stateAdvanceThresholdPpm, 2700); + assert.equal(status0.screenerThresholdPpm, 1350); + assert.equal(status0.thresholds.screenerThresholdPpm, 1350); // A 320ppm screener is below the launch threshold. const before = await coord.submit(submitBody(makePatchHex(GENESIS_ROOT, 40, 1))); @@ -527,7 +525,7 @@ describe('CoreTexCoordinatorCore §7 — baseline runtime semantics', () => { const status1 = await coord.getStatus(); assert.equal(status1.baselineState, 'ready'); assert.equal(status1.baselineParentScorePpm, 400000); - assert.equal(status1.screenerThresholdPpm, 350, 'post-launch baseline recompute falls back to the live state-floor-derived screener'); + assert.equal(status1.screenerThresholdPpm, 1350, 'state-threshold floor dominates normal launch baselines'); assert.equal(status1.thresholds.baselineParentScorePpm, 400000); // A 1400ppm screener clears the live gate. @@ -571,7 +569,7 @@ describe('CoreTexCoordinatorCore §7 — baseline runtime semantics', () => { const ready = await coord.getStatus(); assert.equal(ready.baselineState, 'ready'); assert.equal(ready.baselineParentScorePpm, 300000); - assert.equal(ready.screenerThresholdPpm, 350); + assert.equal(ready.screenerThresholdPpm, 1350); const accepted = await coord.submit(submitBody(makePatchHex(ev0.newRoot, 40, 1), MINER_A, ev0.newRoot)); assert.equal(accepted.status, 'accepted', `expected accept, got ${JSON.stringify(accepted)}`); diff --git a/packages/coretex/test/unit/coretex-coordinator-core.test.mjs b/packages/coretex/test/unit/coretex-coordinator-core.test.mjs index b5969a52..b25691b5 100644 --- a/packages/coretex/test/unit/coretex-coordinator-core.test.mjs +++ b/packages/coretex/test/unit/coretex-coordinator-core.test.mjs @@ -60,12 +60,12 @@ const baseConfig = { confirmationDepth: 4, receiptTtlSec: 60, perMinerScreenerCap: 50, - // §7 launch baseline for the pinned (genesis) context. Under the cold-start - // repin this fixture advertises the lowered 500ppm min-improvement floor and - // 375ppm screener threshold. + // §7 launch baseline for the pinned (genesis) context. 288438 with the + // default policy and 2700ppm state threshold derives a live screener + // threshold of 1350ppm. baselineParentScorePpm: 288438, - screenerThresholdPpm: 375, - minImprovementPpm: 500, + screenerThresholdPpm: 355, + minImprovementPpm: 2500, replayTolerancePpm: 200, targetBlockOffset: 30, patchWordBudget: 4, @@ -685,8 +685,8 @@ describe('CoreTexCoordinatorCore — production submit path', () => { scoreAfterPpm: 2900, rewrittenPatchBytesHex: rewritten, evaluationProof: dualProofFor(ev.compactPatchBytes, GENESIS_ROOT, { - gate: { domain: 'gate', seedCommit: '0x' + '91'.repeat(32), accepted: true, scorePpm: 600 }, - confirm: { domain: 'confirm', seedCommit: '0x' + '92'.repeat(32), accepted: true, scorePpm: 600 }, + gate: { domain: 'gate', seedCommit: '0x' + '91'.repeat(32), accepted: true, scorePpm: 2600 }, + confirm: { domain: 'confirm', seedCommit: '0x' + '92'.repeat(32), accepted: true, scorePpm: 2600 }, }), }), }; diff --git a/packages/coretex/test/unit/difficulty-grace.test.mjs b/packages/coretex/test/unit/difficulty-grace.test.mjs index 2821ac6f..5f1640e8 100644 --- a/packages/coretex/test/unit/difficulty-grace.test.mjs +++ b/packages/coretex/test/unit/difficulty-grace.test.mjs @@ -56,7 +56,7 @@ describe('major-delta grace', () => { qualityAttempts: 200, majorDeltaActive: true, }); - assert.equal(out.next, 500n, 'clamps to MIN_IMPROVEMENT_PPM floor'); + assert.equal(out.next, 2_500n, 'clamps to MIN_IMPROVEMENT_PPM floor'); assert.equal(out.reason, 'major_delta_grace'); }); diff --git a/packages/coretex/test/unit/difficulty.test.mjs b/packages/coretex/test/unit/difficulty.test.mjs index 59de4cd6..49eb5431 100644 --- a/packages/coretex/test/unit/difficulty.test.mjs +++ b/packages/coretex/test/unit/difficulty.test.mjs @@ -19,7 +19,7 @@ const { describe('CoreTex V4 difficulty calculator', () => { test('constants are correct bigints', () => { - assert.equal(MIN_IMPROVEMENT_PPM, 500n); + assert.equal(MIN_IMPROVEMENT_PPM, 2_500n); assert.equal(MAX_IMPROVEMENT_PPM, 150_000n); }); @@ -142,9 +142,9 @@ describe('CoreTex V4 difficulty calculator', () => { }); test('floor clamp: decay cannot go below MIN_IMPROVEMENT_PPM', () => { - // current=600 * 0.85 = 510 → not clamped - // Use a smaller current to force a floor hit: 550 * 0.85 = 468 < 500 - const current = 550n; + // current=3_000, 0.85 → unclamped=2_550, within range + // Use a smaller current to force a floor hit: 2_900 * 0.85 = 2_465 < 2_500 + const current = 2_900n; const result = nextMinImprovementPpm({ current, observedAdvances: 0, @@ -157,9 +157,9 @@ describe('CoreTex V4 difficulty calculator', () => { }); test('floor clamp: small_drift_down at floor stays at floor', () => { - // current=600 * 0.85 (decay) = 510 → not clamped - // current=520 * 0.95 = 494 < 500 → clamped - const current = 520n; + // current=3_000 * 0.85 (decay) = 2_550 → not clamped + // current=2_600 * 0.95 = 2_470 < 2_500 → clamped + const current = 2_600n; const result = nextMinImprovementPpm({ current, observedAdvances: 0, @@ -253,8 +253,8 @@ describe('CoreTex V4 difficulty calculator', () => { // undefined → pinned MAX; a maxClampPpm <= floor is ignored (falls back to MAX). const a = nextMinImprovementPpm({ current: 149_000n, observedAdvances: 10, targetAdvances: 5, qualityAttempts: 8 }); assert.equal(a.next, MAX_IMPROVEMENT_PPM); - const b = nextMinImprovementPpm({ current: 149_000n, observedAdvances: 10, targetAdvances: 5, qualityAttempts: 8, maxClampPpm: 500n }); - assert.equal(b.next, MAX_IMPROVEMENT_PPM); // <= floor → ignored + const b = nextMinImprovementPpm({ current: 149_000n, observedAdvances: 10, targetAdvances: 5, qualityAttempts: 8, maxClampPpm: 1_000n }); + assert.equal(b.next, MAX_IMPROVEMENT_PPM); // 1_000 < floor → ignored const c = nextMinImprovementPpm({ current: 10_000n, observedAdvances: 0, targetAdvances: 5, qualityAttempts: 20, minClampPpm: -5n }); assert.equal(c.next, 8_500n); // negative floor ignored → normal decay, no clamp assert.equal(c.clamped, false); diff --git a/release/calibration/2026-06-04-memory-atom-v16/bundle-manifest-v2-dgen1-policy-r5-atom-v16-300k-enabled.json b/release/calibration/2026-06-04-memory-atom-v16/bundle-manifest-v2-dgen1-policy-r5-atom-v16-300k-enabled.json index a06927b1..e6da98a4 100644 --- a/release/calibration/2026-06-04-memory-atom-v16/bundle-manifest-v2-dgen1-policy-r5-atom-v16-300k-enabled.json +++ b/release/calibration/2026-06-04-memory-atom-v16/bundle-manifest-v2-dgen1-policy-r5-atom-v16-300k-enabled.json @@ -8,33 +8,33 @@ "specs": [ { "role": "substrate-spec", - "path": "specs/coretex_state.md", - "sha256": "88460dfecac8195658569e57913e9cbcb861e46aff7320811170408deafada55", - "bytes": 24032 + "path": "specs/cortex_state.md", + "sha256": "b42a04a26e83d000763ed10af54978027b027857206ac7af072b6c571e0d4c68", + "bytes": 24026 }, { "role": "substrate-spec", - "path": "specs/coretex_schema.json", - "sha256": "3e14ac9292479558e43dd9be4e95f6c53d1f313b3a78c624620110d58bc8f498", - "bytes": 9351 + "path": "specs/cortex_schema.json", + "sha256": "d6328375da87ae59c55f1777771ca37d68749b9c3e089841b82f14a2bc02fead", + "bytes": 9350 }, { "role": "substrate-spec", "path": "specs/packing_spec.md", - "sha256": "4b9685e3155cd8cb10883d70c1a70c1d186d604eab0c067e6172505f6abfce09", - "bytes": 3235 + "sha256": "dbe7813581fcf5c3c49436a7eba1600282274db9d2b9fba710dd3ece3b2a2c45", + "bytes": 3231 }, { "role": "substrate-spec", "path": "specs/merkleization_spec.md", - "sha256": "0e3ac9063da0aa039254c89e5409affca52bb619ecde156378a31876e685a862", - "bytes": 4533 + "sha256": "1f01cb437b51e235328b228e9908682f075cc5d393f32fe08a1e19336f4a9562", + "bytes": 4532 }, { "role": "substrate-spec", "path": "specs/patch_format.md", - "sha256": "ff6f9d352d152945cb568af7e664e39e80d9c5bfb8b22ee650628d18a2e1d765", - "bytes": 7450 + "sha256": "89e31b19cbe2bcabb55e2a1c49e4aba0315d986fad15f87d768130203b6df128", + "bytes": 7449 }, { "role": "substrate-spec", @@ -45,8 +45,8 @@ { "role": "substrate-spec", "path": "specs/substrate_retrieval_semantics.md", - "sha256": "9562c35d5de368dc68e0a4051108d1af138fef153ba865a05d38dd96eeeca2ed", - "bytes": 8564 + "sha256": "ae32db66002aac45679e3044c03d2b0bb92f21a1244a1082dcf64908a6808e0f", + "bytes": 8561 }, { "role": "substrate-spec", @@ -70,33 +70,33 @@ "implementation": [ { "role": "substrate-impl", - "path": "packages/coretex/src/state/codec.ts", + "path": "packages/cortex/src/state/codec.ts", "sha256": "b1d30678701c3c9d96ae37106f4c534361bd7a91c27479b3afefe913b194e6e1", "bytes": 2960 }, { "role": "substrate-impl", - "path": "packages/coretex/src/state/merkle.ts", + "path": "packages/cortex/src/state/merkle.ts", "sha256": "e079a3a91506fc68820cc2115a4abb1469e94450d12c54c53de0e6b83ca89307", "bytes": 4669 }, { "role": "substrate-impl", - "path": "packages/coretex/src/state/patch.ts", + "path": "packages/cortex/src/state/patch.ts", "sha256": "ab1fa9942f7fc2657aeacaf5d72e2d9ecab80aa98e18383e476d7a8226d51672", "bytes": 21589 }, { "role": "substrate-impl", - "path": "packages/coretex/src/state/types.ts", + "path": "packages/cortex/src/state/types.ts", "sha256": "f607667f52acf6a88e8dceac5f578a8d142e59e33063d7d9162c391cfc78dfe5", "bytes": 5511 }, { "role": "substrate-impl", - "path": "packages/coretex/src/state/validate.ts", - "sha256": "f779ba5498f709c081c21ef93ba6c78bab6790ada03c3964dfe08c6f64868dad", - "bytes": 8250 + "path": "packages/cortex/src/state/validate.ts", + "sha256": "365d68a68abf5e0a1e756a626559ce7e6ed4c6713d3740cdf00dc5208b31d1e6", + "bytes": 8248 } ] }, @@ -105,9 +105,15 @@ "files": [ { "role": "corpus", - "path": "release/calibration/2026-06-04-memory-atom-v16/materialized/73172e2b/corpus.json", - "sha256": "c094cd5166b9d132d275921bf8bd3d9052c49c9bcd8b2f02478b298e778c4e47", - "bytes": 2114801 + "path": "release/calibration/2026-06-04-memory-atom-v16/dgen1-r5-synth-300k-atom-v16-corpus.json", + "sha256": "aa84271dade558e6dad9625cf4b59687dc21a3ce2211edc1e39b084c1b7e23df", + "bytes": 236975364 + }, + { + "role": "corpus", + "path": "release/calibration/2026-06-04-memory-atom-v16/dgen1-r5-synth-300k-atom-v16-embeddings.json", + "sha256": "3f590dfa2a58161e213ced613e42dc663a37039b5946a5971c66b2047d0bda04", + "bytes": 475912682 } ] }, @@ -141,7 +147,7 @@ "w_structural_sanity": 0.05 }, "patchAcceptanceFloors": { - "minImprovementPpm": 500, + "minImprovementPpm": 2500, "structuralFloor": 0.95, "protectedRegressionFloor": 0.05, "familyCatastrophicFloor": 0.85 @@ -339,157 +345,157 @@ "files": [ { "role": "evaluator", - "path": "packages/coretex/src/eval/retrieval-corpus.ts", - "sha256": "1b5de7b92ca42820ccd64e1d4cd2ec12422b62362a63c2513cfb4134e60ddb4f", - "bytes": 41862 + "path": "packages/cortex/src/eval/retrieval-corpus.ts", + "sha256": "4ae4e15f6e740d42afb66515e7ca677841e4b39b6616a317e19f0d6659c3d310", + "bytes": 37505 }, { "role": "evaluator", - "path": "packages/coretex/src/eval/retrieval-benchmark.ts", - "sha256": "b7dd77d597bb4a370c572d0ac2a71e1ced35af95414a1dd058ca62b58fa1b369", - "bytes": 167579 + "path": "packages/cortex/src/eval/retrieval-benchmark.ts", + "sha256": "1bb78a1c08c19dd0e8d723d1b095c5bd60d07ac3cba4cb990d19510e8e2ea9a8", + "bytes": 167584 }, { "role": "evaluator", - "path": "packages/coretex/src/eval/ir-metrics.ts", + "path": "packages/cortex/src/eval/ir-metrics.ts", "sha256": "7e8ac68f671f56e7d131d6600a1ae382f3f7a801cc86a386e202aac8ea8c98d6", "bytes": 6130 }, { "role": "evaluator", - "path": "packages/coretex/src/eval/hidden-query-pack.ts", + "path": "packages/cortex/src/eval/hidden-query-pack.ts", "sha256": "5d06d65cdae4dc9cee8ab1af26dc018c91def9c2fdfc8edd8f2461cf93b7fb19", "bytes": 21682 }, { "role": "evaluator", - "path": "packages/coretex/src/eval/bi-encoder.ts", + "path": "packages/cortex/src/eval/bi-encoder.ts", "sha256": "8cb4e55b88b5080a37b2828b62cabcd608f3e410967cced043c6b60ed0269d6d", "bytes": 12968 }, { "role": "evaluator", - "path": "packages/coretex/src/eval/reranker.ts", - "sha256": "7a99461eb1cee8d193f4a85cfbc10d21da6fd0e2159023e11005b4885f3226f5", - "bytes": 38285 + "path": "packages/cortex/src/eval/reranker.ts", + "sha256": "419a6747f5183d86108283a574d55ea5ae7e0123c84323303f1f4e7575363f50", + "bytes": 38274 }, { "role": "evaluator", - "path": "packages/coretex/src/eval/seed-derivation.ts", + "path": "packages/cortex/src/eval/seed-derivation.ts", "sha256": "0a71f90e4e380dda397f121c8dd966d7bd78e752e353cd8c7f2cb73a1da3e306", "bytes": 9793 }, { "role": "evaluator", - "path": "packages/coretex/src/eval/live-eval-admission.ts", + "path": "packages/cortex/src/eval/live-eval-admission.ts", "sha256": "fe93e2a39fa1005c22d4a2904cc701a80da4ecbbb4787d4a9bea3ed48c9a9e66", "bytes": 4855 }, { "role": "evaluator", - "path": "packages/coretex/src/coordinator/base-blockhash.ts", + "path": "packages/cortex/src/coordinator/base-blockhash.ts", "sha256": "576aefcecd8dcb130128eaad6e7ad521b3c4ace2e5f2b5bad0d02b5540c048a9", "bytes": 5747 }, { "role": "evaluator", - "path": "packages/coretex/src/coordinator/patch-received-notice.ts", + "path": "packages/cortex/src/coordinator/patch-received-notice.ts", "sha256": "31cf517bcb510ea839cd3032c9707fd50368e012ce5aeb026bc8c608fe067dd4", "bytes": 8836 }, { "role": "evaluator", - "path": "packages/coretex/src/coordinator/per-patch-evaluator.ts", - "sha256": "e91389ca10bbe08a547cdf3db112a6ef64c0c77844519e10ee71d545933a13e1", - "bytes": 20063 + "path": "packages/cortex/src/coordinator/per-patch-evaluator.ts", + "sha256": "df4f613f881c4c0f7f6884da69fd595afcc8accb1afec444a32cdc0b9647cdcd", + "bytes": 19808 }, { "role": "evaluator", - "path": "packages/coretex/src/coordinator/retrieval-data-source.ts", - "sha256": "6f27b7a37da0ff6fa353640eb1a1f5ba7ae54420a5713001d5d3457d0c4717ac", - "bytes": 22807 + "path": "packages/cortex/src/coordinator/retrieval-data-source.ts", + "sha256": "1182d6727a9a56b6917297099bf7af5876e537b1d214962017669b140be0e32c", + "bytes": 22696 }, { "role": "evaluator", - "path": "packages/coretex/src/coordinator/epoch-frontier.ts", - "sha256": "c1cd65edb6432092d1183b1e67fc678301a79eb0eefa483d5e5f567185826cb5", - "bytes": 14042 + "path": "packages/cortex/src/coordinator/epoch-frontier.ts", + "sha256": "c76d53d8705eaab7509cde9e3c1c9fe01be81af37e4b5d9bbc7dfe6d89bc0eb0", + "bytes": 14041 }, { "role": "evaluator", - "path": "packages/coretex/src/replay/per-patch.ts", + "path": "packages/cortex/src/replay/per-patch.ts", "sha256": "34a34cc4f380026f3775bca3e722af3f10fe42ddfac195c587624d9044babafc", "bytes": 9338 }, { "role": "evaluator", - "path": "packages/coretex/src/substrate/retrieval-decoder.ts", + "path": "packages/cortex/src/substrate/retrieval-decoder.ts", "sha256": "77bc67bea34cec0e991629d0562681519340f0c44b3a06a45cb347c3b1d52ba8", "bytes": 46847 }, { "role": "evaluator", - "path": "packages/coretex/src/substrate/structural-validity.ts", + "path": "packages/cortex/src/substrate/structural-validity.ts", "sha256": "6ac4711138d0396340a1b5237b7ea84a8808c7cc9eee5c8d23b17aab6460c0c9", "bytes": 945 }, { "role": "evaluator", - "path": "packages/coretex/src/substrate/slot-policy.ts", + "path": "packages/cortex/src/substrate/slot-policy.ts", "sha256": "5a18ea15c86284ec5da1611a5e40159654ef2b1aba7b15ffa50295069e3c8ae5", "bytes": 3408 }, { "role": "evaluator", - "path": "packages/coretex/src/corpus/admission.ts", + "path": "packages/cortex/src/corpus/admission.ts", "sha256": "33b883c926d8713374ea86b9a9b4a16c004c7a2babd4e32b6443343ac41064da", "bytes": 5019 }, { "role": "evaluator", - "path": "packages/coretex/src/corpus/delta.ts", + "path": "packages/cortex/src/corpus/delta.ts", "sha256": "63ae28be62f70e7ab3dbd7d9624ff65bd3d853e074753946ed26c1012f1de0c4", "bytes": 13835 }, { "role": "evaluator", - "path": "packages/coretex/src/corpus/logical-delta-bridge.ts", - "sha256": "08c31d3671d1498e42386223358eb5a993fa7db12a7bc1bd09edbd11366aef24", - "bytes": 17511 + "path": "packages/cortex/src/corpus/logical-delta-bridge.ts", + "sha256": "f242c3e4c7ac6995e1d3a289a8f5bde0ae2af159ebd7c03acb44145a419113fc", + "bytes": 17510 }, { "role": "evaluator", - "path": "packages/coretex/src/corpus/epoch-rotation.ts", + "path": "packages/cortex/src/corpus/epoch-rotation.ts", "sha256": "d6d07a0f3ac6e8495cf8fd0a74260533e16e58514febfd7c6e5ea3bc34f59ea0", "bytes": 8787 }, { "role": "evaluator", - "path": "packages/coretex/src/rewards/difficulty.ts", - "sha256": "a13c8dec2bf11ff9fe9f657816254db1ff342fcf6afae3f1e4f34d71d653c4e7", - "bytes": 9824 + "path": "packages/cortex/src/rewards/difficulty.ts", + "sha256": "18f35fc2040f989f4d29340a665c8b508804940b35dac95f99577b6b3fa4dcbc", + "bytes": 9826 }, { "role": "evaluator", - "path": "packages/coretex/src/rewards/work-units.ts", + "path": "packages/cortex/src/rewards/work-units.ts", "sha256": "9b8765ebd9c1011985876280cb2ca2f378f2917dc946a1a1a80635b3aaf1fc90", "bytes": 22111 }, { "role": "evaluator", - "path": "packages/coretex/src/coordinator/endpoints.ts", - "sha256": "596b521a48defbf0d50a622b394103ede9d507e4020c2c7602b686ce91601876", - "bytes": 12407 + "path": "packages/cortex/src/coordinator/endpoints.ts", + "sha256": "47478c1cba2819e4ad60e67e41d14c4d86ec9fcf920e5360ea7a10d72988a7eb", + "bytes": 10738 }, { "role": "evaluator", - "path": "packages/coretex/src/replay/v4.ts", + "path": "packages/cortex/src/replay/v4.ts", "sha256": "ec03c3e0da73b8a6aa9ff3023b73bf800c2761240d0c822eb11bd6825fa3c01e", "bytes": 13591 }, { "role": "evaluator", - "path": "packages/coretex/src/replay-cli.ts", + "path": "packages/cortex/src/replay-cli.ts", "sha256": "1df9568a1743b71a3b7d0aeb5a7d84b07a281cc0a0e0fdded4d693f579d202c2", "bytes": 10275 } @@ -716,5 +722,5 @@ "coordinatorCacheOptional": true, "snapshots": [] }, - "bundleHash": "0x2a0557dad380456c12255d5285e7605cba9d589e9bd23a1dd65a30cd13e99776" + "bundleHash": "0x73172e2bc77e2f066a160bc94a48ae73c5221cf11591c3958c03aa5884793506" } \ No newline at end of file diff --git a/release/calibration/2026-06-04-memory-atom-v16/evaluator-profile-v2-dgen1-policy-r5-atom-v16-300k-enabled.json b/release/calibration/2026-06-04-memory-atom-v16/evaluator-profile-v2-dgen1-policy-r5-atom-v16-300k-enabled.json index d8dac198..b44dc21b 100644 --- a/release/calibration/2026-06-04-memory-atom-v16/evaluator-profile-v2-dgen1-policy-r5-atom-v16-300k-enabled.json +++ b/release/calibration/2026-06-04-memory-atom-v16/evaluator-profile-v2-dgen1-policy-r5-atom-v16-300k-enabled.json @@ -27,7 +27,7 @@ "w_structural_sanity": 0.05 }, "patchAcceptanceFloors": { - "minImprovementPpm": 500, + "minImprovementPpm": 2500, "structuralFloor": 0.95, "protectedRegressionFloor": 0.05, "familyCatastrophicFloor": 0.85 diff --git a/scripts/calibrate.mjs b/scripts/calibrate.mjs index 6afeabba..eaf2a4b9 100644 --- a/scripts/calibrate.mjs +++ b/scripts/calibrate.mjs @@ -87,7 +87,7 @@ if (evalHiddenEvents.length === 0) { // ─── Replay tolerance ──────────────────────────────────────────────────────── -const minImprovementPpm = Number(flag('min-improvement-ppm', '500')); +const minImprovementPpm = Number(flag('min-improvement-ppm', '2500')); const replayTolerancePpm = Math.max( Number(flag('min-replay-tolerance-ppm', '250')), Math.ceil(detAgg.p99PpmDiff || 0), diff --git a/scripts/coretex-epoch-evolve.mjs b/scripts/coretex-epoch-evolve.mjs index d9867bda..91643f10 100644 --- a/scripts/coretex-epoch-evolve.mjs +++ b/scripts/coretex-epoch-evolve.mjs @@ -570,7 +570,7 @@ async function main() { : undefined; const fixedPackRepeatabilityPpm = optionalNumberFlag('fixed-pack-repeatability-ppm', profile.fixedPackRepeatabilityPpm ?? profile.baselineVariancePpm); const recentNoiseFloorPpm = numberFlag('recent-noise-floor-ppm', 0); - const currentMinImprovementPpm = numberFlag('current-min-improvement-ppm', profile.patchAcceptanceFloors?.minImprovementPpm ?? bundle.scoring?.minImprovementPpm ?? 500); + const currentMinImprovementPpm = numberFlag('current-min-improvement-ppm', profile.patchAcceptanceFloors?.minImprovementPpm ?? bundle.scoring?.minImprovementPpm ?? 2500); const targetAdvances = numberFlag('target-advances', profile.epochFrontier?.targetAccepts ?? 3); const previousEvalHiddenCount = previousCorpus.events.filter((e) => e.split === 'eval_hidden').length; const nextEvalHiddenCount = nextCorpus.events.filter((e) => e.split === 'eval_hidden').length; diff --git a/scripts/coretex-scorer-parity-harness.mjs b/scripts/coretex-scorer-parity-harness.mjs index 62ea68d4..563da61a 100644 --- a/scripts/coretex-scorer-parity-harness.mjs +++ b/scripts/coretex-scorer-parity-harness.mjs @@ -205,7 +205,7 @@ const productionVariancePpm = baselineVarianceSource === 'rotating_pack' || base ? (profile.baselineVariancePpm ?? 0) : 0; const stateAdvanceThresholdPpm = - (profile.patchAcceptanceFloors?.minImprovementPpm ?? 500) + (profile.patchAcceptanceFloors?.minImprovementPpm ?? 2500) + (profile.replayTolerancePpm ?? 0) + productionVariancePpm; const screenerThresholdPpm = Number(computeCoreTexScreenerThresholdPpm({ diff --git a/scripts/mining-flow-e2e.mjs b/scripts/mining-flow-e2e.mjs index 7c6be547..9b2569b0 100644 --- a/scripts/mining-flow-e2e.mjs +++ b/scripts/mining-flow-e2e.mjs @@ -123,7 +123,7 @@ const coordinator = { ?? `0x${'0'.repeat(64)}`, wordCount: bundleManifest.substrate?.wordCount ?? 1024, transitionCount: 0, - minImprovementPpm: bundleManifest.evaluator?.profile?.minImprovementPpm ?? 500, + minImprovementPpm: bundleManifest.evaluator?.profile?.minImprovementPpm ?? 2500, rulesVersion: bundleManifest.rulesVersion ?? 0, workPolicyHash: bundleManifest.workPolicyHash ?? `0x${'0'.repeat(64)}`, corpusRoot: bundleManifest.corpusRoot ?? `0x${'0'.repeat(64)}`, diff --git a/scripts/recalibrate-baseline.mjs b/scripts/recalibrate-baseline.mjs index cf9e25d3..2b88458c 100644 --- a/scripts/recalibrate-baseline.mjs +++ b/scripts/recalibrate-baseline.mjs @@ -177,11 +177,11 @@ const proposedProductionVariancePpm = baselineVarianceSource === 'rotating_pack' ? summary.stddevPpm : 0; const currentStateAdvanceThresholdPpm = - (profile.patchAcceptanceFloors?.minImprovementPpm ?? 500) + (profile.patchAcceptanceFloors?.minImprovementPpm ?? 2500) + (profile.replayTolerancePpm ?? 0) + currentProductionVariancePpm; const proposedStateAdvanceThresholdPpm = - (profile.patchAcceptanceFloors?.minImprovementPpm ?? 500) + (profile.patchAcceptanceFloors?.minImprovementPpm ?? 2500) + (profile.replayTolerancePpm ?? 0) + proposedProductionVariancePpm; const currentThresholdPpm = computeCoreTexScreenerThresholdPpm({ diff --git a/scripts/screener-threshold-calibration.mjs b/scripts/screener-threshold-calibration.mjs index ed518f7d..8a331f1c 100644 --- a/scripts/screener-threshold-calibration.mjs +++ b/scripts/screener-threshold-calibration.mjs @@ -117,7 +117,7 @@ const productionVariancePpm = baselineVarianceSource === 'rotating_pack' || base ? (profile.baselineVariancePpm ?? 0) : 0; const stateAdvanceThresholdPpm = - (profile.patchAcceptanceFloors?.minImprovementPpm ?? 500) + (profile.patchAcceptanceFloors?.minImprovementPpm ?? 2500) + (profile.replayTolerancePpm ?? 0) + productionVariancePpm; const floors = { ...profile.patchAcceptanceFloors, acceptanceThresholdPpm: stateAdvanceThresholdPpm }; diff --git a/scripts/smoke-screener-threshold-mechanics.mjs b/scripts/smoke-screener-threshold-mechanics.mjs index a75a6f84..d22075bd 100644 --- a/scripts/smoke-screener-threshold-mechanics.mjs +++ b/scripts/smoke-screener-threshold-mechanics.mjs @@ -50,7 +50,7 @@ const productionVariancePpm = baselineVarianceSource === 'rotating_pack' || base ? (profile.baselineVariancePpm ?? 0) : 0; const stateAdvanceThresholdPpm = - (profile.patchAcceptanceFloors?.minImprovementPpm ?? 500) + (profile.patchAcceptanceFloors?.minImprovementPpm ?? 2500) + (profile.replayTolerancePpm ?? 0) + productionVariancePpm; @@ -64,7 +64,7 @@ const reranker = await createDeterministicReranker(); const biEncoderHash = biEncoderModelIdHash(BE.modelId, BE.revision, 'dense'); const rt = { biEncoder: inertBiEncoder(BE, LAYOUT), reranker, biEncoderHash, retrievalKeyLayout: LAYOUT }; const opts = scoringOptionsFromProfile(profile, rt); -const floors = { ...profile.patchAcceptanceFloors, acceptanceThresholdPpm: profile.patchAcceptanceFloors?.minImprovementPpm ?? 500 }; +const floors = { ...profile.patchAcceptanceFloors, acceptanceThresholdPpm: profile.patchAcceptanceFloors?.minImprovementPpm ?? 2500 }; const evalSeed = profile.baselineEvalSeedHex ?? '0x' + 'a5'.repeat(32); const pack = deriveQueryPack(0, evalSeed, corpus, { packSize: PACK_SIZE, quotas: [] }); From fcfb837fb8d5d624a919e7fd7babd83214033caa Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Tue, 16 Jun 2026 03:17:22 +0000 Subject: [PATCH 3/8] fix: lower canonical cold-start floor on live bundle line --- packages/coretex/src/rewards/difficulty.ts | 2 +- .../coordinator-concurrency-baseline.test.mjs | 22 +++++++++---------- .../unit/coretex-coordinator-core.test.mjs | 16 +++++++------- .../test/unit/difficulty-grace.test.mjs | 2 +- .../coretex/test/unit/difficulty.test.mjs | 14 ++++++------ .../coretex/test/unit/epoch-rotation.test.mjs | 8 +++---- .../test/unit/retrieval-data-source.test.mjs | 4 ++-- ...dgen1-policy-r5-atom-v16-300k-enabled.json | 2 +- scripts/coretex-epoch-evolve.mjs | 2 +- scripts/mining-flow-e2e.mjs | 2 +- scripts/recalibrate-baseline.mjs | 4 ++-- scripts/screener-threshold-calibration.mjs | 2 +- .../smoke-screener-threshold-mechanics.mjs | 4 ++-- 13 files changed, 42 insertions(+), 42 deletions(-) diff --git a/packages/coretex/src/rewards/difficulty.ts b/packages/coretex/src/rewards/difficulty.ts index fbe76ab6..795d8f2c 100644 --- a/packages/coretex/src/rewards/difficulty.ts +++ b/packages/coretex/src/rewards/difficulty.ts @@ -11,7 +11,7 @@ * as floating-point intermediates and then rounded back to bigint. */ -export const MIN_IMPROVEMENT_PPM = 2_500n; +export const MIN_IMPROVEMENT_PPM = 500n; export const MAX_IMPROVEMENT_PPM = 150_000n; export interface DifficultyInputs { diff --git a/packages/coretex/test/unit/coordinator-concurrency-baseline.test.mjs b/packages/coretex/test/unit/coordinator-concurrency-baseline.test.mjs index bbabd701..b1e7f1d4 100644 --- a/packages/coretex/test/unit/coordinator-concurrency-baseline.test.mjs +++ b/packages/coretex/test/unit/coordinator-concurrency-baseline.test.mjs @@ -47,8 +47,8 @@ const MINER_A = '0x' + 'aa'.repeat(20); const MINER_B = '0x' + 'bb'.repeat(20); // No static screenerThresholdPpm: the live threshold must derive from the -// baseline plus state-advance threshold (288438 + 2700ppm -> 1350ppm under -// the default policy). +// baseline plus state-advance threshold (288438 + 700ppm -> 355ppm under the +// default policy). const baseConfig = { epoch: EPOCH, expectedChainId: 8453n, @@ -67,7 +67,7 @@ const baseConfig = { receiptTtlSec: 60, perMinerScreenerCap: 50, baselineParentScorePpm: 288438, - minImprovementPpm: 2500, + minImprovementPpm: 500, replayTolerancePpm: 200, targetBlockOffset: 30, patchWordBudget: 4, @@ -446,7 +446,7 @@ describe('CoreTexCoordinatorCore §9 — FIFO signing queue', () => { const evaluator = { scorePatch: (input) => screenerResult(input.patchBytesHex, input.parentStateRoot, 320) }; const coord = new CoreTexCoordinatorCore(baseConfig, new MockChain({ head: 1000 }), loadGenesis, evaluator, plainSigner); await coord.boot(); - // baseline 288438 + state threshold 2700 -> live threshold 1350; delta + // baseline 288438 + state threshold 700 -> live threshold 355; delta // 320 is below it. const out = await coord.submit(submitBody(makePatchHex(GENESIS_ROOT, 40, 1))); assert.equal(out.status, 'rejected'); @@ -490,14 +490,14 @@ describe('CoreTexCoordinatorCore §7 — baseline runtime semantics', () => { const coord = new CoreTexCoordinatorCore(baseConfig, chain, loadGenesis, evaluator, plainSigner); await coord.boot(); - // Launch context: baseline 288438 with a 2700ppm state threshold -> live - // screener threshold 1350ppm. + // Launch context: baseline 288438 with a 700ppm state threshold -> live + // screener threshold 355ppm. const status0 = await coord.getStatus(); assert.equal(status0.baselineState, 'ready'); assert.equal(status0.baselineParentScorePpm, 288438); - assert.equal(status0.stateAdvanceThresholdPpm, 2700); - assert.equal(status0.screenerThresholdPpm, 1350); - assert.equal(status0.thresholds.screenerThresholdPpm, 1350); + assert.equal(status0.stateAdvanceThresholdPpm, 700); + assert.equal(status0.screenerThresholdPpm, 355); + assert.equal(status0.thresholds.screenerThresholdPpm, 355); // A 320ppm screener is below the launch threshold. const before = await coord.submit(submitBody(makePatchHex(GENESIS_ROOT, 40, 1))); @@ -525,7 +525,7 @@ describe('CoreTexCoordinatorCore §7 — baseline runtime semantics', () => { const status1 = await coord.getStatus(); assert.equal(status1.baselineState, 'ready'); assert.equal(status1.baselineParentScorePpm, 400000); - assert.equal(status1.screenerThresholdPpm, 1350, 'state-threshold floor dominates normal launch baselines'); + assert.equal(status1.screenerThresholdPpm, 350, 'state-threshold floor dominates normal launch baselines'); assert.equal(status1.thresholds.baselineParentScorePpm, 400000); // A 1400ppm screener clears the live gate. @@ -569,7 +569,7 @@ describe('CoreTexCoordinatorCore §7 — baseline runtime semantics', () => { const ready = await coord.getStatus(); assert.equal(ready.baselineState, 'ready'); assert.equal(ready.baselineParentScorePpm, 300000); - assert.equal(ready.screenerThresholdPpm, 1350); + assert.equal(ready.screenerThresholdPpm, 350); const accepted = await coord.submit(submitBody(makePatchHex(ev0.newRoot, 40, 1), MINER_A, ev0.newRoot)); assert.equal(accepted.status, 'accepted', `expected accept, got ${JSON.stringify(accepted)}`); diff --git a/packages/coretex/test/unit/coretex-coordinator-core.test.mjs b/packages/coretex/test/unit/coretex-coordinator-core.test.mjs index b25691b5..6a6d8296 100644 --- a/packages/coretex/test/unit/coretex-coordinator-core.test.mjs +++ b/packages/coretex/test/unit/coretex-coordinator-core.test.mjs @@ -61,11 +61,11 @@ const baseConfig = { receiptTtlSec: 60, perMinerScreenerCap: 50, // §7 launch baseline for the pinned (genesis) context. 288438 with the - // default policy and 2700ppm state threshold derives a live screener - // threshold of 1350ppm. + // default policy and the cold-start 700ppm state threshold derives a live + // screener threshold of 355ppm. baselineParentScorePpm: 288438, screenerThresholdPpm: 355, - minImprovementPpm: 2500, + minImprovementPpm: 500, replayTolerancePpm: 200, targetBlockOffset: 30, patchWordBudget: 4, @@ -674,19 +674,19 @@ describe('CoreTexCoordinatorCore — production submit path', () => { test('state advance signer boundary enforces replay-tolerant threshold on dual-pack proof', async () => { const ev = buildEvent({ blockNumber: 500, blockHash: '0x' + '55'.repeat(32) }); - const rewritten = rewritePatchScoreDelta(ev.compactPatchBytes, 2800); + const rewritten = rewritePatchScoreDelta(ev.compactPatchBytes, 800); const evalAdvance = { scorePatch: () => ({ outcome: 'state_advance', - deterministicDeltaPpm: 2800, + deterministicDeltaPpm: 800, evalReportHash: '0x' + 'e2'.repeat(32), artifactHash: '0x' + 'a2'.repeat(32), scoreBeforePpm: 100, - scoreAfterPpm: 2900, + scoreAfterPpm: 900, rewrittenPatchBytesHex: rewritten, evaluationProof: dualProofFor(ev.compactPatchBytes, GENESIS_ROOT, { - gate: { domain: 'gate', seedCommit: '0x' + '91'.repeat(32), accepted: true, scorePpm: 2600 }, - confirm: { domain: 'confirm', seedCommit: '0x' + '92'.repeat(32), accepted: true, scorePpm: 2600 }, + gate: { domain: 'gate', seedCommit: '0x' + '91'.repeat(32), accepted: true, scorePpm: 600 }, + confirm: { domain: 'confirm', seedCommit: '0x' + '92'.repeat(32), accepted: true, scorePpm: 600 }, }), }), }; diff --git a/packages/coretex/test/unit/difficulty-grace.test.mjs b/packages/coretex/test/unit/difficulty-grace.test.mjs index 5f1640e8..2821ac6f 100644 --- a/packages/coretex/test/unit/difficulty-grace.test.mjs +++ b/packages/coretex/test/unit/difficulty-grace.test.mjs @@ -56,7 +56,7 @@ describe('major-delta grace', () => { qualityAttempts: 200, majorDeltaActive: true, }); - assert.equal(out.next, 2_500n, 'clamps to MIN_IMPROVEMENT_PPM floor'); + assert.equal(out.next, 500n, 'clamps to MIN_IMPROVEMENT_PPM floor'); assert.equal(out.reason, 'major_delta_grace'); }); diff --git a/packages/coretex/test/unit/difficulty.test.mjs b/packages/coretex/test/unit/difficulty.test.mjs index 49eb5431..18d7399d 100644 --- a/packages/coretex/test/unit/difficulty.test.mjs +++ b/packages/coretex/test/unit/difficulty.test.mjs @@ -19,7 +19,7 @@ const { describe('CoreTex V4 difficulty calculator', () => { test('constants are correct bigints', () => { - assert.equal(MIN_IMPROVEMENT_PPM, 2_500n); + assert.equal(MIN_IMPROVEMENT_PPM, 500n); assert.equal(MAX_IMPROVEMENT_PPM, 150_000n); }); @@ -143,8 +143,8 @@ describe('CoreTex V4 difficulty calculator', () => { test('floor clamp: decay cannot go below MIN_IMPROVEMENT_PPM', () => { // current=3_000, 0.85 → unclamped=2_550, within range - // Use a smaller current to force a floor hit: 2_900 * 0.85 = 2_465 < 2_500 - const current = 2_900n; + // Use a smaller current to force a floor hit: 550 * 0.85 = 468 < 500 + const current = 550n; const result = nextMinImprovementPpm({ current, observedAdvances: 0, @@ -158,8 +158,8 @@ describe('CoreTex V4 difficulty calculator', () => { test('floor clamp: small_drift_down at floor stays at floor', () => { // current=3_000 * 0.85 (decay) = 2_550 → not clamped - // current=2_600 * 0.95 = 2_470 < 2_500 → clamped - const current = 2_600n; + // current=520 * 0.95 = 494 < 500 → clamped + const current = 520n; const result = nextMinImprovementPpm({ current, observedAdvances: 0, @@ -253,8 +253,8 @@ describe('CoreTex V4 difficulty calculator', () => { // undefined → pinned MAX; a maxClampPpm <= floor is ignored (falls back to MAX). const a = nextMinImprovementPpm({ current: 149_000n, observedAdvances: 10, targetAdvances: 5, qualityAttempts: 8 }); assert.equal(a.next, MAX_IMPROVEMENT_PPM); - const b = nextMinImprovementPpm({ current: 149_000n, observedAdvances: 10, targetAdvances: 5, qualityAttempts: 8, maxClampPpm: 1_000n }); - assert.equal(b.next, MAX_IMPROVEMENT_PPM); // 1_000 < floor → ignored + const b = nextMinImprovementPpm({ current: 149_000n, observedAdvances: 10, targetAdvances: 5, qualityAttempts: 8, maxClampPpm: 400n }); + assert.equal(b.next, MAX_IMPROVEMENT_PPM); // 400 < floor → ignored const c = nextMinImprovementPpm({ current: 10_000n, observedAdvances: 0, targetAdvances: 5, qualityAttempts: 20, minClampPpm: -5n }); assert.equal(c.next, 8_500n); // negative floor ignored → normal decay, no clamp assert.equal(c.clamped, false); diff --git a/packages/coretex/test/unit/epoch-rotation.test.mjs b/packages/coretex/test/unit/epoch-rotation.test.mjs index 86646461..c6c2be78 100644 --- a/packages/coretex/test/unit/epoch-rotation.test.mjs +++ b/packages/coretex/test/unit/epoch-rotation.test.mjs @@ -88,15 +88,15 @@ describe('epoch rotation manifest', () => { delta, challengeBook: { epoch: 8, ids: delta.addedIds }, bundleHash: '0x' + '11'.repeat(32), - minImprovementPpm: 2500, + minImprovementPpm: 500, baselineParentScorePpm: 288438, baselineVarianceSource: 'unavailable', fixedPackRepeatabilityPpm: 0, screenerThresholdPpm: 347, recentNoiseFloorPpm: 12, controller: { - inputs: { current: '2500', observedAdvances: 12, targetAdvances: 3, qualityAttempts: 40 }, - output: { next: '3750', reason: 'ramp_up', ratioApplied: 1.5, clamped: false }, + inputs: { current: '500', observedAdvances: 12, targetAdvances: 3, qualityAttempts: 40 }, + output: { next: '750', reason: 'ramp_up', ratioApplied: 1.5, clamped: false }, reason: 'ramp_up', }, activeFrontierRoot: '0x' + '09'.repeat(32), @@ -109,7 +109,7 @@ describe('epoch rotation manifest', () => { assert.equal(manifest.previousCorpusRoot, delta.previousRoot); assert.equal(manifest.nextCorpusRoot, delta.nextRoot); assert.equal(manifest.corpusDeltaHash, hashCorpusDelta(delta)); - assert.equal(manifest.minImprovementPpm, 2500); + assert.equal(manifest.minImprovementPpm, 500); assert.equal(manifest.baselineParentScorePpm, 288438); assert.equal(manifest.screenerThresholdPpm, 347); assert.equal(manifest.controller.reason, 'ramp_up'); diff --git a/packages/coretex/test/unit/retrieval-data-source.test.mjs b/packages/coretex/test/unit/retrieval-data-source.test.mjs index 1e11253c..f1f9bb78 100644 --- a/packages/coretex/test/unit/retrieval-data-source.test.mjs +++ b/packages/coretex/test/unit/retrieval-data-source.test.mjs @@ -77,7 +77,7 @@ function makeFactoryOpts(overrides = {}) { currentEpoch: 7, bundleHash: BUNDLE_HASH, coreVersionHash: BUNDLE_HASH, - minImprovementPpm: 2500, + minImprovementPpm: 500, replayTolerancePpm: 250, screenerThresholdPpm: 347, baselineParentScorePpm: 288438, @@ -93,7 +93,7 @@ function makeFactoryOpts(overrides = {}) { patchWordRanges: [{ surface: 'temporal_update', patchType: 'MIXED', wordRanges: [[32, 383], [800, 895]] }], exampleValidPatch: { patchType: 4, wordCount: 1, indexRange: [672, 799], encodedHex: '0x04' }, pins: { corpusRoot: `0x${'77'.repeat(32)}`, activeFrontierRoot: `0x${'78'.repeat(32)}` }, - difficultyController: { reason: 'under_target_recovery', output: { next: '2500' } }, + difficultyController: { reason: 'under_target_recovery', output: { next: '500' } }, runwayTelemetry: { updatedAtEpoch: 7, activeLivePackFamilyDistribution: { temporal_update: 12, validity_atom: 8, scope_atom: 6 }, diff --git a/release/calibration/2026-06-04-memory-atom-v16/evaluator-profile-v2-dgen1-policy-r5-atom-v16-300k-enabled.json b/release/calibration/2026-06-04-memory-atom-v16/evaluator-profile-v2-dgen1-policy-r5-atom-v16-300k-enabled.json index b44dc21b..d8dac198 100644 --- a/release/calibration/2026-06-04-memory-atom-v16/evaluator-profile-v2-dgen1-policy-r5-atom-v16-300k-enabled.json +++ b/release/calibration/2026-06-04-memory-atom-v16/evaluator-profile-v2-dgen1-policy-r5-atom-v16-300k-enabled.json @@ -27,7 +27,7 @@ "w_structural_sanity": 0.05 }, "patchAcceptanceFloors": { - "minImprovementPpm": 2500, + "minImprovementPpm": 500, "structuralFloor": 0.95, "protectedRegressionFloor": 0.05, "familyCatastrophicFloor": 0.85 diff --git a/scripts/coretex-epoch-evolve.mjs b/scripts/coretex-epoch-evolve.mjs index 91643f10..d9867bda 100644 --- a/scripts/coretex-epoch-evolve.mjs +++ b/scripts/coretex-epoch-evolve.mjs @@ -570,7 +570,7 @@ async function main() { : undefined; const fixedPackRepeatabilityPpm = optionalNumberFlag('fixed-pack-repeatability-ppm', profile.fixedPackRepeatabilityPpm ?? profile.baselineVariancePpm); const recentNoiseFloorPpm = numberFlag('recent-noise-floor-ppm', 0); - const currentMinImprovementPpm = numberFlag('current-min-improvement-ppm', profile.patchAcceptanceFloors?.minImprovementPpm ?? bundle.scoring?.minImprovementPpm ?? 2500); + const currentMinImprovementPpm = numberFlag('current-min-improvement-ppm', profile.patchAcceptanceFloors?.minImprovementPpm ?? bundle.scoring?.minImprovementPpm ?? 500); const targetAdvances = numberFlag('target-advances', profile.epochFrontier?.targetAccepts ?? 3); const previousEvalHiddenCount = previousCorpus.events.filter((e) => e.split === 'eval_hidden').length; const nextEvalHiddenCount = nextCorpus.events.filter((e) => e.split === 'eval_hidden').length; diff --git a/scripts/mining-flow-e2e.mjs b/scripts/mining-flow-e2e.mjs index 9b2569b0..7c6be547 100644 --- a/scripts/mining-flow-e2e.mjs +++ b/scripts/mining-flow-e2e.mjs @@ -123,7 +123,7 @@ const coordinator = { ?? `0x${'0'.repeat(64)}`, wordCount: bundleManifest.substrate?.wordCount ?? 1024, transitionCount: 0, - minImprovementPpm: bundleManifest.evaluator?.profile?.minImprovementPpm ?? 2500, + minImprovementPpm: bundleManifest.evaluator?.profile?.minImprovementPpm ?? 500, rulesVersion: bundleManifest.rulesVersion ?? 0, workPolicyHash: bundleManifest.workPolicyHash ?? `0x${'0'.repeat(64)}`, corpusRoot: bundleManifest.corpusRoot ?? `0x${'0'.repeat(64)}`, diff --git a/scripts/recalibrate-baseline.mjs b/scripts/recalibrate-baseline.mjs index 2b88458c..cf9e25d3 100644 --- a/scripts/recalibrate-baseline.mjs +++ b/scripts/recalibrate-baseline.mjs @@ -177,11 +177,11 @@ const proposedProductionVariancePpm = baselineVarianceSource === 'rotating_pack' ? summary.stddevPpm : 0; const currentStateAdvanceThresholdPpm = - (profile.patchAcceptanceFloors?.minImprovementPpm ?? 2500) + (profile.patchAcceptanceFloors?.minImprovementPpm ?? 500) + (profile.replayTolerancePpm ?? 0) + currentProductionVariancePpm; const proposedStateAdvanceThresholdPpm = - (profile.patchAcceptanceFloors?.minImprovementPpm ?? 2500) + (profile.patchAcceptanceFloors?.minImprovementPpm ?? 500) + (profile.replayTolerancePpm ?? 0) + proposedProductionVariancePpm; const currentThresholdPpm = computeCoreTexScreenerThresholdPpm({ diff --git a/scripts/screener-threshold-calibration.mjs b/scripts/screener-threshold-calibration.mjs index 8a331f1c..ed518f7d 100644 --- a/scripts/screener-threshold-calibration.mjs +++ b/scripts/screener-threshold-calibration.mjs @@ -117,7 +117,7 @@ const productionVariancePpm = baselineVarianceSource === 'rotating_pack' || base ? (profile.baselineVariancePpm ?? 0) : 0; const stateAdvanceThresholdPpm = - (profile.patchAcceptanceFloors?.minImprovementPpm ?? 2500) + (profile.patchAcceptanceFloors?.minImprovementPpm ?? 500) + (profile.replayTolerancePpm ?? 0) + productionVariancePpm; const floors = { ...profile.patchAcceptanceFloors, acceptanceThresholdPpm: stateAdvanceThresholdPpm }; diff --git a/scripts/smoke-screener-threshold-mechanics.mjs b/scripts/smoke-screener-threshold-mechanics.mjs index d22075bd..a75a6f84 100644 --- a/scripts/smoke-screener-threshold-mechanics.mjs +++ b/scripts/smoke-screener-threshold-mechanics.mjs @@ -50,7 +50,7 @@ const productionVariancePpm = baselineVarianceSource === 'rotating_pack' || base ? (profile.baselineVariancePpm ?? 0) : 0; const stateAdvanceThresholdPpm = - (profile.patchAcceptanceFloors?.minImprovementPpm ?? 2500) + (profile.patchAcceptanceFloors?.minImprovementPpm ?? 500) + (profile.replayTolerancePpm ?? 0) + productionVariancePpm; @@ -64,7 +64,7 @@ const reranker = await createDeterministicReranker(); const biEncoderHash = biEncoderModelIdHash(BE.modelId, BE.revision, 'dense'); const rt = { biEncoder: inertBiEncoder(BE, LAYOUT), reranker, biEncoderHash, retrievalKeyLayout: LAYOUT }; const opts = scoringOptionsFromProfile(profile, rt); -const floors = { ...profile.patchAcceptanceFloors, acceptanceThresholdPpm: profile.patchAcceptanceFloors?.minImprovementPpm ?? 2500 }; +const floors = { ...profile.patchAcceptanceFloors, acceptanceThresholdPpm: profile.patchAcceptanceFloors?.minImprovementPpm ?? 500 }; const evalSeed = profile.baselineEvalSeedHex ?? '0x' + 'a5'.repeat(32); const pack = deriveQueryPack(0, evalSeed, corpus, { packSize: PACK_SIZE, quotas: [] }); From 0338774d667b407e29a8395aa19fd007c2f4d421 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Tue, 16 Jun 2026 03:32:01 +0000 Subject: [PATCH 4/8] fix: repin live launch manifest for cold-start floor --- .gitignore | 1 + .../coretex-launch-v16-artifacts.json | 73 ++++++------------- ...art-floor-repin-livebundle-2026-06-16.json | 59 +++++++++++++++ 3 files changed, 81 insertions(+), 52 deletions(-) create mode 100644 release/calibration/2026-06-04-memory-atom-v16/screener-threshold-v16-coldstart-floor-repin-livebundle-2026-06-16.json diff --git a/.gitignore b/.gitignore index 0215d79d..8abf6476 100644 --- a/.gitignore +++ b/.gitignore @@ -112,6 +112,7 @@ release/calibration/** !release/calibration/2026-06-04-memory-atom-v16/coretex-launch-v16-artifacts.json !release/calibration/2026-06-04-memory-atom-v16/bundle-manifest-v2-dgen1-policy-r5-atom-v16-300k-enabled.json !release/calibration/2026-06-04-memory-atom-v16/evaluator-profile-v2-dgen1-policy-r5-atom-v16-300k-enabled.json +!release/calibration/2026-06-04-memory-atom-v16/screener-threshold-v16-coldstart-floor-repin-livebundle-2026-06-16.json # Generated DACR corpus (regenerated from HF dataset by scripts/build-corpus-from-dacr.mjs) benchmark/fixtures/dacr/ diff --git a/release/calibration/2026-06-04-memory-atom-v16/coretex-launch-v16-artifacts.json b/release/calibration/2026-06-04-memory-atom-v16/coretex-launch-v16-artifacts.json index 0ecda098..897c4413 100644 --- a/release/calibration/2026-06-04-memory-atom-v16/coretex-launch-v16-artifacts.json +++ b/release/calibration/2026-06-04-memory-atom-v16/coretex-launch-v16-artifacts.json @@ -20,7 +20,8 @@ "2026-06-08 coordinator integration public-key status repin: retrieval-data-source exposes epoch signing public key id/fingerprint and validator sync import-boundary tests were added; enabled bundle manifest updated to 0x78336d1d11a0796047baff340f4f90f154d98d9de064678471cbdf50e974069b; profile/corpus/embeddings unchanged; S3 republish required before validator launch verification.", "2026-06-08 coordinator integration S3 publish: repinned bundle uploaded after public epoch signing status support; public bytes must match bundleHash 0x78336d1d11a0796047baff340f4f90f154d98d9de064678471cbdf50e974069b.", "2026-06-12 screener threshold state-floor repin: DEFAULT_CORETEX_WORK_POLICY v3 floors screenerThresholdPpm at 50% of real stateAdvanceThresholdPpm; enabled bundle manifest updated to 0xf77cfb0fc69aab59fabf439268fff990acd20d3c6998ad0953ead8283ad40361; 4090 Qwen calibration report screener-threshold-v16-4090-statefloor-2026-06-12.json measured threshold 1375ppm; S3 republish required before validator launch verification.", - "2026-06-12 screener hardening follow-up repin: policy v3 threshold floor now fails closed without stateAdvanceThresholdPpm, shared base-blockhash RPC client handles credentialed URLs, enabled bundle manifest updated to 0x73172e2bc77e2f066a160bc94a48ae73c5221cf11591c3958c03aa5884793506, workPolicyHash is 0x4defd562f027e350cc4537ef6b7e1baecdf9387ff19e10e5599325bedfe8b715, and 4090 Qwen calibration report screener-threshold-v16-4090-statefloor-boundary-2026-06-12.json adds boundary-band checks with cachePath=null. S3, chain config, on-chain epoch context, and coordinator integration workPolicyHash repin remain required before validator launch verification." + "2026-06-12 screener hardening follow-up repin: policy v3 threshold floor now fails closed without stateAdvanceThresholdPpm, shared base-blockhash RPC client handles credentialed URLs, enabled bundle manifest updated to 0x73172e2bc77e2f066a160bc94a48ae73c5221cf11591c3958c03aa5884793506, workPolicyHash is 0x4defd562f027e350cc4537ef6b7e1baecdf9387ff19e10e5599325bedfe8b715, and 4090 Qwen calibration report screener-threshold-v16-4090-statefloor-boundary-2026-06-12.json adds boundary-band checks with cachePath=null. S3, chain config, on-chain epoch context, and coordinator integration workPolicyHash repin remain required before validator launch verification.", + "2026-06-16 cold-start floor repin: keep the live 0x73172e2b bundle line, republish the enabled profile with minImprovementPpm 500, publish a manifest/report-only S3 update, and preserve dynamic difficulty carry-forward through future evolves/cutovers. No contract or bundle rewrite is required." ], "generation": { "corpusCommand": "node scripts/generate-dgen1-corpus.mjs --subjects 4200 --depth 30 --seed dgen1-r5-synth-300k-atom-v16-2026-06-04 --r5-synthesis --atom-v16-metadata --out release/calibration/2026-06-04-memory-atom-v16/dgen1-r5-synth-300k-atom-v16-corpus.json", @@ -71,7 +72,7 @@ "bundlePath": "release/calibration/2026-06-04-memory-atom-v16/bundle-manifest-v2-dgen1-policy-r5-atom-v16-300k-enabled.json", "bundleHash": "0x73172e2bc77e2f066a160bc94a48ae73c5221cf11591c3958c03aa5884793506", "profilePath": "release/calibration/2026-06-04-memory-atom-v16/evaluator-profile-v2-dgen1-policy-r5-atom-v16-300k-enabled.json", - "profileSha256": "0e019ef4efd28ab3e475c81798ac0b5e204746f3540dc1c4766bb50b32724392", + "profileSha256": "c6e0fbd9b8a631f342e4c97a43d469078f05cbb44227cb27580baeb81688b6c6", "bundleSha256": "d61e3a2f6ee8a925d2f7421432c82b6832f3ba47e208fd9df15ae3d2c198233d", "s3": { "bucket": "coretex-launch-artifacts-429971482539-us-east-2-an", @@ -90,9 +91,9 @@ "evaluator-profile-v2-dgen1-policy-r5-atom-v16-300k-enabled.json": { "key": "coretex/launch/v16/evaluator-profile-v2-dgen1-policy-r5-atom-v16-300k-enabled.json", "url": "https://coretex-launch-artifacts-429971482539-us-east-2-an.s3.us-east-2.amazonaws.com/coretex/launch/v16/evaluator-profile-v2-dgen1-policy-r5-atom-v16-300k-enabled.json", - "versionId": "EtaWbjKYEfLMCtvbQp.F8anliAoDdKB4", - "eTag": "f75fad44b5fa6d27ea792914a1bc8dce", - "lastModified": "2026-06-08T21:16:32+00:00" + "versionId": "aPhYvc0Fd1UN_.edeLGAja740kXjSs2_", + "eTag": "5e2f90cbae78cf90b104612c3bd1d359", + "lastModified": "2026-06-16T00:10:30+00:00" } }, "baselineRecalibration": { @@ -107,65 +108,33 @@ }, "s3RepublishRequired": false, "s3ConsistencyCheck": { - "checkedAt": "2026-06-12T11:08:19Z", - "method": "manifest workPolicyHash disambiguation re-publish (added coordinatorWorkPolicyHash = on-chain 0xd15e9049); bundle 0x73172e2b unchanged; public GET-rehash verified", + "checkedAt": "2026-06-16T03:29:59Z", + "method": "cold-start floor repin manifest update: live bundle 0x73172e2b unchanged, public profile GET-rehash verified at 500ppm floor, manifest/report republish only", "localBundleHash": "0x73172e2bc77e2f066a160bc94a48ae73c5221cf11591c3958c03aa5884793506", "localBundleSha256": "d61e3a2f6ee8a925d2f7421432c82b6832f3ba47e208fd9df15ae3d2c198233d", - "localProfileSha256": "0e019ef4efd28ab3e475c81798ac0b5e204746f3540dc1c4766bb50b32724392", + "localProfileSha256": "c6e0fbd9b8a631f342e4c97a43d469078f05cbb44227cb27580baeb81688b6c6", "s3BundleVersionId": "CuWM6mI9ZTUJkVNnRIFAm.6jaFwW1hFn", - "s3ProfileVersionId": "EtaWbjKYEfLMCtvbQp.F8anliAoDdKB4", + "s3ProfileVersionId": "aPhYvc0Fd1UN_.edeLGAja740kXjSs2_", "consistent": true }, "screenerThresholdCalibration": { - "report": "release/calibration/2026-06-04-memory-atom-v16/screener-threshold-v16-4090-statefloor-boundary-2026-06-12.json", - "reportSha256": "3eaa7ffe2eb27bb079134c3e1dba91477a52b66a65248abe8fb4df1b9a19f6b8", + "report": "release/calibration/2026-06-04-memory-atom-v16/screener-threshold-v16-coldstart-floor-repin-livebundle-2026-06-16.json", + "reportSha256": "1151c41a13b001497109e51b89ada8b1ca9968e30468b54a76d7bf3649234392", "bundleHash": "0x73172e2bc77e2f066a160bc94a48ae73c5221cf11591c3958c03aa5884793506", "workPolicyHash": "0x4defd562f027e350cc4537ef6b7e1baecdf9387ff19e10e5599325bedfe8b715", + "coordinatorWorkPolicyHash": "0xd15e904997bdb2bb13d932953a77c0ed3ef309076146a4416cfe5a4e0cdb3775", "baselineParentScorePpm": 288438, - "minImprovementPpm": 2500, + "minImprovementPpm": 500, "replayTolerancePpm": 250, - "stateAdvanceThresholdPpm": 2750, + "stateAdvanceThresholdPpm": 750, "priorScreenerThresholdPpm": 355, - "screenerThresholdPpm": 1375, + "screenerThresholdPpm": 375, "measuredRecentNoiseFloorPpm": 0, - "boundaryQualificationChecks": [ - { - "class": "old_screener_pass_band_now_reject", - "band": "(priorScreenerThresholdPpm,currentScreenerThresholdPpm)", - "deltaPpm": 865, - "outcomes": { - "priorScreener": "SCREENER_PASS", - "currentScreener": "REJECT", - "currentStateAdvance": null - } - }, - { - "class": "current_screener_only_not_state_advance", - "band": "[currentScreenerThresholdPpm,stateAdvanceThresholdPpm)", - "deltaPpm": 2062, - "outcomes": { - "priorScreener": null, - "currentScreener": "SCREENER_PASS", - "currentStateAdvance": "REJECT" - } - }, - { - "class": "state_advance_exact_boundary", - "band": "[stateAdvanceThresholdPpm,stateAdvanceThresholdPpm]", - "deltaPpm": 2750, - "outcomes": { - "priorScreener": null, - "currentScreener": "SCREENER_PASS", - "currentStateAdvance": "STATE_ADVANCE" - } - } - ], - "rerankerBackendPairs": 4110, - "rerankerBackendCalls": 523, - "qwenCachePath": null, - "falseScreenerRateByRejectClass": 0, - "viableScreenerRecall": 1, - "stateAdvanceAcceptanceRate": 1 + "recalibrationMode": "cold_start_floor_repin", + "notes": [ + "This is a deliberate sparse-root production repin on the live 0x73172e2b bundle line.", + "Longer live-bundle sanity runs may continue separately, but the manifest and live coordinator thresholds must already reflect the lowered canonical floor." + ] }, "workPolicyHash": "0x4defd562f027e350cc4537ef6b7e1baecdf9387ff19e10e5599325bedfe8b715", "launchRepinRequired": { diff --git a/release/calibration/2026-06-04-memory-atom-v16/screener-threshold-v16-coldstart-floor-repin-livebundle-2026-06-16.json b/release/calibration/2026-06-04-memory-atom-v16/screener-threshold-v16-coldstart-floor-repin-livebundle-2026-06-16.json new file mode 100644 index 00000000..2624c63d --- /dev/null +++ b/release/calibration/2026-06-04-memory-atom-v16/screener-threshold-v16-coldstart-floor-repin-livebundle-2026-06-16.json @@ -0,0 +1,59 @@ +{ + "schema": "coretex.screener-threshold-repin.v1", + "generatedAt": "2026-06-16T03:29:59.717Z", + "kind": "cold_start_floor_repin", + "liveBundleHash": "0x73172e2bc77e2f066a160bc94a48ae73c5221cf11591c3958c03aa5884793506", + "liveBundleSha256": "d61e3a2f6ee8a925d2f7421432c82b6832f3ba47e208fd9df15ae3d2c198233d", + "corpusRoot": "0xb692b4a133963399257979bc5f632a0900d2d5d73dbadf191d3cf9889188e57e", + "profilePath": "release/calibration/2026-06-04-memory-atom-v16/evaluator-profile-v2-dgen1-policy-r5-atom-v16-300k-enabled.json", + "profileSha256": "c6e0fbd9b8a631f342e4c97a43d469078f05cbb44227cb27580baeb81688b6c6", + "priorCalibrationReport": "release/calibration/2026-06-04-memory-atom-v16/screener-threshold-v16-4090-statefloor-boundary-2026-06-12.json", + "priorCalibrationReportSha256": "3eaa7ffe2eb27bb079134c3e1dba91477a52b66a65248abe8fb4df1b9a19f6b8", + "priorThresholds": { + "minImprovementPpm": 2500, + "replayTolerancePpm": 250, + "stateAdvanceThresholdPpm": 2750, + "screenerThresholdPpm": 1375, + "priorScreenerThresholdPpm": 355 + }, + "repinnedThresholds": { + "minImprovementPpm": 500, + "replayTolerancePpm": 250, + "stateAdvanceThresholdPpm": 750, + "screenerThresholdPpm": 375, + "stateAdvanceScreenerFloorRatio": 0.5 + }, + "rationale": [ + "Launch-mainnet CoreTex is still a sparse, cold-start substrate; isolated policy surfaces often remain scorer-inert until routing anchors already exist.", + "The prior 2500/1375/2750 floor was calibrated for a warmer substrate and made early routing/bootstrap work disproportionately hard in production.", + "This repin lowers only the canonical minimum-improvement floor. Dynamic difficulty and future evolve outputs still carry thresholds forward epoch to epoch." + ], + "dynamicCarryForward": { + "canonicalFloorSource": "packages/coretex/src/rewards/difficulty.ts", + "canonicalMinImprovementFloorPpm": 500, + "coordinatorCarryForward": "reloadEpochContext consumes evolveOut.evolve threshold fields and cutover threshold fallbacks now clamp at 500 instead of 2500", + "onchainRegistryChangeRequired": false + }, + "publishedConsistency": { + "s3ProfileSha256": "c6e0fbd9b8a631f342e4c97a43d469078f05cbb44227cb27580baeb81688b6c6", + "s3ProfileVersionId": "aPhYvc0Fd1UN_.edeLGAja740kXjSs2_", + "s3ProfileLastModified": "2026-06-16T00:10:30+00:00", + "s3BundleVersionId": "CuWM6mI9ZTUJkVNnRIFAm.6jaFwW1hFn", + "s3BundleLastModified": "2026-06-12T08:55:02+00:00" + }, + "pendingSanityChecks": { + "liveBundleQwenCpuMiniCalibration": { + "report": "release/calibration/2026-06-04-memory-atom-v16/screener-threshold-v16-qwen-cpu-coldstart-livebundle-2026-06-16.json", + "status": "in_progress", + "note": "Useful as a post-repin sanity check, but not required for the threshold carry-forward mechanics to work live." + }, + "production4090FullRecalibration": { + "status": "optional_followup", + "note": "If rerun, use the same 4090 GPU path as production scoring. It is not required to make the lowered floor live." + } + }, + "notes": [ + "This report is a deliberate floor repin note for the live 0x73172e2b bundle line, not a claim that the old 4090 boundary-band samples were rerun at the new floor.", + "Validator/miner-facing manifest data must reflect the live profile bytes and live coordinator thresholds even while longer sanity runs are still in progress." + ] +} From 4e28255b640304f34209da69473bdc4037ad4859 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Tue, 16 Jun 2026 05:19:50 +0000 Subject: [PATCH 5/8] fix: sync DEFAULT_PATCH_FLOORS minImprovementPpm to canonical 500 floor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The cold-start floor was lowered to 500 in the live bundle manifest, the launch artifacts, and the coretex-client, but DEFAULT_PATCH_FLOORS kept the pre-recalibration 2500 after the f13afd2 recalibration was reverted. Align the structural default to the signed/live value so the source of truth matches the manifest and the validator client (no drift). minImprovementPpm is not part of DEFAULT_CORETEX_WORK_POLICY, so coreTexWorkPolicyHash / rules version are unchanged — no on-chain impact. Co-Authored-By: Claude Opus 4.8 --- packages/coretex/src/bundle/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/coretex/src/bundle/index.ts b/packages/coretex/src/bundle/index.ts index 1419c28f..4b523ce3 100644 --- a/packages/coretex/src/bundle/index.ts +++ b/packages/coretex/src/bundle/index.ts @@ -824,7 +824,7 @@ export const DEFAULT_COMPOSITE_WEIGHTS_PIN: CompositeWeightPin = { }; export const DEFAULT_PATCH_FLOORS: PatchAcceptanceFloorsPin = { - minImprovementPpm: 2500, + minImprovementPpm: 500, structuralFloor: 0.95, protectedRegressionFloor: 0.05, familyCatastrophicFloor: 0.85, From 56c1a69e0db1488b7cf18320138c5a1bd6da407d Mon Sep 17 00:00:00 2001 From: botcoinmoney Date: Tue, 16 Jun 2026 08:51:29 +0000 Subject: [PATCH 6/8] fix: watcher skips finalized prior-epoch StateAdvanced events on replay MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The CoreTexCoordinatorCore watcher replays from a fixed start block and rejected any event whose epoch != the configured epoch. After an epoch advance, the static CORETEX_REPLAY_FROM_BLOCK points before the new epochs boundary, so the replay hits the PRIOR epochs finalized advances and fail-closes ("watcher: event epoch N != configured N+1") — the deadlock that stranded a restart at 115->116. Prior-epoch advances (ev.epoch < config.epoch) are already folded into this epochs on-chain start root (liveRoot is seeded to it), so SKIP them instead of rejecting. Future-epoch events still hard-fail; transitionIndex is per-epoch (resets to 0) so contiguity holds. Makes the watcher robust to a stale/genesis replay start block — no per-epoch CORETEX_REPLAY_FROM_BLOCK update needed. Co-Authored-By: Claude Opus 4.8 --- .../src/coordinator/coretex-coordinator-core.ts | 9 +++++++++ .../test/unit/coretex-coordinator-core.test.mjs | 16 ++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/packages/coretex/src/coordinator/coretex-coordinator-core.ts b/packages/coretex/src/coordinator/coretex-coordinator-core.ts index e2c686d9..5b41e3ec 100644 --- a/packages/coretex/src/coordinator/coretex-coordinator-core.ts +++ b/packages/coretex/src/coordinator/coretex-coordinator-core.ts @@ -632,6 +632,15 @@ export class CoreTexCoordinatorCore { // ── chain-event verification + apply ───────────────────────────────────── private applyChainEvent(ev: CoreTexStateAdvancedEvent): void { + if (ev.epoch < this.config.epoch) { + // Finalized PRIOR-epoch advance — already folded into this epoch's on-chain + // start root (liveRoot was seeded to it at load). Skip; re-applying would fail + // the parent/transitionIndex checks. Lets the watcher replay from a start block + // that predates the live epoch (e.g. a stale CORETEX_REPLAY_FROM_BLOCK after an + // epoch advance) WITHOUT dead-locking; transitionIndex is per-epoch (resets to 0) + // so contiguity is preserved. + return; + } if (ev.epoch !== this.config.epoch) { throw new Error(`watcher: event epoch ${ev.epoch} ≠ configured ${this.config.epoch}`); } diff --git a/packages/coretex/test/unit/coretex-coordinator-core.test.mjs b/packages/coretex/test/unit/coretex-coordinator-core.test.mjs index 6a6d8296..b1d1a4fd 100644 --- a/packages/coretex/test/unit/coretex-coordinator-core.test.mjs +++ b/packages/coretex/test/unit/coretex-coordinator-core.test.mjs @@ -240,6 +240,22 @@ describe('CoreTexCoordinatorCore — chain-confirmed-only semantics', () => { assert.equal(s.unhealthyReason, null); }); + test('watcher SKIPS finalized prior-epoch events (stale replay start does not fail-close)', async () => { + // A finalized event from a PRIOR epoch sits in the replay window (e.g. a stale + // CORETEX_REPLAY_FROM_BLOCK still pointing before this epoch's boundary). It must + // be SKIPPED, not rejected with "watcher: event epoch N != configured N+1". + const chainGen = new EventChain(); + const priorEpochEv = { ...chainGen.next({ blockNumber: 500, blockHash: '0x' + '55'.repeat(32) }), epoch: EPOCH - 1n }; + const chain = new MockChain({ head: 1000, events: [priorEpochEv], regEpoch: { liveStateRoot: GENESIS_ROOT, transitionCount: 0 } }); + const coord = new CoreTexCoordinatorCore(baseConfig, chain, loadGenesis, evaluator); + await coord.boot(); + const s = coord.getState(); + assert.equal(s.transitionCount, 0, 'prior-epoch event must be skipped, not applied'); + assert.equal(s.liveRoot.toLowerCase(), GENESIS_ROOT.toLowerCase(), 'liveRoot unchanged by skipped event'); + assert.equal(s.signingEnabled, true, 'boot must not fail-close on a prior-epoch event'); + assert.equal(s.unhealthyReason, null); + }); + test('mid-run epoch rollover disables signing with CoordEpochMismatch', async () => { const chain = new MockChain({ head: 1000 }); const coord = new CoreTexCoordinatorCore(baseConfig, chain, loadGenesis, evaluator, signer); From 989ffe0b444c60f4fb744404521bd8f2ed74ec69 Mon Sep 17 00:00:00 2001 From: botcoinmoney Date: Tue, 16 Jun 2026 21:37:58 +0000 Subject: [PATCH 7/8] fix: bind target block offset to scorer seed context --- packages/coretex/src/bundle/index.ts | 2 +- .../coordinator/coretex-coordinator-core.ts | 4 +++ .../src/coordinator/production-evaluator.ts | 27 +++++++++++++++---- packages/coretex/src/scorer-server-cli.ts | 9 +++++++ .../test/unit/bundle-base-rpc-config.test.mjs | 4 +-- .../coretex/test/unit/scorer-server.test.mjs | 16 ++++++++++- 6 files changed, 53 insertions(+), 9 deletions(-) diff --git a/packages/coretex/src/bundle/index.ts b/packages/coretex/src/bundle/index.ts index 4b523ce3..a17c265b 100644 --- a/packages/coretex/src/bundle/index.ts +++ b/packages/coretex/src/bundle/index.ts @@ -486,7 +486,7 @@ export interface BaseRpcConfigPin { export const DEFAULT_BASE_RPC_CONFIG: BaseRpcConfigPin = { chainId: 8453, // Base mainnet blockTimeSeconds: 2, - targetBlockOffset: 30, // ≈ 60 s on Base + targetBlockOffset: 15, // ≈ 30 s on Base replayBlockhashLookbackBlocks: 50_000, // ≈ 28 h coverage }; diff --git a/packages/coretex/src/coordinator/coretex-coordinator-core.ts b/packages/coretex/src/coordinator/coretex-coordinator-core.ts index 5b41e3ec..3a495c08 100644 --- a/packages/coretex/src/coordinator/coretex-coordinator-core.ts +++ b/packages/coretex/src/coordinator/coretex-coordinator-core.ts @@ -182,6 +182,10 @@ export interface RealEvaluator { * under the pinned blockhash; the secretless scorer injects them verbatim. * Requires seedContext. The local CPU evaluator path omits it. */ injectedSeeds?: { readonly gateSeed: string; readonly confirmSeed: string }; + /** OPTIONAL coordinator-authoritative offset for the supplied seedContext. + * Remote/keyless evaluators use it to stamp artifacts/proofs with the same + * targetBlockOffset the coordinator used when drawing targetBlock. */ + targetBlockOffset?: number; }): Promise | EvalResult; } diff --git a/packages/coretex/src/coordinator/production-evaluator.ts b/packages/coretex/src/coordinator/production-evaluator.ts index 7fa8206a..f9e11897 100644 --- a/packages/coretex/src/coordinator/production-evaluator.ts +++ b/packages/coretex/src/coordinator/production-evaluator.ts @@ -35,6 +35,7 @@ import { type AttestedCoordinatorBootAttestation, type CoreTexBundleManifest, type EvaluatorProfile, + DEFAULT_BASE_RPC_CONFIG, } from '../bundle/index.js'; import { loadProductionCorpus, @@ -365,6 +366,11 @@ export type ProductionCoreTexEvaluator = RealEvaluator & { * seedContext. Requires seedContext. The validator's post-reveal * re-derivation from the revealed secret is the integrity backstop. */ injectedSeeds?: { readonly gateSeed: string; readonly confirmSeed: string }; + /** Coordinator-authoritative target block offset for an injected seedContext. + * The keyless scorer receives this per job and stamps artifacts/proofs with + * the same value the coordinator used to draw targetBlock. Local CPU scoring + * omits it and uses the construction-time bundle/default offset. */ + targetBlockOffset?: number; }): Promise; /** Hash-bound boot attestation (§2): resolved model id + revision + * reranker mode + instruction + prompt-template hash + Memory-IR mode. */ @@ -569,6 +575,10 @@ export function createCoreTexEvaluatorCore(deps: ProductionCoreTexEvaluatorCoreD const onSeedDerived = coordinatorPinnedSeed || priorAttempt ? undefined : (seedContext: PerPatchSeedContext) => deps.dedupStore.recordSeedDrawnAndAdmission(dedupKey, seedContext, miner); + const effectiveTargetBlockOffset = input.targetBlockOffset ?? deps.targetBlockOffset; + if (!Number.isSafeInteger(effectiveTargetBlockOffset) || effectiveTargetBlockOffset <= 0) { + throw new Error(`targetBlockOffset must be a positive integer (got ${String(effectiveTargetBlockOffset)})`); + } const dual = await runPerPatchEvaluation({ normalizedPatchBytes: patchBytes, @@ -579,7 +589,7 @@ export function createCoreTexEvaluatorCore(deps: ProductionCoreTexEvaluatorCoreD }, { rpcClient: deps.rpcClient, scorer, - targetBlockOffset: deps.targetBlockOffset, + targetBlockOffset: effectiveTargetBlockOffset, thresholdPpm: effectiveThresholdPpm, perMinerCap: deps.perMinerCap, ...(deps.epochSecret ? { epochSecret: deps.epochSecret } : {}), @@ -594,13 +604,20 @@ export function createCoreTexEvaluatorCore(deps: ProductionCoreTexEvaluatorCoreD ...(onSeedDerived ? { onSeedDerived } : {}), }); + const drewPacks = dual.receivedAtBlock > 0; + if (drewPacks) { + const actualTargetBlockOffset = dual.targetBlock - dual.receivedAtBlock; + if (!Number.isSafeInteger(actualTargetBlockOffset) || actualTargetBlockOffset <= 0 || actualTargetBlockOffset !== effectiveTargetBlockOffset) { + throw new Error(`targetBlockOffset mismatch: targetBlock ${dual.targetBlock} != receivedAtBlock ${dual.receivedAtBlock} + offset ${effectiveTargetBlockOffset}`); + } + } + // The patch consumed a pack draw iff seeds were derived. The admission was // ALREADY charged ATOMICALLY with the seed pin inside onSeedDerived (which // runPerPatchEvaluation invokes only AFTER the admission gate passes and // the seed is derived) — so there is no separate post-result charge to // make here (exactly-once, crash-safe). We only record the dedup outcome, // which is what short-circuits a completed resubmission. - const drewPacks = dual.receivedAtBlock > 0; const record = (outcome: CoreTexEvalDedupRecord['outcome'], code?: string) => { if (coordinatorPinnedSeed) return Promise.resolve(); const attemptState = outcome === 'reject' ? 'rejected' as const : 'accepted' as const; @@ -634,7 +651,7 @@ export function createCoreTexEvaluatorCore(deps: ProductionCoreTexEvaluatorCoreD epochId: deps.epochId, receivedAtBlock: dual.receivedAtBlock, targetBlock: dual.targetBlock, - targetBlockOffset: deps.targetBlockOffset, + targetBlockOffset: effectiveTargetBlockOffset, blockhash: dual.blockhash.toLowerCase(), patchHash, parentStateRoot, @@ -655,7 +672,7 @@ export function createCoreTexEvaluatorCore(deps: ProductionCoreTexEvaluatorCoreD corpusRoot: deps.corpusRoot, coreVersionHash: deps.bundleHash, hiddenSeedCommit, - targetBlockOffset: deps.targetBlockOffset, + targetBlockOffset: effectiveTargetBlockOffset, }); if (stateAdvance) { @@ -759,7 +776,7 @@ export async function createProductionCoreTexEvaluator( stateThresholdPpm, screenerThresholdPpm, replayTolerancePpm: profile.replayTolerancePpm, - targetBlockOffset: options.targetBlockOffset ?? 30, + targetBlockOffset: options.targetBlockOffset ?? profile.baseRpcConfig?.targetBlockOffset ?? DEFAULT_BASE_RPC_CONFIG.targetBlockOffset, perMinerCap: options.perMinerCap, rpcClient: options.rpcClient ?? new EnvBaseRpcClient(), dedupStore: options.dedupStore, diff --git a/packages/coretex/src/scorer-server-cli.ts b/packages/coretex/src/scorer-server-cli.ts index 05090318..623ecaa5 100644 --- a/packages/coretex/src/scorer-server-cli.ts +++ b/packages/coretex/src/scorer-server-cli.ts @@ -284,6 +284,14 @@ export function resolveJobSeedContext( if (!Number.isSafeInteger(targetBlock) || (targetBlock as number) <= 0) { return { error: `publicEvalContext.targetBlock must be a positive integer (got ${String(targetBlock)})` }; } + const targetBlockOffset = ctx.targetBlockOffset; + if (!Number.isSafeInteger(targetBlockOffset) || (targetBlockOffset as number) <= 0) { + return { error: `publicEvalContext.targetBlockOffset must be a positive integer (got ${String(targetBlockOffset)})` }; + } + const expectedTargetBlock = (receivedAtBlock as number) + (targetBlockOffset as number); + if ((targetBlock as number) !== expectedTargetBlock) { + return { error: `publicEvalContext.targetBlock ${String(targetBlock)} != receivedAtBlock ${String(receivedAtBlock)} + targetBlockOffset ${String(targetBlockOffset)}` }; + } if (typeof blockhash !== 'string' || !/^0x[0-9a-fA-F]{64}$/.test(blockhash)) { return { error: 'publicEvalContext.blockhash must be bytes32' }; } @@ -400,6 +408,7 @@ export async function handleScoreJob( // seeds — the scorer never re-rolls a blockhash nor touches a secret. seedContext: pinnedSeed.seedContext, injectedSeeds: pinnedSeed.injectedSeeds, + targetBlockOffset: job.publicEvalContext!.targetBlockOffset!, }); } catch (e) { return { status: 500, body: { error: 'eval-failure', reason: (e as Error)?.message ?? 'scorePatch threw' } }; diff --git a/packages/coretex/test/unit/bundle-base-rpc-config.test.mjs b/packages/coretex/test/unit/bundle-base-rpc-config.test.mjs index 531f3d15..541fd74f 100644 --- a/packages/coretex/test/unit/bundle-base-rpc-config.test.mjs +++ b/packages/coretex/test/unit/bundle-base-rpc-config.test.mjs @@ -37,9 +37,9 @@ describe('DEFAULT_BASE_RPC_CONFIG', () => { test('is exported and has Base mainnet values', () => { assert.equal(DEFAULT_BASE_RPC_CONFIG.chainId, 8453); assert.equal(DEFAULT_BASE_RPC_CONFIG.blockTimeSeconds, 2); - assert.equal(DEFAULT_BASE_RPC_CONFIG.targetBlockOffset, 30, 'default offset ≈ 60 s on Base — aligned with per-miner rate limit'); + assert.equal(DEFAULT_BASE_RPC_CONFIG.targetBlockOffset, 15, 'default offset ≈ 30 s on Base — aligned with the live coordinator/scorer seed pin'); // Must cover one full epoch (24 h = 43_200 blocks @ 2 s) + the offset. - const minLookback = 43_200 + 30; + const minLookback = 43_200 + 15; assert.ok(DEFAULT_BASE_RPC_CONFIG.replayBlockhashLookbackBlocks >= minLookback, 'lookback must cover one epoch + offset'); }); }); diff --git a/packages/coretex/test/unit/scorer-server.test.mjs b/packages/coretex/test/unit/scorer-server.test.mjs index 94d263ed..849e8f9c 100644 --- a/packages/coretex/test/unit/scorer-server.test.mjs +++ b/packages/coretex/test/unit/scorer-server.test.mjs @@ -74,7 +74,8 @@ const HEALTH = { // scorer is keyless AND secretless — every job must ship the full pin. const PINNED_SEED_CONTEXT = { receivedAtBlock: 1_000, - targetBlock: 1_030, + targetBlock: 1_015, + targetBlockOffset: 15, blockhash: B32('5e'), gateSeed: B32('6a'), confirmSeed: B32('6b'), @@ -435,6 +436,18 @@ describe('scorer-server — mandatory pinned seed + secretless host', () => { assert.equal(res.status, 422); }); + test('missing or inconsistent targetBlockOffset is refused 422', async () => { + for (const ctx of [ + (() => { const c = { ...PINNED_SEED_CONTEXT }; delete c.targetBlockOffset; return c; })(), + { ...PINNED_SEED_CONTEXT, targetBlockOffset: 30 }, + ]) { + const res = await handleScoreJob(baseJob({ publicEvalContext: ctx }), handlerDeps()); + assert.equal(res.status, 422); + assert.equal(res.body.error, 'SCORER_SEED_CONTEXT_INVALID'); + assert.match(res.body.reason, /targetBlockOffset|targetBlock/); + } + }); + test('missing gateSeed/confirmSeed is refused 422 (coordinator must derive the seeds)', async () => { for (const missing of ['gateSeed', 'confirmSeed']) { const ctx = { ...PINNED_SEED_CONTEXT }; @@ -469,6 +482,7 @@ describe('scorer-server — mandatory pinned seed + secretless host', () => { gateSeed: PINNED_SEED_CONTEXT.gateSeed.toLowerCase(), confirmSeed: PINNED_SEED_CONTEXT.confirmSeed.toLowerCase(), }); + assert.equal(counter.lastInput.targetBlockOffset, 15); }); test('hiddenSeedCommit mismatch vs the loaded commit is a 409 pin mismatch', async () => { From a776d476233be28789f5ac48d074b543e05c2c7e Mon Sep 17 00:00:00 2001 From: botcoinmoney Date: Tue, 16 Jun 2026 21:44:40 +0000 Subject: [PATCH 8/8] docs: align target block offset comment --- packages/coretex/src/coordinator/per-patch-evaluator.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/coretex/src/coordinator/per-patch-evaluator.ts b/packages/coretex/src/coordinator/per-patch-evaluator.ts index c17a7f36..070dac93 100644 --- a/packages/coretex/src/coordinator/per-patch-evaluator.ts +++ b/packages/coretex/src/coordinator/per-patch-evaluator.ts @@ -113,8 +113,8 @@ export interface PerPatchEvaluatorDeps { readonly dedupCache: ReadonlyMap; /** Per-miner admission counter. Same contract as dedupCache. */ readonly minerAdmissions: ReadonlyMap; - /** Max wait for the future blockhash. Defaults to 120 s (2× the - * 60 s budget at targetBlockOffset=30) — generous enough that + /** Max wait for the future blockhash. Defaults to 120 s (4× the + * 30 s budget at targetBlockOffset=15) — generous enough that * Base must be genuinely stalled for this to fire. */ readonly waitTimeoutMs?: number; /** §8 anti-grinding — OPTIONAL pinned seed context. When supplied, the