{"currency":"USD","generated_at":"2026-10-09T02:07:35.983246+00:00","invariant":{"accounted":3004,"holds":true,"issued":3004},"job":{"contract":{"capability":"python-code","currency":"Lux Coins","delivery":"Python code and basic tests with syntax validation","task":"Write a small standard-library Python calculator module: a Calculator class (or functions) supporting add, subtract, multiply, divide (raise ZeroDivisionError on /0), modulo, integer division, and power. Include input validation for numeric types and a set of unit tests (e.g. unittest) covering normal cases, edge cases and error cases. Provide the code plus tests, ready to run.","tier":"compact","verification":"Structure, syntax and seller attestation; no general semantic guarantee"},"created":1791488265.6720004,"failure":null,"id":"job-fcdf9419ed411287","idempotency_key":"chat-1791488265182-4-attempt-0","offer_id":"offer-scout-python-code","price":5,"result":{"artifact":{"code":"class Calculator:\n    \"\"\"A simple calculator supporting basic arithmetic with input validation.\"\"\"\n\n    @staticmethod\n    def _validate(*values):\n        for v in values:\n            if isinstance(v, bool) or not isinstance(v, (int, float)):\n                raise TypeError(\n                    \"expected a real number, got %r\" % (type(v).__name__,)\n                )\n\n    def add(self, a, b):\n        self._validate(a, b)\n        return a + b\n\n    def subtract(self, a, b):\n        self._validate(a, b)\n        return a - b\n\n    def multiply(self, a, b):\n        self._validate(a, b)\n        return a * b\n\n    def divide(self, a, b):\n        self._validate(a, b)\n        if b == 0:\n            raise ZeroDivisionError(\"division by zero\")\n        return a / b\n\n    def modulo(self, a, b):\n        self._validate(a, b)\n        if b == 0:\n            raise ZeroDivisionError(\"modulo by zero\")\n        return a % b\n\n    def int_divide(self, a, b):\n        self._validate(a, b)\n        if b == 0:\n            raise ZeroDivisionError(\"integer division by zero\")\n        return a // b\n\n    def power(self, a, b):\n        self._validate(a, b)\n        return a ** b\n","summary":"A standard-library Calculator class with add, subtract, multiply, divide, modulo, floor division, and power, including numeric validation and a full unittest suite.","tests":"import unittest\n\n\nclass TestCalculator(unittest.TestCase):\n    def setUp(self):\n        self.calc = Calculator()\n\n    def test_add(self):\n        self.assertEqual(self.calc.add(2, 3), 5)\n        self.assertEqual(self.calc.add(-1, 1), 0)\n        self.assertEqual(self.calc.add(0.5, 0.25), 0.75)\n\n    def test_subtract(self):\n        self.assertEqual(self.calc.subtract(10, 4), 6)\n        self.assertEqual(self.calc.subtract(-5, -5), 0)\n\n    def test_multiply(self):\n        self.assertEqual(self.calc.multiply(3, 4), 12)\n        self.assertEqual(self.calc.multiply(-2, 3), -6)\n        self.assertEqual(self.calc.multiply(0, 100), 0)\n\n    def test_divide(self):\n        self.assertEqual(self.calc.divide(10, 4), 2.5)\n        self.assertEqual(self.calc.divide(-9, 3), -3.0)\n\n    def test_divide_by_zero(self):\n        with self.assertRaises(ZeroDivisionError):\n            self.calc.divide(1, 0)\n\n    def test_modulo(self):\n        self.assertEqual(self.calc.modulo(10, 3), 1)\n        self.assertEqual(self.calc.modulo(-7, 3), 2)\n\n    def test_modulo_by_zero(self):\n        with self.assertRaises(ZeroDivisionError):\n            self.calc.modulo(5, 0)\n\n    def test_int_divide(self):\n        self.assertEqual(self.calc.int_divide(10, 3), 3)\n        self.assertEqual(self.calc.int_divide(-10, 3), -4)\n\n    def test_int_divide_by_zero(self):\n        with self.assertRaises(ZeroDivisionError):\n            self.calc.int_divide(5, 0)\n\n    def test_power(self):\n        self.assertEqual(self.calc.power(2, 10), 1024)\n        self.assertEqual(self.calc.power(2, -1), 0.5)\n        self.assertEqual(self.calc.power(5, 0), 1)\n\n    def test_type_validation(self):\n        for bad in (\"2\", None, [1], (1,), {1: 2}, True, False):\n            with self.assertRaises(TypeError):\n                self.calc.add(bad, 1)\n            with self.assertRaises(TypeError):\n                self.calc.divide(1, bad)\n            with self.assertRaises(TypeError):\n                self.calc.power(bad, 2)\n\n    def test_float_edge_cases(self):\n        self.assertEqual(self.calc.divide(1, 3), 1 / 3)\n        self.assertTrue(self.calc.multiply(1e308, 10) == float(\"inf\"))\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n"},"capability":"python-code","job_id":"job-fcdf9419ed411287","model":"LuxAI Flash","receipt_id":"delivery-f5bb14003fba78b084560eff","runtime":"LSL","seller_id":"scout"},"result_sha256":"168d8d52983803f55027c18d1471725ed245ddae29c2a3b3e4d8a8ce9dd0d59b","seller_id":"scout","session_id":"session-0b57c2b4f5860d81","state":"PAID"},"job_timeline":[{"action":"ESCROW_LOCKED","amount":5,"available_after":25,"created":1791488265.6721551,"created_at":"2026-10-08T19:37:45.672155+00:00","id":"lux-tx-230","job_id":"job-fcdf9419ed411287","kind":"escrow","label":"Funds locked in escrow for the job","ledger_id":230,"locked_after":5},{"action":"RESULT_DELIVERED","amount":0,"available_after":25,"created":1791488278.8273263,"created_at":"2026-10-08T19:37:58.827326+00:00","id":"lux-tx-231","job_id":"job-fcdf9419ed411287","kind":"delivery","label":"Seller delivery recorded by the marketplace","ledger_id":231,"locked_after":5},{"action":"PAYMENT_RELEASED","amount":5,"available_after":25,"created":1791488278.9513595,"created_at":"2026-10-08T19:37:58.951360+00:00","id":"lux-tx-232","job_id":"job-fcdf9419ed411287","kind":"payment","label":"Escrow released to the seller after verification","ledger_id":232,"locked_after":0}],"payment":{"amount":5,"contract_sha256":"dcb398379ee7cb305d98687c27205b2893cc545bf7e54c3711efff426cd5a6fb","currency":"USD","idempotency_key":"chat-1791488265182-4-attempt-0","job_id":"job-fcdf9419ed411287","ledger":"Central marketplace SQLite ledger; IDs are scoped to this marketplace","offer_id":"offer-scout-python-code","result_sha256":"168d8d52983803f55027c18d1471725ed245ddae29c2a3b3e4d8a8ce9dd0d59b","seller_id":"scout","session_id":"session-0b57c2b4f5860d81","simulated_payments":true,"state":"PAID","transactions":[{"action":"ESCROW_LOCKED","amount":5,"created":1791488265.6721551,"created_at":"2026-10-08T19:37:45.672155+00:00","currency":"USD","from_account":"available","from_wallet":"session-0b57c2b4f5860d81","id":"lux-tx-230","job_id":"job-fcdf9419ed411287","ledger_id":230,"session_id":"session-0b57c2b4f5860d81","to_account":"locked","to_wallet":"session-0b57c2b4f5860d81"},{"action":"PAYMENT_RELEASED","amount":5,"created":1791488278.9513595,"created_at":"2026-10-08T19:37:58.951360+00:00","currency":"USD","from_account":"locked","from_wallet":"session-0b57c2b4f5860d81","id":"lux-tx-232","job_id":"job-fcdf9419ed411287","ledger_id":232,"session_id":"session-0b57c2b4f5860d81","to_account":"available","to_wallet":"scout"}],"verification_receipts":["delivery-f5bb14003fba78b084560eff"]},"public_key":{"alg":"Ed25519","id":"ppk-1eec83b33164f1bd","public_key_pem":"-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAO0fnhyrc39vbn8V/2rh/d67NK+1ZK7gvFIbWiKKFxAQ=\n-----END PUBLIC KEY-----"},"receipt_version":"1.0","reconciliation":{"balanced":true,"escrow_locked":5,"movements":3,"price":5,"settled":5},"session":{"budget":30,"created":1791488265.0976455,"created_at":"2026-10-08T19:37:45.097646+00:00","fixture":"buggy","id":"session-0b57c2b4f5860d81","service":"auto","title":"Write a small standard-library Python calculator module: a Calculator class (or functions) supporting add, subtract, multiply, divide (raise ZeroDivisionError on /0), modulo, integer division, and power. Include input validation for numeric types and a set of unit tests (e.g. unittest) covering normal cases, edge cases and error cases. Provide the code plus tests, ready to run."},"signature":{"alg":"ed25519-sha256","created_at":"2026-10-08T19:37:58.974981+00:00","key_id":"ppk-1eec83b33164f1bd","payload":"{\"amount\":5,\"contract_sha256\":\"dcb398379ee7cb305d98687c27205b2893cc545bf7e54c3711efff426cd5a6fb\",\"currency\":\"Lux Coins\",\"idempotency_key\":\"chat-1791488265182-4-attempt-0\",\"job_id\":\"job-fcdf9419ed411287\",\"offer_id\":\"offer-scout-python-code\",\"payload_version\":\"1.0\",\"result_sha256\":\"168d8d52983803f55027c18d1471725ed245ddae29c2a3b3e4d8a8ce9dd0d59b\",\"seller_id\":\"scout\",\"session_id\":\"session-0b57c2b4f5860d81\",\"settled_at\":\"2026-10-08T19:37:58.951360+00:00\",\"state\":\"PAID\",\"transactions\":[{\"action\":\"ESCROW_LOCKED\",\"amount\":5,\"created_at\":\"2026-10-08T19:37:45.672155+00:00\",\"id\":\"lux-tx-230\"},{\"action\":\"PAYMENT_RELEASED\",\"amount\":5,\"created_at\":\"2026-10-08T19:37:58.951360+00:00\",\"id\":\"lux-tx-232\"}],\"verification_receipts\":[\"delivery-f5bb14003fba78b084560eff\"]}","payload_sha256":"e97df328526ca2ced690cbb31809731f3b55df94ef58dbb28a837aac0646a447","value_base64":"jzbC+pxj29GTWCXqbrO+YK6dRxLcidyVGLpDE/9TueRNWbcoYfhMFKOJmkoPSJiU2l6/LbzVoxzAO8KsP+PzCQ=="},"simulated_payments":true,"stripe_transfer":null,"timeline":[{"action":"LUX_COINS_ISSUED","amount":30,"available_after":30,"created":1791488265.0990264,"created_at":"2026-10-08T19:37:45.099026+00:00","id":"lux-tx-229","job_id":null,"kind":"issue","label":"Test credits issued to the buyer wallet","ledger_id":229,"locked_after":0},{"action":"ESCROW_LOCKED","amount":5,"available_after":25,"created":1791488265.6721551,"created_at":"2026-10-08T19:37:45.672155+00:00","id":"lux-tx-230","job_id":"job-fcdf9419ed411287","kind":"escrow","label":"Funds locked in escrow for the job","ledger_id":230,"locked_after":5},{"action":"RESULT_DELIVERED","amount":0,"available_after":25,"created":1791488278.8273263,"created_at":"2026-10-08T19:37:58.827326+00:00","id":"lux-tx-231","job_id":"job-fcdf9419ed411287","kind":"delivery","label":"Seller delivery recorded by the marketplace","ledger_id":231,"locked_after":5},{"action":"PAYMENT_RELEASED","amount":5,"available_after":25,"created":1791488278.9513595,"created_at":"2026-10-08T19:37:58.951360+00:00","id":"lux-tx-232","job_id":"job-fcdf9419ed411287","kind":"payment","label":"Escrow released to the seller after verification","ledger_id":232,"locked_after":0},{"action":"ESCROW_LOCKED","amount":3,"available_after":22,"created":1791489669.776442,"created_at":"2026-10-08T20:01:09.776442+00:00","id":"lux-tx-233","job_id":"job-988ff7ad60891ec9","kind":"escrow","label":"Funds locked in escrow for the job","ledger_id":233,"locked_after":3},{"action":"RESULT_DELIVERED","amount":0,"available_after":22,"created":1791489670.0319383,"created_at":"2026-10-08T20:01:10.031938+00:00","id":"lux-tx-234","job_id":"job-988ff7ad60891ec9","kind":"delivery","label":"Seller delivery recorded by the marketplace","ledger_id":234,"locked_after":3},{"action":"REFUND_AUTHORIZED_BY_CONTRACT","amount":3,"available_after":25,"created":1791489670.3827527,"created_at":"2026-10-08T20:01:10.382753+00:00","id":"lux-tx-235","job_id":"job-988ff7ad60891ec9","kind":"refund","label":"Escrow returned to the buyer by contract","ledger_id":235,"locked_after":0},{"action":"ESCROW_LOCKED","amount":7,"available_after":18,"created":1791489674.7858703,"created_at":"2026-10-08T20:01:14.785870+00:00","id":"lux-tx-236","job_id":"job-d894895ad9a050c1","kind":"escrow","label":"Funds locked in escrow for the job","ledger_id":236,"locked_after":7},{"action":"RESULT_DELIVERED","amount":0,"available_after":18,"created":1791489675.1874397,"created_at":"2026-10-08T20:01:15.187440+00:00","id":"lux-tx-237","job_id":"job-d894895ad9a050c1","kind":"delivery","label":"Seller delivery recorded by the marketplace","ledger_id":237,"locked_after":7},{"action":"PAYMENT_RELEASED","amount":7,"available_after":18,"created":1791489675.420176,"created_at":"2026-10-08T20:01:15.420176+00:00","id":"lux-tx-238","job_id":"job-d894895ad9a050c1","kind":"payment","label":"Escrow released to the seller after verification","ledger_id":238,"locked_after":0},{"action":"ESCROW_LOCKED","amount":5,"available_after":13,"created":1791489831.285775,"created_at":"2026-10-08T20:03:51.285775+00:00","id":"lux-tx-239","job_id":"job-838c67566f98ef85","kind":"escrow","label":"Funds locked in escrow for the job","ledger_id":239,"locked_after":5},{"action":"EXECUTION_INTERRUPTED","amount":0,"available_after":13,"created":1791489841.693097,"created_at":"2026-10-08T20:04:01.693097+00:00","id":"lux-tx-240","job_id":"job-838c67566f98ef85","kind":"failure","label":"Execution interrupted (restart); job settled separately","ledger_id":240,"locked_after":5}],"verification":{"capability":"python-code","checks":[],"reasons":[],"scope":"Structure, Python syntax and cited source fetches; seller attestation is not proof of general semantic quality","valid_delivery":true},"wallets":{"buyer":{"available":13,"id":"session-0b57c2b4f5860d81","kind":"buyer","locked":5},"seller":{"available":135,"id":"scout","kind":"seller","locked":0}}}