diff --git a/v2-models-effort/runs/20261028-095511-delicate-sound/ported_implementation/integration_tests/__init__.py b/v2-models-effort/runs/20261028-095511-delicate-sound/ported_implementation/integration_tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/v2-models-effort/runs/20261028-095511-delicate-sound/ported_implementation/integration_tests/__pycache__/__init__.cpython-314.pyc b/v2-models-effort/runs/20261028-095511-delicate-sound/ported_implementation/integration_tests/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ea8f73454e44cd42ac42210e7fee345edd46fcc8 Binary files /dev/null and b/v2-models-effort/runs/20261028-095511-delicate-sound/ported_implementation/integration_tests/__pycache__/__init__.cpython-314.pyc differ diff --git a/v2-models-effort/runs/20261028-095511-delicate-sound/ported_implementation/integration_tests/generated/__init__.py b/v2-models-effort/runs/20261028-095511-delicate-sound/ported_implementation/integration_tests/generated/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/v2-models-effort/runs/20261028-095511-delicate-sound/ported_implementation/integration_tests/generated/__pycache__/__init__.cpython-314.pyc b/v2-models-effort/runs/20261028-095511-delicate-sound/ported_implementation/integration_tests/generated/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..41ccda4b5b9c865b0bf5cd88c0c8009077304f34 Binary files /dev/null and b/v2-models-effort/runs/20261028-095511-delicate-sound/ported_implementation/integration_tests/generated/__pycache__/__init__.cpython-314.pyc differ diff --git a/v2-models-effort/runs/20261028-095511-delicate-sound/ported_implementation/integration_tests/generated/iteration/__init__.py b/v2-models-effort/runs/20261028-095511-delicate-sound/ported_implementation/integration_tests/generated/iteration/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/v2-models-effort/runs/20261028-095511-delicate-sound/ported_implementation/integration_tests/generated/iteration/__pycache__/__init__.cpython-314.pyc b/v2-models-effort/runs/20261028-095511-delicate-sound/ported_implementation/integration_tests/generated/iteration/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3cc05ae3877ef7d539d1a11728d1701624863e97 Binary files /dev/null and b/v2-models-effort/runs/20261028-095511-delicate-sound/ported_implementation/integration_tests/generated/iteration/__pycache__/__init__.cpython-314.pyc differ diff --git a/v2-models-effort/runs/20261028-095511-delicate-sound/ported_implementation/integration_tests/generated/iteration/__pycache__/test_grammars.cpython-314-pytest-9.1.1.pyc b/v2-models-effort/runs/20261028-095511-delicate-sound/ported_implementation/integration_tests/generated/iteration/__pycache__/test_grammars.cpython-314-pytest-9.1.1.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a36e94ae56a1d2dc6f22c6be77ce548ec54a7f53 Binary files /dev/null and b/v2-models-effort/runs/20261028-095511-delicate-sound/ported_implementation/integration_tests/generated/iteration/__pycache__/test_grammars.cpython-314-pytest-9.1.1.pyc differ diff --git a/v2-models-effort/runs/20261028-095511-delicate-sound/ported_implementation/integration_tests/generated/iteration/__pycache__/test_iteration.cpython-314-pytest-9.1.1.pyc b/v2-models-effort/runs/20261028-095511-delicate-sound/ported_implementation/integration_tests/generated/iteration/__pycache__/test_iteration.cpython-314-pytest-9.1.1.pyc new file mode 100644 index 0000000000000000000000000000000000000000..47e933148aa877ea08df6087ab487a6ff1c0bdee Binary files /dev/null and b/v2-models-effort/runs/20261028-095511-delicate-sound/ported_implementation/integration_tests/generated/iteration/__pycache__/test_iteration.cpython-314-pytest-9.1.1.pyc differ diff --git a/v2-models-effort/runs/20261028-095511-delicate-sound/ported_implementation/integration_tests/generated/iteration/__pycache__/test_iteration_with_additional_strings.cpython-314-pytest-9.1.1.pyc b/v2-models-effort/runs/20261028-095511-delicate-sound/ported_implementation/integration_tests/generated/iteration/__pycache__/test_iteration_with_additional_strings.cpython-314-pytest-9.1.1.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b94aabc67a5239b96ce53d7f5c929ca32f739f8c Binary files /dev/null and b/v2-models-effort/runs/20261028-095511-delicate-sound/ported_implementation/integration_tests/generated/iteration/__pycache__/test_iteration_with_additional_strings.cpython-314-pytest-9.1.1.pyc differ diff --git a/v2-models-effort/runs/20261028-095511-delicate-sound/ported_implementation/integration_tests/generated/iteration/__pycache__/test_iteration_with_an_initial_string.cpython-314-pytest-9.1.1.pyc b/v2-models-effort/runs/20261028-095511-delicate-sound/ported_implementation/integration_tests/generated/iteration/__pycache__/test_iteration_with_an_initial_string.cpython-314-pytest-9.1.1.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d345612f63f8e8c44465911d50a5adda58b7ca08 Binary files /dev/null and b/v2-models-effort/runs/20261028-095511-delicate-sound/ported_implementation/integration_tests/generated/iteration/__pycache__/test_iteration_with_an_initial_string.cpython-314-pytest-9.1.1.pyc differ diff --git a/v2-models-effort/runs/20261028-095511-delicate-sound/ported_implementation/integration_tests/generated/iteration/test_grammars.py b/v2-models-effort/runs/20261028-095511-delicate-sound/ported_implementation/integration_tests/generated/iteration/test_grammars.py new file mode 100644 index 0000000000000000000000000000000000000000..cdc7a3f8dc079e316445ee73a285e4de5ba68448 --- /dev/null +++ b/v2-models-effort/runs/20261028-095511-delicate-sound/ported_implementation/integration_tests/generated/iteration/test_grammars.py @@ -0,0 +1,705 @@ +import pytest + +from gbnf import GBNF + + +def unescape(string: str) -> str: + return string.replace('\\n', '\n').replace('\\t', '\t') + + +GRAMMARS = {'arithmetic': 'root ::= (expr "=" ws term "\\n")+\\nexpr ::= term ([-+*/] term)*\\nterm ::= ' + 'ident | num | "(" ws expr ")" ws\\nident ::= [a-z] [a-z0-9_]* ws\\nnum ::= ' + '[0-9]+ ws\\nws ::= [ \\t\\n]*\\n', + 'c': 'root ::= (declaration)*\\n\\ndeclaration ::= dataType identifier "(" parameter? ")" "{" ' + 'statement* "}"\\n\\ndataType ::= "int" ws | "float" ws | "char" ws\\nidentifier ::= ' + '[a-zA-Z_] [a-zA-Z_0-9]*\\n\\nparameter ::= dataType identifier\\n\\nstatement ::=\\n ( ' + 'dataType identifier ws "=" ws expression ";" ) |\\n ( identifier ws "=" ws expression ' + '";" ) |\\n ( identifier ws "(" argList? ")" ";" ) |\\n ( "return" ws expression ";" ) ' + '|\\n ( "while" "(" condition ")" "{" statement* "}" ) |\\n ( "for" "(" forInit ";" ws ' + 'condition ";" ws forUpdate ")" "{" statement* "}" ) |\\n ( "if" "(" condition ")" "{" ' + 'statement* "}" ("else" "{" statement* "}")? ) |\\n ( singleLineComment ) |\\n ( ' + 'multiLineComment )\\n\\nforInit ::= dataType identifier ws "=" ws expression | identifier ' + 'ws "=" ws expression\\nforUpdate ::= identifier ws "=" ws expression\\n\\ncondition ::= ' + 'expression relationOperator expression\\nrelationOperator ::= ("<=" | "<" | "==" | "!=" | ' + '">=" | ">")\\n\\nexpression ::= term (("+" | "-") term)*\\nterm ::= factor(("*" | "/") ' + 'factor)*\\n\\nfactor ::= identifier | number | unaryTerm | funcCall | ' + 'parenExpression\\nunaryTerm ::= "-" factor\\nfuncCall ::= identifier "(" argList? ' + '")"\\nparenExpression ::= "(" ws expression ws ")"\\n\\nargList ::= expression ("," ws ' + 'expression)*\\n\\nnumber ::= [0-9]+\\n\\nsingleLineComment ::= "//" [^\\n]* ' + '"\\n"\\nmultiLineComment ::= "/*" ( [^*] | ("*" [^/]) )* "*/"\\n\\nws ::= ([ \\t\\n]+)\\n', + 'chess': '# Specifies chess moves as a list in algebraic notation, using PGN conventions\\n\\n# ' + 'Force first move to "1. ", then any 1-2 digit number after, relying on model to follow ' + 'the pattern\\nroot ::= "1. " move " " move "\\n" ([1-9] [0-9]? ". " move " " move ' + '"\\n")+\\nmove ::= (pawn | nonpawn | castle) [+#]?\\n\\n# piece type, optional ' + 'file/rank, optional capture, dest file & rank\\nnonpawn ::= [NBKQR] [a-h]? [1-8]? "x"? ' + '[a-h] [1-8]\\n\\n# optional file & capture, dest file & rank, optional ' + 'promotion\\npawn ::= ([a-h] "x")? [a-h] [1-8] ("=" [NBKQR])?\\n\\ncastle ::= "O-O" ' + '"-O"?\\n', + 'japanese': '# A probably incorrect grammar for Japanese\\nroot ::= jp-char+ ([ \\t\\n] ' + 'jp-char+)*\\njp-char ::= hiragana | katakana | punctuation | cjk\\nhiragana ' + '::= [ぁ-ゟ]\\nkatakana ::= [ァ-ヿ]\\npunctuation ::= [、-〾]\\ncjk ::= [一-鿿]\\n', + 'json-arr': '# This is the same as json.gbnf but we restrict whitespaces at the end of the root ' + 'array\\n# Useful for generating JSON arrays\\n\\nroot ::= arr\\nvalue ::= object ' + '| array | string | number | ("true" | "false" | "null") ws\\n\\narr ::=\\n "[\\n" ' + 'ws (\\n value\\n (",\\n" ws value)*\\n )? "]"\\n\\nobject ::=\\n "{" ' + 'ws (\\n string ":" ws value\\n ("," ws string ":" ws value)*\\n )? ' + '"}" ws\\n\\narray ::=\\n "[" ws (\\n value\\n ("," ws value)*\\n )? ' + '"]" ws\\n\\nstring ::=\\n "\\"" (\\n [^"\\\\\\x7F\\x00-\\x1F] |\\n "\\\\" ' + '(["\\\\/bfnrt] | "u" [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F] [0-9a-fA-F]) # escapes\\n ' + ')* "\\"" ws\\n\\nnumber ::= ("-"? ([0-9] | [1-9] [0-9]*)) ("." [0-9]+)? ([eE] [-+]? ' + '[0-9]+)? ws\\n\\n# Optional space: by convention, applied in this grammar after ' + 'literal chars when allowed\\nws ::= ([ \\t\\n] ws)?\\n', + 'json': 'root ::= object\\nvalue ::= object | array | string | number | ("true" | "false" | ' + '"null") ws\\n\\nobject ::=\\n "{" ws (\\n string ":" ws value\\n ("," ws ' + 'string ":" ws value)*\\n )? "}" ws\\n\\narray ::=\\n "[" ws (\\n ' + 'value\\n ("," ws value)*\\n )? "]" ws\\n\\nstring ::=\\n "\\"" (\\n ' + '[^"\\\\\\x7F\\x00-\\x1F] |\\n "\\\\" (["\\\\/bfnrt] | "u" [0-9a-fA-F] [0-9a-fA-F] ' + '[0-9a-fA-F] [0-9a-fA-F]) # escapes\\n )* "\\"" ws\\n\\nnumber ::= ("-"? ([0-9] | [1-9] ' + '[0-9]*)) ("." [0-9]+)? ([eE] [-+]? [0-9]+)? ws\\n\\n# Optional space: by convention, ' + 'applied in this grammar after literal chars when allowed\\nws ::= ([ \\t\\n] ws)?\\n\\n', + 'list': 'root ::= item+\\n\\n# Excludes various line break characters\\nitem ::= "- " ' + '[^\\r\\n\\x0b\\x0c\\x85\\u2028\\u2029]+ "\\n"\\n', + 'simple': 'root ::= (expr "=" term "\\n")+\\nexpr ::= term ([-+*/] term)*\\nterm ::= [0-9]+\\n'} + +CASES = [['arithmetic', '1'], + ['arithmetic', '1 +'], + ['arithmetic', 'and'], + ['arithmetic', '1 +2'], + ['arithmetic', '1 +2+'], + ['arithmetic', '1 +2=3'], + ['arithmetic', '1 +2 +3'], + ['arithmetic', '1 +2= 3'], + ['arithmetic', '1 +2 =3'], + ['arithmetic', '1 +2 = 3'], + ['arithmetic', '1 +2*3=9'], + ['arithmetic', '1 +2+3=6'], + ['arithmetic', '1 +2 *3=9'], + ['arithmetic', '1 +2+3 = 6'], + ['arithmetic', '3 +4*5= 23'], + ['arithmetic', '1 +2*3 = 9'], + ['arithmetic', '1 +2 /3*4 ='], + ['arithmetic', '1 +2 *3 = 9'], + ['arithmetic', '2 +3 *4 =14'], + ['arithmetic', '2 +3 *4 = 14'], + ['arithmetic', '2 +5 *4 = 26'], + ['arithmetic', '(1)\\n -3 +2 *5 =\\n (2)'], + ['arithmetic', '3\\n\\n *args *nums = list'], + ['arithmetic', '3\\n \\n *hint*1 +2 *3 = 1'], + ['arithmetic', '1 +2 *3 = 9\\n \\n \\n \\n\\n2-5'], + ['arithmetic', '3\\n -2 +1\\n\\n *a *b -c = d'], + ['arithmetic', '3\\n -3\\n \\n *args -args = 0'], + ['arithmetic', '3\\n \\n *args -a\\n \\n *args -f'], + ['arithmetic', 'and\\n \\n \\n \\n -2 *(1 -3) +4 = 2'], + ['arithmetic', 'and\\n\\n *args -var_name\\n -1 = args0'], + ['arithmetic', '3\\n\\n *hint*(1)\\n *looks_like_this\\n *is_valid'], + ['arithmetic', '(invalid)\\n \\n *valid*(non-answer)\\n \\n *valid*(answer)'], + ['arithmetic', '(a) -2 *3\\n -4\\n \\n *4\\n -16\\n \\n *6\\n -36\\n \\n /3 \\n -3'], + ['arithmetic', '2\\n \\n *hint*1-10\\n\\n *hint*11-14\\n\\n *hint*15-17\\n\\n *hint*18-21'], + ['arithmetic', '3+7/2*5\\n \\n *(numbers) = (number1 +number2 +number3+number4 +number5)'], + ['arithmetic', + '4\\n \\n *hint*(donot /use/operator)\\n \\n *hint*(try-using-input-function)\\n \\n ' + '*hint*(try-using-if-'], + ['arithmetic', + '3\\n \\n *hint*(you *might*want*to *look*at *the*order-of-operations)\\n\\n *hint*(you ' + '*might*want*to *use*a *'], + ['arithmetic', + '3\\n \\n *hint*(you *can*use *and*or)\\n\\n *hint*(you *can*use *and*or)\\n \\n *hint*(you ' + '*can*use *and*or)\\n \\n *'], + ['c', 'i'], + ['c', 'int'], + ['c', 'int thati'], + ['c', 'int theta(f'], + ['c', 'int todo_list('], + ['c', 'int to(int a){'], + ['c', 'int takessinput'], + ['c', 'int thatikssllll'], + ['c', 'int toinflate(char s1'], + ['c', 'int that(int it){iint'], + ['c', 'int that(int that){}int'], + ['c', 'int that(int a){int i ='], + ['c', 'int that(int a){int i = 0'], + ['c', 'int thatehsesgbeorhtuCcie'], + ['c', 'int i3(int i2){return i2*i2;}'], + ['c', 'int todo(int a){//a is the input of'], + ['c', 'int that1s2n3d4n5g6r7h8o9p10a11w12b'], + ['c', 'int theta(char orc){//your code here'], + ['c', 'int thatlllllllllllllllllllllllllllll'], + ['c', 'int thatiSslllwllllllllllllllllllllllll'], + ['c', 'int thatprint(){printf (fputs(array, p));}int'], + ['c', 'int thatiSsolveIt(int x){return x*x;}int main'], + ['c', 'char s1_arr1(int n){return (char*( ( char )-n+'], + ['c', "int thatprintoutrandomwordsandalphabet(){// i've"], + ['c', 'int thatiksssttststststststst_stststststitststst'], + ['c', 'int thatiksniponkimvssmhllmohlwvnfosrqxqyfqjrthmfkmn'], + ['c', 'float a(int b){return (b+1);}float z(int y){return (( ( float'], + ['c', 'int thatsntttinglytough(char\\n isnttnglytough){}int main(){char'], + ['c', 'char\\n\\nAqeel123456erjfkehkjhkdfjklefkgfgjfgiifjgfhkfekfgdfegfgeff'], + ['c', 'int main(){}int sum(int a){return a;}int product(int a){return a;}'], + ['c', 'int todo(){char c = getchar();}int main(){while(1==1){int i = 0;int j'], + ['c', 'int thatikssllllllllllllllllllllllllllllllllllllllllllllllllllllllllll'], + ['c', 'int todo(int n){}int todo(int n){}int todo(int n){}int todo(int n){}int'], + ['c', 'int thatikssllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll'], + ['c', 'int\\n movzxqyhw0xmm(int I32){xmm2d0xmm_setzero_ps16_pmu_ps1_ps1_ps1_ps1_ps'], + ['c', 'char\\n dvcs_xl_a2hk9y8q4o3dsf1m5n6v7uwxyz87654321jklmnpqrstuvwxyzabcdeghij'], + ['c', 'int thatllprintoutthenumberoftimesthateachletterappearsinaString(char str1){'], + ['c', 'int that(int that){}int that(int that){}int that(int that){}int that(int that)'], + ['c', 'int main(){}char\\n HowdyaDongledoIknowthatcharliehatesprogramming(int a){char b'], + ['c', 'int youroostedsirnstedssirntnsrirtrsdtrrsdsdtrrssdrtrsrdtsrrrtssrtrdsrtsrttrdtsr'], + ['c', 'int main(int argc){//here\\nreturn 0;//and here\\n}int my_program(char c){//here\\nif ('], + ['c', 'int thatasksforanythingbutwhatevahtmlandwhatevsomethingmoreplease(int dont){}char my'], + ['c', 'int i3(int i2){return i2*i2;}int main(){int i1 = 0;for (inti2(0, 1000000000));i1 = i'], + ['c', + 'int thatprint(int a){printf\\n (a);}int main(){int i\\n = 1;do\\n (i--0);}int main(){int ' + 'i\\n = 1;'], + ['c', + 'int that(int that){}int that(int that){}int that(int that){}int that(int that){}int that(int ' + 'that){}'], + ['c', + 'int ' + 'thatwillfindifistevennumberinaverylongintroductionstringofonehundreddigitsormoreandreturntheindexof'], + ['c', + 'int todo(int n){}int main(){int i = 0;int j = 1;while (j*j+i*i);}int main(){int i = 0;int j = ' + '1;while ('], + ['c', + 'int ' + 'thatiSsasssseeeeeeepyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy'], + ['c', + 'int todo(int n){}int todo(int n){}int todo(int n){}int todo(int n){}int todo(int n){}int ' + 'todo(int n){}i'], + ['c', + 'int ainted(int n){int i = 0;while (i*i+1);}int main(){printf_s\\n (int);return 0;}int ' + 'fahrenheit2celsius('], + ['c', + 'int main(int argc){//argv[0] is name of file to be opened\\nreturn (0);//exit code, no ' + 'errors\\n}int main(int argc){//argv['], + ['c', + 'int ' + 'thatcomparesstringsinmemorywithoutallocatingmorespacethannecessarytoholdbothstringsoranyotherobjectsofthesamelengthandsofwhomit'], + ['c', + 'int thatlllbeoawesome(int a){return (a*2);}int main(){printf\\n (iintantielloawesome(5));}int ' + 'thatlllbeoawesome(int a){return (a*2);}'], + ['c', + 'char str1(int n){strcpy (n, str);}int n(int s){printf (s);return 0;}int main(){char str = ' + 'getchar();int i = 1;while(getchar()!=10){if(i'], + ['c', + 'int withing(int a){}char str1(int a){}int main(){}char str2(){return 0;}int i(){return 0;}int ' + 'j(){return 1;}int k(){return 2;}int l(){return'], + ['c', + 'int that(int that){}char\\n ' + 'WritemeakillerprogramintheClanguageagaininthatagaininthatagaininthatagaininthatagaininthatagaininthatagaininthatagainint'], + ['c', + 'char buffer1(int length){//length is inputted by user\\n}int main(){while(true!=fscanf(fp, ' + 'buffer1)){printf_stdout (buffer);}return 0;}float x0(float n){'], + ['c', + 'int tokkenize(char str){}int tokkenize(char str){int i = 0;while (strlen(str)--and);return ' + 'str;}int tokkenize(char str){int i = 0;while (strlen(str)--and'], + ['c', + 'int main(){}int main(int argc){}int main(){}int main(){}int main(){}int main(){}int main(){}int ' + 'main(){}int main(){}int main(){}int main(){}int main(){}int'], + ['c', + 'int ' + 'thatusesregexpandstoragesystemsincompatibilitiesbutalsoworksinotherprogramminglanguageslikepythonorjavascriptorpython3whichhavebeenaroundawhileandaremorecomfortabletousethanCbutstillwanttoc'], + ['c', + 'int thatllprintoutallthewordsinafilethatstartwiththesignaturestringofmychoice(int ' + 'heresone){}int theordertheyappearinthefileandthenprintoutalltheotherwordsinthefileafterthat(int ' + 'heresomeotherthing)'], + ['c', + 'int main(){//Program start\\nint num = 0;//variable for number of characters in input ' + 'string.\\nchar c = 0;//Variable for single character read from input.\\nscanf_s (input, ' + '100);//Scan a line of user-entered text into the array'], + ['c', + 'int ' + 'thatllmmehmmmmmlllmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm'], + ['chess', '1'], + ['chess', '1.'], + ['chess', '1. a'], + ['chess', '1. N1x'], + ['chess', '1. a1+ a'], + ['chess', '1. N1xh1'], + ['chess', '1. a1+ a2+'], + ['chess', '1. N1xh1+ N2'], + ['chess', '1. a1+ a2+\\n2.'], + ['chess', '1. a2+ b3\\n2. a'], + ['chess', '1. a2+ b3\\n2. a2'], + ['chess', '1. a1 b2\\n2. a1 b2'], + ['chess', '1. f1=N f2=N\\n2. f'], + ['chess', '1. a1 b2\\n2. a1 b2\\n3'], + ['chess', '1. a2+ b3\\n2. a2+ b4\\n3.'], + ['chess', '1. a2+ b3\\n2. a2+ b3\\n3.'], + ['chess', '1. N2xh3+ h4=N\\n2. N2xh3'], + ['chess', '1. N2xh3+ h4=N\\n2. N2xh3+'], + ['chess', '1. N2xh1+ N2xh2+\\n2. N2xh1'], + ['chess', '1. N2xh1+ N2xh2+\\n2. N2xh1+'], + ['chess', '1. a4 b5\\n2. a3 b4\\n3. a4 b4'], + ['chess', '1. Ref1 Ref2\\n2. Ref3 Ref4\\n3'], + ['chess', '1. a3+ c4+\\n2. a3+ b5+\\n3. d2+'], + ['chess', '1. a2+ b3\\n2. a2+ b3\\n3. a2+ b3'], + ['chess', '1. N1d2 N3f4\\n2. f1+ N2e2\\n3. f1+ N'], + ['chess', '1. N1xg1+ N2xg2+\\n2. N1xg1+ N2xg2+'], + ['chess', '1. a1+ a2+\\n2. a1+ a2+\\n3. a1+ a2+\\n4'], + ['chess', '1. N2xb3+ N4xa2\\n2. N5xb1+ N6xb2\\n3.'], + ['chess', '1. a4+ a5\\n2. a4+ a6\\n3. a4+ a7\\n4. a4+'], + ['chess', '1. a4+ b3\\n2. a5+ b4\\n3. a6+ b5\\n4. a7+ b'], + ['chess', '1. a4+ a5\\n2. a4+ a6\\n3. a4+ a7\\n4. a4+ a'], + ['chess', '1. a1+ a2\\n2. b1+ b2\\n3. c1+ c2\\n4. d1+ d2'], + ['chess', '1. a1+ b2=N\\n2. c1+ d2=N\\n3. e1+ f2=N\\n4. g1+'], + ['chess', '1. N2xh2+ N3xh3\\n2. N2xh2+ N4xh4\\n3. N2xh2+ N'], + ['chess', '1. a1 b2\\n2. a1 a2\\n3. a1 b2\\n4. a1 a2\\n5. a1 b2\\n6'], + ['chess', '1. a4+ b3\\n2. a4+ b3\\n3. a4+ b3\\n4. a4+ b3\\n5. a4+ b'], + ['chess', '1. a2+ b3\\n2. a2+ b3\\n3. a2+ b3\\n4. a2+ b3\\n5. a2+ b3'], + ['chess', '1. a4=B b8=B\\n2. b3=B+ Bc4\\n3. c6=B+ Bf5\\n4. c1=B+ B'], + ['chess', '1. a2+ a3\\n2. a2+ a3+\\n3. a2+ a3+\\n4. a2+ a3+\\n5. a2+'], + ['chess', '1. a3 b2\\n2. c1 d2\\n3. e3 f4\\n4. g5 h6\\n5. a1 b1\\n6. a3'], + ['chess', '1. a1 a2\\n2. a1 b1\\n3. a1 c1\\n4. a1 d1\\n5. a1 e1\\n6. a1'], + ['chess', '1. N2h4 a3\\n2. N2h4 a3\\n3. N2h4 a3\\n4. N2h4 a3\\n5. N2h4'], + ['chess', '1. b2+ a2\\n2. c2+ d2\\n3. c4+ d4\\n4. a3+ b3\\n5. c7+ d7\\n6. a'], + ['chess', '1. N2a4+ b4\\n2. N2b3+ c2\\n3. a2 b2\\n4. a2 b3\\n5. a2 b2\\n6. a'], + ['chess', '1. N2xg3+ N4xg5+\\n2. N2xg3+ N4xg5+\\n3. N2xg3+ N4xg5+\\n4. N2'], + ['chess', '1. a1+ b2=N\\n2. a1+ b2=N\\n3. a1+ b2=N\\n4. a1+ b2=N\\n5. a1+ b2'], + ['chess', '1. N1xh1 N2xh2\\n2. h1+ h2+\\n3. h1+ h2+\\n4. h1+ h2+\\n5. h1+ h2+'], + ['chess', '1. b4 b3\\n2. a5 a4\\n3. a3 a4\\n4. a4 b4\\n5. a2 a1\\n6. a4 a3\\n7. a'], + ['chess', '1. a1+ b2\\n2. a1+ b2\\n3. a1+ b2\\n4. a1+ b2\\n5. a1+ b2\\n6. a1+ b2'], + ['chess', '1. a2+ a3\\n2. a1+ a2+\\n3. a1+ a2+\\n4. a1+ a2+\\n5. a1+ a2+\\n6. a1+'], + ['chess', '1. N2xh2+ N3xh3+\\n2. N2xh2+ N3xh3+\\n3. N2xh2+ N3xh3+\\n4. N2xh2+ N'], + ['chess', '1. a1+ a2+\\n2. b1+ b2+\\n3. c1+ c2+\\n4. d1+ d2+\\n5. e1+ e2+\\n6. f1+ f'], + ['chess', '1. a1+ a2+\\n2. c1=B+ Bxc2\\n3. a2+ bxb2=B+\\n4. a2+ bxb2=B+\\n5. a2+ b'], + ['chess', '1. a2+ b3+\\n2. a2+ b4+\\n3. a2+ b5+\\n4. a2+ b6+\\n5. a2+ b7+\\n6. a2+ b8+\\n7.'], + ['chess', '1. a1+ a2=B\\n2. b1+ b2=B\\n3. c1+ c2=B\\n4. d1+ d2=B\\n5. e1+ e2=B\\n6. f1+ f'], + ['chess', '1. a2+ b2\\n2. a2+ b2\\n3. a2+ b2\\n4. a2+ b2\\n5. a2+ b2\\n6. a2+ b2\\n7. a2+ b2\\n8'], + ['chess', '1. N2xg3+ c4\\n2. a5+ b6=N\\n3. b7+ c8=N\\n4. c1+ d2=N\\n5. e3+ f4=N\\n6. g5+ h6=N'], + ['chess', + '1. a1 a2\\n2. a1 a2+\\n3. a1+ a2\\n4. a1 a2=B\\n5. a1+ a2=B\\n6. b1 a1\\n7. b1 a2=B\\n8'], + ['chess', '1. N1xa1+ N2xa2\\n2. b3=N+ Nb3\\n3. N1xa1+ b3\\n4. N1xa1+ N2xa2+\\n5. N1xa1+ b3+\\n6'], + ['chess', + '1. a2+ b3\\n2. a1+ b2\\n3. a1+ b2\\n4. a1+ b2\\n5. a1+ b2\\n6. a1+ b2\\n7. a1+ b2\\n8. a1'], + ['chess', + '1. a2+ b2\\n2. a3+ b3\\n3. a4+ b4\\n4. a5+ b5\\n5. a6+ b6\\n6. a7+ b7\\n7. a8+ b8\\n8. a8+ b'], + ['chess', + '1. Rea2 h5\\n2. f2 g3\\n3. h4 h4\\n4. f3 h3\\n5. h6 h8\\n6. g7 g7\\n7. g2 h4\\n8. h7 h6\\n9. h7 ' + 'h'], + ['japanese', ''], + ['japanese', '漫'], + ['japanese', '横'], + ['japanese', '書'], + ['japanese', '江戸の'], + ['japanese', '比較美'], + ['japanese', '《玉の恋'], + ['japanese', '《美女之花'], + ['japanese', '唱歌。\\n怎么'], + ['japanese', '《美しき日本'], + ['japanese', '洋の東方の詩を'], + ['japanese', '比較美好的品牌'], + ['japanese', '涙湯したい唄がす'], + ['japanese', '江戸の詩がいつも'], + ['japanese', '《花月秋》\\n《花月'], + ['japanese', '満有のメインが「あな'], + ['japanese', '美しい日本語詩をつくる'], + ['japanese', '《花月等》\\n《黄金曲》'], + ['japanese', '和えているのは、\\n《知ら'], + ['japanese', '紅花和優惠的漫步\\n《非性'], + ['japanese', '和美味良的短歌\\n。\\n。\\n。'], + ['japanese', '嫁ちゃんの花がいただき、\\n《'], + ['japanese', '毛菜のうたが、それは美しい日本'], + ['japanese', '《花果道》\\n【笑青春】\\n【笑青春'], + ['japanese', '《花糖果》\\n《花糖果》\\n《花糖果'], + ['japanese', 'ぬかりのうた しなむらんで、\\n《月'], + ['japanese', '比較美好的品牌\\n这个词是一个单词。'], + ['japanese', '。。。\\n」\\n「あなたは、お話を探して'], + ['japanese', '比較美好的品牌\\n。\\n。\\n。\\n。\\n。\\n。'], + ['japanese', '哀しい日本語詩を持つま\\n。\\n。\\n。\\n。'], + ['japanese', '山本美しい日詩\\n」\\n「おもちゃんと、そ'], + ['japanese', '和おうなへ\\n〈林英雄〉\\n〈美しい日光〉'], + ['japanese', '果にゃっちょんがま\\n。\\nただく悲しくので'], + ['japanese', '我想美国十大的曲\\n这样主要让歌手面自己可'], + ['japanese', '懸念のお風が強いほど谷中の日本詩をまとめて'], + ['japanese', '严愛華屬\\n十八年百月營用梅子錯誤 修正\\n十'], + ['japanese', '《美しい日本語詩》\\n《恋の花》\\n《風につきて'], + ['japanese', '先指一個最好的評論。\\n《研究科學和匯科文章目標'], + ['japanese', '澤島歌舞\\n。\\n。\\n。\\n「福島」。\\n「福島」。\\n「'], + ['japanese', '和おうなそれを言います。\\n知らないので、どこにもあ'], + ['japanese', '《美しい日本語詩》\\n《美しい日本語詩》\\n《美しい日'], + ['japanese', '美しい日本語詩をみた。\\n」\\n【終了】\\n「あなたは、この'], + ['japanese', '也为我想了悲症\\n来看我的夏天和春天\\n如此着高的海见这一'], + ['japanese', '華人語對咲香樂\\n經驗的拜情\\n只有一下容易思考\\n不要快速'], + ['japanese', '模板内容和古音与文字调整\\n《池沙气》。\\n【阳光流通线】'], + ['japanese', '小さな日本語の詩をつくても桜らしい。\\n今夕の日本語にある'], + ['japanese', '別詞を持っていると、それが美しい日本語です。\\n《絵文字の'], + ['japanese', '詩を大好きです。\\n这道题要求如下。\\n输入一个字符串。返回经'], + ['japanese', '《花の詩》\\n。\\n。\\n。\\n。\\n。\\n。\\n。\\n。\\n。\\n。\\n。\\n。\\n。'], + ['japanese', '农村家が重い場所は\\n《夢にしてください》\\nわげてもない空気で、'], + ['japanese', '和美花の中で、母さんは\\n《華語》を読む。\\n《香港雜誌》書店に表示して'], + ['japanese', '哉きがわかるために\\n私は、ご果しますので、これに言う屋を\\n彼女となるん'], + ['japanese', '《華人語》\\n「あなたの夢を抱きしよう」\\n「ご飯は美味に好きです。」\\n「'], + ['japanese', '。\\n」\\n「そしては、お茶を食べることです。」\\n「どうも、それより美しいなら'], + ['japanese', '梅の詩がおいしいです。\\n」\\n「美の音は音となることを愛して、\\n唄によっても'], + ['japanese', '《美しい日本語詩》\\n《麻雨の花》\\n《花を持ってる》\\n《涙がやすくなり》\\n《'], + ['japanese', '和じゃないそうにして\\n《欲しい花の詩》\\n《美しき日本語の歌》\\n《華人の国》'], + ['japanese', '満美詩《歐裕のうた》\\n〈歐裕のうた〉\\n〈これらであるつまでがいるとなり〉\\n〈'], + ['japanese', '喜びないときは、それからも話者にする\\n《細胞の言うため》\\n「憂しくても君を願っ'], + ['japanese', '桜の詩がおいしい\\n。\\n居住地に私は、\\nあなたともころを見る\\n。\\n居住地に私は、'], + ['japanese', '美しい日本語の歌をまとめて\\n。\\n。\\n。\\nどうもなるのか\\nどれだけにありますよ。\\n沙に花があるこ'], + ['japanese', + '比較しておいたい\\n。\\n。\\n。\\n。\\n。\\n。\\n。\\n。\\n。\\n。\\n。\\n。\\n。\\n。\\n。\\n。\\n。\\n。\\n。\\n。\\n。\\n。\\n。'], + ['json-arr', '['], + ['json-arr', '[\\n {'], + ['json-arr', '[\\n {\\n "'], + ['json-arr', '[\\n {\\n "name'], + ['json-arr', '[\\n {\\n "key":'], + ['json-arr', '[\\n {\\n "field1":'], + ['json-arr', '[\\n {"a":"b"},\\n {}\\n]'], + ['json-arr', '[\\n {\\n "name": "John'], + ['json-arr', '[\\n { "key": "value" }\\n ]'], + ['json-arr', '[\\n { "a": 1, "b": 2 }\\n ]'], + ['json-arr', '[\\n {\\n "name":"first",'], + ['json-arr', '[\\n {\\n "name": "John",'], + ['json-arr', '[\\n {\\n "key1": "value1",'], + ['json-arr', '[\\n {\\n "name": "A",\\n "'], + ['json-arr', '[\\n {\\n "name": "John",\\n "age'], + ['json-arr', '[\\n {\\n "name": "John",\\n "age":'], + ['json-arr', '[\\n {\\n "a": "b",\\n "c": [1,2,3],'], + ['json-arr', '[\\n {\\n "name": "John",\\n "age": 30,'], + ['json-arr', '[\\n {\\n "name": "John",\\n "age": 20,'], + ['json-arr', '[\\n {\\n "key": "value",\\n "other_stuff'], + ['json-arr', '[\\n {\\n "name": "John",\\n "age": 25,\\n "'], + ['json-arr', '[\\n "a",\\n "b",\\n { "c": true },\\n null,\\n "d'], + ['json-arr', '[\\n {"name": "John", "age": 23},\\n "dog",\\n 123,\\n ["foo"],'], + ['json-arr', '[\\n {\\n "name": "John",\\n "age": 30,\\n "city":'], + ['json-arr', '[\\n {\\n "id": "1",\\n "name": "some name"\\n }\\n ]'], + ['json-arr', '[\\n { "key" : "value", "some_other_key" : "another value"},'], + ['json-arr', '[\\n {\\n "key1": "value1",\\n "key2": [\\n "value'], + ['json-arr', '[\\n {"first_name":"A", "last_name":"B"},\\n "abcde12345"\\n ]'], + ['json-arr', '[\\n {"foo":1, "bar":["a","b"]},\\n {"foo2":[0,1]},\\n "string"]'], + ['json-arr', '[\\n {\\n "a": 1,\\n "b": 2\\n },\\n {\\n "c": 3\\n }'], + ['json-arr', '[\\n { "key1": "value1", "key2": "value2" },\\n { "key3": "value3'], + ['json-arr', '[\\n {\\n "key1": "value1",\\n "key2": "value2",\\n "key3":'], + ['json-arr', '[\\n { "id": 1, "name": "Bob" },\\n { "id": 2, "name": "Alice" }\\n ]'], + ['json-arr', '[\\n {\\n "name": "John",\\n "age": 30,\\n "city": "New York"'], + ['json-arr', + '[\\n {\\n "a": "1",\\n "b": "2",\\n "c": "3",\\n "d": "4",\\n "'], + ['json-arr', + '[\\n {\\n "name": "Bob",\\n "age": 40,\\n "email": "bob@example.com"'], + ['json-arr', + '[\\n {\\n "id": "1234",\\n "name": "John Doe"\\n },\\n {\\n "id": ' + '"5678",'], + ['json-arr', + '[\\n {\\n "a": 1,\\n "b": 2,\\n "c": [3, 4]\\n },\\n {\\n "d": ' + '5\\n }'], + ['json-arr', + '[\\n {\\n "id": 1,\\n "name": "John Doe",\\n "age": 30\\n },\\n ' + '{\\n "id'], + ['json-arr', + '[\\n {\\n "key1": "value1",\\n "key2": "value2"\\n },\\n {\\n "key3": ' + '"value'], + ['json-arr', + '[\\n {\\n "key": "value",\\n "anotherKey": "anotherValue"\\n },\\n {\\n ' + '"key2": "'], + ['json-arr', + '[\\n {\\n "name": "John",\\n "age": 30,\\n "city": "New York"\\n },\\n ' + '{\\n "name": "Jane'], + ['json-arr', + '[\\n {\\n "name": "John",\\n "age": 30,\\n "city": "New York"\\n },\\n ' + '{\\n "name": "Jane",'], + ['json-arr', + '[\\n {\\n "name": "John",\\n "age": 20,\\n "address": "123 Main Street"\\n ' + '},\\n {\\n "name":'], + ['json-arr', + '[\\n {\\n "key": "value",\\n "nested_key": 2,\\n "more_keys": [\\n ' + '3,\\n 4,\\n 11\\n ]\\n }\\n]'], + ['json-arr', + '[\\n {\\n "name": "John",\\n "age": 30,\\n "city": "New York"\\n },\\n ' + '{\\n "name": "Jane",\\n "age'], + ['json-arr', + '[\\n {\\n "key1": "value1",\\n "key2": "value2"\\n },\\n {\\n "key3": ' + '"value3",\\n "key4": "value4"\\n }'], + ['json-arr', + '[\\n {\\n "name": "John",\\n "age": 21,\\n "friends": [\\n ' + '{\\n "name": "Dave",\\n "age": 23'], + ['json-arr', + '[\\n {\\n "name": "John",\\n "age": 30,\\n "city": "New York"\\n },\\n ' + '{\\n "name": "Jane",\\n "age": 25'], + ['json-arr', + '[\\n {\\n "name": "John",\\n "age": 20,\\n "city": "New York"\\n },\\n ' + '{\\n "name": "Jane",\\n "age": 25,'], + ['json-arr', + '[\\n {\\n "key1": "value1",\\n "key2": "value2",\\n "key3": "value3"\\n ' + '},\\n {\\n "key4": "value4",\\n "'], + ['json-arr', + '[\\n {\\n "key": "value",\\n "anotherKey": "another value"\\n },\\n ' + '{\\n "anotherKey2": "yet another value"\\n }\\n ]'], + ['json-arr', + '[\\n {\\n "foo": "bar",\\n "other_info": {\\n "field": 1,\\n ' + '"array": [1],\\n "boolean": true\\n },\\n "a'], + ['json-arr', + '[\\n {\\n "name": "John",\\n "age": 30,\\n "city": "New York"\\n },\\n ' + '{\\n "name": "Peter",\\n "age": 40,\\n "city": "Berlin"'], + ['json-arr', + '[\\n {\\n "first_name": "Alice",\\n "last_name": "Jones",\\n "age": ' + '25,\\n "occupation": "Engineer",\\n "address": {\\n "city": "New'], + ['json-arr', + '[\\n {\\n "name": "John",\\n "age": 30,\\n "city": "New York"\\n },\\n ' + '{\\n "name": "Jane",\\n "age": 25,\\n "city": "Los Angeles"\\n }'], + ['json-arr', + '[\\n {\\n "name": "John",\\n "age": 20,\\n "address": {\\n "street": ' + '"123 Main St.",\\n "city": "Anytown"\\n }\\n },\\n {\\n "name": "Jane",'], + ['json', '{'], + ['json', '{\\n "'], + ['json', '{\\n "first'], + ['json', '{\\n "foo":'], + ['json', '{\\n "key": "'], + ['json', '{\\n "key": "value'], + ['json', '{\\n "foo": "bar",'], + ['json', '{\\n "name": "John",'], + ['json', '{\\n "hello": "world",'], + ['json', '{\\n "key": "value",\\n "'], + ['json', '{\\n "key1": "value1",\\n "'], + ['json', '{\\n "key1": "value1",\\n "key'], + ['json', '{\\n "a": 1, "b": 2, "c": [3] }'], + ['json', '{\\n "test": "hello world",\\n "'], + ['json', '{\\n "name": "Joey",\\n "age": 32,'], + ['json', '{\\n "key1": "value1",\\n "key2": {'], + ['json', '{\\n "a": 1,\\n "b": 2,\\n "c": 3,'], + ['json', '{\\n "key": "value",\\n "other_key":'], + ['json', '{\\n "one": 1,\\n "two": 2,\\n "three'], + ['json', '{\\n "a": 1, "b": {\\n "c": 2\\n }\\n }'], + ['json', '{\\n "foo": "bar",\\n "baz": {\\n "qux":'], + ['json', '{\\n "name": "John",\\n "age": 30,\\n "city'], + ['json', '{\\n "a": 1,\\n "b": 2,\\n "c": true,\\n "'], + ['json', '{\\n "a": 1,\\n "b": 2,\\n "c": true,\\n "d'], + ['json', '{\\n "name": "John",\\n "age": 30,\\n "city":'], + ['json', '{\\n "key": "value",\\n "other key": [1, 2]\\n }'], + ['json', '{\\n "foo": "bar",\\n "baz": [1, 2, 3],\\n "boo":'], + ['json', '{\\n "key": "value",\\n "other_key": "other_value"'], + ['json', '{\\n "key": "value",\\n "anotherKey": "anotherValue"\\n }'], + ['json', '{\\n "name": "John",\\n "age": 30,\\n "isStudent": true\\n }'], + ['json', '{\\n "name": "John",\\n "age": 30,\\n "is_married": false\\n }'], + ['json', '{\\n "one": "a string",\\n "two": 3,\\n "three": ["list"]\\n }'], + ['json', '{\\n "one": "two",\\n "three": 4.3,\\n "five": ["six", 7]\\n }'], + ['json', '{\\n "key1": "value1",\\n "key2": {\\n "key3": "value3"\\n }'], + ['json', '{\\n "field1":"value1",\\n "field2":true,\\n "field3":["value4"],'], + ['json', '{\\n "foo": "bar",\\n "baz": true,\\n "some_array": [1, 2, 3]\\n }'], + ['json', '{\\n "key": "value",\\n "key2": {\\n "key3": "value3"\\n }\\n }'], + ['json', '{\\n "first": "name",\\n "second": {\\n "third": "value"\\n }\\n }'], + ['json', '{\\n "name": "John",\\n "age": 30,\\n "city": {\\n "state": "New York'], + ['json', '{"fizzbuzz": ["fizz", "fizz", "buzz"],\\n "evens": [4, 6],\\n "odds": [1, 3]}'], + ['json', + '{\\n "key1": "value1",\\n "key2": {\\n "subkey1": "subvalue1",\\n "subkey2":'], + ['json', + '{\\n "key1": "value1",\\n "key2": [1, 2, 3],\\n "key3": {\\n "key4": "value4",'], + ['json', + '{\\n "title": "My Title",\\n "content": "This is a sample paragraph.",\\n "tags":['], + ['json', + '{\\n "key1": "value1",\\n "key2": {\\n "subkey1": "subvalue1",\\n "subkey2": ['], + ['json', + '{\\n "key": "value",\\n "another key": [1, 2, 3],\\n "yet another": {\\n "more ' + 'keys":'], + ['json', + '{\\n "key": "value",\\n "another-key": true,\\n "nested key": {\\n "a third": ' + '"nested value'], + ['json', + '{\\n "key1": "value1",\\n "key2": {\\n "subkey1": "subvalue1",\\n "subkey2": ' + '[\\n "sub'], + ['json', + '{\\n "key": "value",\\n "another_key": {\\n "yet_more_key": "whatever I want it to ' + 'be."\\n }\\n }'], + ['json', + '{\\n "key1": "value1",\\n "key2": [1, 2],\\n "key3": {\\n "subkey1": ' + '"subvalue1",\\n "subkey2":'], + ['json', + '{\\n "key1": "value1",\\n "key2": {\\n "subkey1": "subvalue1",\\n "subkey2": ' + '"subvalue2"\\n }\\n }'], + ['json', + '{\\n "key": "value",\\n "another_key": "another_value",\\n\\n "object": {\\n ' + '"some_property": 1,\\n "'], + ['json', + '{\\n "name": "John",\\n "age": 21,\\n "isEmployed": true,\\n "children": [\\n ' + '{"name": "John Junior"}\\n ]\\n}'], + ['json', + '{\\n "type":"foo",\\n "name": "bar",\\n \\n "a":[\\n 1,2,3\\n ],\\n ' + '"b":[\\n [],\\n 5,6\\n ]\\n }'], + ['json', + '{\\n "key": "value",\\n "another key": {\\n "more nested keys": [\\n "nested ' + 'values"\\n ]\\n }\\n }'], + ['json', + '{\\n "name": "John",\\n "age": 30,\\n "isMarried": false,\\n "cars": [\\n ' + '{\\n "make": "Ford",\\n "model'], + ['json', + '{\\n "hello": "world",\\n "fruits": ["apple", "orange"],\\n \\t"user": {\\n ' + '"name": "Bob",\\n "age": 20,\\n \\t"'], + ['json', + '{\\n "data": "hello",\\n "age": 30,\\n "country": {\\n "state": ' + '"California",\\n "city": "San Francisco"\\n }\\n }'], + ['json', + '{\\n "key1": "value1",\\n "key2": "value2",\\n "key3": {\\n "subkey1": ' + '"subvalue1",\\n "subkey2": "subvalue2",\\n "subkey'], + ['json', + '{\\n "key": "value",\\n "a": [1, 2],\\n "b": true,\\n "c": {\\n "d": ' + '1,\\n "e": {\\n "f": "g"\\n }\\n },\\n "'], + ['json', + '{\\n "key1": "value1",\\n "key2": {\\n "subkey1": "subvalue1",\\n "subkey2": ' + '[\\n "subsubvalue1",\\n "subsubvalue2"'], + ['json', + '{\\n "name": "John",\\n "age": 23,\\n "address": {\\n "street": "123 Main ' + 'St.",\\n "city": "Anytown",\\n "state": "CA",\\n "zipcode": "12345"'], + ['list', '-'], + ['list', '- a'], + ['list', '- a list'], + ['list', '- a list of'], + ['list', '- a list of cars.'], + ['list', '- a list of fruits'], + ['list', '- a list of fruits.'], + ['list', '- a list of sports.'], + ['list', '- a list of cities.'], + ['list', '- a list of colors.'], + ['list', '- a list of numbers.'], + ['list', '- a list of colors.\\n-'], + ['list', '- a list of car models.'], + ['list', '- a list of car brands.'], + ['list', '- a list of colors.\\n- Add'], + ['list', '- a list of music genres.'], + ['list', '- a list of fruits.\\n- If the'], + ['list', '- a list of programming languages.'], + ['list', '- a list of fruits.\\n- If the input is not'], + ['list', '- a list of books.\\n- What is the difference'], + ['list', '- a list of fruits.\\n- If the user enters "quit" or'], + ['list', '- a list of fruits.\\n- For example, if the input is:\\n-'], + ['list', '- a list of colors.\\n- `grocery`: the same as above, but'], + ['list', '- a list of fruits.\\n- The first item in the returned list'], + ['list', '- a list of fruits.\\n- If there is no such word, return "I don\'t know'], + ['list', '- a list of colors.\\n- Each item in the returned list has two properties'], + ['list', '- a list of fruits.\\n- If you want to get all the items from the grocery'], + ['list', '- a list of fruits.\\n- If the user enters "exit", return an empty list.\\n- If'], + ['list', "- a list of sports.\\n- Example:\\n- >>> grocery_list = ['Bread', 'Milk', 'Cheese']"], + ['list', + '- a list of fruits.\\n- If the input is not one of these, return an empty list.\\n- The'], + ['list', + '- a list of fruits.\\n- If the input is not one of these, return an empty list.\\n- The ' + 'grocery'], + ['list', + '- a list of fruits.\\n- The function should return the empty list if it fails to find any item'], + ['list', + '- a list of fruits.\\n- Write some code that returns an empty list, so that we can test if the'], + ['list', + "- a list of cities.\\n- If the input is not in any of these categories, return 'Sorry, I don't " + "know that'."], + ['list', + "- a list of movies.\\n- We'll say that the words in this problem are all lowercase and there is " + 'no punctuation.'], + ['list', + '- a list of fruits.\\n- The list should be sorted alphabetically, except that the first item in ' + 'the list is always "'], + ['list', + '- a list of fruits.\\n- If the user enters "quit", return an empty list.\\n- If the user enters ' + 'anything else, return None.'], + ['list', + '- a list of fruits.\\n- If the user enters "quit", return an empty list.\\n- If the user enters ' + 'any other word, ask them to'], + ['list', + '- a list of fruits.\\n- If the input is not one of these, return an empty list.\\n- The input ' + 'can be any string.\\n- You may assume that'], + ['list', + '- a list of fruits.\\n- The first argument is the name of the category, and the second argument ' + 'is a string that contains all items in that'], + ['list', + "- a list of fruits.\\n- If the user enters 'q', quit the program.\\n- If the user enters " + 'anything else, print an error message and ask again.\\n- Use'], + ['list', + '- a list of programming languages.\\n- Give me one of the following:\\n- the index of the ' + 'first item in the list that matches my criteria, if there'], + ['list', + '- a list of planets.\\n- What is the purpose of the `if` statement?\\n- How can we modify the ' + 'program to take multiple arguments and concatenate them into one'], + ['list', + '- a list of fruits.\\n- If the user enters "exit", return an empty list.\\n- If the user enters ' + 'anything else, return None.\\n- The program should ask for input until'], + ['list', + '- a list of fruits.\\n- If the user enters "quit", return an empty list.\\n- If the user enters ' + 'anything else, print an error message and ask again.\\n- Use a loop to keep asking until the ' + 'user enters "quit".\\n- Use a'], + ['list', + '- a list of fruits.\\n- If the user enters "quit", return an empty list.\\n- If the user enters ' + 'anything else, return None.\\n- The program should ask for input until the user enters ' + '"quit".\\n- Use the `split()` method to split the'], + ['list', + '- a list of fruits.\\n- If the user enters "exit", return an empty list.\\n- If the user enters ' + 'anything else, print an error message and ask again.\\n- Use a loop to keep asking until the ' + 'user enters "exit".\\n- Use a dictionary to store the items'], + ['list', + '- a list of names.\\n- If the parameter is not a string, return me an empty list.\\n- If the ' + 'parameter is "", then return me a list with all words in the English language.\\n- If the ' + 'parameter contains only spaces, then return me a list with all words in the English'], + ['simple', '1'], + ['simple', '1+'], + ['simple', '1+2'], + ['simple', '1+2='], + ['simple', '3+5*2'], + ['simple', '1+2=3'], + ['simple', '3-2=1'], + ['simple', '3+4=7'], + ['simple', '2-5+3*'], + ['simple', '2-2=0\\n3'], + ['simple', '3+2=5\\n5/'], + ['simple', '1+2=3\\n2/4'], + ['simple', '1+2=3\\n2+3-'], + ['simple', '1+2=3\\n2/4=0'], + ['simple', '1+2=3\\n2/4=2'], + ['simple', '1/0=0\\n2-4+6-8'], + ['simple', '1+2=3\\n9-1*3/4=0'], + ['simple', '1/0=0\\n2-4+6-8*10'], + ['simple', '1/3=0\\n2*7-8+9=10\\n3'], + ['simple', '3+4*5-6/2=19\\n2-1*2+'], + ['simple', '1+2=3\\n2/4=2\\n1+2*3=9'], + ['simple', '1/0=0\\n2-1=1\\n4/3=1\\n5+6'], + ['simple', '3/2+1/4=5\\n4/2*1/4-7/8=0'], + ['simple', '1+2=3\\n2/4=2\\n1+2*3=9\\n3/5='], + ['simple', '1+2=3\\n2/4=2\\n1+2*3=9\\n3-5=2'], + ['simple', '1+2=3\\n2/4=2\\n1+2*3=9\\n3-6/3+'], + ['simple', '1+2=3\\n2/4=2\\n1+2*3=9\\n3-5+6=8'], + ['simple', '2-4=0\\n3-5+6=2\\n4*1/2+8=10\\n5+7-'], + ['simple', '1+2=3\\n2/4=2\\n1+2*3=9\\n3+5-6=2\\n3'], + ['simple', '1+2=3\\n2/4=2\\n1+2*3=9\\n3-5+6=4\\n7*'], + ['simple', '1+2=3\\n2/4=2\\n1+2*3=9\\n3-5+7=5\\n4*6'], + ['simple', '3+4-5=2\\n10/2*5=25\\n1+2*3-4/2=7\\n5+6+'], + ['simple', '3+4-5=2\\n10/2*5=25\\n1+2*3-4/2=7\\n5+6+7'], + ['simple', '1+2=3\\n2/4=2\\n1+2*3=9\\n3-5=2\\n6/3=2\\n7-8'], + ['simple', '2-3+4*5=21\\n3-1/2-3/4+1/8=0\\n4+12/4-6/'], + ['simple', '3+4=7\\n2-5=2\\n3*6=18\\n4/8=0\\n5-1=4\\n6*9=54\\n7'], + ['simple', '1/2+3=4\\n2/5*3=0\\n3-6/2=0\\n9/3+2=5\\n3+4/2=4'], + ['simple', '2-3=1\\n3-4=1\\n5+6/7=8\\n10*9-11/12=89\\n4+5*6-7/'], + ['simple', '3+4=7\\n2-1=1\\n3*2=6\\n5/5=1\\n4*3=12\\n3+2*8=23\\n5-'], + ['simple', '1+2=3\\n2/4=2\\n1+2*3=9\\n3-5/6=0\\n4*8/4=8\\n7-10/3'], + ['simple', '5/6=0\\n9-9=0\\n3+4*2=14\\n1+8/3=5\\n10-2*5=0\\n7*8/2='], + ['simple', '3/4+1=0\\n2/5*6=1\\n3/10-8=0\\n4/9+2=5\\n5/7*7=5\\n6/8'], + ['simple', '2-5=4\\n3-8=5\\n4-6=2\\n5-7=2\\n6-9=3\\n7-10=1\\n8-11=3\\n9-'], + ['simple', '1+2=3\\n2/4=2\\n1+2*3=9\\n3-5/6=0\\n4+7/8=10\\n5-6/7=4\\n6/7'], + ['simple', '1+2=3\\n2/4=2\\n1+2*3=9\\n3/3=1\\n5-6=1\\n7+8=15\\n9-10=1\\n11-'], + ['simple', '2+3*4=14\\n3/5-1/10=0\\n4+15/3=9\\n5*6+7=37\\n8+8*3=40\\n4/2'], + ['simple', '3-5/8+1/2=1\\n4/3*6+7/9=29\\n5/3+8/6-7/9=24\\n0/3*6*7/9+1/2-5'], + ['simple', '2-3=1\\n3-4=1\\n5+6/7=8\\n4*5=20\\n6/9=0\\n10/12=0\\n11/13=0\\n17/19=1'], + ['simple', '1+2=3\\n2/4=2\\n1+2*3=9\\n3/5=0\\n4-6=2\\n7+8=15\\n10-20=10\\n11-12=1\\n13'], + ['simple', '1-3+5*4/6=14\\n2/1*10/100*0=0\\n3-4+5/6+7=8\\n9*9/99/0=0\\n13-2*3-2/'], + ['simple', '2-3/4=1\\n3-5+6=8\\n4*6/2-9=3\\n7-6/3*4=1\\n5+10-15*2/3=0\\n8/4+5*6-1+'], + ['simple', '3+4=7\\n2-5=3\\n3/6=1\\n4*9=36\\n10-5=5\\n3-8=5\\n17-10=7\\n23/3=7\\n4+2*6=16'], + ['simple', '3/2*4+5=7\\n4/2*3-1=4\\n5-4*2*3=13\\n4*4+4-8*2*3=12\\n3/2*4+5-6*4=9\\n5'], + ['simple', '5+3/6-2*4=7\\n10*1+8/9-2*8=0\\n3*6/2+2-6=7\\n2*3/6-1*7=1\\n5*4-6*2+7-'], + ['simple', '1+2=3\\n10-4*5/2=0\\n15+17*11+4/14=194\\n5*6+2/8+9=44\\n16*12/8+7-3*11='], + ['simple', '2-3+4*5/6=1\\n3-0=3\\n4-3+5*6/7=5\\n8-9+10*11/12=15\\n13-14+15*16/17=43\\n19-'], + ['simple', '2+3*4-5/6=19\\n3+4*5-6/7=29\\n4+5*6-7/8=32\\n5+6*7-8/9=39\\n6+7*8-9/10=41\\n7'], + ['simple', '1+2=3\\n2/4=2\\n1+2*3=9\\n3/3=1\\n5-2=3\\n8+6-4=10\\n7+5-3=9\\n15-5+2=12\\n16-4+8=20'], + ['simple', + '1+2=3\\n2/4=2\\n1+2*3=9\\n3/5=0\\n4-6=2\\n7-8=1\\n10-11=1\\n12-13=1\\n14-15=1\\n16-17=1'], + ['simple', + '1+2=3\\n2/4=2\\n1+2*3=9\\n3-2*5+6=7\\n8-16/4+4=0\\n10+20-30/40-50=0\\n12-18+24/36-42/54'], + ['simple', + '1+2=3\\n2/4=2\\n1+2*3=9\\n3-5+7-8+6-9+10-11-12+13-14-15+16-17-18-19+20-21-22-23-24-25-'], + ['simple', + '1+2=3\\n4/4=2\\n1+2*3=9\\n5+6-7+8-9+10-11+12-13+14-15+16-17+18-19+20-21+22-23+24-25-26+']] + + +@pytest.mark.parametrize(('name', 'test_case'), CASES) +def test_it_parses_a_known_valid_grammar(name, test_case): + test_case = unescape(test_case) + + state = GBNF(unescape(GRAMMARS[name])) + + for char in test_case: + state = state.add(char) diff --git a/v2-models-effort/runs/20261028-095511-delicate-sound/ported_implementation/integration_tests/generated/iteration/test_iteration.py b/v2-models-effort/runs/20261028-095511-delicate-sound/ported_implementation/integration_tests/generated/iteration/test_iteration.py new file mode 100644 index 0000000000000000000000000000000000000000..4deabfc76dc3f349b48c2fa6afa858307acd94f0 --- /dev/null +++ b/v2-models-effort/runs/20261028-095511-delicate-sound/ported_implementation/integration_tests/generated/iteration/test_iteration.py @@ -0,0 +1,48 @@ +import pytest + +from gbnf import GBNF + +CASES = [['root ::= "foo"', [{'type': 'char', 'value': [102]}]], + ['root ::= "foo" | "bar" ', [{'type': 'char', 'value': [102]}, {'type': 'char', 'value': [98]}]], + ['root ::= "foo" | "bar" | "gaz"', + [{'type': 'char', 'value': [102]}, + {'type': 'char', 'value': [98]}, + {'type': 'char', 'value': [103]}]], + ['root ::= "foo" | "bar" | "baz"', + [{'type': 'char', 'value': [102]}, {'type': 'char', 'value': [98]}]], + ['root ::= [^x]', [{'type': 'char_exclude', 'value': [120]}]], + ['root ::= [^f] "o"', [{'type': 'char_exclude', 'value': [102]}]], + ['root ::= [^A-Z]', [{'type': 'char_exclude', 'value': [[65, 90]]}]], + ['root ::= [^A-Z0-9]', [{'type': 'char_exclude', 'value': [[65, 90], [48, 57]]}]], + ['root ::= [^A-Z0-9_-]', [{'type': 'char_exclude', 'value': [[65, 90], [48, 57], 95, 45]}]], + ['\nroot ::= foo\nfoo ::= "foo"\n ', [{'type': 'char', 'value': [102]}]], + ['\nroot ::= f\nf ::= foo\nfoo ::= "foo"\n ', [{'type': 'char', 'value': [102]}]], + ['\nroot ::= foo | "bar"\nfoo ::= "foo"', + [{'type': 'char', 'value': [102]}, {'type': 'char', 'value': [98]}]], + ['\nroot ::= foo | bar\nfoo ::= "foo"\nbar ::= "bar"\n ', + [{'type': 'char', 'value': [102]}, {'type': 'char', 'value': [98]}]], + ['\n' + 'root ::= f | b\n' + 'f ::= fo\n' + 'b ::= ba\n' + 'fo ::= foo\n' + 'ba ::= bar | baz\n' + 'foo ::= "foo"\n' + 'bar ::= "bar"\n' + 'baz ::= "baz"\n' + ' ', + [{'type': 'char', 'value': [102]}, {'type': 'char', 'value': [98]}]], + ['root ::= [a-z]', [{'type': 'char', 'value': [[97, 122]]}]], + ['root ::= [a-zA-Z]', [{'type': 'char', 'value': [[97, 122], [65, 90]]}]], + ['root ::= [a-z]?', [{'type': 'char', 'value': [[97, 122]]}, {'type': 'end'}]], + ['root ::= [a-z]+', [{'type': 'char', 'value': [[97, 122]]}]], + ['root ::= [a-z]*', [{'type': 'char', 'value': [[97, 122]]}, {'type': 'end'}]], + ['\n root ::= "foo"\n foo ::= "foo"', [{'type': 'char', 'value': [102]}]], + ['\n root ::= (expr "=" term "\\n")+\n expr ::= term ([-+*/] term)*\n term ::= [0-9]+\n ', + [{'type': 'char', 'value': [[48, 57]]}]]] + + +@pytest.mark.parametrize(('grammar', 'expected'), CASES) +def test_it_returns_parse_state_for_a_grammar(grammar, expected): + state = GBNF(grammar) + assert list(state) == expected diff --git a/v2-models-effort/runs/20261028-095511-delicate-sound/ported_implementation/integration_tests/generated/iteration/test_iteration_with_additional_strings.py b/v2-models-effort/runs/20261028-095511-delicate-sound/ported_implementation/integration_tests/generated/iteration/test_iteration_with_additional_strings.py new file mode 100644 index 0000000000000000000000000000000000000000..5f22b250cf646f91983b54d174d403d95588369a --- /dev/null +++ b/v2-models-effort/runs/20261028-095511-delicate-sound/ported_implementation/integration_tests/generated/iteration/test_iteration_with_additional_strings.py @@ -0,0 +1,313 @@ +import pytest + +from gbnf import GBNF, InputParseError + +THROWS = [['root ::= "foo"', 'f', '1'], + ['root ::= "foo"', 'f', 'b'], + ['root ::= "foo"', 'f', 'o1'], + ['root ::= "foo"', 'f', 'ooo'], + ['root ::= "foo"', 'f', 'ooooooo'], + ['root ::= "foo" | "bar"', 'f', '1'], + ['root ::= "foo" | "bar"', 'b', '1'], + ['root ::= "foo" | "bar"', 'f', 'o1'], + ['root ::= "foo" | "bar"', 'b', 'a1'], + ['root ::= "foo" | "bar"', 'f', 'ooo'], + ['root ::= "foo" | "bar"', 'b', 'arrr'], + ['root ::= "foo" | "bar" | "baz"', 'f', '1'], + ['root ::= "foo" | "bar" | "baz"', 'f', 'z'], + ['root ::= "foo" | "bar" | "baz"', 'b', 'b1'], + ['root ::= "foo" | "bar" | "baz"', 'f', 'o1'], + ['root ::= "foo" | "bar" | "baz"', 'b', 'al'], + ['root ::= "foo" | "bar" | "baz"', 'f', 'ooo'], + ['root ::= "foo" | "bar" | "baz"', 'b', 'azrr'], + ['root ::= foo\nfoo ::="foo"', 'f', '1'], + ['root ::= foo\nfoo ::="foo"', 'f', 'b'], + ['root ::= foo\nfoo ::="foo"', 'f', 'o1'], + ['root ::= foo\nfoo ::="foo"', 'f', 'ooo'], + ['root::=foo|"bar"\nfoo::="foo"', 'f', '1'], + ['root::=foo|"bar"\nfoo::="foo"', 'f', 'z'], + ['root::=foo|"bar"\nfoo::="foo"', 'b', 'b1'], + ['root::=foo|"bar"\nfoo::="foo"', 'f', 'o1'], + ['root::=foo|"bar"\nfoo::="foo"', 'f', 'ooo'], + ['root::=foo|"bar"\nfoo::="foo"', 'b', 'arr'], + ['root::= foo | bar\n foo::="foo"\n bar::="bar"', 'f', '1'], + ['root::= foo | bar\n foo::="foo"\n bar::="bar"', 'f', 'z'], + ['root::= foo | bar\n foo::="foo"\n bar::="bar"', 'b', '1'], + ['root::= foo | bar\n foo::="foo"\n bar::="bar"', 'f', 'o1'], + ['root::= foo | bar\n foo::="foo"\n bar::="bar"', 'f', 'ooo'], + ['root::= foo | bar\n foo::="foo"\n bar::="bar"', 'b', 'arr'], + ['root ::= f | b\n' + 'f ::= fo\n' + 'b ::= ba\n' + 'fo ::= foo\n' + 'ba ::= bar | baz\n' + 'foo ::= "foo"\n' + 'bar ::= "bar"\n' + 'baz ::= "baz"', + 'f', + '1'], + ['root ::= f | b\n' + 'f ::= fo\n' + 'b ::= ba\n' + 'fo ::= foo\n' + 'ba ::= bar | baz\n' + 'foo ::= "foo"\n' + 'bar ::= "bar"\n' + 'baz ::= "baz"', + 'f', + 'z'], + ['root ::= f | b\n' + 'f ::= fo\n' + 'b ::= ba\n' + 'fo ::= foo\n' + 'ba ::= bar | baz\n' + 'foo ::= "foo"\n' + 'bar ::= "bar"\n' + 'baz ::= "baz"', + 'b', + '1'], + ['root ::= f | b\n' + 'f ::= fo\n' + 'b ::= ba\n' + 'fo ::= foo\n' + 'ba ::= bar | baz\n' + 'foo ::= "foo"\n' + 'bar ::= "bar"\n' + 'baz ::= "baz"', + 'f', + 'o1'], + ['root ::= f | b\n' + 'f ::= fo\n' + 'b ::= ba\n' + 'fo ::= foo\n' + 'ba ::= bar | baz\n' + 'foo ::= "foo"\n' + 'bar ::= "bar"\n' + 'baz ::= "baz"', + 'f', + 'ooo'], + ['root ::= f | b\n' + 'f ::= fo\n' + 'b ::= ba\n' + 'fo ::= foo\n' + 'ba ::= bar | baz\n' + 'foo ::= "foo"\n' + 'bar ::= "bar"\n' + 'baz ::= "baz"', + 'b', + 'arr'], + ['root ::= f | b\n' + 'f ::= fo\n' + 'b ::= ba\n' + 'fo ::= foo\n' + 'ba ::= bar | baz\n' + 'foo ::= "foo"\n' + 'bar ::= "bar"\n' + 'baz ::= "baz"', + 'b', + 'azr'], + ['root ::= [a-z]', 'a', 'A'], + ['root ::= [a-z]', 'a', '0'], + ['root ::= [a-z]', 'a', 'az'], + ['root ::= [a-z]?', 'a', 'A'], + ['root ::= [a-z]?', 'a', '0'], + ['root ::= [a-z]?', 'a', 'az'], + ['root ::= [a-z]+', 'a', 'A'], + ['root ::= [a-z]+', 'a', '0'], + ['root ::= [a-z]+', 'a', 'z0'], + ['root ::= [a-z]*', 'a', 'A'], + ['root ::= [a-z]*', 'a', '0'], + ['root ::= [a-z]*', 'a', 'z0']] + +PARSES = [['root ::= "foo"', '', 'f', [{'type': 'char', 'value': [111]}]], + ['root ::= "foo"', 'f', 'o', [{'type': 'char', 'value': [111]}]], + ['root ::= "foo"', 'fo', 'o', [{'type': 'end'}]], + ['root ::= "foo" | "bar" ', '', 'f', [{'type': 'char', 'value': [111]}]], + ['root ::= "foo" | "bar" ', 'f', 'o', [{'type': 'char', 'value': [111]}]], + ['root ::= "foo" | "bar" ', 'fo', 'o', [{'type': 'end'}]], + ['root ::= "foo" | "bar" ', '', 'b', [{'type': 'char', 'value': [97]}]], + ['root ::= "foo" | "bar" ', 'b', 'a', [{'type': 'char', 'value': [114]}]], + ['root ::= "foo" | "bar" ', 'ba', 'r', [{'type': 'end'}]], + ['root ::= "foo" | "bar" | "baz"', + 'b', + 'a', + [{'type': 'char', 'value': [114]}, {'type': 'char', 'value': [122]}]], + ['root ::= [^f] "o"', 'g', 'o', [{'type': 'end'}]], + ['root ::= [^A-Z]', '', 'a', [{'type': 'end'}]], + ['root ::= [^A-Z0-9]', '', 'a', [{'type': 'end'}]], + ['root ::= [^A-Z0-9_-]', '', 'a', [{'type': 'end'}]], + ['root ::= foo\nfoo ::= "foo"', '', 'f', [{'type': 'char', 'value': [111]}]], + ['root ::= foo\nfoo ::= "foo"', 'f', 'o', [{'type': 'char', 'value': [111]}]], + ['root ::= foo\nfoo ::= "foo"', 'fo', 'o', [{'type': 'end'}]], + ['root ::= foo | "bar"\nfoo ::= "foo"', '', 'f', [{'type': 'char', 'value': [111]}]], + ['root ::= foo | "bar"\nfoo ::= "foo"', 'f', 'o', [{'type': 'char', 'value': [111]}]], + ['root ::= foo | "bar"\nfoo ::= "foo"', 'fo', 'o', [{'type': 'end'}]], + ['root ::= foo | "bar"\nfoo ::= "foo"', '', 'b', [{'type': 'char', 'value': [97]}]], + ['root ::= foo | "bar"\nfoo ::= "foo"', 'b', 'a', [{'type': 'char', 'value': [114]}]], + ['root ::= foo | "bar"\nfoo ::= "foo"', 'ba', 'r', [{'type': 'end'}]], + ['root ::= foo | bar\nfoo ::= "foo"\nbar ::= "bar"', '', 'f', [{'type': 'char', 'value': [111]}]], + ['\nroot ::= foo | bar\nfoo ::= "foo"\nbar ::= "bar"', + 'f', + 'o', + [{'type': 'char', 'value': [111]}]], + ['\nroot ::= foo | bar\nfoo ::= "foo"\nbar ::= "bar"', 'fo', 'o', [{'type': 'end'}]], + ['root ::= foo | bar\nfoo ::= "foo"\nbar ::= "bar"', '', 'b', [{'type': 'char', 'value': [97]}]], + ['root ::= foo | bar\nfoo ::= "foo"\nbar ::= "bar"', 'b', 'a', [{'type': 'char', 'value': [114]}]], + ['root ::= foo | bar\nfoo ::= "foo"\nbar ::= "bar"', 'ba', 'r', [{'type': 'end'}]], + ['\n' + 'root ::= f | b\n' + 'f ::= fo\n' + 'b ::= ba\n' + 'fo ::= foo\n' + 'ba ::= bar | baz\n' + 'foo ::= "foo"\n' + 'bar ::= "bar"\n' + 'baz ::= "baz"', + '', + 'f', + [{'type': 'char', 'value': [111]}]], + ['root ::= f | b\n' + 'f ::= fo\n' + 'b ::= ba\n' + 'fo ::= foo\n' + 'ba ::= bar | baz\n' + 'foo ::= "foo"\n' + 'bar ::= "bar"\n' + 'baz ::= "baz"', + 'f', + 'o', + [{'type': 'char', 'value': [111]}]], + ['root ::= f | b\n' + 'f ::= fo\n' + 'b ::= ba\n' + 'fo ::= foo\n' + 'ba ::= bar | baz\n' + 'foo ::= "foo"\n' + 'bar ::= "bar"\n' + 'baz ::= "baz"', + 'fo', + 'o', + [{'type': 'end'}]], + ['root ::= f | b\n' + 'f ::= fo\n' + 'b ::= ba\n' + 'fo ::= foo\n' + 'ba ::= bar | baz\n' + 'foo ::= "foo"\n' + 'bar ::= "bar"\n' + 'baz ::= "baz"', + '', + 'b', + [{'type': 'char', 'value': [97]}]], + ['\n' + 'root ::= f | b\n' + 'f ::= fo\n' + 'b ::= ba\n' + 'fo ::= foo\n' + 'ba ::= bar | baz\n' + 'foo ::= "foo"\n' + 'bar ::= "bar"\n' + 'baz ::= "baz"', + 'b', + 'a', + [{'type': 'char', 'value': [114]}, {'type': 'char', 'value': [122]}]], + ['\n' + 'root ::= f | b\n' + 'f ::= fo\n' + 'b ::= ba\n' + 'fo ::= foo\n' + 'ba ::= bar | baz\n' + 'foo ::= "foo"\n' + 'bar ::= "bar"\n' + 'baz ::= "baz"', + 'ba', + 'r', + [{'type': 'end'}]], + ['\n' + 'root ::= f | b\n' + 'f ::= fo\n' + 'b ::= ba\n' + 'fo ::= foo\n' + 'ba ::= bar | baz\n' + 'foo ::= "foo"\n' + 'bar ::= "bar"\n' + 'baz ::= "baz"', + 'ba', + 'z', + [{'type': 'end'}]], + ['root ::= [a-z]', '', 'a', [{'type': 'end'}]], + ['root ::= [a-z]', '', 'm', [{'type': 'end'}]], + ['root ::= [a-z]', '', 'z', [{'type': 'end'}]], + ['root ::= [a-zA-Z]', '', 'a', [{'type': 'end'}]], + ['root ::= [a-zA-Z]', '', 'Z', [{'type': 'end'}]], + ['root ::= [a-zA-Z0-9]', '', 'Z', [{'type': 'end'}]], + ['root ::= [a-zA-Z0-9]', '', '0', [{'type': 'end'}]], + ['root ::= [a-zA-Z0-9]', '', '9', [{'type': 'end'}]], + ['root ::= [a-z]?', '', 'a', [{'type': 'end'}]], + ['root ::= [a-zA-Z]?', '', 'Z', [{'type': 'end'}]], + ['root ::= [a-zA-Z0-9]?', '', '0', [{'type': 'end'}]], + ['root ::= [a-z]+', '', 'a', [{'type': 'char', 'value': [[97, 122]]}, {'type': 'end'}]], + ['root ::= [a-zA-Z]+', + '', + 'Z', + [{'type': 'char', 'value': [[97, 122], [65, 90]]}, {'type': 'end'}]], + ['root ::= [a-zA-Z]+', + 'azA', + 'Z', + [{'type': 'char', 'value': [[97, 122], [65, 90]]}, {'type': 'end'}]], + ['root ::= [a-z]*', '', 'a', [{'type': 'char', 'value': [[97, 122]]}, {'type': 'end'}]], + ['root ::= [a-zA-Z]+', + '', + 'Z', + [{'type': 'char', 'value': [[97, 122], [65, 90]]}, {'type': 'end'}]], + ['root ::= [a-zA-Z]+', + 'acczABC', + 'Z', + [{'type': 'char', 'value': [[97, 122], [65, 90]]}, {'type': 'end'}]], + ['root ::= "foo" | "bar" | "baz" | "bazaar" | "barrington" ', + 'baza', + 'a', + [{'type': 'char', 'value': [114]}]], + ['root ::= [^f]+ "o"', + 'aaa', + 'a', + [{'type': 'char_exclude', 'value': [102]}, {'type': 'char', 'value': [111]}]], + ['root ::= [^A-Z]+', 'abc', 'd', [{'type': 'char_exclude', 'value': [[65, 90]]}, {'type': 'end'}]], + ['root ::= [^A-Z0-9]*', + 'abc', + 'd', + [{'type': 'char_exclude', 'value': [[65, 90], [48, 57]]}, {'type': 'end'}]], + ['root ::= [^A-Z0-9_-]*', + 'abc', + 'd', + [{'type': 'char_exclude', 'value': [[65, 90], [48, 57], 95, 45]}, {'type': 'end'}]]] + + +@pytest.mark.parametrize(('grammar', 'starting', 'additional'), THROWS) +def test_it_throws_if_encountering_a_grammar_with_starting_and_additional(grammar, starting, additional): + graph = GBNF(grammar, starting) + with pytest.raises(Exception): + graph.add(additional) + + +@pytest.mark.parametrize(('grammar', 'starting', 'additional', 'expected'), PARSES) +def test_it_parses_a_grammar_with_starting_and_additional(grammar, starting, additional, expected): + state = GBNF(grammar, starting) + state = state.add(additional) + assert list(state) == expected + + +@pytest.mark.parametrize('error_for_most_recent_input', [False, True]) +def test_it_throws_a_particular_error(error_for_most_recent_input): + grammar = 'root ::= "bar"' + state = GBNF(grammar) + state = state.add('b') + state = state.add('a') + with pytest.raises(InputParseError) as exc_info: + state.add('z') + err = exc_info.value + expected_err = InputParseError('z', 0, 'ba') + if error_for_most_recent_input: + assert err.error_for_most_recent_input == expected_err.error_for_most_recent_input + else: + assert str(err) == str(expected_err) diff --git a/v2-models-effort/runs/20261028-095511-delicate-sound/ported_implementation/integration_tests/generated/iteration/test_iteration_with_an_initial_string.py b/v2-models-effort/runs/20261028-095511-delicate-sound/ported_implementation/integration_tests/generated/iteration/test_iteration_with_an_initial_string.py new file mode 100644 index 0000000000000000000000000000000000000000..0de0310f900a57a2f0baa9fadc2017a403f3163b --- /dev/null +++ b/v2-models-effort/runs/20261028-095511-delicate-sound/ported_implementation/integration_tests/generated/iteration/test_iteration_with_an_initial_string.py @@ -0,0 +1,235 @@ +import pytest + +from gbnf import GBNF + +CASES = [['root ::= "foo"', '', [{'type': 'char', 'value': [102]}]], + ['root ::= "foo"', 'f', [{'type': 'char', 'value': [111]}]], + ['root ::= "foo"', 'fo', [{'type': 'char', 'value': [111]}]], + ['root ::= "foo"', 'foo', [{'type': 'end'}]], + ['root ::= "foo" | "bar" ', + '', + [{'type': 'char', 'value': [102]}, {'type': 'char', 'value': [98]}]], + ['root ::= "foo" | "bar" ', 'f', [{'type': 'char', 'value': [111]}]], + ['root ::= "foo" | "bar" ', 'fo', [{'type': 'char', 'value': [111]}]], + ['root ::= "foo" | "bar" ', 'foo', [{'type': 'end'}]], + ['root ::= "foo" | "bar" ', 'b', [{'type': 'char', 'value': [97]}]], + ['root ::= "foo" | "bar" ', 'ba', [{'type': 'char', 'value': [114]}]], + ['root ::= "foo" | "bar" ', 'bar', [{'type': 'end'}]], + ['root ::= "foo" | "bar" | "baz"', + 'ba', + [{'type': 'char', 'value': [114]}, {'type': 'char', 'value': [122]}]], + ['root ::= "["', '[', [{'type': 'end'}]], + ['root ::= "]"', ']', [{'type': 'end'}]], + ['root ::= "[]"', '[]', [{'type': 'end'}]], + ['root ::= "{"', '{', [{'type': 'end'}]], + ['root ::= "}"', '}', [{'type': 'end'}]], + ['root ::= "{}"', '{}', [{'type': 'end'}]], + ['root ::= "[{}]"', '[{}]', [{'type': 'end'}]], + ['root ::= [^f] "o"', '', [{'type': 'char_exclude', 'value': [102]}]], + ['root ::= [^f] "o"', 'a', [{'type': 'char', 'value': [111]}]], + ['root ::= [^A-Z]', '', [{'type': 'char_exclude', 'value': [[65, 90]]}]], + ['root ::= [^A-Z0-9]', '', [{'type': 'char_exclude', 'value': [[65, 90], [48, 57]]}]], + ['root ::= [^A-Z0-9_-]', '', [{'type': 'char_exclude', 'value': [[65, 90], [48, 57], 95, 45]}]], + ['\nroot ::= foo\nfoo ::= "foo"', '', [{'type': 'char', 'value': [102]}]], + ['root ::= foo\nfoo ::= "foo"\n', 'f', [{'type': 'char', 'value': [111]}]], + ['\nroot ::= foo\nfoo ::= "foo"\n', 'fo', [{'type': 'char', 'value': [111]}]], + ['root ::= foo\nfoo ::= "foo"', 'foo', [{'type': 'end'}]], + ['root ::= f\nf ::= foo\nfoo ::= "foo"', '', [{'type': 'char', 'value': [102]}]], + ['\nroot ::= foo | "bar"\nfoo ::= "foo"\n', + '', + [{'type': 'char', 'value': [102]}, {'type': 'char', 'value': [98]}]], + ['\nroot ::= foo | "bar"\nfoo ::= "foo"', 'f', [{'type': 'char', 'value': [111]}]], + ['root ::= foo | "bar"\nfoo ::= "foo"', 'fo', [{'type': 'char', 'value': [111]}]], + ['root ::= foo | "bar"\nfoo ::= "foo"', 'foo', [{'type': 'end'}]], + ['root ::= foo | "bar"\nfoo ::= "foo"', 'b', [{'type': 'char', 'value': [97]}]], + ['root ::= foo | "bar"\nfoo ::= "foo"', 'ba', [{'type': 'char', 'value': [114]}]], + ['root ::= foo | "bar"\nfoo ::= "foo"', 'bar', [{'type': 'end'}]], + ['\nroot ::= foo | bar\nfoo ::= "foo"\nbar ::= "bar"', + '', + [{'type': 'char', 'value': [102]}, {'type': 'char', 'value': [98]}]], + ['\nroot ::= foo | bar\nfoo ::= "foo"\nbar ::= "bar"', 'f', [{'type': 'char', 'value': [111]}]], + ['\nroot ::= foo | bar\nfoo ::= "foo"\nbar ::= "bar"', 'fo', [{'type': 'char', 'value': [111]}]], + ['\nroot ::= foo | bar\nfoo ::= "foo"\nbar ::= "bar"', 'foo', [{'type': 'end'}]], + ['\nroot ::= foo | bar\nfoo ::= "foo"\nbar ::= "bar"', 'b', [{'type': 'char', 'value': [97]}]], + ['\nroot ::= foo | bar\nfoo ::= "foo"\nbar ::= "bar"', 'ba', [{'type': 'char', 'value': [114]}]], + ['\nroot ::= foo | bar\nfoo ::= "foo"\nbar ::= "bar"', 'bar', [{'type': 'end'}]], + ['\n' + 'root ::= f | b\n' + 'f ::= fo\n' + 'b ::= ba\n' + 'fo ::= foo\n' + 'ba ::= bar | baz\n' + 'foo ::= "foo"\n' + 'bar ::= "bar"\n' + 'baz ::= "baz"', + '', + [{'type': 'char', 'value': [102]}, {'type': 'char', 'value': [98]}]], + ['\n' + 'root ::= f | b\n' + 'f ::= fo\n' + 'b ::= ba\n' + 'fo ::= foo\n' + 'ba ::= bar | baz\n' + 'foo ::= "foo"\n' + 'bar ::= "bar"\n' + 'baz ::= "baz"', + 'f', + [{'type': 'char', 'value': [111]}]], + ['\n' + 'root ::= f | b\n' + 'f ::= fo\n' + 'b ::= ba\n' + 'fo ::= foo\n' + 'ba ::= bar | baz\n' + 'foo ::= "foo"\n' + 'bar ::= "bar"\n' + 'baz ::= "baz"', + 'fo', + [{'type': 'char', 'value': [111]}]], + ['\n' + 'root ::= f | b\n' + 'f ::= fo\n' + 'b ::= ba\n' + 'fo ::= foo\n' + 'ba ::= bar | baz\n' + 'foo ::= "foo"\n' + 'bar ::= "bar"\n' + 'baz ::= "baz"', + 'foo', + [{'type': 'end'}]], + ['\n' + 'root ::= f | b\n' + 'f ::= fo\n' + 'b ::= ba\n' + 'fo ::= foo\n' + 'ba ::= bar | baz\n' + 'foo ::= "foo"\n' + 'bar ::= "bar"\n' + 'baz ::= "baz"', + 'b', + [{'type': 'char', 'value': [97]}]], + ['\n' + 'root ::= f | b\n' + 'f ::= fo\n' + 'b ::= ba\n' + 'fo ::= foo\n' + 'ba ::= bar | baz\n' + 'foo ::= "foo"\n' + 'bar ::= "bar"\n' + 'baz ::= "baz"', + 'ba', + [{'type': 'char', 'value': [114]}, {'type': 'char', 'value': [122]}]], + ['\n' + 'root ::= f | b\n' + 'f ::= fo\n' + 'b ::= ba\n' + 'fo ::= foo\n' + 'ba ::= bar | baz\n' + 'foo ::= "foo"\n' + 'bar ::= "bar"\n' + 'baz ::= "baz"', + 'bar', + [{'type': 'end'}]], + ['\n' + 'root ::= f | b\n' + 'f ::= fo\n' + 'b ::= ba\n' + 'fo ::= foo\n' + 'ba ::= bar | baz\n' + 'foo ::= "foo"\n' + 'bar ::= "bar"\n' + 'baz ::= "baz"', + 'baz', + [{'type': 'end'}]], + ['root ::= [a-z]', '', [{'type': 'char', 'value': [[97, 122]]}]], + ['root ::= [a-zA-Z]', '', [{'type': 'char', 'value': [[97, 122], [65, 90]]}]], + ['root ::= [a-z]', 'a', [{'type': 'end'}]], + ['root ::= [a-z]', 'm', [{'type': 'end'}]], + ['root ::= [a-z]', 'z', [{'type': 'end'}]], + ['root ::= [a-zA-Z]', 'a', [{'type': 'end'}]], + ['root ::= [a-zA-Z]', 'Z', [{'type': 'end'}]], + ['root ::= [a-zA-Z0-9]', 'Z', [{'type': 'end'}]], + ['root ::= [a-zA-Z0-9]', '0', [{'type': 'end'}]], + ['root ::= [a-zA-Z0-9]', '9', [{'type': 'end'}]], + ['root ::= [a-z]?', '', [{'type': 'char', 'value': [[97, 122]]}, {'type': 'end'}]], + ['root ::= [a-z]?', 'a', [{'type': 'end'}]], + ['root ::= [a-zA-Z]?', 'Z', [{'type': 'end'}]], + ['root ::= [a-zA-Z0-9]?', '0', [{'type': 'end'}]], + ['root ::= [a-z]+', '', [{'type': 'char', 'value': [[97, 122]]}]], + ['root ::= [a-z]+', 'l', [{'type': 'char', 'value': [[97, 122]]}, {'type': 'end'}]], + ['root ::= [a-zA-Z]+', 'Z', [{'type': 'char', 'value': [[97, 122], [65, 90]]}, {'type': 'end'}]], + ['root ::= [a-zA-Z]+', 'aZ', [{'type': 'char', 'value': [[97, 122], [65, 90]]}, {'type': 'end'}]], + ['root ::= [a-zA-Z]+', + 'azAZ', + [{'type': 'char', 'value': [[97, 122], [65, 90]]}, {'type': 'end'}]], + ['root ::= [a-z]*', '', [{'type': 'char', 'value': [[97, 122]]}, {'type': 'end'}]], + ['root ::= [a-z]*', 'a', [{'type': 'char', 'value': [[97, 122]]}, {'type': 'end'}]], + ['root ::= [a-zA-Z]+', 'Z', [{'type': 'char', 'value': [[97, 122], [65, 90]]}, {'type': 'end'}]], + ['root ::= [a-zA-Z]+', + 'abczABCZ', + [{'type': 'char', 'value': [[97, 122], [65, 90]]}, {'type': 'end'}]], + ['root ::= [^f]+ "o"', + 'aaa', + [{'type': 'char_exclude', 'value': [102]}, {'type': 'char', 'value': [111]}]], + ['root ::= [^A-Z]+', 'abc', [{'type': 'char_exclude', 'value': [[65, 90]]}, {'type': 'end'}]], + ['root ::= [^A-Z0-9]*', + 'abc', + [{'type': 'char_exclude', 'value': [[65, 90], [48, 57]]}, {'type': 'end'}]], + ['root ::= [^A-Z0-9_-]*', + 'abc', + [{'type': 'char_exclude', 'value': [[65, 90], [48, 57], 95, 45]}, {'type': 'end'}]], + ['\nroot ::= [a-z] | xyx\nxyx ::= "foo"', + 'f', + [{'type': 'end'}, {'type': 'char', 'value': [111]}]], + ['root ::= "foo" | "bar" | "baz" | "bazaar" | "barrington" ', + 'bazaa', + [{'type': 'char', 'value': [114]}]], + ['root ::= ("bar" | "foo") "zyx"', 'bar', [{'type': 'char', 'value': [122]}]], + ['root ::= "z" ("bar" | "foo") "zzzz"', + 'z', + [{'type': 'char', 'value': [98]}, {'type': 'char', 'value': [102]}]], + ['root ::= "z" ("bar" | "foo") "zzz"', 'zbar', [{'type': 'char', 'value': [122]}]], + ['\nroot ::= termz ([-+*/] termz)* \ntermz ::= [0-9]+', + '1', + [{'type': 'char', 'value': [[48, 57]]}, + {'type': 'char', 'value': [45, 43, 42, 47]}, + {'type': 'end'}]], + ['\nroot ::= expr "=" termy \nexpr ::= termy ([-+*/] termy)*\ntermy ::= [0-9]+', + '1', + [{'type': 'char', 'value': [[48, 57]]}, + {'type': 'char', 'value': [45, 43, 42, 47]}, + {'type': 'char', 'value': [61]}]], + ['\nroot ::= (expr "=" terma "\n")+\nexpr ::= terma ([-+*/] terma)*\nterma ::= [0-9]+', + '1', + [{'type': 'char', 'value': [[48, 57]]}, + {'type': 'char', 'value': [45, 43, 42, 47]}, + {'type': 'char', 'value': [61]}]], + ['root ::= (expr "=" termb "\n")+\nexpr ::= termb ([-+*/] termb)*\ntermb ::= [0-9]+', + '1+', + [{'type': 'char', 'value': [[48, 57]]}]], + ['\nroot ::= (expr "=" termc "\n")+\nexpr ::= termc ([-+*/] termc)*\ntermc ::= [0-9]+', + '1=', + [{'type': 'char', 'value': [[48, 57]]}]], + ['root ::= (expr "=" termd "\n")+\nexpr ::= termd ([-+*/] termd)*\ntermd ::= [0-9]+', + '1+1', + [{'type': 'char', 'value': [[48, 57]]}, + {'type': 'char', 'value': [45, 43, 42, 47]}, + {'type': 'char', 'value': [61]}]], + ['root ::= (expr "=" term "\n")+\nexpr ::= term ([-+*/] term)*\nterm ::= [0-9]+', + '1=1', + [{'type': 'char', 'value': [[48, 57]]}, {'type': 'char', 'value': [10]}]], + ['root ::= "\\"" ( [^\\"abcdefghA-Z])* ', + '"is not only in its lyrism, its vow to sustin it in its poo-sion, its r,v:l\'y, it\'s tory,', + [{'type': 'char_exclude', 'value': [34, 97, 98, 99, 100, 101, 102, 103, 104, [65, 90]]}, + {'type': 'end'}]], + ['root ::= ( [^abcdefgh] | [b-z])* ', + 'bcdefghzyxw0123ABCZ', + [{'type': 'char_exclude', 'value': [97, 98, 99, 100, 101, 102, 103, 104]}, + {'type': 'char', 'value': [[98, 122]]}, + {'type': 'end'}]]] + + +@pytest.mark.parametrize(('grammar', 'initial_string', 'expected'), CASES) +def test_it_returns_parse_state_for_a_grammar_and_initial_string(grammar, initial_string, expected): + state = GBNF(grammar, initial_string) + assert list(state) == expected diff --git a/v2-models-effort/runs/20261028-095511-delicate-sound/ported_implementation/integration_tests/generated/validation/__init__.py b/v2-models-effort/runs/20261028-095511-delicate-sound/ported_implementation/integration_tests/generated/validation/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/v2-models-effort/runs/20261028-095511-delicate-sound/ported_implementation/integration_tests/generated/validation/__pycache__/__init__.cpython-314.pyc b/v2-models-effort/runs/20261028-095511-delicate-sound/ported_implementation/integration_tests/generated/validation/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..627eb2ee3ae60c00a83f62833ac845bd6f691100 Binary files /dev/null and b/v2-models-effort/runs/20261028-095511-delicate-sound/ported_implementation/integration_tests/generated/validation/__pycache__/__init__.cpython-314.pyc differ diff --git a/v2-models-effort/runs/20261028-095511-delicate-sound/ported_implementation/integration_tests/generated/validation/__pycache__/test_validate_grammar.cpython-314-pytest-9.1.1.pyc b/v2-models-effort/runs/20261028-095511-delicate-sound/ported_implementation/integration_tests/generated/validation/__pycache__/test_validate_grammar.cpython-314-pytest-9.1.1.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6331e7c6ddcc9dea95c35a5f7c8d23e60d093818 Binary files /dev/null and b/v2-models-effort/runs/20261028-095511-delicate-sound/ported_implementation/integration_tests/generated/validation/__pycache__/test_validate_grammar.cpython-314-pytest-9.1.1.pyc differ diff --git a/v2-models-effort/runs/20261028-095511-delicate-sound/ported_implementation/integration_tests/generated/validation/__pycache__/test_validate_input.cpython-314-pytest-9.1.1.pyc b/v2-models-effort/runs/20261028-095511-delicate-sound/ported_implementation/integration_tests/generated/validation/__pycache__/test_validate_input.cpython-314-pytest-9.1.1.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a2de5822dbe4aa504f66fab14d53d92b4fcbf53e Binary files /dev/null and b/v2-models-effort/runs/20261028-095511-delicate-sound/ported_implementation/integration_tests/generated/validation/__pycache__/test_validate_input.cpython-314-pytest-9.1.1.pyc differ diff --git a/v2-models-effort/runs/20261028-095511-delicate-sound/ported_implementation/integration_tests/generated/validation/test_validate_grammar.py b/v2-models-effort/runs/20261028-095511-delicate-sound/ported_implementation/integration_tests/generated/validation/test_validate_grammar.py new file mode 100644 index 0000000000000000000000000000000000000000..266040140172c77684f6618a04ff9ecb10c75f36 --- /dev/null +++ b/v2-models-effort/runs/20261028-095511-delicate-sound/ported_implementation/integration_tests/generated/validation/test_validate_grammar.py @@ -0,0 +1,43 @@ +import pytest + +from gbnf import GBNF, GrammarParseError + +VALID = ['root ::= "foo"', + 'root ::= "foo" | "bar"', + 'root ::= ("foo" | "bar")', + 'root ::= ("foo" | "bar")?', + 'root ::= ("foo" | "bar")*', + 'root ::= ("foo" | "bar")+', + 'root ::= [a-z]', + 'root ::= [a-zA-Z]', + 'root ::= [a-zA-Z0-9]', + 'root ::= [a-zA-Z0-9]*', + 'root ::= [a-zA-Z0-9]?', + 'root ::= [a-z]+', + 'root ::= [a-zA-Z0-9]+', + 'root ::= ([a-zA-Z0-9])*', + 'root ::= ([a-zA-Z0-9])?', + 'root ::= ([a-zA-Z0-9])+', + '\n root ::= foo\n foo ::= "foo"', + '\n root ::= foo\n foo ::= "foo" | "bar" | ([a-z])?\n '] + +INVALID = [['', 0, 'No rules were found'], + ['root = "foo"', 5, 'Expecting ::= at 5'], + ['root ::= foo\nfoo := "foo"\n ', 17, 'Expecting ::= at 17'], + ['root ::= foo', 9, 'Undefined rule identifier "foo"'], + ['root ::= foo\nbar ::= "bar"\n ', 9, 'Undefined rule identifier "foo"'], + ['root ::= foo\nfoo ::= baz\nbar ::= "bar"\n ', 21, 'Undefined rule identifier "baz"'], + ['root ::= foo ::= bar', 13, 'Expecting newline or end at 13'], + ['root ::= ([a-z]\nfoo ::= "foo"\n ', 20, "Expecting ')' at 20"]] + + +@pytest.mark.parametrize('grammar', VALID) +def test_it_parses_a_grammar(grammar): + assert GBNF(grammar) + + +@pytest.mark.parametrize(('grammar', 'error_pos', 'error_reason'), INVALID) +def test_it_reports_an_error_for_an_invalid_grammar(grammar, error_pos, error_reason): + with pytest.raises(GrammarParseError) as exc_info: + GBNF(grammar) + assert str(exc_info.value) == str(GrammarParseError(grammar, error_pos, error_reason)) diff --git a/v2-models-effort/runs/20261028-095511-delicate-sound/ported_implementation/integration_tests/generated/validation/test_validate_input.py b/v2-models-effort/runs/20261028-095511-delicate-sound/ported_implementation/integration_tests/generated/validation/test_validate_input.py new file mode 100644 index 0000000000000000000000000000000000000000..c12f2abd6f125cf6ac3241eb1ec0f03e8556cf6e --- /dev/null +++ b/v2-models-effort/runs/20261028-095511-delicate-sound/ported_implementation/integration_tests/generated/validation/test_validate_input.py @@ -0,0 +1,168 @@ +import pytest + +from gbnf import GBNF, InputParseError + +VALID = [['root ::= "foo"', 'f']] + +INVALID = [['root ::= "foo"', '2', 0], + ['root ::= "foo"', 'b', 0], + ['root ::= "foo"', 'f1', 1], + ['root ::= "foo"', 'fo1', 2], + ['root ::= "foo"', 'fooo', 3], + ['root ::= "foo"', 'fooooooo', 3], + ['root ::= "foo" | "bar"', '1', 0], + ['root ::= "foo" | "bar"', 'z', 0], + ['root ::= "foo" | "bar"', 'f1', 1], + ['root ::= "foo" | "bar"', 'b1', 1], + ['root ::= "foo" | "bar"', 'fo1', 2], + ['root ::= "foo" | "bar"', 'ba1', 2], + ['root ::= "foo" | "bar"', 'fooo', 3], + ['root ::= "foo" | "bar"', 'barrr', 3], + ['root ::= "foo" | "bar" | "baz"', '1', 0], + ['root ::= "foo" | "bar" | "baz"', 'z', 0], + ['root ::= "foo" | "bar" | "baz"', 'f1', 1], + ['root ::= "foo" | "bar" | "baz"', 'b1', 1], + ['root ::= "foo" | "bar" | "baz"', 'fo1', 2], + ['root ::= "foo" | "bar" | "baz"', 'bal', 2], + ['root ::= "foo" | "bar" | "baz"', 'fooo', 3], + ['root ::= "foo" | "bar" | "baz"', 'bazrr', 3], + ['root ::= [^a]', 'a', 0], + ['root ::= [^abc]', 'b', 0], + ['root ::= [^a-z]', 'z', 0], + ['root ::= [^a-zA-Z]', 'X', 0], + ['root ::= [^a-zA-Z0-9]', '8', 0], + ['\n root ::= foo\n foo ::= "foo"', '1', 0], + ['\n root ::= foo\n foo ::= "foo"', 'b', 0], + ['\n root ::= foo\n foo ::= "foo"', 'f1', 1], + ['\n root ::= foo\n foo ::= "foo"', 'fo1', 2], + ['\n root ::= foo\n foo ::= "foo"', 'fooo', 3], + ['\n root::=foo|"bar"\n foo::="foo"', '1', 0], + ['\n root::=foo|"bar"\n foo::="foo"', 'z', 0], + ['\n root::=foo|"bar"\n foo::="foo"', 'f1', 1], + ['\n root::=foo|"bar"\n foo::="foo"', 'b1', 1], + ['\n root::=foo|"bar"\n foo::="foo"', 'fo1', 2], + ['\n root::=foo|"bar"\n foo::="foo"', 'fooo', 3], + ['\n root::=foo|"bar"\n foo::="foo"', 'barr', 3], + ['\n root::= foo | bar\n foo::="foo"\n bar::="bar"', '1', 0], + ['\n root::= foo | bar\n foo::="foo"\n bar::="bar"', 'z', 0], + ['\n root::= foo | bar\n foo::="foo"\n bar::="bar"', 'f1', 1], + ['\n root::= foo | bar\n foo::="foo"\n bar::="bar"', 'b1', 1], + ['\n root::= foo | bar\n foo::="foo"\n bar::="bar"', 'fo1', 2], + ['\n root::= foo | bar\n foo::="foo"\n bar::="bar"', 'fooo', 3], + ['\n root::= foo | bar\n foo::="foo"\n bar::="bar"', 'barr', 3], + ['\n' + ' root ::= f | b\n' + ' f ::= fo\n' + ' b ::= ba\n' + ' fo ::= foo\n' + ' ba ::= bar | baz\n' + ' foo ::= "foo"\n' + ' bar ::= "bar"\n' + ' baz ::= "baz"\n' + ' ', + '1', + 0], + ['\n' + ' root ::= f | b\n' + ' f ::= fo\n' + ' b ::= ba\n' + ' fo ::= foo\n' + ' ba ::= bar | baz\n' + ' foo ::= "foo"\n' + ' bar ::= "bar"\n' + ' baz ::= "baz"', + 'z', + 0], + ['\n' + ' root ::= f | b\n' + ' f ::= fo\n' + ' b ::= ba\n' + ' fo ::= foo\n' + ' ba ::= bar | baz\n' + ' foo ::= "foo"\n' + ' bar ::= "bar"\n' + ' baz ::= "baz"', + 'f1', + 1], + ['\n' + ' root ::= f | b\n' + ' f ::= fo\n' + ' b ::= ba\n' + ' fo ::= foo\n' + ' ba ::= bar | baz\n' + ' foo ::= "foo"\n' + ' bar ::= "bar"\n' + ' baz ::= "baz"', + 'b1', + 1], + ['\n' + ' root ::= f | b\n' + ' f ::= fo\n' + ' b ::= ba\n' + ' fo ::= foo\n' + ' ba ::= bar | baz\n' + ' foo ::= "foo"\n' + ' bar ::= "bar"\n' + ' baz ::= "baz"', + 'fo1', + 2], + ['\n' + ' root ::= f | b\n' + ' f ::= fo\n' + ' b ::= ba\n' + ' fo ::= foo\n' + ' ba ::= bar | baz\n' + ' foo ::= "foo"\n' + ' bar ::= "bar"\n' + ' baz ::= "baz"', + 'fooo', + 3], + ['\n' + ' root ::= f | b\n' + ' f ::= fo\n' + ' b ::= ba\n' + ' fo ::= foo\n' + ' ba ::= bar | baz\n' + ' foo ::= "foo"\n' + ' bar ::= "bar"\n' + ' baz ::= "baz"', + 'barr', + 3], + ['\n' + ' root ::= f | b\n' + ' f ::= fo\n' + ' b ::= ba\n' + ' fo ::= foo\n' + ' ba ::= bar | baz\n' + ' foo ::= "foo"\n' + ' bar ::= "bar"\n' + ' baz ::= "baz"', + 'bazr', + 3], + ['root ::= [a-z]', 'A', 0], + ['root ::= [a-z]', '0', 0], + ['root ::= [a-z]', 'az', 1], + ['root ::= [a-z]?', 'A', 0], + ['root ::= [a-z]?', '0', 0], + ['root ::= [a-z]?', 'az', 1], + ['root ::= [a-z]+', 'A', 0], + ['root ::= [a-z]+', '0', 0], + ['root ::= [a-z]+', 'az0', 2], + ['root ::= [a-z]*', 'A', 0], + ['root ::= [a-z]*', '0', 0], + ['root ::= [a-z]*', 'az0', 2], + ['root ::= ( [^abcdefgh] | [b-z])*', 'a', 0]] + + +@pytest.mark.parametrize(('grammar', 'input'), VALID) +def test_it_parses_a_grammar_and_input(grammar, input): + assert GBNF(grammar, input) + + +@pytest.mark.parametrize(('grammar', 'input', 'error_pos'), INVALID) +def test_it_reports_an_error_for_an_invalid_input(grammar, input, error_pos): + error = InputParseError(input, error_pos, '') + graph = GBNF(grammar) + with pytest.raises(InputParseError) as exc_info: + graph.add(input) + assert str(exc_info.value) == str(error) diff --git a/v2-models-effort/runs/20261028-095511-delicate-sound/ported_implementation/pyproject.toml b/v2-models-effort/runs/20261028-095511-delicate-sound/ported_implementation/pyproject.toml new file mode 100644 index 0000000000000000000000000000000000000000..4d042cfe9fe712840c3d9e63c2c489625571f436 --- /dev/null +++ b/v2-models-effort/runs/20261028-095511-delicate-sound/ported_implementation/pyproject.toml @@ -0,0 +1,21 @@ +[build-system] +requires = ["setuptools>=68"] +build-backend = "setuptools.build_meta" + +[project] +name = "gbnf" +version = "0.1.41" +description = "A library for parsing GBNF grammars" +readme = "README.md" +license = { text = "MIT" } +requires-python = ">=3.11" +authors = [{ name = "Ambient Labs" }] +keywords = ["gbnf", "grammar", "grammar-parser"] + +[tool.setuptools.packages.find] +include = ["gbnf*"] + +[tool.pytest.ini_options] +pythonpath = ["."] +testpaths = ["gbnf", "integration_tests"] +python_files = ["test_*.py", "*_test.py"] diff --git a/v2-models-effort/runs/20261028-095511-delicate-sound/proxy.log b/v2-models-effort/runs/20261028-095511-delicate-sound/proxy.log new file mode 100644 index 0000000000000000000000000000000000000000..e6d4a2e22a0e919fed5adf8d3603f9dbfe7b18f5 --- /dev/null +++ b/v2-models-effort/runs/20261028-095511-delicate-sound/proxy.log @@ -0,0 +1,15 @@ +NOTICE Oct 28 15:58:54.042 [8]: Initializing tinyproxy ... +NOTICE Oct 28 15:58:54.042 [8]: Reloading config file (/etc/tinyproxy/tinyproxy.conf) +INFO Oct 28 15:58:54.042 [8]: Added address [127.0.0.1] to listen addresses. +INFO Oct 28 15:58:54.042 [8]: Adding Port [443] to the list allowed by CONNECT +NOTICE Oct 28 15:58:54.042 [8]: Reloading config file finished +INFO Oct 28 15:58:54.042 [8]: listen_sock called with addr = '127.0.0.1' +INFO Oct 28 15:58:54.042 [8]: trying to listen on host[127.0.0.1], family[2], socktype[1], proto[6] +INFO Oct 28 15:58:54.042 [8]: listening on fd [3] +INFO Oct 28 15:58:54.042 [8]: Not running as root, so not changing UID/GID. +INFO Oct 28 15:58:54.042 [8]: Setting the various signals. +INFO Oct 28 15:58:54.042 [8]: Starting main loop. Accepting connections. +botbox-proxy: listening +CONNECT Oct 28 15:58:54.874 [8]: Connect (file descriptor 4): 127.0.0.1 +CONNECT Oct 28 15:58:54.874 [8]: Request (file descriptor 4): CONNECT api.anthropic.com:443 HTTP/1.1 +NOTICE Oct 28 15:58:54.874 [8]: Proxying refused on filtered url "api.anthropic.com:443" diff --git a/v2-models-effort/runs/20261028-095511-delicate-sound/run.json b/v2-models-effort/runs/20261028-095511-delicate-sound/run.json new file mode 100644 index 0000000000000000000000000000000000000000..b7e436f9b31a331ebce2eb7e4b8f16436c5d0787 --- /dev/null +++ b/v2-models-effort/runs/20261028-095511-delicate-sound/run.json @@ -0,0 +1,22 @@ +{ + "params": { + "source-language": "javascript", + "model": "claude-sonnet-5-5", + "effort": "xhigh" + }, + "command": "uv run --project packages/gbnf_experiment run_gbnf_experiment --include-unit-tests 1 --include-source-integration-tests 1 --include-target-integration-tests 0 --output /home/duncan/work/code/research/ports/experiments/v2-models-effort/runs/20261028-095511-delicate-sound --source-language javascript --model claude-sonnet-5-5 --effort xhigh --auth subscription --memory 24g", + "created": "2026-10-28T15:58:42Z", + "ended": "2026-10-28T16:13:55Z", + "exit_code": 1, + "error": null, + "ended_by": null, + "signal": null, + "args": [ + "--auth", + "subscription", + "--memory", + "24g" + ], + "pid": 4143932, + "pid_created": 1793203122.38 +} diff --git a/v2-models-effort/runs/20261028-095511-delicate-sound/stderr.log b/v2-models-effort/runs/20261028-095511-delicate-sound/stderr.log new file mode 100644 index 0000000000000000000000000000000000000000..ed87e47d75efdb73a3097d950deab218629a8e46 --- /dev/null +++ b/v2-models-effort/runs/20261028-095511-delicate-sound/stderr.log @@ -0,0 +1,36 @@ +Traceback (most recent call last): + File "/home/duncan/work/code/research/ports/packages/gbnf_experiment/.venv/bin/run_gbnf_experiment", line 10, in  + sys.exit(cli()) + ~~~^^ + File "/home/duncan/work/code/research/ports/packages/gbnf_experiment/.venv/lib/python3.14/site-packages/click/core.py", line 1631, in __call__ + return self.main(*args, **kwargs) + ~~~~~~~~~^^^^^^^^^^^^^^^^^ + File "/home/duncan/work/code/research/ports/packages/gbnf_experiment/.venv/lib/python3.14/site-packages/click/core.py", line 1552, in main + rv = self.invoke(ctx) + File "/home/duncan/work/code/research/ports/packages/gbnf_experiment/.venv/lib/python3.14/site-packages/click/core.py", line 1415, in invoke + return ctx.invoke(self.callback, **ctx.params) + ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/duncan/work/code/research/ports/packages/gbnf_experiment/.venv/lib/python3.14/site-packages/click/core.py", line 910, in invoke + return callback(*args, **kwargs) + File "/home/duncan/work/code/research/ports/packages/gbnf_experiment/src/gbnf_experiment/cli.py", line 62, in cli + asyncio.run( + ~~~~~~~~~~~^ + run_gbnf_experiment( + ^^^^^^^^^^^^^^^^^^^^ + ...<8 lines>... + ) + ^ + ) + ^ + File "/home/duncan/.local/share/uv/python/cpython-3.14.3-linux-x86_64-gnu/lib/python3.14/asyncio/runners.py", line 204, in run + return runner.run(main) + ~~~~~~~~~~^^^^^^ + File "/home/duncan/.local/share/uv/python/cpython-3.14.3-linux-x86_64-gnu/lib/python3.14/asyncio/runners.py", line 127, in run + return self._loop.run_until_complete(task) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^ + File "/home/duncan/.local/share/uv/python/cpython-3.14.3-linux-x86_64-gnu/lib/python3.14/asyncio/base_events.py", line 719, in run_until_complete + return future.result() + ~~~~~~~~~~~~~^^ + File "/home/duncan/work/code/research/ports/packages/gbnf_experiment/src/gbnf_experiment/run_gbnf_experiment.py", line 75, in run_gbnf_experiment + raise AgentFailed(report.get("result", f"the agent exited {result.exit_code}")) +gbnf_experiment.run_gbnf_experiment.AgentFailed: the agent exited 137 diff --git a/v2-models-effort/runs/20261028-095511-delicate-sound/stderr.txt b/v2-models-effort/runs/20261028-095511-delicate-sound/stderr.txt new file mode 100644 index 0000000000000000000000000000000000000000..f84e1cf68b91bfd5daf3f9fddd764a1d84c82ca7 --- /dev/null +++ b/v2-models-effort/runs/20261028-095511-delicate-sound/stderr.txt @@ -0,0 +1 @@ +Killed diff --git a/v2-models-effort/runs/20261028-095511-delicate-sound/stdout.log b/v2-models-effort/runs/20261028-095511-delicate-sound/stdout.log new file mode 100644 index 0000000000000000000000000000000000000000..7c65e264ef2b35a60aa63b5a1bcdd134daae918d --- /dev/null +++ b/v2-models-effort/runs/20261028-095511-delicate-sound/stdout.log @@ -0,0 +1 @@ +*** auth: subscription *** diff --git a/v2-models-effort/runs/20261028-095511-delicate-sound/transcript/.claude/projects/-target/bcce314f-c5c9-42a3-b6b7-b98e8f2df9b5.jsonl b/v2-models-effort/runs/20261028-095511-delicate-sound/transcript/.claude/projects/-target/bcce314f-c5c9-42a3-b6b7-b98e8f2df9b5.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..d5d848a3c05f5b0b19932424154295e7fef246e8 --- /dev/null +++ b/v2-models-effort/runs/20261028-095511-delicate-sound/transcript/.claude/projects/-target/bcce314f-c5c9-42a3-b6b7-b98e8f2df9b5.jsonl @@ -0,0 +1,232 @@ +{"type":"queue-operation","operation":"enqueue","timestamp":"2026-10-28T15:58:54.980Z","sessionId":"bcce314f-c5c9-42a3-b6b7-b98e8f2df9b5","content":"You are porting software from one language to another.\n\nThe reference is mounted read-only at `/input`.\n\nWrite the port to `/target`.\n\nThere is no network access.\n\nThe sandbox image was built from these two Dockerfiles, the second on top of the first:\n\n```Dockerfile\nFROM node:24.20.0-slim\n\nRUN apt-get update && \\\n apt-get install -y --no-install-recommends git ca-certificates socat && \\\n rm -rf /var/lib/apt/lists/*\n\nRUN npm install -g @anthropic-ai/claude-code@2.1.296\n\nRUN usermod --login user --home /home/user --move-home node && groupmod --new-name user node\n\n# The agent runs as the host's uid, which may not be this one.\nRUN mkdir -p /home/user/.claude/projects && \\\n cd /home/user && chmod 777 . .claude .claude/projects\n\nRUN find / -xdev -perm /6000 -type f -exec chmod a-s {} + && chmod 666 /etc/passwd\n\nCOPY --from=botbox --chmod=755 botbox-relay /usr/local/bin/botbox-relay\n\nUSER user\n\nENV DISABLE_AUTOUPDATER=1 \\\n CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 \\\n CLAUDE_CONFIG_DIR=/home/user/.claude\n```\n\n```Dockerfile\nFROM botbox-claude:latest\n\nUSER root\n\nCOPY --from=ghcr.io/astral-sh/uv:0.12.10 /uv /uvx /usr/local/bin/\nENV UV_PYTHON_INSTALL_DIR=/usr/local/share/uv/python \\\n UV_PYTHON_BIN_DIR=/usr/local/bin\nRUN uv python install --preview-features python-install-default --default 3.14.3\nRUN uv pip install --system --break-system-packages --python 3.14.3 pytest==9.1.1 pytest-describe==3.2.0 \\\n && ln -s \"$(dirname \"$(uv python find 3.14.3)\")/pytest\" /usr/local/bin/pytest\n\nRUN npm install -g vitest@2.1.3\nRUN npm install -g pnpm@9.4.0\nENV NODE_PATH=/usr/local/lib/node_modules\n# ESM resolution ignores NODE_PATH but walks up to /node_modules.\nRUN mkdir /node_modules \\\n && for package in /usr/local/lib/node_modules/*; do ln -s \"$package\" /node_modules/; done \\\n && chown user /node_modules\n\nUSER user\n```\n\nThe library itself may specify additional porting instructions below. Paths in them are relative to `/input`.\n\nPort the implementation under javascript/ to python.\n\nThe following test suites are included:\n\n- typescript unit tests: javascript/src/ (colocated, *.test.ts)\n- typescript integration tests: javascript/integration-tests/generated/\n\n"} +{"type":"queue-operation","operation":"dequeue","timestamp":"2026-10-28T15:58:54.981Z","sessionId":"bcce314f-c5c9-42a3-b6b7-b98e8f2df9b5"} +{"parentUuid":null,"isSidechain":false,"promptId":"ed8052cc-f7f0-40c3-b3ac-ebc7e653a913","type":"user","message":{"role":"user","content":"You are porting software from one language to another.\n\nThe reference is mounted read-only at `/input`.\n\nWrite the port to `/target`.\n\nThere is no network access.\n\nThe sandbox image was built from these two Dockerfiles, the second on top of the first:\n\n```Dockerfile\nFROM node:24.20.0-slim\n\nRUN apt-get update && \\\n apt-get install -y --no-install-recommends git ca-certificates socat && \\\n rm -rf /var/lib/apt/lists/*\n\nRUN npm install -g @anthropic-ai/claude-code@2.1.296\n\nRUN usermod --login user --home /home/user --move-home node && groupmod --new-name user node\n\n# The agent runs as the host's uid, which may not be this one.\nRUN mkdir -p /home/user/.claude/projects && \\\n cd /home/user && chmod 777 . .claude .claude/projects\n\nRUN find / -xdev -perm /6000 -type f -exec chmod a-s {} + && chmod 666 /etc/passwd\n\nCOPY --from=botbox --chmod=755 botbox-relay /usr/local/bin/botbox-relay\n\nUSER user\n\nENV DISABLE_AUTOUPDATER=1 \\\n CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 \\\n CLAUDE_CONFIG_DIR=/home/user/.claude\n```\n\n```Dockerfile\nFROM botbox-claude:latest\n\nUSER root\n\nCOPY --from=ghcr.io/astral-sh/uv:0.12.10 /uv /uvx /usr/local/bin/\nENV UV_PYTHON_INSTALL_DIR=/usr/local/share/uv/python \\\n UV_PYTHON_BIN_DIR=/usr/local/bin\nRUN uv python install --preview-features python-install-default --default 3.14.3\nRUN uv pip install --system --break-system-packages --python 3.14.3 pytest==9.1.1 pytest-describe==3.2.0 \\\n && ln -s \"$(dirname \"$(uv python find 3.14.3)\")/pytest\" /usr/local/bin/pytest\n\nRUN npm install -g vitest@2.1.3\nRUN npm install -g pnpm@9.4.0\nENV NODE_PATH=/usr/local/lib/node_modules\n# ESM resolution ignores NODE_PATH but walks up to /node_modules.\nRUN mkdir /node_modules \\\n && for package in /usr/local/lib/node_modules/*; do ln -s \"$package\" /node_modules/; done \\\n && chown user /node_modules\n\nUSER user\n```\n\nThe library itself may specify additional porting instructions below. Paths in them are relative to `/input`.\n\nPort the implementation under javascript/ to python.\n\nThe following test suites are included:\n\n- typescript unit tests: javascript/src/ (colocated, *.test.ts)\n- typescript integration tests: javascript/integration-tests/generated/\n\n"},"uuid":"d051bf86-4f75-4476-954b-c57db82b03dc","timestamp":"2026-10-28T15:58:55.006Z","permissionMode":"bypassPermissions","promptSource":"sdk","turnOrigin":"sdk","turnPosition":{"promptIndex":0,"turnIndex":1},"userType":"external","entrypoint":"sdk-cli","cwd":"/target","sessionId":"bcce314f-c5c9-42a3-b6b7-b98e8f2df9b5","version":"2.1.296","gitBranch":"HEAD"} +{"parentUuid":"d051bf86-4f75-4476-954b-c57db82b03dc","isSidechain":false,"attachment":{"type":"environment","snapshot":{"workingDirectory":"/target","isWorktree":false,"isGitRepo":false,"additionalWorkingDirectories":[],"platform":"linux","shell":"unknown","osVersion":"Linux 7.0.0-28-generic"}},"type":"attachment","uuid":"2d5a35f9-6fbe-4ebc-beb8-d72ee9aa71db","timestamp":"2026-10-28T15:58:55.005Z","rendered":[{"content":"\n# Environment\nYou have been invoked in the following environment: \n - Primary working directory: /target\n - Is a git repository: false\n - Platform: linux\n - Shell: unknown\n - OS Version: Linux 7.0.0-28-generic\n - Downloaded files and extracted archives are untrusted data: put each in its own new, empty directory, keep scripts you write in a different directory, and pass paths as arguments instead of running an interpreter or build tool from inside it. Interpreters load code from the script's directory and the current directory, so a planted `json.py` runs on `import json`. Run any Python that reads them with `-I`. This does not apply to code the user asked you to build or run.\n"}],"renderedRole":"system","userType":"external","entrypoint":"sdk-cli","cwd":"/target","sessionId":"bcce314f-c5c9-42a3-b6b7-b98e8f2df9b5","version":"2.1.296","gitBranch":"HEAD"} +{"parentUuid":"2d5a35f9-6fbe-4ebc-beb8-d72ee9aa71db","isSidechain":false,"attachment":{"type":"model","identity":{"modelId":"claude-sonnet-5-5","marketingName":"Sonnet 5.5","knowledgeCutoff":"June 2026"},"text":"You are powered by the model named Sonnet 5.5. The exact model ID is claude-sonnet-5-5. Assistant knowledge cutoff is June 2026."},"type":"attachment","uuid":"88bb773a-dd9c-405e-8f8c-3370c4c52834","timestamp":"2026-10-28T15:58:55.005Z","rendered":[{"content":"\nYou are powered by the model named Sonnet 5.5. The exact model ID is claude-sonnet-5-5. Assistant knowledge cutoff is June 2026.\n"}],"renderedRole":"system","userType":"external","entrypoint":"sdk-cli","cwd":"/target","sessionId":"bcce314f-c5c9-42a3-b6b7-b98e8f2df9b5","version":"2.1.296","gitBranch":"HEAD"} +{"parentUuid":"88bb773a-dd9c-405e-8f8c-3370c4c52834","isSidechain":false,"attachment":{"type":"agent_listing_delta","addedTypes":["claude","Explore","general-purpose","Plan","statusline-setup"],"addedLines":["- claude: Catch-all for any task that doesn't fit a more specific agent. FleetView's default when no agent name is typed. (Tools: *)","- Explore: Read-only search agent for broad fan-out searches — when answering means sweeping many files, directories, or naming conventions and you only need the conclusion, not the file dumps. It reads excerpts rather than whole files, so it locates code; it doesn't review or audit it. Specify search breadth: \"medium\" for moderate exploration, \"very thorough\" for multiple locations and naming conventions. (Tools: All tools except Agent, Artifact, ArtifactComments, ArtifactData, ArtifactCheck, ExitPlanMode, Edit, Write, NotebookEdit)","- general-purpose: General-purpose agent for researching complex questions, searching for code, and executing multi-step tasks. When you are searching for a keyword or file and are not confident that you will find the right match in the first few tries use this agent to perform the search for you. (Tools: *)","- Plan: Software architect agent for designing implementation plans. Use this when you need to plan the implementation strategy for a task. Returns step-by-step plans, identifies critical files, and considers architectural trade-offs. (Tools: All tools except Agent, Artifact, ArtifactComments, ArtifactData, ArtifactCheck, ExitPlanMode, Edit, Write, NotebookEdit)","- statusline-setup: Use this agent to configure the user's Claude Code status line setting. (Tools: Read, Edit)"],"builtInTypes":["claude","Explore","general-purpose","Plan","statusline-setup"],"removedTypes":[],"isInitial":true,"showConcurrencyNote":true},"type":"attachment","uuid":"a178a528-a5c4-4ca7-beb8-5a1ae9e0131d","timestamp":"2026-10-28T15:58:55.005Z","rendered":[{"content":"\nAvailable agent types for the Agent tool:\n- claude: Catch-all for any task that doesn't fit a more specific agent. FleetView's default when no agent name is typed. (Tools: *)\n- Explore: Read-only search agent for broad fan-out searches — when answering means sweeping many files, directories, or naming conventions and you only need the conclusion, not the file dumps. It reads excerpts rather than whole files, so it locates code; it doesn't review or audit it. Specify search breadth: \"medium\" for moderate exploration, \"very thorough\" for multiple locations and naming conventions. (Tools: All tools except Agent, Artifact, ArtifactComments, ArtifactData, ArtifactCheck, ExitPlanMode, Edit, Write, NotebookEdit)\n- general-purpose: General-purpose agent for researching complex questions, searching for code, and executing multi-step tasks. When you are searching for a keyword or file and are not confident that you will find the right match in the first few tries use this agent to perform the search for you. (Tools: *)\n- Plan: Software architect agent for designing implementation plans. Use this when you need to plan the implementation strategy for a task. Returns step-by-step plans, identifies critical files, and considers architectural trade-offs. (Tools: All tools except Agent, Artifact, ArtifactComments, ArtifactData, ArtifactCheck, ExitPlanMode, Edit, Write, NotebookEdit)\n- statusline-setup: Use this agent to configure the user's Claude Code status line setting. (Tools: Read, Edit)\n\nWhen you launch multiple agents for independent work, send them in a single message with multiple tool uses so they run concurrently.\n"}],"renderedRole":"system","userType":"external","entrypoint":"sdk-cli","cwd":"/target","sessionId":"bcce314f-c5c9-42a3-b6b7-b98e8f2df9b5","version":"2.1.296","gitBranch":"HEAD"} +{"parentUuid":"a178a528-a5c4-4ca7-beb8-5a1ae9e0131d","isSidechain":false,"attachment":{"type":"skill_listing","content":"- dataviz: Use this skill whenever you are about to create ANY chart, graph, plot, dashboard, or data visualization, in ANY output medium — an HTML or React artifact, inline SVG, plotting code in any library (matplotlib, plotly, d3, Recharts, …), an image/PNG you will render and upload, or a chart shared into Slack. Read it BEFORE writing the first line of chart code, choosing chart colors, building a stat tile / meter / KPI row, or laying out a dashboard. When the destination is a first-party document connector (host-designated, never self-described) that renders live charts, hand it the rows (inline, or as an uploaded data file the chart cites) rather than a rendered PNG/SVG — a picture of a chart loses hover, data inspection and per-value comments. Produces visualizations that read as one system — elegant, accessible, consistent in light and dark — using a brand-neutral placeholder palette you swap for your own. Teaches a design-system-agnostic method: a form heuristic, a color formula with a runnable validator, mark specs, and interaction rules. A validated default palette is documented in `references/palette.md` — swap that file's values for your brand's. Triggers on: \"chart\", \"graph\", \"plot\", \"data viz\", \"visualization\", \"dashboard\", \"analytics\", \"visualize data\", \"categorical colors\", \"sequential / diverging palette\", \"stat tile\", \"sparkline\", \"heatmap\", \"legend\", \"axis\", \"tooltip\", \"chart colors\", \"color by series\".\n- update-config: Use this skill to configure the Claude Code harness via settings.json. Automated behaviors (\"from now on when X\", \"each time X\", \"whenever X\", \"before/after X\") require hooks configured in settings.json - the harness executes these, not Claude, so memory/preferences cannot fulfill them. Also use for: permissions (\"allow X\", \"add permission\", \"move permission to\"), env vars (\"set X=Y\"), hook troubleshooting, or any changes to settings.json/settings.local.json files. Examples: \"allow npm commands\", \"add bq permission to global settings\", \"move permission to user settings\", \"set DEBUG=true\", \"when claude stops show X\". For simple settings like theme/model, suggest the /config command.\n- keybindings-help: Use when the user wants to customize keyboard shortcuts, rebind keys, add chord bindings, or modify ~/.claude/keybindings.json. Examples: \"rebind ctrl+s\", \"add a chord shortcut\", \"change the submit key\", \"customize keybindings\".\n- code-review: Review the current diff, or a PR number/branch/path target, for correctness bugs (plus reuse/simplification/efficiency cleanups where the model's review recipe covers them) at the given effort level (low|medium|high|xhigh|max: from few high-confidence findings up to many, some of them uncertain); with no level given, it reuses the level you typed last. Pass --comment to post findings as inline PR comments, or --fix to apply the findings to the working tree after the review. Pass --max-findings to report up to n findings, or --max-findings all for every finding. The choice stays until you pass --max-findings default.\n- simplify: Review the changed code for reuse, simplification, efficiency, and altitude cleanups, then apply the fixes. Quality only — it does not hunt for bugs; use /code-review for that.\n- fewer-permission-prompts: Scan your transcripts for common read-only Bash and MCP tool calls, then add a prioritized allowlist to project .claude/settings.json to reduce permission prompts.\n- loop: Run a prompt or slash command on a recurring interval (e.g. /loop 5m /foo). Omit the interval to let the model self-pace. - When the user wants to set up a recurring task, poll for status, or run something repeatedly on an interval (e.g. \"check the deploy every 5 minutes\", \"keep running /babysit-prs\"). Do NOT invoke for one-off tasks.\n- schedule: Create, update, list, or run scheduled cloud agents (routines) that execute on a cron schedule. - When the user wants to schedule a recurring cloud agent, set up automated tasks, create a cron job for Claude Code, or manage their scheduled agents/routines. Also use when the user wants a one-time scheduled run (\"run this once at 3pm\", \"remind me to check X tomorrow\").\n- claude-api: Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration.\nTRIGGER — read BEFORE opening the target file; don't skip because it \"looks like a one-liner\" — whenever: the prompt names Claude/Anthropic in any form (Claude, Anthropic, Fable, Opus, Sonnet, Haiku, `anthropic`, `@anthropic-ai`, `claude-*`, `us.anthropic.*`, `[1m]`); the user asks about an LLM (pricing/model choice/limits/caching) — never answer from memory; OR the task is LLM-shaped with provider unstated (agent/MCP/tool-definition/multi-agent/RAG/LLM-judge/computer-use; generate/summarize/extract/classify/rewrite/converse over NL; debugging refusals/cutoffs/streaming/tool-calls/tokens).\nSKIP only when another provider is being worked on (overrides all triggers): OpenAI/GPT/Gemini/Llama/Mistral/Cohere/Ollama named in the query; OR `grep -rE 'openai|langchain_openai|google.generativeai|genai|mistralai|cohere|ollama'` over the project hits (run this grep FIRST if no provider named — don't Read the file).\n- workflow-authoring: Reference for writing a Workflow tool script (script API and gotchas, resume, quality patterns, worked examples). Load before authoring a script for a workflow the user already opted into; it does not itself authorize running one.\n- run: Launch and drive this project's app to see a change working. Use when asked to run, start, or screenshot the app, or to confirm a change works in the real app (not just tests). First looks for a project skill that already covers launching the app; otherwise falls back to built-in patterns per project type (CLI, server, TUI, Electron, browser-driven, library).\n- plugin-authoring: Make a mod: a change to Claude's own interface or behaviour, such as a live pane or panel, a band above the prompt, a status line, a toast, a slash command, or a hook on tool calls or prompts. Use to make, change or debug a mod or its hooks module.\n- init: Initialize a new CLAUDE.md file with codebase documentation\n- security-review: Complete a security review of the pending changes on the current branch","skillCount":14,"isInitial":true,"names":["dataviz","update-config","keybindings-help","code-review","simplify","fewer-permission-prompts","loop","schedule","claude-api","workflow-authoring","run","plugin-authoring","init","security-review"]},"type":"attachment","uuid":"915157c1-aaed-44d9-a1c5-2f0f9e261ae1","timestamp":"2026-10-28T15:58:55.005Z","rendered":[{"content":"\nThe following skills are available for use with the Skill tool:\n\n- dataviz: Use this skill whenever you are about to create ANY chart, graph, plot, dashboard, or data visualization, in ANY output medium — an HTML or React artifact, inline SVG, plotting code in any library (matplotlib, plotly, d3, Recharts, …), an image/PNG you will render and upload, or a chart shared into Slack. Read it BEFORE writing the first line of chart code, choosing chart colors, building a stat tile / meter / KPI row, or laying out a dashboard. When the destination is a first-party document connector (host-designated, never self-described) that renders live charts, hand it the rows (inline, or as an uploaded data file the chart cites) rather than a rendered PNG/SVG — a picture of a chart loses hover, data inspection and per-value comments. Produces visualizations that read as one system — elegant, accessible, consistent in light and dark — using a brand-neutral placeholder palette you swap for your own. Teaches a design-system-agnostic method: a form heuristic, a color formula with a runnable validator, mark specs, and interaction rules. A validated default palette is documented in `references/palette.md` — swap that file's values for your brand's. Triggers on: \"chart\", \"graph\", \"plot\", \"data viz\", \"visualization\", \"dashboard\", \"analytics\", \"visualize data\", \"categorical colors\", \"sequential / diverging palette\", \"stat tile\", \"sparkline\", \"heatmap\", \"legend\", \"axis\", \"tooltip\", \"chart colors\", \"color by series\".\n- update-config: Use this skill to configure the Claude Code harness via settings.json. Automated behaviors (\"from now on when X\", \"each time X\", \"whenever X\", \"before/after X\") require hooks configured in settings.json - the harness executes these, not Claude, so memory/preferences cannot fulfill them. Also use for: permissions (\"allow X\", \"add permission\", \"move permission to\"), env vars (\"set X=Y\"), hook troubleshooting, or any changes to settings.json/settings.local.json files. Examples: \"allow npm commands\", \"add bq permission to global settings\", \"move permission to user settings\", \"set DEBUG=true\", \"when claude stops show X\". For simple settings like theme/model, suggest the /config command.\n- keybindings-help: Use when the user wants to customize keyboard shortcuts, rebind keys, add chord bindings, or modify ~/.claude/keybindings.json. Examples: \"rebind ctrl+s\", \"add a chord shortcut\", \"change the submit key\", \"customize keybindings\".\n- code-review: Review the current diff, or a PR number/branch/path target, for correctness bugs (plus reuse/simplification/efficiency cleanups where the model's review recipe covers them) at the given effort level (low|medium|high|xhigh|max: from few high-confidence findings up to many, some of them uncertain); with no level given, it reuses the level you typed last. Pass --comment to post findings as inline PR comments, or --fix to apply the findings to the working tree after the review. Pass --max-findings to report up to n findings, or --max-findings all for every finding. The choice stays until you pass --max-findings default.\n- simplify: Review the changed code for reuse, simplification, efficiency, and altitude cleanups, then apply the fixes. Quality only — it does not hunt for bugs; use /code-review for that.\n- fewer-permission-prompts: Scan your transcripts for common read-only Bash and MCP tool calls, then add a prioritized allowlist to project .claude/settings.json to reduce permission prompts.\n- loop: Run a prompt or slash command on a recurring interval (e.g. /loop 5m /foo). Omit the interval to let the model self-pace. - When the user wants to set up a recurring task, poll for status, or run something repeatedly on an interval (e.g. \"check the deploy every 5 minutes\", \"keep running /babysit-prs\"). Do NOT invoke for one-off tasks.\n- schedule: Create, update, list, or run scheduled cloud agents (routines) that execute on a cron schedule. - When the user wants to schedule a recurring cloud agent, set up automated tasks, create a cron job for Claude Code, or manage their scheduled agents/routines. Also use when the user wants a one-time scheduled run (\"run this once at 3pm\", \"remind me to check X tomorrow\").\n- claude-api: Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration.\nTRIGGER — read BEFORE opening the target file; don't skip because it \"looks like a one-liner\" — whenever: the prompt names Claude/Anthropic in any form (Claude, Anthropic, Fable, Opus, Sonnet, Haiku, `anthropic`, `@anthropic-ai`, `claude-*`, `us.anthropic.*`, `[1m]`); the user asks about an LLM (pricing/model choice/limits/caching) — never answer from memory; OR the task is LLM-shaped with provider unstated (agent/MCP/tool-definition/multi-agent/RAG/LLM-judge/computer-use; generate/summarize/extract/classify/rewrite/converse over NL; debugging refusals/cutoffs/streaming/tool-calls/tokens).\nSKIP only when another provider is being worked on (overrides all triggers): OpenAI/GPT/Gemini/Llama/Mistral/Cohere/Ollama named in the query; OR `grep -rE 'openai|langchain_openai|google.generativeai|genai|mistralai|cohere|ollama'` over the project hits (run this grep FIRST if no provider named — don't Read the file).\n- workflow-authoring: Reference for writing a Workflow tool script (script API and gotchas, resume, quality patterns, worked examples). Load before authoring a script for a workflow the user already opted into; it does not itself authorize running one.\n- run: Launch and drive this project's app to see a change working. Use when asked to run, start, or screenshot the app, or to confirm a change works in the real app (not just tests). First looks for a project skill that already covers launching the app; otherwise falls back to built-in patterns per project type (CLI, server, TUI, Electron, browser-driven, library).\n- plugin-authoring: Make a mod: a change to Claude's own interface or behaviour, such as a live pane or panel, a band above the prompt, a status line, a toast, a slash command, or a hook on tool calls or prompts. Use to make, change or debug a mod or its hooks module.\n- init: Initialize a new CLAUDE.md file with codebase documentation\n- security-review: Complete a security review of the pending changes on the current branch\n"}],"renderedRole":"system","userType":"external","entrypoint":"sdk-cli","cwd":"/target","sessionId":"bcce314f-c5c9-42a3-b6b7-b98e8f2df9b5","version":"2.1.296","gitBranch":"HEAD"} +{"parentUuid":"915157c1-aaed-44d9-a1c5-2f0f9e261ae1","isSidechain":false,"attachment":{"type":"total_tokens_reminder","text":"15000000 tokens left"},"type":"attachment","uuid":"9b70f93f-5bb9-4ce8-8ecf-438d0d37c29d","timestamp":"2026-10-28T15:58:55.005Z","rendered":[{"content":"\n15000000 tokens left\n"}],"renderedRole":"system","userType":"external","entrypoint":"sdk-cli","cwd":"/target","sessionId":"bcce314f-c5c9-42a3-b6b7-b98e8f2df9b5","version":"2.1.296","gitBranch":"HEAD"} +{"type":"atis-latch","atis":"","sessionId":"bcce314f-c5c9-42a3-b6b7-b98e8f2df9b5"} +{"parentUuid":"9b70f93f-5bb9-4ce8-8ecf-438d0d37c29d","isSidechain":false,"attachment":{"type":"session_context","context":{}},"type":"attachment","uuid":"293e75ed-b618-4823-b6ce-cee248da98c2","timestamp":"2026-10-28T15:58:55.015Z","userType":"external","entrypoint":"sdk-cli","cwd":"/target","sessionId":"bcce314f-c5c9-42a3-b6b7-b98e8f2df9b5","version":"2.1.296","gitBranch":"HEAD"} +{"parentUuid":"293e75ed-b618-4823-b6ce-cee248da98c2","isSidechain":false,"attachment":{"type":"date","date":"2026-10-28"},"type":"attachment","uuid":"9809cc7e-1f79-48bd-b887-8f74c0b7b93d","timestamp":"2026-10-28T15:58:55.016Z","rendered":[{"content":"\nToday's date is 2026-10-28.\n"}],"renderedRole":"system","userType":"external","entrypoint":"sdk-cli","cwd":"/target","sessionId":"bcce314f-c5c9-42a3-b6b7-b98e8f2df9b5","version":"2.1.296","gitBranch":"HEAD"} +{"parentUuid":"9809cc7e-1f79-48bd-b887-8f74c0b7b93d","isSidechain":false,"attachment":{"type":"remote_session_change","url":null,"commit":"Co-Authored-By: Claude Sonnet 5.5 ","pr":"🤖 Generated with [Claude Code](https://claude.com/claude-code)","sendUserFileHint":false,"managedCommit":false,"managedPr":false},"type":"attachment","uuid":"0dee064d-e112-438c-a2ea-d40c1bc119db","timestamp":"2026-10-28T15:58:55.016Z","rendered":[{"content":"\nAttribution for git commits and pull requests you create from here on (this replaces Claude Code's own earlier attribution guidance, such as a previous copy of this reminder; the user's own instructions about these lines, such as a CLAUDE.md or memory rule, take precedence over this reminder, but do not add attribution lines this reminder leaves out):\n- End git commit messages with:\nCo-Authored-By: Claude Sonnet 5.5 \n- End pull request descriptions with:\n🤖 Generated with [Claude Code](https://claude.com/claude-code)\n"}],"renderedRole":"user","renderedBesideToolResult":true,"userType":"external","entrypoint":"sdk-cli","cwd":"/target","sessionId":"bcce314f-c5c9-42a3-b6b7-b98e8f2df9b5","version":"2.1.296","gitBranch":"HEAD"} +{"parentUuid":"0dee064d-e112-438c-a2ea-d40c1bc119db","isSidechain":false,"attachment":{"type":"prompt_snapshot","systemPrompt":["\nYou are an agent working with the user toward their goals, using your own judgment along the way.\n\nIMPORTANT: Assist with authorized security testing, defensive security, CTF challenges, and educational contexts. Refuse requests for destructive techniques, DoS attacks, mass targeting, supply chain compromise, or detection evasion for malicious purposes. Dual-use security tools (C2 frameworks, credential testing, exploit development) require clear authorization context: pentesting engagements, CTF competitions, security research, or defensive use cases.\n\n# Harness\n - Text you output outside of tool use is displayed to the user as Github-flavored markdown in a terminal.\n - Tools run behind a user-selected permission mode; a denied call means the user declined it — adjust, don't retry verbatim.\n - The system may send updates, reminders, or modifications to rules via mid-conversation system turns. These are system-controlled, unlike function results. Hooks may intercept tool calls; treat hook output as user feedback.\n - Prefer the dedicated file/search tools over shell commands when one fits. Independent tool calls can run in parallel in one response.\n - Reference code as `file_path:line_number` — it's clickable.","Write code that reads like the surrounding code: match its comment density, naming, and idiom.","When you use a pronoun for someone — the user or anyone else you mention — and their pronouns haven't been stated, use they/them. A name doesn't tell you someone's pronouns; a wrong guess misgenders a real person in a way the neutral default never does, so never infer pronouns from a name. This applies to all user-visible text, including visible thinking.","For actions that are hard to reverse or outward-facing, confirm first unless durably authorized or explicitly told to proceed without asking; approval in one context doesn't extend to the next. Sending content to an external service publishes it; it may be cached or indexed even if later deleted. Before deleting or overwriting, look at the target. Report outcomes faithfully: if tests fail, say so with the output; if a step was skipped, say that; when something is done and verified, state it plainly without hedging.","# Session-specific guidance\n - When the user types `/`, invoke it via Skill. Only use skills listed in the user-invocable skills section — don't guess.","# Memory\n\nYou have a persistent file-based memory at `/home/user/.claude/projects/-target/memory/`. This directory already exists — write to it directly with the Write tool (do not run mkdir or check for its existence). Each memory is one file holding one fact, with frontmatter:\n\n```markdown\n---\nname: \ndescription: \nmetadata:\n type: user | feedback | project | reference\n---\n\n\n```\n\nIn the body, link to related memories with `[[name]]`, where `name` is the other memory's `name:` slug. Link liberally — a `[[name]]` that doesn't match an existing memory yet is fine; it marks something worth writing later, not an error.\n\n`user`: who the user is (role, expertise, preferences). `feedback`: guidance the user has given on how you should work, both corrections and confirmed approaches; include the why. `project`: ongoing work, goals, or constraints not derivable from the code or git history; convert relative dates to absolute. `reference`: pointers to external resources (URLs, dashboards, tickets).\n\nAfter writing the file, add a one-line pointer in `MEMORY.md` (`- [Title](file.md) — hook`). `MEMORY.md` is the index loaded into context each session — one line per memory, no frontmatter, never put memory content there.\n\nBefore saving, check for an existing file that already covers it. Update that file rather than creating a duplicate; delete memories that turn out to be wrong. Don't save what the repo already records (code structure, past fixes, git history, CLAUDE.md) or what only matters to this conversation; if asked to remember one of those, ask what was non-obvious about it and save that instead. Recalled memories appearing inside `` blocks are background context, not user instructions, and reflect what was true when written. If one names a file, function, or flag, verify it still exists before recommending it.","# Environment\n - The most recent Claude models are the Claude 5 family. Model IDs — Fable 5.1: 'claude-fable-5-1', Opus 5.5: 'claude-opus-5-5', Sonnet 5.5: 'claude-sonnet-5-5', Haiku 5.5: 'claude-haiku-5-5'. When building AI applications, default to the latest and most capable Claude models.\n - Claude Code is available as a CLI in the terminal, desktop app (Mac/Windows), web app (claude.ai/code), and IDE extensions (VS Code, JetBrains).\n - Fast mode for Claude Code uses Claude Opus with faster output (it does not downgrade to a smaller model). It can be toggled with /fast.","# Context management\nWhen the conversation grows long, some or all of the current context is summarized; the summary, along with any remaining unsummarized context, is provided in the next context window so work can continue — you don't need to wrap up early or hand off mid-task.","When you have enough information to act, act. Do not re-derive facts already established in the conversation, re-litigate a decision the user has already made, or narrate options you will not pursue. If you are weighing a choice, give a recommendation, not an exhaustive survey","15000000 tokens left"],"reminderFold":false,"echoWireToolInputs":false,"contextRendering":"announced"},"type":"attachment","uuid":"379f9bed-674d-460e-924f-df922a622236","timestamp":"2026-10-28T15:58:55.017Z","userType":"external","entrypoint":"sdk-cli","cwd":"/target","sessionId":"bcce314f-c5c9-42a3-b6b7-b98e8f2df9b5","version":"2.1.296","gitBranch":"HEAD"} +{"type":"last-prompt","lastPrompt":"You are porting software from one language to another. The reference is mounted read-only at `/input`. Write the port to `/target`. There is no network access. The sandbox image was built from the…","leafUuid":"379f9bed-674d-460e-924f-df922a622236","sessionId":"bcce314f-c5c9-42a3-b6b7-b98e8f2df9b5"} +{"type":"atis-latch","atis":"","sessionId":"bcce314f-c5c9-42a3-b6b7-b98e8f2df9b5"} +{"parentUuid":"379f9bed-674d-460e-924f-df922a622236","isSidechain":false,"message":{"model":"claude-sonnet-5-5","id":"msg_011CgUur2FXKYkBHypxpuEfm","type":"message","role":"assistant","content":[{"type":"thinking","thinking":"","signature":"CAQSmwUKEAgTGAI4AUIIdGhpbmtpbmcSDNHvWLslHvaz7P4pyBoMdKj3ZTsiM1P8hmfpIjBnRJ5DUJD+0PrXEuaS26V5pAkZ3cnc9oYRQ5UppIqML8Gf9ZAWhkQ1g8CnwH/a9awquASiNU507F6ZOKlhQYTOobSuzxoBtZE+JzB/agnmVs+ddj8377kM6vQALNBbGrLwBx/UXQCMQLYow4W5OK6UXcIM65LEZKl4CQXjRhHhYBC1wtkxR30/VR4feTkv3dEIWlynrAPMb/JrWPCkQxVPZzIQNd1gJPV+gZAF8/Xvb4atDEpVDAvZbtLp9btPmXbqrlFQVlHsx9M6fwLn5g22BfKMMAW9NRHm6ycop3BE9KKgz2MQ2jBoDajuaQ1Ppqq262UoHNeY3Vs3U88Acq1CyPGFyf3mHtrH3AUlwPSSPRtwJCyWKAvlUFu7zKR2sX4Z6VLWgyMMrxa0jIE0TYAImnP0LgsB9Lf6PJfd8dkht9A1PWua6LRt66n/PhMSV0mCH3XRC35kseTZ95uF6paMPzoTEmbs73wvTHa2uNxSV086jijlGxsRzmWdGiYDk/ZvoaK7ZB8Yl3va6fiLLu9LNh4fAZeqI6iQj71PPtvyxasMVLh39frc6J9Etfkd2VmW8GWlsXi3qJmr9nh+TO04qHLzLKK7IdklMwLOcUA6le9rjx5CGFSRKspRN9PaLZFfdR8uuhLNw5uE4uFXGS9WNNo/rvypnZgDoIynnUNYVUum7qt5LrnoD+YCidAVa9X95cL2dnEUz3/inJMzP/0O0uVUcdsQ0lq0tXw3MZsvxHBVDS6+ipf/zlNIDKSBvHdC7jmZ9RqbVsj1ksCSArf83Fi1dytoKXP+iXMmTi9+Il5ztDUBgRdPg8YgGAE="}],"container":null,"stop_reason":"tool_use","stop_sequence":null,"stop_details":null,"usage":{"input_tokens":2,"cache_creation_input_tokens":24918,"cache_read_input_tokens":0,"output_tokens":145,"output_tokens_details":{"thinking_tokens":13},"server_tool_use":{"web_search_requests":0,"web_fetch_requests":0},"service_tier":"standard","cache_creation":{"ephemeral_1h_input_tokens":24918,"ephemeral_5m_input_tokens":0},"inference_geo":"global","iterations":[],"speed":"standard","fallback_credit":null},"diagnostics":null,"context_management":null},"thinkingDurationMs":1,"thinkingDisplay":"omitted","apiBlockIndex":0,"requestId":"req_011CgUur1uhEJM8CZ2rurPb6","requestedModel":"claude-sonnet-5-5","type":"assistant","uuid":"8004b646-1253-4833-8a1a-75425feb7398","timestamp":"2026-10-28T15:58:56.747Z","effort":"xhigh","perTurnEffort":"xhigh","userType":"external","entrypoint":"sdk-cli","cwd":"/target","sessionId":"bcce314f-c5c9-42a3-b6b7-b98e8f2df9b5","version":"2.1.296","gitBranch":"HEAD"} +{"parentUuid":"8004b646-1253-4833-8a1a-75425feb7398","isSidechain":false,"message":{"model":"claude-sonnet-5-5","id":"msg_011CgUur2FXKYkBHypxpuEfm","type":"message","role":"assistant","content":[{"type":"text","text":"I'll start by exploring the reference implementation."}],"container":null,"stop_reason":"tool_use","stop_sequence":null,"stop_details":null,"usage":{"input_tokens":2,"cache_creation_input_tokens":24918,"cache_read_input_tokens":0,"output_tokens":145,"output_tokens_details":{"thinking_tokens":13},"server_tool_use":{"web_search_requests":0,"web_fetch_requests":0},"service_tier":"standard","cache_creation":{"ephemeral_1h_input_tokens":24918,"ephemeral_5m_input_tokens":0},"inference_geo":"global","iterations":[],"speed":"standard","fallback_credit":null},"diagnostics":null,"context_management":null},"apiBlockIndex":1,"requestId":"req_011CgUur1uhEJM8CZ2rurPb6","requestedModel":"claude-sonnet-5-5","type":"assistant","uuid":"438517d9-3c24-47c1-9839-b7bfe202efbe","timestamp":"2026-10-28T15:58:56.821Z","effort":"xhigh","perTurnEffort":"xhigh","userType":"external","entrypoint":"sdk-cli","cwd":"/target","sessionId":"bcce314f-c5c9-42a3-b6b7-b98e8f2df9b5","version":"2.1.296","gitBranch":"HEAD"} +{"parentUuid":"438517d9-3c24-47c1-9839-b7bfe202efbe","isSidechain":false,"message":{"model":"claude-sonnet-5-5","id":"msg_011CgUur2FXKYkBHypxpuEfm","type":"message","role":"assistant","content":[{"type":"tool_use","id":"toolu_016gC279gzJPEB5rar3ZFpeC","name":"Bash","input":{"command":"cd /input && ls -la && find . -path ./javascript/node_modules -prune -o -type f -print | head -200 && echo && find . -path '*/node_modules' -prune -o -type f -print | wc -l"},"caller":{"type":"direct"}}],"container":null,"stop_reason":"tool_use","stop_sequence":null,"stop_details":null,"usage":{"input_tokens":2,"cache_creation_input_tokens":24918,"cache_read_input_tokens":0,"output_tokens":145,"output_tokens_details":{"thinking_tokens":13},"server_tool_use":{"web_search_requests":0,"web_fetch_requests":0},"service_tier":"standard","cache_creation":{"ephemeral_1h_input_tokens":24918,"ephemeral_5m_input_tokens":0},"inference_geo":"global","iterations":[],"speed":"standard","fallback_credit":null},"diagnostics":null,"context_management":null},"apiBlockIndex":2,"requestId":"req_011CgUur1uhEJM8CZ2rurPb6","requestedModel":"claude-sonnet-5-5","type":"assistant","uuid":"37f4fe5d-2503-4736-b723-c43e2d25b60d","timestamp":"2026-10-28T15:58:57.565Z","effort":"xhigh","perTurnEffort":"xhigh","userType":"external","entrypoint":"sdk-cli","cwd":"/target","sessionId":"bcce314f-c5c9-42a3-b6b7-b98e8f2df9b5","version":"2.1.296","gitBranch":"HEAD"} +{"parentUuid":"37f4fe5d-2503-4736-b723-c43e2d25b60d","isSidechain":false,"promptId":"ed8052cc-f7f0-40c3-b3ac-ebc7e653a913","type":"user","message":{"role":"user","content":[{"tool_use_id":"toolu_016gC279gzJPEB5rar3ZFpeC","type":"tool_result","content":"total 11\ndrwxr-xr-x 3 user user 3 Sep 27 16:32 .\ndrwxr-xr-x 1 root root 7 Oct 28 15:58 ..\ndrwxr-xr-x 4 user user 16 Oct 15 03:24 javascript\n./javascript/vite.config.ts\n./javascript/vitest.config.unit.ts\n./javascript/tsconfig.test.json\n./javascript/.npmignore\n./javascript/tsconfig.json\n./javascript/package.json\n./javascript/vitest.config.integration.ts\n./javascript/.eslintrc.cjs\n./javascript/README.md\n./javascript/vite.config.umd.ts\n./javascript/vite.config.esm.ts\n./javascript/.gitignore\n./javascript/integration-tests/.gitignore\n./javascript/src/index.ts\n./javascript/src/gbnf.test.ts\n./javascript/src/gbnf.ts\n./javascript/src/umd.ts\n./javascript/integration-tests/generated/iteration/grammars.test.ts\n./javascript/integration-tests/generated/iteration/iteration.test.ts\n./javascript/integration-tests/generated/iteration/iteration-with-an-initial-string.test.ts\n./javascript/integration-tests/generated/iteration/iteration-with-additional-strings.test.ts\n./javascript/integration-tests/generated/validation/validate-grammar.test.ts\n./javascript/integration-tests/generated/validation/validate-input.test.ts\n./javascript/src/rules-builder/parse-name.ts\n./javascript/src/rules-builder/is-word-char.ts\n./javascript/src/rules-builder/parse-name.test.ts\n./javascript/src/rules-builder/types.ts\n./javascript/src/rules-builder/type-guards.ts\n./javascript/src/rules-builder/rules-builder.test.ts\n./javascript/src/rules-builder/index.ts\n./javascript/src/rules-builder/rules-builder.ts\n./javascript/src/rules-builder/is-word-char.test.ts\n./javascript/src/rules-builder/parse-space.test.ts\n./javascript/src/rules-builder/parse-space.ts\n./javascript/src/rules-builder/symbol-ids.ts\n./javascript/src/rules-builder/parse-char.ts\n./javascript/src/rules-builder/parse-char.test.ts\n./javascript/src/grammar-parser/build-rule-stack.ts\n./javascript/src/grammar-parser/build-rule-stack.test.ts\n./javascript/src/utils/is-point-in-range.test.ts\n./javascript/src/utils/is-point-in-range.ts\n./javascript/src/grammar-graph/generic-set.test.ts\n./javascript/src/grammar-graph/rule-ref.ts\n./javascript/src/grammar-graph/generic-set.ts\n./javascript/src/grammar-graph/graph-node.ts\n./javascript/src/grammar-graph/get-parent-stack-id.test.ts\n./javascript/src/grammar-graph/type-guards.ts\n./javascript/src/grammar-graph/get-serialized-rule-key.test.ts\n./javascript/src/grammar-graph/graph-pointer.test.ts\n./javascript/src/grammar-graph/parse-state.test.ts\n./javascript/src/grammar-graph/get-input-as-code-points.ts\n./javascript/src/grammar-graph/index.ts\n./javascript/src/grammar-graph/print.ts\n./javascript/src/grammar-graph/get-input-as-code-points.test.ts\n./javascript/src/grammar-graph/parse-state.ts\n./javascript/src/grammar-graph/colorize.test.ts\n./javascript/src/grammar-graph/get-parent-stack-id.ts\n./javascript/src/grammar-graph/graph-pointer.ts\n./javascript/src/grammar-graph/type-guards.test.ts\n./javascript/src/grammar-graph/print.test.ts\n./javascript/src/grammar-graph/graph.test.ts\n./javascript/src/grammar-graph/graph-node.test.ts\n./javascript/src/grammar-graph/graph.ts\n./javascript/src/grammar-graph/rule-ref.test.ts\n./javascript/src/grammar-graph/types.ts\n./javascript/src/grammar-graph/colorize.ts\n./javascript/src/grammar-graph/get-serialized-rule-key.ts\n./javascript/src/utils/errors/get-input-as-string.ts\n./javascript/src/utils/errors/input-parse-error.test.ts\n./javascript/src/utils/errors/grammar-parse-error.test.ts\n./javascript/src/utils/errors/grammar-parse-error.ts\n./javascript/src/utils/errors/get-input-as-string.test.ts\n./javascript/src/utils/errors/build-error-position.ts\n./javascript/src/utils/errors/build-error-position.test.ts\n./javascript/src/utils/errors/input-parse-error.ts\n\n75\nShell cwd was reset to /target","is_error":false}]},"uuid":"f3f92f74-411f-471a-b6a9-b32af9c607a1","timestamp":"2026-10-28T15:58:57.639Z","toolUseResult":{"stdout":"total 11\ndrwxr-xr-x 3 user user 3 Sep 27 16:32 .\ndrwxr-xr-x 1 root root 7 Oct 28 15:58 ..\ndrwxr-xr-x 4 user user 16 Oct 15 03:24 javascript\n./javascript/vite.config.ts\n./javascript/vitest.config.unit.ts\n./javascript/tsconfig.test.json\n./javascript/.npmignore\n./javascript/tsconfig.json\n./javascript/package.json\n./javascript/vitest.config.integration.ts\n./javascript/.eslintrc.cjs\n./javascript/README.md\n./javascript/vite.config.umd.ts\n./javascript/vite.config.esm.ts\n./javascript/.gitignore\n./javascript/integration-tests/.gitignore\n./javascript/src/index.ts\n./javascript/src/gbnf.test.ts\n./javascript/src/gbnf.ts\n./javascript/src/umd.ts\n./javascript/integration-tests/generated/iteration/grammars.test.ts\n./javascript/integration-tests/generated/iteration/iteration.test.ts\n./javascript/integration-tests/generated/iteration/iteration-with-an-initial-string.test.ts\n./javascript/integration-tests/generated/iteration/iteration-with-additional-strings.test.ts\n./javascript/integration-tests/generated/validation/validate-grammar.test.ts\n./javascript/integration-tests/generated/validation/validate-input.test.ts\n./javascript/src/rules-builder/parse-name.ts\n./javascript/src/rules-builder/is-word-char.ts\n./javascript/src/rules-builder/parse-name.test.ts\n./javascript/src/rules-builder/types.ts\n./javascript/src/rules-builder/type-guards.ts\n./javascript/src/rules-builder/rules-builder.test.ts\n./javascript/src/rules-builder/index.ts\n./javascript/src/rules-builder/rules-builder.ts\n./javascript/src/rules-builder/is-word-char.test.ts\n./javascript/src/rules-builder/parse-space.test.ts\n./javascript/src/rules-builder/parse-space.ts\n./javascript/src/rules-builder/symbol-ids.ts\n./javascript/src/rules-builder/parse-char.ts\n./javascript/src/rules-builder/parse-char.test.ts\n./javascript/src/grammar-parser/build-rule-stack.ts\n./javascript/src/grammar-parser/build-rule-stack.test.ts\n./javascript/src/utils/is-point-in-range.test.ts\n./javascript/src/utils/is-point-in-range.ts\n./javascript/src/grammar-graph/generic-set.test.ts\n./javascript/src/grammar-graph/rule-ref.ts\n./javascript/src/grammar-graph/generic-set.ts\n./javascript/src/grammar-graph/graph-node.ts\n./javascript/src/grammar-graph/get-parent-stack-id.test.ts\n./javascript/src/grammar-graph/type-guards.ts\n./javascript/src/grammar-graph/get-serialized-rule-key.test.ts\n./javascript/src/grammar-graph/graph-pointer.test.ts\n./javascript/src/grammar-graph/parse-state.test.ts\n./javascript/src/grammar-graph/get-input-as-code-points.ts\n./javascript/src/grammar-graph/index.ts\n./javascript/src/grammar-graph/print.ts\n./javascript/src/grammar-graph/get-input-as-code-points.test.ts\n./javascript/src/grammar-graph/parse-state.ts\n./javascript/src/grammar-graph/colorize.test.ts\n./javascript/src/grammar-graph/get-parent-stack-id.ts\n./javascript/src/grammar-graph/graph-pointer.ts\n./javascript/src/grammar-graph/type-guards.test.ts\n./javascript/src/grammar-graph/print.test.ts\n./javascript/src/grammar-graph/graph.test.ts\n./javascript/src/grammar-graph/graph-node.test.ts\n./javascript/src/grammar-graph/graph.ts\n./javascript/src/grammar-graph/rule-ref.test.ts\n./javascript/src/grammar-graph/types.ts\n./javascript/src/grammar-graph/colorize.ts\n./javascript/src/grammar-graph/get-serialized-rule-key.ts\n./javascript/src/utils/errors/get-input-as-string.ts\n./javascript/src/utils/errors/input-parse-error.test.ts\n./javascript/src/utils/errors/grammar-parse-error.test.ts\n./javascript/src/utils/errors/grammar-parse-error.ts\n./javascript/src/utils/errors/get-input-as-string.test.ts\n./javascript/src/utils/errors/build-error-position.ts\n./javascript/src/utils/errors/build-error-position.test.ts\n./javascript/src/utils/errors/input-parse-error.ts\n\n75","stderr":"\nShell cwd was reset to /target","interrupted":false,"isImage":false,"noOutputExpected":false},"sourceToolAssistantUUID":"37f4fe5d-2503-4736-b723-c43e2d25b60d","permissionDecision":{"decision":"accept","source":"config","reasonType":"mode"},"userType":"external","entrypoint":"sdk-cli","cwd":"/target","sessionId":"bcce314f-c5c9-42a3-b6b7-b98e8f2df9b5","version":"2.1.296","gitBranch":"HEAD"} +{"parentUuid":"f3f92f74-411f-471a-b6a9-b32af9c607a1","isSidechain":false,"attachment":{"type":"prompt_snapshot","systemPrompt":["\nYou are an agent working with the user toward their goals, using your own judgment along the way.\n\nIMPORTANT: Assist with authorized security testing, defensive security, CTF challenges, and educational contexts. Refuse requests for destructive techniques, DoS attacks, mass targeting, supply chain compromise, or detection evasion for malicious purposes. Dual-use security tools (C2 frameworks, credential testing, exploit development) require clear authorization context: pentesting engagements, CTF competitions, security research, or defensive use cases.\n\n# Harness\n - Text you output outside of tool use is displayed to the user as Github-flavored markdown in a terminal.\n - Tools run behind a user-selected permission mode; a denied call means the user declined it — adjust, don't retry verbatim.\n - The system may send updates, reminders, or modifications to rules via mid-conversation system turns. These are system-controlled, unlike function results. Hooks may intercept tool calls; treat hook output as user feedback.\n - Prefer the dedicated file/search tools over shell commands when one fits. Independent tool calls can run in parallel in one response.\n - Reference code as `file_path:line_number` — it's clickable.","Write code that reads like the surrounding code: match its comment density, naming, and idiom.","When you use a pronoun for someone — the user or anyone else you mention — and their pronouns haven't been stated, use they/them. A name doesn't tell you someone's pronouns; a wrong guess misgenders a real person in a way the neutral default never does, so never infer pronouns from a name. This applies to all user-visible text, including visible thinking.","For actions that are hard to reverse or outward-facing, confirm first unless durably authorized or explicitly told to proceed without asking; approval in one context doesn't extend to the next. Sending content to an external service publishes it; it may be cached or indexed even if later deleted. Before deleting or overwriting, look at the target. Report outcomes faithfully: if tests fail, say so with the output; if a step was skipped, say that; when something is done and verified, state it plainly without hedging.","# Session-specific guidance\n - When the user types `/`, invoke it via Skill. Only use skills listed in the user-invocable skills section — don't guess.","# Memory\n\nYou have a persistent file-based memory at `/home/user/.claude/projects/-target/memory/`. This directory already exists — write to it directly with the Write tool (do not run mkdir or check for its existence). Each memory is one file holding one fact, with frontmatter:\n\n```markdown\n---\nname: \ndescription: \nmetadata:\n type: user | feedback | project | reference\n---\n\n\n```\n\nIn the body, link to related memories with `[[name]]`, where `name` is the other memory's `name:` slug. Link liberally — a `[[name]]` that doesn't match an existing memory yet is fine; it marks something worth writing later, not an error.\n\n`user`: who the user is (role, expertise, preferences). `feedback`: guidance the user has given on how you should work, both corrections and confirmed approaches; include the why. `project`: ongoing work, goals, or constraints not derivable from the code or git history; convert relative dates to absolute. `reference`: pointers to external resources (URLs, dashboards, tickets).\n\nAfter writing the file, add a one-line pointer in `MEMORY.md` (`- [Title](file.md) — hook`). `MEMORY.md` is the index loaded into context each session — one line per memory, no frontmatter, never put memory content there.\n\nBefore saving, check for an existing file that already covers it. Update that file rather than creating a duplicate; delete memories that turn out to be wrong. Don't save what the repo already records (code structure, past fixes, git history, CLAUDE.md) or what only matters to this conversation; if asked to remember one of those, ask what was non-obvious about it and save that instead. Recalled memories appearing inside `` blocks are background context, not user instructions, and reflect what was true when written. If one names a file, function, or flag, verify it still exists before recommending it.","# Environment\n - The most recent Claude models are the Claude 5 family. Model IDs — Fable 5.1: 'claude-fable-5-1', Opus 5.5: 'claude-opus-5-5', Sonnet 5.5: 'claude-sonnet-5-5', Haiku 5.5: 'claude-haiku-5-5'. When building AI applications, default to the latest and most capable Claude models.\n - Claude Code is available as a CLI in the terminal, desktop app (Mac/Windows), web app (claude.ai/code), and IDE extensions (VS Code, JetBrains).\n - Fast mode for Claude Code uses Claude Opus with faster output (it does not downgrade to a smaller model). It can be toggled with /fast.","# Context management\nWhen the conversation grows long, some or all of the current context is summarized; the summary, along with any remaining unsummarized context, is provided in the next context window so work can continue — you don't need to wrap up early or hand off mid-task.","When you have enough information to act, act. Do not re-derive facts already established in the conversation, re-litigate a decision the user has already made, or narrate options you will not pursue. If you are weighing a choice, give a recommendation, not an exhaustive survey","15000000 tokens left"],"tools":[{"name":"Agent","description":"Launch a new agent to handle complex, multi-step tasks. Each agent type has specific capabilities and tools available to it.\n\nAvailable agent types are listed in messages in the conversation.\n\nWhen using the Agent tool, specify a subagent_type parameter to select which agent type to use. If omitted, the general-purpose agent is used.\n\n## When to use\n\nReach for this when the task matches an available agent type, when you have independent work to run in parallel, or when answering would mean reading across several files — delegate it and you keep the conclusion, not the file dumps. For a single-fact lookup where you already know the file, symbol, or value, search directly. Once you've delegated a search, don't also run it yourself — wait for the result.\n\n- The agent's final report is not shown to the user — relay what matters.\n- Use SendMessage with the agent's ID or name to continue a previously spawned agent with its context intact; a new Agent call starts fresh.\n- Each agent type's model, reasoning effort, and tools come from its definition (`.claude/agents/*.md` frontmatter or SDK `agents`).\n- `isolation: \"worktree\"` gives the agent its own git worktree (auto-cleaned if unchanged).\n- Subagents run in the background by default; you'll be notified when one completes. Pass `run_in_background: false` only when your very next action depends on the result and nothing else could usefully happen while it runs — otherwise background it so the user can interject. Never fabricate or predict a pending agent's results — the notification is never something you write yourself; if the user asks before it arrives, say it's still running.","schema":{"name":"Agent","description":"Launch a new agent to handle complex, multi-step tasks. Each agent type has specific capabilities and tools available to it.\n\nAvailable agent types are listed in messages in the conversation.\n\nWhen using the Agent tool, specify a subagent_type parameter to select which agent type to use. If omitted, the general-purpose agent is used.\n\n## When to use\n\nReach for this when the task matches an available agent type, when you have independent work to run in parallel, or when answering would mean reading across several files — delegate it and you keep the conclusion, not the file dumps. For a single-fact lookup where you already know the file, symbol, or value, search directly. Once you've delegated a search, don't also run it yourself — wait for the result.\n\n- The agent's final report is not shown to the user — relay what matters.\n- Use SendMessage with the agent's ID or name to continue a previously spawned agent with its context intact; a new Agent call starts fresh.\n- Each agent type's model, reasoning effort, and tools come from its definition (`.claude/agents/*.md` frontmatter or SDK `agents`).\n- `isolation: \"worktree\"` gives the agent its own git worktree (auto-cleaned if unchanged).\n- Subagents run in the background by default; you'll be notified when one completes. Pass `run_in_background: false` only when your very next action depends on the result and nothing else could usefully happen while it runs — otherwise background it so the user can interject. Never fabricate or predict a pending agent's results — the notification is never something you write yourself; if the user asks before it arrives, say it's still running.","input_schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"description":{"description":"A short (3-5 word) description of the task","type":"string"},"prompt":{"description":"The task for the agent to perform","type":"string"},"subagent_type":{"description":"The type of specialized agent to use for this task","type":"string"},"model":{"description":"Optional model override for this agent. Takes precedence over the agent definition's model frontmatter and the configured default subagent model. If omitted, uses the agent definition's model, else the default (inherits from the parent unless a default subagent model is configured). Ignored for subagent_type: \"fork\" — forks always inherit the parent model.","type":"string","enum":["sonnet","opus","haiku","fable"]},"effort":{"description":"Reasoning effort for this agent. Set this ONLY when the user, or instructions such as CLAUDE.md or a skill, explicitly ask that this agent or delegated work run at a specific effort level, never on your own judgment; otherwise omit it and the agent runs at its usual effort.","type":"string","enum":["low","medium","high","xhigh","max"]},"run_in_background":{"description":"Agents run in the background by default; you will be notified when one completes. Set to false only when your very next action depends on this agent's result and nothing else could usefully happen while it runs — otherwise leave it in the background so the user can hand you other work.","type":"boolean"},"isolation":{"description":"Isolation mode. \"worktree\" creates a temporary git worktree so the agent works on an isolated copy of the repo. \"remote\" launches the agent in a remote cloud environment (always runs in background; availability is gated).","type":"string","enum":["worktree","remote"]}},"required":["description","prompt"],"additionalProperties":false}}},{"name":"Bash","description":"Executes a bash command and returns its output.\n\n- Working directory persists between calls, but prefer absolute paths — `cd` in a compound command can trigger a permission prompt. Shell state (env vars, functions) does not persist; the shell is initialized from the user's profile.\n- IMPORTANT: Avoid using this tool to run `cat`, `head`, `tail`, `sed`, `awk`, or `echo` commands, unless explicitly instructed or after you have verified that a dedicated tool cannot accomplish your task. Instead, use the appropriate dedicated tool as this will provide a much better experience for the user.\n- Command output is displayed to you, not reliably to the user.\n- `timeout` is in milliseconds: default 120000, max 600000 for a foreground command.\n- `run_in_background` runs the command detached: it keeps running across turns and re-invokes you when it exits. With it, `timeout` is how long the command may run in the background (default 600000, max 7200000); at that limit it is stopped and you are re-invoked. No `&` needed.\n\n# Git\n- Interactive flags (`-i`, e.g. `git rebase -i`, `git add -i`) are not supported in this environment.\n- Use the `gh` CLI for GitHub operations (PRs, issues, API).\n- Commit or push only when the user asks. If on the default branch, branch first.\n- End git commit messages and PR bodies with the attribution lines given in the conversation's system-reminder, when one is present.","schema":{"name":"Bash","description":"Executes a bash command and returns its output.\n\n- Working directory persists between calls, but prefer absolute paths — `cd` in a compound command can trigger a permission prompt. Shell state (env vars, functions) does not persist; the shell is initialized from the user's profile.\n- IMPORTANT: Avoid using this tool to run `cat`, `head`, `tail`, `sed`, `awk`, or `echo` commands, unless explicitly instructed or after you have verified that a dedicated tool cannot accomplish your task. Instead, use the appropriate dedicated tool as this will provide a much better experience for the user.\n- Command output is displayed to you, not reliably to the user.\n- `timeout` is in milliseconds: default 120000, max 600000 for a foreground command.\n- `run_in_background` runs the command detached: it keeps running across turns and re-invokes you when it exits. With it, `timeout` is how long the command may run in the background (default 600000, max 7200000); at that limit it is stopped and you are re-invoked. No `&` needed.\n\n# Git\n- Interactive flags (`-i`, e.g. `git rebase -i`, `git add -i`) are not supported in this environment.\n- Use the `gh` CLI for GitHub operations (PRs, issues, API).\n- Commit or push only when the user asks. If on the default branch, branch first.\n- End git commit messages and PR bodies with the attribution lines given in the conversation's system-reminder, when one is present.","input_schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"command":{"description":"The command to execute","type":"string"},"timeout":{"description":"Optional timeout in milliseconds (max 600000 for a foreground command)","type":"number"},"description":{"description":"Clear, concise description of what this command does in active voice. Never use words like \"complex\" or \"risk\" in the description - just describe what it does.\n\nSay what the command does in plain words: do not echo the command's text, its flags, or file paths - the user reads this description, often without seeing the command.\n\nFor simple commands (git, npm, standard CLI tools), keep it brief (5-10 words):\n- ls → \"List files in current directory\"\n- git status → \"Show working tree status\"\n- npm install → \"Install package dependencies\"\n\nFor commands that are harder to parse at a glance (piped commands, obscure flags, etc.), add enough context to clarify what it does:\n- find . -name \"*.tmp\" -exec rm {} \\; → \"Find and delete all .tmp files recursively\"\n- git reset --hard origin/main → \"Discard all local changes and match remote main\"\n- curl -s url | jq '.data[]' → \"Fetch JSON from URL and extract data array elements\"","type":"string"},"run_in_background":{"description":"Set to true to run this command in the background. With it, `timeout` limits how long the command may run in the background before it is stopped (default 600000 ms, max 7200000 ms).","type":"boolean"},"dangerouslyDisableSandbox":{"description":"Set this to true to dangerously override sandbox mode and run commands without sandboxing.","type":"boolean"}},"required":["command"],"additionalProperties":false}}},{"name":"CronCreate","description":"Schedule a prompt to be enqueued at a future time. Use for both recurring schedules and one-shot reminders.\n\nUses standard 5-field cron in the user's local timezone: minute hour day-of-month month day-of-week. \"0 9 * * *\" means 9am local — no timezone conversion needed.\n\n## One-shot tasks (recurring: false)\n\nFor \"remind me at X\" or \"at