Debugging and Inspection
Debug Flags
Review Pipeline Stages
Debug flags identify which stage has already been checked and which stage still needs review.
Program
Play the script to choose a stage and see its inspection status.
debug_flags.R
Replay: real traced execution (multi-file project)
stage_index <- 2
stages <- c("parse", "clean", "render")
checked <- c(TRUE, FALSE, TRUE)
stage <- stages[stage_index]
status <- ifelse(checked[stage_index], "checked", "review")
label <- paste(stage, status, sep = ":")
cat(label, "\n", sep = "")
stage_index <- 1
stages <- c("parse", "clean", "render")
checked <- c(TRUE, FALSE, TRUE)
stage <- stages[stage_index]
status <- ifelse(checked[stage_index], "checked", "review")
label <- paste(stage, status, sep = ":")
cat(label, "\n", sep = "")
stage_index <- 3
stages <- c("parse", "clean", "render")
checked <- c(TRUE, FALSE, TRUE)
stage <- stages[stage_index]
status <- ifelse(checked[stage_index], "checked", "review")
label <- paste(stage, status, sep = ":")
cat(label, "\n", sep = "")
stage_index ← 2
1stage_index <- 22stages <- c("parse", "clean", "render")values this step2stage_indexstages ← parse, clean, render
1stage_index <- 22stages <- c("parse", "clean", "render")3checked <- c(TRUE, FALSE, TRUE)values this stepparse, clean, renderstageschecked ← TRUE, FALSE, TRUE
2stages <- c("parse", "clean", "render")3checked <- c(TRUE, FALSE, TRUE)4stage <- stages[stage_index]values this stepTRUE, FALSE, TRUEcheckedstage ← clean
3checked <- c(TRUE, FALSE, TRUE)4stage <- stages[stage_index]5status <- ifelse(checked[stage_index], "checked", "review")values this stepcleanstage2stage_indexstatus ← review
4stage <- stages[stage_index]5status <- ifelse(checked[stage_index], "checked", "review")6label <- paste(stage, status, sep = ":")values this stepreviewstatus2stage_indexTRUE, FALSE, TRUEcheckedlabel ← clean:review
5status <- ifelse(checked[stage_index], "checked", "review")6label <- paste(stage, status, sep = ":")7cat(label, "\n", sep = "")values this stepclean:reviewlabelcleanstagereviewstatuscat(label, " ", sep = "")
6label <- paste(stage, status, sep = ":")7cat(label, "\n", sep = "")outputclean:reviewvalues this stepclean:reviewlabel
stage_index ← 1
1stage_index <- 12stages <- c("parse", "clean", "render")values this step1stage_indexstages ← parse, clean, render
1stage_index <- 12stages <- c("parse", "clean", "render")3checked <- c(TRUE, FALSE, TRUE)values this stepparse, clean, renderstageschecked ← TRUE, FALSE, TRUE
2stages <- c("parse", "clean", "render")3checked <- c(TRUE, FALSE, TRUE)4stage <- stages[stage_index]values this stepTRUE, FALSE, TRUEcheckedstage ← parse
3checked <- c(TRUE, FALSE, TRUE)4stage <- stages[stage_index]5status <- ifelse(checked[stage_index], "checked", "review")values this stepparsestage1stage_indexstatus ← checked
4stage <- stages[stage_index]5status <- ifelse(checked[stage_index], "checked", "review")6label <- paste(stage, status, sep = ":")values this stepcheckedstatus1stage_indexTRUE, FALSE, TRUEcheckedlabel ← parse:checked
5status <- ifelse(checked[stage_index], "checked", "review")6label <- paste(stage, status, sep = ":")7cat(label, "\n", sep = "")values this stepparse:checkedlabelparsestagecheckedstatuscat(label, " ", sep = "")
6label <- paste(stage, status, sep = ":")7cat(label, "\n", sep = "")outputparse:checkedvalues this stepparse:checkedlabel
stage_index ← 3
1stage_index <- 32stages <- c("parse", "clean", "render")values this step3stage_indexstages ← parse, clean, render
1stage_index <- 32stages <- c("parse", "clean", "render")3checked <- c(TRUE, FALSE, TRUE)values this stepparse, clean, renderstageschecked ← TRUE, FALSE, TRUE
2stages <- c("parse", "clean", "render")3checked <- c(TRUE, FALSE, TRUE)4stage <- stages[stage_index]values this stepTRUE, FALSE, TRUEcheckedstage ← render
3checked <- c(TRUE, FALSE, TRUE)4stage <- stages[stage_index]5status <- ifelse(checked[stage_index], "checked", "review")values this steprenderstage3stage_indexstatus ← checked
4stage <- stages[stage_index]5status <- ifelse(checked[stage_index], "checked", "review")6label <- paste(stage, status, sep = ":")values this stepcheckedstatus3stage_indexTRUE, FALSE, TRUEcheckedlabel ← render:checked
5status <- ifelse(checked[stage_index], "checked", "review")6label <- paste(stage, status, sep = ":")7cat(label, "\n", sep = "")values this steprender:checkedlabelrenderstagecheckedstatuscat(label, " ", sep = "")
6label <- paste(stage, status, sep = ":")7cat(label, "\n", sep = "")outputrender:checkedvalues this steprender:checkedlabel
stage list
A vector names the ordered stages being inspected.
debug flag
A logical vector stores whether each stage has been checked.
status label
Combining stage and status creates a compact debugging summary.