Phase 920: export mesh validate coverage + diagnostics/entry scope adoption (v0.8.887)
Non-breaking refactor only — validate-coverage module extracts pull config, named mixin, and scope list count validation; validate and diagnostics adopt withExportMeshFetchRegistryScope(); entry scope clone uses lazy scope wrapper to avoid registry→audit→entry circular dep. CI: test:ci-phase920 with live digest snapshot RPC.
This commit is contained in:
@@ -92,6 +92,8 @@ Application facade: one `PearcordPlatform` class that wires identity, database,
|
||||
|
||||
**Phase 822 (v0.8.789):** Triple-peer topology via `guild-mesh-topology` + `getMeshStabilityStats`. Bundle: `npm run test:ci-phase822`.
|
||||
|
||||
**Phase 920 (v0.8.887):** Export mesh validate coverage + diagnostics/entry scope adoption. Bundle: `npm run test:ci-phase920`.
|
||||
|
||||
**Phase 919 (v0.8.886):** Export mesh scope list builder + lookup name scope resolver + validate entries extract. Bundle: `npm run test:ci-phase919`.
|
||||
|
||||
**Phase 918 (v0.8.885):** Export mesh scope list aliases + diagnostics payload scope + validate pull scope. Bundle: `npm run test:ci-phase918`.
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
'use strict'
|
||||
|
||||
const { getExportMeshFetchRegistryScope } = require('./gossip-rpc-export-mesh-registry-scope')
|
||||
const {
|
||||
buildExportMeshFetchRegistryDiagnosticsPayload
|
||||
} = require('./gossip-rpc-export-mesh-registry-snapshot')
|
||||
@@ -13,18 +12,20 @@ const {
|
||||
listExportMeshFetchNamedMixinExportKeys,
|
||||
listExportMeshFetchNamedMixinRegistryNames
|
||||
} = require('./gossip-rpc-export-mesh-registry-named')
|
||||
const { withExportMeshFetchRegistryScope } = require('./gossip-rpc-export-mesh-registry-lookup-name-scope')
|
||||
|
||||
/** Build export mesh registry diagnostics payload from scope (Phase 918). */
|
||||
/** Build export mesh registry diagnostics payload from scope (Phase 918–920). */
|
||||
function buildExportMeshFetchRegistryDiagnosticsPayloadFromScope () {
|
||||
const { keys } = getExportMeshFetchRegistryScope()
|
||||
return buildExportMeshFetchRegistryDiagnosticsPayload({
|
||||
registryKeys: keys,
|
||||
registrySnapshot: buildExportMeshFetchRegistrySnapshotFromScope(),
|
||||
mixinMethods: listExportMeshFetchMixinMethodsFromScope(),
|
||||
waitersKeys: listExportMeshFetchWaitersKeysFromScope(),
|
||||
namedMixinExportKeys: listExportMeshFetchNamedMixinExportKeys(),
|
||||
namedMixinRegistryNames: listExportMeshFetchNamedMixinRegistryNames()
|
||||
})
|
||||
return withExportMeshFetchRegistryScope((_registry, keys) =>
|
||||
buildExportMeshFetchRegistryDiagnosticsPayload({
|
||||
registryKeys: keys,
|
||||
registrySnapshot: buildExportMeshFetchRegistrySnapshotFromScope(),
|
||||
mixinMethods: listExportMeshFetchMixinMethodsFromScope(),
|
||||
waitersKeys: listExportMeshFetchWaitersKeysFromScope(),
|
||||
namedMixinExportKeys: listExportMeshFetchNamedMixinExportKeys(),
|
||||
namedMixinRegistryNames: listExportMeshFetchNamedMixinRegistryNames()
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
/** Build export mesh registry diagnostics snapshot from scope (Phase 914). */
|
||||
|
||||
@@ -30,11 +30,12 @@ function cloneExportMeshFetchRegistryEntry (entry) {
|
||||
return { ...entry }
|
||||
}
|
||||
|
||||
/** Clone one export mesh registry entry by name from scope (Phase 916). */
|
||||
/** Clone one export mesh registry entry by name from scope (Phase 916–920). */
|
||||
function lookupExportMeshFetchRegistryEntryFromScope (name) {
|
||||
const { getExportMeshFetchRegistryScope } = require('./gossip-rpc-export-mesh-registry-scope')
|
||||
const { registry } = getExportMeshFetchRegistryScope()
|
||||
return cloneExportMeshFetchRegistryEntry(registry[name])
|
||||
const { withExportMeshFetchRegistryScope } = require('./gossip-rpc-export-mesh-registry-lookup-name-scope')
|
||||
return withExportMeshFetchRegistryScope((registry) =>
|
||||
cloneExportMeshFetchRegistryEntry(registry[name])
|
||||
)
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
'use strict'
|
||||
|
||||
const {
|
||||
listExportMeshFetchMixinMethodsFromScope,
|
||||
listExportMeshFetchWaitersKeysFromScope,
|
||||
listExportMeshPullConfigKeysFromScope
|
||||
} = require('./gossip-rpc-export-mesh-registry-scope-lists')
|
||||
const {
|
||||
exportMeshFetchNamedMixinMap,
|
||||
listExportMeshFetchNamedMixinRegistryNames
|
||||
} = require('./gossip-rpc-export-mesh-registry-named')
|
||||
|
||||
/** Validate export mesh pull config coverage from scope (Phase 920). */
|
||||
function validateExportMeshFetchRegistryPullConfigCoverageFromScope (registry, keys) {
|
||||
for (const pullConfigKey of listExportMeshPullConfigKeysFromScope()) {
|
||||
if (!keys.some((name) => registry[name].pullConfigKey === pullConfigKey)) {
|
||||
throw new Error(`export mesh registry missing pull config entry: ${pullConfigKey}`)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** Validate export mesh named mixin registry coverage from scope (Phase 920). */
|
||||
function validateExportMeshFetchRegistryNamedMixinCoverageFromScope (registry) {
|
||||
for (const registryName of listExportMeshFetchNamedMixinRegistryNames()) {
|
||||
if (!registry[registryName]) {
|
||||
throw new Error(`export mesh named mixin missing registry entry: ${registryName}`)
|
||||
}
|
||||
}
|
||||
const namedRegistryNames = listExportMeshFetchNamedMixinRegistryNames()
|
||||
if (namedRegistryNames.length !== Object.keys(exportMeshFetchNamedMixinMap).length) {
|
||||
throw new Error(`export mesh named mixin registry name count ${namedRegistryNames.length}`)
|
||||
}
|
||||
}
|
||||
|
||||
/** Validate export mesh scope list counts from scope (Phase 920). */
|
||||
function validateExportMeshFetchRegistryScopeListCountsFromScope (keys) {
|
||||
const mixinMethods = listExportMeshFetchMixinMethodsFromScope()
|
||||
if (mixinMethods.length !== keys.length * 3) {
|
||||
throw new Error(`export mesh mixin method count ${mixinMethods.length}`)
|
||||
}
|
||||
const waiterKeyList = listExportMeshFetchWaitersKeysFromScope()
|
||||
if (waiterKeyList.length !== keys.length) {
|
||||
throw new Error(`export mesh waiters key count ${waiterKeyList.length}`)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
validateExportMeshFetchRegistryPullConfigCoverageFromScope,
|
||||
validateExportMeshFetchRegistryNamedMixinCoverageFromScope,
|
||||
validateExportMeshFetchRegistryScopeListCountsFromScope
|
||||
}
|
||||
@@ -1,50 +1,23 @@
|
||||
'use strict'
|
||||
|
||||
const { gossipRpcPullConfigs } = require('./gossip-rpc-pull-config')
|
||||
const { getExportMeshFetchRegistryScope } = require('./gossip-rpc-export-mesh-registry-scope')
|
||||
const {
|
||||
listExportMeshFetchMixinMethodsFromScope,
|
||||
listExportMeshFetchWaitersKeysFromScope,
|
||||
listExportMeshPullConfigKeysFromScope
|
||||
} = require('./gossip-rpc-export-mesh-registry-scope-lists')
|
||||
const { exportMeshFetchNamedMixinMap, listExportMeshFetchNamedMixinRegistryNames } = require('./gossip-rpc-export-mesh-registry-named')
|
||||
const { withExportMeshFetchRegistryScope } = require('./gossip-rpc-export-mesh-registry-lookup-name-scope')
|
||||
const { validateExportMeshFetchRegistryEntriesFromScope } = require('./gossip-rpc-export-mesh-registry-validate-entries')
|
||||
const {
|
||||
validateExportMeshFetchRegistryPullConfigCoverageFromScope,
|
||||
validateExportMeshFetchRegistryNamedMixinCoverageFromScope,
|
||||
validateExportMeshFetchRegistryScopeListCountsFromScope
|
||||
} = require('./gossip-rpc-export-mesh-registry-validate-coverage')
|
||||
|
||||
/** Validate export mesh fetch registry alignment with gossip RPC pull configs (Phase 901–919). */
|
||||
/** Validate export mesh fetch registry alignment with gossip RPC pull configs (Phase 901–920). */
|
||||
function validateExportMeshFetchRegistryAlignment () {
|
||||
const { registry, keys } = getExportMeshFetchRegistryScope()
|
||||
const pullConfigKeys = Object.keys(gossipRpcPullConfigs)
|
||||
|
||||
validateExportMeshFetchRegistryEntriesFromScope(registry, keys, pullConfigKeys)
|
||||
|
||||
for (const pullConfigKey of listExportMeshPullConfigKeysFromScope()) {
|
||||
if (!keys.some((name) => registry[name].pullConfigKey === pullConfigKey)) {
|
||||
throw new Error(`export mesh registry missing pull config entry: ${pullConfigKey}`)
|
||||
}
|
||||
}
|
||||
|
||||
for (const registryName of listExportMeshFetchNamedMixinRegistryNames()) {
|
||||
if (!registry[registryName]) {
|
||||
throw new Error(`export mesh named mixin missing registry entry: ${registryName}`)
|
||||
}
|
||||
}
|
||||
|
||||
const namedRegistryNames = listExportMeshFetchNamedMixinRegistryNames()
|
||||
if (namedRegistryNames.length !== Object.keys(exportMeshFetchNamedMixinMap).length) {
|
||||
throw new Error(`export mesh named mixin registry name count ${namedRegistryNames.length}`)
|
||||
}
|
||||
|
||||
const mixinMethods = listExportMeshFetchMixinMethodsFromScope()
|
||||
if (mixinMethods.length !== keys.length * 3) {
|
||||
throw new Error(`export mesh mixin method count ${mixinMethods.length}`)
|
||||
}
|
||||
|
||||
const waiterKeyList = listExportMeshFetchWaitersKeysFromScope()
|
||||
if (waiterKeyList.length !== keys.length) {
|
||||
throw new Error(`export mesh waiters key count ${waiterKeyList.length}`)
|
||||
}
|
||||
|
||||
return true
|
||||
return withExportMeshFetchRegistryScope((registry, keys) => {
|
||||
validateExportMeshFetchRegistryEntriesFromScope(registry, keys, Object.keys(gossipRpcPullConfigs))
|
||||
validateExportMeshFetchRegistryPullConfigCoverageFromScope(registry, keys)
|
||||
validateExportMeshFetchRegistryNamedMixinCoverageFromScope(registry)
|
||||
validateExportMeshFetchRegistryScopeListCountsFromScope(keys)
|
||||
return true
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = { validateExportMeshFetchRegistryAlignment }
|
||||
|
||||
@@ -27,6 +27,7 @@ const meshRegistryNamed = require('./gossip-rpc-export-mesh-registry-named')
|
||||
const meshRegistrySnapshot = require('./gossip-rpc-export-mesh-registry-snapshot')
|
||||
const meshRegistryValidate = require('./gossip-rpc-export-mesh-registry-validate')
|
||||
const meshRegistryValidateEntries = require('./gossip-rpc-export-mesh-registry-validate-entries')
|
||||
const meshRegistryValidateCoverage = require('./gossip-rpc-export-mesh-registry-validate-coverage')
|
||||
const meshRegistryValidateFields = require('./gossip-rpc-export-mesh-registry-validate-fields')
|
||||
const meshRegistryValidateUnique = require('./gossip-rpc-export-mesh-registry-validate-unique')
|
||||
const meshRegistryEntry = require('./gossip-rpc-export-mesh-registry-entry')
|
||||
@@ -62,6 +63,7 @@ module.exports = {
|
||||
...meshRegistrySnapshot,
|
||||
...meshRegistryValidate,
|
||||
...meshRegistryValidateEntries,
|
||||
...meshRegistryValidateCoverage,
|
||||
...meshRegistryValidateFields,
|
||||
...meshRegistryValidateUnique,
|
||||
...meshRegistryEntry,
|
||||
|
||||
Reference in New Issue
Block a user