[{"data":1,"prerenderedAt":1608,"buildId":1609},["ShallowReactive",2],{"docs:\u002Fguide\u002Ffailures":3},{"page":4,"section":16,"document":17,"credits":10,"prev":1604,"next":1606},{"id":5,"path":6,"file":7,"title":8,"sourceTitle":8,"description":9,"tagline":9,"eyebrow":10,"credits":10,"keywords":11,"icon":12,"layout":13,"sidebar":14,"toc":14,"kind":10,"group":10,"navigation":14,"order":15},"failures","\u002Fguide\u002Ffailures","guide\u002Ffailures.md","Failures and exit codes","The Failure envelope, failure(), actionRequired(), FailureError, toFailure and out.fail, readerly's exit codes, and how each format prints a failure.",null,[],"i-lucide-circle-x","article",true,11,"guide",{"nodes":18,"toc":1594},[19,28,36,133,159,165,372,464,489,495,529,543,911,935,945,978,990,996,1007,1021,1027,1033,1243,1280,1294,1303,1310,1361,1367,1380,1404,1407,1431,1468,1474,1498,1512,1523,1529,1535,1571,1587],[20,21,22,23,27],"p",{},"A failure is a run that stopped before it could report findings: bad flags, a broken config, a missing input or a thrown error. readerly turns each one into a ",[24,25,26],"code",{},"Failure"," and prints it in the reader's format, with an exit code that says what to do next.",[29,30,35],"h2",{"id":31,"anchor":32},"exit-codes",{"label":33,"icon":34},"Section titled \"Exit codes\"","#","Exit codes",[37,38,39,55],"table",{},[40,41,42],"thead",{},[43,44,45,49,52],"tr",{},[46,47,48],"th",{},"Code",[46,50,51],{},"Meaning",[46,53,54],{},"Comes from",[56,57,58,77,98,118],"tbody",{},[43,59,60,66,69],{},[61,62,63],"td",{},[24,64,65],{},"0",[61,67,68],{},"ok",[61,70,71,74,75],{},[24,72,73],{},"out.end()"," with status ",[24,76,68],{},[43,78,79,84,87],{},[61,80,81],{},[24,82,83],{},"1",[61,85,86],{},"failed",[61,88,89,90,93,94,97],{},"errors in the run, a ",[24,91,92],{},"config"," or ",[24,95,96],{},"runtime"," failure",[43,99,100,105,108],{},[61,101,102],{},[24,103,104],{},"2",[61,106,107],{},"change the invocation",[61,109,110,111,114,115],{},"a ",[24,112,113],{},"usage"," failure or ",[24,116,117],{},"action_required",[43,119,120,125,128],{},[61,121,122],{},[24,123,124],{},"3+",[61,126,127],{},"your tool's own",[61,129,130],{},[24,131,132],{},"failure(kind, message, { exitCode })",[20,134,135,138,139,142,143,146,147,150,151,154,155,158],{},[24,136,137],{},"exitCodes"," from ",[24,140,141],{},"readerly\u002Fenvelope"," holds the first three as ",[24,144,145],{},"{ ok: 0, failed: 1, usage: 2 }",". Code 2 means the caller has to change the command, because running it again as is gives the same result. An agent reads the ",[24,148,149],{},"fix:",", ",[24,152,153],{},"missing:"," and ",[24,156,157],{},"rerun:"," lines and changes the command.",[29,160,164],{"id":161,"anchor":162},"the-failure-envelope",{"label":163,"icon":34},"Section titled \"The Failure envelope\"","The Failure envelope",[166,167,171],"pre",{"language":168,"filename":169,"class":170,"wrap":14},"ts","types.ts","shiki shiki-themes github-light-default github-dark-default dark:github-dark-default",[24,172,174,214,215,214,217,214,228,214,242,214,254,214,266,214,278,214,343,214,356,214,367],{"class":173},"language-ts",[175,176,179,183,187,190,194,197,200,202,205,207,210],"span",{"class":177,"style":178},"line","display: inline",[175,180,182],{"style":181},"color:#CF222E;--shiki-dark:#FF7B72","type",[175,184,186],{"style":185},"color:#953800;--shiki-dark:#FFA657"," FailureKind",[175,188,189],{"style":181}," =",[175,191,193],{"style":192},"color:#0A3069;--shiki-dark:#A5D6FF"," \"usage\"",[175,195,196],{"style":181}," |",[175,198,199],{"style":192}," \"config\"",[175,201,196],{"style":181},[175,203,204],{"style":192}," \"runtime\"",[175,206,196],{"style":181},[175,208,209],{"style":192}," \"action_required\"",[175,211,213],{"style":212},"color:#1F2328;--shiki-dark:#E6EDF3",";","\n",[175,216],{"class":177,"style":178},[175,218,219,222,225],{"class":177,"style":178},[175,220,221],{"style":181},"interface",[175,223,224],{"style":185}," Failure",[175,226,227],{"style":212}," {",[175,229,230,233,236,240],{"class":177,"style":178},[175,231,232],{"style":185},"  schema",[175,234,235],{"style":181},"?:",[175,237,239],{"style":238},"color:#0550AE;--shiki-dark:#79C0FF"," string",[175,241,213],{"style":212},[175,243,244,247,250,252],{"class":177,"style":178},[175,245,246],{"style":185},"  kind",[175,248,249],{"style":181},":",[175,251,186],{"style":185},[175,253,213],{"style":212},[175,255,256,259,261,264],{"class":177,"style":178},[175,257,258],{"style":185},"  status",[175,260,249],{"style":181},[175,262,263],{"style":185}," Status",[175,265,213],{"style":212},[175,267,268,271,273,276],{"class":177,"style":178},[175,269,270],{"style":185},"  exitCode",[175,272,249],{"style":181},[175,274,275],{"style":238}," number",[175,277,213],{"style":212},[175,279,280,283,285,288,290,292,294,297,300,302,304,306,309,311,313,315,318,320,322,324,327,329,331,333,336,338,340],{"class":177,"style":178},[175,281,282],{"style":185},"  error",[175,284,249],{"style":181},[175,286,287],{"style":212}," { ",[175,289,24],{"style":185},[175,291,235],{"style":181},[175,293,239],{"style":238},[175,295,296],{"style":212},"; ",[175,298,299],{"style":185},"message",[175,301,249],{"style":181},[175,303,239],{"style":238},[175,305,296],{"style":212},[175,307,308],{"style":185},"why",[175,310,235],{"style":181},[175,312,239],{"style":238},[175,314,296],{"style":212},[175,316,317],{"style":185},"fix",[175,319,235],{"style":181},[175,321,239],{"style":238},[175,323,296],{"style":212},[175,325,326],{"style":185},"docs",[175,328,235],{"style":181},[175,330,239],{"style":238},[175,332,296],{"style":212},[175,334,335],{"style":185},"file",[175,337,235],{"style":181},[175,339,239],{"style":238},[175,341,342],{"style":212}," };",[175,344,345,348,350,353],{"class":177,"style":178},[175,346,347],{"style":185},"  missing",[175,349,235],{"style":181},[175,351,352],{"style":185}," Missing",[175,354,355],{"style":212},"[];",[175,357,358,361,363,365],{"class":177,"style":178},[175,359,360],{"style":185},"  rerun",[175,362,235],{"style":181},[175,364,239],{"style":238},[175,366,213],{"style":212},[175,368,369],{"class":177,"style":178},[175,370,371],{"style":212},"}",[37,373,374,394],{},[40,375,376],{},[43,377,378,381,384,389],{},[46,379,380],{},"Kind",[46,382,383],{},"For",[46,385,386],{},[24,387,388],{},"status",[46,390,391],{},[24,392,393],{},"exitCode",[56,395,396,413,430,447],{},[43,397,398,402,405,409],{},[61,399,400],{},[24,401,113],{},[61,403,404],{},"a bad flag or value",[61,406,407],{},[24,408,86],{},[61,410,411],{},[24,412,104],{},[43,414,415,419,422,426],{},[61,416,417],{},[24,418,92],{},[61,420,421],{},"a config file that can't be used",[61,423,424],{},[24,425,86],{},[61,427,428],{},[24,429,83],{},[43,431,432,436,439,443],{},[61,433,434],{},[24,435,96],{},[61,437,438],{},"anything that broke while running",[61,440,441],{},[24,442,86],{},[61,444,445],{},[24,446,83],{},[43,448,449,453,456,460],{},[61,450,451],{},[24,452,117],{},[61,454,455],{},"an input only the caller can give",[61,457,458],{},[24,459,117],{},[61,461,462],{},[24,463,104],{},[20,465,466,469,470,472,473,476,477,480,481,484,485,488],{},[24,467,468],{},"missing"," lists the inputs an ",[24,471,117],{}," failure needs, each as ",[24,474,475],{},"{ field, flag?, env?, choices? }",". ",[24,478,479],{},"rerun"," is the command to run instead. ",[24,482,483],{},"schema"," replaces the run's schema in ",[24,486,487],{},"json"," output.",[29,490,494],{"id":491,"anchor":492},"building-failures",{"label":493,"icon":34},"Section titled \"Building failures\"","Building failures",[20,496,497,500,501,476,503,506,507,150,509,150,511,150,513,150,515,517,518,150,520,150,522,150,524,154,526,528],{},[24,498,499],{},"failure(kind, message, extra?)"," returns a ",[24,502,26],{},[24,504,505],{},"extra"," takes the error fields (",[24,508,24],{},[24,510,308],{},[24,512,317],{},[24,514,326],{},[24,516,335],{},") and can override ",[24,519,483],{},[24,521,388],{},[24,523,393],{},[24,525,468],{},[24,527,479],{},".",[20,530,531,532,535,536,476,539,542],{},"To stop a command from deep inside it, throw a ",[24,533,534],{},"FailureError",", which carries the failure on ",[24,537,538],{},".failure",[24,540,541],{},"actionRequired(message, missing, extra?)"," returns one ready to throw.",[166,544,546],{"language":168,"filename":545,"class":170,"wrap":14},"build.ts",[24,547,548,214,564,214,578,214,580,214,622,214,650,214,657,214,673,214,692,214,706,214,719,214,737,214,748,214,758,214,768,214,778,214,788,214,793,214,798,214,803,214,814,214,841,214,851,214,856,214,860,214,866,214,879,214,890,214,902,214,907],{"class":173},[175,549,550,553,556,559,562],{"class":177,"style":178},[175,551,552],{"style":181},"import",[175,554,555],{"style":212}," { createOut } ",[175,557,558],{"style":181},"from",[175,560,561],{"style":192}," \"readerly\"",[175,563,213],{"style":212},[175,565,566,568,571,573,576],{"class":177,"style":178},[175,567,552],{"style":181},[175,569,570],{"style":212}," { FailureError, actionRequired, failure } ",[175,572,558],{"style":181},[175,574,575],{"style":192}," \"readerly\u002Fenvelope\"",[175,577,213],{"style":212},[175,579],{"class":177,"style":178},[175,581,582,585,588,591,595,598,601,603,605,608,610,613,616,619],{"class":177,"style":178},[175,583,584],{"style":181},"export",[175,586,587],{"style":181}," async",[175,589,590],{"style":181}," function",[175,592,594],{"style":593},"color:#8250DF;--shiki-dark:#D2A8FF"," build",[175,596,597],{"style":212},"(",[175,599,600],{"style":185},"argv",[175,602,249],{"style":181},[175,604,239],{"style":238},[175,606,607],{"style":212},"[])",[175,609,249],{"style":181},[175,611,612],{"style":185}," Promise",[175,614,615],{"style":212},"\u003C",[175,617,618],{"style":238},"number",[175,620,621],{"style":212},"> {",[175,623,624,627,630,632,635,638,641,644,647],{"class":177,"style":178},[175,625,626],{"style":181},"  const",[175,628,629],{"style":238}," out",[175,631,189],{"style":181},[175,633,634],{"style":593}," createOut",[175,636,637],{"style":212},"({ tool: ",[175,639,640],{"style":192},"\"acme\"",[175,642,643],{"style":212},", command: ",[175,645,646],{"style":192},"\"build\"",[175,648,649],{"style":212},", argv });",[175,651,652,655],{"class":177,"style":178},[175,653,654],{"style":181},"  try",[175,656,227],{"style":212},[175,658,659,662,665,667,670],{"class":177,"style":178},[175,660,661],{"style":212},"    out.",[175,663,664],{"style":593},"log",[175,666,597],{"style":212},[175,668,669],{"style":192},"\"Reading config\"",[175,671,672],{"style":212},");",[175,674,675,678,681,683,686,689],{"class":177,"style":178},[175,676,677],{"style":181},"    const",[175,679,680],{"style":238}," config",[175,682,189],{"style":181},[175,684,685],{"style":181}," await",[175,687,688],{"style":593}," loadConfig",[175,690,691],{"style":212},"();",[175,693,694,697,700,703],{"class":177,"style":178},[175,695,696],{"style":181},"    if",[175,698,699],{"style":212}," (",[175,701,702],{"style":181},"!",[175,704,705],{"style":212},"config.entry) {",[175,707,708,711,714,717],{"class":177,"style":178},[175,709,710],{"style":181},"      throw",[175,712,713],{"style":181}," new",[175,715,716],{"style":593}," FailureError",[175,718,597],{"style":212},[175,720,721,724,726,729,731,734],{"class":177,"style":178},[175,722,723],{"style":593},"        failure",[175,725,597],{"style":212},[175,727,728],{"style":192},"\"config\"",[175,730,150],{"style":212},[175,732,733],{"style":192},"\"acme.config.ts has no entry.\"",[175,735,736],{"style":212},", {",[175,738,739,742,745],{"class":177,"style":178},[175,740,741],{"style":212},"          code: ",[175,743,744],{"style":192},"\"ACME_CONFIG\"",[175,746,747],{"style":212},",",[175,749,750,753,756],{"class":177,"style":178},[175,751,752],{"style":212},"          why: ",[175,754,755],{"style":192},"\"The build needs one entry point\"",[175,757,747],{"style":212},[175,759,760,763,766],{"class":177,"style":178},[175,761,762],{"style":212},"          fix: ",[175,764,765],{"style":192},"'Add entry: \"src\u002Findex.ts\" to acme.config.ts'",[175,767,747],{"style":212},[175,769,770,773,776],{"class":177,"style":178},[175,771,772],{"style":212},"          docs: ",[175,774,775],{"style":192},"\"https:\u002F\u002Facme.dev\u002Fconfig#entry\"",[175,777,747],{"style":212},[175,779,780,783,786],{"class":177,"style":178},[175,781,782],{"style":212},"          file: ",[175,784,785],{"style":192},"\"acme.config.ts\"",[175,787,747],{"style":212},[175,789,790],{"class":177,"style":178},[175,791,792],{"style":212},"        }),",[175,794,795],{"class":177,"style":178},[175,796,797],{"style":212},"      );",[175,799,800],{"class":177,"style":178},[175,801,802],{"style":212},"    }",[175,804,805,807,809,811],{"class":177,"style":178},[175,806,696],{"style":181},[175,808,699],{"style":212},[175,810,702],{"style":181},[175,812,813],{"style":212},"config.target) {",[175,815,816,818,821,823,826,829,832,835,838],{"class":177,"style":178},[175,817,710],{"style":181},[175,819,820],{"style":593}," actionRequired",[175,822,597],{"style":212},[175,824,825],{"style":192},"\"Target is required.\"",[175,827,828],{"style":212},", [{ field: ",[175,830,831],{"style":192},"\"target\"",[175,833,834],{"style":212},", flag: ",[175,836,837],{"style":192},"\"--target\"",[175,839,840],{"style":212}," }], {",[175,842,843,846,849],{"class":177,"style":178},[175,844,845],{"style":212},"        rerun: ",[175,847,848],{"style":192},"\"acme build --target \u003Ctarget>\"",[175,850,747],{"style":212},[175,852,853],{"class":177,"style":178},[175,854,855],{"style":212},"      });",[175,857,858],{"class":177,"style":178},[175,859,802],{"style":212},[175,861,862],{"class":177,"style":178},[175,863,865],{"style":864},"color:#6E7781;--shiki-dark:#8B949E","    \u002F\u002F …",[175,867,868,871,874,877],{"class":177,"style":178},[175,869,870],{"style":181},"    return",[175,872,873],{"style":212}," out.",[175,875,876],{"style":593},"end",[175,878,691],{"style":212},[175,880,881,884,887],{"class":177,"style":178},[175,882,883],{"style":212},"  } ",[175,885,886],{"style":181},"catch",[175,888,889],{"style":212}," (error) {",[175,891,892,894,896,899],{"class":177,"style":178},[175,893,870],{"style":181},[175,895,873],{"style":212},[175,897,898],{"style":593},"fail",[175,900,901],{"style":212},"(error);",[175,903,904],{"class":177,"style":178},[175,905,906],{"style":212},"  }",[175,908,909],{"class":177,"style":178},[175,910,371],{"style":212},[20,912,913,916,917,154,920,923,924,926,927,929,930,528],{},[24,914,915],{},"out.fail(error)"," takes anything thrown, renders it and returns the exit code. Return that code from your command. ",[24,918,919],{},"out.ask",[24,921,922],{},"out.confirm"," throw ",[24,925,117],{}," and usage failures, so the same ",[24,928,886],{}," reports those too. See ",[931,932,934],"a",{"href":933},"\u002Fguide\u002Fprompts","Prompts and input",[20,936,937,940,941,944],{},[24,938,939],{},"toFailure(error)"," is the conversion ",[24,942,943],{},"out.fail"," uses:",[946,947,948,954,964],"ul",{},[949,950,110,951,953],"li",{},[24,952,534],{}," keeps its own failure,",[949,955,956,957,960,961,963],{},"an ",[24,958,959],{},"Error"," becomes ",[24,962,96],{}," with the error's message,",[949,965,966,967,969,970,973,974,977],{},"anything else becomes ",[24,968,96],{}," with ",[24,971,972],{},"String(value)"," as the message, or ",[24,975,976],{},"Unknown error."," when that throws.",[20,979,980,981,93,983,986,987],{},"Call ",[24,982,943],{},[24,984,985],{},"out.end"," once. A second call throws ",[24,988,989],{},"out.end or out.fail was already called.",[29,991,995],{"id":992,"anchor":993},"where-failures-go",{"label":994,"icon":34},"Section titled \"Where failures go\"","Where failures go",[20,997,998,999,1002,1003,1006],{},"In ",[24,1000,1001],{},"text",", a failure goes to stderr, so ",[24,1004,1005],{},"acme build > report.txt"," doesn't write it into the report. Logs already printed stay on stdout.",[20,1008,998,1009,150,1012,154,1014,1017,1018,1020],{},[24,1010,1011],{},"agent",[24,1013,487],{},[24,1015,1016],{},"jsonl",", the failure goes to stdout. A program that parses stdout gets one document either way, and ",[24,1019,388],{}," tells it which kind.",[29,1022,1026],{"id":1023,"anchor":1024},"how-each-format-prints-a-failure",{"label":1025,"icon":34},"Section titled \"How each format prints a failure\"","How each format prints a failure",[20,1028,1029,1030,1032],{},"The ",[24,1031,92],{}," failure from the example above, with exit code 1.",[1034,1035,1042,1070,1086,1217],"tabs",{"uid":1036,"count":1037,"labels":1038,"code":1040,"magic":1041},"ct-1e9k2za-1","4",[1039,1011,487,1016],"text (stderr)","true","auto",[1043,1044,1045],"tabs-item",{"label":1039,"index":83},[166,1046,1047],{"language":1001,"class":170,"wrap":14},[24,1048,1050,214,1055,214,1060,214,1065],{"class":1049},"language-text",[175,1051,1052],{"class":177,"style":178},[175,1053,1054],{},"✖ acme.config.ts has no entry.",[175,1056,1057],{"class":177,"style":178},[175,1058,1059],{},"├▶ why: The build needs one entry point",[175,1061,1062],{"class":177,"style":178},[175,1063,1064],{},"├▶ fix: Add entry: \"src\u002Findex.ts\" to acme.config.ts",[175,1066,1067],{"class":177,"style":178},[175,1068,1069],{},"╰▶ see: https:\u002F\u002Facme.dev\u002Fconfig#entry",[1043,1071,1072],{"label":1011,"index":104},[166,1073,1074],{"language":1001,"class":170,"wrap":14},[24,1075,1076,214,1081],{"class":1049},[175,1077,1078],{"class":177,"style":178},[175,1079,1080],{},"acme build: failed. acme.config.ts has no entry.",[175,1082,1083],{"class":177,"style":178},[175,1084,1085],{},"fix: Add entry: \"src\u002Findex.ts\" to acme.config.ts",[1043,1087,1089],{"label":487,"index":1088},"3",[166,1090,1091],{"language":487,"class":170,"wrap":14},[24,1092,1094,214,1099,214,1113,214,1125,214,1133,214,1144,214,1155,214,1178,214,1189,214,1200,214,1209,214,1213],{"class":1093},"language-json",[175,1095,1096],{"class":177,"style":178},[175,1097,1098],{"style":212},"{",[175,1100,1101,1105,1108,1111],{"class":177,"style":178},[175,1102,1104],{"style":1103},"color:#116329;--shiki-dark:#7EE787","  \"schema\"",[175,1106,1107],{"style":212},": ",[175,1109,1110],{"style":192},"\"acme.build\u002Fv1\"",[175,1112,747],{"style":212},[175,1114,1115,1118,1120,1123],{"class":177,"style":178},[175,1116,1117],{"style":1103},"  \"status\"",[175,1119,1107],{"style":212},[175,1121,1122],{"style":192},"\"failed\"",[175,1124,747],{"style":212},[175,1126,1127,1130],{"class":177,"style":178},[175,1128,1129],{"style":1103},"  \"error\"",[175,1131,1132],{"style":212},": {",[175,1134,1135,1138,1140,1142],{"class":177,"style":178},[175,1136,1137],{"style":1103},"    \"code\"",[175,1139,1107],{"style":212},[175,1141,744],{"style":192},[175,1143,747],{"style":212},[175,1145,1146,1149,1151,1153],{"class":177,"style":178},[175,1147,1148],{"style":1103},"    \"why\"",[175,1150,1107],{"style":212},[175,1152,755],{"style":192},[175,1154,747],{"style":212},[175,1156,1157,1160,1162,1165,1168,1171,1173,1176],{"class":177,"style":178},[175,1158,1159],{"style":1103},"    \"fix\"",[175,1161,1107],{"style":212},[175,1163,1164],{"style":192},"\"Add entry: ",[175,1166,1167],{"style":181},"\\\"",[175,1169,1170],{"style":192},"src\u002Findex.ts",[175,1172,1167],{"style":181},[175,1174,1175],{"style":192}," to acme.config.ts\"",[175,1177,747],{"style":212},[175,1179,1180,1183,1185,1187],{"class":177,"style":178},[175,1181,1182],{"style":1103},"    \"docs\"",[175,1184,1107],{"style":212},[175,1186,775],{"style":192},[175,1188,747],{"style":212},[175,1190,1191,1194,1196,1198],{"class":177,"style":178},[175,1192,1193],{"style":1103},"    \"file\"",[175,1195,1107],{"style":212},[175,1197,785],{"style":192},[175,1199,747],{"style":212},[175,1201,1202,1205,1207],{"class":177,"style":178},[175,1203,1204],{"style":1103},"    \"message\"",[175,1206,1107],{"style":212},[175,1208,733],{"style":192},[175,1210,1211],{"class":177,"style":178},[175,1212,906],{"style":212},[175,1214,1215],{"class":177,"style":178},[175,1216,371],{"style":212},[1043,1218,1219],{"label":1016,"index":1037},[166,1220,1221],{"language":1001,"class":170,"wrap":14},[24,1222,1223,214,1228,214,1233,214,1238],{"class":1049},[175,1224,1225],{"class":177,"style":178},[175,1226,1227],{},"{\"type\":\"version\",\"schema\":\"acme.build\u002Fv1\",\"tool\":\"acme\"}",[175,1229,1230],{"class":177,"style":178},[175,1231,1232],{},"{\"type\":\"log\",\"message\":\"Reading config\"}",[175,1234,1235],{"class":177,"style":178},[175,1236,1237],{},"{\"type\":\"error\",\"code\":\"ACME_CONFIG\",\"why\":\"The build needs one entry point\",\"fix\":\"Add entry: \\\"src\u002Findex.ts\\\" to acme.config.ts\",\"docs\":\"https:\u002F\u002Facme.dev\u002Fconfig#entry\",\"file\":\"acme.config.ts\",\"message\":\"acme.config.ts has no entry.\"}",[175,1239,1240],{"class":177,"style":178},[175,1241,1242],{},"{\"type\":\"result\",\"status\":\"failed\",\"message\":\"acme.config.ts has no entry.\",\"data\":{}}",[20,1244,1245,1246,154,1249,1252,1253,154,1255,1258,1259,1262,1263,1267,1268,1270,1271,1270,1273,1275,1276,93,1278,528],{},"The person at a terminal sees ",[24,1247,1248],{},"why:",[24,1250,1251],{},"see:"," every time. A coding agent gets ",[24,1254,1248],{},[24,1256,1257],{},"docs:"," only with ",[24,1260,1261],{},"--full",", and under a tight ",[931,1264,1266],{"href":1265},"\u002Fguide\u002Fbudget","budget"," readerly drops ",[24,1269,326],{},", then ",[24,1272,308],{},[24,1274,317],{},", but never the verdict, ",[24,1277,153],{},[24,1279,157],{},[20,1281,1282,1283,1286,1287,1289,1290,1293],{},"A thrown ",[24,1284,1285],{},"Error(\"ENOSPC: no space left on device\")"," is a ",[24,1288,96],{}," failure. A person at a terminal gets ",[24,1291,1292],{},"✖ ENOSPC: no space left on device"," on stderr, and a coding agent gets:",[166,1295,1296],{"language":1001,"class":170,"wrap":14},[24,1297,1298],{"class":1049},[175,1299,1300],{"class":177,"style":178},[175,1301,1302],{},"acme build: failed. ENOSPC: no space left on device.",[20,1304,1305,1306,1309],{},"With ",[24,1307,1308],{},"--json",", the document has the message only:",[166,1311,1312],{"language":487,"class":170,"wrap":14},[24,1313,1314,214,1318,214,1328,214,1338,214,1344,214,1353,214,1357],{"class":1093},[175,1315,1316],{"class":177,"style":178},[175,1317,1098],{"style":212},[175,1319,1320,1322,1324,1326],{"class":177,"style":178},[175,1321,1104],{"style":1103},[175,1323,1107],{"style":212},[175,1325,1110],{"style":192},[175,1327,747],{"style":212},[175,1329,1330,1332,1334,1336],{"class":177,"style":178},[175,1331,1117],{"style":1103},[175,1333,1107],{"style":212},[175,1335,1122],{"style":192},[175,1337,747],{"style":212},[175,1339,1340,1342],{"class":177,"style":178},[175,1341,1129],{"style":1103},[175,1343,1132],{"style":212},[175,1345,1346,1348,1350],{"class":177,"style":178},[175,1347,1204],{"style":1103},[175,1349,1107],{"style":212},[175,1351,1352],{"style":192},"\"ENOSPC: no space left on device\"",[175,1354,1355],{"class":177,"style":178},[175,1356,906],{"style":212},[175,1358,1359],{"class":177,"style":178},[175,1360,371],{"style":212},[29,1362,1366],{"id":1363,"anchor":1364},"action_required-in-every-format",{"label":1365,"icon":34},"Section titled \"action_required in every format\"","action_required in every format",[20,1368,1369,1375,1376,1379],{},[931,1370,1372],{"href":1371},"https:\u002F\u002Fgithub.com\u002Floadsheet\u002Freaderly\u002Fblob\u002Fmain\u002Ftest\u002Fgolden.test.ts",[24,1373,1374],{},"test\u002Fgolden.test.ts"," runs ",[24,1377,1378],{},"acme deploy --prod"," without an account, which exits with code 2. A person at a terminal gets this on stderr, with stdout empty:",[166,1381,1382],{"language":1001,"class":170,"wrap":14},[24,1383,1384,214,1389,214,1394,214,1399],{"class":1049},[175,1385,1386],{"class":177,"style":178},[175,1387,1388],{},"✖ Account is required.",[175,1390,1391],{"class":177,"style":178},[175,1392,1393],{},"├▶ fix: Pass --account.",[175,1395,1396],{"class":177,"style":178},[175,1397,1398],{},"├▶ missing: --account (ACME_ACCOUNT), one of personal, team",[175,1400,1401],{"class":177,"style":178},[175,1402,1403],{},"╰▶ rerun: acme deploy --prod --account \u003Caccount>",[20,1405,1406],{},"A coding agent gets the same lines on stdout, after a verdict:",[166,1408,1409],{"language":1001,"class":170,"wrap":14},[24,1410,1411,214,1416,214,1421,214,1426],{"class":1049},[175,1412,1413],{"class":177,"style":178},[175,1414,1415],{},"acme deploy: action required. Account is required.",[175,1417,1418],{"class":177,"style":178},[175,1419,1420],{},"fix: Pass --account.",[175,1422,1423],{"class":177,"style":178},[175,1424,1425],{},"missing: --account (ACME_ACCOUNT), one of personal, team",[175,1427,1428],{"class":177,"style":178},[175,1429,1430],{},"rerun: acme deploy --prod --account \u003Caccount>",[20,1432,1433,1435,1436,969,1439,150,1442,154,1444,476,1446,1448,1449,1452,1453,1455,1456,1459,1460,1463,1464,528],{},[24,1434,487],{}," prints ",[24,1437,1438],{},"status: \"action_required\"",[24,1440,1441],{},"error",[24,1443,468],{},[24,1445,479],{},[24,1447,1016],{}," prints a ",[24,1450,1451],{},"version"," record, an ",[24,1454,1441],{}," record with the same fields, and a ",[24,1457,1458],{},"result"," record with ",[24,1461,1462],{},"\"status\":\"action_required\"",". Both are on the ",[931,1465,1467],{"href":1466},"\u002Fguide\u002Fjson#failures","JSON page",[29,1469,1473],{"id":1470,"anchor":1471},"bad-reader-flags",{"label":1472,"icon":34},"Section titled \"Bad reader flags\"","Bad reader flags",[20,1475,1476,1477,93,1480,1483,1484,1487,1488,93,1490,1493,1494,1497],{},"A bad ",[24,1478,1479],{},"--format",[24,1481,1482],{},"--max-chars"," doesn't throw from ",[24,1485,1486],{},"createOut",". readerly stores the usage failure and prints it at ",[24,1489,73],{},[24,1491,1492],{},"out.fail()",", with exit code 2. A person at a terminal who passes ",[24,1495,1496],{},"--format yaml"," gets:",[166,1499,1500],{"language":1001,"class":170,"wrap":14},[24,1501,1502,214,1507],{"class":1049},[175,1503,1504],{"class":177,"style":178},[175,1505,1506],{},"✖ --format yaml is not a format. Use one of: text, agent, json, jsonl.",[175,1508,1509],{"class":177,"style":178},[175,1510,1511],{},"╰▶ fix: Pass --format with one of: text, agent, json, jsonl.",[20,1513,1514,1515,1518,1519,528],{},"The list names every format the tool accepts, including the ones it adds with ",[24,1516,1517],{},"formats",". See ",[931,1520,1522],{"href":1521},"\u002Fguide\u002Fformats","Formats",[29,1524,1528],{"id":1525,"anchor":1526},"your-own-exit-codes",{"label":1527,"icon":34},"Section titled \"Your own exit codes\"","Your own exit codes",[20,1530,1531,1532,1534],{},"Pass ",[24,1533,393],{}," to give a failure a code above 2:",[166,1536,1537],{"language":168,"filename":545,"class":170,"wrap":14},[24,1538,1539],{"class":173},[175,1540,1541,1544,1546,1548,1550,1553,1555,1558,1560,1563,1566,1568],{"class":177,"style":178},[175,1542,1543],{"style":181},"throw",[175,1545,713],{"style":181},[175,1547,716],{"style":593},[175,1549,597],{"style":212},[175,1551,1552],{"style":593},"failure",[175,1554,597],{"style":212},[175,1556,1557],{"style":192},"\"runtime\"",[175,1559,150],{"style":212},[175,1561,1562],{"style":192},"\"Tests failed to start.\"",[175,1564,1565],{"style":212},", { exitCode: ",[175,1567,1088],{"style":238},[175,1569,1570],{"style":212}," }));",[20,1572,1573,1575,1576,1578,1579,1582,1583,1586],{},[24,1574,943],{}," returns ",[24,1577,1088],{},", and a coding agent running ",[24,1580,1581],{},"acme build"," gets ",[24,1584,1585],{},"acme build: failed. Tests failed to start."," readerly reserves 0, 1 and 2, so document what your other codes mean.",[20,1588,1589,1590,528],{},"Next: ",[931,1591,1593],{"href":1592},"\u002Fguide\u002Fjson","JSON and JSONL",[1595,1597,1598,1599,1600,1601,1602,1603],{"id":31,"depth":1596,"text":35},2,{"id":161,"depth":1596,"text":164},{"id":491,"depth":1596,"text":494},{"id":992,"depth":1596,"text":995},{"id":1023,"depth":1596,"text":1026},{"id":1363,"depth":1596,"text":1366},{"id":1470,"depth":1596,"text":1473},{"id":1525,"depth":1596,"text":1528},{"path":933,"title":934,"description":1605},"How out.ask and out.confirm get a value from a flag, --input, an env var, a prompt or a default, and when they stop with action_required.",{"path":1592,"title":1593,"description":1607},"The json document and the jsonl record stream a readerly command prints, their fields and schema name, failures in both, and how out.set fills result.",1795985393399,"22ea5d7b-bce0-4e3b-bca3-1fbe3722fcf7"]