Phase 905: export mesh registry entry factory + pull config keys (v0.8.872)

Non-breaking refactor — buildExportMeshFetchRegistryEntry() factory
deduplicates audit/digest registry entry construction;
listExportMeshPullConfigKeys() consolidates pull config keys in registry
root; validate module imports keys from registry instead of duplicating.
Default gossip v1 unchanged; fleet v2 cutover still deferred.

Verification: test:ci-phase905 (3rd retry), boot gate, pearcord.log scan.
This commit is contained in:
Raven Scott
2026-06-04 20:00:38 -04:00
parent 45a8c2a524
commit 7f08101e81
7 changed files with 51 additions and 12 deletions
+2
View File
@@ -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 905 (v0.8.872):** Export mesh registry entry factory + pull config keys. Bundle: `npm run test:ci-phase905`.
**Phase 904 (v0.8.871):** Export mesh row helper extract + platform mixin builder. Bundle: `npm run test:ci-phase904`.
**Phase 903 (v0.8.870):** Export mesh format helper extract + mixin method registry. Bundle: `npm run test:ci-phase903`.
+4 -3
View File
@@ -2,6 +2,7 @@
const { resolveExportMeshFetchWaiterByPrefix } = require('./gossip-rpc-export-mesh-waiter-resolve')
const { isValidAuditExportArchiveMeshRow } = require('./gossip-rpc-export-mesh-validators')
const { buildExportMeshFetchRegistryEntry } = require('./gossip-rpc-export-mesh-registry-entry')
const {
formatAuditExportArchiveMeshLocalHit,
formatAuditExportArchiveMeshRpcHit,
@@ -14,8 +15,8 @@ const {
ingestAuditExportArchiveMeshRpc
} = require('./gossip-rpc-export-mesh-row-audit')
/** Audit export archive mesh fetch registry entry (Phase 901904). */
const auditExportArchiveMeshFetchEntry = {
/** Audit export archive mesh fetch registry entry (Phase 901905). */
const auditExportArchiveMeshFetchEntry = buildExportMeshFetchRegistryEntry({
pullConfigKey: 'auditExportArchive',
resolveWaiterMethod: '_resolveAuditArchiveFetchWaiter',
fetchFromMeshMethod: 'fetchAuditExportArchiveFromMesh',
@@ -34,6 +35,6 @@ const auditExportArchiveMeshFetchEntry = {
formatRpcHit: formatAuditExportArchiveMeshRpcHit,
formatGossipResult: formatAuditExportArchiveMeshGossipResult,
sendGossipRequest: sendAuditExportArchiveMeshGossipRequest
}
})
module.exports = { auditExportArchiveMeshFetchEntry }
+4 -3
View File
@@ -2,6 +2,7 @@
const { resolveExportMeshFetchWaiterByExactKey } = require('./gossip-rpc-export-mesh-waiter-resolve')
const { isValidAutomationDigestSnapshotMeshRow } = require('./gossip-rpc-export-mesh-validators')
const { buildExportMeshFetchRegistryEntry } = require('./gossip-rpc-export-mesh-registry-entry')
const {
formatAutomationDigestSnapshotMeshLocalHit,
formatAutomationDigestSnapshotMeshRpcHit,
@@ -14,8 +15,8 @@ const {
ingestAutomationDigestSnapshotMeshRpc
} = require('./gossip-rpc-export-mesh-row-digest')
/** Automation digest snapshot mesh fetch registry entry (Phase 901904). */
const automationDigestSnapshotMeshFetchEntry = {
/** Automation digest snapshot mesh fetch registry entry (Phase 901905). */
const automationDigestSnapshotMeshFetchEntry = buildExportMeshFetchRegistryEntry({
pullConfigKey: 'automationDigestSnapshot',
resolveWaiterMethod: '_resolveAutomationDigestSnapshotFetchWaiter',
fetchFromMeshMethod: 'fetchAutomationDigestSnapshotFromMesh',
@@ -34,6 +35,6 @@ const automationDigestSnapshotMeshFetchEntry = {
formatRpcHit: formatAutomationDigestSnapshotMeshRpcHit,
formatGossipResult: formatAutomationDigestSnapshotMeshGossipResult,
sendGossipRequest: sendAutomationDigestSnapshotMeshGossipRequest
}
})
module.exports = { automationDigestSnapshotMeshFetchEntry }
+27
View File
@@ -0,0 +1,27 @@
'use strict'
/** Build one export mesh fetch registry entry from a spec (Phase 905). */
function buildExportMeshFetchRegistryEntry (spec) {
return {
pullConfigKey: spec.pullConfigKey,
resolveWaiterMethod: spec.resolveWaiterMethod,
fetchFromMeshMethod: spec.fetchFromMeshMethod,
fetchOnceMethod: spec.fetchOnceMethod,
waitersKey: spec.waitersKey,
resolveWaiter: spec.resolveWaiter,
permissionError: spec.permissionError,
notFoundMessage: spec.notFoundMessage,
validateLocal: spec.validateLocal,
waiterMode: spec.waiterMode,
timeoutErrorMessage: spec.timeoutErrorMessage,
getLocalRow: spec.getLocalRow,
tryRpc: spec.tryRpc,
ingestRpc: spec.ingestRpc,
formatLocalHit: spec.formatLocalHit,
formatRpcHit: spec.formatRpcHit,
formatGossipResult: spec.formatGossipResult,
sendGossipRequest: spec.sendGossipRequest
}
}
module.exports = { buildExportMeshFetchRegistryEntry }
+3 -5
View File
@@ -1,14 +1,12 @@
'use strict'
const { gossipRpcPullConfigs } = require('./gossip-rpc-pull-config')
const { exportMeshFetchRegistry } = require('./gossip-rpc-export-mesh-registry')
const { exportMeshFetchRegistry, listExportMeshPullConfigKeys } = require('./gossip-rpc-export-mesh-registry')
const {
listExportMeshFetchRegistryKeys,
listExportMeshFetchMixinMethods
} = require('./gossip-rpc-export-mesh-registry-lookup')
const exportMeshPullConfigKeys = ['auditExportArchive', 'automationDigestSnapshot']
function assertUniqueExportMeshMethod (methodSet, methodName, label) {
if (methodSet.has(methodName)) {
throw new Error(`duplicate export mesh ${label}: ${methodName}`)
@@ -16,7 +14,7 @@ function assertUniqueExportMeshMethod (methodSet, methodName, label) {
methodSet.add(methodName)
}
/** Validate export mesh fetch registry alignment with gossip RPC pull configs (Phase 901903). */
/** Validate export mesh fetch registry alignment with gossip RPC pull configs (Phase 901905). */
function validateExportMeshFetchRegistryAlignment () {
const keys = listExportMeshFetchRegistryKeys()
const pullConfigKeys = Object.keys(gossipRpcPullConfigs)
@@ -47,7 +45,7 @@ function validateExportMeshFetchRegistryAlignment () {
assertUniqueExportMeshMethod(fetchOnceMethods, entry.fetchOnceMethod, 'fetchOnceMethod')
}
for (const pullConfigKey of exportMeshPullConfigKeys) {
for (const pullConfigKey of listExportMeshPullConfigKeys()) {
if (!keys.some((name) => exportMeshFetchRegistry[name].pullConfigKey === pullConfigKey)) {
throw new Error(`export mesh registry missing pull config entry: ${pullConfigKey}`)
}
+9 -1
View File
@@ -8,12 +8,18 @@ const {
formatAutomationDigestSnapshotMeshRow
} = require('./gossip-rpc-export-mesh-validators')
/** Registry entries for targeted export mesh fetch mixins (Phase 899901). */
/** Registry entries for targeted export mesh fetch mixins (Phase 899905). */
const exportMeshFetchRegistry = {
auditExportArchive: auditExportArchiveMeshFetchEntry,
automationDigestSnapshot: automationDigestSnapshotMeshFetchEntry
}
const exportMeshPullConfigKeys = ['auditExportArchive', 'automationDigestSnapshot']
function listExportMeshPullConfigKeys () {
return [...exportMeshPullConfigKeys]
}
function exportMeshFetchConfig (name) {
const cfg = exportMeshFetchRegistry[name]
if (!cfg) return null
@@ -22,6 +28,8 @@ function exportMeshFetchConfig (name) {
module.exports = {
exportMeshFetchRegistry,
exportMeshPullConfigKeys,
listExportMeshPullConfigKeys,
exportMeshFetchConfig,
isValidAuditExportArchiveMeshRow,
isValidAutomationDigestSnapshotMeshRow,
+2
View File
@@ -12,6 +12,7 @@ const meshValidators = require('./gossip-rpc-export-mesh-validators')
const meshRegistry = require('./gossip-rpc-export-mesh-registry')
const meshRegistryLookup = require('./gossip-rpc-export-mesh-registry-lookup')
const meshRegistryValidate = require('./gossip-rpc-export-mesh-registry-validate')
const meshRegistryEntry = require('./gossip-rpc-export-mesh-registry-entry')
const meshFormatAudit = require('./gossip-rpc-export-mesh-format-audit')
const meshFormatDigest = require('./gossip-rpc-export-mesh-format-digest')
const meshRowAudit = require('./gossip-rpc-export-mesh-row-audit')
@@ -29,6 +30,7 @@ module.exports = {
...meshRegistry,
...meshRegistryLookup,
...meshRegistryValidate,
...meshRegistryEntry,
...meshFormatAudit,
...meshFormatDigest,
...meshRowAudit,