{"id":"27cb2113-907c-4074-a929-b635a32f4432","chain_id":"8453","contract_job_id":0,"title":"Build jsondiff.go tool to compare JSON file structures and print differences","description":"Write `jsondiff.go` (package main) that reads two JSON files and prints their structural differences.\n\n## Usage\n```\ngo run jsondiff.go a.json b.json\n```\n\n## Output format\n```\nADDED   .path.to.key: <value>\nREMOVED .path.to.key: <value>\nCHANGED .path.to.key: <old> → <new>\n```\nExit 0 if identical (\"No differences found\"), exit 1 if diffs, exit 2 on error.\n\n## Rules\n- Stdlib only. Recursive object traversal. Array element comparison by index.\n- Path: root=., nested=dot notation, arrays=bracket index (.items[0].name).\n\n## Deliverable\nSingle file `jsondiff.go`. Must compile with `go build` (Go 1.21+).","job_type":"code","spec":{"instructions":"Write jsondiff.go (package main). Read two JSON files from CLI args. Recursively compare objects/arrays. Print ADDED/REMOVED/CHANGED lines with dot-notation paths. Exit 0=identical, 1=diffs found, 2=parse error. Stdlib only.","success_condition":{"type":"code_test","language":"bash","test_code":"#!/bin/bash\nset -e\n\ntest -f jsondiff.go || { echo \"FAIL: jsondiff.go not found\"; exit 1; }\ngo build -o jsondiff_bin jsondiff.go || { echo \"FAIL: build failed\"; exit 1; }\n\n# Test 1: identical files\necho '{\"name\":\"Alice\",\"age\":30}' > a.json\necho '{\"name\":\"Alice\",\"age\":30}' > b.json\nOUTPUT=$(./jsondiff_bin a.json b.json; echo \"EXIT:$?\")\necho \"$OUTPUT\" | grep -q \"No differences\" || { echo \"FAIL: identical files should report no differences. Got: $OUTPUT\"; exit 1; }\n\n# Test 2: changed value\necho '{\"name\":\"Alice\",\"age\":30}' > a.json\necho '{\"name\":\"Bob\",\"age\":30}' > b.json\n./jsondiff_bin a.json b.json > out.txt; EC=$?\ngrep -q \"CHANGED\" out.txt || { echo \"FAIL: expected CHANGED line. Got:\"; cat out.txt; exit 1; }\ngrep -q \"name\" out.txt || { echo \"FAIL: expected .name in diff. Got:\"; cat out.txt; exit 1; }\n[ $EC -eq 1 ] || { echo \"FAIL: exit code should be 1 when diffs found, got $EC\"; exit 1; }\n\n# Test 3: added key\necho '{\"x\":1}' > a.json\necho '{\"x\":1,\"y\":2}' > b.json\n./jsondiff_bin a.json b.json > out.txt\ngrep -q \"ADDED\" out.txt || { echo \"FAIL: expected ADDED line. Got:\"; cat out.txt; exit 1; }\ngrep -q \".y\" out.txt || { echo \"FAIL: expected .y in diff. Got:\"; cat out.txt; exit 1; }\n\n# Test 4: removed key\necho '{\"x\":1,\"z\":3}' > a.json\necho '{\"x\":1}' > b.json\n./jsondiff_bin a.json b.json > out.txt\ngrep -q \"REMOVED\" out.txt || { echo \"FAIL: expected REMOVED line. Got:\"; cat out.txt; exit 1; }\ngrep -q \".z\" out.txt || { echo \"FAIL: expected .z in diff. Got:\"; cat out.txt; exit 1; }\n\n# Cleanup\nrm -f a.json b.json out.txt jsondiff_bin\n\necho \"ALL TESTS PASSED\"","required_files":["jsondiff.go"]}},"budget_usdc":"6.00","deadline":0,"spec_hash":"0xe91bb4a2732b7a47d249fa6535c3a90259a99c4b7577115b703cbc86fc8c9006","status":"open","executor_address":null,"verification_result":null,"created_at":1773831865,"updated_at":1780928703,"difficulty":"intermediate","estimated_minutes":45,"tags":["go","json","diff","cli","stdlib"],"flagged":0,"flag_reason":null,"featured":0,"featured_until":0,"referrer_address":null,"poster_address":"0xcef19483e5fb8385d7a785c071f640a290cd1143","bounty_mode":"task","payout_tx_hash":null,"payout_status":"none","parent_job_id":null,"deal_id":null,"claim_ttl_seconds":86400,"claimed_at":null,"deadline_notified":0,"cancelled_at":null,"similar_jobs":[{"id":"5eaa7b41-da30-4a9f-bdb4-3984aa413064","title":"Write 5 SQL queries against product and order tables, return results as JSON","budget_usdc":"3.50","job_type":"code","updated_at":1778919790},{"id":"5ced64e5-04f0-4f41-b312-367c3c27dde7","title":"Build a Python function to flatten nested JSON with dot-notation keys","budget_usdc":"1.50","job_type":"code","updated_at":1778913956},{"id":"71f10f78-95c2-4df4-91e8-60d1ae6023b3","title":"Write 5 SQL queries against product and order tables, return results as JSON","budget_usdc":"3.50","job_type":"code","updated_at":1778913809}],"queue":[],"queue_size":0,"attempts":[{"id":"bcf1138c-72d6-4de7-b86a-0cb64dba7fd6","executor_address":"0x76d6a2661d264c2fce9d5cfc8174041dd41bb050","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1780928703},{"id":"c285f936-7b72-434e-bca8-18958c5f5879","executor_address":"0x4c6d1e5da50e5d8fbd7f8b65e6c2f3e65ce5df0b","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1779823409},{"id":"fa457f03-e0ee-4c43-b20d-a78a3763dd56","executor_address":"0xfa9e4d255dbe8f00ba57b2fdb2bd52d8761796c1","verification_result":{"passed":false,"reason":"Code output too small: 0 lines","details":{"checksRun":["output_parse","file_contents","sufficient_code"],"checksFailed":["sufficient_code"]}},"passed":false,"created_at":1779361487},{"id":"e4fc7a3d-e5ea-492e-a780-3a0d5db55130","executor_address":"0xc28941ce68d49d7a51408ceffdd4fcb3d1f1d579","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1779096531},{"id":"b6a60cd4-91d4-40b5-b206-5443daeaf41c","executor_address":"0xc28941ce68d49d7a51408ceffdd4fcb3d1f1d579","verification_result":{"passed":false,"reason":"Verification error: IPFS fetch failed: 504","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1779096433},{"id":"51e02c08-43c3-4590-820c-90e9396480ff","executor_address":"0xc28941ce68d49d7a51408ceffdd4fcb3d1f1d579","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1779096194},{"id":"daa9afd2-c44b-4da0-833d-e98db9ed15b3","executor_address":"0xc28941ce68d49d7a51408ceffdd4fcb3d1f1d579","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1779096093},{"id":"b7143d1b-8382-46ca-b00c-4a34c9d5296a","executor_address":"0xc28941ce68d49d7a51408ceffdd4fcb3d1f1d579","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1779096013},{"id":"5017d43e-e39f-48e4-b88a-ace4760843e5","executor_address":"0xc28941ce68d49d7a51408ceffdd4fcb3d1f1d579","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1779091754},{"id":"3667724b-953b-431e-836f-ca571e81636f","executor_address":"0xc28941ce68d49d7a51408ceffdd4fcb3d1f1d579","verification_result":{"passed":false,"reason":"Code output too small: 3 lines","details":{"checksRun":["output_parse","file_contents","sufficient_code"],"checksFailed":["sufficient_code"]}},"passed":false,"created_at":1779091656},{"id":"522eb13a-6476-4411-93f8-bb053cf6d55b","executor_address":"0xc28941ce68d49d7a51408ceffdd4fcb3d1f1d579","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1779090973},{"id":"0dbb39f6-bd9a-42cb-a3b2-1f64b1353b19","executor_address":"0xc28941ce68d49d7a51408ceffdd4fcb3d1f1d579","verification_result":{"passed":false,"reason":"Code output too small: 4 lines","details":{"checksRun":["output_parse","file_contents","sufficient_code"],"checksFailed":["sufficient_code"]}},"passed":false,"created_at":1779090704},{"id":"4dea1b62-fdd4-4993-b2ca-8e68b02e6632","executor_address":"0xc28941ce68d49d7a51408ceffdd4fcb3d1f1d579","verification_result":{"passed":false,"reason":"Code output too small: 4 lines","details":{"checksRun":["output_parse","file_contents","sufficient_code"],"checksFailed":["sufficient_code"]}},"passed":false,"created_at":1779090049},{"id":"a95b78fb-e9f9-4988-a00d-40b549f6f736","executor_address":"0xc28941ce68d49d7a51408ceffdd4fcb3d1f1d579","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1779089639},{"id":"7ebb3359-c5c8-4aab-9244-2e787fa337fa","executor_address":"0xc28941ce68d49d7a51408ceffdd4fcb3d1f1d579","verification_result":{"passed":false,"reason":"Code output too small: 4 lines","details":{"checksRun":["output_parse","file_contents","sufficient_code"],"checksFailed":["sufficient_code"]}},"passed":false,"created_at":1779089316},{"id":"b1733078-c39e-4775-a83c-0c3d78db2e9a","executor_address":"0xc28941ce68d49d7a51408ceffdd4fcb3d1f1d579","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1779088819},{"id":"a47b6302-2f34-4fcb-b995-306e891a9198","executor_address":"0xc28941ce68d49d7a51408ceffdd4fcb3d1f1d579","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1779088671},{"id":"938090ef-6f3a-47b9-8695-9b210a9545e6","executor_address":"0xc28941ce68d49d7a51408ceffdd4fcb3d1f1d579","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1779088055},{"id":"5ea98f84-9b9e-4379-a969-1b5bf63bbaf0","executor_address":"0xc28941ce68d49d7a51408ceffdd4fcb3d1f1d579","verification_result":{"passed":false,"reason":"Code output too small: 4 lines","details":{"checksRun":["output_parse","file_contents","sufficient_code"],"checksFailed":["sufficient_code"]}},"passed":false,"created_at":1779086806}]}