learning
learning
¶
Learning and pattern management commands for Marianne CLI.
This package implements commands for monitoring and managing the learning system. Originally a single 1673-line file, now split into focused modules:
- _patterns: Pattern listing and WHY analysis (patterns-list, patterns-why)
- _stats: Learning statistics, insights, activity (learning-stats, learning-insights, learning-activity)
- _drift: Drift detection (learning-drift, learning-epistemic-drift)
- _entropy: Entropy monitoring (patterns-entropy, entropy-status)
- _budget: Exploration budget (patterns-budget)
All commands are re-exported from this init.py for backward compatibility.
The import path from .commands.learning import ... continues to work unchanged.
Functions¶
patterns_budget
¶
patterns_budget(job=Option(None, '--job', '-j', help='Filter by specific job hash'), history=Option(False, '--history', '-H', help='Show budget adjustment history'), limit=Option(20, '--limit', '-n', help='Number of history records to show'), json_output=Option(False, '--json', help='Output as JSON for machine parsing'))
Display exploration budget status and history.
The budget adjusts based on pattern entropy: - Low entropy -> budget increases (boost) to inject diversity - Healthy entropy -> budget decays toward floor - Budget never drops below floor (default 5%)
Examples:
mzt patterns-budget # Show current budget status mzt patterns-budget --history # View budget adjustment history mzt patterns-budget --job abc123 # Filter by specific job mzt patterns-budget --json # JSON output for scripting
Source code in src/marianne/cli/commands/learning/_budget.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 | |
learning_drift
¶
learning_drift(threshold=Option(0.2, '--threshold', '-t', help='Drift threshold (0.0-1.0) to flag patterns'), window=Option(5, '--window', '-w', help='Window size for drift comparison'), limit=Option(10, '--limit', '-l', help='Maximum number of patterns to show'), json_output=Option(False, '--json', '-j', help='Output as JSON for machine parsing'), summary=Option(False, '--summary', '-s', help='Show only summary statistics'))
Detect patterns with effectiveness drift.
Drift is calculated by comparing the pattern's effectiveness in its last N applications vs the previous N applications.
Examples:
mzt learning-drift # Show drifting patterns mzt learning-drift -t 0.15 # Lower threshold (more sensitive) mzt learning-drift -w 10 # Larger comparison window mzt learning-drift --summary # Just show summary stats mzt learning-drift --json # JSON output for scripting
Source code in src/marianne/cli/commands/learning/_drift.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 | |
learning_epistemic_drift
¶
learning_epistemic_drift(threshold=Option(0.15, '--threshold', '-t', help='Epistemic drift threshold (0.0-1.0) to flag patterns'), window=Option(5, '--window', '-w', help='Window size for drift comparison'), limit=Option(10, '--limit', '-l', help='Maximum number of patterns to show'), json_output=Option(False, '--json', '-j', help='Output as JSON for machine parsing'), summary=Option(False, '--summary', '-s', help='Show only summary statistics'))
Detect patterns with epistemic drift (belief/confidence changes).
Epistemic drift tracks confidence changes over time, complementing effectiveness drift as a leading indicator of pattern health.
Examples:
mzt learning-epistemic-drift # Show patterns with belief drift mzt learning-epistemic-drift -t 0.1 # Lower threshold (more sensitive) mzt learning-epistemic-drift --summary # Just show summary stats mzt learning-epistemic-drift --json # JSON output for scripting
Source code in src/marianne/cli/commands/learning/_drift.py
160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 | |
entropy_status
¶
entropy_status(job=Option(None, '--job', '-j', help='Filter by specific job hash'), history=Option(False, '--history', '-H', help='Show entropy response history'), limit=Option(20, '--limit', '-n', help='Number of history records to show'), json_output=Option(False, '--json', help='Output as JSON for machine parsing'), check=Option(False, '--check', '-c', help='Check if entropy response is needed (dry-run)'))
Display entropy response status and history.
When pattern entropy drops below threshold, the system automatically: - Boosts the exploration budget to encourage diversity - Revisits quarantined patterns for potential revalidation
Examples:
marianne entropy-status # Show current entropy response status marianne entropy-status --history # View response history marianne entropy-status --check # Check if response is needed now marianne entropy-status --json # JSON output for scripting
Source code in src/marianne/cli/commands/learning/_entropy.py
203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 | |
patterns_entropy
¶
patterns_entropy(alert_threshold=Option(0.5, '--threshold', '-t', help='Diversity index below this triggers alert (0.0-1.0)'), history=Option(False, '--history', '-H', help='Show entropy history over time'), limit=Option(20, '--limit', '-n', help='Number of history records to show'), json_output=Option(False, '--json', '-j', help='Output as JSON for machine parsing'), record=Option(False, '--record', '-r', help='Record current entropy to history'))
Monitor pattern population diversity using Shannon entropy.
Shannon entropy measures how evenly patterns are used: - High entropy (H -> max): Healthy diversity, many patterns contribute - Low entropy (H -> 0): Single pattern dominates (collapse risk)
Examples:
mzt patterns-entropy # Show current entropy metrics mzt patterns-entropy --threshold 0.3 # Alert on low diversity mzt patterns-entropy --history # View entropy trend over time mzt patterns-entropy --record # Record snapshot for trend analysis mzt patterns-entropy --json # JSON output for scripting
Source code in src/marianne/cli/commands/learning/_entropy.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 | |
learning_export
¶
learning_export(output_dir='./learning-export', fmt='markdown', since=30, include_pending=True, min_effectiveness=0.0)
Export learning store data to workspace files.
Writes structured files for consumption by evolution scores: semantic-insights, drift-report, entropy-state, pattern-health, evolution-history, error-landscape.
Examples:
mzt learning-export --output-dir ./workspace/learning mzt learning-export --format json --since 60 mzt learning-export --min-effectiveness 0.6 --no-include-pending
Source code in src/marianne/cli/commands/learning/_export.py
261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 | |
learning_record_evolution
¶
learning_record_evolution(cycle=..., evolutions_completed=..., issue_classes=..., implementation_loc=..., test_loc=..., evolutions_deferred=0, cv_avg=0.0, loc_accuracy=1.0, notes='')
Record an evolution cycle in the trajectory table.
Examples:
mzt learning-record-evolution --cycle 26 \ --evolutions-completed 2 \ --issue-classes "infrastructure_activation,testing_depth" \ --implementation-loc 150 --test-loc 200
Source code in src/marianne/cli/commands/learning/_export.py
patterns_list
¶
patterns_list(global_patterns=Option(True, '--global/--local', '-g/-l', help='Show global patterns (default) or local workspace patterns'), min_priority=Option(0.0, '--min-priority', '-p', help='Minimum priority score to display (0.0-1.0)'), limit=Option(20, '--limit', '-n', help='Maximum number of patterns to display'), json_output=Option(False, '--json', '-j', help='Output as JSON for machine parsing'), quarantined=Option(False, '--quarantined', '-q', help='Show only quarantined patterns'), high_trust=Option(False, '--high-trust', help='Show only patterns with trust >= 0.7'), low_trust=Option(False, '--low-trust', help='Show only patterns with trust <= 0.3'))
View global learning patterns.
Displays patterns learned from job executions across all workspaces.
Examples:
mzt patterns-list # Show global patterns mzt patterns-list --min-priority 0.5 # Only high-priority patterns mzt patterns-list --json # JSON output for scripting mzt patterns-list --quarantined # Show quarantined patterns mzt patterns-list --high-trust # Show trusted patterns only
Source code in src/marianne/cli/commands/learning/_patterns.py
194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 | |
patterns_why
¶
patterns_why(pattern_id=Argument(None, help="Pattern ID to analyze (first 10 chars from 'patterns' command). If omitted, shows all patterns with captured success factors."), min_observations=Option(1, '--min-obs', '-m', help='Minimum success factor observations required'), limit=Option(10, '--limit', '-n', help='Maximum number of patterns to display'), json_output=Option(False, '--json', '-j', help='Output as JSON for machine parsing'))
Analyze WHY patterns succeed with metacognitive insights.
Shows success factors - the context conditions that contribute to pattern effectiveness. This helps understand CAUSALITY behind patterns, not just correlation.
v22 Evolution: Metacognitive Pattern Reflection
Examples:
mzt patterns-why # Show all patterns with WHY analysis mzt patterns-why abc123 # Analyze specific pattern mzt patterns-why --min-obs 3 # Only patterns with 3+ observations mzt patterns-why --json # JSON output for scripting
Source code in src/marianne/cli/commands/learning/_patterns.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 | |
learning_activity
¶
learning_activity(hours=Option(24, '--hours', '-h', help='Show activity from the last N hours'), json_output=Option(False, '--json', '-j', help='Output as JSON for machine parsing'))
View recent learning activity and pattern applications.
Examples:
mzt learning-activity # Last 24 hours of activity mzt learning-activity -h 48 # Last 48 hours mzt learning-activity --json # JSON output
Source code in src/marianne/cli/commands/learning/_stats.py
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 | |
learning_insights
¶
Show actionable insights from learning data.
Displays patterns extracted from execution history including: - Output patterns (from stdout/stderr analysis) - Error code patterns (aggregated error statistics) - Success predictors (factors that correlate with success)
Examples:
mzt learning-insights mzt learning-insights --pattern-type output_pattern mzt learning-insights --limit 20
Source code in src/marianne/cli/commands/learning/_stats.py
learning_stats
¶
learning_stats(json_output=Option(False, '--json', '-j', help='Output as JSON for machine parsing'))
View global learning statistics.
Shows summary statistics about the global learning store including execution counts, pattern counts, and effectiveness metrics.
Examples:
mzt learning-stats # Human-readable summary mzt learning-stats --json # JSON output for scripting