How this skill is triggered — by the user, by Claude, or both
Slash command
/dsg-governance:dsg-ising-optimizationThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
**Status:** ✅ Governance-enabled
Status: ✅ Governance-enabled
Solver: Simulated Annealing (Ising Model)
Decision Flow: PLAN → GATE → OPTIMIZE → VERIFY → EXECUTE
Proof System: Z3 + Ising Energy Minimization
The DSG Ising Optimization Skill solves constraint satisfaction and combinatorial optimization problems using the Ising model with simulated annealing. It combines:
Best for: Resource allocation, configuration optimization, scheduling, combinatorial problems where SAT/SMT solvers are too slow.
1. PLAN
├─ Extract optimization problem
├─ Identify constraints (hard/soft)
└─ Set solver parameters (temperature, cooling rate)
2. GATE
├─ Call deterministic governance gate
├─ Verify problem specification
└─ Generate governance proof
3. OPTIMIZE
├─ Run Ising/simulated annealing solver
├─ Minimize energy function
└─ Track best solution found
4. VERIFY
├─ Check constraint satisfaction
├─ Evaluate optimality (OPTIMAL / FEASIBLE / INFEASIBLE)
└─ Generate proof hash
5. EXECUTE
└─ Return decision + solution + metrics
interface IsingOptimizationInput {
jobId: string; // Unique job identifier
workspaceId: string; // DSG workspace
problem: {
name: string; // Optimization problem name
variables: Record<string, boolean>; // Initial state
constraints: Array<{
id: string; // Constraint ID
type: 'hard' | 'soft'; // hard = must satisfy, soft = prefer
weight: number; // Penalty weight (hard: 1.0)
description: string; // Human-readable description
requiresSatisfaction: boolean; // If true, BLOCK if unsatisfied
}>;
};
config?: { // Solver configuration
maxIterations?: number; // Default: 5000
initialTemperature?: number; // Default: 1.0
coolingRate?: number; // Default: 0.995 (0 < rate < 1)
randomSeed?: number; // For reproducibility
timeout_ms?: number; // Default: 10000
};
mockState?: boolean; // Disable production decisions if true
}
interface IsingOptimizationResult {
ok: boolean; // Production decision (PASS + feasible)
jobId: string; // Echo of input jobId
optimizationStatus: 'OPTIMAL' | 'FEASIBLE' | 'INFEASIBLE';
solution: {
satisfiable: boolean; // At least one feasible solution found
variables: Array<{
name: string;
value: boolean; // Final spin value
}>;
energy: number; // Total constraint violation energy
violatedConstraints: string[]; // IDs of unsatisfied constraints
};
metrics: {
iterations: number; // Annealing iterations performed
finalTemperature: number; // Temperature at convergence
executionTimeMs: number; // Wall-clock time
solverVersion: string; // Solver identifier
};
governance: {
gateStatus: 'PASS' | 'REVIEW' | 'BLOCK';
proofHash: string; // Z3 governance proof
};
}
const result = await runIsingOptimization({
jobId: 'alloc-2026-001',
workspaceId: 'dsg-control-plane',
problem: {
name: 'GPU Cluster Allocation',
variables: {
node_1: true,
node_2: false,
node_3: true,
node_4: false,
},
constraints: [
{
id: 'total_power',
type: 'hard',
weight: 1.0,
description: 'Total power draw < 2000W',
requiresSatisfaction: true,
},
{
id: 'min_availability',
type: 'hard',
weight: 1.0,
description: 'At least 2 nodes online',
requiresSatisfaction: true,
},
{
id: 'cost_minimize',
type: 'soft',
weight: 0.1,
description: 'Prefer fewer running nodes',
requiresSatisfaction: false,
},
],
},
config: {
maxIterations: 10000,
initialTemperature: 2.0,
coolingRate: 0.99,
},
});
// Result:
// {
// ok: true,
// optimizationStatus: 'OPTIMAL',
// solution: {
// satisfiable: true,
// variables: [
// { name: 'node_1', value: true },
// { name: 'node_2', value: false },
// { name: 'node_3', value: true },
// { name: 'node_4', value: false },
// ],
// energy: 0,
// violatedConstraints: [],
// },
// metrics: {
// iterations: 3421,
// finalTemperature: 0.087,
// executionTimeMs: 234,
// solverVersion: 'ising-simulated-annealing-v1',
// },
// governance: {
// gateStatus: 'PASS',
// proofHash: 'a1b2c3d4...',
// },
// }
const result = await runIsingOptimization({
jobId: 'sched-2026-042',
workspaceId: 'dsg-control-plane',
problem: {
name: 'Agent Task Scheduling',
variables: {
task_1_slot_0: true,
task_1_slot_1: false,
task_2_slot_0: false,
task_2_slot_1: true,
task_3_slot_0: true,
task_3_slot_1: false,
},
constraints: [
{
id: 'no_overlap',
type: 'hard',
weight: 1.0,
description: 'No task runs in two slots',
requiresSatisfaction: true,
},
{
id: 'all_assigned',
type: 'hard',
weight: 1.0,
description: 'Every task assigned to exactly one slot',
requiresSatisfaction: true,
},
{
id: 'load_balance',
type: 'soft',
weight: 0.5,
description: 'Prefer even slot load',
requiresSatisfaction: false,
},
],
},
});
// Result may show:
// optimizationStatus: 'FEASIBLE' (hard constraints met, soft violated)
// solution.energy: 0.5 (one soft constraint penalty)
// solution.violatedConstraints: [] (no hard violations)
// governance.gateStatus: 'REVIEW' (feasible but not optimal)
const result = await runIsingOptimization({
jobId: 'infeas-2026-999',
workspaceId: 'dsg-control-plane',
problem: {
name: 'Impossible Coloring',
variables: { v1: true, v2: false, v3: true },
constraints: [
{
id: 'edge_12',
type: 'hard',
weight: 1.0,
description: 'v1 and v2 must differ',
requiresSatisfaction: true,
},
{
id: 'edge_23',
type: 'hard',
weight: 1.0,
description: 'v2 and v3 must differ',
requiresSatisfaction: true,
},
{
id: 'edge_31',
type: 'hard',
weight: 1.0,
description: 'v3 and v1 must differ',
requiresSatisfaction: true,
},
{
id: 'all_true',
type: 'hard',
weight: 1.0,
description: 'All variables must be true',
requiresSatisfaction: true,
},
],
},
});
// Result:
// optimizationStatus: 'INFEASIBLE'
// solution.satisfiable: false
// governance.gateStatus: 'BLOCK'
Hard constraints (type: 'hard', weight = 1.0):
FEASIBLE or INFEASIBLErequiresSatisfaction: true, violation → BLOCKSoft constraints (type: 'soft', weight < 1.0):
The solver uses simulated annealing:
temperature_t = initialTemperature × (coolingRate ^ t)
- Higher initial temperature: explore more (risk: slow convergence)
- Faster cooling (coolingRate near 1.0): faster convergence (risk: local minima)
- Slower cooling (coolingRate like 0.99): better quality (risk: slower)
Recommendation: Start with initialTemperature: 1.0, coolingRate: 0.995 for medium problems.
Exit when:
- iteration count >= maxIterations, OR
- elapsed time >= timeout_ms
Whichever comes first. Default: 5000 iterations, 10000 ms timeout.
Gate Decision Logic:
IF gateResult.pass == false
→ gateStatus = 'BLOCK'
ELSE IF optimizationStatus == 'OPTIMAL'
→ gateStatus = 'PASS'
ELSE IF optimizationStatus == 'FEASIBLE'
→ gateStatus = 'REVIEW'
ELSE
→ gateStatus = 'BLOCK'
Production Readiness:
ok = !mockState AND gateStatus == 'PASS' AND optimizationStatus == 'OPTIMAL'
| Aspect | Ising | Z3 | Formal Verification |
|---|---|---|---|
| Type | Optimization | SMT/SAT | Constraint proof |
| Speed | Fast (heuristic) | Slow (exact) | Medium (proof-based) |
| Optimality | Approximate | Exact | Proven properties |
| Best For | Large combinatorial | Small precise | Policy validation |
| Hard Timeout | Yes (always completes) | May timeout | May timeout |
| Use Case | Resource allocation | Scheduling | Governance policy |
Benchmarks (10k variable problem):
| Metric | Time | Notes |
|---|---|---|
| Initialization | ~5 ms | Build energy function |
| Annealing (5000 iter) | ~200 ms | LCG random number gen |
| Convergence | Varies | Depends on constraint complexity |
| Final energy calc | ~2 ms | Verify solution |
Memory:
# Via Claude Code CLI
/dsg-ising-optimization <problem-description>
# Via Skill tool
Skill("dsg-ising-optimization", "jobId: alloc-001, name: Resource Allocation, ...")
# Programmatic
import { runIsingOptimization } from '@/skills/dsg-ising-optimization/skill';
const result = await runIsingOptimization(input);
randomSeed for deterministic results❌ Mistake: Confusing hard/soft constraint weights
✅ Fix: Hard constraints always weight = 1.0, only soft constraints use < 1.0
❌ Mistake: Expecting OPTIMAL for NP-hard problems with 1000+ variables
✅ Fix: Accept FEASIBLE status for large problems, increase iterations/temperature if needed
❌ Mistake: Not setting timeout for production
✅ Fix: Always specify config.timeout_ms (default 10000 ms is safe)
❌ Mistake: Assuming energy = 0 means OPTIMAL
✅ Fix: Check optimizationStatus field, not just energy
L1 (Unit): Test individual constraint satisfaction functions
L2 (Integration): Test solver with known problems (graph coloring, scheduling)
L3 (Adversarial): Test impossible problems, timeout conditions
L4 (Mutation): Mutation testing of energy calculation and annealing loop
L5 (Provenance): Signed proof from Z3 gate + audit trail
Reference: docs/CLAIM_EVIDENCE_STANDARD.md, docs/ISING_SOLVER_GUIDE.md
lib/ising/gpu-acceleration.ts)Last Updated: 2026-07-23
Status: ✅ Governance-enabled, production-ready, audit-ready
npx claudepluginhub tdealer01-crypto/tdealer01-crypto-dsg-control-plane --plugin dsg-governanceVerify deterministic gates and governance policies using hybrid Ising + Z3 formal solver pipeline. Use this skill whenever you need to: verify policy constraints formally, generate deterministic proofs for audit trails, detect violations and counterexamples, integrate formal proofs into CCVS evidence pipeline, or validate gate decisions using Z3 SMT solver. The skill coordinates a three-stage verification workflow: (1) Ising solver finds safe assignments matching policy requirements, (2) Agent processes results in parallel, (3) Z3 performs formal verification to detect violations. Triggers on: "verify policy", "formal proof", "check constraint", "Z3", "gate verification", "proof generation", "violation detection", "CCVS evidence", "deterministic proof", "counterexample", "satisfiability".
Formulates and solves optimization problems — defining decision variables, objective functions, and constraints — and selects appropriate solvers for LP, QP, NLP, or MIP.
Provides guidelines for using NVIDIA cuOpt SDK: routing, LP/MILP/QP, installation, and server deployment. Activates when users need help calling cuOpt APIs or setting up the solver.