소스 정보
- 저장소
- TuYv/ccpm
- 최근 소스 활동
- 2026년 8월 14일 19:45
- 감지된 SKILL.md 언어
- 영어
- 스타
- 1
- 포크
- 2
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/TuYv/ccpm --skill agent-quorum-manager명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SKILL.md 표시 중
SOC 직업 분류 기준
| name | agent-quorum-manager |
| description | Agent skill for quorum-manager - invoke with $agent-quorum-manager |
name: quorum-manager type: coordinator color: "#673AB7" description: Implements dynamic quorum adjustment and intelligent membership management capabilities:
Implements dynamic quorum adjustment and intelligent membership management for distributed consensus protocols.
class QuorumManager {
constructor(nodeId, consensusProtocol) {
this.nodeId = nodeId;
this.protocol = consensusProtocol;
this.currentQuorum = new Map(); // nodeId -> QuorumNode
this.quorumHistory = [];
this.networkMonitor = new NetworkConditionMonitor();
this.membershipTracker = new MembershipTracker();
this.faultToleranceCalculator = new FaultToleranceCalculator();
this.adjustmentStrategies = new Map();
this.initializeStrategies();
}
// Initialize quorum adjustment strategies
initializeStrategies() {
this.adjustmentStrategies.set('NETWORK_BASED', new NetworkBasedStrategy());
this.adjustmentStrategies.set('PERFORMANCE_BASED', new PerformanceBasedStrategy());
this.adjustmentStrategies.set('FAULT_TOLERANCE_BASED', new FaultToleranceStrategy());
this.adjustmentStrategies.set('HYBRID', new HybridStrategy());
}
// Calculate optimal quorum size based on current conditions
async calculateOptimalQuorum(context = {}) {
const networkConditions = await this.networkMonitor.getCurrentConditions();
const membershipStatus = await this.membershipTracker.getMembershipStatus();
const performanceMetrics = context.performanceMetrics || await this.getPerformanceMetrics();
const analysisInput = {
networkConditions: networkConditions,
membershipStatus: membershipStatus,
performanceMetrics: performanceMetrics,
currentQuorum: this.currentQuorum,
protocol: this.protocol,
faultToleranceRequirements: context.faultToleranceRequirements || this.getDefaultFaultTolerance()
};
// Apply multiple strategies and select optimal result
const strategyResults = new Map();
for (const [strategyName, strategy] of this.adjustmentStrategies) {
try {
const result = await strategy.calculateQuorum(analysisInput);
strategyResults.set(strategyName, result);
} catch (error) {
console.warn(`Strategy ${strategyName} failed:`, error);
}
}
// Select best strategy result
const optimalResult = this.selectOptimalStrategy(strategyResults, analysisInput);
return {
recommendedQuorum: optimalResult.quorum,
strategy: optimalResult.strategy,
confidence: optimalResult.confidence,
reasoning: optimalResult.reasoning,
expectedImpact: optimalResult.expectedImpact
};
}
// Apply quorum changes with validation and rollback capability
async adjustQuorum(newQuorumConfig, options = {}) {
const adjustmentId = `adjustment_${Date.now()}`;
try {
// Validate new quorum configuration
await this.validateQuorumConfiguration(newQuorumConfig);
// Create adjustment plan
const adjustmentPlan = await this.createAdjustmentPlan(
this.currentQuorum, newQuorumConfig
);
// Execute adjustment with monitoring
const adjustmentResult = await this.executeQuorumAdjustment(
adjustmentPlan, adjustmentId, options
);
// Verify adjustment success
await this.verifyQuorumAdjustment(adjustmentResult);
// Update current quorum
this.currentQuorum = newQuorumConfig.quorum;
// Record successful adjustment
this.recordQuorumChange(adjustmentId, adjustmentResult);
return {
success: true,
adjustmentId: adjustmentId,
previousQuorum: adjustmentPlan.previousQuorum,
newQuorum: this.currentQuorum,
impact: adjustmentResult.impact
};
} catch (error) {
console.error(`Quorum adjustment failed:`, error);
// Attempt rollback
await this.rollbackQuorumAdjustment(adjustmentId);
throw error;
}
}
async executeQuorumAdjustment(adjustmentPlan, adjustmentId, options) {
const startTime = Date.now();
// Phase 1: Prepare nodes for quorum change
await this.prepareNodesForAdjustment(adjustmentPlan.affectedNodes);
// Phase 2: Execute membership changes
const membershipChanges = await this.executeMembershipChanges(
adjustmentPlan.membershipChanges
);
// Phase 3: Update voting weights if needed
if (adjustmentPlan.weightChanges.length > 0) {
await this.updateVotingWeights(adjustmentPlan.weightChanges);
}
// Phase 4: Reconfigure consensus protocol
await this.reconfigureConsensusProtocol(adjustmentPlan.protocolChanges);
// Phase 5: Verify new quorum is operational
const verificationResult = await this.verifyQuorumOperational(adjustmentPlan.newQuorum);
const endTime = Date.now();
return {
adjustmentId: adjustmentId,
duration: endTime - startTime,
membershipChanges: membershipChanges,
verificationResult: verificationResult,
impact: await this.measureAdjustmentImpact(startTime, endTime)
};
}
}
class NetworkBasedStrategy {
constructor() {
this.networkAnalyzer = new NetworkAnalyzer();
this.connectivityMatrix = new ConnectivityMatrix();
this.partitionPredictor = new PartitionPredictor();
}
async calculateQuorum(analysisInput) {
const { networkConditions, membershipStatus, currentQuorum } = analysisInput;
// Analyze network topology and connectivity
const topologyAnalysis = await this.analyzeNetworkTopology(membershipStatus.activeNodes);
// Predict potential network partitions
const partitionRisk = await this.assessPartitionRisk(networkConditions, topologyAnalysis);
// Calculate minimum quorum for fault tolerance
const minQuorum = this.calculateMinimumQuorum(
membershipStatus.activeNodes.length,
partitionRisk.maxPartitionSize
);
// Optimize for network conditions
const optimizedQuorum = await this.optimizeForNetworkConditions(
minQuorum,
networkConditions,
topologyAnalysis
);
{
: optimizedQuorum,
: ,
: .(networkConditions, topologyAnalysis),
: .(optimizedQuorum, partitionRisk, networkConditions),
: {
: .(optimizedQuorum),
: .(optimizedQuorum, networkConditions)
}
};
}
() {
topology = {
: activeNodes.,
: ,
: [],
: ,
: ()
};
( node activeNodes) {
connections = .(node);
topology..(node., connections);
topology. += connections.;
}
topology. = .(topology.);
topology. = .(topology.);
topology;
}
() {
riskFactors = {
: .(networkConditions),
: .(topologyAnalysis),
: .(networkConditions),
: .()
};
overallRisk = .(riskFactors);
maxPartitionSize = .(
topologyAnalysis,
riskFactors
);
{
: overallRisk,
: maxPartitionSize,
: riskFactors,
: .(riskFactors)
};
}
() {
byzantineMinimum = .( * totalNodes / ) + ;
partitionMinimum = .((totalNodes - maxPartitionSize) / ) + ;
.(byzantineMinimum, partitionMinimum);
}
() {
optimization = {
: minQuorum,
: (),
:
};
nodeScores = .(networkConditions, topologyAnalysis);
sortedNodes = .(nodeScores.())
.( scoreB - scoreA);
selectedCount = ;
( [nodeId, score] sortedNodes) {
(selectedCount < minQuorum) {
weight = .(nodeId, score, networkConditions);
optimization..(nodeId, {
: weight,
: score,
: selectedCount === ? :
});
optimization. += weight;
selectedCount++;
}
}
optimization;
}
() {
scores = ();
( [nodeId, connections] topologyAnalysis.) {
score = ;
score += (connections. / topologyAnalysis.) * ;
centrality = .(nodeId, topologyAnalysis);
score += centrality * ;
reliability = .(nodeId, networkConditions);
score += reliability * ;
geoScore = .(nodeId, topologyAnalysis);
score += geoScore * ;
scores.(nodeId, score);
}
scores;
}
() {
weight = ;
normalizedScore = score / ;
weight *= ( + normalizedScore);
nodeLatency = networkConditions..(nodeId) || ;
latencyFactor = .(, - (nodeLatency / ));
weight *= latencyFactor;
.(, .(, weight));
}
}
class PerformanceBasedStrategy {
constructor() {
this.performanceAnalyzer = new PerformanceAnalyzer();
this.throughputOptimizer = new ThroughputOptimizer();
this.latencyOptimizer = new LatencyOptimizer();
}
async calculateQuorum(analysisInput) {
const { performanceMetrics, membershipStatus, protocol } = analysisInput;
// Analyze current performance bottlenecks
const bottlenecks = await this.identifyPerformanceBottlenecks(performanceMetrics);
// Calculate throughput-optimal quorum size
const throughputOptimal = await this.calculateThroughputOptimalQuorum(
performanceMetrics, membershipStatus.activeNodes
);
// Calculate latency-optimal quorum size
const latencyOptimal = await this.calculateLatencyOptimalQuorum(
performanceMetrics, membershipStatus.activeNodes
);
// Balance throughput and latency requirements
const balancedQuorum = await this.balanceThroughputAndLatency(
throughputOptimal, latencyOptimal, performanceMetrics.
);
{
: balancedQuorum,
: ,
: .(performanceMetrics),
: .(
balancedQuorum, throughputOptimal, latencyOptimal, bottlenecks
),
: {
: .(balancedQuorum),
: .(balancedQuorum)
}
};
}
() {
currentThroughput = performanceMetrics.;
targetThroughput = performanceMetrics..;
throughputCurve = .(activeNodes);
optimalSize = .(activeNodes. / ) + ;
maxThroughput = ;
( size = optimalSize; size <= activeNodes.; size++) {
projectedThroughput = .(size, throughputCurve);
(projectedThroughput > maxThroughput && projectedThroughput >= targetThroughput) {
maxThroughput = projectedThroughput;
optimalSize = size;
} (projectedThroughput < maxThroughput * ) {
;
}
}
.(activeNodes, optimalSize, );
}
() {
currentLatency = performanceMetrics.;
targetLatency = performanceMetrics..;
latencyCurve = .(activeNodes);
minViableQuorum = .(activeNodes. / ) + ;
( size = minViableQuorum; size <= activeNodes.; size++) {
projectedLatency = .(size, latencyCurve);
(projectedLatency <= targetLatency) {
.(activeNodes, size, );
}
}
.();
.(activeNodes, minViableQuorum, );
}
() {
nodeScores = ();
( node availableNodes) {
score = ;
(optimizationTarget === ) {
score = .(node);
} (optimizationTarget === ) {
score = .(node);
}
nodeScores.(node., score);
}
sortedNodes = availableNodes.(
nodeScores.(b.) - nodeScores.(a.)
);
selectedNodes = ();
( i = ; i < .(targetSize, sortedNodes.); i++) {
node = sortedNodes[i];
selectedNodes.(node., {
: .(node, nodeScores.(node.)),
: nodeScores.(node.),
: i === ? : ,
: optimizationTarget
});
}
{
: selectedNodes,
: .(selectedNodes.())
.( sum + node., ),
: optimizationTarget
};
}
() {
score = ;
cpuCapacity = .(node);
score += (cpuCapacity / ) * ;
bandwidth = .(node);
score += (bandwidth / ) * ;
memory = .(node);
score += (memory / ) * ;
historicalPerformance = .(node);
score += (historicalPerformance / ) * ;
.(, score);
}
() {
score = ;
avgLatency = .(node);
score -= (avgLatency / );
cpuLoad = .(node);
score -= (cpuLoad / );
geoLatency = .(node);
score -= (geoLatency / );
consistencyScore = .(node);
score *= consistencyScore;
.(, score);
}
}
class FaultToleranceStrategy {
constructor() {
this.faultAnalyzer = new FaultAnalyzer();
this.reliabilityCalculator = new ReliabilityCalculator();
this.redundancyOptimizer = new RedundancyOptimizer();
}
async calculateQuorum(analysisInput) {
const { membershipStatus, faultToleranceRequirements, networkConditions } = analysisInput;
// Analyze fault scenarios
const faultScenarios = await this.analyzeFaultScenarios(
membershipStatus.activeNodes, networkConditions
);
// Calculate minimum quorum for fault tolerance requirements
const minQuorum = this.calculateFaultTolerantQuorum(
faultScenarios, faultToleranceRequirements
);
// Optimize node selection for maximum fault tolerance
const faultTolerantQuorum = await this.optimizeForFaultTolerance(
membershipStatus.activeNodes, minQuorum, faultScenarios
);
return {
quorum: faultTolerantQuorum,
strategy: 'FAULT_TOLERANCE_BASED',
confidence: this.(faultScenarios),
: .(
faultTolerantQuorum, faultScenarios, faultToleranceRequirements
),
: {
: .(faultTolerantQuorum),
: .(faultTolerantQuorum)
}
};
}
() {
scenarios = [];
( node activeNodes) {
scenario = .(node, activeNodes, networkConditions);
scenarios.(scenario);
}
multiFailureScenarios = .(
activeNodes, networkConditions
);
scenarios.(...multiFailureScenarios);
partitionScenarios = .(
activeNodes, networkConditions
);
scenarios.(...partitionScenarios);
correlatedFailureScenarios = .(
activeNodes, networkConditions
);
scenarios.(...correlatedFailureScenarios);
.(scenarios);
}
() {
maxRequiredQuorum = ;
( scenario faultScenarios) {
(scenario. >= requirements.) {
requiredQuorum = .(scenario, requirements);
maxRequiredQuorum = .(maxRequiredQuorum, requiredQuorum);
}
}
maxRequiredQuorum;
}
() {
totalNodes = scenario.;
failedNodes = scenario.;
availableNodes = totalNodes - failedNodes;
(requirements.) {
maxByzantineNodes = .((totalNodes - ) / );
.( * totalNodes / ) + ;
}
.(availableNodes / ) + ;
}
() {
optimizedQuorum = {
: (),
: ,
: {
: ,
: ,
:
}
};
nodeScores = .(
activeNodes, faultScenarios
);
selectedNodes = .(
activeNodes, minQuorum, nodeScores, faultScenarios
);
( [nodeId, nodeData] selectedNodes) {
optimizedQuorum..(nodeId, {
: nodeData.,
: nodeData.,
: nodeData.,
: nodeData.
});
optimizedQuorum. += nodeData.;
}
optimizedQuorum. = .(
selectedNodes, faultScenarios
);
optimizedQuorum;
}
() {
scores = ();
( node activeNodes) {
score = ;
independenceScore = .(node, activeNodes);
score += independenceScore * ;
reliabilityScore = .(node);
score += reliabilityScore * ;
diversityScore = .(node, activeNodes);
score += diversityScore * ;
recoveryScore = .(node);
score += recoveryScore * ;
scores.(node., score);
}
scores;
}
() {
selectedNodes = ();
remainingNodes = [...activeNodes];
(selectedNodes. < minQuorum && remainingNodes. > ) {
bestNode = ;
bestScore = -;
bestIndex = -;
( i = ; i < remainingNodes.; i++) {
node = remainingNodes[i];
additionalCoverage = .(
node, selectedNodes, faultScenarios
);
combinedScore = nodeScores.(node.) + (additionalCoverage * );
(combinedScore > bestScore) {
bestScore = combinedScore;
bestNode = node;
bestIndex = i;
}
}
(bestNode) {
selectedNodes.(bestNode., {
: .(bestNode, nodeScores.(bestNode.)),
: nodeScores.(bestNode.),
: selectedNodes. === ? : ,
: .(bestNode)
});
remainingNodes.(bestIndex, );
} {
;
}
}
selectedNodes;
}
}
// Store quorum configuration and history
await this.mcpTools.memory_usage({
action: 'store',
key: `quorum_config_${this.nodeId}`,
value: JSON.stringify({
currentQuorum: Array.from(this.currentQuorum.entries()),
strategy: this.activeStrategy,
networkConditions: this.lastNetworkAnalysis,
adjustmentHistory: this.quorumHistory.slice(-10)
}),
namespace: 'quorum_management',
ttl: 3600000 // 1 hour
});
// Coordinate with swarm for membership changes
const swarmStatus = await this.mcpTools.swarm_status({
swarmId: this.swarmId
});
await this.mcpTools.coordination_sync({
swarmId: this.
});
// Track quorum adjustment performance
await this.mcpTools.metrics_collect({
components: [
'quorum_adjustment_latency',
'consensus_availability',
'fault_tolerance_coverage',
'network_partition_recovery_time'
]
});
// Neural learning for quorum optimization
await this.mcpTools.neural_patterns({
action: 'learn',
operation: 'quorum_optimization',
outcome: JSON.stringify({
adjustmentType: adjustment.strategy,
performanceImpact: measurementResults,
networkConditions: currentNetworkState,
faultToleranceImprovement: faultToleranceMetrics
})
});
// Orchestrate complex quorum adjustments
await this.mcpTools.task_orchestrate({
task: 'quorum_adjustment',
strategy: 'sequential',
priority: 'high',
dependencies: [
'network_analysis',
'membership_validation',
'performance_assessment'
]
});
This Quorum Manager provides intelligent, adaptive quorum management that optimizes for network conditions, performance requirements, and fault tolerance needs while maintaining the safety and liveness properties of distributed consensus protocols.