rendering
rendering
¶
Rendering preview engine for enhanced validation.
Generates previews of how sheets will be rendered at execution time,
including expanded prompts, validation paths, and fan-out metadata.
Used by mzt validate to show what each sheet will look like
before actually running the job.
Attributes¶
Classes¶
ExpandedValidation
dataclass
¶
ExpandedValidation(index, type, description, raw_path, expanded_path, pattern, condition, applicable, field_path=None, expected_value=None, source_path=None, source_field_path=None, sha256=None, key_field=None)
A single validation rule with expanded paths and applicability.
SheetPreview
dataclass
¶
SheetPreview(sheet_num, item_range, rendered_prompt, prompt_snippet, expanded_validations, stage, instance, fan_count, render_error)
Preview of a single sheet's rendered state.
RenderingPreview
dataclass
¶
Complete rendering preview for all sheets in a job.
Functions:¶
render_prompts_markdown
¶
The full rendered prompt of every sheet as one Markdown document.
Sheets whose rendered text is byte-identical share one section headed by all their numbers (a 1,797-sheet score has ~48 distinct prompts: fan-out voices and loop iterations render alike). A sheet that failed to render gets its error instead of a prompt. Order is by first sheet number.
Source code in src/marianne/validation/rendering.py
generate_preview
¶
Generate a rendering preview for all sheets in a job.
Builds each sheet's context, renders its prompt, expands validation paths, and evaluates condition applicability — all without executing anything.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
JobConfig
|
Parsed job configuration. |
required |
config_path
|
Path
|
Path to the YAML config file (for relative path resolution). |
required |
max_sheets
|
int | None
|
Cap the number of sheets to preview. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
A |
RenderingPreview
|
class: |
Source code in src/marianne/validation/rendering.py
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 | |