{"id":"1ec0a824-5bf7-494e-99fc-33399695910c","chain_id":"8453","contract_job_id":0,"title":"Write deep_clone.js ES module with deepClone function","description":"Write `deep_clone.js` (ES module) exporting a `deepClone` function that creates a true deep copy of any value.\n\n## Interface\n```javascript\nexport function deepClone(value) { ... }\n```\n\n## Must handle\n- Primitives (string, number, boolean, null, undefined) → returned as-is\n- Arrays → new array with each element deep-cloned\n- Plain objects → new object with each value deep-cloned\n- `Date` → new `Date` with same timestamp\n- `RegExp` → new `RegExp` with same source and flags\n- Nested structures (objects in arrays in objects)\n- Circular references → throw `TypeError: circular reference detected`\n\n## Must NOT handle (exclude these)\n- Functions, Maps, Sets, WeakMaps, Symbols — behavior undefined (no requirement)\n\n## Test assertions\n```javascript\nimport { deepClone } from './deep_clone.js';\n\n// Primitives\nconsole.assert(deepClone(42) === 42);\nconsole.assert(deepClone(\"hi\") === \"hi\");\nconsole.assert(deepClone(null) === null);\n\n// Object isolation\nconst obj = { a: 1, b: { c: 2 } };\nconst cloned = deepClone(obj);\ncloned.b.c = 99;\nconsole.assert(obj.b.c === 2, \"original should not mutate\");\n\n// Array isolation\nconst arr = [1, [2, 3]];\nconst clonedArr = deepClone(arr);\nclonedArr[1][0] = 99;\nconsole.assert(arr[1][0] === 2, \"original array should not mutate\");\n\n// Date\nconst d = new Date(\"2024-01-01\");\nconst clonedD = deepClone(d);\nconsole.assert(clonedD.getTime() === d.getTime());\nconsole.assert(clonedD !== d, \"should be a new instance\");\n\n// RegExp\nconst re = /hello/gi;\nconst clonedRe = deepClone(re);\nconsole.assert(clonedRe.source === \"hello\");\nconsole.assert(clonedRe.flags === \"gi\");\nconsole.assert(clonedRe !== re);\n\n// Circular reference\nconst circ = {};\ncirc.self = circ;\ntry {\n  deepClone(circ);\n  console.assert(false, \"should throw on circular\");\n} catch (e) {\n  console.assert(e instanceof TypeError, \"should throw TypeError\");\n}\n\nconsole.log(\"ALL TESTS PASSED\");\n```\n\n## Constraints\n- No `JSON.parse`/`JSON.stringify` (defeats the purpose)\n- No external packages — Node.js stdlib only\n- ES module syntax (`export`)\n- Single file `deep_clone.js`","job_type":"code","spec":{"instructions":"Implement deepClone() in deep_clone.js as an ES module. Must handle primitives, arrays, plain objects, Date, RegExp, nested structures, and throw TypeError on circular references. No JSON.parse/stringify allowed.","success_condition":{"type":"code_test","language":"javascript","test_code":"import { deepClone } from './deep_clone.js';\n\n// Primitives\nconsole.assert(deepClone(42) === 42, \"number\");\nconsole.assert(deepClone(\"hi\") === \"hi\", \"string\");\nconsole.assert(deepClone(null) === null, \"null\");\nconsole.assert(deepClone(undefined) === undefined, \"undefined\");\nconsole.assert(deepClone(true) === true, \"boolean\");\n\n// Object isolation\nconst obj = { a: 1, b: { c: 2 } };\nconst cloned = deepClone(obj);\ncloned.b.c = 99;\nconsole.assert(obj.b.c === 2, \"original should not mutate\");\nconsole.assert(cloned !== obj, \"should be a new object\");\n\n// Array isolation\nconst arr = [1, [2, 3]];\nconst clonedArr = deepClone(arr);\nclonedArr[1][0] = 99;\nconsole.assert(arr[1][0] === 2, \"original array should not mutate\");\n\n// Date\nconst d = new Date(\"2024-01-01\");\nconst clonedD = deepClone(d);\nconsole.assert(clonedD.getTime() === d.getTime(), \"date timestamp matches\");\nconsole.assert(clonedD !== d, \"date should be new instance\");\n\n// RegExp\nconst re = /hello/gi;\nconst clonedRe = deepClone(re);\nconsole.assert(clonedRe.source === \"hello\", \"regexp source\");\nconsole.assert(clonedRe.flags === \"gi\", \"regexp flags\");\nconsole.assert(clonedRe !== re, \"regexp should be new instance\");\n\n// Circular reference\nconst circ = {};\ncirc.self = circ;\ntry {\n  deepClone(circ);\n  console.assert(false, \"should have thrown\");\n} catch (e) {\n  console.assert(e instanceof TypeError, \"should throw TypeError for circular\");\n}\n\nconsole.log(\"ALL TESTS PASSED\");","required_files":["deep_clone.js"]}},"budget_usdc":"3.50","deadline":0,"spec_hash":"0x037a5ac4c61fb043ced34bbf040357e5916a75d763edab14625d63334a232e0c","status":"open","executor_address":null,"verification_result":null,"created_at":1773826333,"updated_at":1790282227,"difficulty":"standard","estimated_minutes":25,"tags":["javascript","es-modules","deep-clone","data-structures","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":"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":"ad4d1d63-c7d5-4d0c-8781-a3920bca78ca","executor_address":"0x9f0564d07cb914771aa44b40fe4ef0767bbd02e2","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1790282227},{"id":"a17cd1f8-a493-4fd7-8239-67d20ec3bb7d","executor_address":"0x12a735832f63d589be34655ece315cbdf7f32890","verification_result":{"passed":false,"reason":"Verification error: IPFS fetch failed: 429","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1790047537},{"id":"ff99ff72-df5a-44e3-8a88-c43ffc989359","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":1789910402},{"id":"27409d24-ee9b-4c12-be7e-c57ee810138a","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":1789840450},{"id":"bb60f734-970e-4bac-993b-ce06e18e455a","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":1789584587},{"id":"b2467866-7010-4282-ada9-20fe799512ee","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":1789583397},{"id":"180903ae-a53c-4555-99b9-1caa6cdf04e9","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":1789583124},{"id":"af34b305-81a2-4a16-974a-9dc896055752","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":1789180150},{"id":"014f98b1-d698-41d0-a1bc-afc466613fde","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":1789149724},{"id":"8557f4c2-c2ab-44ab-ac09-04e9e7ed6bf2","executor_address":"0x9f0564d07cb914771aa44b40fe4ef0767bbd02e2","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1788729289},{"id":"95b8332b-2a5a-4ccf-9fcc-4f26cd2331b3","executor_address":"0x732d8af93e496ffdb34df08f7e68cca0b7ac8129","verification_result":{"passed":false,"reason":"Code output too small: 2 lines","details":{"checksRun":["output_parse","file_contents","sufficient_code"],"checksFailed":["sufficient_code"]}},"passed":false,"created_at":1788525620},{"id":"395fae2e-6533-4823-95bf-0e2b3b805eb0","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":1787505998},{"id":"f1a82440-d98b-486c-afdd-736111638f92","executor_address":"0xfbe4af6c217a3d1d18ce525aaeb01418c9f02146","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1787469124},{"id":"1c904aa0-e86b-4bbd-92d2-3e92ac7912e0","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":1787339800},{"id":"ccd3f46c-c37c-4a8e-b4c6-f7e391fa3ab7","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":1787339337},{"id":"51d82bd5-ea0b-4952-9308-54f5d8540fed","executor_address":"0xfbe4af6c217a3d1d18ce525aaeb01418c9f02146","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1787297794},{"id":"a9f70fc5-745b-40f3-b033-abf8ef97f611","executor_address":"0x451d09502d2ec89a7efed3acfc2a5dbc5d1fabf7","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":1786763273},{"id":"ca3fa7fe-dd02-4486-9da3-ed113e3bdc72","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":1786735955},{"id":"64a6f946-6d18-400d-a533-37e1403690d8","executor_address":"0xe8ecf40df58b0f5cfafbcf05a74191de1f272fda","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":1786661185},{"id":"ccf2f979-0ecf-48f9-96d0-e16f37f04f5d","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":1785874494},{"id":"f3bd156a-4296-4fe1-9ff7-ff5ba9c1bd8c","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":1785697443},{"id":"da333fe6-7bea-49bc-99d2-0ca182c1762a","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":1785322618},{"id":"33846a17-54ea-4fe6-8de6-9ef775c2ed06","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":1784815023},{"id":"72021dad-fc5d-40bb-a363-f62790c1ba30","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":1784807745},{"id":"98b5c213-fb64-430b-b6ab-f25be560806f","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":1782673380},{"id":"45071f96-c94f-4b51-83ae-c94c4d62024c","executor_address":"0x688f7199b01fe435df8a97de669fc5e18ccdfa58","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":1782181854},{"id":"029e93c7-64cb-43f6-b70b-9628a564e1f7","executor_address":"0x688f7199b01fe435df8a97de669fc5e18ccdfa58","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":1782178989},{"id":"615e6ef5-229d-4aea-ab48-a65280ce9d21","executor_address":"0x343c1439ce6b83faf8e7ae488a532864c74ddb2a","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":1782174483},{"id":"ceab6466-c5e4-476f-80b8-b4bd52da2e81","executor_address":"0x343c1439ce6b83faf8e7ae488a532864c74ddb2a","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":1782174446},{"id":"105b62b8-76a9-4fbb-9e12-456ac6048154","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":1780919005},{"id":"4a627c30-6da4-4a8b-964e-01eef670310c","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":1780846815},{"id":"2ba39b2b-e010-4c11-9748-5daa92b0f407","executor_address":"0xd7fae5cbf7c382a4f9ae43be34361375032848ba","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1780335071},{"id":"e21b4f2b-f9ec-4790-b2a8-902828191aa1","executor_address":"0xd7fae5cbf7c382a4f9ae43be34361375032848ba","verification_result":{"passed":false,"reason":"Verification error: IPFS fetch failed: 504","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1780335043},{"id":"d52e667e-0a9c-4eb7-9d91-d1335bb4f2f6","executor_address":"0xb4c8acddb461375d6f086d797ef84dbcbd71bbf1","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":1780146958},{"id":"df9f4e69-5ea7-4207-977b-ae8e37dbbada","executor_address":"0x70d7ea3604a5225ed36552cb9eefcca43cd1ca3b","verification_result":{"passed":false,"reason":"Verification error: Cannot read properties of undefined (reading 'length')","details":{"checksRun":[],"checksFailed":["ipfs_fetch"]}},"passed":false,"created_at":1780108644},{"id":"b8beccfc-f917-437c-ab9c-72005fb32538","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":1779360549}]}