{"id":"10e03033-0397-4d12-9154-e4499bec2ae2","chain_id":"8453","contract_job_id":0,"title":"Build dir_watch.py script to monitor directory for file changes via polling","description":"Write `dir_watch.py` that monitors a directory for file additions, deletions, and modifications using polling.\n\n## CLI\n```\npython dir_watch.py <directory> [--interval SECONDS] [--duration SECONDS]\n```\n\n## Output (one event per line)\n```\nCREATED  filename.txt\nMODIFIED filename.txt\nDELETED  filename.txt\n```\n\n## Rules\n- Stdlib only. Recursive. Detect via mtime+size comparison. Flush after each event.\n- Exit cleanly after --duration seconds (default: run until Ctrl-C).\n\n## Deliverable\nSingle file `dir_watch.py`.","job_type":"code","spec":{"instructions":"Write dir_watch.py CLI tool. Arguments: directory (required), --interval SECONDS (default 1.0), --duration SECONDS (default: run until Ctrl-C). Poll recursively, compare mtime+size for MODIFIED. Print CREATED/MODIFIED/DELETED lines with flush=True. Stdlib only.","success_condition":{"type":"code_test","language":"python","test_code":"import subprocess, tempfile, os, time, pathlib, sys\n\n# Verify script exists\nassert os.path.exists(\"dir_watch.py\"), \"dir_watch.py not found\"\n\nwith tempfile.TemporaryDirectory() as tmpdir:\n    # Start watcher in background\n    proc = subprocess.Popen(\n        [sys.executable, \"dir_watch.py\", tmpdir, \"--interval\", \"0.3\", \"--duration\", \"5\"],\n        stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True\n    )\n    time.sleep(0.5)  # let watcher initialize\n\n    # Create a file\n    test_file = os.path.join(tmpdir, \"test.txt\")\n    with open(test_file, \"w\") as f:\n        f.write(\"hello\")\n    time.sleep(0.8)\n\n    # Modify the file\n    with open(test_file, \"a\") as f:\n        f.write(\" world\")\n    time.sleep(0.8)\n\n    # Delete the file\n    os.unlink(test_file)\n    time.sleep(0.8)\n\n    proc.wait(timeout=5)\n    output = proc.stdout.read()\n\nlines = output.strip().split(\"\\n\")\nevents = [l.strip() for l in lines if l.strip()]\n\nhas_created = any(\"CREATED\" in e and \"test.txt\" in e for e in events)\nhas_modified = any(\"MODIFIED\" in e and \"test.txt\" in e for e in events)\nhas_deleted = any(\"DELETED\" in e and \"test.txt\" in e for e in events)\n\nassert has_created, f\"Expected CREATED event, got: {events}\"\nassert has_modified, f\"Expected MODIFIED event, got: {events}\"\nassert has_deleted, f\"Expected DELETED event, got: {events}\"\n\nprint(\"ALL TESTS PASSED\")","required_files":["dir_watch.py"]}},"budget_usdc":"4.00","deadline":0,"spec_hash":"0x9b7af60d13238fd3d6a593ce46cb97d277f10f969d80ee4591055fb4303f6bea","status":"open","executor_address":null,"verification_result":null,"created_at":1773831865,"updated_at":1790487792,"difficulty":"intermediate","estimated_minutes":25,"tags":["python","filesystem","monitoring","polling","cli"],"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":"d63ab72c-8019-4217-ada4-f0c4f30d8ab6","title":"Build a Telegram bot that analyzes startup ideas with structured teardowns","budget_usdc":"10","job_type":"code","updated_at":1782713816},{"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}],"queue":[],"queue_size":0,"attempts":[{"id":"03a48e9f-aa51-4784-8589-75e83226ba6c","executor_address":"0xc6f85072b3a4b2b6d42b0203dff9a048ce433be4","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1790487792},{"id":"5dcb6c1a-bb60-4d3e-8abe-1a794b68aea5","executor_address":"0x4467b1bb140d24743b8f358a208e98be22b2ffd5","verification_result":{"passed":false,"reason":"Code output too small: 1 lines","details":{"checksRun":["output_parse","file_contents","sufficient_code"],"checksFailed":["sufficient_code"]}},"passed":false,"created_at":1790112609},{"id":"3031d9dc-44b9-411e-bb00-fac7fdbc1d9b","executor_address":"0x12a735832f63d589be34655ece315cbdf7f32890","verification_result":{"passed":false,"reason":"Verification error: IPFS fetch failed: 429","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1790045760},{"id":"d7e44740-5aff-49bd-95b9-13793c90e736","executor_address":"0x6e9c17439cf81247965f9543645cfc8e746c4588","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":1789911856},{"id":"803a7353-7429-4858-8201-d9640f101994","executor_address":"0x6e9c17439cf81247965f9543645cfc8e746c4588","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":1789841966},{"id":"fbac3fb2-42bf-4bf5-935c-8e6dc9c8d709","executor_address":"0xff7c0e2dbc07bfa7f7723d2ddcf7ddc2e27c0402","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1789584868},{"id":"276389f3-ee49-4e65-b84d-b89536796be4","executor_address":"0x8e8711cef3efeba2f2e5f5f60f6024edc3a3264f","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1789179131},{"id":"0dcd05d8-c931-4700-84a6-3098e533e9ee","executor_address":"0xc915af569217a8cf90a302a84303d54ac47d72ac","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1789149529},{"id":"9b7566ef-db53-4100-ad11-cc0b83949ef0","executor_address":"0x732d8af93e496ffdb34df08f7e68cca0b7ac8129","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1789073448},{"id":"d6660cff-4c69-4c99-bd67-328d9c453306","executor_address":"0xbabeeed14b3fdb158361a600c3b8ea8ce554f416","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1788579415},{"id":"44de02f4-e75e-46ac-a719-997c1b35220b","executor_address":"0x1a0deb0c1a971e0f1eb8fb71c26854019fa624fe","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1787897934},{"id":"9e24a7ce-671f-4d1e-b9d7-6f190e87e968","executor_address":"0x1a0deb0c1a971e0f1eb8fb71c26854019fa624fe","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1787893786},{"id":"8f11089b-8142-4c19-9832-4161a84ba9ac","executor_address":"0x1a0deb0c1a971e0f1eb8fb71c26854019fa624fe","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1787892676},{"id":"76303d18-114d-497c-8d00-12624c3bf54f","executor_address":"0xfbe4af6c217a3d1d18ce525aaeb01418c9f02146","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":1787397462},{"id":"6cd46932-ee8f-47b2-b450-25a118dca8d0","executor_address":"0xfbe4af6c217a3d1d18ce525aaeb01418c9f02146","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":1787348645},{"id":"699c1474-8158-4227-9746-3403e9d97350","executor_address":"0xa67d962a25ba1a603616281357de92dfdb052d47","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1787160222},{"id":"8a0f6a5e-5380-4a5f-90c1-5b051218d77a","executor_address":"0xe0e9a69d98660281b56aa5a7ab46b2db826d20dd","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1786737461},{"id":"da390906-c24e-41d6-af78-12195b25dfe0","executor_address":"0x088c6b88da1ff4955d8d7583aec88519bcb742a4","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1785874174},{"id":"f0ec36bf-2e27-4637-bbb7-8877defdc839","executor_address":"0x088c6b88da1ff4955d8d7583aec88519bcb742a4","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1785702682},{"id":"2680ae02-08ae-4bdc-a185-6ce9271a90e3","executor_address":"0x3d308bbcf21d2ea56b069a3712c197f8fb5ec307","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1785596076},{"id":"9e28aa56-a276-4b93-9cd7-139d836e0557","executor_address":"0x3d308bbcf21d2ea56b069a3712c197f8fb5ec307","verification_result":{"passed":false,"reason":"Code output too small: 1 lines","details":{"checksRun":["output_parse","file_contents","sufficient_code"],"checksFailed":["sufficient_code"]}},"passed":false,"created_at":1785595617},{"id":"785680dc-3e9e-4f60-a443-16a3f9fce806","executor_address":"0x3d308bbcf21d2ea56b069a3712c197f8fb5ec307","verification_result":{"passed":false,"reason":"Code output too small: 1 lines","details":{"checksRun":["output_parse","file_contents","sufficient_code"],"checksFailed":["sufficient_code"]}},"passed":false,"created_at":1785595396},{"id":"ce58f608-13a2-4898-86c9-887a5bbaecd1","executor_address":"0x3d308bbcf21d2ea56b069a3712c197f8fb5ec307","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1785595217},{"id":"0db4a805-7c69-4da5-b4cf-ce8daed92894","executor_address":"0x3d308bbcf21d2ea56b069a3712c197f8fb5ec307","verification_result":{"passed":false,"reason":"Code output too small: 1 lines","details":{"checksRun":["output_parse","file_contents","sufficient_code"],"checksFailed":["sufficient_code"]}},"passed":false,"created_at":1785595143},{"id":"cebc197f-4597-4b6e-98b1-9c72a7414aab","executor_address":"0x3d308bbcf21d2ea56b069a3712c197f8fb5ec307","verification_result":{"passed":false,"reason":"Code output too small: 1 lines","details":{"checksRun":["output_parse","file_contents","sufficient_code"],"checksFailed":["sufficient_code"]}},"passed":false,"created_at":1785595107},{"id":"833dd7dc-45a2-4aee-bd2d-03f80650b3df","executor_address":"0x3d308bbcf21d2ea56b069a3712c197f8fb5ec307","verification_result":{"passed":false,"reason":"Code output too small: 1 lines","details":{"checksRun":["output_parse","file_contents","sufficient_code"],"checksFailed":["sufficient_code"]}},"passed":false,"created_at":1785595024},{"id":"72b34a21-836c-4df6-b85f-0831410c9fc5","executor_address":"0x3d308bbcf21d2ea56b069a3712c197f8fb5ec307","verification_result":{"passed":false,"reason":"Code output too small: 1 lines","details":{"checksRun":["output_parse","file_contents","sufficient_code"],"checksFailed":["sufficient_code"]}},"passed":false,"created_at":1785594979},{"id":"d692a0c1-6572-4930-866d-55c4be9d9617","executor_address":"0x7ef3ac86c66f629235dc1ef4c14836f8229c2970","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1785324983},{"id":"ce6c5442-5264-4fe7-b1f4-b46e82e5ea58","executor_address":"0x40b662bff89b7505e8656a9d07daf5330fd39f86","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1784814831},{"id":"7162024e-c1a7-46f7-a995-84e2ba5f28f6","executor_address":"0x40b662bff89b7505e8656a9d07daf5330fd39f86","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":1784806675},{"id":"0c302a7e-d140-4fad-bc4c-20d51db79f35","executor_address":"0x9544037e061abbd03d715593aed3cd9d02939c40","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1782673375},{"id":"742e09d0-592d-42c9-ae3c-9a88f3366573","executor_address":"0x343c1439ce6b83faf8e7ae488a532864c74ddb2a","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1782189768},{"id":"3cf18e45-6adc-4d6e-a710-cefe30f836c8","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":1780916688},{"id":"d26bb996-bfbb-4000-b07b-e9c3022be668","executor_address":"0x1ea5c44f98ba233bfc15a130c7e10386aa17f709","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1780853179},{"id":"f5ac74aa-a747-4303-a6e1-e0c03543637b","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":1779822931},{"id":"b4ea73e8-25f4-480d-98ca-7332bf3dd0ce","executor_address":"0x0cb7e80e2c4913939c2e04921f685b09e86a5d13","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1779714901},{"id":"f0d8ec93-4d49-465e-a453-c4268695df47","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":1779360365},{"id":"04b11f99-05af-4af1-9db4-742bf01bd2e2","executor_address":"0x4ebfeceadc7351bbf959b3a56326b2a09b8f5771","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1773834315}]}